/* ============================================================
   基础层：重置、排版、语义化、焦点、动效降级
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.72;
  letter-spacing: 0.02em;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, p { margin: 0; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* 语义化唯一 h1 视觉隐藏（页面内用 h2 分层） */
.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;
}

/* 焦点可见：2px + 2px 偏移 */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* 等宽数字：财务数据对齐 */
.tabular { font-variant-numeric: tabular-nums; font-family: var(--font-num); }

/* 入场序列：纯 CSS 动画，默认可见（不依赖 JS 的 requestAnimationFrame）
   移动端 WebView / file:// / 低电量模式下 rAF 常被节流甚至不执行，
   旧方案用 opacity:0 + JS 加 .in 会导致整页内容永久透明。 */
.reveal { opacity: 1; transform: none; }
.screen.active .reveal { animation: revealIn var(--dur-base) var(--ease-out) backwards; }
@keyframes revealIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.screen.active .reveal:nth-child(1) { animation-delay: 40ms; }
.screen.active .reveal:nth-child(2) { animation-delay: 80ms; }
.screen.active .reveal:nth-child(3) { animation-delay: 120ms; }
.screen.active .reveal:nth-child(4) { animation-delay: 160ms; }
.screen.active .reveal:nth-child(5) { animation-delay: 200ms; }
.screen.active .reveal:nth-child(6) { animation-delay: 240ms; }

/* 降级：尊重减少动效偏好 */
@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;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}
