/* ==========================================================================
   Base · reset / 排版 / 基础工具类
   ========================================================================== */

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, p, figure, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.14s var(--ease);
}
a:hover { color: var(--brand-ink); }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}

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

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

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

::selection {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

/* 焦点可见：只在键盘操作时出现 */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* 滚动条 */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: var(--r-full);
}
*::-webkit-scrollbar-thumb:hover { background-clip: content-box; background-color: var(--text-3); }

/* ── 排版 ─────────────────────────────────────────────────────────────── */
.h1 { font-size: 26px; line-height: 1.25; font-weight: 650; letter-spacing: -0.02em; }
.h2 { font-size: 19px; line-height: 1.35; font-weight: 620; letter-spacing: -0.015em; }
.h3 { font-size: 15.5px; line-height: 1.4; font-weight: 600; letter-spacing: -0.01em; }
.h4 { font-size: 14px; line-height: 1.45; font-weight: 600; }

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.lead { font-size: 14.5px; color: var(--text-2); line-height: 1.65; }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }

.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.strong { font-weight: 600; }
.mono { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.01em; }
.tnum { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.truncate { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.num-display {
  font-size: 30px;
  line-height: 1.1;
  font-weight: 660;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

/* ── 工具类 ───────────────────────────────────────────────────────────── */
.stack { display: flex; flex-direction: column; }
.stack-4 { gap: 4px; } .stack-6 { gap: 6px; } .stack-8 { gap: 8px; }
.stack-12 { gap: 12px; } .stack-16 { gap: 16px; } .stack-20 { gap: 20px; }
.stack-24 { gap: 24px; }
.row { display: flex; align-items: center; }
.row-4 { gap: 4px; } .row-6 { gap: 6px; } .row-8 { gap: 8px; }
.row-12 { gap: 12px; } .row-16 { gap: 16px; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.center { justify-content: center; }
.end { justify-content: flex-end; }
.items-start { align-items: flex-start; }
.grow { flex: 1 1 auto; min-width: 0; }
.block { display: block; }

.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;
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* hidden 必须真正隐藏（覆盖 .btn / .tab 等的 display） */
[hidden] { display: none !important; }

/* 表单控件自带焦点环，避免与外层 border/box-shadow 叠加 */
.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: none;
}
