/* ==========================================================================
   华一律师事务所 BEIJING HUAYI LAW FIRM · Web Design Tokens  v1.0 (2026)
   tokens.css —— 可直接复制使用：@font-face + CSS 自定义属性
   色值以《华一律师事务所视觉识别系统手册 V1.0》为准。
   字体：思源宋体 / 思源黑体（Noto Serif SC / Noto Sans CJK SC，SIL OFL 1.1），
         本地自托管 woff2 子集；西文与数字使用系统字体 Times New Roman（不嵌入）。
   注意：assets/fonts/ 中的 woff2 为“本规范文档用字”的页面子集，
         正式站点须按站点实际内容重新子集化/分包（见 tools/build_fonts.py 与文档 §03）。
   ========================================================================== */

/* ---------- 1. @font-face：本地嵌入中文字体（无任何外部请求） ---------- */
@font-face{
  font-family:"Huayi Serif SC";
  src:url("assets/fonts/noto-serif-sc-600.subset.189895f6d624.woff2") format("woff2");
  font-weight:600; font-style:normal; font-display:swap;
}
@font-face{
  font-family:"Huayi Serif SC";
  src:url("assets/fonts/noto-serif-sc-700.subset.9b0a83abf44b.woff2") format("woff2");
  font-weight:700; font-style:normal; font-display:swap;
}
@font-face{
  font-family:"Huayi Sans SC";
  src:url("assets/fonts/noto-sans-sc-400.subset.197d9542e6d2.woff2") format("woff2");
  font-weight:400; font-style:normal; font-display:swap;
}
@font-face{
  font-family:"Huayi Sans SC";
  src:url("assets/fonts/noto-sans-sc-500.subset.a360982c00e1.woff2") format("woff2");
  font-weight:500; font-style:normal; font-display:swap;
}

/* ---------- 1b. 中文标点修正面（与上方同一文件，浏览器缓存复用，不额外下载） ----------
   Times New Roman 排在栈首时，会“抢走”中文语境里的 “” ‘’ — … · 等共用码位，
   变成窄小的西文标点。以下字体面仅覆盖这些码位并指向中文字体，置于栈首即可修正。
   英文页面请使用 --hy-font-latin，不要使用含 Punct 的栈。 */
@font-face{font-family:"Huayi Punct Serif";src:url("assets/fonts/noto-serif-sc-600.subset.189895f6d624.woff2") format("woff2");font-weight:600;font-display:swap;unicode-range:U+00B7,U+2014,U+2018-2019,U+201C-201D,U+2026;}
@font-face{font-family:"Huayi Punct Serif";src:url("assets/fonts/noto-serif-sc-700.subset.9b0a83abf44b.woff2") format("woff2");font-weight:700;font-display:swap;unicode-range:U+00B7,U+2014,U+2018-2019,U+201C-201D,U+2026;}
@font-face{font-family:"Huayi Punct Sans";src:url("assets/fonts/noto-sans-sc-400.subset.197d9542e6d2.woff2") format("woff2");font-weight:400;font-display:swap;unicode-range:U+00B7,U+2014,U+2018-2019,U+201C-201D,U+2026;}
@font-face{font-family:"Huayi Punct Sans";src:url("assets/fonts/noto-sans-sc-500.subset.a360982c00e1.woff2") format("woff2");font-weight:500;font-display:swap;unicode-range:U+00B7,U+2014,U+2018-2019,U+201C-201D,U+2026;}

:root{
  /* ---------- 2. 颜色 Color ---------- */
  /* 品牌主色（VI 3.1） */
  --hy-navy:#15243D;        /* 华一藏青：页头深色版/Hero/页脚底色、标题 */
  --hy-blue:#224379;        /* 华一蓝：主按钮、链接、焦点环、图标 */
  --hy-red:#C24747;         /* 准绳红：仅限细线点睛，面积 ≤2%，不作底色/正文色 */
  /* 辅助色（VI 3.2） */
  --hy-slate:#4F6182;       /* 石青：次级文字、深色上的分隔 */
  --hy-mist:#8C9BB4;        /* 雾蓝：装饰线、深底上的说明文字；白底上不可用于文字 */
  --hy-haze:#DCE2EB;        /* 霜灰：分隔、禁用底 */
  --hy-frost:#EEF1F5;       /* 霜蓝浅底：区块底色 */
  --hy-paper:#F7F6F2;       /* 卷宗白：区块底色、卡片底 */
  /* 中性色 */
  --hy-ink:#1B2130;         /* 墨黑：正文 */
  --hy-gray:#6A7180;        /* 中灰：说明文字（白底 4.90:1，卷宗白 4.53:1） */
  --hy-gray-strong:#5B6475; /* 加深中灰：霜蓝浅底上的说明文字 */
  --hy-line:#E3E6EB;        /* 发丝线 */
  --hy-border:#DCE2EB;      /* 卡片/表格边框（装饰性） */
  --hy-border-input:#7D8697;/* 表单控件边框（≥3:1，满足 WCAG 1.4.11） */
  --hy-white:#FFFFFF;
  /* 语义色（文字色 / 浅底色） */
  --hy-success:#26704F;  --hy-success-bg:#EDF5F0;
  --hy-warning:#8A5A12;  --hy-warning-bg:#F7F0E2;
  --hy-error:#A63A3A;    --hy-error-bg:#F8ECEC;   /* 错误色比准绳红更深，避免与品牌点睛混淆 */
  --hy-info:#224379;     --hy-info-bg:#EEF1F5;
  /* 角色映射 */
  --hy-color-text:var(--hy-ink);
  --hy-color-text-secondary:var(--hy-gray);
  --hy-color-heading:var(--hy-navy);
  --hy-color-link:var(--hy-blue);
  --hy-color-link-hover:var(--hy-navy);
  --hy-color-bg:var(--hy-white);
  --hy-color-bg-subtle:var(--hy-paper);
  --hy-color-bg-inverse:var(--hy-navy);
  --hy-color-text-inverse:#FFFFFF;
  --hy-color-text-inverse-secondary:#B9C3D4; /* 藏青底 8.74:1 */
  --hy-color-focus:var(--hy-blue);

  /* ---------- 3. 字体 Font family ---------- */
  /* 西文/数字：Times New Roman 为 Windows/macOS/iOS 系统字体，无需嵌入；
     Liberation Serif / Nimbus Roman 为 Linux 上度量兼容的替代。 */
  --hy-font-latin:"Times New Roman",Times,"Liberation Serif","Nimbus Roman",serif;
  /* 中文标题（宋体）：西文优先 → 本地嵌入思源宋体 → 系统宋体 */
  --hy-font-serif:"Huayi Punct Serif","Times New Roman",Times,"Liberation Serif","Nimbus Roman","Huayi Serif SC","Source Han Serif SC","Noto Serif CJK SC","Songti SC","STSong","SimSun",serif;
  /* 中文正文/UI（黑体）：西文优先 → 本地嵌入思源黑体 → 系统黑体 */
  --hy-font-sans:"Huayi Punct Sans","Times New Roman",Times,"Liberation Serif","Nimbus Roman","Huayi Sans SC","Source Han Sans SC","Noto Sans CJK SC","PingFang SC","Microsoft YaHei",sans-serif;
  --hy-font-mono:ui-monospace,"SFMono-Regular",Menlo,Consolas,"Liberation Mono","Huayi Sans SC",monospace;

  /* 字重 */
  --hy-fw-regular:400; --hy-fw-medium:500; --hy-fw-semibold:600; --hy-fw-bold:700;

  /* ---------- 4. 字阶 Type scale（桌面，≥1024px） ---------- */
  --hy-fs-display:52px; --hy-lh-display:1.3;  --hy-ls-display:.08em;
  --hy-fs-h1:40px;      --hy-lh-h1:1.35;      --hy-ls-h1:.06em;
  --hy-fs-h2:32px;      --hy-lh-h2:1.4;       --hy-ls-h2:.04em;
  --hy-fs-h3:24px;      --hy-lh-h3:1.45;      --hy-ls-h3:.03em;
  --hy-fs-h4:20px;      --hy-lh-h4:1.5;       --hy-ls-h4:.02em;
  --hy-fs-h5:18px;      --hy-lh-h5:1.6;       --hy-ls-h5:.02em;
  --hy-fs-h6:16px;      --hy-lh-h6:1.6;       --hy-ls-h6:.04em;
  --hy-fs-body-lg:18px; --hy-lh-body-lg:1.9;  /* 文章详情正文 */
  --hy-fs-body:16px;    --hy-lh-body:1.8;
  --hy-fs-body-sm:14px; --hy-lh-body-sm:1.75;
  --hy-fs-caption:13px; --hy-lh-caption:1.6;
  --hy-fs-overline:12px;--hy-ls-overline:.24em; /* 英文眉题，Times New Roman 全大写 */

  /* ---------- 5. 间距 Spacing（8px 基准，4px 为半档） ---------- */
  --hy-space-0:0; --hy-space-1:4px; --hy-space-2:8px; --hy-space-3:12px; --hy-space-4:16px;
  --hy-space-5:24px; --hy-space-6:32px; --hy-space-7:40px; --hy-space-8:48px;
  --hy-space-9:64px; --hy-space-10:80px; --hy-space-11:96px; --hy-space-12:128px;
  --hy-section-y:var(--hy-space-12);   /* 区块上下留白：桌面 128 / 移动 64 */

  /* ---------- 6. 圆角 Radius（直角为主，呼应“只横不斜”） ---------- */
  --hy-radius-0:0;      /* 默认：卡片、图片、Hero、表格 */
  --hy-radius-1:2px;    /* 按钮、输入框、标签 */
  --hy-radius-2:4px;    /* 模态框、下拉层、提示条 */

  /* ---------- 7. 阴影 Elevation（克制，以线代影） ---------- */
  --hy-shadow-0:none;
  --hy-shadow-1:0 1px 2px rgba(21,36,61,.06);
  --hy-shadow-2:0 6px 20px rgba(21,36,61,.08);
  --hy-shadow-3:0 20px 56px rgba(21,36,61,.20);
  --hy-focus-ring:0 0 0 2px #FFFFFF,0 0 0 4px var(--hy-blue);
  --hy-focus-ring-inverse:0 0 0 2px var(--hy-navy),0 0 0 4px #FFFFFF;

  /* ---------- 8. 线条 Lines（VI 横线母题） ---------- */
  --hy-line-hair:1px solid var(--hy-line);
  --hy-line-rule:1px solid var(--hy-border);
  --hy-line-strong:1px solid var(--hy-navy);
  --hy-redline-w:32px; --hy-redline-h:2px;   /* 红线标题符：1–2 个字宽 */
  --hy-pattern-weft:repeating-linear-gradient(180deg,rgba(255,255,255,.055) 0 2px,transparent 2px 46px); /* 经纬线底纹（深底） */
  --hy-pattern-grid:repeating-linear-gradient(180deg,rgba(21,36,61,.045) 0 1px,transparent 1px 32px);   /* 格栅底纹（浅底） */

  /* ---------- 9. 动效 Motion ---------- */
  --hy-dur-fast:120ms; --hy-dur-base:200ms; --hy-dur-slow:320ms;
  --hy-ease-standard:cubic-bezier(.2,0,0,1);
  --hy-ease-out:cubic-bezier(0,0,.2,1);
  --hy-ease-in:cubic-bezier(.4,0,1,1);

  /* ---------- 10. 栅格与断点 Grid ---------- */
  /* 断点（媒体查询中需写字面量）：sm 576 · md 768 · lg 1024 · xl 1280 · xxl 1440 */
  --hy-container:1200px;   /* 内容最大宽度 */
  --hy-columns:12;
  --hy-gutter:24px;
  --hy-margin:80px;        /* 页面左右边距（xl+） */
  --hy-header-h:80px;
  --hy-touch-min:44px;

  /* ---------- 11. 层级 z-index ---------- */
  --hy-z-header:100; --hy-z-dropdown:200; --hy-z-modal:400; --hy-z-toast:500;
}

/* 移动端字阶与间距（<768px） */
@media (max-width:767.98px){
  :root{
    --hy-fs-display:34px; --hy-fs-h1:30px; --hy-fs-h2:26px; --hy-fs-h3:21px;
    --hy-fs-h4:18px; --hy-fs-h5:17px; --hy-fs-h6:15px;
    --hy-fs-body-lg:17px; --hy-fs-body:16px; --hy-fs-body-sm:14px; --hy-fs-caption:12px;
    --hy-ls-display:.04em; --hy-ls-h1:.04em;
    --hy-section-y:var(--hy-space-9);
    --hy-gutter:16px; --hy-margin:20px; --hy-header-h:60px;
  }
}
@media (min-width:768px) and (max-width:1279.98px){
  :root{ --hy-margin:40px; --hy-gutter:24px; --hy-section-y:var(--hy-space-11); }
}
@media (prefers-reduced-motion:reduce){
  :root{ --hy-dur-fast:0ms; --hy-dur-base:0ms; --hy-dur-slow:0ms; }
}
