/* theme.css —— 主题令牌 + 暗色覆盖
   初版由 tools/theme_tokenize.py 一次性生成（把全站硬编码色换成令牌）；
   之后新增令牌按需手改本文件即可，不必重跑生成器（生成器只做迁移）。 */
/* 亮色值 = 令牌化时界面上实际在用的值，保证亮色视觉零变化 */

:root {
  --bad-border: #fecaca;
  --bad-border-2: #fee4e2;
  --bad-strong: #dc2626;
  --bad-text: #b42318;
  --bad-tint: #fef3f2;
  --bad-tint-2: #fdf5f4;
  --info-text: #2563eb;
  --ok-strong: #22a06b;
  --surface-hover: #eef2f7;
  --brand-200-s: #c7d2fe;
  --brand-soft: #a855f7;
  --brand-tint: #f5f3ff;
  --brand-tint-2: #ddd6fe;
  --hero-1: #0d0b1f;
  --hero-2: #120f2e;
  --hero-3: #16123a;
  --hero-4: #1d1747;
  --hero-5: #2b2260;
  --info-strong: #1d4ed8;
  --line-soft: #eceff4;
  --ok-border: #c6e9d6;
  --ok-text: #1a7f4b;
  --ok-tint: #e8f6ee;
  --ok-tint-2: #f4fbf7;
  --surface-blur: rgba(255, 255, 255, .85);
  --surface-blur-2: rgba(255, 255, 255, .82);
  --surface-soft: #fafbfc;
  --surface-sunken: #f2f4f8;
  --text-body: #4a5568;
  --text-soft: #7c8698;
  --text-soft-2: #8a94a6;
  --text-title: #2d3444;
  --warn-border: #fde68a;
  --warn-border-2: #fde3a7;
  --warn-strong: #d97706;
  --warn-text: #92400e;
  --warn-tint: #fffbeb;
  --x000000-s: #000000;
  --x059669: #059669;
  --x07c160: #07c160;
  --x111111: #111111;
  --x1a7f4b-s: #1a7f4b;
  --x1f2937-s: #1f2937;
  --x22a06b-s: #22a06b;
  --x2f7dfb: #2f7dfb;
  --x34d399-s: #34d399;
  --x5b6472: #5b6472;
  --x67e8f9-s: #67e8f9;
  --x6ee7b7-s: #6ee7b7;
  --x86efac: #86efac;
  --x98a2b3: #98a2b3;
  --xa6adba: #a6adba;
  --xa7f3d0-s: #a7f3d0;
  --xb7ebcd-s: #b7ebcd;
  --xb9c6d6-s: #b9c6d6;
  --xbae6fd-s: #bae6fd;
  --xbe185d: #be185d;
  --xc0392b: #c0392b;
  --xc2410c: #c2410c;
  --xc2daff-s: #c2daff;
  --xc4b5fd-s: #c4b5fd;
  --xc6d2e0-s: #c6d2e0;
  --xd1fae5-s: #d1fae5;
  --xd5dde8-s: #d5dde8;
  --xd6ecdf-s: #d6ecdf;
  --xd7e5ff-s: #d7e5ff;
  --xd92d20: #d92d20;
  --xd97706-s: #d97706;
  --xdc2626-s: #dc2626;
  --xddd6fe: #ddd6fe;
  --xdfe3e8-s: #dfe3e8;
  --xe2e8f0-s: #e2e8f0;
  --xe5e7eb-s: #e5e7eb;
  --xe6eefc-s: #e6eefc;
  --xe9f9f1-s: #e9f9f1;
  --xf04438-s: #f04438;
  --xf2f7ff-s: #f2f7ff;
  --xf7dbd8-s: #f7dbd8;
  --xf97316-s: #f97316;
  --xfbcfe8-s: #fbcfe8;
  --xfca5a5-s: #fca5a5;
  --xfda29b-s: #fda29b;
  --xfdf2f8-s: #fdf2f8;
  --xfef3c7-s: #fef3c7;
  --xffedd5-s: #ffedd5;
  --xfffafa-s: #fffafa;
}

[data-theme="dark"] {
  color-scheme: dark;
  --amount-down: #34d399;
  --amount-up: #f87171;
  --bad-border: #6d2b2b;
  --bad-border-2: #5c2626;
  --bad-strong: #f87171;
  --bad-text: #fca5a5;
  --bad-tint: #2a1618;
  --bad-tint-2: #241315;
  --bg-body: #0f141d;
  --bg-card: #171e2a;
  --border: #26303f;
  --border-strong: #3d4b60;
  --brand-100: #252a4f;
  --brand-200: #b8c6ff;
  --brand-200-s: #333a68;
  --brand-300: #4d55a3;
  --brand-400: #818cf8;
  --brand-50: #1d2140;
  --brand-500: #818cf8;
  --brand-600: #818cf8;
  --brand-700: #a5b4fc;
  --brand-soft: #c084fc;
  --brand-tint: #221d3d;
  --brand-tint-2: #3b2f6b;
  --cyan-500: #22d3ee;
  --danger-50: #2a1518;
  --danger-500: #f87171;
  --danger-700: #fca5a5;
  --hero-1: #0d0b1f;
  --hero-2: #120f2e;
  --hero-3: #16123a;
  --hero-4: #1d1747;
  --hero-5: #2b2260;
  --info-50: #12253c;
  --info-500: #38bdf8;
  --info-700: #7dd3fc;
  --info-strong: #3b82f6;
  --info-text: #60a5fa;
  --line-soft: #232c3c;
  --n-100: #222b3a;
  --n-200: #2a3444;
  --n-25: #1a2230;
  --n-300: #4a566b;
  --n-400: #7f8b9d;
  --n-50: #1c2432;
  --n-500: #8e9aac;
  --n-600: #a9b4c4;
  --n-700: #c4cdda;
  --n-800: #dee4ee;
  --n-900: #f0f4fa;
  --ok-border: #245c3f;
  --ok-strong: #34d399;
  --ok-text: #4ade80;
  --ok-tint: #132a20;
  --ok-tint-2: #16281f;
  --sh-brand: 0 10px 26px rgba(99, 102, 241, .45);
  --sh-lg: 0 18px 44px rgba(0, 0, 0, .6);
  --sh-md: 0 6px 18px rgba(0, 0, 0, .5);
  --sh-sm: 0 1px 3px rgba(0, 0, 0, .55), 0 1px 2px rgba(0, 0, 0, .45);
  --sh-xs: 0 1px 2px rgba(0, 0, 0, .5);
  --success-50: #12251c;
  --success-500: #34d399;
  --success-700: #4ade80;
  --surface-blur: rgba(18, 23, 33, .88);
  --surface-blur-2: rgba(18, 23, 33, .82);
  --surface-hover: #212b3b;
  --surface-soft: #1b2330;
  --surface-sunken: #131a24;
  --text: #ccd5e1;
  --text-body: #bac4d2;
  --text-faint: #8895a7;
  --text-muted: #95a2b4;
  --text-soft: #8f9bad;
  --text-soft-2: #9ba7b9;
  --text-strong: #eef2f8;
  --text-title: #e7ecf4;
  --violet-500: #a78bfa;
  --violet-600: #a78bfa;
  --violet-700: #c4b5fd;
  --warn-border: #6b5420;
  --warn-border-2: #5e4a1c;
  --warn-strong: #fbbf24;
  --warn-text: #fcd34d;
  --warn-tint: #2a2110;
  --warning-50: #2a2110;
  --warning-500: #fbbf24;
  --warning-700: #fcd34d;
  --white: #ffffff;
  --x000000-s: #dddfe3;
  --x059669: #41fdc3;
  --x07c160: #6efdb3;
  --x111111: #dadce1;
  --x1a7f4b-s: #1cb064;
  --x1f2937-s: #2b3a52;   /* 深色 tooltip（--x1f2937 本身未被引用，已删） */
  --x22a06b-s: #23d288;
  --x2f7dfb: #448cff;
  --x34d399-s: #58e2b0;
  --x5b6472: #b0b6c0;
  --x67e8f9-s: #9bf2fd;
  --x6ee7b7-s: #a1f2d1;
  --x86efac: #9af4bb;
  --x98a2b3: #b9bdc5;
  --xa6adba: #c4c8cf;
  --xa7f3d0-s: #22593f;
  --xb7ebcd-s: #225939;
  --xb9c6d6-s: #434751;
  --xbae6fd-s: #224659;
  --xbe185d: #f387b3;
  --xc0392b: #eca9a2;
  --xc2410c: #fa9d77;
  --xc2daff-s: #223759;
  --xc4b5fd-s: #2d2259;
  --xc6d2e0-s: #434751;
  --xd1fae5-s: #22593d;
  --xd5dde8-s: #2e3138;
  --xd6ecdf-s: #275439;
  --xd7e5ff-s: #223559;
  --xd92d20: #f4ada8;
  --xd97706-s: #ff9113;
  --xdc2626-s: #ea4b4b;
  --xddd6fe: #c4b8ff;
  --xdfe3e8-s: #2e3138;
  --xe2e8f0-s: #2e3138;
  --xe5e7eb-s: #2e3138;
  --xe6eefc-s: #223659;
  --xe9f9f1-s: #22593d;
  --xf04438-s: #f8776e;
  --xf2f7ff-s: #223759;
  --xf7dbd8-s: #592722;
  --xf97316-s: #ff8d3d;
  --xfbcfe8-s: #592241;
  --xfca5a5-s: #592222;
  --xfda29b-s: #592622;
  --xfdf2f8-s: #592240;
  --xfef3c7-s: #594e22;
  --xffedd5-s: #594122;
  --xfffafa-s: #592222;
}

/* 图表 SVG 的呈现属性没令牌化（var() 在呈现属性里支持不稳），用属性选择器覆盖。
   呈现属性的优先级低于任何 CSS 规则，所以这样能生效。
   dashboard.js 是用 setAttribute 画的，DOM 属性值就是这些字面量，所以能选中。 */
[data-theme="dark"] [stroke="#eef2f7"] { stroke: var(--border); }
[data-theme="dark"] [fill="#eef2f7"]   { fill:   var(--border); }
[data-theme="dark"] [stroke="#f1f5f9"] { stroke: var(--surface-hover); }
[data-theme="dark"] [fill="#f1f5f9"]   { fill:   var(--surface-hover); }

[data-theme="light"] { color-scheme: light; }
