/* SSO 认证页 — 专业级设计系统 */
/* 参考: Auth0 / Okta / Keycloak 最佳实践 */

/* ========== 设计变量 ========== */
:root {
    /* 品牌色 — 沉稳专业的深蓝紫 */
    --auth-primary: #4f46e5;
    --auth-primary-hover: #4338ca;
    --auth-primary-light: #eef2ff;
    --auth-gradient-start: #4f46e5;
    --auth-gradient-end: #7c3aed;

    /* 文字 */
    --auth-text-primary: #111827;
    --auth-text-secondary: #374151;
    --auth-text-muted: #6b7280;
    --auth-text-light: #9ca3af;

    /* 背景 */
    --auth-bg-page: #f5f3ff;
    --auth-bg-card: #ffffff;
    --auth-bg-muted: #f9fafb;
    --auth-bg-subtle: #f3f4f6;

    /* 页面背景装饰 — 声波纹理 + 光晕 */
    --auth-bg-gradient: linear-gradient(135deg, #e8e0ff 0%, #d4ccff 35%, #e0d6ff 65%, #eee8ff 100%);
    --auth-glow-1: rgba(79, 70, 229, 0.15);
    --auth-glow-2: rgba(124, 58, 237, 0.1);
    --auth-glow-accent: rgba(124, 58, 237, 0.08);
    --auth-wave-color: rgba(79, 70, 229, 0.07);
    --auth-card-glass: rgba(255, 255, 255, 0.95);
    --auth-card-glass-border: rgba(200, 200, 220, 0.5);

    /* 边框 */
    --auth-border: #e5e7eb;
    --auth-border-input: #d1d5db;
    --auth-border-focus: #4f46e5;

    /* 反馈色 */
    --auth-error-bg: #fef2f2;
    --auth-error-border: #fecaca;
    --auth-error-text: #dc2626;
    --auth-success-bg: #f0fdf4;
    --auth-success-border: #bbf7d0;
    --auth-success-text: #16a34a;
    --auth-danger: #ef4444;

    /* 阴影 */
    --auth-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --auth-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --auth-shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --auth-shadow-xl: 0 20px 50px -12px rgba(0, 0, 0, 0.12);
    --auth-focus-ring: 0 0 0 3px rgba(79, 70, 229, 0.18);

    /* 圆角 */
    --auth-radius-sm: 6px;
    --auth-radius: 8px;
    --auth-radius-lg: 12px;
    --auth-radius-xl: 16px;
}

/* ========== 暗色主题 ========== */
[data-theme="dark"] {
    --auth-primary: #818cf8;
    --auth-primary-hover: #a5b4fc;
    --auth-primary-light: #1e1b4b;
    --auth-gradient-start: #6366f1;
    --auth-gradient-end: #8b5cf6;

    --auth-text-primary: #f3f4f6;
    --auth-text-secondary: #d1d5db;
    --auth-text-muted: #9ca3af;
    --auth-text-light: #6b7280;

    --auth-bg-page: #0c1222;
    --auth-bg-card: #1e293b;
    --auth-bg-muted: #1e293b;
    --auth-bg-subtle: #334155;

    /* 页面背景装饰 — 暗色适配 */
    --auth-bg-gradient: linear-gradient(135deg, #0c1222 0%, #1a1340 35%, #15132a 65%, #0f172a 100%);
    --auth-glow-1: rgba(129, 140, 248, 0.12);
    --auth-glow-2: rgba(139, 92, 246, 0.08);
    --auth-glow-accent: rgba(139, 92, 246, 0.06);
    --auth-wave-color: rgba(129, 140, 248, 0.07);
    --auth-card-glass: rgba(30, 41, 59, 0.92);
    --auth-card-glass-border: rgba(51, 65, 85, 0.6);

    --auth-border: #334155;
    --auth-border-input: #475569;
    --auth-border-focus: #818cf8;

    --auth-error-bg: #450a0a;
    --auth-error-border: #7f1d1d;
    --auth-error-text: #fca5a5;
    --auth-success-bg: #052e16;
    --auth-success-border: #166534;
    --auth-success-text: #86efac;
    --auth-danger: #f87171;

    --auth-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --auth-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --auth-shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.5);
    --auth-shadow-xl: 0 20px 50px -12px rgba(0, 0, 0, 0.6);
    --auth-focus-ring: 0 0 0 3px rgba(129, 140, 248, 0.25);
}

/* 暗色主题卡片阴影加深 */
[data-theme="dark"] .auth-card,
[data-theme="dark"] .profile-container {
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 8px 24px rgba(0, 0, 0, 0.3),
        0 2px 6px rgba(0, 0, 0, 0.2);
}

/* 暗色主题侧边导航/选项卡 */
[data-theme="dark"] .sidebar-item:hover,
[data-theme="dark"] .mobile-tab:hover {
    background: rgba(129, 140, 248, 0.08);
}

[data-theme="dark"] .sidebar-item.active {
    background: rgba(129, 140, 248, 0.1);
    border-left-color: var(--auth-primary);
}

[data-theme="dark"] .mobile-tab.active {
    border-bottom-color: var(--auth-primary);
}

/* 暗色主题安全项 hover */
[data-theme="dark"] .security-item:hover {
    background: rgba(129, 140, 248, 0.04);
}

/* 暗色主题安全项图标背景 */
[data-theme="dark"] .security-item-icon {
    background: rgba(129, 140, 248, 0.1);
    color: var(--auth-primary);
}

/* 暗色主题会话卡片 hover */
[data-theme="dark"] .session-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border-color: rgba(129, 140, 248, 0.2);
}

/* 暗色主题登录历史表格交替色 */
[data-theme="dark"] .login-history-table tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .login-history-table th {
    background: rgba(129, 140, 248, 0.06);
    border-bottom-color: rgba(129, 140, 248, 0.15);
}

/* 暗色主题 outline-secondary 按钮增强可见度 */
[data-theme="dark"] .btn-outline-secondary.btn-sm {
    border-color: rgba(209, 213, 219, 0.3);
    color: var(--auth-text-secondary);
}

[data-theme="dark"] .btn-outline-secondary.btn-sm:hover {
    border-color: rgba(209, 213, 219, 0.5);
    background: rgba(255, 255, 255, 0.06);
}

/* 暗色主题授权确认列表 hover */
[data-theme="dark"] .consent-scope-list li:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* ========== Reset & Base ========== */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
    color: var(--auth-text-primary);
}

/* ========== 页面容器 ========== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at 15% 85%, var(--auth-glow-1) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 15%, var(--auth-glow-2) 0%, transparent 50%),
        var(--auth-bg-gradient);
    position: relative;
    overflow: hidden;
}

/* 声波容器 */
.auth-waves {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

/* 动态声波涟漪 — 从左下「声源」向外扩散 */
.wave-ring {
    position: absolute;
    left: 10%;
    bottom: 10%;
    width: 140vmax;
    height: 140vmax;
    margin-left: -70vmax;
    margin-bottom: -70vmax;
    border: 2px solid var(--auth-wave-color);
    border-radius: 50%;
    transform: scale(0);
    opacity: 0;
    will-change: transform, opacity;
    animation: wave-pulse 12s cubic-bezier(0.2, 0.6, 0.3, 1) infinite;
}

.wave-ring:nth-child(1) { animation-delay: 0s; }
.wave-ring:nth-child(2) { animation-delay: 2.4s; }
.wave-ring:nth-child(3) { animation-delay: 4.8s; }
.wave-ring:nth-child(4) { animation-delay: 7.2s; }
.wave-ring:nth-child(5) { animation-delay: 9.6s; }

@keyframes wave-pulse {
    0% {
        transform: scale(0.03);
        opacity: 0;
    }
    5% {
        opacity: 0.25;
    }
    60% {
        opacity: 0.08;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* 装饰光晕 — 右上角柔和渐变，平衡视觉重心 */
.auth-wrapper::after {
    content: "";
    position: absolute;
    top: -20%;
    right: -10%;
    width: 50%;
    height: 70%;
    background: radial-gradient(circle, var(--auth-glow-accent) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* 减少运动偏好 — 禁用波纹动画 */
@media (prefers-reduced-motion: reduce) {
    .wave-ring {
        animation: none;
        transform: scale(0.3);
        opacity: 0.06;
    }
    .wave-ring:nth-child(2) { transform: scale(0.5); opacity: 0.05; }
    .wave-ring:nth-child(3) { transform: scale(0.7); opacity: 0.04; }
    .wave-ring:nth-child(4) { transform: scale(0.85); opacity: 0.03; }
    .wave-ring:nth-child(5) { transform: scale(1); opacity: 0.02; }
}

/* ========== 认证卡片（毛玻璃） ========== */
.auth-card {
    position: relative;
    z-index: 1;
    background: var(--auth-card-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--auth-card-glass-border);
    border-radius: var(--auth-radius-xl);
    box-shadow:
        0 20px 60px rgba(79, 70, 229, 0.1),
        0 8px 24px rgba(0, 0, 0, 0.06),
        0 2px 6px rgba(0, 0, 0, 0.03);
    padding: 44px;
    width: 100%;
    max-width: 420px;
    margin: 24px;
}

/* ========== 页头: 品牌 + 标题 ========== */
.auth-header {
    margin-bottom: 32px;
}

.auth-header-top {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 24px;
}

.auth-brand {
    text-align: center;
}

.auth-logo {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    display: block;
    border-radius: var(--auth-radius-lg);
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.3), 0 2px 6px rgba(79, 70, 229, 0.15);
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--auth-text-primary);
    margin: 0 0 8px;
    letter-spacing: -0.4px;
    line-height: 1.2;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--auth-text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* ========== 表单 ========== */
.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form .form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.auth-form .form-control {
    width: 100%;
    height: 46px;
    border-radius: var(--auth-radius);
    border: 1.5px solid var(--auth-border-input);
    font-size: 14px;
    padding: 0 14px;
    color: var(--auth-text-primary);
    background: var(--auth-bg-card);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
    line-height: 46px;
}

.auth-form .form-control::placeholder {
    color: var(--auth-text-light);
}

.auth-form .form-control:hover {
    border-color: var(--auth-text-light);
}

.auth-form .form-control:focus {
    border-color: var(--auth-border-focus);
    box-shadow: var(--auth-focus-ring);
}

/* 主按钮 — 渐变 + 高级 hover */
.auth-form .btn-primary {
    width: 100%;
    height: 46px;
    border-radius: var(--auth-radius);
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-gradient-start), var(--auth-gradient-end));
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

.auth-form .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35);
    filter: brightness(1.05);
}

.auth-form .btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

/* ========== 记住我 + 忘记密码 ========== */
.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check-input {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1.5px solid var(--auth-border-input);
    cursor: pointer;
    accent-color: var(--auth-primary);
}

.form-check-label {
    font-size: 13px;
    color: var(--auth-text-secondary);
    cursor: pointer;
    user-select: none;
}

.auth-link {
    font-size: 13px;
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.auth-link:hover {
    color: var(--auth-primary-hover);
    text-decoration: underline;
}

/* ========== 错误消息 ========== */
.auth-error {
    background: var(--auth-error-bg);
    border: 1px solid var(--auth-error-border);
    border-radius: var(--auth-radius);
    padding: 12px 16px;
    margin-bottom: 20px;
    color: var(--auth-error-text);
    font-size: 13px;
    line-height: 1.5;
}

.auth-error div + div {
    margin-top: 4px;
}

/* ========== 分割线 ========== */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
    gap: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}

.auth-divider span {
    font-size: 12px;
    color: var(--auth-text-muted);
    white-space: nowrap;
    letter-spacing: 0.02em;
    font-weight: 500;
}

/* ========== 社交 / Passkey 按钮（统一风格: 灰边框） ========== */
.auth-alt-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 46px;
    border-radius: var(--auth-radius);
    border: 1.5px solid var(--auth-border-input);
    background: var(--auth-bg-card);
    color: var(--auth-text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s, transform 0.1s;
    text-decoration: none;
}

.auth-alt-btn:hover {
    border-color: var(--auth-text-muted);
    background: var(--auth-bg-muted);
    color: var(--auth-text-primary);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.auth-alt-btn + .auth-alt-btn {
    margin-top: 10px;
}

.auth-alt-btn svg,
.auth-alt-btn .btn-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* 社交按钮品牌色变体 */
.auth-alt-btn.btn-github {
    background: #24292f;
    border-color: #24292f;
    color: #fff;
}
.auth-alt-btn.btn-github:hover {
    background: #32383f;
    border-color: #32383f;
    color: #fff;
}

.auth-alt-btn.btn-weixin {
    background: #07c160;
    border-color: #07c160;
    color: #fff;
}
.auth-alt-btn.btn-weixin:hover {
    background: #06ae56;
    border-color: #06ae56;
    color: #fff;
}

.auth-alt-btn.btn-workweixin {
    background: #2B7CE9;
    border-color: #2B7CE9;
    color: #fff;
}
.auth-alt-btn.btn-workweixin:hover {
    background: #2468cc;
    border-color: #2468cc;
    color: #fff;
}

.auth-alt-btn.btn-dingtalk {
    background: #0089FF;
    border-color: #0089FF;
    color: #fff;
}
.auth-alt-btn.btn-dingtalk:hover {
    background: #007ae6;
    border-color: #007ae6;
    color: #fff;
}

/* ========== 页脚链接 ========== */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--auth-text-muted);
}

.auth-footer a {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ========== 语言 / 主题切换器 ========== */
.auth-toolbar {
    display: flex;
    gap: 6px;
    align-items: center;
}

.auth-toolbar a,
.auth-toolbar button {
    font-size: 12px;
    color: var(--auth-text-light);
    text-decoration: none;
    background: none;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    padding: 4px 10px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background-color 0.15s;
    line-height: 1.4;
}

.auth-toolbar a:hover,
.auth-toolbar button:hover {
    color: var(--auth-primary);
    border-color: var(--auth-primary);
    background: var(--auth-primary-light);
}

/* ========== 锁定页 ========== */
.lockout-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.lockout-message {
    text-align: center;
    padding: 20px 0;
}

.lockout-message h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--auth-text-primary);
    margin-bottom: 10px;
}

.lockout-message p {
    font-size: 14px;
    color: var(--auth-text-muted);
    line-height: 1.6;
}

/* ========== Consent 授权确认 ========== */
.consent-header {
    text-align: center;
    margin-bottom: 24px;
}

.consent-icon {
    margin-bottom: 16px;
}

.consent-scopes {
    margin-bottom: 24px;
}

.consent-scopes-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-text-secondary);
    margin-bottom: 12px;
}

.consent-scope-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.consent-scope-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--auth-bg-muted);
    border-radius: var(--auth-radius);
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--auth-text-primary);
    border: 1px solid var(--auth-border);
    transition: background-color 0.15s;
}

.consent-scope-list li:hover {
    background: var(--auth-bg-subtle);
}

.consent-scope-list li svg {
    color: var(--auth-primary);
    flex-shrink: 0;
}

.consent-actions {
    margin-top: 16px;
}

.btn-outline-secondary {
    width: 100%;
    height: 44px;
    border-radius: var(--auth-radius);
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--auth-border-input);
    color: var(--auth-text-secondary);
    background: var(--auth-bg-card);
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.btn-outline-secondary:hover {
    background: var(--auth-bg-muted);
    border-color: var(--auth-text-light);
}

/* ========== 按钮基类 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--auth-radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
    padding: 10px 18px;
}

.btn-sm {
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
}

.btn-primary {
    color: #fff;
    background: var(--auth-primary);
    border-color: var(--auth-primary);
}

.btn-primary:hover {
    background: var(--auth-primary-hover);
    border-color: var(--auth-primary-hover);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.btn-outline-danger {
    color: var(--auth-danger);
    background: transparent;
    border-color: var(--auth-danger);
}

.btn-outline-danger:hover {
    color: #fff;
    background: var(--auth-danger);
    border-color: var(--auth-danger);
}

/* 柔和危险按钮 — 淡红背景 + 红色文字 */
.btn-danger-subtle {
    color: var(--auth-danger);
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
}

.btn-danger-subtle:hover {
    color: #fff;
    background: var(--auth-danger);
    border-color: var(--auth-danger);
}

[data-theme="dark"] .btn-danger-subtle {
    color: #fca5a5;
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.25);
}

[data-theme="dark"] .btn-danger-subtle:hover {
    color: #fff;
    background: #ef4444;
    border-color: #ef4444;
}

/* ========== 模态框 ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-card {
    background: var(--auth-bg-card);
    border-radius: var(--auth-radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--auth-shadow-xl);
    border: 1px solid var(--auth-border);
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--auth-text-primary);
    margin: 0 0 8px;
}

.modal-desc {
    font-size: 13px;
    color: var(--auth-text-muted);
    margin: 0 0 16px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

/* ========== MFA 两步验证 ========== */
.mfa-step {
    font-size: 14px;
    color: var(--auth-text-muted);
    margin-bottom: 20px;
    line-height: 1.6;
}

.qr-code-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 8px;
}

.qr-code-img {
    width: 168px;
    height: 168px;
    border-radius: var(--auth-radius);
    display: block;
}

.manual-key {
    text-align: center;
    margin-bottom: 24px;
}

.manual-key-label {
    font-size: 13px;
    color: var(--auth-text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
    font-weight: 600;
}

.manual-key-value {
    font-size: 14px;
    padding: 10px 14px;
    background: var(--auth-bg-subtle);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    letter-spacing: 2px;
    word-break: break-all;
    color: var(--auth-text-primary);
    font-family: "SF Mono", "Cascadia Code", "Fira Code", monospace;
}

.recovery-codes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 16px 0;
}

.recovery-codes code {
    padding: 10px;
    background: var(--auth-bg-subtle);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    text-align: center;
    font-size: 13px;
    font-family: "SF Mono", "Cascadia Code", monospace;
    color: var(--auth-text-primary);
    letter-spacing: 1px;
}

.mfa-success {
    text-align: center;
}

.mfa-success h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--auth-text-primary);
    margin-bottom: 8px;
}

.mfa-success p {
    font-size: 14px;
    color: var(--auth-text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

.mfa-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.mfa-icon-svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    color: var(--auth-primary);
}

.mfa-icon-svg--success {
    color: #16a34a;
}

.mfa-icon-svg--warning {
    color: #ea580c;
}

.recovery-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 16px 0;
}

.recovery-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.btn-copied {
    color: #16a34a !important;
    border-color: #16a34a !important;
}

.mfa-resend-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--auth-text-muted);
    text-decoration: none;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    transition: color 0.2s;
}

.mfa-resend-btn:not(:disabled):hover {
    color: var(--auth-primary);
}

.mfa-resend-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.mfa-link {
    text-align: center;
    margin-top: 16px;
}

.mfa-link a {
    font-size: 13px;
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 500;
}

.mfa-link a:hover {
    text-decoration: underline;
}

/* ========== MFA 步骤指示器 ========== */
.mfa-steps {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-bottom: 16px;
    gap: 0;
}

.mfa-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.mfa-step-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid var(--auth-border);
    color: var(--auth-text-light);
    background: var(--auth-bg-card);
    transition: all 0.2s ease;
}

.mfa-step-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--auth-text-light);
    letter-spacing: 0.02em;
    transition: color 0.2s ease;
}

/* 当前步骤 */
.mfa-step-item.active .mfa-step-circle {
    border-color: var(--auth-primary);
    background: var(--auth-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.mfa-step-item.active .mfa-step-label {
    color: var(--auth-primary);
}

/* 已完成步骤 */
.mfa-step-item.completed .mfa-step-circle {
    border-color: var(--auth-success-text);
    background: var(--auth-success-text);
    color: #fff;
}

.mfa-step-item.completed .mfa-step-label {
    color: var(--auth-success-text);
}

/* 步骤连接线 */
.mfa-step-connector {
    flex: 1;
    height: 2px;
    background: var(--auth-border);
    min-width: 40px;
    max-width: 60px;
    margin: 0 8px;
    margin-top: 14px; /* 对齐圆圈中心 */
    border-radius: 1px;
    transition: background-color 0.2s ease;
}

.mfa-step-connector.completed {
    background: var(--auth-success-text);
}

/* ========== QR 码精致容器 ========== */
.qr-code-frame {
    display: inline-block;
    padding: 12px;
    background: #fff;
    border-radius: var(--auth-radius-lg);
    box-shadow:
        0 2px 12px rgba(0, 0, 0, 0.08),
        inset 0 0 0 1px rgba(0, 0, 0, 0.06);
    position: relative;
}

/* 品牌色装饰线（顶部） */
.qr-code-frame::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(135deg, var(--auth-gradient-start), var(--auth-gradient-end));
    border-radius: 0 0 2px 2px;
}

/* ========== 手动密钥折叠 ========== */
.manual-key-details {
    margin: 10px 0 0;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    overflow: hidden;
}

.manual-key-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--auth-text-muted);
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: color 0.15s, background-color 0.15s;
}

.manual-key-toggle::-webkit-details-marker {
    display: none;
}

/* 自定义展开箭头 */
.manual-key-toggle::after {
    content: "";
    margin-left: auto;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--auth-text-light);
    transition: transform 0.2s ease;
}

.manual-key-details[open] .manual-key-toggle::after {
    transform: rotate(180deg);
}

.manual-key-toggle:hover {
    color: var(--auth-primary);
    background: var(--auth-bg-muted);
}

.manual-key-toggle svg {
    color: var(--auth-text-light);
    flex-shrink: 0;
}

.manual-key-content {
    padding: 0 16px 16px;
    border-top: 1px solid var(--auth-border);
}

.manual-key-hint {
    font-size: 12px;
    color: var(--auth-text-muted);
    margin: 12px 0 10px;
    line-height: 1.5;
}

/* ========== QR 码提示文字 ========== */
.qr-code-hint {
    font-size: 11px;
    color: var(--auth-text-light);
    margin: 8px 0 0;
    line-height: 1.4;
    text-align: center;
    max-width: 240px;
    margin-left: auto;
    margin-right: auto;
}

/* ========== 步骤描述文本（备用） ========== */
.mfa-step-desc {
    font-size: 12px;
    color: var(--auth-text-light);
    margin-bottom: 24px;
    line-height: 1.5;
    text-align: center;
}

/* ========== OTP 分段验证码输入 ========== */
.otp-input-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.otp-cell {
    width: 44px;
    height: 48px;
    border: 2px solid var(--auth-border-input);
    border-radius: var(--auth-radius);
    background: var(--auth-bg-card);
    color: var(--auth-text-primary);
    font-size: 22px;
    font-weight: 700;
    font-family: "SF Mono", "Cascadia Code", "Fira Code", ui-monospace, monospace;
    text-align: center;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    caret-color: var(--auth-primary);
}

.otp-cell:focus {
    border-color: var(--auth-primary);
    box-shadow: var(--auth-focus-ring);
    transform: translateY(-1px);
}

.otp-cell:not(:placeholder-shown) {
    border-color: var(--auth-primary);
    background: var(--auth-primary-light);
}

.otp-separator {
    width: 12px;
    height: 3px;
    background: var(--auth-border-input);
    border-radius: 2px;
    flex-shrink: 0;
}

/* OTP 填满后按钮亮起 */
.otp-ready {
    background: linear-gradient(135deg, var(--auth-gradient-start), var(--auth-gradient-end)) !important;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35) !important;
    transform: translateY(-1px);
}

/* ========== 手动密钥 — chip 网格 ========== */
.manual-key-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.manual-key-chip {
    display: inline-block;
    padding: 4px 8px;
    background: var(--auth-bg-subtle);
    border: 1px solid var(--auth-border);
    border-radius: 4px;
    font-size: 12px;
    font-family: "SF Mono", "Cascadia Code", "Fira Code", ui-monospace, monospace;
    font-weight: 600;
    color: var(--auth-text-primary);
    letter-spacing: 1.5px;
    line-height: 1.4;
}

/* ========== 恢复码安全警告 ========== */
.recovery-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--auth-radius);
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.5;
}

.recovery-warning svg {
    color: #d97706;
    flex-shrink: 0;
    margin-top: 1px;
}

.recovery-warning strong {
    display: block;
    color: #92400e;
    font-weight: 700;
    margin-bottom: 2px;
}

.recovery-warning span {
    color: #a16207;
}

/* 暗色模式 — 恢复码警告 */
[data-theme="dark"] .recovery-warning {
    background: rgba(217, 119, 6, 0.1);
    border-color: rgba(217, 119, 6, 0.3);
}

[data-theme="dark"] .recovery-warning svg {
    color: #fbbf24;
}

[data-theme="dark"] .recovery-warning strong {
    color: #fde68a;
}

[data-theme="dark"] .recovery-warning span {
    color: #fcd34d;
}

/* ========== 恢复码页脚链接 ========== */
.auth-footer-link {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    color: var(--auth-text-muted);
    text-decoration: none;
}

.auth-footer-link:hover {
    color: var(--auth-primary);
    text-decoration: underline;
}

/* ========== MFA 设置页 — 紧凑覆盖 ========== */
/* 含 MFA 步骤的卡片缩小 padding 和 header 间距 */
.auth-card:has(.mfa-steps) {
    padding: 32px 36px;
}

.auth-card:has(.mfa-steps) .auth-header {
    margin-bottom: 16px;
}

.auth-card:has(.mfa-steps) .auth-header-top {
    margin-bottom: 12px;
}

.auth-card:has(.mfa-steps) .auth-logo {
    width: 36px;
    height: 36px;
    margin-bottom: 8px;
    font-size: 18px;
}

.auth-card:has(.mfa-steps) .auth-title {
    font-size: 20px;
}

.auth-card:has(.mfa-steps) .auth-subtitle {
    font-size: 12px;
    margin-top: 2px;
}

/* ========== 暗色模式 — QR 码容器 ========== */
[data-theme="dark"] .qr-code-frame {
    background: #fff;
    box-shadow:
        0 2px 12px rgba(0, 0, 0, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* ========== 暗色模式 — 步骤指示器 ========== */
[data-theme="dark"] .mfa-step-item.active .mfa-step-circle {
    box-shadow: 0 2px 8px rgba(129, 140, 248, 0.4);
}

/* ========== 暗色模式 — 手动密钥折叠 ========== */
[data-theme="dark"] .manual-key-toggle:hover {
    background: var(--auth-bg-subtle);
}

/* mt-3 辅助类 */
.mt-3 {
    margin-top: 16px;
}

/* ========== 用户自助中心 — 双模式响应式布局 ========== */

/* 容器 */
.profile-container {
    width: 100%;
    max-width: 900px;
    background: var(--auth-card-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--auth-card-glass-border);
    border-radius: var(--auth-radius-xl);
    box-shadow:
        0 20px 60px rgba(79, 70, 229, 0.1),
        0 8px 24px rgba(0, 0, 0, 0.06),
        0 2px 6px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

/* 头部 */
.profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-bottom: 1px solid var(--auth-border);
}

.profile-header-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: var(--auth-text-primary);
    letter-spacing: -0.2px;
}

.profile-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-action-link {
    font-size: 12px;
    color: var(--auth-text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

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

.profile-action-btn {
    font-size: 12px;
    color: var(--auth-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    padding: 0;
    transition: color 0.15s;
}

.profile-action-btn:hover {
    color: var(--auth-primary);
}

.profile-logout {
    font-size: 12px;
    color: var(--auth-text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.profile-logout:hover {
    color: var(--auth-danger);
}

/* 主体两列布局 */
.profile-body {
    display: flex;
    height: 520px;
}

/* 侧边导航（桌面端） */
.profile-sidebar {
    width: 190px;
    flex-shrink: 0;
    border-right: 1px solid var(--auth-border);
    padding: 12px 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 18px;
    color: var(--auth-text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}

.sidebar-item:hover {
    color: var(--auth-primary);
    background: rgba(79, 70, 229, 0.04);
}

.sidebar-item.active {
    color: var(--auth-primary);
    background: rgba(79, 70, 229, 0.06);
    border-left-color: var(--auth-primary);
    font-weight: 600;
}

.sidebar-item svg {
    flex-shrink: 0;
    opacity: 0.5;
    width: 16px;
    height: 16px;
}

.sidebar-item.active svg {
    opacity: 0.9;
}

/* 手机端标签栏（桌面端隐藏） */
.profile-tabs-mobile {
    display: none;
    border-bottom: 1px solid var(--auth-border);
    padding: 0 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.profile-tabs-mobile::-webkit-scrollbar {
    display: none;
}

.mobile-tab {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--auth-text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}

.mobile-tab:hover {
    color: var(--auth-primary);
}

.mobile-tab.active {
    color: var(--auth-primary);
    border-bottom-color: var(--auth-primary);
    font-weight: 600;
}

/* 内容区 */
.profile-content {
    flex: 1;
    padding: 24px 28px;
    min-width: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--auth-border) transparent;
}

.profile-content::-webkit-scrollbar {
    width: 4px;
}

.profile-content::-webkit-scrollbar-track {
    background: transparent;
}

.profile-content::-webkit-scrollbar-thumb {
    background: var(--auth-border);
    border-radius: 2px;
}

/* 个人中心内表单紧凑化 */
.profile-content .auth-form .form-label {
    font-size: 12px;
    margin-bottom: 4px;
}

.profile-content .auth-form .form-control {
    height: 40px;
    font-size: 13px;
    line-height: 40px;
    padding: 0 12px;
}

.profile-content .auth-form .btn-primary {
    height: 40px;
    font-size: 13px;
}

.profile-content .mb-3 {
    margin-bottom: 14px;
}

/* 桌面/手机端切换辅助类 — !important 防止被组件样式覆盖 */
.desktop-only { display: block !important; }
table.desktop-only { display: table !important; }
.mobile-only  { display: none !important; }

/* 兼容旧 class */
.avatar-section {
    text-align: center;
    margin-bottom: 20px;
}

.avatar-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(129, 140, 248, 0.3);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.08);
}

.avatar-actions {
    margin-top: 8px;
}

.avatar-upload-label {
    cursor: pointer;
    font-size: 12px;
    color: var(--auth-primary);
    border: 1px solid var(--auth-primary);
    background: transparent;
    transition: background-color 0.15s, color 0.15s;
}

.avatar-upload-label:hover {
    background: var(--auth-primary);
    color: #fff;
}

.btn-icon {
    vertical-align: -2px;
}

.text-success {
    color: var(--auth-success-text) !important;
}

.d-none {
    display: none !important;
}

.d-inline {
    display: inline !important;
}

.d-flex {
    display: flex !important;
}

.gap-2 {
    gap: 8px !important;
}

/* ========== 状态消息 ========== */
.profile-status {
    background: var(--auth-success-bg);
    border: 1px solid var(--auth-success-border);
    border-radius: var(--auth-radius-sm);
    padding: 10px 14px;
    margin-bottom: 16px;
    color: var(--auth-success-text);
    font-size: 12px;
    line-height: 1.5;
}

/* ========== 安全状态卡片 ========== */
.security-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px;
    border-bottom: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    margin: 0 -12px;
    transition: background-color 0.15s ease;
}

.security-item:hover {
    background: var(--auth-bg-muted);
}

.security-item:last-child {
    border-bottom: none;
}

.security-item-info {
    flex: 1;
}

.security-item-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-text-primary);
    margin-bottom: 2px;
}

.security-item-desc {
    font-size: 12px;
    color: var(--auth-text-muted);
    line-height: 1.4;
}

.security-item-action .btn {
    font-size: 12px;
    padding: 5px 12px;
    border-radius: var(--auth-radius-sm);
    white-space: nowrap;
}

/* ========== 登录历史 ========== */
.login-history {
    margin-top: 16px;
}

.login-history h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.login-history-table {
    width: 100%;
    font-size: 12px;
    border-collapse: collapse;
    table-layout: fixed;
}

.login-history-table th {
    text-align: left;
    padding: 7px 10px;
    background: var(--auth-bg-subtle);
    color: var(--auth-text-muted);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--auth-border);
}

.login-history-table th:last-child {
    border-right: none;
}

.login-history-table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--auth-border);
    color: var(--auth-text-secondary);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* — 登录历史卡片（手机端） — */
.login-history-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-history-card {
    padding: 12px 14px;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    background: var(--auth-bg-card);
}

.login-card-action {
    font-size: 13px;
    font-weight: 500;
    color: var(--auth-text-primary);
    margin-bottom: 4px;
}

.login-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--auth-text-secondary);
}

/* ========== 已授权应用卡片 ========== */
.session-card {
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    padding: 14px 16px;
    margin-bottom: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: var(--auth-bg-card);
}

.session-card:hover {
    border-color: var(--auth-text-light);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.session-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.session-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-text-primary);
}

.session-card-scopes {
    font-size: 12px;
    color: var(--auth-text-muted);
}

.session-card-time {
    font-size: 11px;
    color: var(--auth-text-light);
    margin-top: 4px;
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--auth-text-muted);
}

.empty-state-icon {
    font-size: 40px;
    margin-bottom: 10px;
    opacity: 0.4;
}

.empty-state-icon svg {
    width: 40px;
    height: 40px;
}

.empty-state p {
    font-size: 13px;
    margin: 0;
}

.empty-state-hint {
    font-size: 12px !important;
    color: var(--auth-text-light);
    margin-top: 8px !important;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

/* ========== 只读字段 ========== */
.readonly-field {
    font-size: 14px;
    color: var(--auth-text-primary);
    padding: 8px 0;
}

.readonly-field-label {
    font-size: 13px;
    color: var(--auth-text-secondary);
    margin-bottom: 4px;
    letter-spacing: 0.01em;
    font-weight: 600;
}

/* ========== 头像横排区域 ========== */
.avatar-horizontal {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.avatar-horizontal .avatar-img {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.avatar-horizontal .avatar-info {
    flex: 1;
    min-width: 0;
}

.avatar-horizontal .avatar-info .readonly-field-label {
    margin-bottom: 2px;
}

.avatar-horizontal .avatar-info .avatar-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--auth-text-primary);
    margin-bottom: 2px;
}

.avatar-horizontal .avatar-info .avatar-meta {
    font-size: 11px;
    color: var(--auth-text-light);
}

/* ========== 只读字段双列网格 ========== */
.readonly-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
    margin-bottom: 20px;
}

.readonly-grid .readonly-field {
    padding: 4px 0;
}

/* ========== 信息提示框 ========== */
.info-box {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    background: var(--auth-primary-light);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    margin-bottom: 16px;
    font-size: 12px;
    color: var(--auth-text-muted);
    line-height: 1.5;
}

.info-box svg {
    color: var(--auth-primary);
    flex-shrink: 0;
    margin-top: 1px;
    width: 14px;
    height: 14px;
}

/* ========== 安全项图标 ========== */
.security-item-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--auth-radius-sm);
    background: var(--auth-bg-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 12px;
    color: var(--auth-text-muted);
}

.security-item-icon svg {
    width: 15px;
    height: 15px;
}

.security-item-info {
    flex: 1;
    display: flex;
    align-items: center;
}

.security-item-text {
    flex: 1;
}

/* ========== Scope 标签 ========== */
.scope-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.scope-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--auth-bg-subtle);
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    font-size: 11px;
    color: var(--auth-text-muted);
    font-weight: 500;
}

/* ========== 登录历史分隔 ========== */
.login-history-divider {
    height: 1px;
    background: var(--auth-border);
    margin: 16px -12px 0;
}

/* ========== 通用辅助 ========== */
.w-100 {
    width: 100%;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-3 {
    margin-bottom: 16px;
}

.small {
    font-size: 12px;
}

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

/* ========== 响应式: 平板 (≤768px) ========== */
@media (max-width: 768px) {
    .auth-card {
        margin: 16px;
        padding: 32px 24px;
        max-width: 100%;
        border-radius: var(--auth-radius-lg);
    }

    .auth-title {
        font-size: 21px;
    }

    /* — 用户自助中心 — */
    .profile-container {
        margin: 8px;
        max-width: 100%;
        border-radius: var(--auth-radius-lg);
    }

    .profile-header {
        flex-wrap: wrap;
        gap: 8px;
        padding: 14px 16px;
    }

    /* 侧边导航隐藏，标签栏显示 */
    .profile-sidebar { display: none; }
    .profile-tabs-mobile { display: flex; }
    .desktop-only, table.desktop-only { display: none !important; }
    .mobile-only  { display: block !important; }

    .profile-body {
        flex-direction: column;
        height: auto;
        min-height: 400px;
    }

    .profile-content {
        padding: 16px;
        overflow-y: visible;
    }

    .auth-options {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    /* — 安全项：小屏纵向堆叠 — */
    .security-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .security-item-action {
        width: 100%;
    }

    .security-item-action .btn {
        width: 100%;
        text-align: center;
    }

    .security-item-action.d-flex {
        flex-direction: row;
    }

    .security-item-action.d-flex .btn {
        width: auto;
        flex: 1;
    }

    /* — 登录历史表格：紧凑化 — */
    .login-history-table th {
        padding: 6px 8px;
        font-size: 10px;
    }

    .login-history-table td {
        padding: 5px 8px;
        font-size: 11px;
    }

    /* — 删除账号模态框 — */
    .modal-overlay {
        padding: 16px;
    }

    .modal-card {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: var(--auth-radius-lg);
    }

    /* — MFA 恢复码 — */
    .recovery-codes {
        grid-template-columns: 1fr;
    }

    .recovery-actions {
        flex-direction: column;
    }

    .recovery-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* — MFA 步骤指示器 — */
    .mfa-step-connector {
        min-width: 30px;
    }

    .mfa-step-circle {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .mfa-step-label {
        font-size: 10px;
    }

    /* — QR 码响应式 — */
    .qr-code-frame {
        padding: 12px;
    }

    .qr-code-frame .qr-code-img,
    .qr-code-img {
        width: min(160px, calc(100vw - 120px));
        height: min(160px, calc(100vw - 120px));
    }

    /* — OTP 输入框 — */
    .otp-cell {
        width: 42px;
        height: 50px;
        font-size: 20px;
    }

    .otp-input-group {
        gap: 6px;
    }

    /* — 隐私/数据操作按钮 — */
    .privacy-actions {
        flex-direction: column;
        gap: 8px;
    }

    .privacy-actions .btn {
        width: 100%;
        text-align: center;
    }

    /* — 已授权应用卡片 — */
    .session-card-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .session-card-header .btn {
        width: 100%;
        text-align: center;
    }
}

/* ========== 响应式: 手机 (≤480px) ========== */
@media (max-width: 480px) {
    .auth-card {
        margin: 0;
        padding: 28px 20px;
        border-radius: 0;
        border: none;
        box-shadow: none;
        background: var(--auth-bg-card);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        max-width: 100%;
    }

    .auth-title {
        font-size: 20px;
    }

    .auth-logo {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }

    /* — 用户自助中心 — */
    .profile-container {
        margin: 0;
        width: 100%;
        border-radius: 0;
        border: none;
        background: var(--auth-bg-card);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .profile-header {
        padding: 12px 16px;
    }

    .profile-header-title {
        font-size: 15px;
    }

    .profile-content {
        padding: 14px 16px;
    }

    /* — 头像横排回退纵向 — */
    .avatar-horizontal {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }

    /* — 只读字段单列 — */
    .readonly-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    /* — 表单输入 — */
    .form-control {
        font-size: 16px; /* 防止 iOS 缩放 */
    }

    /* — 触摸目标最小 44px — */
    .btn {
        min-height: 44px;
    }

    .mobile-tab {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .auth-link,
    .form-check-label {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* — 步骤指示器紧凑化 — */
    .mfa-steps {
        margin-bottom: 12px;
    }

    .mfa-step-connector {
        min-width: 20px;
        margin: 0 4px;
        margin-top: 14px;
    }

    .mfa-step-circle {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }

    /* — QR 码进一步缩小 — */
    .qr-code-frame .qr-code-img,
    .qr-code-img {
        width: min(160px, calc(100vw - 100px));
        height: min(160px, calc(100vw - 100px));
    }

    .qr-code-frame {
        padding: 10px;
    }

    /* — 手动密钥优化 — */
    .manual-key-toggle {
        padding: 10px 12px;
        font-size: 12px;
    }

    .manual-key-content {
        padding: 0 12px 12px;
    }

    .manual-key-hint {
        font-size: 11px;
    }

    /* — OTP 输入框极窄屏 — */
    .otp-cell {
        width: 38px;
        height: 46px;
        font-size: 18px;
        border-width: 1.5px;
    }

    .otp-input-group {
        gap: 4px;
    }

    .otp-separator {
        width: 8px;
    }

    /* — 恢复码警告紧凑化 — */
    .recovery-warning {
        padding: 10px 12px;
        font-size: 12px;
    }

    /* — 登录历史表格：极窄屏隐藏 IP 列 — */
    .login-history-table th:last-child,
    .login-history-table td:last-child {
        display: none;
    }

    /* — 手动密钥换行优化 — */
    .manual-key-value {
        font-size: 12px;
        letter-spacing: 1px;
        overflow-wrap: break-word;
    }

    /* — 头像尺寸 — */
    .avatar-img {
        width: 64px;
        height: 64px;
    }

    /* — 安全项按钮 padding 增大 — */
    .security-item-action .btn {
        padding: 10px 16px;
    }

    /* — 空状态减少内边距 — */
    .empty-state {
        padding: 32px 16px;
    }
}
