/* 《石榴》· 阅读页样式
   气质三个数：正文宽 820px / 行高 1.92 / 字距 0.02em（衬线中文不宜过散）
   色：纸（暖白）· 墨（偏暖的深褐黑）· 石榴（一个压暗的赭红，只用在小面积）
*/

:root {
  /* 纸与墨 */
  --paper:      #f6f2ea;
  --paper-deep: #efe9dd;
  --ink:        #1e1b17;
  --ink-2:      #45403a;   /* 次要文字 */
  --ink-3:      #6f6860;   /* 注脚 */
  --ink-4:      #a79f94;   /* 更弱 */
  --rule:       #ddd5c6;   /* 分隔线 */

  /* 主色：石榴 */
  --pom:        #8c2f27;
  --pom-soft:   #b8564a;

  /* 排版三数 */
  --measure:    820px;
  --lh:         1.92;
  --ls:         0.02em;

  /* 间距刻度（8 的倍数）：段 : 块 : 节 ≈ 1 : 2 : 5 */
  --s1: 8px;  --s2: 16px; --s3: 24px;
  --s4: 40px; --s5: 64px; --s6: 104px; --s7: 160px;

  --serif: 'Noto Serif SC', 'Songti SC', 'Source Han Serif SC', Georgia, serif;
  --sans:  'Inter', 'PingFang SC', 'Noto Sans SC', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17.5px;
  line-height: var(--lh);
  letter-spacing: var(--ls);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── 阅读进度：唯一的持续动效 ───────────────────────── */
#progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: var(--pom);
  z-index: 50;
  transition: width .08s linear;
}

/* ── 顶栏 ──────────────────────────────────────────── */
.site-head {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-head.scrolled { border-bottom-color: var(--rule); }

.site-title {
  font-family: var(--serif);
  font-size: 15px; font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--ink); text-decoration: none;
}
.site-nav { display: flex; gap: var(--s3); }
.site-nav a {
  font-family: var(--sans);
  font-size: 12.5px; letter-spacing: 0.1em;
  color: var(--ink-3); text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.site-nav a:hover, .site-nav a[aria-current] {
  color: var(--pom); border-bottom-color: var(--pom);
}

/* ── 通用容器 ──────────────────────────────────────── */
main { padding: 0 var(--s4); }
.wrap { max-width: var(--measure); margin: 0 auto; }

/* ── 题名区：左对齐，不做居中大标题 ─────────────────── */
.titleblock {
  max-width: var(--measure); margin: 0 auto;
  padding: var(--s7) 0 var(--s6);
}
.titleblock .kicker {
  font-family: var(--sans);
  font-size: 12px; letter-spacing: 0.32em;
  color: var(--ink-4);
  margin: 0 0 var(--s4);
  text-transform: uppercase;
}
.titleblock h1 {
  margin: 0;
  font-size: clamp(72px, 15vw, 156px);
  font-weight: 700;
  line-height: .92;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.titleblock .fa {
  display: block;
  width: max-content;
  margin-top: var(--s1);
  font-size: clamp(26px, 5vw, 40px);
  color: var(--pom);
  font-weight: 400;
  letter-spacing: 0;
  direction: rtl;
  unicode-bidi: isolate;
}
.titleblock .sub {
  margin: var(--s5) 0 0;
  max-width: 34em;
  font-size: 19px;
  color: var(--ink-2);
  line-height: 1.8;
}

/* 丰度阶梯：从内容里长出来的题图，不是装饰条 */
.ladder {
  margin: var(--s6) 0 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: var(--s3) 0;
  display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4);
  font-family: var(--sans);
  font-size: 12px; letter-spacing: 0.08em;
  color: var(--ink-4);
}
.ladder b { color: var(--ink-2); font-weight: 500; }
.ladder .hot { color: var(--pom); font-weight: 600; }
.ladder .unk { color: var(--pom); font-weight: 600; }

/* ── 目录 ──────────────────────────────────────────── */
.toc { max-width: var(--measure); margin: var(--s6) auto 0; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { border-top: 1px solid var(--rule); }
.toc li:last-child { border-bottom: 1px solid var(--rule); }
.toc a {
  display: flex; align-items: baseline; gap: var(--s3);
  padding: var(--s3) 0;
  color: var(--ink); text-decoration: none;
  transition: color .2s, padding-left .25s ease;
}
.toc a:hover { color: var(--pom); padding-left: var(--s2); }
.toc .num {
  font-family: var(--sans); font-size: 11px; letter-spacing: 0.2em;
  color: var(--ink-4); width: 3.5em; flex: none;
}
.toc .t { font-size: 20px; font-weight: 500; }
.toc .g { margin-left: auto; font-family: var(--sans); font-size: 11.5px; color: var(--ink-4); letter-spacing: .06em; }

/* ── 章 ────────────────────────────────────────────── */
.chapter { max-width: var(--measure); margin: 0 auto; padding-top: var(--s7); }
.chapter-head { margin-bottom: var(--s6); }
.chapter-head .cn {
  font-family: var(--sans);
  font-size: 11.5px; letter-spacing: 0.34em;
  color: var(--pom);
  margin: 0 0 var(--s2);
}
.chapter-head h2 {
  margin: 0;
  font-size: clamp(40px, 7vw, 62px);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.1;
}

/* 正文 */
.chapter p {
  margin: 0 0 var(--s3);
  text-align: justify;
  text-justify: inter-ideograph;
}
.chapter p.first { text-indent: 0; }
.chapter strong { font-weight: 700; color: var(--ink); }
.chapter em { font-style: normal; color: var(--pom); }

/* 诗行 / 清单式的短行段落（日期列表、他写：…） */
.chapter .lines p { margin-bottom: 2px; }
.chapter .lines { margin-bottom: var(--s3); }

/* 引文 */
.chapter blockquote {
  margin: var(--s4) 0;
  padding-left: var(--s3);
  border-left: 2px solid var(--pom);
  color: var(--ink-2);
}
.chapter blockquote p:last-child { margin-bottom: 0; }

/* 行内波斯语 */
.ar {
  font-family: 'Noto Naskh Arabic', var(--serif);
  direction: rtl; unicode-bidi: isolate;
  color: var(--pom); font-size: 1.15em;
}

/* 场景分隔：三颗籽 */
.sep {
  margin: var(--s5) 0;
  text-align: center;
  color: var(--pom-soft);
  font-size: 12px;
  letter-spacing: 1.2em;
  text-indent: 1.2em;
  opacity: .8;
}

/* 全篇最重的一句，单独立出来 */
.pull {
  margin: var(--s5) 0;
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1.55;
  font-weight: 700;
  color: var(--ink);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: var(--s4) 0;
}
.pull .fa { display:block; direction: rtl; color: var(--pom); font-size: .8em; margin-top: var(--s2); font-weight: 400; }

/* ── 附录页 ────────────────────────────────────────── */
.doc { max-width: var(--measure); margin: 0 auto; padding-top: var(--s6); }
.doc h1 {
  font-size: clamp(38px, 7vw, 58px); font-weight: 700;
  letter-spacing: .05em; margin: 0 0 var(--s3); line-height: 1.15;
}
.doc .standfirst { font-size: 18px; color: var(--ink-2); margin: 0 0 var(--s6); max-width: 34em; }
.doc h2 {
  margin: var(--s6) 0 var(--s3);
  font-size: 26px; font-weight: 700; letter-spacing: .05em;
  padding-top: var(--s3); border-top: 2px solid var(--ink);
}
.doc h3 {
  margin: var(--s4) 0 var(--s2);
  font-family: var(--sans); font-size: 13px; letter-spacing: .16em;
  color: var(--pom); font-weight: 600;
}
.doc ul { margin: 0 0 var(--s3); padding-left: 1.2em; }
.doc li { margin-bottom: 6px; }
.doc li::marker { color: var(--ink-4); }
.doc p { margin: 0 0 var(--s3); }
.doc .tag {
  display: inline-block;
  font-family: var(--sans); font-size: 11px; letter-spacing: .1em;
  padding: 3px 9px; border-radius: 2px; margin-bottom: var(--s2);
}
.tag.real { background: #e4ece2; color: #33552f; }
.tag.half { background: var(--paper-deep); color: var(--ink-2); }
.tag.fake { background: #f2e0dd; color: var(--pom); }

/* ── 页脚 ──────────────────────────────────────────── */
.site-foot {
  margin-top: var(--s7);
  border-top: 1px solid var(--rule);
  padding: var(--s5) var(--s4) var(--s6);
}
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); justify-content: space-between; align-items: flex-start; }
.site-foot p { margin: 0 0 6px; font-family: var(--sans); font-size: 12.5px; color: var(--ink-3); letter-spacing: .04em; line-height: 1.8; max-width: 30em; }
.site-foot a { color: var(--pom); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--pom) 35%, transparent); }
.site-foot a:hover { border-bottom-color: var(--pom); }
.site-foot .mark { font-family: var(--serif); font-size: 13px; letter-spacing: .2em; color: var(--ink-4); }

/* ── 节淡入：按节做，不逐元素 ──────────────────────── */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ── 响应式：一个断点 ──────────────────────────────── */
@media (max-width: 860px) {
  body { font-size: 16.5px; line-height: 1.88; }
  main, .site-head, .site-foot { padding-left: var(--s3); padding-right: var(--s3); }
  .titleblock { padding: var(--s6) 0 var(--s5); }
  .chapter { padding-top: var(--s6); }
  .chapter-head { margin-bottom: var(--s5); }
  .ladder { gap: 4px var(--s3); font-size: 11px; }
  .toc .g { display: none; }
  .toc .num { width: 3em; }
  .toc .t { font-size: 17px; }
  .site-foot .wrap { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  #progress { transition: none; }
}
