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

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

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--f-body);
  font-size: var(--t-base);
  line-height: 1.7;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  font-family: var(--f-display);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.04;
  margin: 0;
}

p {
  margin: 0;
}

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

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

::selection {
  background: var(--c-accent);
  color: var(--c-bg-deep);
}

/* 焦点可见 —— 2px + 2px 偏移 */
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--c-bg-deep);
}
::-webkit-scrollbar-thumb {
  background: var(--c-surface-3);
  border: 2px solid var(--c-bg-deep);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--c-muted);
}

/* 等宽数字 —— 数据密集界面 */
.tabular,
.stat-value,
.code {
  font-variant-numeric: tabular-nums;
}

/* 入场序列基础 */
.reveal {
  opacity: 0;
  transform: translateY(22px);
}
.reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity var(--d-base) var(--e-out), transform var(--d-base) var(--e-out);
}
.reveal.d1 { transition-delay: 60ms; }
.reveal.d2 { transition-delay: 120ms; }
.reveal.d3 { transition-delay: 180ms; }
.reveal.d4 { transition-delay: 240ms; }
.reveal.d5 { transition-delay: 300ms; }

/* 降级动效 */
@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;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
