/* ==========================================================================
   base.css · 重置与版式地基
   ========================================================================== */

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

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

html, body {
  height: 100%;
  overscroll-behavior-y: none;
}

body {
  font-family: var(--f-sans);
  font-size: var(--fs-body);
  line-height: 1.85;
  color: var(--ink);
  background: var(--paper-3);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---------- 舞台：移动优先，桌面收成一条竖幅 ---------- */
.scroll {
  position: relative;
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  background: var(--paper);
  box-shadow: var(--shadow-3);
  overflow-x: hidden;
  /* iOS 地址栏安全区 */
  padding-bottom: env(safe-area-inset-bottom);
}

@media (min-width: 560px) {
  body { padding: var(--s5) 0; }
  .scroll { border-radius: 4px; min-height: calc(100dvh - var(--s7)); }
}

/* ---------- 纸纹：全屏 3.5% 噪点，高级感的廉价解法 ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  opacity: .035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* 暖调暗角：让纸面有"光从上方来"的错觉，压住四角 */
.scroll::after {
  content: "";
  position: fixed;
  top: 0; bottom: 0; left: 0; right: 0;
  max-width: var(--page-max);
  margin: 0 auto;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(128% 92% at 50% 10%,
              rgba(255, 255, 255, .16) 0%,
              rgba(255, 255, 255, 0) 44%,
              rgba(118, 86, 56, .13) 100%);
}

/* ---------- SVG 图形库容器 ---------- */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ---------- 排版元件 ---------- */
.kicker {
  font-family: var(--f-sans);
  font-size: var(--fs-kicker);
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--wood);
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
}
.kicker::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: .6;
}

.title {
  font-family: var(--f-serif);
  font-size: var(--fs-h2);
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: .02em;
  color: var(--ink);
}

.title--xl {
  font-size: var(--fs-h1);
  letter-spacing: .14em;
  line-height: 1.1;
}

.lede {
  font-family: var(--f-serif);
  font-size: var(--fs-lede);
  line-height: 1.9;
  color: var(--ink-2);
}

.body {
  font-size: var(--fs-body);
  line-height: 1.95;
  color: var(--ink-2);
  text-align: justify;
  text-justify: inter-ideograph;
}

.em {
  color: var(--peach);
  font-style: normal;
  /* 手写般的下划，不用 border-bottom */
  background: linear-gradient(transparent 62%, var(--peach-soft) 62%, var(--peach-soft) 92%, transparent 92%);
  padding: 0 1px;
}

.num {
  font-family: var(--f-serif);
  font-size: var(--fs-num);
  line-height: 1;
  color: var(--peach);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

/* ---------- 图片 / 待替换素材位 ---------- */
.photo-slot {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px dashed var(--paper-3);
  border-radius: var(--r-2);
  background: linear-gradient(160deg, var(--paper-2), var(--paper));
  color: var(--ink-2);
  font-size: 12px;
  letter-spacing: .12em;
  text-align: center;
  line-height: 1.7;
}
.photo-slot::after {
  content: "待替换实拍素材";
  position: absolute;
  bottom: var(--s1);
  right: var(--s2);
  font-size: 10px;
  opacity: .55;
}

.photo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-2);
  object-fit: cover;
  background: var(--paper-2);
}

/* ---------- 滚动条隐藏（视觉洁净） ---------- */
.scroll::-webkit-scrollbar { width: 0; height: 0; }
.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

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

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
