/* 谱局实验室 · 版式与组件。8px 网格，圆角 0–2px，不用转圈加载（研墨）。 */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 13px; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
body::before {          /* 纸纹 */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='7'/><feColorMatrix values='0 0 0 0 0.55  0 0 0 0 0.49  0 0 0 0 0.40  0 0 0 0.10 0'/></filter><rect width='240' height='240' filter='url(%23n)'/></svg>");
}
a { color: var(--zhu-deep); text-underline-offset: 3px; }
a:hover { color: var(--zhu); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--zhu); outline-offset: 2px; }
.wrap { position: relative; z-index: 1; max-width: 1440px; margin: 0 auto; padding: 28px 40px 56px; display: flex; flex-direction: column; gap: 24px; }
@media (max-width: 720px) { .wrap { padding: 16px 16px 40px; gap: 20px; } }
#view { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.serif { font-family: var(--serif); }
.mono { font-family: var(--mono); }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── 页头 ── */
.hdr { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; border-bottom: 1px solid var(--rule); padding-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.brand:hover { color: inherit; }
.seal-tui { width: 30px; height: 30px; background: var(--zhu); color: var(--paper); display: grid; place-items: center; font-family: var(--serif); font-weight: 900; font-size: 17px; transform: rotate(-3deg); border-radius: 1px; flex: none; }
.brand-t { display: flex; flex-direction: column; }
.brand-t b { font-family: var(--serif); font-weight: 900; font-size: 26px; letter-spacing: 6px; line-height: 1.2; }
.brand-t span { color: var(--ink-3); font-size: 12px; letter-spacing: 1px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 20px; flex: 1 1 420px; align-items: center; }
.nav a { color: var(--ink-3); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--zhu); font-weight: 500; }
.nav details { position: relative; }
.nav summary { list-style: none; cursor: pointer; color: var(--ink-3); padding: 6px 0; }
.nav summary::-webkit-details-marker { display: none; }
.nav summary::after { content: " ▾"; font-size: 10px; }
.nav details[open] summary { color: var(--ink); }
.nav .menu { position: absolute; z-index: 20; top: 100%; left: -12px; min-width: 200px; background: var(--page); border: 1px solid var(--rule-2); border-radius: 2px; padding: 8px 0; display: flex; flex-direction: column; box-shadow: 0 6px 24px rgba(0,0,0,.08); }
.nav .menu a { padding: 6px 16px; border: 0; display: flex; gap: 10px; }
.nav .menu a .k { font-family: var(--mono); font-size: 11px; color: var(--ink-4); min-width: 22px; }
.nav .menu a[aria-current="page"] { color: var(--zhu-deep); }
.tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hdr > .d-langslot { flex: none; width: 0; margin-right: -32px; display: flex; justify-content: flex-end; align-items: center; }   /* 电脑宽度：语言印在分段钮左边同一行（用户 10-25；原挂天头，摞在分段钮上方）。插槽零宽，印往左伸进导航右边的空白，导航与分段钮不挪、不折行；组件 full 选项＝印带 28、外文页写完整眉批 */
.hdr > .d-langslot > .pj-lang { margin-right: 16px; }
@media (max-width: 720px) { .hdr > .d-langslot { display: none; } }
.seg { display: inline-flex; border: 1px solid var(--ink-5); border-radius: 2px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 7px 14px; cursor: pointer; color: var(--ink-2); min-height: 34px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.seg.sm button { padding: 4px 10px; min-height: 28px; font-size: 12px; }

/* ── 标题区 ── */
.titlebar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 40px; }
.titlebar .t { display: flex; flex-direction: column; gap: 6px; max-width: 820px; }
.display { margin: 0; font-family: var(--serif); font-weight: 900; font-size: 64px; line-height: 1.05; letter-spacing: 2px; }
.display-2 { margin: 0; font-family: var(--serif); font-weight: 900; font-size: 48px; line-height: 1.1; letter-spacing: 2px; }
.reign { font-family: var(--serif); font-size: 18px; color: var(--ink-2); }
.lede { margin: 0; font-family: var(--serif); font-size: 17px; line-height: 1.9; color: var(--ink-2); text-wrap: pretty; }
@media (max-width: 720px) { .display { font-size: 44px; } .display-2 { font-size: 36px; } .lede { font-size: 15.5px; } }
.eyebrow { font-size: 12px; color: var(--ink-3); letter-spacing: 1px; }
h2.h { margin: 0; font-family: var(--serif); font-weight: 900; font-size: 18px; }
h3.h { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 15px; }

/* ── 印章与图例 ── */
.legend { display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.legend > div { display: flex; align-items: center; gap: 10px; }
.stamp { width: 17px; height: 17px; border: 1px solid var(--zhu); color: var(--zhu); display: inline-grid; place-items: center; font-family: var(--serif); font-size: 10.5px; font-weight: 600; transform: rotate(-2deg); border-radius: 1px; flex: none; line-height: 1; }
.stamp.ni { border-style: dashed; }
.stamp.bu { border-color: var(--ink-3); color: var(--ink-3); }
.line-zheng { width: 34px; height: 0; border-top: 2.5px solid var(--ink-2); display: inline-block; }
.line-ni { width: 34px; height: 0; border-top: 2px dashed var(--zhu); display: inline-block; }
.band-swatch { width: 34px; height: 10px; background: var(--band); display: inline-block; }
.seal-big { display: inline-grid; place-items: center; font-family: var(--serif); font-weight: 900; flex: none; }
.seal-kanhe { --r: -6deg; width: 60px; height: 60px; border-radius: 50%; background: var(--zhu); color: var(--paper); font-size: 19px; transform: rotate(var(--r)); box-shadow: inset 0 0 0 3px var(--zhu), inset 0 0 0 4.5px var(--paper); }
.seal-cunyi { --r: -4deg; width: 60px; height: 58px; border: 2.5px solid var(--zhu); color: var(--zhu); font-size: 18px; transform: rotate(var(--r)); border-radius: 1px; }
.seal-bo { --r: 3deg; width: 60px; height: 58px; border: 2.5px solid var(--ink); color: var(--ink); font-size: 22px; transform: rotate(var(--r)); border-radius: 1px; box-shadow: 3px 3px 0 var(--rule-2); }
.badge { font-size: 11.5px; padding: 1px 6px; border: 1px solid currentColor; border-radius: 2px; white-space: nowrap; }
.badge.ok { color: var(--ok); }
.badge.zhu { color: var(--zhu); }
.badge.ink { color: var(--ink-3); }

/* ── 卡片与面板 ── */
.panel { background: var(--page); border: 1px solid var(--rule); border-radius: 2px; }
.pad { padding: 16px 20px; }
.ni-box { border: 1px dashed var(--zhu); border-radius: 2px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--zhu-wash); }
.ni-box .eyebrow { color: var(--zhu-deep); }
.cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.col-l { flex: 0 1 270px; min-width: 240px; display: flex; flex-direction: column; gap: 14px; }
.col-m { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.col-r { flex: 1 1 290px; min-width: 260px; display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 720px) { .col-l, .col-r { min-width: 100%; } .col-m { order: -1; } }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; align-items: baseline; }
.kv .k { color: var(--ink-2); }
.kv .v { font-family: var(--mono); font-size: 12px; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.kv .v b { color: var(--ink); font-weight: 500; }
.note { margin: 0; font-size: 12px; color: var(--ink-3); line-height: 1.75; }
.big-num { font-family: var(--serif); font-weight: 900; font-size: 40px; line-height: 1.1; }

/* ── 条件开关 ── */
.conds { display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.cond { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.cond .n { font-family: var(--serif); font-size: 15px; font-weight: 600; display: flex; align-items: baseline; gap: 8px; }
.cond .n .coef { font-family: var(--mono); font-size: 10.5px; font-weight: 400; color: var(--ink-4); }
.cond .s { font-family: var(--mono); font-size: 11px; color: var(--ink-3); grid-column: 1 / -1; }
.cond.off .n, .cond.off .s { color: var(--ink-4); }
.switch { width: 44px; height: 24px; border-radius: 12px; border: 1px solid var(--ink); background: var(--ink); position: relative; cursor: pointer; padding: 0; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 23px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); transition: left .15s; }
.switch[aria-pressed="false"] { background: var(--rule); border-color: var(--ink-5); }
.switch[aria-pressed="false"]::after { left: 3px; background: var(--page); box-shadow: 0 0 0 1px var(--ink-5); }

/* ── 按钮 ── */
.btn { min-height: 36px; padding: 6px 14px; border-radius: 2px; cursor: pointer; font-size: 13px; border: 1px solid var(--ink-5); background: transparent; color: var(--ink-2); }
.btn:hover { border-color: var(--ink-3); }
.btn[aria-pressed="true"] { border-color: var(--zhu); background: var(--zhu); color: var(--paper); }
.btn.primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.btn.primary:hover { background: var(--ink-2); }
.btn.sq { min-width: 44px; padding: 6px 0; font-size: 14px; background: var(--paper); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── 条形列表 ── */
.bars { display: flex; flex-direction: column; gap: 6px; }
.brow { display: grid; grid-template-columns: minmax(0, 1fr) 52px; gap: 3px 10px; align-items: center; }
.brow .l { font-family: var(--serif); font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brow .v { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.brow .track { grid-column: 1 / -1; height: 4px; background: var(--rule); border-radius: 0 2px 2px 0; position: relative; }
.brow .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink-2); border-radius: 0 2px 2px 0; }
.brow .fill.ni { background: transparent; border-top: 2px dashed var(--zhu); height: 0; top: 1px; border-radius: 0; }

/* ── 地图 ── */
.mapbox { position: relative; background: var(--page); border: 1px solid var(--rule); border-radius: 2px; padding: 12px; }
.mapbox svg.map { width: 100%; height: auto; display: block; }
.inset { position: absolute; right: 20px; bottom: 20px; width: 168px; height: auto; background: var(--paper); border: 1px solid var(--rule); border-radius: 1px; }
@media (max-width: 720px) { .inset { width: 104px; right: 14px; bottom: 14px; } }
.map-lab { font-family: var(--serif); font-weight: 600; fill: var(--ink); stroke: var(--page); paint-order: stroke; stroke-linejoin: round; }
.flow-zheng { fill: none; stroke: var(--ink-2); stroke-linecap: round; }
.flow-ni { fill: none; stroke: var(--zhu); stroke-linecap: round; }
.flow-hit { fill: none; stroke: transparent; cursor: pointer; }

/* ── 墨流图 ── */
.im-host { position: relative; }
.im-host { padding: 8px; }
.inkmap { position: relative; width: 100%; aspect-ratio: 760 / 560; background: var(--page); border: 0.75px solid var(--ink-2); box-shadow: 0 0 0 5px var(--page), 0 0 0 7.5px var(--ink-2); border-radius: 0; overflow: hidden; touch-action: none; cursor: grab; outline: none; user-select: none; -webkit-user-select: none; }   /* 文武边栏：外粗内细 */
.inkmap:focus-visible { box-shadow: 0 0 0 5px var(--page), 0 0 0 7.5px var(--zhu); }
.inkmap.grabbing { cursor: grabbing; }
.im-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.im-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; align-items: center; z-index: 2; }
.im-zoom { display: flex; border: 1px solid var(--ink-5); border-radius: 2px; overflow: hidden; background: var(--page); }
.im-btn { width: 32px; height: 30px; border: 0; border-right: 1px solid var(--rule); background: transparent; cursor: pointer; font-family: var(--serif); font-size: 14px; color: var(--ink-2); }
.im-btn:last-child { border-right: 0; }
.im-btn:hover { background: var(--zhu-wash); color: var(--ink); }
.im-layers { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; z-index: 2; max-width: calc(100% - 210px); }
.im-chip { height: 30px; padding: 0 10px; border: 1px solid var(--ink-5); border-radius: 2px; background: var(--page); color: var(--ink-4); cursor: pointer; font-size: 12px; text-decoration: line-through; text-decoration-color: var(--ink-5); }
.im-chip[aria-pressed="true"] { border-color: var(--ink-2); color: var(--ink); text-decoration: none; }
.im-chip:hover { background: var(--zhu-wash); }
.im-legend { position: absolute; left: 12px; bottom: 10px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: var(--ink-3); z-index: 2; pointer-events: none; max-width: calc(100% - 190px); }
.im-legend span { display: inline-flex; align-items: center; gap: 6px; }
.im-branch { width: 26px; height: 7px; display: inline-block; clip-path: polygon(0 0, 100% 40%, 100% 60%, 0 100%); }
.im-branch.zheng { background: var(--ink-2); }
.im-branch.ni { background: var(--zhu); }
.im-branch.old { background: #D6CBB6; }
:root[data-theme="dark"] .im-branch.old { background: #3D352C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .im-branch.old { background: #3D352C; } }
.im-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.im-dot.zheng { background: var(--ink); }
.im-dot.ni { background: var(--zhu); }
.im-seal { width: 13px; height: 13px; background: var(--ink); color: var(--page); font-style: normal; font-family: var(--serif); font-size: 9.5px; line-height: 1; display: inline-grid; place-items: center; transform: rotate(-4deg); }
.im-hint { color: var(--ink-4); }
.im-tip { position: absolute; display: none; z-index: 3; pointer-events: none; background: var(--ink); color: var(--on-ink); padding: 8px 10px; border-radius: 2px; font-size: 12px; line-height: 1.6; max-width: 280px; box-shadow: 0 4px 16px rgba(0,0,0,.18); }
.im-tip b { font-family: var(--serif); font-size: 13px; display: block; margin-bottom: 2px; }
.im-tip-h { opacity: .7; margin-top: 4px; font-size: 11px; }
@media (max-width: 720px) { .im-legend .im-hint { display: none; } .im-legend { max-width: calc(100% - 130px); } .im-layers { max-width: calc(100% - 120px); } .im-tools .im-chip { display: none; } }

/* ── 手卷时间轴 ── */
.scroll-tl { background: var(--page); border: 1px solid var(--rule); border-radius: 2px; padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.scroll-tl .ctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.scroll-tl .ctl label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); }
input[type="range"] { accent-color: var(--zhu); }
.tl-bar { cursor: pointer; }

/* ── 研墨（进度，不转圈）── */
.yanmo { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); }
.yanmo .stroke { width: 64px; height: 6px; background: var(--rule); border-radius: 0 3px 3px 0; position: relative; overflow: hidden; }
.yanmo .stroke i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink-2); border-radius: 0 3px 3px 0; transition: width .2s; }

/* ── 表格 ── */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; color: var(--ink-2); padding: 10px 10px; border-bottom: 1px solid var(--ink-5); font-size: 13px; }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--rule); color: var(--ink-2); }
.tbl td.n, .tbl th.n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.tbl th.ni { color: var(--zhu-deep); }
.tbl td.best { color: var(--ink); font-weight: 600; }
.tbl-wrap { overflow-x: auto; }

/* ── 提示框 ── */
.tip { position: fixed; z-index: 50; pointer-events: none; display: none; background: var(--ink); color: var(--on-ink); padding: 8px 10px; border-radius: 2px; font-size: 12px; max-width: 280px; line-height: 1.55; box-shadow: 0 4px 16px rgba(0,0,0,.18); }
.tip .v { font-family: var(--mono); font-size: 12.5px; }

/* ── 竖排证据卷 ── */
.vscroll { background: var(--page); border: 1px solid var(--rule); border-radius: 1px; padding: 24px 20px; display: flex; justify-content: center; }
.vtext { writing-mode: vertical-rl; font-family: var(--serif); font-size: 19px; line-height: 2.05; letter-spacing: 3px; max-height: 440px; color: var(--ink); overflow-x: auto; max-width: 100%; }
.an { padding-right: 3px; }
.an-person { color: var(--an-person); border-right: 2px solid var(--an-person); }
.an-place { color: var(--an-place); border-right: 2px solid var(--an-place); }
.an-time { color: var(--an-time); border-right: 2px solid var(--an-time); }
.an-cause { color: var(--an-cause); border-right: 2px dotted var(--an-cause); }

/* ── 时间线（宗族推演卷）── */
.tline { display: flex; flex-direction: column; }
.tnode { display: grid; grid-template-columns: 100px 28px minmax(0, 1fr); gap: 0 16px; }
.tnode .when { text-align: right; padding: 14px 0; }
.tnode .when b { font-family: var(--serif); font-weight: 900; font-size: 18px; display: block; line-height: 1.3; }
.tnode .when span { font-size: 11.5px; color: var(--ink-3); }
.tnode .spine { position: relative; }
.tnode .spine::before { content: ""; position: absolute; left: 13px; top: 0; bottom: 0; border-left: 2px solid var(--ink-2); }
.tnode.ni .spine::before { border-left: 2px dashed var(--zhu); }
.tnode .spine i { position: absolute; left: 6px; top: 20px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); border: 2px solid var(--page); }
.tnode.ni .spine i { background: var(--page); border: 2px dashed var(--zhu); }
.tnode .body { padding: 14px 0; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 4px; }
.tnode .body .ttl { font-family: var(--serif); font-weight: 600; font-size: 15.5px; }
.tnode .body .tag { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.tnode.ni .body .tag { color: var(--zhu-deep); }
@media (max-width: 720px) { .tnode { grid-template-columns: 72px 24px minmax(0, 1fr); gap: 0 10px; } .tnode .when b { font-size: 15px; } }

/* ── 搜索 ── */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.field input, .field select { min-height: 40px; padding: 6px 12px; border: 1px solid var(--ink-5); background: var(--page); border-radius: 2px; color: var(--ink); }
.field input:focus, .field select:focus { border-color: var(--ink-3); outline: none; }
.list { display: flex; flex-direction: column; border-top: 1px solid var(--rule); max-height: 420px; overflow-y: auto; }
.list button { display: flex; justify-content: space-between; gap: 12px; text-align: left; border: 0; border-bottom: 1px solid var(--rule); background: transparent; padding: 9px 4px; cursor: pointer; }
.list button:hover, .list button[aria-current="true"] { background: var(--zhu-wash); }
.list button .t { font-family: var(--serif); font-size: 14px; }
.list button .m { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }

/* ── 杂项 ── */
.err { border: 1px solid var(--zhu); padding: 16px 20px; color: var(--zhu-deep); background: var(--zhu-wash); border-radius: 2px; }
.hr { border: 0; border-top: 1px solid var(--rule); margin: 8px 0; }
.foot { font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--rule); padding-top: 16px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
svg text { font-family: var(--sans); }
svg .t-serif { font-family: var(--serif); }
svg .t-mono { font-family: var(--mono); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ── 动效（js/anim.js）：进入视口时生长 / 画出 / 浮现 / 盖印；系统设置"减少动态效果"时不动 ── */
:root { --ease: cubic-bezier(.2, .7, .2, 1); }
@media (prefers-reduced-motion: no-preference) {
  .va [data-a], .va[data-a] {
    transition: opacity var(--dur, .55s) var(--ease) var(--d, 0ms), transform var(--dur, .8s) var(--ease) var(--d, 0ms),
      clip-path var(--dur, 1.1s) var(--ease) var(--d, 0ms), width .55s var(--ease), height .55s var(--ease);
  }
  [data-a="grow"] { transform-box: fill-box; transform-origin: 50% 100%; }
  [data-a="growx"] { transform-box: fill-box; transform-origin: 0 50%; }
  [data-a="pop"] { transform-box: fill-box; transform-origin: 50% 50%; }
  .va:not(.in) [data-a="grow"], .va:not(.in)[data-a="grow"] { transform: scaleY(0); }
  .va:not(.in) [data-a="growx"], .va:not(.in)[data-a="growx"] { transform: scaleX(0); }
  .va:not(.in) [data-a="pop"], .va:not(.in)[data-a="pop"] { transform: scale(0); opacity: 0; }
  .va:not(.in) [data-a="fade"], .va:not(.in)[data-a="fade"] { opacity: 0; }
  .va:not(.in) [data-a="rise"], .va:not(.in)[data-a="rise"] { opacity: 0; transform: translateY(10px); }
  .va:not(.in) [data-a="wipe"], .va:not(.in)[data-a="wipe"] { clip-path: inset(-20px 100% -20px -20px); }
  .va.in [data-a="wipe"], .va.in[data-a="wipe"] { clip-path: inset(-20px -20px -20px -20px); }
  .va:not(.in) .seal-big { opacity: 0; }
  .va:not(.in) [data-a="draw"], .va:not(.in) [data-count] { opacity: 0; }
  .va [data-count] { transition: opacity .3s; }
  .va.in .seal-big { animation: stamp .6s cubic-bezier(.3, 1.35, .5, 1) var(--d, 120ms) both; }
  .brow .fill { transition: width .55s var(--ease), transform .8s var(--ease) var(--d, 0ms); }
  #view > .enter { animation: rise .6s var(--ease) var(--d, 0ms) both; }
  .tl-head { transition: transform .45s var(--ease); }
  .tl-bar { transition: fill .3s; }
}
@keyframes stamp {
  0% { opacity: 0; transform: scale(1.9) rotate(var(--r, 0deg)); }
  55% { opacity: 1; transform: scale(.92) rotate(var(--r, 0deg)); }
  100% { opacity: 1; transform: scale(1) rotate(var(--r, 0deg)); }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ── 方法与数据 · 封存页：文稿只露轮廓，斜贴封条，盖朱印"封"；下方预览、数字带、致谢 ── */
.gate { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 500px); gap: 36px 72px; align-items: center; padding: 8px 0 12px; }
.gate-l { display: flex; flex-direction: column; gap: 16px; max-width: 580px; }
.gate-l .display-2 { letter-spacing: 3px; }
.gate-l .display-2 .nb { display: inline-block; }
.gate-meta { display: flex; flex-direction: column; gap: 7px; padding: 12px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); font-size: 13px; }
.gate-meta div { display: flex; gap: 18px; align-items: baseline; }
.gate-meta span { color: var(--ink-4); letter-spacing: 3px; flex: none; }
.gate-meta b { font-weight: 500; color: var(--ink-2); }
.gate-btn { text-decoration: none; display: inline-flex; align-items: center; }
.gate-r { padding: 14px 18px 22px 12px; }
.doc-stack { position: relative; }
.doc-stack::before, .doc-stack::after { content: ""; position: absolute; inset: 0; background: var(--page); border: 1px solid var(--rule-2); }
.doc-stack::before { transform: rotate(-2.4deg) translate(-8px, 9px); }
.doc-stack::after { transform: rotate(1.3deg) translate(7px, 5px); box-shadow: 0 16px 34px -22px rgba(31, 27, 22, .45); }
.doc { position: relative; z-index: 1; overflow: hidden; background: var(--page); border: 1px solid var(--rule-2); padding: 24px 28px 30px; min-height: 440px; display: flex; flex-direction: column; gap: 14px; }
.doc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 8px; border-bottom: 3px double var(--rule-2); }
.doc-head b { font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--ink-2); letter-spacing: 1px; }
.doc-head span { font-size: 11px; color: var(--ink-4); letter-spacing: 2px; white-space: nowrap; }
.doc-body { display: flex; flex-direction: column; gap: 8px; }
.doc-h { font-family: var(--serif); font-size: 13px; font-weight: 600; color: var(--ink-3); margin-top: 6px; letter-spacing: 1px; }
.doc-f { font-family: var(--serif); font-style: italic; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; filter: blur(3.2px); opacity: .7; user-select: none; padding: 2px 0 2px 18px; }
.doc-bar { display: block; height: 7px; border-radius: 4px; background: linear-gradient(90deg, var(--ink-5), color-mix(in srgb, var(--ink-5) 55%, transparent)); filter: blur(1.4px); opacity: .6; }
.doc-table { display: flex; flex-direction: column; gap: 6px; padding: 6px 0; border-block: 1px solid var(--rule); }
.doc-table div { display: grid; grid-template-columns: 1fr 52px 52px 52px; gap: 14px; align-items: center; }
.doc-table i { display: block; height: 6px; border-radius: 3px; background: var(--ink-5); opacity: .5; filter: blur(1.3px); }
.doc-table i:not(:first-child) { justify-self: end; width: 70%; }
.seal-strip { position: absolute; z-index: 2; left: -16%; right: -16%; top: 47%; transform: rotate(-13deg); display: flex; justify-content: center; align-items: center; gap: 16px; padding: 10px 0;
  background: color-mix(in srgb, var(--page) 90%, var(--zhu)); border-block: 1.5px solid var(--zhu); box-shadow: 0 0 0 4px color-mix(in srgb, var(--page) 90%, var(--zhu)), 0 0 0 5px color-mix(in srgb, var(--zhu) 45%, transparent), 0 10px 22px -12px rgba(31, 27, 22, .5);
  color: var(--zhu); font-family: var(--serif); font-size: 15px; font-weight: 700; letter-spacing: 7px; white-space: nowrap; }
.seal-strip i { font-style: normal; font-size: 8px; letter-spacing: 0; opacity: .7; }
.seal-feng { --r: -9deg; position: absolute; z-index: 3; right: 30px; bottom: 34px; width: 78px; height: 78px; border-radius: 3px; background: var(--zhu); color: var(--paper); font-size: 40px; transform: rotate(var(--r));
  box-shadow: inset 0 0 0 3px var(--zhu), inset 0 0 0 5px color-mix(in srgb, var(--paper) 85%, transparent); opacity: .93; }
.pv { display: flex; flex-direction: column; gap: 18px; }
.pv-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--rule); padding-top: 22px; }
.pv-head .h { font-size: 22px; }
.pv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 16px; }
.pv-card { background: var(--page); border: 1px solid var(--rule); border-radius: 2px; padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.pv-card .h { font-size: 17px; margin: 0; }
.pv-card p { margin: 0; font-size: 13.5px; line-height: 1.85; color: var(--ink-2); text-wrap: pretty; }
.pv-seal { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 1.5px solid var(--zhu); color: var(--zhu); font-family: var(--serif); font-size: 18px; font-weight: 700; border-radius: 1px; transform: rotate(-3deg); }
.va.in .pv-seal { transform: rotate(-3deg); }
.num-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule-2); }
.num-strip > div { display: flex; flex-direction: column; gap: 3px; padding: 16px 16px 18px; border-left: 1px solid var(--rule); min-width: 0; }
.num-strip > div:first-child { border-left: 0; padding-left: 0; }
.num-strip b { font-family: var(--serif); font-size: 28px; font-weight: 700; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.num-strip .u { font-size: 13px; color: var(--ink-2); }
.num-strip .s { font-size: 11.5px; color: var(--ink-4); line-height: 1.6; }
.credits { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--rule); padding-top: 22px; }
.credits .h { font-size: 18px; margin: 0; }
.credit-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 4px 32px; }
.credit { display: flex; flex-direction: column; gap: 3px; padding: 10px 0 12px; border-bottom: 1px dashed var(--rule-2); min-width: 0; }
.credit a, .credit b { font-family: var(--serif); font-size: 14px; font-weight: 600; color: var(--ink); text-decoration-color: var(--rule-2); text-underline-offset: 3px; overflow-wrap: anywhere; }
.credit a:hover { text-decoration-color: var(--zhu); }
.credit .c { font-size: 12px; color: var(--ink-3); line-height: 1.65; overflow-wrap: anywhere; }
.credit .m { font-size: 11.5px; color: var(--ink-4); font-family: var(--mono); overflow-wrap: anywhere; }
.gate-later { margin: 0; display: flex; gap: 10px; align-items: flex-start; justify-content: center; border-top: 1px solid var(--rule); padding-top: 20px; font-family: var(--serif); font-size: 14px; line-height: 1.85; color: var(--ink-3); text-wrap: pretty; }
.gate-later .stamp { margin-top: 5px; }
.nav-feng { font-style: normal; display: inline-grid; place-items: center; width: 14px; height: 14px; margin-left: 5px; border: 1px solid var(--zhu); color: var(--zhu); font-family: var(--serif); font-size: 9px; line-height: 1; border-radius: 1px; transform: rotate(-5deg); vertical-align: 2px; }
@media (max-width: 960px) { .gate { grid-template-columns: minmax(0, 1fr); } .gate-r { max-width: 520px; width: 100%; justify-self: center; } }
@media (max-width: 720px) {
  .doc { min-height: 380px; padding: 20px 20px 26px; }
  .doc-f { font-size: 12px; }
  .seal-strip { font-size: 13px; letter-spacing: 5px; gap: 12px; }
  .seal-feng { width: 64px; height: 64px; font-size: 32px; right: 20px; bottom: 26px; }
  .num-strip > div { padding: 14px 12px 16px; }
  .num-strip > div:nth-child(odd) { border-left: 0; padding-left: 0; }
  .num-strip b { font-size: 23px; }
}

/* ═══ 手机基础修正（≤720 宽，用本页原有的手机断点）· 2026-10-24 ═══════════════════════════════════════
   字阶参照「手机字阶 v1」（手机版研究/字号研究/数据/手机字阶v1.css）：本页是黑体界面，正文 15、导语 17 宋、说明与数据 14、编号图例 12；
   行高按「字号倍数取整像素」；可点的地方不小于 44×44（地图上的小钮看上去仍是原来的大小，点按区补到 44）；
   电脑上悬停才看到的情景说明（title）在手机上直接写在钮里。只动样式，不动 js/（外文版用的是各自的 js）。电脑宽度（>720）不受影响。 ═══ */
@media (max-width: 720px) {
  html { text-size-adjust: 100%; font-synthesis: none; }
  body { font-size: 15px; line-break: strict; }

  /* 页头：导航、分段钮、主题钮都补到 44 */
  .brand-t span { font-size: 14px; letter-spacing: .5px; }
  .nav { gap: 0 18px; }
  .nav a, .nav summary { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0; font-size: 15px; }
  .nav .menu a { min-height: 44px; align-items: center; padding: 0 16px; }
  .nav .menu a .k { font-size: 12px; }
  .nav-feng { width: 18px; height: 18px; font-size: 12px; }
  .seg button, .seg.sm button { min-width: 44px; min-height: 44px; padding: 0 14px; font-size: 15px; }

  /* 标题区与通用字号 */
  .lede { font-size: 17px; line-height: 1.8; text-wrap: wrap; }
  .gate-l .display-2 { line-height: 1.4; }                  /* 两行时行盒不叠 */
  .big-num { line-height: 1.45; }
  .eyebrow, .small { font-size: 14px; }
  .note { font-size: 14px !important; line-height: 1.6; }   /* 有几处写在行内的 13px 一并放大 */
  .note a { padding-block: 12px; }
  h3.h { font-size: 17px; }
  .legend { font-size: 14px; }
  .stamp { width: 22px; height: 22px; font-size: 14px; }
  .badge { font-size: 12px; }
  .kv { font-size: 15px; }
  .kv .v { font-size: 14px; }

  /* 条件开关：钮的点按区 52×44，画出来的开关仍是 44×24 */
  .cond { padding: 6px 0; }
  .cond .n { min-height: 44px; align-items: center; font-size: 17px; }   /* 条件名可点（看推力系数），点按区补到 44 */
  .cond .n .coef, .cond .s { font-size: 12px; }
  .cond .n .coef { color: var(--ink-3); }
  .switch { width: 52px; height: 44px; border: 0; border-radius: 0; background: transparent; }
  .switch::before { content: ""; position: absolute; left: 4px; top: 10px; width: 44px; height: 24px; box-sizing: border-box; border-radius: 12px; border: 1px solid var(--ink); background: var(--ink); }
  .switch::after { top: 14px; left: 28px; }
  .switch[aria-pressed="false"] { border-color: transparent; background: transparent; }
  .switch[aria-pressed="false"]::before { border-color: var(--ink-5); background: var(--rule); }
  .switch[aria-pressed="false"]::after { left: 8px; }

  /* 按钮；情景钮的说明（电脑上是悬停提示）直接写在钮里 */
  .btn { min-height: 44px; font-size: 15px; }
  .btn.sq { min-width: 44px; }
  .chips .btn[title]:not([title=""])::after { content: attr(title); display: block; margin-top: 1px; font-size: 12px; line-height: 1.4; opacity: .8; }

  /* 条形列表：名字写全（电脑上截断、悬停看全名） */
  .brow { grid-template-columns: minmax(0, 1fr) auto; }
  .brow .l { font-size: 17px; white-space: normal; }
  .brow .v { font-size: 14px; }
  #view .va > span[title]:first-child { white-space: normal !important; overflow: visible !important; }   /* 模型名、府名写全，不截断 */
  #view details > summary { padding-block: 10px; }

  /* 墨流图上的控件：点按区 44，看上去仍是原来的小钮 */
  .im-layers { flex-wrap: nowrap; gap: 0 6px; max-width: calc(100% - 152px); overflow-x: auto; overscroll-behavior-x: contain; touch-action: pan-x; scrollbar-width: none; }   /* 图层钮排成一行、可横滑：只占画幅顶上一条，编者注卡（离顶 ≥60）不被压 */
  .im-layers::-webkit-scrollbar { display: none; }
  .im-chip { flex: none; position: relative; height: 44px; border-color: transparent; background: transparent; font-size: 14px; white-space: nowrap; }
  .im-chip::before { content: ""; position: absolute; inset: 7px 0; z-index: -1; border: 1px solid var(--ink-5); border-radius: 2px; background: var(--page); }
  .im-chip[aria-pressed="true"]::before { border-color: var(--ink-2); }
  .im-chip[aria-pressed="false"] { color: var(--ink-3); }
  .im-chip:hover { background: transparent; }
  .im-zoom { border: 0; background: transparent; overflow: visible; }
  .im-btn { position: relative; width: 44px; height: 44px; border-right: 0; background: transparent; font-size: 15px; }
  .im-btn::before { content: ""; position: absolute; inset: 7px 6px; z-index: -1; border: 1px solid var(--ink-5); border-radius: 2px; background: var(--page); }
  .im-btn:hover { background: transparent; }
  .inkmap { aspect-ratio: 4 / 5; }                          /* 手机上图竖长一些：顶上一行钮、底下图例之间留出看图的地方 */
  .im-legend { padding: 2px 6px; font-size: 12px; background: color-mix(in srgb, var(--page) 82%, transparent); }
  .im-seal { width: 16px; height: 16px; font-size: 12px; }
  .im-tip { font-size: 14px; }
  .im-tip b { font-size: 15px; }
  .im-tip-h { font-size: 12px; }

  /* 手卷时间轴：「选择十年」滑杆整行、点按区 44 */
  .scroll-tl { padding: 14px; }
  .scroll-tl .ctl label { flex: 1 1 100%; font-size: 14px; }
  .scroll-tl .ctl label input[type="range"] { flex: 1 1 auto; width: auto !important; min-width: 0; }
  .scroll-tl svg { min-height: 48px; }                      /* 手卷整条可点、可拖：高度补到 48 */
  input[type="range"] { height: 44px; }
  .yanmo { font-size: 14px; }

  /* 表格：数字 14；只在悬停提示里的说明直接写在格里 */
  .tbl, .tbl th, .tbl td.n, .tbl th.n { font-size: 14px; }
  .tbl td.n[title]:not([title=""])::after { content: attr(title); display: block; font-family: var(--sans); font-size: 12px; line-height: 1.4; color: var(--ink-3); white-space: normal; text-align: left; }
  .tip, .tip .v { font-size: 14px; }

  /* 宗族推演卷、选谱 */
  .tnode .when span { font-size: 14px; }
  .tnode .body .ttl { font-size: 17px; }
  .tnode .body .tag { font-size: 12px; }
  .field { font-size: 14px; }
  .field input, .field select, #view input[type="text"], #view input[type="search"] { min-height: 44px; font-size: 16px; }   /* 小于 16 iOS 会自动放大页面 */
  .field select { -webkit-appearance: none; appearance: none; padding-right: 30px;   /* WebKit 的原生下拉框不认高度：去掉原生外观、自画小折角 */
    background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
    background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
  .list button { min-height: 44px; align-items: center; }
  .list button .t { font-size: 17px; }
  .list button .m { font-size: 14px; }
  .foot { font-size: 12px; }

  /* 方法与数据 · 封存页 */
  .doc-h { font-size: 14px; }
  .doc-head span, .seal-strip i, .num-strip .s, .credit .m { font-size: 12px; }
  .doc-head span, .gate-meta span, .num-strip .s, .credit .m { color: var(--ink-3); }   /* 12px 的数据注记用墨三（墨四只给大字） */
  .gate-meta { font-size: 15px; }
  .pv-card p { font-size: 15px; text-wrap: wrap; }
  .gate-later { font-size: 17px; text-wrap: wrap; }
  .num-strip .u, .credit .c { font-size: 14px; }
  .num-strip { grid-template-columns: repeat(auto-fit, minmax(min(100%, 11em), 1fr)); }   /* 列宽跟字号走：字放大后数字写不下两列就折成一列，不压到旁边 */
  .num-strip b { line-height: 1.45; }
  .credit a, .credit b { font-size: 17px; }
  .credit a { display: flex; align-items: center; min-height: 44px; }

  /* 行高按「字号倍数取整像素」（WebKit 会把小数行高截成整数；取整后两种内核一致，放大时跟着变）；不支持 round() 的内核用上面的倍数 */
  @supports (line-height: round(nearest, 1em, 1px)) {
    .lede { line-height: round(nearest, calc(1.8 * 1em), 1px); }
    .note, .im-tip { line-height: round(nearest, calc(1.6 * 1em), 1px); }
  }
}
