/* ============================================================
   base.css — reset + 全局样式 + 字体阶梯
   依据：design-spec.md §3 字体阶梯、§4 间距与栅格、§8 无障碍
   ============================================================ */

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-neutral-800);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
}

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

[hidden] { display: none !important; }

a { color: var(--color-primary-600); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }

p { margin: 0 0 var(--space-4); max-width: 640px; }

h1, h2, h3, h4 {
  margin: 0 0 var(--space-6);
  color: var(--color-neutral-900);
  font-weight: 700;
  line-height: 1.2;
}
h1 { font-size: 48px; letter-spacing: 0.02em; }
h2 { font-size: 36px; letter-spacing: 0.01em; line-height: 1.25; }
h3 { font-size: 26px; line-height: 1.35; font-weight: 600; }
h4 { font-size: 20px; line-height: 1.4; font-weight: 600; }

/* 标题中允许单个关键词用品牌蓝强调 */
h1 .hl, h2 .hl, h3 .hl { color: var(--color-primary-700); }

ul, ol { margin: 0 0 var(--space-4); padding-left: 1.4em; }
li { margin-bottom: var(--space-2); }

button { font-family: inherit; cursor: pointer; }

/* ---------- 容器 ---------- */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}
.container-reading {
  max-width: var(--container-reading);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* ---------- 区块纵向节奏 ---------- */
.section { padding-block: var(--space-24); }
.section-dark { padding-block: 80px; }
.section-alt { background: var(--color-neutral-50); }
.section-title { margin-bottom: var(--space-6); }
.section-lead { font-size: 18px; color: var(--color-neutral-600); margin-bottom: var(--space-12); }

/* ---------- 焦点可见（全站统一） ---------- */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
  border-radius: 2px;
}
.on-dark :focus-visible, .focus-dark:focus-visible {
  outline: var(--focus-ring-dark);
}

/* ---------- 跳转链接（无障碍） ---------- */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 200;
  padding: var(--space-3) var(--space-4);
  background: var(--color-primary-700);
  color: var(--color-white);
  border-radius: var(--radius-md);
  transition: top 150ms ease-out;
}
.skip-link:focus { top: var(--space-4); text-decoration: none; }

/* ---------- 效能数字大字 ---------- */
.num-display {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 56px;
  font-weight: 700;
  line-height: 1.1;
}
.num-gradient {
  background: var(--gradient-tech);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@supports not (background-clip: text) {
  .num-gradient { color: var(--color-cyan-300); }
}

/* ---------- 工具类 ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* ---------- 动效统一收敛 ---------- */
@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;
  }
}

/* ============================================================
   响应式字号阶梯（design-spec §3.2）
   ============================================================ */
@media (max-width: 1023px) {
  h1 { font-size: 32px; line-height: 1.25; }
  h2 { font-size: 28px; line-height: 1.3; }
  h3 { font-size: 22px; line-height: 1.4; }
  h4 { font-size: 18px; line-height: 1.45; }
  .num-display { font-size: 40px; line-height: 1.15; }
  .section { padding-block: 56px; }
  .section-dark { padding-block: 48px; }
  .section-lead { font-size: 17px; margin-bottom: var(--space-8); }
}

/* 平板区块间距 72px（design-spec §6） */
@media (min-width: 640px) and (max-width: 1023px) {
  .section { padding-block: 72px; }
}
