/* 认证相关样式 - 登录/注册界面 */

/* 用户信息显示区域 */
.user-info {
    display: none;
    align-items: center;
    gap: 12px;
    margin-left: 20px;
}

.user-info.logged-in {
    display: flex;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #434242;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.btn-logout {
    padding: 6px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 登录按钮 - Cursor Style (参考 openml.org 白色背景版本) */
.btn-login {
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a !important;
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    transition: background-color 0.2s ease, transform 0.1s ease;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
    margin-left: 0;
    line-height: normal;
}

.btn-login:hover {
    background-color: #f5f5f5 !important;
    color: #1a1a1a !important;
}

.btn-login:active {
    transform: scale(0.98);
}

/* 模态框背景 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 模态框容器 */
.auth-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 模态框头部 */
.modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* 模态框内容 */
.modal-body {
    padding: 24px;
}

/* 标签页切换 */
.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: 8px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.auth-tab.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 表单 */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

/* 提交按钮 */
.btn-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 错误提示 */
.error-message {
    display: none;
    padding: 12px 16px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    color: #c33;
    font-size: 14px;
    margin-bottom: 16px;
}

.error-message.show {
    display: block;
}

/* 成功提示 */
.success-message {
    display: none;
    padding: 12px 16px;
    background: #efe;
    border: 1px solid #cfc;
    border-radius: 8px;
    color: #3c3;
    font-size: 14px;
    margin-bottom: 16px;
}

.success-message.show {
    display: block;
}

/* 加载状态 */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .auth-modal {
        width: 95%;
        max-width: none;
    }
    
    .modal-header {
        padding: 20px 16px 12px;
    }
    
    .modal-body {
        padding: 20px 16px;
    }
    
    .modal-title {
        font-size: 20px;
    }

    .verification-input-wrapper {
        flex-direction: column;
        gap: 8px;
    }

    .btn-send-code {
        width: 100%;
    }
}

/* 验证码相关样式 */
.verification-group {
    margin-bottom: 20px;
}

.verification-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.verification-input-wrapper .form-input {
    flex: 1;
    margin-bottom: 0;
}

.btn-send-code {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 120px;
}

.btn-send-code:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-send-code:active:not(:disabled) {
    transform: translateY(0);
}

.btn-send-code:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-send-code.sending {
    background: #ffa500;
}

.btn-send-code.countdown {
    background: #999;
}

.verification-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

/* 忘记密码链接 */
.forgot-password-link {
    text-align: center;
    margin-top: 16px;
}

.forgot-password-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.forgot-password-link a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* 返回登录链接 */
.back-to-login-link {
    text-align: center;
    margin-top: 16px;
}

.back-to-login-link a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.back-to-login-link a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

    font-size: 14px;
    transition: all 0.2s;
}

.back-to-login-link a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}



    font-size: 14px;
    transition: all 0.2s;
}

.back-to-login-link a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

    font-size: 14px;
    transition: all 0.2s;
}

.back-to-login-link a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}


