/* 登录和注册页面通用优化样式 */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

/* 基础重置和优化 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
}

/* 登录注册容器通用样式 */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 500px;
    width: 100%;
    padding: 40px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15);
}

/* 品牌标识区域 */
.brand-section {
    text-align: center;
    margin-bottom: 30px;
}

.site-logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.site-description {
    color: var(--secondary-color);
    font-size: 1.1rem;
    opacity: 0.8;
}

/* 表单样式优化 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-color);
}

.form-control {
    width: 100%;
    border-radius: 8px;
    border: 2px solid #e9e9e9;
    padding: 12px 15px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

.form-control.error {
    border-color: var(--danger-color);
}

.form-control.success {
    border-color: var(--success-color);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: none;
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), #0056b3);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
    color: white;
}

.btn-success {
    background: linear-gradient(45deg, var(--success-color), #1e7e34);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
    color: white;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    color: white;
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 验证码区域 */
.code-section {
    display: flex;
    gap: 10px;
    align-items: center;
}

.code-section .form-control {
    flex: 1;
}

/* 链接区域 */
.links-section {
    text-align: center;
    margin-top: 20px;
}

.link {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.link:hover {
    color: var(--primary-color);
}

/* 版权信息 */
.copyright {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    text-align: center;
    z-index: 10;
}

/* 警告框优化 */
.alert {
    border-radius: 8px;
    border: none;
    padding: 15px 20px;
    margin-bottom: 20px;
    position: relative;
}

.alert-dismissible .close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式设计优化 */
@media (max-width: 768px) {
    .auth-container {
        padding: 10px;
    }
    
    .auth-card {
        padding: 30px 20px;
    }
    
    .site-logo {
        font-size: 2rem;
    }
    
    .code-section {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 20px 15px;
    }
    
    .site-logo {
        font-size: 1.8rem;
    }
    
    .copyright {
        position: relative;
        margin-top: 30px;
        color: var(--secondary-color);
    }
}

/* 表单验证提示样式 */
.validation-message {
    font-size: 0.875rem;
    margin-top: 5px;
}

.validation-error {
    color: var(--danger-color);
}

.validation-success {
    color: var(--success-color);
}

/* 极验验证码样式兼容修复 */
#geetest-container {
    min-height: 44px;
    overflow: visible;
}

/* 修复全局重置对极验组件的影响 */
#geetest-container .geetest_radar_tip,
#geetest-container .geetest_radar_tip_content {
    box-sizing: content-box;
}

.geetest_panel_ghost {
    z-index: 2147483647 !important;
}

.geetest_popup_wrap {
    z-index: 2147483648 !important;
}

/* 移动端极验适配 */
@media (max-width: 480px) {
    .geetest_popup_wrap {
        left: 0 !important;
        width: 100% !important;
    }
}

/* 协议勾选框（注册页） */
.agreement-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
}

.agreement-check input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.agreement-check label {
    cursor: pointer;
}

.agreement-check a {
    color: var(--primary-color);
    text-decoration: none;
}

.agreement-check a:hover {
    text-decoration: underline;
}

/* 协议提示文字（登录页） */
.agreement-hint {
    text-align: center;
    font-size: 0.85rem;
    color: #888;
    margin-top: 12px;
    line-height: 1.5;
}

.agreement-hint a {
    color: var(--primary-color);
    text-decoration: none;
}

.agreement-hint a:hover {
    text-decoration: underline;
}

/* 移动端协议区域适配 */
@media (max-width: 480px) {
    .agreement-check {
        font-size: 0.85rem;
    }
}

/* 防止触摸设备双击缩放 */
.agreement-check a {
    touch-action: manipulation;
}