/* ============ 泽润智言 · 基础层 ============
   reset、元素默认、字阶工具类、焦点环、滚动条、无障碍基础。 */

/* JetBrains Mono latin 子集本地托管（代码不加粗，仅 Regular 一款）；
   CJK 界面字走系统字体栈回退，HarmonyOS Sans SC 保留栈首位。 */
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                 U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
                 U+FEFF, U+FFFD;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.85;                 /* 中文正文行高不得低于 1.7 */
  background: hsl(var(--bg-canvas));
  color: hsl(var(--text-primary));
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-break: strict;
  transition: background var(--dur-2) var(--ease-standard),
              color var(--dur-2) var(--ease-standard);
}

/* ---- 标题：层级只靠明度字号留白；中文标题禁负字距 ---- */
h1, h2, h3, h4, h5, h6 { text-wrap: balance; letter-spacing: 0; }
h1 { font-size: 40px; line-height: 1.25; font-weight: 700; }
h2 { font-size: 30px; line-height: 1.3;  font-weight: 650; }
h3 { font-size: 22px; line-height: 1.35; font-weight: 600; }
h4 { font-size: 18px; line-height: 1.4;  font-weight: 600; }

p { text-wrap: pretty; }

a { color: hsl(var(--brand)); text-underline-offset: 3px; }

button { font-family: inherit; color: inherit; }

img, svg, video { display: block; max-width: 100%; }

/* ---- 字阶工具类 ---- */
.t-display-xl { font-size: clamp(40px, 5.2vw, 68px); line-height: 1.12; font-weight: 700; }
.t-display    { font-size: clamp(32px, 4vw, 52px);   line-height: 1.15; font-weight: 700; }
.t-body-lg    { font-size: 18px; line-height: 1.8;  font-weight: 400; }
.t-body       { font-size: 16px; line-height: 1.85; font-weight: 400; }
.t-body-sm    { font-size: 14px; line-height: 1.7;  font-weight: 400; }
.t-caption    { font-size: 13px; line-height: 1.5;  font-weight: 400; color: hsl(var(--text-tertiary)); }
.t-eyebrow    { font-size: 12px; line-height: 1.2;  font-weight: 600; letter-spacing: .08em; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* 数字与单位不加空格；指标 / 表格数值 / 时间戳一律 tabular-nums */
.num, time, .tabular { font-variant-numeric: tabular-nums; }

/* 行内代码：mono 0.9em、code-bg 底、圆角 4、不加粗不高亮 */
code.ic, .ic-code {
  font-family: var(--font-mono);
  font-size: .9em;
  background: hsl(var(--code-bg));
  color: hsl(var(--code-inline));
  border-radius: 4px;
  padding: 1px 4px;
}

/* ---- 容器 ---- */
.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--page-pad);
}
.wrap-narrow { max-width: var(--container-narrow); }

/* ---- 焦点环：全站唯一，禁止无替代地移除 ---- */
:focus-visible {
  outline: 2px solid hsl(var(--brand));
  outline-offset: 2px;
}

/* ---- 滚动条：8px ---- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: hsl(var(--bg-inset)); }
::-webkit-scrollbar-thumb { background: hsl(var(--border-strong)); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: hsl(var(--text-tertiary)); }

::selection { background: hsl(var(--brand) / .3); }

/* ---- 跳过导航（首个 Tab 位）---- */
.skip-link {
  position: fixed;
  top: -100px; left: var(--space-4);
  z-index: 200;
  padding: 8px 16px;
  background: hsl(var(--bg-inset));
  border: 1px solid hsl(var(--border-strong));
  border-radius: var(--radius-sm);
  color: hsl(var(--text-primary));
  font-size: 14px;
  text-decoration: none;
  transition: top var(--dur-2) var(--ease-standard);
}
.skip-link:focus { top: var(--space-3); }

/* ---- 屏幕阅读器专用 ---- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ---- 区块三段式：eyebrow → h2 → 引导文 ---- */
.eyebrow {
  display: block;
  font-size: 12px; line-height: 1.2; font-weight: 600; letter-spacing: .08em;
  color: hsl(var(--brand-dim));
  margin-bottom: var(--space-3);
}
.sechead { margin-bottom: var(--space-7); max-width: 62ch; }
.sechead h2 { margin-bottom: var(--space-3); }
.sechead .lede {
  font-size: 14px; line-height: 1.7;
  color: hsl(var(--text-secondary));
  max-width: 60ch;
}

/* ---- 滚动进入（只播一次，阈值 25%，stagger 用 --i）---- */
.reveal { opacity: 0; transform: translateY(16px); }
.reveal.on {
  opacity: 1; transform: none;
  transition: opacity var(--dur-4) var(--ease-decelerate),
              transform var(--dur-4) var(--ease-decelerate);
  transition-delay: calc(var(--i, 0) * 60ms);
}

/* ---- 动效降级：入场改纯淡入、指示动画关闭，不一把抹掉状态反馈 ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .caret, .think i, .spin, .dots-anim i { animation: none !important; }
}

/* ---- 隐藏工具 ---- */
[hidden] { display: none !important; }   /* 防止组件 display 规则覆盖 hidden 属性 */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* 公安备案徽标（页脚，与 ICP 并列） */
.ga-beian { display: inline-flex; align-items: center; gap: 5px; }
.ga-beian img { width: 18px; height: 20px; display: block; }

/* 备案号成组：工信部 + 公安始终同一行并列，不折到下一行 */
.beian-line { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.beian-line .dot { opacity: .6; }
@media (max-width: 480px) { .beian-line { gap: 4px; font-size: 11px; } }
