/* reset + 排版基调 + 全局可访问性 */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--text-body);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei",
    "Noto Sans SC", "Source Han Sans SC", system-ui, -apple-system, sans-serif;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
figure { margin: 0; }              /* UA 默认 1em 40px，移动端会横向溢出 */

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

a {
  color: var(--brand-ink);
  text-decoration: none;
  transition: color 0.2s var(--ease), opacity 0.2s var(--ease);
}
a:hover { text-decoration: underline; text-underline-offset: 3px; }

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

/* 组件里的 display 会盖掉 UA 的 [hidden]，筛选靠它，必须 !important */
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--brand-ink);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px; left: 16px;
  z-index: 100;
  padding: 12px 20px;
  border-radius: var(--r-sm);
  background: var(--brand-fill);
  color: #fff;
  font-size: var(--fs-sm);
}
.skip-link:focus { top: 12px; }

/* 标题族：颜色与字重统一，行高收紧 */
.h1, .h2, .h3, .h4, .h5 {
  color: var(--text);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
}
.h2 { font-size: var(--fs-h2); }
.h3 { font-size: var(--fs-h3); }
.h4 { font-size: var(--fs-h4); }
.h5 { font-size: var(--fs-h5); }

/* 唯一的长文宽度档 */
.prose { max-width: var(--w-prose); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
