/* ==========================================================================
   base.css — 重置、排版、页面骨架
   ========================================================================== */

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

/* [hidden] 必须能压过组件类的 display。
   UA 样式表里的 [hidden]{display:none} 特指度只有 0-1-0，
   会被 .banner{display:flex}、.btn{display:inline-flex} 这类规则盖掉，
   导致 JS 设了 hidden 元素照样显示。 */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 22px;
  color: var(--text-primary);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;              /* 验收：375px 宽无横向滚动 */
}

h1, h2, h3, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

a { color: inherit; text-decoration: none; }
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brand-ink);
  outline-offset: 2px;
  border-radius: var(--space-1);
}

/* ── 字阶（§三） ───────────────────────────────────────────── */
.t-hero-num  { font-size: 40px; line-height: 44px; font-weight: 700;
               font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1;
               letter-spacing: -0.5px; }
.t-greeting  { font-size: 15px; line-height: 20px; font-weight: 400; }
.t-name      { font-size: 28px; line-height: 34px; font-weight: 700; }
.t-page      { font-size: 22px; line-height: 30px; font-weight: 600; }
.t-section   { font-size: 17px; line-height: 24px; font-weight: 600; }
.t-body      { font-size: 15px; line-height: 22px; font-weight: 400; }
.t-note      { font-size: 13px; line-height: 18px; font-weight: 400; color: var(--text-secondary); }
.t-tile      { font-size: 14px; line-height: 18px; font-weight: 600; }
.num         { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ── 页面骨架 ─────────────────────────────────────────────── */
.page {
  max-width: var(--page-max);
  margin: 0 auto;
  /* 底部留出浮起导航的高度 + 安全区 */
  padding-bottom: calc(var(--nav-height) + var(--space-6) + env(safe-area-inset-bottom));
}
.page--no-nav { padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom)); }

.section    { padding: 0 var(--space-4); }
.section + .section { margin-top: var(--space-4); }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.section-more {
  font-size: 13px; line-height: 18px; font-weight: 600;
  color: var(--brand-ink);
  display: inline-flex; align-items: center; gap: 2px;
  /* 命中区补足到 44px 高，不撑开视觉行高 */
  padding: 13px 0; margin: -13px 0;
}

.stack-4 > * + * { margin-top: var(--space-4); }
.stack-3 > * + * { margin-top: var(--space-3); }
.stack-2 > * + * { margin-top: var(--space-2); }

/* 简易顶栏（非首页用） */
.appbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--space-2);
  height: 52px; padding: 0 var(--space-2) 0 var(--space-1);
  background: var(--bg-base);
}
.appbar__back {
  width: 44px; height: 44px; flex: 0 0 44px;
  display: grid; place-items: center;
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--text-primary);
}
.appbar__title { font-size: 17px; line-height: 24px; font-weight: 600; }

/* ── 图标：线性风格，2px 线宽（§6.5 与 App 一致） ─────────── */
.ico {
  width: 24px; height: 24px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  flex: 0 0 auto;
}
.ico--sm { width: 18px; height: 18px; }
.ico--xs { width: 16px; height: 16px; stroke-width: 2.2; }
.ico--lg { width: 32px; height: 32px; stroke-width: 1.8; }
.ico--xl { width: 48px; height: 48px; stroke-width: 1.6; }
.ico--fill { fill: currentColor; stroke: none; }

.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.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
