/* ============================================================================
   设计变量（全站唯一来源）
   ----------------------------------------------------------------------------
   原则：
   1. 语义色沿用 V1 —— 红涨绿跌是 A 股用户的肌肉记忆，改了就是灾难。
   2. 其余颜色全部变量化。V1 里大量硬编码字面值（同一含义出现 4 个近似红），
      这是重写时必须收口的地方。
   3. 只在这里定义"值"，组件只使用变量。要换整体风格，改这一个文件。
   ========================================================================== */

:root {
  /* ── 涨跌语义（不可改方向） ───────────────────────────────── */
  --up: #e5484d;            /* 涨：红 */
  --up-soft: #fff1f1;
  --up-border: #ffd7d7;
  --down: #0ca678;          /* 跌：绿 */
  --down-soft: #ebfaf4;
  --down-border: #c8f0e0;
  --flat: #8b95a1;          /* 平：灰 */
  --flat-soft: #f4f6f8;

  /* ── 表面与背景 ───────────────────────────────────────────── */
  --bg: #f3f5f8;            /* 页面底 */
  --bg-deep: #e9edf2;
  --surface: #ffffff;       /* 卡片 */
  --surface-2: #f8fafc;     /* 内嵌灰块 */
  --surface-3: #f1f4f8;     /* 再次一级 */
  --overlay: rgba(17, 24, 39, 0.42);

  /* ── 描边 ─────────────────────────────────────────────────── */
  --line: #e5e9f0;
  --line-strong: #d3dae4;
  --line-focus: #1c7ed6;

  /* ── 文字（四级） ─────────────────────────────────────────── */
  --text: #1a2230;          /* 正文/数字 */
  --text-2: #46536b;        /* 次级说明 */
  --text-3: #76839b;        /* 标签/时间/弱化 */
  --text-4: #9aa6b8;        /* 辅助/轴标 */

  /* ── 主色与强调 ───────────────────────────────────────────── */
  --accent: #1c7ed6;
  --accent-strong: #1668b8;
  --accent-soft: #e7f0fd;
  --accent-border: #c3ddfb;

  /* ── 功能语义 ─────────────────────────────────────────────── */
  --warn: #d97706;
  --warn-soft: #fff8eb;
  --warn-border: #fbe3b5;
  --danger: #c92a2a;
  --danger-soft: #fff2f2;
  --danger-border: #fbd5d5;
  --success: #0f9d58;
  --success-soft: #ebfaf3;
  --success-border: #c3efdb;

  /* ── 专题色（区块主题，沿用 V1 的辨识度） ─────────────────── */
  --season-gold: #b8860b;
  --season-gold-soft: #fff8e6;
  --season-gold-border: #ffe8a3;

  /* ── 金属色（赛季/荣誉铭牌/奖牌专用） ───────────────────────
     --season-gold 是"暗金"，拼出来的渐变是香槟金，缺 V1 那种饱和正金的冲劲。
     V1 style.css 的金属渐变用的是 #ffd700 / #f0b400 / #ffe066 / #b8860b 一族，
     这里把它们收成一组语义变量：任何"金属质感"的东西只准引用这七个值。
       hi   = 受光面（高光，最亮）
       mid  = 正金（主体色，V1 的主金）
       lo   = 背光面（暗部）
       deep = 最深（描边/阴影/暗刻线）
       edge = 边沿高光（细描边、扫光起点）
       ink  = 金底上的文字（深棕，V1 的 #5c4200）
       wash = 极淡金底（卡片/胶囊底色）
       text = 金色**文字**（直接写在普通底色上的金）
              它和"金色面"是两种用法：亮色主题下金面要深到 #b8860b 才读得清，
              夜间主题下正好反过来 —— 深金贴在深底上等于看不见。所以单列一个变量，
              两套主题各给一个"和自己的底有足够对比"的值。 */
  --metal-hi: #ffe066;
  --metal-mid: #ffd700;
  --metal-lo: #f0b400;
  --metal-deep: #b8860b;
  --metal-edge: #fff3a8;
  --metal-ink: #5c4200;
  --metal-wash: #fffbe8;
  --metal-text: #b8860b;
  --lottery: #862e9c;
  --lottery-soft: #fcf7fe;
  --lottery-border: #ecd9f1;
  --lottery-ball: #cb354b;
  --lottery-blue: #1971c2;
  --scratch: #d9480f;
  --scratch-soft: #fff9f2;
  --scratch-border: #ffe0c2;
  --scratch-coat: #ffa94d;

  /* ── 字体 ─────────────────────────────────────────────────── */
  --font: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --fs-2xs: 11px;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;   /* 正文基准，与 V1 一致 */
  --fs-lg: 16px;
  --fs-xl: 19px;
  --fs-2xl: 24px;
  --fs-3xl: 30px;

  --lh-tight: 1.25;
  --lh: 1.55;
  --lh-loose: 1.75;

  /* ── 间距（4 的倍数，V1 的节奏） ──────────────────────────── */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s7: 32px;
  --s8: 40px;

  /* ── 圆角 ─────────────────────────────────────────────────── */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;

  /* ── 阴影（比 V1 克制，靠"薄"而不是"重"） ────────────────── */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08), 0 2px 4px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.14), 0 4px 8px rgba(16, 24, 40, 0.06);
  --ring: 0 0 0 3px rgba(28, 126, 214, 0.18);

  /* ── 尺寸 ─────────────────────────────────────────────────── */
  --col-season: 246px;      /* 左栏（V1 实测值） */
  --col-side: 272px;        /* 右栏（V1 实测值） */
  --content-max: 1280px;
  --header-h: 62px;

  /* ── 动效 ─────────────────────────────────────────────────── */
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  /* ── 层级 ─────────────────────────────────────────────────── */
  --z-header: 50;
  --z-dropdown: 200;
  --z-modal: 1000;
  --z-toast: 1300;
}

/* 极简深色主题：只翻转表面与文字，语义色保持不变（红涨绿跌不因主题而变） */
[data-theme="night"] {
  --bg: #11161f;
  --bg-deep: #0c1117;
  --surface: #18202c;
  --surface-2: #1f2937;
  --surface-3: #26313f;
  --line: #2a3646;
  --line-strong: #3a4a5e;
  --text: #e7edf6;
  --text-2: #b4c0d2;
  --text-3: #8b99ad;
  --text-4: #6b7a8f;
  --accent: #4a9eff;
  --accent-strong: #6fb0ff;
  --accent-soft: #16273d;
  --accent-border: #21456b;
  --up-soft: #2a1a1c;
  --up-border: #4a2529;
  --down-soft: #10241e;
  --down-border: #1c453a;
  --flat-soft: #1d2530;
  --warn-soft: #2a2313;
  --warn-border: #4a3a16;
  --danger-soft: #2a1919;
  --danger-border: #4a2424;
  --success-soft: #10241c;
  --success-border: #1c4536;
  --season-gold-soft: #2a2313;
  --season-gold-border: #4a3a16;
  /* 金属色夜间档：整体压暗一档，但保持"金"而不是变铜。
     不能沿用亮色那套 —— #ffd700 在深底上会刺眼到发绿，且和暗背景对比失衡。 */
  --metal-hi: #e2ba3c;
  --metal-mid: #c9a227;
  --metal-lo: #a5821a;
  --metal-deep: #7d5f10;
  --metal-edge: #f2dc94;
  --metal-ink: #2a1e02;
  --metal-wash: #2a2313;
  --metal-text: #e2ba3c;
  --lottery-soft: #241a29;
  --lottery-border: #3f2a47;
  --scratch-soft: #2a1f14;
  --scratch-border: #4a3520;
  --overlay: rgba(0, 0, 0, 0.62);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, 0.55);
}

/* ── 密度变体：只改间距，不动字号（避免排版崩） ─────────────── */
[data-density="compact"] {
  --s3: 8px;
  --s4: 12px;
  --s5: 16px;
  --s6: 18px;
}
[data-density="spacious"] {
  --s3: 14px;
  --s4: 20px;
  --s5: 26px;
  --s6: 30px;
}