/**
 * 全站主题令牌 — 由 html.site-theme-* 切换
 * 组件样式通过 var(--st-*) 引用（见 home.css / admin-shell.css）
 */

html[class*="site-theme-"]::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: var(--st-pattern, none);
  opacity: var(--st-pattern-opacity, 0);
}

html[class*="site-theme-"]::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--st-overlay, none);
  opacity: var(--st-overlay-opacity, 0);
  animation: var(--st-overlay-animation, none);
}

@keyframes st-fluid-drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(3%, -2%) scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  html.site-theme-fluid::after {
    --st-overlay-animation: none !important;
  }
}

html[class*="site-theme-"],
html[class*="site-theme-"] body {
  background: var(--st-canvas) fixed;
  background-size: cover;
  color: var(--st-text);
}

/* —— 1. 玻璃拟态 —— */
html.site-theme-glass,
html.site-theme-random {
  --st-canvas: linear-gradient(140deg, #071018 0%, #0d1528 38%, #101a30 72%, #0c1424 100%);
  --st-text: #e8ecf4;
  --st-text-muted: #94a3b8;
  --st-accent: #7dd3fc;
  --st-accent-soft: rgba(125, 211, 252, 0.14);
  --st-card-bg: rgba(15, 23, 42, 0.42);
  --st-card-border: rgba(255, 255, 255, 0.12);
  --st-surface-bg: rgba(255, 255, 255, 0.06);
  --st-surface-border: rgba(255, 255, 255, 0.1);
  --st-glass-blur: 24px;
  --st-glass-frost: blur(24px) saturate(1.42);
  --st-glass-frost-md: blur(18px) saturate(1.38);
  --st-glass-frost-sm: blur(14px) saturate(1.34);
  --st-glass-frost-xs: blur(12px) saturate(1.32);
  --st-glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --st-shadow: 0 24px 52px rgba(2, 8, 24, 0.55);
  --st-shadow-sm: 0 16px 36px rgba(2, 8, 24, 0.32);
  --st-use-blur: 1;
  --st-pattern: none;
  --st-pattern-opacity: 0;
  --st-admin-sidebar: rgba(15, 23, 42, 0.42);
  --st-admin-shell: rgba(15, 23, 42, 0.38);
  --st-admin-panel: rgba(15, 23, 42, 0.45);
}

html.site-theme-glass.theme-light,
html.site-theme-random.theme-light {
  --st-canvas: linear-gradient(125deg, #e9e5f8 0%, #dbe8e0 24%, #d9ebfb 48%, #e8e4f6 74%, #efe8f5 100%);
  --st-text: #111827;
  --st-text-muted: #64748b;
  --st-accent: #2563eb;
  --st-accent-soft: rgba(37, 99, 235, 0.12);
  --st-card-bg: rgba(255, 255, 255, 0.12);
  --st-card-border: rgba(255, 255, 255, 0.3);
  --st-surface-bg: rgba(255, 255, 255, 0.14);
  --st-surface-border: rgba(255, 255, 255, 0.22);
  --st-glass-blur: 40px;
  --st-glass-frost: blur(40px) saturate(1.52);
  --st-glass-frost-md: blur(28px) saturate(1.46);
  --st-glass-frost-sm: blur(18px) saturate(1.42);
  --st-glass-frost-xs: blur(14px) saturate(1.38);
  --st-glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.24);
  --st-shadow: 0 22px 46px rgba(80, 100, 150, 0.1);
  --st-shadow-sm: 0 14px 32px rgba(80, 100, 140, 0.08);
  --st-admin-sidebar: rgba(255, 255, 255, 0.14);
  --st-admin-shell: rgba(255, 255, 255, 0.11);
  --st-admin-panel: rgba(255, 255, 255, 0.12);
}

/* —— 2. 深色模式 #121212 —— */
html.site-theme-dark {
  --st-canvas: #121212;
  --st-text: #e8eaed;
  --st-text-muted: #9aa0a6;
  --st-accent: #8ab4f8;
  --st-accent-soft: rgba(138, 180, 248, 0.16);
  --st-card-bg: #1e1e1e;
  --st-card-border: #2d2d2d;
  --st-surface-bg: #252525;
  --st-surface-border: #333333;
  --st-glass-blur: 0;
  --st-glass-frost: none;
  --st-glass-frost-md: none;
  --st-glass-frost-sm: none;
  --st-glass-frost-xs: none;
  --st-glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --st-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  --st-shadow-sm: 0 12px 28px rgba(0, 0, 0, 0.35);
  --st-use-blur: 0;
  --st-pattern: radial-gradient(circle at 50% 0%, rgba(138, 180, 248, 0.08) 0%, transparent 55%);
  --st-pattern-opacity: 1;
  --st-admin-sidebar: #181818;
  --st-admin-shell: #1a1a1a;
  --st-admin-panel: #1e1e1e;
  --st-input-bg: #181818;
  --st-input-border: #3b3b3b;
  --st-control-bg: #242424;
  --st-control-border: #444444;
  --st-action-bg: linear-gradient(135deg, #8ab4f8, #5f8fdc);
  --st-action-bg-hover: linear-gradient(135deg, #a8c7fb, #76a5ed);
  --st-action-fg: #101418;
  --st-link: #9ec5ff;
  --st-link-hover: #c4dcff;
  --st-focus-ring: rgba(138, 180, 248, 0.28);
  --st-hover-bg: rgba(255, 255, 255, 0.08);
  --st-table-line: #303030;
  --st-heading: #f1f3f4;
  --st-success-bg: rgba(52, 168, 83, 0.18);
  --st-success-fg: #b7efc5;
  --st-success-border: rgba(91, 210, 113, 0.38);
  --st-danger-bg: rgba(234, 67, 53, 0.16);
  --st-danger-fg: #ffb4ad;
  --st-danger-border: rgba(255, 125, 113, 0.38);
  --st-product-btn-bg: linear-gradient(135deg, #8ab4f8, #5f8fdc);
  --st-product-btn-bg-hover: linear-gradient(135deg, #a8c7fb, #76a5ed);
  --st-product-btn-fg: #101418;
  --st-product-btn-fg-hover: #101418;
  --st-product-btn-border: rgba(138, 180, 248, 0.45);
  --st-product-btn-shadow: 0 8px 18px rgba(95, 143, 220, 0.24);
}

/* —— 3. 网格与点阵 —— */
html.site-theme-grid {
  --st-canvas: #08141c;
  --st-text: #e2e8f0;
  --st-text-muted: #94a3b8;
  --st-accent: #38bdf8;
  --st-accent-soft: rgba(56, 189, 248, 0.16);
  --st-card-bg: rgba(12, 35, 47, 0.9);
  --st-card-border: rgba(103, 232, 249, 0.22);
  --st-surface-bg: rgba(20, 52, 66, 0.7);
  --st-surface-border: rgba(103, 232, 249, 0.18);
  --st-glass-blur: 12px;
  --st-glass-frost: none;
  --st-glass-frost-md: none;
  --st-glass-frost-sm: none;
  --st-glass-frost-xs: none;
  --st-glass-inset: inset 0 1px 0 rgba(103, 232, 249, 0.08);
  --st-shadow: 0 20px 44px rgba(0, 0, 0, 0.4);
  --st-shadow-sm: 0 12px 30px rgba(0, 0, 0, 0.28);
  --st-use-blur: 1;
  --st-pattern:
    linear-gradient(rgba(148, 163, 184, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.07) 1px, transparent 1px),
    radial-gradient(circle, rgba(148, 163, 184, 0.12) 1px, transparent 1px);
  --st-pattern-opacity: 1;
  --st-admin-sidebar: rgba(7, 25, 34, 0.94);
  --st-admin-shell: rgba(8, 25, 34, 0.92);
  --st-admin-panel: rgba(12, 35, 47, 0.94);
  --st-input-bg: rgba(5, 24, 33, 0.92);
  --st-input-border: rgba(103, 232, 249, 0.24);
  --st-control-bg: rgba(20, 52, 66, 0.82);
  --st-control-border: rgba(103, 232, 249, 0.24);
  --st-action-bg: linear-gradient(135deg, #22d3ee, #0ea5e9);
  --st-action-bg-hover: linear-gradient(135deg, #67e8f9, #38bdf8);
  --st-action-fg: #04232d;
  --st-link: #67e8f9;
  --st-link-hover: #a5f3fc;
  --st-focus-ring: rgba(34, 211, 238, 0.3);
  --st-hover-bg: rgba(103, 232, 249, 0.1);
  --st-table-line: rgba(103, 232, 249, 0.16);
  --st-heading: #ecfeff;
  --st-success-bg: rgba(52, 211, 153, 0.16);
  --st-success-fg: #a7f3d0;
  --st-success-border: rgba(52, 211, 153, 0.38);
  --st-danger-bg: rgba(251, 113, 133, 0.16);
  --st-danger-fg: #fecdd3;
  --st-danger-border: rgba(251, 113, 133, 0.38);
  --st-product-btn-bg: linear-gradient(135deg, #22d3ee, #0ea5e9);
  --st-product-btn-bg-hover: linear-gradient(135deg, #67e8f9, #38bdf8);
  --st-product-btn-fg: #04232d;
  --st-product-btn-fg-hover: #04232d;
  --st-product-btn-border: rgba(103, 232, 249, 0.5);
  --st-product-btn-shadow: 0 8px 18px rgba(14, 165, 233, 0.25);
}

html.site-theme-grid::before {
  background-size: 24px 24px, 24px 24px, 16px 16px;
  background-position: 0 0, 0 0, 8px 8px;
}

html.site-theme-grid.theme-light {
  --st-canvas: #eef7f9;
  --st-text: #12313b;
  --st-text-muted: #5f7780;
  --st-accent: #0f7892;
  --st-accent-soft: rgba(15, 120, 146, 0.11);
  --st-card-bg: rgba(255, 255, 255, 0.94);
  --st-card-border: rgba(15, 120, 146, 0.2);
  --st-surface-bg: rgba(238, 250, 252, 0.95);
  --st-surface-border: rgba(15, 120, 146, 0.18);
  --st-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
  --st-shadow-sm: 0 10px 24px rgba(15, 23, 42, 0.06);
  --st-pattern:
    linear-gradient(rgba(100, 116, 139, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 116, 139, 0.09) 1px, transparent 1px),
    radial-gradient(circle, rgba(100, 116, 139, 0.14) 1px, transparent 1px);
  --st-admin-sidebar: rgba(232, 248, 250, 0.96);
  --st-admin-shell: rgba(245, 252, 253, 0.96);
  --st-admin-panel: rgba(255, 255, 255, 0.96);
  --st-input-bg: #ffffff;
  --st-input-border: rgba(15, 120, 146, 0.25);
  --st-control-bg: #f1fbfc;
  --st-control-border: rgba(15, 120, 146, 0.22);
  --st-action-bg: linear-gradient(135deg, #0f7892, #0e9fbb);
  --st-action-bg-hover: linear-gradient(135deg, #0d6478, #0f7892);
  --st-action-fg: #ffffff;
  --st-link: #0b718a;
  --st-link-hover: #07566a;
  --st-focus-ring: rgba(15, 120, 146, 0.2);
  --st-hover-bg: rgba(15, 120, 146, 0.08);
  --st-table-line: rgba(15, 120, 146, 0.14);
  --st-heading: #12313b;
  --st-success-bg: rgba(5, 150, 105, 0.11);
  --st-success-fg: #047857;
  --st-success-border: rgba(5, 150, 105, 0.28);
  --st-danger-bg: rgba(225, 29, 72, 0.09);
  --st-danger-fg: #be123c;
  --st-danger-border: rgba(225, 29, 72, 0.25);
  --st-product-btn-bg: linear-gradient(135deg, #0f7892, #0e9fbb);
  --st-product-btn-bg-hover: linear-gradient(135deg, #0d6478, #0f7892);
  --st-product-btn-fg: #ffffff;
  --st-product-btn-fg-hover: #ffffff;
  --st-product-btn-border: rgba(15, 120, 146, 0.3);
  --st-product-btn-shadow: 0 8px 18px rgba(15, 120, 146, 0.18);
}

/* —— 4. 高级渐变 —— */
html.site-theme-gradient {
  --st-canvas: linear-gradient(135deg, #111827 0%, #1e293b 46%, #30243a 100%);
  --st-text: #f1f5f9;
  --st-text-muted: #a5b4c7;
  --st-accent: #fbbf24;
  --st-accent-soft: rgba(251, 191, 36, 0.16);
  --st-card-bg: rgba(25, 34, 50, 0.78);
  --st-card-border: rgba(203, 213, 225, 0.2);
  --st-surface-bg: rgba(51, 65, 85, 0.48);
  --st-surface-border: rgba(203, 213, 225, 0.16);
  --st-glass-blur: 20px;
  --st-glass-frost: blur(20px) saturate(1.25);
  --st-glass-frost-md: blur(16px) saturate(1.2);
  --st-glass-frost-sm: blur(12px);
  --st-glass-frost-xs: blur(10px);
  --st-glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  --st-shadow: 0 16px 34px rgba(8, 12, 24, 0.28);
  --st-shadow-sm: 0 10px 22px rgba(8, 12, 24, 0.18);
  --st-use-blur: 1;
  --st-pattern: none;
  --st-pattern-opacity: 0;
  --st-admin-sidebar: rgba(17, 24, 39, 0.8);
  --st-admin-shell: rgba(20, 28, 44, 0.76);
  --st-admin-panel: rgba(25, 34, 50, 0.82);
  --st-input-bg: rgba(15, 23, 42, 0.72);
  --st-input-border: rgba(203, 213, 225, 0.2);
  --st-control-bg: rgba(51, 65, 85, 0.54);
  --st-control-border: rgba(203, 213, 225, 0.2);
  --st-action-bg: linear-gradient(135deg, #fbbf24, #f97316);
  --st-action-bg-hover: linear-gradient(135deg, #fcd34d, #fb923c);
  --st-action-fg: #291508;
  --st-link: #fde68a;
  --st-link-hover: #fef3c7;
  --st-focus-ring: rgba(251, 191, 36, 0.3);
  --st-hover-bg: rgba(251, 191, 36, 0.1);
  --st-table-line: rgba(203, 213, 225, 0.16);
  --st-heading: #fff7ed;
  --st-success-bg: rgba(52, 211, 153, 0.15);
  --st-success-fg: #a7f3d0;
  --st-success-border: rgba(52, 211, 153, 0.34);
  --st-danger-bg: rgba(251, 113, 133, 0.15);
  --st-danger-fg: #fecdd3;
  --st-danger-border: rgba(251, 113, 133, 0.34);
  --st-product-btn-bg: linear-gradient(135deg, #fbbf24, #f97316);
  --st-product-btn-bg-hover: linear-gradient(135deg, #fcd34d, #fb923c);
  --st-product-btn-fg: #291508;
  --st-product-btn-fg-hover: #291508;
  --st-product-btn-border: rgba(251, 191, 36, 0.48);
  --st-product-btn-shadow: 0 8px 18px rgba(249, 115, 22, 0.24);
}

html.site-theme-gradient.theme-light {
  --st-canvas: linear-gradient(135deg, #f8fafc 0%, #e8eef7 48%, #fff1e8 100%);
  --st-text: #273449;
  --st-text-muted: #6b778a;
  --st-accent: #b45309;
  --st-accent-soft: rgba(180, 83, 9, 0.11);
  --st-card-bg: rgba(255, 255, 255, 0.76);
  --st-card-border: rgba(148, 163, 184, 0.24);
  --st-surface-bg: rgba(255, 255, 255, 0.62);
  --st-surface-border: rgba(148, 163, 184, 0.2);
  --st-shadow: 0 18px 40px rgba(71, 85, 105, 0.1);
  --st-shadow-sm: 0 12px 28px rgba(71, 85, 105, 0.08);
  --st-admin-sidebar: rgba(255, 255, 255, 0.78);
  --st-admin-shell: rgba(255, 255, 255, 0.72);
  --st-admin-panel: rgba(255, 255, 255, 0.8);
  --st-input-bg: rgba(255, 255, 255, 0.82);
  --st-input-border: rgba(100, 116, 139, 0.28);
  --st-control-bg: rgba(255, 255, 255, 0.72);
  --st-control-border: rgba(100, 116, 139, 0.24);
  --st-action-bg: linear-gradient(135deg, #d97706, #ea580c);
  --st-action-bg-hover: linear-gradient(135deg, #b45309, #c2410c);
  --st-action-fg: #ffffff;
  --st-link: #a16207;
  --st-link-hover: #854d0e;
  --st-focus-ring: rgba(180, 83, 9, 0.2);
  --st-hover-bg: rgba(180, 83, 9, 0.08);
  --st-table-line: rgba(100, 116, 139, 0.18);
  --st-heading: #273449;
  --st-success-bg: rgba(5, 150, 105, 0.1);
  --st-success-fg: #047857;
  --st-success-border: rgba(5, 150, 105, 0.24);
  --st-danger-bg: rgba(225, 29, 72, 0.08);
  --st-danger-fg: #be123c;
  --st-danger-border: rgba(225, 29, 72, 0.22);
  --st-product-btn-bg: linear-gradient(135deg, #d97706, #ea580c);
  --st-product-btn-bg-hover: linear-gradient(135deg, #b45309, #c2410c);
  --st-product-btn-fg: #ffffff;
  --st-product-btn-fg-hover: #ffffff;
  --st-product-btn-border: rgba(180, 83, 9, 0.34);
  --st-product-btn-shadow: 0 8px 18px rgba(180, 83, 9, 0.18);
}

/* —— 5. 3D 炫彩流体 —— */
html.site-theme-fluid {
  --st-canvas: #0a0c12;
  --st-text: #f1f5f9;
  --st-text-muted: #a1a8b8;
  --st-accent: #a78bfa;
  --st-accent-soft: rgba(167, 139, 250, 0.18);
  --st-card-bg: rgba(18, 22, 36, 0.55);
  --st-card-border: rgba(255, 255, 255, 0.1);
  --st-surface-bg: rgba(255, 255, 255, 0.06);
  --st-surface-border: rgba(255, 255, 255, 0.1);
  --st-glass-blur: 28px;
  --st-glass-frost: blur(28px) saturate(1.5);
  --st-glass-frost-md: blur(22px) saturate(1.45);
  --st-glass-frost-sm: blur(16px) saturate(1.4);
  --st-glass-frost-xs: blur(12px);
  --st-glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --st-shadow: 0 18px 38px rgba(4, 6, 20, 0.32);
  --st-shadow-sm: 0 10px 24px rgba(4, 6, 20, 0.22);
  --st-use-blur: 1;
  --st-pattern: none;
  --st-pattern-opacity: 0;
  --st-overlay:
    radial-gradient(ellipse 55% 45% at 15% 25%, rgba(99, 102, 241, 0.42), transparent 55%),
    radial-gradient(ellipse 50% 40% at 85% 70%, rgba(56, 189, 248, 0.35), transparent 50%),
    radial-gradient(ellipse 45% 38% at 55% 15%, rgba(244, 114, 182, 0.22), transparent 48%),
    radial-gradient(ellipse 40% 35% at 30% 80%, rgba(52, 211, 153, 0.18), transparent 45%);
  --st-overlay-opacity: 1;
  --st-overlay-animation: st-fluid-drift 18s ease-in-out infinite alternate;
  --st-admin-sidebar: rgba(14, 18, 32, 0.58);
  --st-admin-shell: rgba(16, 20, 34, 0.52);
  --st-admin-panel: rgba(18, 22, 36, 0.58);
  --st-input-bg: rgba(10, 15, 28, 0.72);
  --st-input-border: rgba(196, 181, 253, 0.24);
  --st-control-bg: rgba(255, 255, 255, 0.08);
  --st-control-border: rgba(255, 255, 255, 0.15);
  --st-action-bg: linear-gradient(135deg, #a78bfa, #22d3ee);
  --st-action-bg-hover: linear-gradient(135deg, #c4b5fd, #67e8f9);
  --st-action-fg: #111827;
  --st-link: #c4b5fd;
  --st-link-hover: #e0e7ff;
  --st-focus-ring: rgba(167, 139, 250, 0.32);
  --st-hover-bg: rgba(167, 139, 250, 0.12);
  --st-table-line: rgba(255, 255, 255, 0.12);
  --st-heading: #faf5ff;
  --st-success-bg: rgba(52, 211, 153, 0.15);
  --st-success-fg: #a7f3d0;
  --st-success-border: rgba(52, 211, 153, 0.34);
  --st-danger-bg: rgba(244, 114, 182, 0.16);
  --st-danger-fg: #fbcfe8;
  --st-danger-border: rgba(244, 114, 182, 0.36);
  --st-product-btn-bg: linear-gradient(135deg, #a78bfa, #22d3ee);
  --st-product-btn-bg-hover: linear-gradient(135deg, #c4b5fd, #67e8f9);
  --st-product-btn-fg: #111827;
  --st-product-btn-fg-hover: #111827;
  --st-product-btn-border: rgba(196, 181, 253, 0.46);
  --st-product-btn-shadow: 0 10px 22px rgba(99, 102, 241, 0.28);
}

html.site-theme-fluid.theme-light {
  --st-canvas: linear-gradient(160deg, #f0f4ff 0%, #faf5ff 50%, #f0fdfa 100%);
  --st-text: #1e1b4b;
  --st-text-muted: #64748b;
  --st-accent: #6366f1;
  --st-accent-soft: rgba(99, 102, 241, 0.12);
  --st-card-bg: rgba(255, 255, 255, 0.45);
  --st-card-border: rgba(255, 255, 255, 0.35);
  --st-surface-bg: rgba(255, 255, 255, 0.56);
  --st-surface-border: rgba(99, 102, 241, 0.18);
  --st-overlay:
    radial-gradient(ellipse 55% 45% at 20% 30%, rgba(129, 140, 248, 0.35), transparent 55%),
    radial-gradient(ellipse 50% 40% at 80% 65%, rgba(56, 189, 248, 0.28), transparent 50%),
    radial-gradient(ellipse 45% 38% at 50% 10%, rgba(244, 114, 182, 0.2), transparent 48%);
  --st-admin-sidebar: rgba(255, 255, 255, 0.42);
  --st-admin-shell: rgba(255, 255, 255, 0.38);
  --st-admin-panel: rgba(255, 255, 255, 0.48);
  --st-input-bg: rgba(255, 255, 255, 0.68);
  --st-input-border: rgba(99, 102, 241, 0.22);
  --st-control-bg: rgba(255, 255, 255, 0.56);
  --st-control-border: rgba(99, 102, 241, 0.18);
  --st-action-bg: linear-gradient(135deg, #6366f1, #0891b2);
  --st-action-bg-hover: linear-gradient(135deg, #4f46e5, #0e7490);
  --st-action-fg: #ffffff;
  --st-link: #4f46e5;
  --st-link-hover: #3730a3;
  --st-focus-ring: rgba(99, 102, 241, 0.2);
  --st-hover-bg: rgba(99, 102, 241, 0.08);
  --st-table-line: rgba(99, 102, 241, 0.15);
  --st-heading: #27215b;
  --st-success-bg: rgba(5, 150, 105, 0.1);
  --st-success-fg: #047857;
  --st-success-border: rgba(5, 150, 105, 0.24);
  --st-danger-bg: rgba(225, 29, 72, 0.08);
  --st-danger-fg: #be123c;
  --st-danger-border: rgba(225, 29, 72, 0.22);
  --st-product-btn-bg: linear-gradient(135deg, #6366f1, #0891b2);
  --st-product-btn-bg-hover: linear-gradient(135deg, #4f46e5, #0e7490);
  --st-product-btn-fg: #ffffff;
  --st-product-btn-fg-hover: #ffffff;
  --st-product-btn-border: rgba(99, 102, 241, 0.3);
  --st-product-btn-shadow: 0 8px 18px rgba(99, 102, 241, 0.18);
}

/* —— 6. 低饱和纯色 —— */
html.site-theme-muted {
  --st-canvas: #1a1d21;
  --st-text: #e5e7eb;
  --st-text-muted: #9ca3af;
  --st-accent: #6b9bd1;
  --st-accent-soft: rgba(107, 155, 209, 0.15);
  --st-card-bg: #24282e;
  --st-card-border: #343a42;
  --st-surface-bg: #2c3138;
  --st-surface-border: #3d4450;
  --st-glass-blur: 0;
  --st-glass-frost: none;
  --st-glass-frost-md: none;
  --st-glass-frost-sm: none;
  --st-glass-frost-xs: none;
  --st-glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --st-shadow:
    0 1px 2px rgba(0, 0, 0, 0.2),
    0 8px 24px rgba(0, 0, 0, 0.28),
    0 20px 40px rgba(0, 0, 0, 0.18);
  --st-shadow-sm:
    0 1px 2px rgba(0, 0, 0, 0.15),
    0 6px 16px rgba(0, 0, 0, 0.22);
  --st-use-blur: 0;
  --st-pattern: none;
  --st-pattern-opacity: 0;
  --st-admin-sidebar: #22262c;
  --st-admin-shell: #1e2227;
  --st-admin-panel: #24282e;
  --st-input-bg: #1e2227;
  --st-input-border: #454c55;
  --st-control-bg: #2c3138;
  --st-control-border: #505862;
  --st-action-bg: #6b9bd1;
  --st-action-bg-hover: #7da9d8;
  --st-action-fg: #101820;
  --st-link: #8fb5df;
  --st-link-hover: #b0cbea;
  --st-focus-ring: rgba(107, 155, 209, 0.28);
  --st-hover-bg: rgba(255, 255, 255, 0.07);
  --st-table-line: #3b424b;
  --st-heading: #f0f2f4;
  --st-success-bg: rgba(74, 150, 103, 0.17);
  --st-success-fg: #b8dfc3;
  --st-success-border: rgba(116, 190, 137, 0.34);
  --st-danger-bg: rgba(187, 82, 82, 0.16);
  --st-danger-fg: #f0b7b7;
  --st-danger-border: rgba(220, 125, 125, 0.34);
  --st-product-btn-bg: #6b9bd1;
  --st-product-btn-bg-hover: #7da9d8;
  --st-product-btn-fg: #101820;
  --st-product-btn-fg-hover: #101820;
  --st-product-btn-border: #8aaed5;
  --st-product-btn-shadow: 0 6px 16px rgba(55, 77, 104, 0.3);
}

html.site-theme-muted.theme-light {
  --st-canvas: #f0f2f5;
  --st-text: #1f2937;
  --st-text-muted: #6b7280;
  --st-accent: #4b7bb5;
  --st-accent-soft: rgba(75, 123, 181, 0.1);
  --st-card-bg: #ffffff;
  --st-card-border: #e5e7eb;
  --st-surface-bg: #f9fafb;
  --st-surface-border: #e5e7eb;
  --st-glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --st-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 6px 20px rgba(15, 23, 42, 0.06),
    0 16px 40px rgba(15, 23, 42, 0.05);
  --st-shadow-sm:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 4px 14px rgba(15, 23, 42, 0.06);
  --st-admin-sidebar: #ffffff;
  --st-admin-shell: #ffffff;
  --st-admin-panel: #ffffff;
  --st-input-bg: #ffffff;
  --st-input-border: #d4d9df;
  --st-control-bg: #f7f8fa;
  --st-control-border: #d4d9df;
  --st-action-bg: #4b7bb5;
  --st-action-bg-hover: #3f6b9f;
  --st-action-fg: #ffffff;
  --st-link: #3f6b9f;
  --st-link-hover: #315780;
  --st-focus-ring: rgba(75, 123, 181, 0.2);
  --st-hover-bg: rgba(75, 123, 181, 0.07);
  --st-table-line: #e2e5e9;
  --st-heading: #1f2937;
  --st-success-bg: rgba(22, 101, 52, 0.08);
  --st-success-fg: #166534;
  --st-success-border: rgba(22, 101, 52, 0.2);
  --st-danger-bg: rgba(185, 28, 28, 0.07);
  --st-danger-fg: #b91c1c;
  --st-danger-border: rgba(185, 28, 28, 0.2);
  --st-product-btn-bg: #4b7bb5;
  --st-product-btn-bg-hover: #3f6b9f;
  --st-product-btn-fg: #ffffff;
  --st-product-btn-fg-hover: #ffffff;
  --st-product-btn-border: #6d94c1;
  --st-product-btn-shadow: 0 6px 16px rgba(75, 123, 181, 0.2);
}

/* Glass keeps its original visual language; these semantic tokens only let
   shared controls follow the same palette as the other themes. */
html.site-theme-glass,
html.site-theme-random {
  --st-input-bg: rgba(15, 23, 42, 0.5);
  --st-input-border: rgba(255, 255, 255, 0.14);
  --st-control-bg: rgba(255, 255, 255, 0.06);
  --st-control-border: rgba(255, 255, 255, 0.12);
  --st-action-bg: linear-gradient(135deg, #7dd3fc, #38bdf8);
  --st-action-bg-hover: linear-gradient(135deg, #bae6fd, #67e8f9);
  --st-action-fg: #082032;
  --st-link: #7dd3fc;
  --st-link-hover: #bae6fd;
  --st-focus-ring: rgba(125, 211, 252, 0.3);
  --st-hover-bg: rgba(255, 255, 255, 0.08);
  --st-table-line: rgba(255, 255, 255, 0.1);
  --st-heading: #f8fafc;
  --st-success-bg: rgba(34, 197, 94, 0.15);
  --st-success-fg: #bbf7d0;
  --st-success-border: rgba(74, 222, 128, 0.35);
  --st-danger-bg: rgba(239, 68, 68, 0.12);
  --st-danger-fg: #fecaca;
  --st-danger-border: rgba(248, 113, 113, 0.35);
  --st-product-btn-bg: linear-gradient(135deg, rgba(56, 189, 248, 0.28), rgba(14, 165, 233, 0.22));
  --st-product-btn-bg-hover: linear-gradient(135deg, rgba(56, 189, 248, 0.36), rgba(14, 165, 233, 0.3));
  --st-product-btn-fg: #e0f2fe;
  --st-product-btn-fg-hover: #e0f2fe;
  --st-product-btn-border: rgba(125, 211, 252, 0.36);
  --st-product-btn-shadow: none;
}

html.site-theme-glass.theme-light,
html.site-theme-random.theme-light {
  --st-input-bg: rgba(255, 255, 255, 0.35);
  --st-input-border: rgba(15, 23, 42, 0.12);
  --st-control-bg: rgba(255, 255, 255, 0.18);
  --st-control-border: rgba(15, 23, 42, 0.1);
  --st-action-bg: linear-gradient(135deg, #2563eb, #3b82f6);
  --st-action-bg-hover: linear-gradient(135deg, #1d4ed8, #2563eb);
  --st-action-fg: #ffffff;
  --st-link: #2563eb;
  --st-link-hover: #1d4ed8;
  --st-focus-ring: rgba(37, 99, 235, 0.2);
  --st-hover-bg: rgba(255, 255, 255, 0.2);
  --st-table-line: rgba(148, 163, 184, 0.2);
  --st-heading: #111827;
  --st-success-bg: rgba(240, 253, 244, 0.95);
  --st-success-fg: #166534;
  --st-success-border: rgba(134, 239, 172, 0.9);
  --st-danger-bg: rgba(254, 242, 242, 0.95);
  --st-danger-fg: #b91c1c;
  --st-danger-border: rgba(254, 202, 202, 0.9);
  --st-product-btn-bg: linear-gradient(135deg, #2563eb, #3b82f6);
  --st-product-btn-bg-hover: linear-gradient(135deg, #1d4ed8, #2563eb);
  --st-product-btn-fg: #ffffff;
  --st-product-btn-fg-hover: #ffffff;
  --st-product-btn-border: rgba(37, 99, 235, 0.3);
  --st-product-btn-shadow: 0 6px 16px rgba(37, 99, 235, 0.18);
}

/* 无模糊主题：关闭 backdrop-filter（由组件类配合） */
html.site-theme-dark .card,
html.site-theme-dark .category,
html.site-theme-muted .card,
html.site-theme-muted .category,
html.site-theme-dark .admin-shell-card,
html.site-theme-muted .admin-shell-card {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.theme-toggle--locked {
  opacity: 0.85;
  cursor: default;
}

/* 设置页主题预览 */
.theme-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.theme-picker__item {
  position: relative;
  margin: 0;
  cursor: pointer;
}

.theme-picker__item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-picker__card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  border: 2px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.4);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-height: 100px;
}

.theme-picker__item input:checked + .theme-picker__card {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.theme-picker__swatch {
  height: 44px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-picker__swatch--glass {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.35), rgba(99, 102, 241, 0.25)),
    linear-gradient(140deg, #0d1528, #101a30);
}

.theme-picker__swatch--dark {
  background: linear-gradient(180deg, #242424, #121212);
}

.theme-picker__swatch--grid {
  background-color: #08141c;
  background-image:
    linear-gradient(rgba(103, 232, 249, 0.28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(103, 232, 249, 0.28) 1px, transparent 1px),
    radial-gradient(circle, rgba(165, 243, 252, 0.45) 1px, transparent 1px);
  background-size: 10px 10px, 10px 10px, 10px 10px;
}

.theme-picker__swatch--gradient {
  background: linear-gradient(135deg, #111827 0%, #1e293b 48%, #f97316 150%);
}

.theme-picker__swatch--fluid {
  background:
    radial-gradient(circle at 30% 30%, rgba(167, 139, 250, 0.7), transparent 45%),
    radial-gradient(circle at 70% 70%, rgba(56, 189, 248, 0.6), transparent 45%),
    #0a0c12;
}

.theme-picker__swatch--muted {
  background: linear-gradient(180deg, #ffffff, #dfe3e8);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.theme-picker__swatch--random {
  background: conic-gradient(from 210deg, #38bdf8, #a78bfa, #f97316, #fbbf24, #34d399, #38bdf8);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.2);
}

.theme-picker__label {
  font-size: 12px;
  font-weight: 600;
  color: #e5e7eb;
}

.theme-picker__desc {
  font-size: 10px;
  line-height: 1.4;
  color: #94a3b8;
}

html.theme-light .theme-picker__card {
  background: rgba(255, 255, 255, 0.7);
  border-color: #e2e8f0;
}

html.theme-light .theme-picker__label {
  color: #0f172a;
}

html.theme-light .theme-picker__desc {
  color: #64748b;
}

html[class*="site-theme-"] .theme-picker__card {
  background: var(--st-control-bg) !important;
  border-color: var(--st-surface-border) !important;
}

html[class*="site-theme-"] .theme-picker__label {
  color: var(--st-text) !important;
}

html[class*="site-theme-"] .theme-picker__desc {
  color: var(--st-text-muted) !important;
}

html[class*="site-theme-"] .theme-picker__item input:checked + .theme-picker__card {
  border-color: var(--st-accent) !important;
  box-shadow: 0 0 0 3px var(--st-accent-soft) !important;
}
