/* 全局样式 */
body {
    background-color: #f8f9fa;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 表单容器 */
.form-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    width: 100%;
    max-width: 400px;
    transition: all 0.3s ease;
}

.form-container:hover {
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
}

/* 表单标题 */
.form-title {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-weight: 600;
}

/* 表单部分 */
.form-section {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 按钮样式 */
.btn-primary {
    width: 100%;
    padding: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

/* 表单切换链接 */
.toggle-form {
    text-align: center;
    margin-top: 20px;
}

.toggle-form a {
    color: #0d6efd;
    text-decoration: none;
    transition: color 0.2s ease;
}

.toggle-form a:hover {
    color: #0a58ca;
    text-decoration: underline;
}

/* 警告框样式 */
.alert {
    display: none;
    margin-bottom: 20px;
    border-radius: 8px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 100px; }
}

/* 用户信息样式 */
.user-info {
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #6c757d;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 30px;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* 卡密列表样式 */
.keys-section {
    animation: fadeIn 0.5s ease;
}

.keys-list {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 15px;
}

.key-item {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #0d6efd;
    transition: all 0.2s ease;
}

.key-item:hover {
    background-color: #e9ecef;
    transform: translateX(5px);
}

.key-value {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #495057;
    word-break: break-all;
}

.key-duration {
    font-size: 0.9em;
    color: #6c757d;
    margin-top: 5px;
}

.key-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
    margin-top: 5px;
}

.key-status.used {
    background-color: #f8d7da;
    color: #721c24;
}

.key-status.unused {
    background-color: #d1e7dd;
    color: #0f5132;
}

/* 加载覆盖层 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 响应式设计 */
@media (max-width: 576px) {
    .form-container {
        margin: 15px;
        padding: 20px;
    }
    
    .user-avatar {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
}

/* 输入框焦点效果 */
.form-control:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* 表单验证样式 */
.form-control.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
}