/* ============================================================
   base.css — 重置、排版基线、氛围层、入场序列、可访问性
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { list-style: none; padding: 0; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
svg { display: block; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* 键盘焦点：2px 黑色描边；黑底按钮用反向白描边 + 红点环 */
:focus-visible { outline: 2px solid var(--color-ink); outline-offset: 2px; border-radius: 5px; }
.cta:focus-visible, .pay-btn:focus-visible, .confirm-btn:focus-visible,
.modal-primary:focus-visible, .switcher-tab:focus-visible {
  outline: 2px solid #fff; outline-offset: -4px;
  box-shadow: 0 0 0 4px var(--color-accent);
}
::selection { background: var(--color-fill-pale); color: var(--color-ink); }

/* ---------- 氛围层：渐变网格 + 细网格 + 颗粒 ---------- */
.atmosphere {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(58rem 42rem at 88% -12%, rgba(0, 0, 0, .055), transparent 62%),
    radial-gradient(44rem 40rem at -10% 100%, rgba(0, 0, 0, .03), transparent 60%),
    repeating-linear-gradient(0deg, var(--color-bg-line) 0 1px, transparent 1px 72px);
}
.grain::after {
  content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: .045;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 一次编排好的入场序列（错峰 60–120ms） ---------- */
@keyframes revealIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes deviceIn { from { opacity: 0; transform: translateY(38px) scale(.975); } to { opacity: 1; transform: none; } }
@keyframes captionIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: revealIn var(--dur-slow) var(--ease-out) var(--d, 0ms) both; }
  .device-wrap { animation: deviceIn 780ms var(--ease-out) 180ms both; }
  .stage-caption { animation: captionIn 560ms var(--ease-out) 620ms both; }
}

/* 降级：reduce 下关闭全部动效 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
