/* ==========================================================================
   base.css — reset / 排版基线 / 动效 / 工具类
   ========================================================================== */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  font-size: var(--fs-14);
  line-height: 1.6;
  letter-spacing: .004em;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}

body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: var(--grain);
}

::selection { background: var(--accent); color: #fff; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
ul, ol { list-style: none; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.ic { flex: none; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-2); border-radius: 10px;
  border: 2.5px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--line-3); background-clip: content-box; }

/* ---------- 动效 ---------- */
@keyframes fade-up   { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade-in   { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in    { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes spin      { to { transform: rotate(360deg); } }
@keyframes pulse     { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes shimmer   { 0% { background-position: -160% 0; } 100% { background-position: 160% 0; } }
@keyframes draw-line { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes caret     { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 工具类 ---------- */
.row { display: flex; align-items: center; gap: var(--sp2); }
.row-end { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp2); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp3); }
.row-wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: var(--sp2); }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--ink-3); font-size: var(--fs-12); }
.mono { font-family: var(--font-mono); font-size: var(--fs-12); letter-spacing: -.01em; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.divider { height: 1px; background: var(--line); border: none; margin: var(--sp4) 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 淡入序列（列表容器） */
.stagger > * { animation: fade-up .38s var(--ease-out) both; }
.stagger > *:nth-child(1) { animation-delay: .01s; }
.stagger > *:nth-child(2) { animation-delay: .04s; }
.stagger > *:nth-child(3) { animation-delay: .07s; }
.stagger > *:nth-child(4) { animation-delay: .10s; }
.stagger > *:nth-child(5) { animation-delay: .13s; }
.stagger > *:nth-child(6) { animation-delay: .16s; }
.stagger > *:nth-child(7) { animation-delay: .19s; }
.stagger > *:nth-child(8) { animation-delay: .22s; }

/* 标签小标题 */
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--sp2);
  font-size: var(--fs-10); font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before { content: ''; width: 16px; height: 1px; background: currentColor; opacity: .6; }