/* ============================================================================
   毛主席诗词 · 样式表（/Maozedong/）
   ----------------------------------------------------------------------------
   设计基调：夜雪 + 朱砂。首屏是 CSS/SVG 画的雪山与红日，正文落在暖白纸上。
   所有图形都是内联 SVG 与 CSS —— 不引字体、不引图标库、不引外部图片
   （服务器在境内、带宽有限，且素材必须可控；见项目 AGENTS.md）。

   写法三层，顺序即优先级：① 令牌 ② 骨架 ③ 组件，媒体查询放在最后。
   ⚠️ 媒体查询必须写在它要覆盖的基础规则**之后**（同优先级看源顺序）。
   ========================================================================== */

/* ---------------------------------------------------------------- ① 令牌 */
/* 主题：中国红 + 金 + 米白（参考《毛泽东诗词鉴赏》书的封面：深红底、金字）。
   首屏与页脚用红，正文区用米白纸 —— 红是"门面"，不是底色，读起来才不累。 */
:root {
  --red-1: #5d0905;
  --red-2: #8a120b;
  --red-3: #a81a0e;
  --red-4: #c0301d;
  --gold-1: #f2d68f;
  --gold-2: #dcb45f;
  --gold-3: #b5892f;

  --paper: #f6f1e6;
  --paper-2: #fbf7ee;
  --card: #fffdf8;

  --ink: #1d1a16;
  --ink-2: #56504a;
  --ink-3: #8d8479;

  --line: #e8dcc6;
  --line-2: #f2e9d9;

  --seal: #b02418;
  --seal-2: #c8452f;
  --seal-soft: #f9ece7;
  --gold: #a9822c;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(60, 45, 25, .05), 0 12px 30px -18px rgba(60, 45, 25, .38);
  --shadow-lg: 0 2px 6px rgba(30, 22, 12, .08), 0 26px 50px -26px rgba(30, 22, 12, .45);

  --font-ui: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-poem: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif SC",
    "Songti TC", "SimSun", Georgia, serif;

  --pad: 18px;
  --maxw: 1040px;
  --verse-scale: 1; /* 顶栏 A− / A+ 调的就是它，只作用于正文 */
}

/* 正文字号档位（html[data-font] 由 common.js 写入，记在本机） */
html[data-font="sm"] { --verse-scale: .92; }
html[data-font="lg"] { --verse-scale: 1.12; }
html[data-font="xl"] { --verse-scale: 1.26; }

/* ---------------------------------------------------------------- ② 骨架 */
* { box-sizing: border-box; }

/* 作者样式里的任何 display 都会盖掉 UA 的 [hidden]{display:none}，这里兜底 */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  /* 区块锚点跳转平滑滚动；减少动效偏好下立即跳 */
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  /* 手机上往下拽不要触发回弹/下拉刷新（嵌套横滑轨道的既有约定） */
  overscroll-behavior-y: contain;
}

a { color: inherit; }

img, svg { max-width: 100%; }

::selection { background: rgba(176, 36, 24, .16); }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px var(--pad) 10px;
}

.loading {
  margin: 0;
  padding: 26px 0;
  text-align: center;
  color: var(--ink-3);
  font-size: 14px;
}

.link-more {
  display: inline-block;
  color: var(--seal);
  text-decoration: none;
  border-bottom: 1px solid rgba(176, 36, 24, .35);
  padding-bottom: 1px;
}
.link-more:hover { border-bottom-color: var(--seal); }

/* ---------------------------------------------------------------- ③ 顶栏 */
/* 顶栏吸顶：滚动时锁在最上面，不跟着页面滑走 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(74, 8, 4, .94);
  border-bottom: 1px solid rgba(242, 214, 143, .18);
  backdrop-filter: blur(10px);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px var(--pad);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: #fff7e8;
  font-family: var(--font-poem);
  font-size: 19px;
  letter-spacing: .12em;
  text-decoration: none;
  white-space: nowrap;
}
.brand small {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: .06em;
  color: rgba(242, 214, 143, .75);
}

.topnav { display: flex; flex: 0 0 auto; gap: 11px; font-size: 13px; }
.topnav a {
  color: rgba(250, 236, 210, .88);
  text-decoration: none;
  padding: 4px 1px;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
}
.topnav a:hover { color: #fff; }
.topnav a[aria-current="page"] { color: #fff; border-bottom-color: var(--gold-2); }

.topbar__spacer { flex: 1 1 auto; min-width: 0; }

/* 顶栏右侧：字号 / 搜索 / 个人中心 —— 同一个图标按钮样式 */
.topbar__actions { display: inline-flex; align-items: center; gap: 6px; }
.iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 13px;
  line-height: 1;
  color: rgba(250, 236, 210, .92);
  background: rgba(0, 0, 0, .16);
  border: 1px solid rgba(242, 214, 143, .32);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}
.iconbtn:hover { color: #fff; border-color: rgba(242, 214, 143, .62); background: rgba(0, 0, 0, .26); }
.iconbtn svg { display: block; }
/* 已登录：图标右上角一个小金点（不写「已登录：我」那种字样） */
.account-chip .iconbtn--me { position: relative; }
.account-chip .iconbtn--me::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-2);
}
.iconbtn--me { font-size: 12px; }

/* 搜索结果面板 */
.search {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 78px 16px 16px;
  background: rgba(30, 4, 2, .55);
  backdrop-filter: blur(3px);
}
.search__box {
  width: min(560px, 100%);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .6);
  overflow: hidden;
}
.search__input::-webkit-search-cancel-button,
.search__input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}
.search__input {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  font-family: var(--font-ui);
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-2);
  outline: none;
}
.search__list { max-height: 56vh; overflow-y: auto; margin: 0; padding: 6px; list-style: none; }
.search__item { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: inherit; }
.search__item:hover, .search__item:focus { background: rgba(176, 36, 24, .07); }
.search__title { font-family: var(--font-poem); font-size: 16px; font-weight: 600; }
.search__meta { margin-left: 8px; font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
.search__line { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.6; color: var(--ink-2); }
.search__field {
  display: inline-block;
  margin-right: 6px;
  padding: 0 6px;
  font-size: 11px;
  font-style: normal;
  color: var(--seal);
  background: var(--seal-soft);
  border-radius: 4px;
}
.search__line mark { background: rgba(169, 130, 44, .28); color: var(--ink); border-radius: 2px; }
.search__empty { padding: 18px 16px; font-size: 13px; color: var(--ink-3); }

/* 字号/搜索的小提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 90;
  transform: translateX(-50%);
  padding: 8px 16px;
  font-size: 13px;
  color: #fff7e8;
  background: rgba(74, 8, 4, .92);
  border: 1px solid rgba(242, 214, 143, .35);
  border-radius: 999px;
  pointer-events: none;
}

.account-chip { font-size: 12.5px; color: rgba(242, 214, 143, .8); white-space: nowrap; }
.account-chip a { color: #f8e6c8; text-decoration: none; border-bottom: 1px solid rgba(242, 214, 143, .45); }
.account-chip a:hover { color: #fff; }

/* ------------------------------------------------------------ ③b 首屏 */
/* 深红底 + 金线：首页是「两张手迹」的海报，内页是紧凑的红色题头 */
.hero {
  position: relative;
  overflow: hidden;
  color: var(--gold-1);
  background:
    radial-gradient(115% 85% at 80% 6%, rgba(242, 214, 143, .18) 0%, rgba(242, 214, 143, 0) 55%),
    radial-gradient(85% 70% at 6% 104%, rgba(0, 0, 0, .34) 0%, rgba(0, 0, 0, 0) 62%),
    linear-gradient(158deg, var(--red-3) 0%, var(--red-2) 46%, var(--red-1) 100%);
}

/* 下沿一道细金线（装帧感，也把首屏与米白正文分开） */
.hero::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  z-index: 2;
  opacity: .6;
  background: linear-gradient(90deg, transparent, var(--gold-2) 14%, var(--gold-1) 50%, var(--gold-2) 86%, transparent);
}

.hero__inner {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px var(--pad) 26px;
}

.hero__text { min-width: 0; }

.hero__eyebrow {
  display: inline-block;
  margin: 0 0 14px;
  padding: 4px 12px;
  font-size: 11.5px;
  letter-spacing: .22em;
  color: var(--gold-1);
  border: 1px solid rgba(242, 214, 143, .4);
  border-radius: 999px;
  background: rgba(0, 0, 0, .12);
}

.hero__title {
  margin: 0 0 14px;
  font-family: var(--font-poem);
  font-size: clamp(38px, 11vw, 64px);
  font-weight: 600;
  letter-spacing: .14em;
  line-height: 1.15;
  color: #fff7e8;
  text-shadow: 0 2px 26px rgba(0, 0, 0, .45);
}

.hero__lead {
  max-width: 32em;
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.85;
  color: #f8e6c8;
}

/* 首屏三个区块的跳转 */
.hero__jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
}
.hero__jump a {
  padding: 6px 13px;
  font-size: 12.5px;
  letter-spacing: .04em;
  color: var(--gold-1);
  text-decoration: none;
  border: 1px solid rgba(242, 214, 143, .38);
  border-radius: 999px;
  background: rgba(0, 0, 0, .14);
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.hero__jump a:hover {
  color: #fff;
  border-color: rgba(255, 247, 232, .7);
  background: rgba(0, 0, 0, .28);
}

/* 两张手迹横向并排（用户要求：主机图用主席手书，横排两张） */
/* 首屏右下方的签名水印（暗红，低透明度，纯装饰） */
.hero__sign {
  position: absolute;
  top: -12px;
  right: 4px;
  width: clamp(96px, 27vw, 168px);
  height: clamp(190px, 54vw, 330px);
  background: url("../img/hero/qianming.webp") center / contain no-repeat;
  opacity: .38;
  pointer-events: none;
  z-index: 1;
}

/* 两张手迹：左右并排、通栏（原图方向就是对的，不旋转） */
/* 两张手迹：左右并排、通栏到屏幕两边（看得清是最要紧的） */
.hero__hands {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  align-items: start;
  width: 100vw;
  margin: 22px calc(50% - 50vw) 0;
}
/* 手迹原样铺满：不加装裱（红框在图上），只留一点投影把它从红底上托起来 */
.hero__hand {
  padding: 0;
  border-radius: 3px;
  box-shadow: 0 18px 36px -18px rgba(0, 0, 0, .8);
}
.hero__hand img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}
.hero__caption {
  grid-column: 1 / -1;
  margin-top: 2px;
  font-size: 11.5px;
  letter-spacing: .08em;
  text-align: right;
  color: rgba(242, 214, 143, .78);
}

/* 内页紧凑题头：红底 + 雪山红日（SVG 里的颜色在 HTML 里改） */
.hero--compact .hero__inner {
  display: block;
  padding: 14px var(--pad) 14px;
}
.hero__title--poem { font-size: clamp(30px, 8.6vw, 46px); letter-spacing: .1em; }

/* ------------------------------------------------------------ ④ 首页 */
.section { margin: 16px 0 28px; scroll-margin-top: 68px; }

.section__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-2);
}

.section__intro { min-width: 0; }

.section__title {
  position: relative;
  margin: 0;
  padding-left: 12px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .12em;
}
.section__title::before {
  content: "";
  position: absolute;
  left: 0;
  top: .32em;
  width: 4px;
  height: .92em;
  background: var(--seal);
  border-radius: 2px;
}

.section__sub {
  margin: 5px 0 0;
  padding-left: 12px;
  font-size: 12.5px;
  color: var(--ink-3);
}

/* ------------------------------------------------- ④a 一、经典篇目精选 */
/* 横滑轨道：flex + overflow-x + scroll-snap（不要用负外边距藏轨道，会撑宽整页） */
.rail {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  margin-inline: calc(var(--pad) * -1);
  padding: 4px var(--pad) 16px;
  scroll-padding-inline: var(--pad);
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }

.rail-nav { display: flex; gap: 8px; margin-left: auto; flex: 0 0 auto; }
.rail-nav__btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.rail-nav__btn:hover:not(:disabled) { border-color: var(--seal); color: var(--seal); }
.rail-nav__btn:disabled { opacity: .35; cursor: default; }

/* 竖版 3:4（与主站的站点卡一致）—— 像一本小书 */
.pcard {
  flex: 0 0 auto;
  width: min(62vw, 224px);
  aspect-ratio: 3 / 4;
  display: flex;
  scroll-snap-align: start;
}

.pcard__link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: 16px 14px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.pcard__link:hover {
  transform: translateY(-3px);
  border-color: #dccfb5;
  box-shadow: var(--shadow-lg);
}

.pcard__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 0 0 2px;
}
.pcard__year {
  font-family: var(--font-poem);
  font-size: 17px;
  letter-spacing: .05em;
  color: var(--seal);
}
.pcard__chip {
  padding: 1px 7px;
  font-size: 10.5px;
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  white-space: nowrap;
}

.pcard__title {
  margin: 0;
  font-family: var(--font-poem);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pcard__quote {
  margin: 8px 0 0;
  padding: 4px 0 4px 9px;
  border-left: 3px solid var(--seal);
  font-family: var(--font-poem);
  font-size: 14.5px;
  line-height: 1.68;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pcard__note {
  margin: 6px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pcard__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 18px 0 0;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
  font-size: 11px;
  color: var(--ink-3);
}
.pcard__more { color: var(--seal); white-space: nowrap; }
.pcard__stat { color: var(--ink-3); }

/* ----------------------------------------------------- ④b 二、主题分类 */
.cgrid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.ccard {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.ccard:hover { border-color: #d9c9a8; }
.ccard.is-open {
  border-color: rgba(176, 36, 24, .38);
  box-shadow: var(--shadow-lg);
}

.ccard__front { padding: 18px; }

.ccard__no {
  margin: 0 0 6px;
  font-size: 11.5px;
  letter-spacing: .22em;
  color: var(--gold);
}

.ccard__title {
  margin: 0 0 8px;
  font-family: var(--font-poem);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .12em;
}

.ccard__hint {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--ink-2);
  text-align: justify;
}

.ccard__works {
  margin: 0 0 14px;
  font-size: 12.5px;
  line-height: 1.95;
  color: var(--ink-3);
}
.ccard__label {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--ink-3);
}

.cwork { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid rgba(82, 89, 99, .22); }
.cwork:hover { color: var(--seal); border-bottom-color: currentColor; }
.cwork--off { color: var(--ink-3); border-bottom-color: transparent; }
.cwork--more { color: var(--ink-3); border-bottom: 0; }

.ccard__toggle,
.ccard__close {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 14px;
  font-size: 12.5px;
  color: var(--seal);
  background: var(--seal-soft);
  border: 1px solid rgba(176, 36, 24, .24);
  border-radius: 999px;
  cursor: pointer;
}
.ccard__toggle:hover,
.ccard__close:hover { background: #f4ded7; }

.ccard__caret { font-size: 12px; line-height: 1; margin-left: 2px; }

.ccard__panel {
  padding: 2px 18px 18px;
  border-top: 1px dashed var(--line-2);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .2s ease, transform .2s ease;
}
.ccard__panel.is-open { opacity: 1; transform: none; }

.cfields { margin: 14px 0 0; }
.cfields__row {
  display: grid;
  grid-template-columns: minmax(0, 4.8em) minmax(0, 1fr);
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line-2);
}
.cfields__row:last-child { border-bottom: 0; }
.cfields__row dt { font-size: 12.5px; letter-spacing: .06em; color: var(--ink-3); }
.cfields__row dd { margin: 0; font-size: 13.5px; line-height: 1.78; color: var(--ink-2); }

.kw {
  display: inline-block;
  margin: 0 6px 4px 0;
  padding: 1px 9px;
  font-size: 12px;
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: 999px;
}

.ccard__text {
  margin: 14px 0;
  font-size: 14px;
  line-height: 1.95;
  color: var(--ink-2);
  text-align: justify;
}

/* ------------------------------------------------- ④c 三、全编 · 时间线 */
/* 纵向时间线：左侧一条轴线 + 圆点，右边「年份/元信息 → 标题 → 代表句 → 看点」。
   用户明确：**这里不用卡片** —— 没有底色、没有边框，靠轴线与排版把 16 首串起来。 */
.tline {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tline::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 16px;
  bottom: 18px;
  width: 1px;
  background: linear-gradient(180deg, transparent, #d8c9ae 2%, #d8c9ae 98%, transparent);
}

.tnode {
  position: relative;
  padding: 0 0 6px 34px;
  scroll-margin-top: 72px;
}

.tnode__hit {
  display: block;
  padding: 10px 14px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: background .18s ease;
}
a.tnode__hit:hover { background: rgba(255, 253, 248, .78); }

.tnode__dot {
  position: absolute;
  left: 6px;
  top: 20px;
  width: 9px;
  height: 9px;
  background: var(--paper);
  border: 2px solid var(--seal-2);
  border-radius: 50%;
}

.tnode__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 5px;
}
.tnode__year {
  font-family: var(--font-poem);
  font-size: 17px;
  letter-spacing: .04em;
  color: var(--seal);
}
.tnode__cat,
.tnode__form,
.tnode__flag {
  padding: 0 6px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink-3);
  border: 1px solid var(--line-2);
  border-radius: 999px;
}
.tnode__flag {
  color: var(--gold);
  background: rgba(169, 130, 44, .06);
  border-color: rgba(169, 130, 44, .3);
}

.tnode__title {
  display: block;
  margin: 0 0 5px;
  font-family: var(--font-poem);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .03em;
  line-height: 1.45;
}

.tnode__quote {
  display: block;
  margin: 0 0 5px;
  font-family: var(--font-poem);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
}

.tnode__note {
  display: block;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-3);
}

/* 锚点定位到某一年：只给一层很淡的底与朱色标题，仍然不是卡片 */
.tnode:target .tnode__hit { background: rgba(176, 36, 24, .055); }
.tnode:target .tnode__dot { background: var(--seal); border-color: var(--seal); }
.tnode:target .tnode__title { color: var(--seal); }

/* ------------------------------------------------------------ ⑤ 详情页 */
.poem__head { margin: 0 0 14px; }

.poem__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}

.chip {
  padding: 3px 10px;
  font-size: 12px;
  color: var(--ink-2);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}
.chip--form { color: var(--seal); border-color: rgba(176, 36, 24, .32); background: var(--seal-soft); }
.chip--stat { color: var(--ink-3); border-style: dashed; }

.poem__preface {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-2);
  font-family: var(--font-poem);
}

.verse {
  padding: 28px 16px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.verse__stanza + .verse__stanza {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}

.verse__label {
  margin: 0 0 8px;
  text-align: left;
  font-size: 11.5px;
  letter-spacing: .3em;
  color: var(--ink-3);
}

.verse__line {
  margin: 0 0 4px;
  font-family: var(--font-poem);
  font-size: calc(clamp(16px, 4.4vw, 19px) * var(--verse-scale));
  line-height: 1.9;
  letter-spacing: .02em;
  text-align: left;
  color: var(--ink);
}

.block { margin: 28px 0 0; }

.block__title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 12px;
  padding-left: 10px;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: .1em;
  border-left: 4px solid var(--seal);
}

.block__count { font-size: 12px; font-weight: 400; color: var(--ink-3); letter-spacing: .04em; }

.quote {
  margin: 0 0 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--seal);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.quote__text {
  margin: 0 0 6px;
  font-family: var(--font-poem);
  font-size: calc(18px * var(--verse-scale));
  letter-spacing: .04em;
  color: var(--ink);
}
.quote__gloss { font-size: 13.5px; line-height: 1.8; color: var(--ink-2); }

.notes { margin: 0; }
.notes__row { padding: 10px 0; border-bottom: 1px dashed var(--line-2); }
.notes__row:last-child { border-bottom: 0; }
.notes__term { margin: 0 0 2px; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.notes__text { margin: 0; font-size: calc(14px * var(--verse-scale)); line-height: 1.85; color: var(--ink-2); }

.prose {
  margin: 0 0 12px;
  font-size: calc(15px * var(--verse-scale));
  line-height: 1.95;
  color: var(--ink-2);
  text-align: justify;
}

/* 顶部翻页：只留左右两格，细一条 */
.pager--top {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 10px;
}
.pgbtn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 12px;
  font-size: 12.5px;
  color: var(--ink-2);
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color .18s ease, color .18s ease;
}
.pgbtn:hover { border-color: var(--seal); color: var(--seal); }
.pgbtn--next { justify-content: flex-end; }
.pgbtn--none { opacity: .45; }
.pgbtn--none:hover { border-color: var(--line); color: var(--ink-2); }
.pgbtn__dir { color: var(--ink-3); }
.pgbtn__title {
  font-family: var(--font-poem);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 26px 0 10px;
}
.pager__link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: border-color .18s ease, transform .18s ease;
}
.pager__link:hover { border-color: var(--seal); transform: translateY(-2px); }
.pager__link--none { opacity: .45; }
.pager__link--none:hover { border-color: var(--line); transform: none; }
.pager__link--next { text-align: right; align-items: flex-end; }
.pager__link--index { grid-column: 1 / -1; order: 3; text-align: center; align-items: center; }
.pager__dir { font-size: 11.5px; letter-spacing: .08em; color: var(--ink-3); }
.pager__title { font-family: var(--font-poem); font-size: 16px; }

/* ------------------------------------------------------------ ⑥ 凡例页 */
.doc {
  padding: 26px var(--pad) 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.doc__list { margin: 0 0 12px; padding-left: 1.2em; }
.doc__list li { margin-bottom: 6px; font-size: 14.5px; line-height: 1.85; color: var(--ink-2); }
.doc__list strong { color: var(--ink); font-weight: 600; }

.doc__defs { margin: 0; }
.doc__defs dt { margin-top: 12px; font-weight: 600; color: var(--ink); font-size: 14.5px; }
.doc__defs dd { margin: 4px 0 0; font-size: 14.5px; line-height: 1.9; color: var(--ink-2); }

/* 目次里的「全文」小标 */
.doc__flag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  font-size: 11px;
  font-style: normal;
  color: var(--gold);
  background: rgba(169, 130, 44, .08);
  border: 1px solid rgba(169, 130, 44, .3);
  border-radius: 4px;
  vertical-align: 1px;
}

.doc__back { margin: 26px 0 0; }

/* ---------------------------------------------------------------- ⑦ 页脚 */
.footer {
  margin-top: 42px;
  background: linear-gradient(180deg, var(--red-2), var(--red-1));
  color: rgba(242, 214, 143, .8);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px var(--pad) 28px;
  font-size: 12.5px;
}
.footer__inner a { color: #f8e6c8; text-decoration: none; }
.footer__inner a:hover { color: #fff; }
.footer__brand { font-family: var(--font-poem); font-size: 14px; letter-spacing: .1em; color: var(--gold-1); }
.footer__legal { color: rgba(242, 214, 143, .7); }

/* ------------------------------------------------------- ⑧ 宽屏（最后写） */
@media (min-width: 720px) {
  :root { --pad: 28px; }

  /* 首屏：文字在上（1040），两张手迹通栏更宽（1200），看得清 */
  .hero__inner { padding: 34px var(--pad) 40px; }
  .hero__sign { top: -18px; right: 2%; width: 240px; height: 480px; opacity: .5; }
  .hero__text { max-width: 44em; }
  .hero__hands {
    gap: 18px;
    width: min(1400px, 100vw - var(--pad) * 2);
    margin: 28px auto 0;
  }
  .hero__title { font-size: clamp(44px, 5vw, 62px); }
  .hero--compact .hero__inner { display: block; padding: 20px var(--pad) 18px; }

  .wrap { padding-top: 22px; }

  .section { margin: 24px 0 36px; }
  .section__title { font-size: 19px; }

  /* 精选：3:4 竖版卡，一屏看三张半 */
  .pcard { width: 250px; }
  .pcard__title { font-size: 20px; }
  .pcard__quote { font-size: 15px; }

  .cgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .ccard__front { padding: 22px; }
  .ccard__panel { padding: 2px 22px 22px; }
  .cfields__row { grid-template-columns: minmax(0, 5.4em) minmax(0, 1fr); gap: 14px; }

  /* 纵向时间线：宽屏下行宽收一收，读起来不散 */
  .tline { max-width: 820px; }
  .tnode { padding-left: 40px; }
  .tnode__title { font-size: 22px; }
  .tnode__quote { font-size: 17px; }

  .verse { padding: 40px 32px 34px; }
  .verse__line { font-size: 22px; }

  .notes__row {
    display: grid;
    grid-template-columns: minmax(0, 8.5em) minmax(0, 1fr);
    gap: 14px;
    align-items: baseline;
  }
  .notes__term { margin: 0; text-align: right; }

  .pager { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1fr); }
  .pager__link--index { grid-column: auto; order: 0; }

  .footer__inner {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 18px;
  }
}

/* ------------------------------------------------- ⑨ 窄屏收尾（最后写） */
/* 站点名 5 个字 + 日期 + 两个导航 + 账号，在 390 及以下会把顶栏挤得换行
   （实测 360 宽时内容比栏宽多 4px、栏高从 56 变 79）。手机上把日期收起来。 */
@media (max-width: 480px) {
  .brand small { display: none; }
  .topnav { gap: 8px; font-size: 12.5px; }
  .brand { font-size: 16px; letter-spacing: .06em; }
  .topbar__inner { gap: 7px; }
  .iconbtn { width: 27px; height: 27px; }
}
