/* 中国饮食文化 · 网站样式（site.js 复制为 dist/site/style.css）
   宣纸底、浓墨字、朱砂与石青点缀；正文用自托管的思源宋体子集（tools/site/subset_fonts.py 生成），
   不加载任何外部资源。首页饭桌区横向翻阅，正文按篇阅读；引注浮窗由 assets/site/reader.js 提供。 */
@font-face { font-family: "GFC Serif"; font-weight: 400; font-style: normal; font-display: swap; src: url("assets/fonts/gfc-serif-400.woff2?v=995d9e52") format("woff2"); }
@font-face { font-family: "GFC Serif"; font-weight: 700; font-style: normal; font-display: swap; src: url("assets/fonts/gfc-serif-700.woff2?v=860e5d12") format("woff2"); }

:root {
  --paper: #f4eee2;
  --paper2: #ebe3d3;
  --card: #fbf8f1;
  --ink: #221e1a;
  --ink2: #5b5248;
  --ink3: #8d8373;
  --line: #d9cfbc;
  --zhu: #a3321f;          /* 朱砂 */
  --zhu-soft: rgba(163, 50, 31, .08);
  --qing: #2e5d63;         /* 石青 */
  --lu: #5a7c5c;           /* 石绿 */
  --frame: #b9ab92;        /* 版框 */
  --serif: "GFC Serif", "Noto Serif SC", "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "STSong", serif;
  --bar: 52px;
  --reading-width: 840px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16140f; --paper2: #1d1a15; --card: #211d18;
    --ink: #e8e0d0; --ink2: #b1a796; --ink3: #827a6c; --line: #3a342b;
    --zhu: #d77a62; --zhu-soft: rgba(215, 122, 98, .1); --qing: #86b4b4; --lu: #9bbd94; --frame: #4a4237;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--serif); line-height: 1.8;
  font-feature-settings: "palt" 0; text-rendering: optimizeLegibility; }
/* 宣纸底纹：Seedream 生成的生宣特写，处理成可平铺的明暗贴图（tools/site/prep_assets.py），以正片叠底叠在底色上 */
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background: url("assets/site/paper.jpg") 0 0 / 512px 512px repeat; mix-blend-mode: multiply; opacity: .95; }
@media (prefers-color-scheme: dark) { body::before { filter: invert(1); mix-blend-mode: screen; opacity: .28; } }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
.btn { display: inline-block; font-size: 15px; letter-spacing: .2em; text-decoration: none; padding: 10px 26px 10px 30px;
  border: 1px solid var(--ink); color: var(--ink); background: transparent; border-radius: 2px; transition: background .2s, color .2s; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { border-color: var(--zhu); background: var(--zhu); color: #fdf8f2; }
.btn.primary:hover { background: transparent; color: var(--zhu); }
.btn[hidden] { display: none; }

/* ---------- 顶栏 ---------- */
.bar { position: sticky; top: 0; z-index: 20; height: var(--bar); display: flex; align-items: center; gap: 16px;
  padding: 0 20px; background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand .seal { width: 30px; height: 30px; color: var(--zhu); display: block; }
.brand b { font-weight: 700; letter-spacing: .32em; font-size: 16px; }
.crumb { flex: 1; min-width: 0; text-align: center; color: var(--ink3); font-size: 13px; letter-spacing: .12em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools { display: flex; gap: 6px; align-items: center; }
.tools a, .tools button { font: inherit; font-size: 13px; letter-spacing: .14em; color: var(--ink2); background: none; border: 1px solid transparent;
  border-radius: 2px; padding: 4px 8px; cursor: pointer; text-decoration: none; }
.tools a:hover, .tools button:hover { color: var(--zhu); border-color: var(--line); }
.tools [hidden] { display: none; }

/* ---------- 首页 ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero picture img { width: 100%; height: clamp(340px, 46vw, 640px); object-fit: cover; object-position: 35% 52%; mix-blend-mode: multiply; }
@media (prefers-color-scheme: dark) { .hero picture img { mix-blend-mode: normal; filter: brightness(.82) saturate(.9); } }
.hero .titles { position: absolute; top: 0; bottom: 0; right: clamp(18px, 8vw, 150px); writing-mode: vertical-rl; display: flex; flex-direction: column;
  align-items: flex-start; gap: clamp(10px, 1.6vw, 26px); padding-top: clamp(26px, 4.6vw, 64px); }
.hero h1 { margin: 0; font-size: clamp(30px, 4.6vw, 64px); font-weight: 700; letter-spacing: .34em; color: #1f1b16; line-height: 1.2; white-space: nowrap;
  text-shadow: 0 0 22px #f4eee2, 0 0 3px #f4eee2; }
.hero .sub { margin: 0; font-size: clamp(14px, 1.45vw, 21px); letter-spacing: .6em; color: #4d453c; padding-top: .4em; white-space: nowrap; text-shadow: 0 0 10px #f4eee2; }
.hero .seal-big { width: clamp(36px, 3.6vw, 56px); height: auto; color: #a3321f; margin-top: .8em; writing-mode: horizontal-tb; }
.home-lead { max-width: 760px; margin: 0 auto; padding: 56px 24px 8px; text-align: center; }
.home-lead p { font-size: 18px; line-height: 2.1; color: var(--ink2); margin: 0 0 1em; }
.home-lead .actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
.section-title { display: flex; align-items: center; gap: 18px; justify-content: center; margin: 72px auto 28px; font-size: 15px; font-weight: 400;
  letter-spacing: .8em; color: var(--ink3); max-width: 1100px; padding: 0 24px; }
.section-title::before, .section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(to right, transparent, var(--line), transparent); }
/* 两万年同席 · 十张饭桌交互展台 */
.table-stage { max-width: 1100px; margin: 0 auto 28px; padding: 0 24px; }
.tt-radio { position: absolute; opacity: 0; pointer-events: none; }
.tt-tabs { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; margin-bottom: 16px; }
.tt-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 4px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 72%, transparent); cursor: pointer; transition: border-color .2s, background .2s, color .2s; text-align: center; user-select: none; }
.tt-tab .tt-no { font-size: 11.5px; color: var(--ink3); letter-spacing: .12em; }
.tt-tab b { font-size: 14.5px; font-weight: 700; letter-spacing: .12em; color: var(--ink); margin-top: 1px; }
.tt-tab:hover { border-color: var(--zhu); }
.tt-panel { display: none; grid-template-columns: minmax(220px, 310px) 1fr; gap: 28px; align-items: center; padding: 24px 28px;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--card) 86%, transparent); }
#tt-v1:checked ~ .tt-tabs label[for="tt-v1"],
#tt-v2:checked ~ .tt-tabs label[for="tt-v2"],
#tt-v3:checked ~ .tt-tabs label[for="tt-v3"],
#tt-v4:checked ~ .tt-tabs label[for="tt-v4"],
#tt-v5:checked ~ .tt-tabs label[for="tt-v5"],
#tt-v6:checked ~ .tt-tabs label[for="tt-v6"],
#tt-v7:checked ~ .tt-tabs label[for="tt-v7"],
#tt-v8:checked ~ .tt-tabs label[for="tt-v8"],
#tt-v9:checked ~ .tt-tabs label[for="tt-v9"],
#tt-v10:checked ~ .tt-tabs label[for="tt-v10"] { border-color: var(--zhu); background: var(--zhu-soft); }
#tt-v1:checked ~ .tt-tabs label[for="tt-v1"] b,
#tt-v2:checked ~ .tt-tabs label[for="tt-v2"] b,
#tt-v3:checked ~ .tt-tabs label[for="tt-v3"] b,
#tt-v4:checked ~ .tt-tabs label[for="tt-v4"] b,
#tt-v5:checked ~ .tt-tabs label[for="tt-v5"] b,
#tt-v6:checked ~ .tt-tabs label[for="tt-v6"] b,
#tt-v7:checked ~ .tt-tabs label[for="tt-v7"] b,
#tt-v8:checked ~ .tt-tabs label[for="tt-v8"] b,
#tt-v9:checked ~ .tt-tabs label[for="tt-v9"] b,
#tt-v10:checked ~ .tt-tabs label[for="tt-v10"] b { color: var(--zhu); }
#tt-v1:checked ~ .tt-panels .tt-panel[data-vid="v1"],
#tt-v2:checked ~ .tt-panels .tt-panel[data-vid="v2"],
#tt-v3:checked ~ .tt-panels .tt-panel[data-vid="v3"],
#tt-v4:checked ~ .tt-panels .tt-panel[data-vid="v4"],
#tt-v5:checked ~ .tt-panels .tt-panel[data-vid="v5"],
#tt-v6:checked ~ .tt-panels .tt-panel[data-vid="v6"],
#tt-v7:checked ~ .tt-panels .tt-panel[data-vid="v7"],
#tt-v8:checked ~ .tt-panels .tt-panel[data-vid="v8"],
#tt-v9:checked ~ .tt-panels .tt-panel[data-vid="v9"],
#tt-v10:checked ~ .tt-panels .tt-panel[data-vid="v10"] { display: grid; }
.tt-visual a { display: block; border: 1px solid var(--line); overflow: hidden; aspect-ratio: 2 / 3; background: var(--card); }
.tt-visual img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.tt-visual a:hover img { transform: scale(1.03); }
.tt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 14px; }
.tt-kicker { margin: 0; font-size: 13px; letter-spacing: .24em; color: var(--zhu); }
.tt-head h3 { margin: 4px 0; font-size: 28px; letter-spacing: .16em; }
.tt-head h3 a { text-decoration: none; }
.tt-head h3 a:hover { color: var(--zhu); }
.tt-period { margin: 0; font-size: 13.5px; color: var(--ink3); letter-spacing: .08em; }
.tt-emblem { width: 88px; height: 88px; object-fit: contain; mix-blend-mode: multiply; flex-shrink: 0; }
.tt-specs { margin: 0 0 14px; display: grid; gap: 8px; }
.tt-specs > div { display: grid; grid-template-columns: 6.2em 1fr; gap: 10px; align-items: baseline; font-size: 15px; line-height: 1.75; }
.tt-specs dt { color: var(--zhu); font-size: 13px; letter-spacing: .16em; }
.tt-specs dd { margin: 0; color: var(--ink); }
.tt-note { margin: 0 0 18px; font-size: 15.5px; line-height: 1.95; color: var(--ink2); padding-top: 10px; border-top: 1px dashed color-mix(in srgb, var(--line) 80%, transparent); }
.tt-action { margin: 0; }
/* 十张饭桌缩略列 */
.tables { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px 14px; padding: 4px 24px 18px;
  max-width: 1320px; margin: 0 auto; }
.tcard { display: block; text-decoration: none; color: inherit; }
.tcard .pic { aspect-ratio: 2 / 3; border: 1px solid var(--line); background: var(--card); overflow: hidden; position: relative; }
.tcard img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.tcard:hover img { transform: scale(1.04); }
.tcard .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; writing-mode: vertical-rl;
  color: var(--ink3); letter-spacing: .5em; font-size: 14px; background:
  radial-gradient(circle at 50% 42%, var(--paper2) 0 34%, transparent 35%), var(--card); }
.tcard .cap { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 2px 0; font-size: 14px; }
.tcard .cap b { color: var(--zhu); font-weight: 400; letter-spacing: .1em; }
.tcard .cap span { color: var(--ink2); letter-spacing: .1em; }
.tcard.todo .cap span, .tcard.todo .cap b { color: var(--ink3); }
/* 卷目 */
.toc { max-width: 1100px; margin: 0 auto; padding: 0 24px 24px; }
.introcard { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px; padding: 26px 28px; border: 1px solid var(--line);
  border-top: 3px solid var(--zhu); background: var(--card); text-decoration: none; color: inherit; margin-bottom: 18px; }
.introcard b { color: var(--zhu); font-size: 15px; letter-spacing: .3em; font-weight: 700; }
.introcard h3 { font-size: 24px; line-height: 1.5; letter-spacing: .12em; margin: 8px 0 12px; }
.introcard p { margin: 4px 0 0; color: var(--ink2); font-size: 15px; line-height: 1.9; }
.introcard .go { color: var(--zhu); letter-spacing: .2em; font-size: 14px; }
.introcard:hover { border-color: var(--zhu); }
.conclusioncard { margin-top: 18px; margin-bottom: 0; }
@media (max-width: 760px) { .introcard { grid-template-columns: 1fr; align-items: start; } }
.vcards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.vcard { display: grid; grid-template-columns: 120px 1fr; gap: 18px; padding: 22px; border: 1px solid var(--line); background: var(--card);
  text-decoration: none; color: inherit; transition: border-color .2s, transform .2s; }
.vcard:hover { border-color: var(--zhu); }
.vcard img { width: 120px; height: 120px; object-fit: contain; mix-blend-mode: multiply; }
@media (prefers-color-scheme: dark) { .vcard img, .voltitle .emblem, .tt-emblem { mix-blend-mode: normal; background: #efe8da; border-radius: 50%; } }
.vcard .vno { color: var(--zhu); letter-spacing: .3em; font-size: 14px; margin: 0; }
.vcard h3 { margin: 2px 0 4px; font-size: 24px; letter-spacing: .14em; }
.vcard .per { margin: 0 0 8px; color: var(--ink3); font-size: 13px; letter-spacing: .06em; }
.vcard .desc { margin: 0; color: var(--ink2); font-size: 15px; line-height: 1.85; }
.vcard .cnt { margin: 10px 0 0; font-size: 13px; color: var(--qing); letter-spacing: .1em; }
.plan { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.plan .pv { padding: 16px 18px; border: 1px dashed var(--line); color: var(--ink3); }
.plan .pv b { display: block; color: var(--ink2); font-weight: 400; letter-spacing: .2em; margin-bottom: 4px; }
.plan .pv p { margin: 0; font-size: 13.5px; line-height: 1.8; }
.backlist { display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: center; padding: 12px 24px 0; font-size: 15px; }
.backlist a { color: var(--ink2); text-decoration: none; border-bottom: 1px solid var(--line); }
.backlist a:hover { color: var(--zhu); border-color: var(--zhu); }

/* ---------- 卷页 ---------- */
.volpage { max-width: 1100px; margin: 0 auto; padding: 40px 24px 24px; }
.volhead { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.volfig figure { margin: 0; }
.volfig img { width: 100%; border: 1px solid var(--line); }
.volfig figcaption { margin-top: 10px; }
.voltitle { display: flex; flex-direction: column; justify-content: flex-start; gap: 22px; writing-mode: vertical-rl; height: min(560px, 72vh);
  padding-right: 8px; position: relative; }
.voltitle .vno { margin: 0; font-size: 18px; letter-spacing: .5em; color: var(--zhu); border: 1px solid var(--zhu); padding: .6em .25em; align-self: flex-start; }
.voltitle h1 { margin: 0; font-size: clamp(38px, 4.6vw, 64px); letter-spacing: .3em; line-height: 1.25; font-weight: 700; }
.voltitle .period { margin: 0; color: var(--ink2); letter-spacing: .3em; font-size: 16px; }
.voltitle .emblem { writing-mode: horizontal-tb; position: absolute; left: 0; bottom: 0; width: min(200px, 40%); height: auto; mix-blend-mode: multiply; }
.volintro { max-width: 760px; margin: 48px auto 0; text-align: center; }
.volintro .lead { font-size: 18px; line-height: 2.1; color: var(--ink2); text-align: justify; text-indent: 2em; margin: 0 0 24px; }
.contents { max-width: 760px; margin: 40px auto 0; }
.contents h2 { text-align: center; font-size: 15px; letter-spacing: .8em; color: var(--ink3); font-weight: 400; margin: 0 0 14px; }
.elist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.elist li { border-bottom: 1px solid var(--line); }
.elist a { display: grid; grid-template-columns: 3.2em 1fr auto; align-items: baseline; gap: 12px; padding: 14px 6px; text-decoration: none; }
.elist .no { color: var(--zhu); letter-spacing: .1em; font-size: 15px; }
.elist .t { font-size: 19px; letter-spacing: .08em; }
.elist .m { color: var(--ink3); font-size: 12.5px; }
.elist a:hover .t { color: var(--zhu); }
.elist .foreword .t, .elist .epilogue .t { color: var(--ink2); }
.volnav { display: flex; justify-content: space-between; gap: 12px; margin: 48px auto 0; max-width: 760px; font-size: 14px; letter-spacing: .1em; }
.volnav a { color: var(--ink2); text-decoration: none; }
.volnav a:hover { color: var(--zhu); }

/* ---------- 阅读页 ---------- */
.reader { max-width: var(--reading-width); margin: 0 auto; padding: 56px 24px 8px; }
.ehead { text-align: center; margin: 0 0 2.6em; }
.ehead .kicker { margin: 0 0 14px; font-size: 13px; letter-spacing: .3em; color: var(--ink3); }
.ehead .kicker a { color: var(--ink3); text-decoration: none; }
.ehead .kicker a:hover { color: var(--zhu); }
.elabel { display: inline-block; color: var(--zhu); border: 1px solid var(--zhu); font-size: 13px; letter-spacing: .3em; padding: 2px 4px 2px 8px; margin-bottom: 14px; }
.ehead h1 { margin: 0; font-size: clamp(28px, 5.4vw, 40px); letter-spacing: .14em; line-height: 1.4; font-weight: 700; }
.ehead .period { margin: 10px 0 0; color: var(--ink2); letter-spacing: .2em; font-size: 15px; }
.text p { font-size: 19px; line-height: 2.05; text-indent: 2em; text-align: justify; margin: 0 0 1.05em; letter-spacing: .02em; }
hr.sep { border: 0; height: 22px; margin: 1.6em 0;
  background: center / 74px 14px no-repeat url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 74 14'><g fill='none' stroke='%23a3321f' stroke-width='1.1' stroke-linecap='round'><path d='M2 7h18M54 7h18'/><path d='M37 2.5c-3 0-5 2-5 4.5s2 4.5 5 4.5 5-2 5-4.5-2-4.5-5-4.5zM27 7c0-2 1.6-3.4 3.4-3.4M47 7c0-2-1.6-3.4-3.4-3.4M27 7c0 2 1.6 3.4 3.4 3.4M47 7c0 2-1.6 3.4-3.4 3.4'/></g></svg>"); }
.fin { text-align: center; color: var(--ink3); font-size: 14px; letter-spacing: .3em; margin: 1.6em 0 0; }
.fin:empty { display: none; }
a.fn { color: var(--zhu); text-decoration: none; font-size: .76em; font-variant-numeric: tabular-nums; margin: 0 .1em; padding: 0 2px; border-radius: 2px; vertical-align: .34em; line-height: 0; cursor: pointer; transition: background .15s, color .15s; }
a.fn:hover { background: var(--zhu-soft); text-decoration: none; }

/* 插图（工笔淡彩复原图去框融纸，图表与书影保留細框） */
.fig { margin: 2.4em auto; text-align: center; }
.fig img { margin: 0 auto; max-height: 82vh; width: auto; border: 1px solid var(--line); background: var(--card); }
.fig.ai:not(.frontis) img { border: 0; background: transparent; mix-blend-mode: multiply; }
.fig.chart img { background: #f8f6f2; }
.fig.source-link { max-width: 40em; margin: 1.5em auto; padding: 12px 18px; border: 1px dashed var(--line); background: color-mix(in srgb, var(--card) 72%, transparent); }
.fig.source-link figcaption { margin: 0; font-size: 13.5px; }
.fig figcaption { max-width: 38em; margin: 12px auto 0; font-size: 14px; line-height: 1.8; color: var(--ink2); text-align: justify; text-align-last: center; }
.ftag { display: inline-block; font-size: 11.5px; letter-spacing: .2em; color: var(--zhu); border: 1px solid var(--zhu); padding: 0 3px 0 6px; margin-right: 8px; line-height: 1.6; vertical-align: 1px; }
.legend { list-style: none; padding: 10px 14px; margin: 10px auto 6px; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 4px 18px; text-align: left; text-align-last: left; font-size: 13px; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.legend li { padding: 2px 4px; border-radius: 2px; transition: background .15s; }
.legend li:hover { background: var(--zhu-soft); }
.legend b { color: var(--zhu); font-weight: 700; margin-right: 5px; }
.credit { display: block; font-size: 12px; color: var(--ink3); margin-top: 6px; text-align: center; }
.credit a { color: var(--ink3); }

/* 注释与引文索引（篇末） */
.notes { max-width: var(--reading-width); margin: 3em auto 0; padding: 0 24px; font-size: 14px; line-height: 1.9; color: var(--ink2); }
.notes h2 { display: flex; align-items: center; gap: 12px; font-size: 13px; letter-spacing: .5em; font-weight: 400; color: var(--ink3); margin: 0 0 10px; padding-top: 22px; border-top: 1px solid var(--line); }
.notes h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(to right, var(--line), transparent); }
.notes ol { list-style: none; margin: 0; padding: 0; }
.notes li { position: relative; padding: 9px 6px 9px 2.85em; margin: 0; border-bottom: 1px dashed color-mix(in srgb, var(--line) 68%, transparent); overflow-wrap: anywhere; word-break: break-word; }
.notes li:last-child { border-bottom: 0; }
.notes li > b { position: absolute; left: 2px; top: 9px; width: 2.35em; color: var(--zhu); font-weight: 400; font-variant-numeric: tabular-nums; text-align: left; line-height: 1.9; user-select: none; }
.notes li > span { display: inline; }
.notes li > span a { color: var(--qing); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--qing) 42%, transparent); text-underline-offset: 3px; word-break: break-all; }
.notes li > span a:hover { color: var(--zhu); text-decoration-color: var(--zhu); }
.notes .back, .notes .source-index { display: inline-block; white-space: nowrap; vertical-align: baseline; font-size: 12px; line-height: 1.45; text-decoration: none; border-radius: 2px; transition: color .15s, border-color .15s, background .15s; }
.notes .back { margin-left: .5em; padding: 1px 6px; color: var(--ink3); border: 1px solid color-mix(in srgb, var(--line) 80%, transparent); background: transparent; }
.notes .back:hover { color: var(--zhu); border-color: var(--zhu); background: var(--card); }
.notes .source-index { margin-left: .35em; padding: 1px 7px; color: var(--zhu); border: 1px solid color-mix(in srgb, var(--zhu) 30%, var(--line)); background: var(--card); letter-spacing: .06em; }
.notes .source-index:hover { border-color: var(--zhu); background: var(--zhu-soft); }
.notes li:target { background: var(--zhu-soft); border-radius: 3px; }
.pager { max-width: var(--reading-width); margin: 2.6em auto 0; padding: 0 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pager a { display: block; padding: 14px 18px; border: 1px solid var(--line); background: var(--card); text-decoration: none; transition: border-color .2s, background .2s; }
.pager a:hover { border-color: var(--zhu); }
.pager span { display: block; font-size: 12px; letter-spacing: .3em; color: var(--ink3); margin-bottom: 2px; }
.pager b { font-weight: 400; letter-spacing: .06em; }
.pager .next { text-align: right; }
.popnote { position: fixed; z-index: 40; max-width: min(440px, calc(100vw - 28px)); background: var(--card); color: var(--ink2); border: 1px solid var(--frame);
  box-shadow: 0 10px 32px rgba(34, 26, 18, .2); border-radius: 3px; padding: 13px 16px; font-size: 14px; line-height: 1.85;
  overflow-wrap: anywhere; word-break: break-word; max-height: calc(100vh - 24px); overflow-y: auto; }
.popnote b { color: var(--zhu); font-weight: 400; font-variant-numeric: tabular-nums; margin-right: 6px; }
.popnote a { color: var(--qing); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--qing) 45%, transparent); text-underline-offset: 3px; word-break: break-all; }
.popnote a:hover { color: var(--zhu); text-decoration-color: var(--zhu); }
.popnote .pop-actions { display: inline-flex; gap: 6px; align-items: center; margin-left: .5em; vertical-align: baseline; }
.popnote .pop-actions a { display: inline-block; white-space: nowrap; font-size: 12px; line-height: 1.4; padding: 1px 6px; border: 1px solid var(--line); border-radius: 2px; color: var(--zhu); background: var(--paper); text-decoration: none; word-break: normal; }
.popnote .pop-actions a:hover { border-color: var(--zhu); background: var(--zhu-soft); }

/* ---------- 书末 ---------- */
.backmatter { max-width: 760px; margin: 0 auto; padding: 48px 24px 24px; }
.backmatter > .kicker { font-size: 13px; letter-spacing: .3em; color: var(--ink3); margin: 0 0 12px; }
.backmatter > .kicker a { color: var(--zhu); text-decoration: none; }
.backmatter h1 { font-size: clamp(28px, 5.4vw, 38px); line-height: 1.4; margin: 0 0 18px; letter-spacing: .1em; }
.backmatter h2 { font-size: 20px; margin: 42px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); letter-spacing: .1em; }
.backmatter h2 small { font-size: 12px; color: var(--ink3); font-weight: 400; margin-left: .8em; }
.note { color: var(--ink2); font-size: 15px; line-height: 2; }
.credits { padding-left: 0; list-style: none; font-size: 15px; line-height: 1.85; counter-reset: c; }
.credits a { font-size: 12.5px; color: var(--zhu); margin-left: .4em; }
.credits li { counter-increment: c; padding: 10px 0; border-bottom: 1px dashed color-mix(in srgb, var(--line) 75%, transparent); }
.credits li:last-child { border-bottom: 0; }
.credits li::before { content: counter(c) "．"; color: var(--ink3); font-size: 12.5px; font-variant-numeric: tabular-nums; margin-right: 2px; }
.credits .where { margin: 0 .55em 0 0; color: var(--qing); text-decoration: none; font-size: 14px; }
.credits .where:hover { color: var(--zhu); }
.credits .credit { text-align: left; margin-top: 3px; }
.backlist { display: flex; flex-wrap: wrap; gap: 16px 28px; }
.sources { max-width: var(--reading-width); font-size: 15px; line-height: 1.95; overflow-wrap: anywhere; word-break: break-word; }
.sources a { color: var(--qing); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--qing) 42%, transparent); text-underline-offset: 3px; word-break: break-all; }
.sources a:hover { color: var(--zhu); text-decoration-color: var(--zhu); }
.citation-table { overflow-x: auto; margin: 18px 0 24px; }
.citation-table table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.75; background: var(--card); }
.citation-table th, .citation-table td { border: 1px solid var(--line); padding: 10px 12px; vertical-align: top; text-align: left; }
.citation-table th { background: var(--paper2); color: var(--ink); font-weight: 700; letter-spacing: .06em; }
.source-note { border-bottom: 1px dashed color-mix(in srgb, var(--line) 72%, transparent); padding: 10px 6px; scroll-margin-top: calc(var(--bar) + 20px); font-size: 14.5px; line-height: 1.9; }
.source-note:target { background: var(--zhu-soft); border-radius: 3px; }
.source-note p { margin: 0; display: inline; }
.source-number { display: inline-block; min-width: 1.8em; color: var(--zhu); font-variant-numeric: tabular-nums; }
.source-where { display: inline-block; font-size: 12px; margin: 0 0 0 .55em; white-space: nowrap; }
.source-where a { display: inline-block; padding: 1px 7px; border: 1px solid color-mix(in srgb, var(--zhu) 30%, var(--line)); border-radius: 2px; background: var(--card); color: var(--zhu); text-decoration: none; line-height: 1.45; word-break: normal; letter-spacing: .04em; }
.source-where a:hover { border-color: var(--zhu); background: var(--zhu-soft); }
/* ---------- 页脚 ---------- */
.foot { text-align: center; font-size: 12.5px; color: var(--ink3); padding: 36px 20px 48px; border-top: 1px solid var(--line); margin-top: 56px; letter-spacing: .06em; }
.foot p { margin: 4px 0; }
.foot a { color: var(--ink3); text-decoration: none; }
.foot a:hover { color: var(--zhu); }

@media (max-width: 860px) {
  .tt-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .tt-panel { grid-template-columns: 1fr; padding: 18px; gap: 18px; }
  .tt-visual { max-width: 260px; margin: 0 auto; width: 100%; }
  .tcard .cap { flex-direction: column; gap: 3px; font-size: 12px; }
  .vcards { grid-template-columns: 1fr; }
  .plan { grid-template-columns: 1fr 1fr; }
  .volhead { grid-template-columns: 1fr; }
  .voltitle { height: auto; min-height: 300px; order: -1; }
  .voltitle .emblem { width: 120px; }
}
@media (max-width: 560px) {
  :root { --bar: 48px; }
  .bar { padding: 0 12px; gap: 8px; }
  .brand b { font-size: 14px; letter-spacing: .2em; }
  .crumb { display: none; }
  .table-stage { padding: 0 12px; }
  .tt-tab b { font-size: 13px; letter-spacing: .04em; }
  .tt-head h3 { font-size: 22px; }
  .tt-emblem { width: 68px; height: 68px; }
  .tt-specs > div { grid-template-columns: 1fr; gap: 2px; }
  .tables { padding-inline: 12px; gap: 16px 6px; }
  .tcard .cap { flex-direction: column; gap: 3px; font-size: 10px; }
  .tcard .cap span { letter-spacing: 0; }
  .vcard { grid-template-columns: 76px 1fr; padding: 16px; gap: 12px; }
  .vcard img { width: 76px; height: 76px; }
  .plan { grid-template-columns: 1fr; }
  .reader { padding: 40px 18px 8px; }
  .text p { font-size: 18px; line-height: 2; }
  .notes { padding: 0 18px; font-size: 13.5px; line-height: 1.85; }
  .notes li { padding: 8px 2px 8px 2.65em; }
  .notes li > b { left: 0; top: 8px; width: 2.2em; }
  .pager { grid-template-columns: 1fr; padding: 0 18px; }
  .pager .next { text-align: left; }
  .backmatter { padding: 36px 18px 20px; }
  .hero .titles { right: 14px; }
}
@media print {
  .bar, .pager, .foot, script { display: none; }
  body::before { display: none; }
  body { background: #fff; color: #000; }
}

.ehead, .text > *, .notes { scroll-margin-top: calc(var(--bar) + 18px); }
@media (prefers-color-scheme: dark) {
  .vcard img, .voltitle img.emblem, .tt-emblem { mix-blend-mode: normal; background: #efe8da; border-radius: 50%; padding: 6px; }
  .fig.ai:not(.frontis) img { mix-blend-mode: normal; background: #efe8da; border-radius: 4px; padding: 8px; }
  .tcard .pic img, .tt-visual img { filter: brightness(.92); }
}
