/* ============================================================
   宝宝小传 · 设计令牌「编年史纸本 Chronicle Paper」
   米纸底 / 墨字 / 唯一强调色朱砂 / 金粟点缀
   字体自托管子集（assets/fetch_fonts.py 生成），不依赖任何字体 CDN
   ============================================================ */

/* 只含原型实际渲染到的 1022 个字，3 个中文字重共 12 片 + 西文 latin 3 片。
   改文案后若有字回退系统宋体，重跑 python assets/fetch_fonts.py 补字。 */
@import url('fonts.css');

:root {
  /* 纸 */
  --paper-0: #efe7d9;
  --paper-1: #f6f0e6;
  --paper-2: #fbf7ef;
  --paper-3: #fffdf8;
  --paper-warm: #e8dcc7;

  /* 墨 */
  --ink: #1b1813;
  --ink-2: #464036;
  --ink-3: #7a7264;
  --ink-4: #a79e8d;
  --rule: rgba(27, 24, 19, .13);
  --rule-strong: rgba(27, 24, 19, .28);

  /* 朱砂（唯一强调） */
  --cinnabar: #c03f21;
  --cinnabar-deep: #97290f;
  --cinnabar-wash: rgba(192, 63, 33, .09);

  /* 辅助 */
  --gold: #a9853c;
  --moss: #5c6b4c;
  --indigo: #2f3d55;

  /* 字 */
  --f-serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --f-num: "EB Garamond", "Noto Serif SC", Georgia, serif;

  /* 字号（纸本阶梯，偏紧的行高配大留白） */
  --t-display: clamp(2.6rem, 8.4vw, 6.4rem);
  --t-h1: clamp(2rem, 5.4vw, 3.4rem);
  --t-h2: clamp(1.45rem, 3.2vw, 2.15rem);
  --t-h3: 1.22rem;
  --t-body: 1.02rem;
  --t-small: .87rem;
  --t-label: .72rem;

  /* 8pt 网格 */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 140px;

  --maxw: 1180px;
  --shadow-paper: 0 1px 0 rgba(255,255,255,.7) inset, 0 18px 40px -26px rgba(43, 34, 20, .5);
  --shadow-lift: 0 30px 60px -34px rgba(43, 34, 20, .55);
  --ease: cubic-bezier(.22, .61, .31, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }   /* 组件里的 display:grid/flex 会盖掉 hidden 属性 */

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

body {
  margin: 0;
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: var(--t-body);
  line-height: 1.72;
  color: var(--ink);
  background: var(--paper-1);
  overflow-x: hidden;
}

/* 纸纤维颗粒：整站氛围层 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: .32;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='.42'/></svg>");
}

h1, h2, h3, h4 { font-weight: 500; line-height: 1.24; margin: 0; letter-spacing: .01em; }
h1 { font-size: var(--t-h1); font-weight: 600; }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }

::selection { background: var(--cinnabar); color: var(--paper-3); }

.wrap { width: min(100% - 2.6rem, var(--maxw)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2.6rem, 760px); margin-inline: auto; }

/* ---------- 签名元素：朱砂印 ---------- */
.seal {
  display: inline-grid;
  place-items: center;
  width: 3.6rem; height: 3.6rem;
  border-radius: 50%;
  background: var(--cinnabar);
  color: #fff8ef;
  font-size: .78rem;
  line-height: 1.15;
  text-align: center;
  letter-spacing: .04em;
  transform: rotate(-7deg);
  box-shadow: 0 6px 16px -9px rgba(151, 41, 15, .9), inset 0 0 0 1.5px rgba(255,255,255,.5);
  flex: none;
}
.seal--sm { width: 2.7rem; height: 2.7rem; font-size: .6rem; }
.seal--ghost {
  background: transparent;
  color: var(--cinnabar);
  box-shadow: inset 0 0 0 1.5px var(--cinnabar);
}
/* 印章的斑驳边缘 */
.seal::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='60'><filter id='r'><feTurbulence baseFrequency='.9' numOctaves='2'/><feColorMatrix type='saturate' values='0'/></filter><rect width='60' height='60' filter='url(%23r)' opacity='.5'/></svg>");
  mix-blend-mode: screen;
  opacity: .4;
  pointer-events: none;
}
.seal { position: relative; }

/* ---------- 小标签 ---------- */
.label {
  font-size: var(--t-label);
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.label--cn { letter-spacing: .42em; text-transform: none; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  padding: .82em 1.7em;
  border: 0; border-radius: 2px;
  font-size: .95rem; font-weight: 500; letter-spacing: .06em;
  cursor: pointer;
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), background .2s;
  white-space: nowrap;
}
.btn--ink { background: var(--ink); color: var(--paper-2); box-shadow: 0 12px 26px -16px rgba(27,24,19,.9); }
.btn--ink:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -16px rgba(27,24,19,.95); }
.btn--cinnabar { background: var(--cinnabar); color: #fff7ee; box-shadow: 0 12px 26px -14px rgba(151,41,15,.85); }
.btn--cinnabar:hover { transform: translateY(-2px); background: var(--cinnabar-deep); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule-strong); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.btn--block { width: 100%; }

/* ---------- 卡片 / 纸片 ---------- */
.sheet {
  background: var(--paper-2);
  box-shadow: var(--shadow-paper);
  border-radius: 2px;
  padding: var(--s6);
  position: relative;
}
.sheet--edge::before {
  content: ""; position: absolute; inset: 6px;
  border: 1px solid var(--rule); pointer-events: none;
}

/* 装饰角标：中式回纹简笔 */
.corner { position: relative; }
.corner::after {
  content: ""; position: absolute; right: var(--s4); top: var(--s4);
  width: 22px; height: 22px;
  border-top: 1.5px solid var(--cinnabar);
  border-right: 1.5px solid var(--cinnabar);
  opacity: .55;
}

/* ---------- 影像占位（不用真人儿童照，见方案 §11） ---------- */
.plate {
  position: relative;
  overflow: hidden;
  background: var(--paper-warm);
  border-radius: 2px;
  isolation: isolate;
}
.plate::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 20% 15%, rgba(255,253,245,.9), transparent 60%),
    radial-gradient(90% 70% at 85% 85%, rgba(160, 120, 70, .34), transparent 62%),
    linear-gradient(150deg, #ddceae 0%, #cbb790 42%, #a89272 100%);
}
.plate::after {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='g'><feTurbulence baseFrequency='.75' numOctaves='3'/><feColorMatrix type='saturate' values='0'/></filter><rect width='120' height='120' filter='url(%23g)' opacity='.38'/></svg>");
  mix-blend-mode: multiply;
  opacity: .55;
}
.plate svg { position: relative; z-index: 2; width: 100%; height: 100%; display: block; }
.plate .stamp {
  position: absolute; z-index: 3; left: var(--s3); bottom: var(--s3);
  font-size: .62rem; letter-spacing: .18em;
  color: rgba(255,250,240,.9);
  background: rgba(27,24,19,.42);
  padding: 3px 8px; border-radius: 1px;
  backdrop-filter: blur(2px);
}

/* ---------- 时间线 ---------- */
.timeline { position: relative; }
.tl-item {
  position: relative;
  padding-left: 5.2rem;
  padding-bottom: var(--s7);
}
.tl-item::before { /* 生长线 */
  content: "";
  position: absolute; left: 1.75rem; top: .4rem; bottom: 0;
  width: 1.5px;
  background: linear-gradient(180deg, var(--rule-strong), var(--rule));
}
.tl-item:last-child::before { background: linear-gradient(180deg, var(--rule-strong), transparent); }
.tl-node {
  position: absolute; left: .55rem; top: 0;
}
.tl-meta {
  font-family: var(--f-num);
  font-size: .95rem;
  letter-spacing: .06em;
  color: var(--ink-3);
  font-variant-numeric: lining-nums;
}

/* ---------- 引号块：爸妈的反应 ---------- */
.quote {
  margin: var(--s4) 0 0;
  padding-left: var(--s4);
  border-left: 2px solid var(--cinnabar);
  font-size: .96rem;
  color: var(--ink-2);
  line-height: 1.78;
}
.quote cite { display: block; font-style: normal; font-size: .74rem; letter-spacing: .16em; color: var(--ink-3); margin-top: .35em; }

/* ---------- 分类签 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip {
  font-size: .76rem; letter-spacing: .1em;
  padding: .3em .8em;
  border-radius: 999px;
  background: var(--cinnabar-wash);
  color: var(--cinnabar-deep);
  border: 1px solid rgba(192,63,33,.22);
}
.chip--mute { background: rgba(27,24,19,.05); color: var(--ink-3); border-color: var(--rule); }

/* ---------- 表格 ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tbl th { text-align: left; font-weight: 500; letter-spacing: .12em; font-size: .74rem; color: var(--ink-3); padding-bottom: .7em; border-bottom: 1px solid var(--rule-strong); }
.tbl td { padding: .85em .6em .85em 0; border-bottom: 1px solid var(--rule); vertical-align: top; }

/* ---------- 动效 ---------- */
.reveal { opacity: 0; transform: translateY(26px); }
.reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- 通用排版件 ---------- */
.lede { font-size: clamp(1.06rem, 1.6vw, 1.28rem); color: var(--ink-2); line-height: 1.85; max-width: 34em; }
.num { font-family: var(--f-num); font-variant-numeric: lining-nums tabular-nums; }
.rule { height: 1px; background: var(--rule); border: 0; margin: var(--s7) 0; }
.vtext { writing-mode: vertical-rl; text-orientation: upright; letter-spacing: .3em; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cinnabar); display: inline-block; }

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

@media (max-width: 640px) {
  :root { --s7: 34px; --s8: 44px; --s9: 62px; --s10: 78px; }
  .sheet { padding: var(--s5); }
  .tl-item { padding-left: 3.4rem; }
  .tl-item::before { left: 1.15rem; }
  .tl-node { left: .1rem; }
  .seal { width: 2.9rem; height: 2.9rem; font-size: .62rem; }
}
