/* base.css — 设计令牌 + 重置 + 基础排版
   ─────────────────────────────────────────────────────────────
   本文件是全站「色彩 / 字号 / 行高 / 动效 / 阴影」的唯一事实来源。
   其余样式文件只消费变量，不重复定义硬编码值。改这里 = 改全站。
   ───────────────────────────────────────────────────────────── */

:root {
  /* ═══════ 品牌蓝色阶 ═══════
     补全 400 / 800 两个中间档，让 hover、active、描边、图表都有值可用。
     主色 --brand-600 保持不变（品牌资产，不轻动）。 */
  --brand-50: #f2f6fc;
  --brand-100: #dce8f8;
  --brand-200: #b9d0f1;
  --brand-300: #8fb2e6;
  --brand-400: #5b8bda;
  --brand-500: #2c6bc9;
  --brand-600: #1a4fa0; /* 品牌主色 */
  --brand-700: #143f78;
  --brand-800: #102f5a;
  --brand-900: #0b2545;

  /* ═══════ CTA 强调色 ═══════
     仅用于转化按钮，全站克制使用。
     ★ 对比度修正：#d1461a × 白字 = 4.6:1 ✅ 达到 WCAG AA
       （原 #e85d2f × 白字仅 3.46:1 —— 15px 文字不算「大字号」，
        严格审核会判不达标；政企客户的无障碍要求逐年收紧） */
  --cta: #d1461a;
  --cta-dark: #ad3810;
  --cta-soft: #fdf0ea;
  --cta-ring: rgba(209, 70, 26, 0.26);

  /* ═══════ 文字灰阶 ═══════
     三档全部通过 WCAG AA 4.5:1 校验：
     text-1 → 12.6:1 ｜ text-2 → 7.6:1 ｜ text-3 → 4.8:1
     ★ text-3 本次由 #8a93a0 → #697384
       （原值对比度仅 2.9:1，而它承载了大量 12~13.5px 小字，不可读） */
  --text-1: #1f2937;
  --text-2: #4b5563;
  --text-3: #697384;

  /* 深色底上的文字分档（深色区专用，避免到处写 rgba） */
  --on-dark-1: #ffffff;
  --on-dark-2: rgba(255, 255, 255, 0.8);
  --on-dark-3: rgba(255, 255, 255, 0.6);

  /* ═══════ 表面与描边 ═══════ */
  --line: #e3e8ef;
  --line-strong: #cbd5e1;
  --bg: #ffffff;
  --bg-soft: #f7f9fc;
  --bg-softer: #fbfcfe;
  --bg-dark: #0b2545;   /* 深色区块 */
  --bg-darker: #071a32; /* 页脚：再深一档，与深色区块拉开层次 */

  /* ═══════ 语义色 ═══════ */
  --ok: #15805c;
  --ok-soft: #e6f6f0;
  --warn: #a5610d;
  --warn-soft: #fdf3e3;
  --error: #c0392b;
  --error-soft: #fdecea;

  /* ═══════ 圆角 ═══════ */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* ═══════ 阴影（四层递进：贴边 / 卡片 / 浮层 / 悬浮） ═══════ */
  --shadow-xs: 0 1px 2px rgba(11, 37, 69, 0.05);
  --shadow-sm: 0 1px 2px rgba(11, 37, 69, 0.06), 0 1px 3px rgba(11, 37, 69, 0.04);
  --shadow-md: 0 4px 12px rgba(11, 37, 69, 0.08);
  --shadow-lg: 0 12px 32px rgba(11, 37, 69, 0.1);
  --shadow-xl: 0 22px 52px rgba(11, 37, 69, 0.14);

  /* ═══════ 字号阶梯 ═══════
     中文最小可读字号 13px。所有字号都从这里取，不要写散值。
     ★ 本次把原先散落的 12 / 12.5 / 13 / 13.5 / 14 / 14.5 / 15 / 15.5 /
       16 / 16.5 / 17 / 17.5 收敛成下面这一张表。 */
  --fs-2xs: 12.5px;  /* 角标、图注（下限） */
  --fs-xs: 13px;     /* 辅助说明、CTA 提示 ★ 原为 12px，是转化关键文字 */
  --fs-sm: 13.5px;   /* 元信息、日期 */
  --fs-base: 14.5px; /* 卡片内小正文 */
  --fs-md: 15px;     /* 紧凑正文 */
  --fs-lg: 16px;     /* 正文标准 / 按钮 */
  --fs-xl: 17px;     /* 导语 */
  --fs-2xl: 18px;    /* 卡片标题 */
  --fs-3xl: 20px;    /* 小标题 */
  --fs-h3: 22px;
  --fs-h2: clamp(23px, 2.9vw, 34px); /* 原上限 30px */
  --fs-h1: clamp(29px, 4.6vw, 48px); /* 原上限 42px */

  /* ═══════ 行高（中文比英文需要更松） ═══════ */
  --lh-tight: 1.25;
  --lh-heading: 1.4; /* 原 1.35，中文标题下挤 */
  --lh-body: 1.72;
  --lh-loose: 1.85;

  /* ═══════ 动效 ═══════
     时长三档 + 缓动四档，全站统一取用（原先是 0.18/0.2/0.22s 各写各的）。 */
  --dur-fast: 140ms;
  --dur: 220ms;
  --dur-slow: 380ms;
  --dur-slower: 640ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.32, 0.64, 1);

  /* ═══════ 尺寸 ═══════ */
  --container: 1200px;
  --header-h: 68px;
  --header-h-sm: 60px; /* 滚动后收缩高度 */

  /* ═══════ 字体栈 ═══════
     补入 HarmonyOS Sans SC / Noto Sans SC 兜底；
     数字统一走 tabular-nums（在用到的地方单独开启）。 */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "HarmonyOS Sans SC", "Noto Sans SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Source Han Sans SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

/* 尊重系统「减弱动态效果」偏好：一切动效降为瞬时 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-lg);
  line-height: var(--lh-body);
  color: var(--text-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  /* 长英文、URL、编号不会撑破容器 */
  overflow-wrap: break-word;
}

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

a {
  color: var(--brand-600);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}

a:hover {
  color: var(--brand-700);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.6em;
  line-height: var(--lh-heading);
  font-weight: 500;
  color: var(--text-1);
  letter-spacing: -0.01em;
  /* 中文标题均衡断行，避免末行只剩一个孤字 */
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
}
h2 {
  font-size: var(--fs-h2);
}
h3 {
  font-size: var(--fs-h3);
}
h4 {
  font-size: var(--fs-2xl);
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

p:last-child {
  margin-bottom: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

figure {
  margin: 0;
}

blockquote {
  margin: 0;
}

table {
  border-collapse: collapse;
  width: 100%;
}

button {
  font: inherit;
  cursor: pointer;
}

input,
textarea,
select {
  font: inherit;
  color: inherit;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 32px 0;
}

strong,
b {
  font-weight: 500;
  color: var(--text-1);
}

/* 数据类文本：等宽数字，滚动与对齐时不抖动 */
.num,
.stat__num,
[data-count],
.entry__no,
.post-item__date,
.fact dd {
  font-variant-numeric: tabular-nums;
}

::selection {
  background: var(--brand-100);
  color: var(--brand-900);
}

/* 焦点可见（无障碍） */
:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* ═══════ 工具类 ═══════ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 999;
  padding: 10px 18px;
  background: var(--brand-600);
  color: #fff;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top var(--dur) var(--ease);
}

.skip-link:focus {
  top: 0;
  color: #fff;
}

.text-c {
  text-align: center;
}

.text-2 {
  color: var(--text-2);
}

.text-3 {
  color: var(--text-3);
}

.nowrap {
  white-space: nowrap;
}

/* 间距 / 宽度工具类
   本节存在的意义：把散落在 HTML 里的 inline style 收回来。
   inline style 的优先级高过样式表，会让设计令牌在这些地方失效。 */
.mt-0 {
  margin-top: 0;
}
.mt-4 {
  margin-top: 4px;
}
.mt-8 {
  margin-top: 8px;
}
.mt-12 {
  margin-top: 12px;
}
.mt-16 {
  margin-top: 16px;
}
.mt-24 {
  margin-top: 24px;
}
.mt-32 {
  margin-top: 32px;
}
.mt-40 {
  margin-top: 40px;
}
.mb-0 {
  margin-bottom: 0;
}
.pt-28 {
  padding-top: 28px;
}
.maxw-76 {
  max-width: 76ch;
}
.note-sm {
  font-size: var(--fs-xs);
}

/* 小字号导语（列表页/内页共用） */
.lead {
  font-size: var(--fs-xl);
  color: var(--text-2);
  max-width: 62ch;
}
