/* =====================================================================
   SC 设计契约（2026-11-18 美式复古重制）
   颜色 / 字体 / 间距 / 字号 / 圆角 / 阴影 —— 全站唯一来源。
   页面里只允许引用这里的 token，不允许再写 #1a3c34 / 紫色 / 绿色这类旧值。
   ===================================================================== */
:root {
  color-scheme: light dark;

  /* 品牌色（VI B-09） */
  --sc-red: #c92b30;
  --sc-red-deep: #9d3b30;
  --sc-blue: #377eb8;
  --sc-yellow: #f7ba23;
  --sc-green: #32876f;
  --sc-sand: #e0d2b1;

  /* 中性色 */
  --sc-surface: #f4f1ec;      /* 纸面 */
  --sc-raised: #ffffff;       /* 卡片 */
  --sc-sunken: #ece7de;       /* 凹槽/选中态底 */
  --sc-ink: #2f2c28;          /* 墨 */
  --sc-muted: rgba(47, 44, 40, 0.72);
  --sc-faint: rgba(47, 44, 40, 0.45);
  --sc-line: rgba(47, 44, 40, 0.18);
  --sc-focus: var(--sc-red);

  /* 印刷质感 */
  --sc-halftone: rgba(201, 43, 48, 0.14);
  --sc-rule: 2px;
  --sc-shadow: 3px 3px 0 var(--sc-ink);
  --sc-shadow-lg: 5px 5px 0 var(--sc-ink);
  --sc-on-red: #fff8ee;
  --sc-red-fill: #c92b30;
  --sc-blue-fill: #377eb8;

  /* ===== 字体角色（2026-11-29 看板改版：练习页统一 Alegreya，Anton 退场）=====
     改这套表必须同改：index/timer.html 的 css2 链接 + css/fonts-local.css + assets/fonts/FONTS.md。
     现役家族三支：Alegreya（练习页全部文字 + 标题 + 数字）、Pixelify Sans（仅 Start）、
     Comic Neue（只留在后台 admin.css 的 --font）。
     细节见 设计规范/2026-11-29-看板改版/ 与 AGENTS.md「设计系统」。 */
  /* 练习页正文 / 下拉 / 按钮 / 表格：Alegreya（看板口径：整页一个家族） */
  --font-ui: 'Alegreya', Georgia, 'Songti SC', 'SimSun', 'Noto Serif SC', serif;
  /* 标题：900 正体（模式标题、结算标题、海报大标题） */
  --font-heading: 'Alegreya', Georgia, 'Songti SC', 'SimSun', 'Noto Serif SC', serif;
  /* 标签与题面：800（tab / REDNOTE / 按钮 / 转盘题面 / 计时页题面 / 小写标签） */
  --font-label: 'Alegreya', Georgia, 'Songti SC', 'SimSun', 'Noto Serif SC', serif;
  /* 注记：Alegreya italic 400（步骤 / 摇杆提示 / 星级评语） */
  --font-note: 'Alegreya', Georgia, 'Songti SC', 'SimSun', 'Noto Serif SC', serif;
  /* 数字：Alegreya 900（看板「Alegreya Black」那一档；Anton 已退场） */
  --font-num: 'Alegreya', Georgia, 'Songti SC', 'SimSun', 'Noto Serif SC', serif;
  /* 像素：仅街机 Start 按钮 */
  --font-pixel: 'Pixelify Sans', 'Courier New', monospace;

  /* 街机台面 */
  --console-deck: #f6f3ee;
  --console-edge: #2f2c28;
  --console-dpad: #3a3733;
  --console-dpad-hi: #5b5752;
  --console-arrow: #6f6b65;
  --console-stick: #c92b30;
  --start-lip: #8e1f23;

  /* ===== 文件夹道具 / 纸片（2026-11-27 版式重做）=====
     下拉本体、露出的纸、菜单纸条、RedNote 票根共用这一组，**必须是不透明纸色**：
     `--cream` 为空值时 menu 背景会变完全透明（2026-11-27 实测踩到）。 */
  --cream: #fff8ee;        /* 奶白纸：纸片 / 票根 / 菜单底 */
  --folder: #f0e2c2;       /* 档案夹前盖 */
  --folder-dark: #dcc9a0;  /* 档案夹后盖（露出的一条） */

  /* 间距阶梯：页面里所有间距只取这些值 */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;

  /* 字号阶梯（最小 12px） */
  --fs-11: 0.6875rem;
  --fs-12: 0.75rem;
  --fs-13: 0.8125rem;
  --fs-14: 0.875rem;
  --fs-16: 1rem;
  --fs-18: 1.125rem;
  --fs-20: 1.25rem;
  --fs-24: 1.5rem;
  --fs-28: 1.75rem;
  --fs-36: 2.25rem;
  --fs-44: 2.75rem;
  --fs-56: 3.5rem;
  --fs-72: 4.5rem;

  /* ===== 角色字号三档（2026-11-27 版式重做）=====
     同级共用一个 token，档内不再变；三档按断点在文件末尾覆写。
     ⚠ 题面字号是双源：CSS 给基准，app.js 的 fitTextToWidth() 的 maxFontSize
       必须同步改成同一组值，否则长题会在某一档突然变小。 */
  --fs-title: 36px;    /* 模式标题：Alegreya 900 */
  --fs-reel: 56px;     /* 转盘题面：Alegreya 800 italic（落定 1.15×） */
  --fs-control: 14px;  /* 顶栏控件：tab / 下拉 / RedNote / 按钮 */
  --fs-body: 18px;     /* 正文：选项 / 释义 / 步骤（2026-11-30 修复轮-2 16→18） */
  --fs-note: 18px;     /* 注记：步骤 / 评语 / 提示（Alegreya italic 400） */

  /* 圆角三档 + 胶囊 */
  --r-1: 4px;
  --r-2: 10px;
  --r-3: 16px;
  --r-pill: 999px;

  /* 版心 */
  --maxw: 1560px;
  --gutter: var(--sp-6);
}

/* 平板档：模式标题 28 / 题面 42 / 控件与正文 15 / 注记 15
   2026-11-30 修复轮-5：单列断点 1024 → 1200（1025–1170 双栏装不下 tab + RedNote） */
@media (max-width: 1200px) {
  :root {
    --fs-title: 28px;
    --fs-reel: 42px;
    --fs-body: 16px;
    --fs-note: 16px;
  }
}
/* 手机档：24 / 32 / 13 / 13 / 12 */
@media (max-width: 560px) {
  :root {
    --fs-title: 24px;
    --fs-reel: 32px;
    --fs-control: 13px;
    --fs-body: 13px;
    --fs-note: 12px;
  }
}

/* 深色：系统偏好（可被手动开关覆盖） */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --sc-surface: #1c1a17;
    --sc-raised: #262320;
    --sc-sunken: #14120f;
    --sc-ink: #f2ede3;
    --sc-muted: rgba(242, 237, 227, 0.74);
    --sc-faint: rgba(242, 237, 227, 0.5);
    --sc-line: rgba(242, 237, 227, 0.2);
    --sc-red: #e0524c;
    --sc-red-deep: #b5403a;
    --sc-blue: #6ba3d6;
    --sc-yellow: #f7ba23;
    --sc-green: #4fa890;
    --sc-sand: #8a7355;
    --sc-halftone: rgba(224, 82, 76, 0.18);
    --sc-shadow: 3px 3px 0 #000;
    --sc-shadow-lg: 5px 5px 0 #000;
    --sc-on-red: #fff8ee;
    --sc-red-fill: #b5413b;
    --sc-blue-fill: #3f719e;
    --console-deck: #2a2723;
    --console-edge: #0e0d0b;
    --console-dpad: #45413c;
    --console-dpad-hi: #67625b;
    --console-arrow: #8a857d;
    --start-lip: #6e1a1d;
    --cream: #2b2723;
    --folder: #4a4136;
    --folder-dark: #3a332b;
  }
}
/* 手动：深色 */
html[data-theme='dark'] {
  --sc-surface: #1c1a17;
  --sc-raised: #262320;
  --sc-sunken: #14120f;
  --sc-ink: #f2ede3;
  --sc-muted: rgba(242, 237, 227, 0.74);
  --sc-faint: rgba(242, 237, 227, 0.5);
  --sc-line: rgba(242, 237, 227, 0.2);
  --sc-red: #e0524c;
  --sc-red-deep: #b5403a;
  --sc-blue: #6ba3d6;
  --sc-yellow: #f7ba23;
  --sc-green: #4fa890;
  --sc-sand: #8a7355;
  --sc-halftone: rgba(224, 82, 76, 0.18);
  --sc-shadow: 3px 3px 0 #000;
  --sc-shadow-lg: 5px 5px 0 #000;
  --sc-on-red: #1c1a17;
  --sc-red-fill: #b5413b;
  --sc-blue-fill: #3f719e;
  --console-deck: #2a2723;
  --console-edge: #0e0d0b;
  --console-dpad: #45413c;
  --console-dpad-hi: #67625b;
  --console-arrow: #8a857d;
  --start-lip: #6e1a1d;
  --cream: #2b2723;
  --folder: #4a4136;
  --folder-dark: #3a332b;
  color-scheme: dark;
}
/* 手动：浅色（同时阻止系统自动反色） */
html[data-theme='light'] {
  color-scheme: light;
}

/* ===== 字体文件（2026-11-23 起）=====
   线上站：页面 <head> 用 <link> 引 fonts.loli.net（Google Fonts 镜像）的 css2，见 index/timer.html 的 fonts:web 段；
   离线包：tmp/build_export.mjs 把 fonts:web 段换成 css/fonts-local.css（同一批 woff2 自托管）。
   这里只定义 token，不再写 @font-face。 */
