/* 用户认证弹窗样式 */

/* 遮罩层 */
.auth-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-overlay.active {
    display: block;
    opacity: 1;
}

/* 弹窗容器 */
.auth-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    opacity: 0;
    transition: all 0.3s ease;
}

.auth-modal.active {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* 弹窗头部 */
.auth-modal-header {
    padding: 24px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
}

.auth-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.auth-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.auth-modal-close:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

/* 弹窗内容 */
.auth-modal-body {
    padding: 24px;
}

/* 表单样式 */
.auth-form {
    margin-top: 20px;
}

.auth-form-group {
    margin-bottom: 20px;
}

.auth-form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.auth-form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
    outline: none;
}

.auth-form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.auth-form-input.error {
    border-color: #ef4444;
}

/* 复选框样式 */
.auth-checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.auth-checkbox {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
}

.auth-checkbox-label {
    font-size: 14px;
    color: #6b7280;
    cursor: pointer;
}

/* 提交按钮 */
.auth-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 16px;
}

.auth-submit-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

.auth-submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* 分隔线 */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: #9ca3af;
    font-size: 14px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

.auth-divider span {
    padding: 0 12px;
}

/* 切换链接 */
.auth-switch-text {
    text-align: center;
    font-size: 14px;
    color: #6b7280;
    margin-top: 16px;
}

.auth-switch-link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
}

.auth-switch-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* 忘记密码链接 */
.auth-forgot-password {
    text-align: right;
    margin-top: -10px;
    margin-bottom: 20px;
}

.auth-forgot-password a {
    font-size: 13px;
    color: #3b82f6;
    text-decoration: none;
}

.auth-forgot-password a:hover {
    text-decoration: underline;
}

/* 错误消息 */
.auth-error-message {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    display: none;
}

.auth-error-message.show {
    display: block;
}

/* 成功消息 */
.auth-success-message {
    background-color: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #059669;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    display: none;
}

.auth-success-message.show {
    display: block;
}

/* 加载动画 */
.auth-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: auth-spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

/* 用户信息显示（登录后） */
.auth-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
}

.auth-user-details {
    flex: 1;
}

.auth-user-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 15px;
}

.auth-user-email {
    font-size: 13px;
    color: #6b7280;
}

.auth-logout-btn {
    padding: 8px 16px;
    background-color: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-logout-btn:hover {
    background-color: #dc2626;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .auth-modal {
        width: 95%;
        max-height: 95vh;
    }
    
    .auth-modal-header {
        padding: 20px 20px 0;
    }
    
    .auth-modal-body {
        padding: 20px;
    }
    
    .auth-modal-title {
        font-size: 20px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .auth-modal {
        background: #1f2937;
    }
    
    .auth-modal-header {
        border-bottom-color: #374151;
    }
    
    .auth-modal-title {
        color: #f9fafb;
    }
    
    .auth-modal-close {
        color: #9ca3af;
    }
    
    .auth-modal-close:hover {
        background-color: #374151;
        color: #f9fafb;
    }
    
    .auth-form-label {
        color: #d1d5db;
    }
    
    .auth-form-input {
        background-color: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .auth-form-input:focus {
        border-color: #3b82f6;
    }
    
    .auth-checkbox-label {
        color: #d1d5db;
    }
    
    .auth-switch-text {
        color: #d1d5db;
    }
    
    .auth-user-name {
        color: #f9fafb;
    }
    
    .auth-user-email {
        color: #9ca3af;
    }
}

/* 用户下拉菜单深色模式 */
@media (prefers-color-scheme: dark) {
    .gp-user-btn {
        background-color: rgba(102, 126, 234, 0.2);
        color: #a5b4fc;
        border-color: #667eea;
    }
    
    .gp-user-btn:hover,
    .gp-user-btn.active {
        background-color: #667eea;
        color: white;
    }
    
    .gp-user-menu {
        background: #1f2937;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    }
    
    .gp-user-menu-name {
        color: #f9fafb;
    }
    
    .gp-user-menu-email {
        color: #9ca3af;
    }
    
    .gp-user-menu-divider {
        background-color: #374151;
    }
    
    .gp-user-menu-item {
        color: #d1d5db;
    }
    
    .gp-user-menu-item i {
        color: #9ca3af;
    }
    
    .gp-user-menu-item:hover {
        background-color: #374151;
        color: #a5b4fc;
    }
    
    .gp-user-menu-item:hover i {
        color: #a5b4fc;
    }
    
    .gp-logout-item:hover {
        background-color: rgba(220, 38, 38, 0.2);
        color: #fca5a5;
    }
    
    .gp-logout-item:hover i {
        color: #fca5a5;
    }
}

/* 侧边栏认证区域深色模式 */
@media (prefers-color-scheme: dark) {
    .gp-sidebar-auth-divider {
        background: linear-gradient(to right, transparent, rgba(102, 126, 234, 0.5), transparent);
    }
    
    .gp-sidebar-auth-btn.auth-login-btn {
        color: #a5b4fc;
        border-color: #667eea;
    }
    
    .gp-sidebar-auth-btn.auth-login-btn:hover {
        background-color: #667eea;
        color: white;
    }
    
    .gp-sidebar-user-info {
        background: transparent;
    }
    
    .gp-sidebar-user-name {
        color: #ffffff;
    }
    
    .gp-sidebar-user-email {
        color: rgba(255, 255, 255, 0.7);
    }
    
    .gp-sidebar-menu-item {
        color: #ffffff;
    }
    
    .gp-sidebar-menu-item i {
        color: rgba(255, 255, 255, 0.8);
    }
    
    .gp-sidebar-menu-item:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }
    
    .gp-sidebar-menu-item:hover i {
        color: #ffffff;
    }
    
    .gp-sidebar-logout-item:hover {
        background-color: rgba(220, 38, 38, 0.3);
        color: #ffffff;
    }
    
    .gp-sidebar-logout-item:hover i {
        color: #ffffff;
    }
}
