/**
 * 全站视觉主题 — html[data-theme] 覆盖 CSS 变量与浅色可读性修正
 */

html[data-theme="dark_gold"] {
    --bg: #09090e;
    --bg-card: #12121a;
    --bg-elevated: #1a1a24;
    --bg-hover: #22222e;
    --border: #2a2a3a;
    --gold: #e8a820;
    --gold-light: #f5c842;
    --gold-dim: #b8860b;
    --text: #eeeef2;
    --text-muted: #a8a8bc;
    --header-bg: rgba(9, 9, 14, 0.98);
    --nav-track-bg: #12121a;
    --home-promo-ph: #12100e;
    --home-stats-bg: linear-gradient(180deg, rgba(232, 168, 32, 0.08), rgba(20, 20, 20, 0.6));
    --hero-bg: linear-gradient(135deg, #12121a 0%, #1a1420 60%, #12121a 100%);
    --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.35);
    --btn-solid-text: #111111;
    --btn-outline-hover-bg: rgba(232, 168, 32, 0.1);
    --badge-info-color: #7eb8ff;
    --notice-info-color: #9ec5ff;
    --row-new-title: #c8dc3a;
    --row-ongoing-title: #7eb8ff;
    --row-ok-title: #8ed4a8;
    --row-hover-accent: rgba(232, 168, 32, 0.25);
    --admin-accent: #ffb300;
    --admin-sidebar-bg: #353540;
}

/* 浅色主题 · 按钮白字、帖子/标签深色字 */
html[data-theme="sky_blue"],
html[data-theme="cloud_white"],
html[data-theme="slate_soft"] {
    --btn-solid-text: #ffffff;
    --row-new-title: #4a6b0a;
    --row-ongoing-title: #1559a8;
    --row-ok-title: #0d6b42;
    --row-hover-accent: rgba(26, 111, 212, 0.22);
    --badge-quote-bg: rgba(180, 120, 0, 0.12);
    --badge-quote-color: #9a6200;
    --badge-quote-border: rgba(180, 120, 0, 0.35);
    --badge-running-bg: rgba(26, 111, 212, 0.14);
    --badge-running-color: #1559a8;
    --badge-running-border: rgba(26, 111, 212, 0.38);
    --badge-done-bg: rgba(26, 157, 98, 0.14);
    --badge-done-color: #0d6b42;
    --badge-done-border: rgba(26, 157, 98, 0.38);
}

html[data-theme="sky_blue"] {
    --bg: #e8f1fa;
    --bg-card: #ffffff;
    --bg-elevated: #f4f8fd;
    --bg-hover: #dce8f5;
    --border: #c5d8eb;
    --gold: #1a6fd4;
    --gold-light: #3589e8;
    --gold-dim: #1559a8;
    --text: #1a2d42;
    --text-muted: #4a627a;
    --success: #1a9d62;
    --danger: #c53030;
    --header-bg: rgba(255, 255, 255, 0.96);
    --nav-track-bg: #f0f6fc;
    --home-promo-ph: #dce8f5;
    --home-stats-bg: linear-gradient(180deg, rgba(26, 111, 212, 0.1), rgba(255, 255, 255, 0.85));
    --hero-bg: linear-gradient(135deg, #f0f7ff 0%, #e3eef9 50%, #f5f9ff 100%);
    --shadow-soft: 0 4px 20px rgba(26, 80, 140, 0.1);
    --btn-outline-hover-bg: rgba(26, 111, 212, 0.1);
    --badge-info-color: #1559a8;
    --notice-info-color: #1559a8;
    --admin-accent: #1a6fd4;
    --admin-sidebar-bg: #e8f1fa;
}

html[data-theme="cloud_white"] {
    --bg: #f6f7f9;
    --bg-card: #ffffff;
    --bg-elevated: #fafbfc;
    --bg-hover: #eef0f3;
    --border: #dde1e8;
    --gold: #2563eb;
    --gold-light: #3b82f6;
    --gold-dim: #1d4ed8;
    --text: #111827;
    --text-muted: #4b5563;
    --header-bg: rgba(255, 255, 255, 0.98);
    --nav-track-bg: #f3f4f6;
    --home-promo-ph: #eef0f3;
    --home-stats-bg: linear-gradient(180deg, rgba(37, 99, 235, 0.06), #ffffff);
    --hero-bg: linear-gradient(180deg, #ffffff, #f3f4f6);
    --shadow-soft: 0 2px 16px rgba(0, 0, 0, 0.06);
    --btn-outline-hover-bg: rgba(37, 99, 235, 0.08);
    --badge-info-color: #1d4ed8;
    --notice-info-color: #1d4ed8;
    --row-ongoing-title: #1d4ed8;
    --admin-accent: #2563eb;
    --admin-sidebar-bg: #f3f4f6;
}

html[data-theme="slate_soft"] {
    --bg: #eceff3;
    --bg-card: #f8f9fb;
    --bg-elevated: #ffffff;
    --bg-hover: #e2e6ec;
    --border: #c8cfd8;
    --gold: #2c5282;
    --gold-light: #3d6a9e;
    --gold-dim: #1e3f5f;
    --text: #1e2936;
    --text-muted: #526070;
    --header-bg: rgba(248, 249, 251, 0.98);
    --nav-track-bg: #e8ebf0;
    --home-promo-ph: #dfe3ea;
    --home-stats-bg: linear-gradient(180deg, rgba(44, 82, 130, 0.08), rgba(255, 255, 255, 0.9));
    --hero-bg: linear-gradient(135deg, #eef1f5, #e4e9ef);
    --shadow-soft: 0 3px 18px rgba(30, 41, 54, 0.08);
    --btn-outline-hover-bg: rgba(44, 82, 130, 0.1);
    --badge-info-color: #1e3f5f;
    --notice-info-color: #1e3f5f;
    --row-ongoing-title: #1e3f5f;
    --admin-accent: #2c5282;
    --admin-sidebar-bg: #e8ebf0;
}

/* ========== 浅色 · 组件可读性 ========== */
html[data-theme="sky_blue"] .site-header,
html[data-theme="cloud_white"] .site-header,
html[data-theme="slate_soft"] .site-header {
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

html[data-theme="cloud_white"] .site-header {
    border-bottom-color: #e5e7eb;
}

html[data-theme="slate_soft"] .site-header {
    border-bottom: 2px solid #c8cfd8;
}

html[data-theme="sky_blue"] .nav-link.is-active,
html[data-theme="cloud_white"] .nav-link.is-active,
html[data-theme="slate_soft"] .nav-link.is-active {
    background: color-mix(in srgb, var(--gold) 12%, transparent);
    color: var(--gold-dim);
}

html[data-theme="sky_blue"] .btn,
html[data-theme="cloud_white"] .btn,
html[data-theme="slate_soft"] .btn {
    color: #ffffff !important;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
    box-shadow: 0 2px 6px color-mix(in srgb, var(--gold) 28%, transparent);
}

html[data-theme="sky_blue"] .btn-outline,
html[data-theme="cloud_white"] .btn-outline,
html[data-theme="slate_soft"] .btn-outline {
    color: var(--gold-dim) !important;
    border-color: var(--gold);
    background: #ffffff;
    text-shadow: none;
    box-shadow: none;
}

html[data-theme="sky_blue"] .btn-ghost,
html[data-theme="cloud_white"] .btn-ghost,
html[data-theme="slate_soft"] .btn-ghost {
    color: var(--text) !important;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    text-shadow: none;
    box-shadow: none;
}

html[data-theme="sky_blue"] .btn-ghost:hover,
html[data-theme="cloud_white"] .btn-ghost:hover,
html[data-theme="slate_soft"] .btn-ghost:hover {
    color: var(--gold-dim) !important;
    border-color: var(--gold);
    background: var(--btn-outline-hover-bg);
}

html[data-theme="sky_blue"] .btn-outline:hover,
html[data-theme="cloud_white"] .btn-outline:hover,
html[data-theme="slate_soft"] .btn-outline:hover {
    color: var(--gold-dim) !important;
    background: var(--btn-outline-hover-bg);
}

html[data-theme="sky_blue"] .phase-tab.phase-ongoing.active,
html[data-theme="cloud_white"] .phase-tab.phase-ongoing.active,
html[data-theme="slate_soft"] .phase-tab.phase-ongoing.active {
    color: var(--row-ongoing-title) !important;
    border-color: var(--row-ongoing-title) !important;
}

html[data-theme="sky_blue"] .trade-eval-neutral,
html[data-theme="cloud_white"] .trade-eval-neutral,
html[data-theme="slate_soft"] .trade-eval-neutral {
    color: #5a627a;
    background: rgba(90, 98, 122, 0.1);
    border-color: rgba(90, 98, 122, 0.25);
}

html[data-theme="sky_blue"] .trade-eval-good,
html[data-theme="cloud_white"] .trade-eval-good,
html[data-theme="slate_soft"] .trade-eval-good {
    color: #0d6b42;
}

html[data-theme="sky_blue"] .trade-eval-bad,
html[data-theme="cloud_white"] .trade-eval-bad,
html[data-theme="slate_soft"] .trade-eval-bad {
    color: #b91c1c;
}

html[data-theme="sky_blue"] .trade-row-new,
html[data-theme="cloud_white"] .trade-row-new,
html[data-theme="slate_soft"] .trade-row-new {
    background: color-mix(in srgb, var(--row-new-title) 6%, transparent);
}

html[data-theme="sky_blue"] .trade-row-ongoing,
html[data-theme="cloud_white"] .trade-row-ongoing,
html[data-theme="slate_soft"] .trade-row-ongoing {
    background: color-mix(in srgb, var(--row-ongoing-title) 6%, transparent);
}

html[data-theme="sky_blue"] .community-cat-link.active,
html[data-theme="cloud_white"] .community-cat-link.active,
html[data-theme="slate_soft"] .community-cat-link.active {
    color: var(--badge-info-color);
    background: color-mix(in srgb, var(--badge-info-color) 10%, transparent);
}

html[data-theme="sky_blue"] .community-cat-link:hover,
html[data-theme="cloud_white"] .community-cat-link:hover,
html[data-theme="slate_soft"] .community-cat-link:hover {
    color: var(--badge-info-color);
}

html[data-theme="sky_blue"] .home-today-num,
html[data-theme="cloud_white"] .home-today-num,
html[data-theme="slate_soft"] .home-today-num {
    color: var(--gold-dim);
}

html[data-theme="sky_blue"] .text-gold,
html[data-theme="cloud_white"] .text-gold,
html[data-theme="slate_soft"] .text-gold {
    color: var(--gold-dim) !important;
}

html[data-theme="sky_blue"] .flash .success,
html[data-theme="cloud_white"] .flash .success,
html[data-theme="slate_soft"] .flash .success {
    background: rgba(26, 157, 98, 0.12);
    color: #0d6b42;
    border-color: rgba(26, 157, 98, 0.3);
}

html[data-theme="sky_blue"] .flash .error,
html[data-theme="cloud_white"] .flash .error,
html[data-theme="slate_soft"] .flash .error {
    background: rgba(197, 48, 48, 0.1);
    color: #991b1b;
}

html[data-theme="sky_blue"] .home-promo-placeholder,
html[data-theme="cloud_white"] .home-promo-placeholder,
html[data-theme="slate_soft"] .home-promo-placeholder {
    background: var(--home-promo-ph);
}

html[data-theme="sky_blue"] .provider-contact-link,
html[data-theme="cloud_white"] .provider-contact-link,
html[data-theme="slate_soft"] .provider-contact-link {
    color: var(--gold-dim);
    border-color: color-mix(in srgb, var(--gold) 35%, transparent);
}

html[data-theme="sky_blue"] .module-compact-arrow,
html[data-theme="cloud_white"] .module-compact-arrow,
html[data-theme="slate_soft"] .module-compact-arrow {
    color: var(--gold-dim);
}

html[data-theme="sky_blue"] .detail-require-body,
html[data-theme="cloud_white"] .detail-require-body,
html[data-theme="slate_soft"] .detail-require-body {
    color: var(--text);
    background: color-mix(in srgb, var(--gold) 5%, var(--bg-elevated));
    border-color: color-mix(in srgb, var(--gold) 22%, transparent);
}

html[data-theme="sky_blue"] .notice-info,
html[data-theme="cloud_white"] .notice-info,
html[data-theme="slate_soft"] .notice-info {
    color: var(--notice-info-color);
}
