/* 重置与排版基础 */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
p,
dl,
dd,
ul,
ol {
  margin: 0;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

svg {
  display: block;
  flex: none;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--accent-ring);
}

/* 键盘焦点：一圈光环。鼠标点击不出现 */
:focus {
  outline: none;
}

/* 用实色的 --accent 而不是半透明的 --accent-ring：后者压在近白的顶栏上
   只有 1.5:1，WCAG 1.4.11 要 3:1，等于没有。实色是 4.3:1(浅) / 5.8:1(深)。 */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 字阶 */
.t-large {
  font: 700 clamp(32px, 5.2vw, 44px) / 1.08 var(--font-display);
  letter-spacing: -0.025em;
}

.t-title {
  font: 600 22px/1.25 var(--font-display);
  letter-spacing: -0.015em;
}

.t-headline {
  font: 600 17px/1.3 var(--font-sans);
  letter-spacing: -0.01em;
}

.t-footnote {
  font-size: 13px;
  line-height: 1.4;
}

.t-caption {
  font-size: 12px;
  line-height: 1.35;
}

/* 等宽数字只用在要上下对齐的地方：表格列、坐标轴刻度 */
.num {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
  letter-spacing: 0;
}

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

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

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