/* base.css — 重置、排版基座、布局原语。所有 section 都用这里的类，不要另起一套。 */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* 纸感：极淡的噪点，不靠图片 */
  background-image: radial-gradient(oklch(0.245 0.014 265 / 0.022) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
  letter-spacing: -0.01em;
}

p, ul, ol, dl, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }

/* hidden 必须真的藏住：很多组件类会写 display:grid/flex，会盖掉浏览器默认的 [hidden] */
[hidden] { display: none !important; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}

a { color: inherit; }

/* ---- 焦点：一律可见，不删 ---- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-1);
}
:focus:not(:focus-visible) { outline: none; }

/* ---- 跳转链接 ---- */
.skip {
  position: absolute;
  left: var(--sp-4);
  top: calc(-1 * var(--sp-8));
  z-index: 20;
  display: inline-flex;
  align-items: center;
  min-block-size: var(--tap);
  padding: var(--sp-2) var(--sp-4);
  background: var(--ink);
  color: var(--paper-raised);
  border-radius: var(--r-2);
  transition: top var(--t-fast) var(--ease-out);
}
.skip:focus-visible { top: var(--sp-4); }

/* ---- 布局原语 ---- */
.wrap {
  max-inline-size: var(--measure);
  margin-inline: auto;
  padding-inline: var(--page-x);
}
.wrap--wide { max-inline-size: 46rem; }

.stack > * + * { margin-block-start: var(--sp-4); }
.stack--tight > * + * { margin-block-start: var(--sp-2); }
.stack--loose > * + * { margin-block-start: var(--sp-6); }

.row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }

.section { padding-block: var(--sp-7); }
.section--tight { padding-block: var(--sp-5); }
.section + .section { border-block-start: 1px solid var(--line); }

.rule { border: 0; border-block-start: 1px solid var(--line); margin: 0; }

/* ---- 排版角色 ---- */
.eyebrow {
  font-family: var(--font-num);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.h-sec {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 700;
}

.h-sub {
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  font-weight: 600;
}

.lede {
  font-size: var(--fs-base);
  color: var(--ink-2);
  max-inline-size: 30rem;
}

.small { font-size: var(--fs-sm); color: var(--ink-2); }
.note  { font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.6; }

/* ---- 数字：一律等宽 + 表格数位 ---- */
.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: -0.02em;
}

/* ---- 编号：01 / 02 / 03 ---- */
.idx {
  font-family: var(--font-num);
  font-size: var(--fs-xs);
  color: var(--ink-3);
  letter-spacing: 0.08em;
}

/* ---- 无障碍工具类 ---- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  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;
  }
}

/* ---- 只在有悬停能力时给悬停反馈 ---- */
@media (hover: hover) and (pointer: fine) {
  .hover-lift:hover { border-color: var(--line-strong); }
}
