/* ============================================
   LAA 排版系统 — Typography Tokens
   全站字号 / 行高 / 字重 / 字体栈的单一数据源
   Type Scale: Minor Third 1.2，基准 14px
   ============================================

   使用约定：
   - 本文件只定义变量，不定义任何选择器规则，
     因此加载顺序不会造成样式覆盖，可安全前置。
   - 页面样式表按需引用变量，逐步替换硬编码字号。
   - 中文字重不要使用 500 以下的细体，Windows 渲染会发虚。
   ============================================ */

/* ── 西文字体：Space Grotesk ───────────────────
   全站唯一定义处。此前 laa.css / design-polish.css
   声明为 "LAA Space Grotesk"，auth.css / account-refresh.css
   声明为 SpaceGrotesk（无空格），是两个不同族名，
   导致同一批字体被重复声明。现统一为 "LAA Space Grotesk"。
   2026-08-29 由 TTF 转 woff2：271KB → 103KB（-62%） */
@font-face { font-family: "LAA Space Grotesk"; src: url("../assets/fonts/space-grotesk-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "LAA Space Grotesk"; src: url("../assets/fonts/space-grotesk-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "LAA Space Grotesk"; src: url("../assets/fonts/space-grotesk-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "LAA Space Grotesk"; src: url("../assets/fonts/space-grotesk-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

/* ── 后台标题字体：Rajdhani ────────────────────
   2026-08-29 从 Google Fonts 本地化（latin 子集，
   fontsource v5，3 字重共 45KB）。
   背景：style.css / dealer.css 原通过 @import 从
   fonts.googleapis.com 加载，国内被墙且串行阻塞渲染，
   现改为本地文件，彻底消除外部依赖。
   中文部分由 --font-rajdhani 栈中的系统字体承担。 */
@font-face { font-family: 'Rajdhani'; src: url("../assets/fonts/rajdhani-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Rajdhani'; src: url("../assets/fonts/rajdhani-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Rajdhani'; src: url("../assets/fonts/rajdhani-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  /* ── 字体栈 ──────────────────────────────────
     西文用 Space Grotesk（本地 woff2，约 100KB）
     中文回退系统字体（苹方 / 雅黑），零下载成本
     中西文混排时由浏览器自动分字体渲染            */
  --font-sans: "LAA Space Grotesk", -apple-system, BlinkMacSystemFont,
               "SF Pro Text", "PingFang SC", "Microsoft YaHei",
               "Helvetica Neue", Arial, sans-serif;

  /* 等宽：订单号 / 卡密 / 价格数字 / 日志 */
  --font-mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
               "Liberation Mono", monospace;

  /* 窄体展示字体：提货页等需要冲击力的场景。
     刻意不叫 --font-display，避免与 style.css / dealer.css 中
     已有的同名变量互相覆盖。 */
  --font-condensed: "Saira Condensed", "LAA Space Grotesk",
                    "PingFang SC", "Microsoft YaHei", sans-serif;

  /* 后台标题字体：Rajdhani（本地 woff2，见上方 @font-face）。
     中文回退系统字体。 */
  --font-rajdhani: 'Rajdhani', 'PingFang SC', 'Microsoft YaHei',
                   sans-serif;

  /* 保留旧变量名的兼容别名，避免历史样式表失效 */
  --font-body: var(--font-sans);
  --font-ui:   var(--font-sans);

  /* ── 字号阶梯（Type Scale 1.2）───────────────
     14px 为基准，向上下各推导，共 8 档
     历史遗留的 9 / 10.5 / 11 / 13 / 15 / 16 / 18 /
     19 / 25 / 26 / 28 / 30 / 31 / 34 / 42 逐步归位 */
  --fs-10: 10px;   /* 角标 · 时间戳 · 水印 */
  --fs-12: 12px;   /* 辅助说明 · 表单标签 · 表头 */
  --fs-14: 14px;   /* 正文基准 · 按钮 · 导航 */
  --fs-17: 17px;   /* 卡片标题 · 小标题 */
  --fs-20: 20px;   /* 模块标题 h3 */
  --fs-24: 24px;   /* 区块标题 h2 */
  --fs-29: 29px;   /* 页面标题 h1 */
  --fs-35: 35px;   /* Hero 主标题 */

  /* ── 行高 ────────────────────────────────────
     中文需要比西文更松的行高，正文取 1.7
     字号越大行高越紧，避免标题松散             */
  --lh-hero:    1.15;
  --lh-h1:      1.25;
  --lh-h2:      1.35;
  --lh-h3:      1.40;
  --lh-body:    1.70;
  --lh-caption: 1.60;

  /* ── 字重 ───────────────────────────────────
     只保留 3 档。历史遗留的 650 / 750 / 760 /
     780 / 790 会被浏览器就近取整，是排版不一致
     的来源，已全部归位到 500 或 700            */
  --fw-regular: 400;
  --fw-medium:  500;
  --fw-bold:    700;

  /* ── 字间距 ────────────────────────────────── */
  --ls-tight:  -0.02em;  /* 大标题收紧，抵消视觉松散 */
  --ls-normal:  0;
  --ls-wide:    0.04em;  /* 小号全大写标签 / 数字列 */
}
