/* ========== settings.css ========== */
/**
 * 设置模块样式 - Nebula 暗色设计语言
 * 玻璃拟态 · 紫靛渐变 · 微光发光 · 高级质感
 * 变量回退值确保独立可用：--primary:#6366f1  --accent:#06b6d4
 * --bg-base:#0a0c1e  --bg-card:rgba(20,22,48,0.6)  --border:rgba(99,102,241,0.15)
 */

/* ============ 页面容器 ============ */
.settings-page-header {
    max-width: 900px;
    margin: 0 auto 28px;
    padding: 0 4px;
}

.settings-page-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg,
        var(--primary, #6366f1) 0%,
        var(--accent, #06b6d4) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.settings-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 4px 48px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: settings-fade-in .5s cubic-bezier(.22,1,.36,1);
}

@keyframes settings-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============ 设置卡片（玻璃拟态） ============ */
.settings-section {
    position: relative;
    padding: 24px 26px;
    border-radius: 16px;
    border: 1px solid var(--border, rgba(99, 102, 241, 0.15));
    background: var(--bg-card, rgba(20, 22, 48, 0.6));
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    box-shadow: 0 8px 28px rgba(0, 0, 0, .3),
                inset 0 1px 0 rgba(255, 255, 255, .04);
    transition: border-color .3s ease, box-shadow .3s ease, transform .3s ease;
    overflow: hidden;
}

.settings-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(99, 102, 241, .35) 50%,
        transparent 100%);
    opacity: .6;
}

.settings-section:hover {
    border-color: rgba(99, 102, 241, .3);
    box-shadow: 0 14px 36px rgba(0, 0, 0, .38),
                0 0 26px rgba(99, 102, 241, .14);
}

/* ============ Section 标题（左侧渐变色条 + 渐变背景药丸） ============ */
.settings-section h3 {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 22px 0;
    padding: 8px 16px 8px 18px;
    position: relative;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary, #e7e9f5);
    border-radius: 12px;
    /* 柔和渐变背景药丸，营造标题图标背景质感 */
    background: linear-gradient(135deg,
        rgba(99, 102, 241, .14) 0%,
        rgba(6, 182, 212, .07) 100%);
    border: 1px solid var(--border, rgba(99, 102, 241, 0.15));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

/* 左侧渐变色条 */
.settings-section h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    border-radius: 6px;
    background: linear-gradient(180deg,
        var(--primary, #6366f1) 0%,
        var(--accent, #06b6d4) 100%);
    box-shadow: 0 0 12px rgba(99, 102, 241, .5);
}

/* ============ 设置项布局（左标签+描述 / 右控件） ============ */
.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border, rgba(99, 102, 241, 0.15));
    transition: padding-left .2s ease;
}

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

.settings-item:hover {
    padding-left: 6px;
}

.settings-item label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #e7e9f5);
    flex: 1;
}

.settings-item > span {
    font-size: 13px;
    color: var(--text-secondary, rgba(231, 233, 245, .6));
    text-align: right;
    word-break: break-all;
}

/* ============ 主题选择（原生 select 美化为玻璃下拉） ============ */
#theme-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    min-width: 168px;
    height: 40px;
    padding: 0 38px 0 14px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-primary, #e7e9f5);
    background-color: rgba(10, 12, 30, .6);
    background-image:
        linear-gradient(135deg,
            rgba(99, 102, 241, .14) 0%,
            rgba(6, 182, 212, .08) 100%),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a5b4fc' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat, no-repeat;
    background-position: right 14px center, right 14px center;
    background-size: auto, 12px;
    border: 1px solid var(--border, rgba(99, 102, 241, 0.15));
    border-radius: 12px;
    cursor: pointer;
    transition: border-color .25s ease, box-shadow .25s ease, background-color .25s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#theme-select:hover {
    border-color: rgba(99, 102, 241, .35);
}

#theme-select:focus {
    outline: none;
    border-color: var(--primary, #6366f1);
    background-color: rgba(10, 12, 30, .8);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .14),
                0 0 22px rgba(99, 102, 241, .22);
}

#theme-select option {
    background: #0f1130;
    color: #e7e9f5;
}

/* ============ 自定义 Toggle 开关（基于原生 checkbox） ============ */
.settings-item.toggle {
    /* 右侧控件为开关 */
}

.settings-item.toggle input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    position: relative;
    width: 50px;
    height: 28px;
    margin: 0;
    flex: none;
    border-radius: 999px;
    background: rgba(10, 12, 30, .7);
    border: 1px solid var(--border, rgba(99, 102, 241, 0.15));
    cursor: pointer;
    transition: background .3s ease, border-color .3s ease, box-shadow .3s ease;
    outline: none;
}

/* 滑块 */
.settings-item.toggle input[type="checkbox"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 3px;
    transform: translateY(-50%);
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c7cdf7 0%, #8b91e0 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
    transition: left .3s cubic-bezier(.22,1,.36,1),
                background .3s ease, transform .3s ease;
}

.settings-item.toggle input[type="checkbox"]:hover {
    border-color: rgba(99, 102, 241, .35);
}

.settings-item.toggle input[type="checkbox"]:focus-visible {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .16);
}

/* 选中态：渐变轨道 + 渐变滑块右移 */
.settings-item.toggle input[type="checkbox"]:checked {
    background: linear-gradient(135deg,
        var(--primary, #6366f1) 0%,
        var(--accent, #06b6d4) 100%);
    border-color: transparent;
    box-shadow: 0 0 16px rgba(99, 102, 241, .45),
                0 0 26px rgba(6, 182, 212, .22);
}

.settings-item.toggle input[type="checkbox"]:checked::before {
    left: 26px;
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
    transform: translateY(-50%) scale(1.02);
}

/* ============ 按钮组 ============ */
.settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
}

.settings-section .btn-primary,
.settings-section .btn-secondary,
.settings-section .btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 42px;
    padding: 0 18px;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: -0.005em;
    border-radius: 12px;
    cursor: pointer;
    transition: transform .25s cubic-bezier(.22,1,.36,1),
                box-shadow .25s ease, border-color .25s ease,
                background .25s ease, opacity .25s ease;
    white-space: nowrap;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.settings-section .btn-primary {
    color: #fff;
    background: linear-gradient(135deg,
        var(--primary, #6366f1) 0%,
        var(--accent, #06b6d4) 100%);
    border: 1px solid transparent;
    box-shadow: 0 8px 22px rgba(99, 102, 241, .32),
                0 0 18px rgba(6, 182, 212, .16);
}

.settings-section .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(99, 102, 241, .42),
                0 0 28px rgba(6, 182, 212, .28);
}

.settings-section .btn-secondary {
    color: var(--text-primary, #e7e9f5);
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--border, rgba(99, 102, 241, 0.15));
}

.settings-section .btn-secondary:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, .4);
    background: rgba(99, 102, 241, .12);
    box-shadow: 0 8px 22px rgba(99, 102, 241, .18);
}

.settings-section .btn-primary:active,
.settings-section .btn-secondary:active,
.settings-section .btn-danger:active {
    transform: translateY(0) scale(.98);
}

/* 危险按钮（红色发光边框） */
.settings-section .btn-danger {
    color: #ffc9c9;
    background: rgba(239, 68, 68, .12);
    border: 1px solid rgba(239, 68, 68, .4);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, .05);
}

.settings-section .btn-danger:hover {
    color: #fff;
    transform: translateY(-2px);
    background: rgba(239, 68, 68, .22);
    border-color: rgba(239, 68, 68, .7);
    box-shadow: 0 10px 26px rgba(239, 68, 68, .32),
                0 0 22px rgba(239, 68, 68, .3);
}

/* ============ 关于卡片（居中 + 大号渐变版本号） ============ */
.settings-section .about-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    padding: 18px 0 6px;
}

.settings-section .about-info p {
    margin: 0;
    line-height: 1.7;
}

.settings-section .about-info p strong {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #e7e9f5);
    letter-spacing: -0.01em;
}

/* 版本号大号渐变文字 */
.settings-section .about-info p:nth-of-type(2) {
    margin-top: 6px;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    background: linear-gradient(135deg,
        var(--primary, #6366f1) 0%,
        var(--accent, #06b6d4) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.settings-section .about-info p:nth-of-type(3) {
    font-size: 12.5px;
    color: var(--text-secondary, rgba(231, 233, 245, .5));
}

/* ============ 危险区域 / 退出登录 ============ */
.settings-section.danger-zone {
    border-color: rgba(239, 68, 68, .28);
    background: linear-gradient(135deg,
        rgba(239, 68, 68, .06) 0%,
        var(--bg-card, rgba(20, 22, 48, 0.6)) 70%);
}

.settings-section.danger-zone::before {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(239, 68, 68, .4) 50%,
        transparent 100%);
}

.settings-section.danger-zone:hover {
    border-color: rgba(239, 68, 68, .45);
    box-shadow: 0 14px 36px rgba(0, 0, 0, .38),
                0 0 26px rgba(239, 68, 68, .16);
}

.settings-section.danger-zone h3::before {
    background: linear-gradient(180deg, #ef4444 0%, #f97316 100%);
    box-shadow: 0 0 12px rgba(239, 68, 68, .55);
}

/* 退出登录按钮：红色发光 */
.settings-section.danger-zone .btn-danger {
    width: 100%;
    height: 46px;
    font-size: 14.5px;
    color: #fff;
    background: linear-gradient(135deg, #ef4444 0%, #f43f5e 100%);
    border: 1px solid rgba(255, 120, 120, .5);
    box-shadow: 0 10px 26px rgba(239, 68, 68, .35),
                0 0 22px rgba(239, 68, 68, .3);
}

.settings-section.danger-zone .btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(239, 68, 68, .5),
                0 0 34px rgba(239, 68, 68, .42);
    background: linear-gradient(135deg, #f43f5e 0%, #ef4444 100%);
}

/* 确认样式：危险按钮按下/聚焦提示 */
.settings-section.danger-zone .btn-danger:active {
    transform: translateY(0) scale(.99);
}

/* ============ 辅助提示文字 ============ */
.settings-section p[style*="text-muted"],
.settings-section p {
    color: var(--text-secondary, rgba(231, 233, 245, .55));
}

/* ============ 响应式 ============ */
@media (max-width: 640px) {
    .settings-page-header h2 { font-size: 23px; }
    .settings-section { padding: 20px 18px; }
    .settings-section h3 { font-size: 16px; }
    .settings-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .settings-item > span { text-align: left; }
    .settings-actions { flex-direction: column; }
    .settings-section .btn-primary,
    .settings-section .btn-secondary,
    .settings-section .btn-danger {
        width: 100%;
    }
    #theme-select { width: 100%; min-width: 0; }
}

/* 减弱动画偏好 */
@media (prefers-reduced-motion: reduce) {
    .settings-content,
    .settings-section,
    .settings-item,
    .settings-section .btn-primary,
    .settings-section .btn-secondary,
    .settings-section .btn-danger,
    .settings-item.toggle input[type="checkbox"] {
        animation: none !important;
        transition: none !important;
    }
}


/* ============================================================
   settings.css 统一覆盖层 — radius 令牌化 + 触控 + 奇数字号归一
   ============================================================ */
.settings-section { border-radius: var(--radius-lg); }
.settings-card { border-radius: var(--radius-md); }
.settings-section .btn-primary,
.settings-section .btn-secondary,
.settings-section .btn-danger { min-height: 40px; border-radius: var(--radius-md); font-size: var(--text-sm); }
.danger-zone .btn-danger { min-height: 44px; }
