/* ============================================================
   「药典·墨卷」— 中国药典 2025 展示界面
   现代学术排版 × 古籍卷帙: 暖纸底 / 墨色 / 朱砂 / 黛蓝 / 琥珀
   ============================================================ */

:root {
  --paper: #f5f0e6;
  --paper-2: #fbf8f1;
  --paper-3: #ece5d6;
  --paper-4: #e3dac7;
  --ink: #2a241b;
  --ink-2: #5f574a;
  --ink-3: #968c7b;
  --ink-4: #b5ab97;
  --line: #ddd3bf;
  --line-strong: #c6ba9f;
  --seal: #b03a2b;
  --seal-deep: #8f2d20;
  --seal-soft: #e7c9c2;
  --indigo: #37506e;
  --indigo-soft: #dce4ee;
  --amber: #9a7a2f;
  --amber-soft: #f2e9d3;
  --shadow: 0 1px 2px rgba(60, 45, 20, .06), 0 8px 24px rgba(60, 45, 20, .07);
  --shadow-lift: 0 2px 4px rgba(60, 45, 20, .08), 0 14px 40px rgba(60, 45, 20, .13);
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --folio: "Cormorant Garamond", "Noto Serif SC", serif;
  --mast-h: 60px;
  --radius: 10px;
}

[data-theme="ink"] {
  --paper: #171410;
  --paper-2: #1e1a13;
  --paper-3: #262119;
  --paper-4: #2e281d;
  --ink: #e8dfca;
  --ink-2: #b6ab92;
  --ink-3: #7f765f;
  --ink-4: #5c5543;
  --line: #332c20;
  --line-strong: #4c4230;
  --seal: #cf5a42;
  --seal-deep: #e2725b;
  --seal-soft: #46231c;
  --indigo: #8ba4c4;
  --indigo-soft: #1f2a38;
  --amber: #c9a25e;
  --amber-soft: #33291a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .4), 0 14px 40px rgba(0, 0, 0, .5);
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--mast-h) + 64px); }

body {
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  transition: background .35s ease, color .35s ease;
}

/* 纸纹噪声 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  background-image: url(/codex-cn-2025/assets/css/"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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .35 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="ink"] body::before { opacity: .16; }

a { color: var(--indigo); text-decoration: none; }
a:hover { color: var(--seal); }

.skip {
  position: absolute; left: -9999px;
}
.skip:focus { left: 12px; top: 12px; z-index: 200; background: var(--paper-2); padding: 6px 14px; border-radius: 6px; border: 1px solid var(--seal); }

/* ---------------- 书眉 (masthead) ---------------- */

.mast {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 var(--paper-3) inset;
}
.mast::after {
  content: "";
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--seal) 0%, var(--seal) 120px, transparent 46%);
  opacity: .85;
}
.mast-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  height: var(--mast-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--seal);
  color: #f7efe2;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 1px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(255, 245, 220, .35), inset 0 0 12px rgba(80, 10, 0, .45), var(--shadow);
  transform: rotate(-3deg);
  transition: transform .25s ease;
  user-select: none;
}
.brand:hover .seal { transform: rotate(0deg) scale(1.05); }
.brand-name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .04em;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
}
.brand-name small {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 10.5px;
  letter-spacing: .42em;
  color: var(--ink-3);
}
.mast-nav { display: flex; align-items: center; gap: 4px; }
.mast-nav a {
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink-2);
  padding: 6px 12px;
  border-radius: 99px;
  transition: color .2s, background .2s;
}
.mast-nav a:hover { color: var(--seal); background: var(--paper-3); }
.theme-toggle {
  width: 34px; height: 34px;
  margin-left: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
  transition: transform .3s ease, border-color .2s;
}
.theme-toggle:hover { border-color: var(--seal); transform: rotate(30deg); }

/* ---------------- 检索条 ---------------- */

.search-strip {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 24px 0;
  z-index: 60;
}
.search-strip input,
.hero-search input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 14.5px;
  padding: 9px 16px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.search-strip input:focus,
.hero-search input:focus {
  border-color: var(--seal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--seal) 18%, transparent);
}
.search-drop {
  position: absolute;
  top: calc(100% - 2px);
  left: 24px;
  right: 24px;
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-lift);
  max-height: 380px;
  overflow: auto;
  display: none;
  z-index: 90;
}
.search-drop.open { display: block; }
.search-drop .sd-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 16px;
  border-top: 1px dashed var(--line);
  cursor: pointer;
  color: var(--ink);
}
.search-drop .sd-item:hover, .search-drop .sd-item.active { background: var(--paper-3); }
.search-drop .sd-name { font-weight: 600; font-size: 14.5px; }
.search-drop .sd-py { font-family: var(--sans); font-size: 12px; color: var(--ink-3); }
.search-drop .sd-meta { margin-left: auto; font-family: var(--sans); font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.search-drop .sd-none { padding: 14px 16px; color: var(--ink-3); font-size: 13px; }

/* ---------------- 面包屑 + 卷页号 ---------------- */

.crumb {
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 24px 4px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-3);
  position: relative;
}
.crumb a { color: var(--ink-3); }
.crumb a:hover { color: var(--seal); }
.crumb-sep { color: var(--ink-4); }
.folio {
  margin-left: auto;
  font-family: var(--folio);
  font-style: italic;
  font-size: 52px;
  line-height: 1;
  color: var(--ink-4);
  letter-spacing: .02em;
  user-select: none;
  transition: color .3s;
}

/* ---------------- 三栏布局 ---------------- */

.layout {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 24px 40px;
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr) 264px;
  gap: 30px;
  align-items: start;
}

/* 目录轨 */
.tocrail { position: relative; }
.tocrail-inner {
  position: sticky;
  top: calc(var(--mast-h) + 84px);
  max-height: calc(100vh - var(--mast-h) - 120px);
  overflow: auto;
  padding: 6px 10px 6px 0;
}
.toc { display: flex; flex-direction: column; gap: 1px; }
.toc a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  border-left: 2px solid transparent;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-3);
  transition: color .18s, background .18s, border-color .18s;
}
.toc a:hover { color: var(--ink); background: var(--paper-3); }
.toc a.active {
  color: var(--seal);
  border-left-color: var(--seal);
  background: color-mix(in srgb, var(--seal-soft) 26%, transparent);
  font-weight: 500;
}
.toc-num {
  font-family: var(--serif);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-4);
  min-width: 1em;
}
.toc a.active .toc-num { color: var(--seal); }
.toc-progress {
  margin-top: 14px;
  height: 2px;
  background: var(--paper-3);
  border-radius: 2px;
  overflow: hidden;
}
.toc-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--seal);
  transition: width .15s linear;
}

/* 主栏 */
.main { min-width: 0; display: flex; flex-direction: column; gap: 26px; }

/* ---------------- 条目眉题 ---------------- */

.masthead {
  padding: 26px 34px 22px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.masthead::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--seal), color-mix(in srgb, var(--seal) 20%, transparent));
}
.masthead::after {
  content: "";
  position: absolute;
  right: -40px; top: -46px;
  width: 210px; height: 210px;
  background: radial-gradient(circle, color-mix(in srgb, var(--seal-soft) 55%, transparent) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.masthead-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tag {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .08em;
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
  background: var(--paper-3);
}
.tag-part { color: var(--seal); border-color: color-mix(in srgb, var(--seal) 45%, var(--line)); }
.tag-cat { color: var(--indigo); border-color: color-mix(in srgb, var(--indigo) 40%, var(--line)); }
.entry-name {
  font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.25;
  color: var(--ink);
  position: relative;
  z-index: 1;
}
.entry-langs {
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-3);
  letter-spacing: .05em;
}
.masthead-meta {
  margin-top: 14px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-3);
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}

/* 勘校提示 */
.ocr-note {
  display: flex;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid color-mix(in srgb, var(--amber) 45%, var(--line));
  background: var(--amber-soft);
  border-radius: var(--radius);
  animation: rise .5s ease both;
}
.ocr-note-mark {
  flex: none;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--amber);
  color: #fdf8ec;
  font-weight: 700;
  border-radius: 6px;
  transform: rotate(-4deg);
}
.ocr-note b { font-size: 13.5px; color: var(--amber); }
.ocr-note p { font-family: var(--sans); font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }

/* AI 速览 */
.ai-card {
  border: 1px dashed color-mix(in srgb, var(--seal) 55%, var(--line-strong));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--paper-2) 88%, var(--seal-soft));
  padding: 18px 22px;
  animation: rise .5s .05s ease both;
}
.ai-card header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ai-mark {
  flex: none;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--seal);
  color: #f7efe2;
  font-family: var(--folio);
  font-style: italic;
  font-weight: 700;
  font-size: 17px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255,245,220,.4);
}
.ai-card h3 { font-size: 15px; font-weight: 700; letter-spacing: .06em; }
.ai-tag { font-family: var(--sans); font-size: 11px; color: var(--ink-3); }
.ai-lead {
  font-size: 15px;
  color: var(--ink);
  border-left: 3px solid var(--seal);
  padding-left: 12px;
  margin: 10px 0 12px;
}
.ai-card h4 {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .2em;
  color: var(--ink-3);
  margin: 12px 0 6px;
}
.ai-points { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.ai-points li { position: relative; padding-left: 16px; font-size: 13.5px; color: var(--ink-2); }
.ai-points li::before {
  content: "";
  position: absolute;
  left: 2px; top: .72em;
  width: 6px; height: 6px;
  background: var(--seal);
  transform: rotate(45deg);
}

/* ---------------- 节卡片 ---------------- */

.sec-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  scroll-margin-top: calc(var(--mast-h) + 60px);
  animation: rise .5s ease both;
}
.sec-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
}
.sec-index {
  flex: none;
  font-weight: 700;
  font-size: 15px;
  color: var(--seal);
  position: relative;
}
.sec-index::after {
  content: "";
  position: absolute;
  right: -6px; top: 2px; bottom: 2px;
  width: 1px;
  background: var(--line-strong);
}
.sec-head h2 { font-size: 19px; font-weight: 700; letter-spacing: .1em; color: var(--ink); }
.sec-sub { font-family: var(--sans); font-size: 11.5px; color: var(--ink-3); letter-spacing: .14em; }
.sec-body { padding: 18px 24px 22px; }

.sec-text { margin: 8px 0; color: var(--ink-2); font-size: 15px; }
.sec-text b { color: var(--ink); font-weight: 600; }

/* 测试项 */
.test-item {
  padding: 12px 0;
  border-top: 1px dashed var(--line);
}
.test-item:first-child { border-top: none; }
.test-item-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.test-item-name {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--indigo);
  letter-spacing: .04em;
}
.test-item-label {
  display: inline-block;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--indigo);
  background: var(--indigo-soft);
  padding: 1px 9px;
  border-radius: 4px;
  margin: 4px 8px 4px 0;
}
.limit-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.limit-chip {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--amber);
  border: 1px solid color-mix(in srgb, var(--amber) 50%, var(--line));
  background: color-mix(in srgb, var(--amber-soft) 70%, transparent);
  padding: 1px 8px;
  border-radius: 99px;
}

/* 子块(饮片 / 附) */
.sub-block { margin: 10px 0; }
.sub-block-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  border-left: 3px solid var(--seal);
  padding-left: 10px;
  margin-bottom: 6px;
  letter-spacing: .06em;
}

/* 通则条款 */
.clause {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper-3);
  border-radius: 6px;
  padding: 6px 12px;
  margin: 16px 0 4px;
  letter-spacing: .06em;
}
.clause:first-child { margin-top: 0; }
.clause-bracket { color: var(--seal); font-weight: 700; }

/* 表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13.5px;
  font-family: var(--serif);
  color: var(--ink-2);
}
.data-table th, .data-table td {
  border: 1px solid var(--line);
  padding: 7px 12px;
  text-align: center;
  vertical-align: middle;
}
.data-table th {
  background: var(--paper-3);
  font-weight: 700;
  color: var(--ink);
  border-bottom: 2px solid var(--line-strong);
  white-space: nowrap;
}
.data-table td { color: var(--ink-2); }
.data-table tr:hover td { background: color-mix(in srgb, var(--paper-3) 60%, transparent); }
.data-table.mini { width: auto; min-width: 260px; }

/* ---------------- 图谱 ---------------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}
.plate {
  background: var(--paper-3);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.plate:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: var(--shadow-lift); }
.plate a { display: block; }
.plate img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  background: #fff;
}
[data-theme="ink"] .plate img { background: #f4f0e4; }
.plate figcaption, .folio figcaption {
  font-family: var(--folio);
  font-style: italic;
  font-size: 12.5px;
  color: var(--ink-3);
  text-align: center;
  padding-top: 6px;
  letter-spacing: .06em;
}
.gallery-empty {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--ink-3);
  font-size: 13.5px;
}
.gallery-empty-mark {
  flex: none;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--line-strong);
  border-radius: 50%;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-4);
}
.folio-gallery { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.folio {
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  box-shadow: 3px 3px 0 color-mix(in srgb, var(--line-strong) 40%, transparent), var(--shadow);
  padding: 10px;
  border-radius: 4px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.folio:hover { transform: translateY(-3px) rotate(.4deg); box-shadow: 4px 5px 0 color-mix(in srgb, var(--line-strong) 45%, transparent), var(--shadow-lift); }
.folio img { width: 100%; display: block; border-radius: 2px; background: #f6f2e7; }
[data-theme="ink"] .folio img { background: #e9e3d2; }

/* ---------------- Lightbox ---------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(16, 12, 6, .93);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lb-fig { max-width: 92vw; max-height: 86vh; text-align: center; }
.lb-fig img { max-width: 92vw; max-height: 78vh; box-shadow: 0 10px 60px rgba(0,0,0,.6); border-radius: 4px; background: #f4f0e4; }
.lb-cap { color: #d8cdb4; font-family: var(--folio); font-style: italic; font-size: 15px; margin-top: 14px; letter-spacing: .1em; }
.lb-close {
  position: absolute;
  top: 18px; right: 22px;
  width: 42px; height: 42px;
  border: 1px solid rgba(255, 245, 220, .35);
  border-radius: 50%;
  background: transparent;
  color: #eee2c8;
  font-size: 20px;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.lb-close:hover { background: var(--seal); border-color: var(--seal); transform: rotate(90deg); }
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  border: 1px solid rgba(255, 245, 220, .3);
  border-radius: 50%;
  background: transparent;
  color: #eee2c8;
  font-size: 22px;
  cursor: pointer;
  transition: background .2s;
}
.lb-nav:hover { background: var(--seal); border-color: var(--seal); }
.lb-nav.prev { left: 20px; }
.lb-nav.next { right: 20px; }
.lb-open-hint { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); font-family: var(--sans); font-size: 11.5px; color: rgba(238,226,200,.45); letter-spacing: .2em; }

/* ---------------- 翻页器 ---------------- */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.pager-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.pager-link:hover { border-color: var(--seal); color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.pager-link.next { text-align: right; }
.pager-dir { font-family: var(--sans); font-size: 11.5px; letter-spacing: .18em; color: var(--ink-3); }
.pager-link:hover .pager-dir { color: var(--seal); }
.pager-name { font-weight: 700; font-size: 15.5px; letter-spacing: .04em; }
.pager-name.faint { color: var(--ink-4); }

/* ---------------- 侧栏档案 ---------------- */

.sidebar { position: relative; }
.sidebar-inner {
  position: sticky;
  top: calc(var(--mast-h) + 84px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.arch-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  position: relative;
}
.arch-card::before, .arch-card::after {
  content: "";
  position: absolute;
  width: 9px; height: 9px;
  border-color: var(--line-strong);
  border-style: solid;
}
.arch-card::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; border-radius: var(--radius) 0 0 0; }
.arch-card::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; border-radius: 0 0 var(--radius) 0; }
.arch-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .3em;
  color: var(--seal);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.facts { display: flex; flex-direction: column; gap: 7px; }
.fact { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.fact-k { font-family: var(--sans); font-size: 12px; color: var(--ink-3); flex: none; }
.fact-v { color: var(--ink-2); text-align: right; word-break: break-all; }
.arch-note { font-family: var(--sans); font-size: 12px; color: var(--ink-3); }

.formula-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.formula-card h4 {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .25em;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.formula {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--indigo);
}
.formula-meta { font-family: var(--sans); font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.formula-meta a { color: var(--indigo); }

/* ---------------- 页脚 ---------------- */

.folio-foot {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  background: var(--paper-3);
}
.folio-foot-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px 24px 34px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
}
.folio-foot p { font-family: var(--sans); font-size: 12px; color: var(--ink-3); max-width: 640px; }
.folio-foot-mark {
  font-family: var(--folio);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-3);
  letter-spacing: .14em;
}

/* ---------------- 回顶 ---------------- */

.to-top {
  position: fixed;
  right: 22px;
  bottom: 24px;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--paper-2);
  color: var(--seal);
  font-size: 18px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .25s, transform .25s, background .2s, border-color .2s;
  z-index: 120;
  box-shadow: var(--shadow);
}
.to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.to-top:hover { background: var(--seal); color: #f7efe2; border-color: var(--seal); }

/* ============================================================
   首页
   ============================================================ */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--seal-soft) 60%, transparent), transparent 60%),
    radial-gradient(900px 420px at -10% 110%, color-mix(in srgb, var(--indigo-soft) 55%, transparent), transparent 55%),
    var(--paper-2);
}
.hero::before {
  content: "典";
  position: absolute;
  right: -30px;
  top: 8px;
  font-size: clamp(240px, 34vw, 460px);
  font-weight: 900;
  line-height: 1;
  color: var(--paper-3);
  user-select: none;
  pointer-events: none;
}
[data-theme="ink"] .hero::before { color: var(--paper-4); opacity: .5; }
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 74px 24px 60px;
}
.hero-kicker {
  font-family: var(--sans);
  font-size: 12.5px;
  letter-spacing: .42em;
  color: var(--seal);
  animation: rise .55s ease both;
}
.hero h1 {
  margin-top: 14px;
  font-size: clamp(44px, 7vw, 78px);
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1.08;
  color: var(--ink);
  animation: rise .55s .08s ease both;
}
.hero h1 em {
  font-family: var(--folio);
  font-style: italic;
  font-weight: 500;
  color: var(--seal);
  letter-spacing: .05em;
  padding-right: .08em;
}
.hero-sub {
  margin-top: 16px;
  font-size: 16px;
  color: var(--ink-2);
  letter-spacing: .12em;
  animation: rise .55s .16s ease both;
}
.hero-search {
  position: relative;
  max-width: 620px;
  margin-top: 30px;
  animation: rise .55s .24s ease both;
}
.hero-search input { font-size: 16px; padding: 13px 20px; border-radius: 12px; }
.hero-search .search-drop { top: calc(100% - 2px); left: 0; right: 0; }
.hero-stats {
  margin-top: 44px;
  display: flex;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-2);
  box-shadow: var(--shadow);
  max-width: 760px;
  overflow: hidden;
  animation: rise .55s .32s ease both;
}
.hero-stats div {
  flex: 1;
  padding: 16px 8px;
  text-align: center;
  border-left: 1px solid var(--line);
}
.hero-stats div:first-child { border-left: none; }
.hero-stats b {
  display: block;
  font-family: var(--folio);
  font-size: 30px;
  font-weight: 500;
  color: var(--seal);
  line-height: 1.1;
}
.hero-stats span { font-family: var(--sans); font-size: 11.5px; color: var(--ink-3); letter-spacing: .14em; }

.band {
  max-width: 1240px;
  margin: 0 auto;
  padding: 56px 24px 8px;
}
.band-title {
  display: flex;
  align-items: baseline;
  gap: 16px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--ink);
  margin-bottom: 22px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--seal);
  width: fit-content;
}
.band-title-en {
  font-family: var(--folio);
  font-style: italic;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: .3em;
  color: var(--ink-4);
}

.parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.part-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 22px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.part-card:hover { transform: translateY(-4px); border-color: var(--seal); color: var(--ink); box-shadow: var(--shadow-lift); }
.part-card-seal {
  flex: none;
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--seal);
  color: var(--seal);
  font-weight: 700;
  font-size: 20px;
  border-radius: 8px;
  transform: rotate(-4deg);
  background: color-mix(in srgb, var(--seal-soft) 30%, transparent);
}
.part-card:hover .part-card-seal { background: var(--seal); color: #f7efe2; }
.part-card h3 { font-size: 16.5px; font-weight: 700; letter-spacing: .06em; }
.part-card p { font-family: var(--sans); font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.part-card-ex { margin-top: 10px; }
.sample-link { font-size: 12.5px; color: var(--indigo); }
.sample-link:hover { color: var(--seal); }

.feats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.feat {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  box-shadow: var(--shadow);
  transition: transform .22s ease, border-color .22s;
}
.feat:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--seal) 50%, var(--line)); }
.feat-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  margin-bottom: 10px;
  background: var(--paper-3);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--seal);
  font-weight: 700;
  font-size: 15px;
}
.feat h4 { font-size: 15px; font-weight: 700; letter-spacing: .1em; margin-bottom: 6px; }
.feat p { font-family: var(--sans); font-size: 12.5px; color: var(--ink-3); line-height: 1.8; }

.feat-entries {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}
.feat-entry {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform .22s ease, border-color .22s, box-shadow .22s;
}
.feat-entry:hover { transform: translateY(-4px); border-color: var(--seal); color: var(--ink); box-shadow: var(--shadow-lift); }
.feat-entry-tag {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--seal);
}
.feat-entry h3 { font-size: 20px; font-weight: 700; letter-spacing: .08em; }
.feat-entry p { font-family: var(--sans); font-size: 12.5px; color: var(--ink-3); line-height: 1.8; }
.feat-entry-meta {
  margin-top: auto;
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--ink-3);
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}

/* ---------------- 动效 ---------------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 1120px) {
  .layout { grid-template-columns: minmax(0, 1fr) 248px; }
  .tocrail { display: none; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .search-strip { padding-top: 10px; }
  .mast-nav a:not(:first-child) { display: none; }
  .crumb { padding-top: 12px; }
  .folio { font-size: 40px; }
  .sec-body { padding: 14px 16px 18px; }
  .masthead { padding: 20px 20px 18px; }
  .hero-inner { padding: 48px 20px 40px; }
  .hero h1 { font-size: 40px; }
  .band { padding: 40px 20px 4px; }
  .hero-stats b { font-size: 24px; }
}

/* ---------------- 打印 ---------------- */

@media print {
  .mast, .search-strip, .tocrail, .sidebar, .to-top, .pager, .lightbox { display: none !important; }
  body { background: #fff; }
  .layout { display: block; }
  .sec-card, .masthead { box-shadow: none; border-color: #999; break-inside: avoid; }
  .sec-card { border: 1px solid #ccc; margin-bottom: 12px; }
  a { color: #000; }
}

/* ============ 药典 v2 全站: 索引/分组/互链 ============ */
.page-shell { max-width: 1240px; margin: 0 auto; padding: 28px 24px 64px; }
.page-title { font-size: 28px; font-weight: 700; letter-spacing: .08em; margin: 6px 0 2px; }
.page-sub { font-family: var(--sans); font-size: 12.5px; color: var(--ink-3); margin-bottom: 14px; }
/* 分组页/部页导航块: 等宽网格, 每块同尺寸, 整齐划一 */
.tabs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 8px; margin: 16px 0 22px; }
.tabs a { font-family: var(--sans); font-size: 12.5px; padding: 7px 10px; text-align: center;
          border: 1px solid var(--line); border-radius: 6px; color: var(--ink-2);
          white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: all .2s ease; }
.tabs a:hover { border-color: var(--seal); color: var(--seal); transform: translateY(-1px); }
/* 列表: 统一卡片网格(每块同宽, 名称单行截断, meta 固定行) */
.v2-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
           gap: 10px; border-top: 0; }
.v2-item { display: flex; flex-direction: column; gap: 5px; padding: 12px 14px;
           border: 1px solid var(--line); border-radius: 8px; color: var(--ink);
           transition: all .15s ease; }
.v2-item:hover { background: var(--paper-2); border-color: var(--seal); }
.v2-item-name { font-weight: 700; letter-spacing: .03em; white-space: nowrap;
                overflow: hidden; text-overflow: ellipsis; }
.v2-item:hover .v2-item-name { color: var(--seal); }
.v2-item-meta { font-family: var(--sans); font-size: 12px; color: var(--ink-3);
                white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 部页: 一部/二部/四部一行三个品名; 三部名称长, 一行两个 */
.v2-list.cols-3 { grid-template-columns: repeat(3, 1fr); }
.v2-list.cols-2 { grid-template-columns: repeat(2, 1fr); }
.idx-card { flex: 1 1 200px; }
.inst-chip { display: inline-block; font-family: var(--sans); font-size: 12px; padding: 3px 10px;
             border: 1px solid var(--line); border-radius: 999px; margin: 2px 4px 2px 0;
             color: var(--ink-2); transition: all .15s ease; }
a.inst-chip:hover { border-color: var(--seal); color: var(--seal); }
.inst-plain { border-style: dashed; color: var(--ink-3); }
.part-card.idx-card h3 { font-size: 15px; }
/* 首页频道说明(页面下方简单文字) */
.site-note { max-width: 860px; }
.site-note p { font-family: var(--sans); font-size: 13.5px; line-height: 1.9;
               color: var(--ink-2); margin: 0 0 10px; }
/* 仪器页空状态(提及集中在未收录文本区) */
.v2-empty { font-family: var(--sans); font-size: 13.5px; line-height: 1.9;
            color: var(--ink-3); border: 1px dashed var(--line); border-radius: 8px;
            padding: 16px 18px; max-width: 860px; }
/* 附块轻量 MD 渲染: 行首 [节名] 加粗标签 */
.attach-sec { font-weight: 700; color: var(--ink); margin-right: 4px; }
