/* ============================================================
   TongOrigin LIMS · 原型组件样式（第二部分）
   表格 / 标签 / 抽屉模态 / 时间线 / 板位图 / 库位图 / 图表 / 说明标注
   ------------------------------------------------------------
   登记（本文件新增，页面作者可直接使用；旧类语义不变）
   表格：.tablewrap .tbl--sortable .tbl--fixed .tbl--select .tbl--pin .tbl--skeleton .tbl--empty
        .tbl__check .tbl__first .tbl--linenos .is-focus（tr 高亮一次）
   工具条：.tablebar（配 __search __filters __count __right）、.bulkbar（__count __acts __clear）
   状态：.statuschip .countdown(.is-warn/.is-over) .locpath
   菜单浮层：.menu(.menu__group .menu__item .menu__item--danger .menu__sep) .menu__head
        .popover(.popover__arrow) .popconfirm .cmdbar(.cmdbar__input __list __item __kbd __group __empty)
   流程：.stepbar(.stepbar__item __dot __body) .stepline .timeline--tight .auditdiff(.auditdiff__from __to __arrow)
   数据：.statgrid(.stat __label __value __foot __delta) 替代散落 .kpis
   抽屉：.drawer__section(.drawer__section-title) .drawer__foot--sticky .drawer__resize .drawer__grip
        .drawer--xl .modal--sm
   反馈：.toast--action(.toast__act) .well[data-mark~] .plate[data-zoom] .plate--sm .plate--lg
   杂项：.card__body .chip__x .shortcuts(.shortcuts__group __row) .hintkbd
   ------------------------------------------------------------
   字号档位口径（避免再出现随意的 11px 正文）
   · 阅读文本（说明/副文本/时间戳/正文）：≥ --fs-xs(11.5)，正文用 --fs-sm(12)~--fs-body(12.5)
     → .tbl__sub .tl-item__time .tl-item__body .metastrip span|b 均已按此抬档
   · 标签密度（pill / tag / chip / 单位 / 角标 / .btn--sm）：允许 11~11.5，它们不是连续阅读对象
   · 禁止：把承载句子语义的元素设成 --fs-2xs(11)
   ============================================================ */

/* ── 表格 ──────────────────────────────────────────────── */
.tablewrap { overflow-x: auto; padding: var(--focus-off); min-width: 0; max-width: 100%; }
/* 焦点环补偿：整格贴边的按钮用负 offset，避免被 tablewrap 的滚动裁剪裁掉 */
.tablewrap .tbl .btn:focus-visible, .tablewrap .tbl a:focus-visible,
.tablewrap .tbl .linklike:focus-visible { outline-offset: calc(var(--focus-off) * -1); }
.tbl { font-size: var(--fs-body); }
.tbl thead th {
  position: sticky; top: 0; z-index: var(--z-sticky);
  padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink-3);
  font-size: var(--fs-sm); font-weight: 500; text-align: left; white-space: nowrap;
}
.tbl tbody td { padding: var(--s-2h, 10px) var(--s-3); border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background var(--dur-1) var(--ease-out); }
.tbl tbody tr:hover { background: var(--brand-wash); }
.tbl tbody tr[aria-selected="true"] { background: var(--brand-tint); box-shadow: inset 2px 0 0 var(--brand); }
.tbl tbody tr[data-cursor="true"] { background: var(--surface-3); box-shadow: inset 2px 0 0 var(--brand-dim); }
.tbl tbody tr.is-link { cursor: pointer; }
.tbl tbody tr:focus-visible { outline: var(--focus-w) solid var(--focus-c); outline-offset: calc(var(--focus-off) * -1); }
.tbl td.num, .tbl th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tbl td.idcell { color: var(--ink-2); font-family: var(--mono); font-size: var(--fs-xs); white-space: nowrap; }
.tbl .rowidx { width: 34px; color: var(--ink-3); font-family: var(--mono); font-size: var(--fs-2xs); }
.tbl--compact tbody td { padding: var(--s-3h) var(--s-2h); }
.tbl--board tbody td { padding: var(--s-2h) var(--s-3); }
.tbl__actions { display: flex; gap: var(--s-1); justify-content: flex-end; }
/* 副文本=阅读性文字（说明/编号/规格），按“正文语义”抬到 11.5；仍低于正文 12.5 以保持层序。
   注意：长副文本仍靠 .clamp1 + 父单元格 title 兜底。 */
/* 副文本（A 方案，实测最优）：单元格内联成一段、不限行数地自然换行会把
   88~118px 窄列撑到 4 行（行高 99px）。这里改为：
   ①副文本 inline 连成一段，相邻用「·」分隔；
   ②外层包一层 2 行截断容器，超长才折到第 3 行以后被裁。
   实测行高 99px → 64px，且不牺牲文字（只是限行，非省略号吞字）。 */
.tbl__sub { display: inline; color: var(--ink-3); font-size: var(--fs-xs); line-height: var(--lh-snug); }
.tbl__sub + .tbl__sub::before { content: " · "; color: var(--ink-4); }
/* 窄列 + 多副文本时，整块限 2 行：容器取「含 ≥2 个副文本的 div」，
   内联排布后超出第 2 行的部分被裁。实测行高 99px → 64px。
   这类单元格内容高度重复（患者·癌种·支数 / 代次·日期），限 2 行不影响可读性。 */
td > div:has(> .tbl__sub + .tbl__sub) {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-width: 0;
}
td > div > .tbl__sub { display: inline; }
td > div > .tbl__sub:first-of-type { display: block; margin-top: 1px; }
.tbl__check, .tbl td.tbl__check, .tbl th.tbl__check { width: 34px; padding-right: 0; }
.tblwrap { overflow-x: auto; }
/* 单元格角色：勾选列（居中、收窄）与动作列（右对齐） */
.tbl .cell-check, .tbl th.cell-check { width: 34px; padding-left: 0; padding-right: 0; text-align: center; }
.tbl .cell-act, .tbl th.cell-act { text-align: right; }
.tbl .cell-act .tbl__actions { justify-content: flex-end; }

/* 可排序：箭头只在 aria-sort 存在时出现，避免表头跳动 */
.tbl--sortable th[aria-sort] { cursor: pointer; user-select: none; }
.tbl--sortable th[aria-sort]::after { content: "↕"; margin-left: var(--s-1); color: var(--ink-4); font-size: var(--fs-2xs); }
.tbl--sortable th[aria-sort]:hover { color: var(--ink); background: var(--surface-3); }
.tbl--sortable th[aria-sort="ascending"]::after { content: "↑"; color: var(--brand); }
.tbl--sortable th[aria-sort="descending"]::after { content: "↓"; color: var(--brand); }

/* 固定首列：.tbl--fixed 让首列 sticky，需不透明底色 + 右侧发丝阴影 */
.tbl--fixed { border-collapse: separate; border-spacing: 0; }
.tbl--fixed td.tbl__first, .tbl--fixed th.tbl__first {
  position: sticky; left: 0; z-index: var(--z-sticky);
  background: var(--surface); box-shadow: 1px 0 0 var(--line-soft);
}
.tbl--fixed thead th.tbl__first { z-index: calc(var(--z-sticky) + 1); background: var(--surface-2); }
.tbl--fixed tbody tr:hover td.tbl__first { background: var(--surface-2); }
.tbl--fixed tbody tr[aria-selected="true"] td.tbl__first { background: var(--brand-tint); }
/* 钉住列再套一层：.tbl--pin 同时钉首列与表头（卡片内滚动时表头不脱位） */
.tbl--pin td.tbl__first, .tbl--pin th.tbl__first { position: sticky; left: 0; background: var(--surface); z-index: var(--z-sticky); }
.tbl--pin thead th.tbl__first { background: var(--surface-2); }

/* 骨架与空态行：表格加载时不要塌成 1 行高度 */
.tbl--skeleton tbody td { padding: var(--s-2h) var(--s-3); }
.tbl--skeleton .skeleton--line { height: 9px; }
.tbl--empty tbody td { padding: 0; }

/* 深链定位：从通知/审计跳转后目标行单次高亮。
   为满足“动画只动 transform/opacity”，用伪元素叠一层并淡出，不改行背景。 */
.tbl tbody tr.is-focus { position: relative; }
.tbl tbody tr.is-focus::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  border-left: 3px solid var(--flag); background: var(--flag-tint);
  animation: focusrow 1.8s var(--ease-out) 1 both;
}
.tbl tbody tr.is-focus > td { position: relative; z-index: 1; }
@keyframes focusrow {
  0% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; }
}

/* 行号列：贴左侧的连续序号，配合 .tbl--fixed 使用 */
.tbl--linenos .rowidx { position: sticky; left: 0; background: var(--surface); }

/* ── 状态 / 标签 ───────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: var(--s-3h);
  max-width: 100%; padding: 0 var(--s-2h);
  border: 1px solid transparent; border-radius: var(--r-pill);
  background: var(--surface-3); color: var(--ink-2);
  font-size: var(--fs-2xs); line-height: 18px; white-space: nowrap;
}
.pill::before { content: ""; flex: 0 0 auto; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.75; }
.pill--none::before { display: none; }
.pill--ok { color: var(--ok); background: var(--ok-tint); border-color: var(--ok-line); }
.pill--warn { color: var(--flag); background: var(--flag-tint); border-color: var(--flag-line); }
.pill--danger { color: var(--danger); background: var(--danger-tint); border-color: var(--danger-line); }
.pill--info { color: var(--info); background: var(--info-tint); border-color: var(--info-line); }
.pill--brand { color: var(--brand-strong); background: var(--brand-tint); border-color: var(--brand-line); }
.pill--violet { color: var(--violet); background: var(--violet-tint); border-color: var(--violet-line); }
.pill--muted { color: var(--ink-3); background: var(--surface-3); border-color: var(--line); }

.tag {
  display: inline-block; max-width: 100%; padding: 0 var(--s-3h);
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--ink-2);
  font-size: var(--fs-2xs); line-height: 18px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
}
.tag--brand { border-color: var(--brand-line); background: var(--brand-tint); color: var(--brand-strong); }
.tag--warn { border-color: var(--flag-line); background: var(--flag-tint); color: var(--flag); }
.tag--danger { border-color: var(--danger-line); background: var(--danger-tint); color: var(--danger); }
.tag--info { border-color: var(--info-line); background: var(--info-tint); color: var(--info); }
.tag--mono { font-family: var(--mono); font-size: var(--fs-2xs); font-variant-numeric: tabular-nums; }

.chip {
  display: inline-flex; align-items: center; gap: var(--s-3h);
  max-width: 100%; padding: var(--s-1h) var(--s-2) var(--s-1h) var(--s-3h);
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); font-size: var(--fs-xs); cursor: default;
}
.chip b { font-weight: 500; }
.chip .mono { color: var(--ink-3); font-size: var(--fs-2xs); }
.chip--sample { border-color: var(--brand-line); background: #f4faf7; }
.chip--warn { border-color: var(--flag-line); background: var(--flag-tint); }
.chip--danger { border-color: var(--danger-line); background: var(--danger-tint); }
.chip__dot { flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-dim); }
/* 可移除筛选 chip：× 按钮独立可聚焦，点击即退出该筛选 */
.chip__x {
  display: inline-grid; place-items: center; width: 16px; height: 16px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink-4); cursor: pointer;
}
.chip__x:hover { background: var(--surface-3); color: var(--danger); }
/* coreui 的面包屑链接类名；与 .crumb__link 同观感 */
.breadcrumb-link { padding: 0; border: 0; background: none; color: var(--ink-3); font: inherit; cursor: pointer; }
.breadcrumb-link:hover { color: var(--brand); text-decoration: underline; }
.chip__x:focus-visible { outline: var(--focus-w) solid var(--focus-c); outline-offset: 1px; }

/* 统一状态点（文档流内联，不撑行高） */
.statuschip { display: inline-flex; align-items: center; gap: var(--s-3h); font-size: var(--fs-xs); color: var(--ink-2); white-space: nowrap; }
.statuschip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4); }
.statuschip[data-tone="ok"]::before { background: var(--ok); }
.statuschip[data-tone="warn"]::before { background: var(--flag); }
.statuschip[data-tone="danger"]::before { background: var(--danger); }
.statuschip[data-tone="info"]::before { background: var(--info); }
.statuschip[data-tone="live"]::before { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-wash); }

/* 时效条：正常 / 临期(is-warn) / 超期(is-over)，宽度用 transform 表示占比 */
.countdown { display: flex; align-items: center; gap: var(--s-2); min-width: 0; font-size: var(--fs-xs); color: var(--ink-3); }
.countdown__track { flex: 1 1 auto; min-width: 40px; height: 4px; overflow: hidden; border-radius: var(--r); background: var(--surface-3); }
.countdown__track > i { display: block; height: 100%; background: var(--brand); transform-origin: left; }
.countdown__val { flex: 0 0 auto; font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.countdown__val::before { content: "剩 "; color: var(--ink-4); }
.countdown.is-warn .countdown__track > i { background: var(--flag); }
.countdown.is-warn .countdown__val { color: var(--flag); }
.countdown.is-over .countdown__track > i { background: var(--danger); }
.countdown.is-over .countdown__val { color: var(--danger); }
.countdown.is-over .countdown__val::before { content: "超期 "; }

/* 冻结项：通用的“不可改”提示 */
.prio { display: inline-flex; align-items: center; gap: var(--s-1); font-size: var(--fs-2xs); }
.prio--urgent { color: var(--danger); font-weight: 500; }
.prio--urgent::before { content: "▲"; font-size: 8px; }
.prio--normal { color: var(--ink-3); }
.prio--normal::before { content: "·"; font-size: var(--fs-lg); line-height: 0; }

/* ── 工具条：.tablebar 表格专用（与 .toolbar 互不影响） ──── */
.tablebar {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2);
  padding: var(--s-2h) var(--sp-card, var(--s-7h));
  border-bottom: 1px solid var(--line-soft); background: var(--surface);
}
.tablebar__search { position: relative; display: inline-flex; align-items: center; flex: 0 1 260px; min-width: 160px; }
.tablebar__search svg { position: absolute; left: var(--s-2); color: var(--ink-4); pointer-events: none; }
.tablebar__search input { padding-left: 27px; }
.tablebar__filters { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-1); min-width: 0; }
.tablebar__count { color: var(--ink-3); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.tablebar__right { display: flex; align-items: center; gap: var(--s-1); margin-left: auto; }
/* 统一工具条（原型评估清单 A5）：筛选左、操作右、同一行 */
.tablebar__left { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2); min-width: 0; }
/* 操作区允许折行：主操作超过 3～4 枚时窄视口不撑出横向滚动（A5 实测 execution 5 枚已临界） */
.tablebar__actions { display: inline-flex; align-items: center; flex-wrap: wrap; gap: var(--s-1); }
.segmented__count { margin-left: 3px; font-size: var(--fs-2xs, 11px); opacity: .72; font-variant-numeric: tabular-nums; }

/* ── 行操作条：移除行内操作列后，「先选行再操作」的操作位（A5） ── */
.rowbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2);
  padding: var(--s-1h) var(--sp-card, var(--s-7h));
  border-bottom: 1px solid var(--line-soft); background: var(--brand-tint);
  color: var(--brand-strong); font-size: var(--fs-xs); min-height: 34px;
}
.rowbar--empty { background: var(--surface-2); color: var(--ink-3); }
.rowbar--empty svg { color: var(--ink-4); flex: none; }
.rowbar__count { white-space: nowrap; }
.rowbar__what { color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowbar__actions { display: inline-flex; align-items: center; gap: var(--s-1); margin-left: auto; flex-wrap: wrap; }
.rowbar .btn:focus-visible { outline-offset: calc(var(--focus-off) * -1); }
/* coreui 用 .tablebar__batch 表示内联批量条；与 .bulkbar 同观感 */
.tablebar__batch { display: flex; align-items: center; gap: var(--s-1); padding: var(--s-1h) var(--s-1) var(--s-1h) var(--s-2);
  border: 1px solid var(--brand-line); border-radius: var(--r); background: var(--brand-tint); color: var(--brand-strong); font-size: var(--fs-xs); }
.tablebar .btn:focus-visible, .chipbar .btn:focus-visible { outline-offset: calc(var(--focus-off) * -1); }
.tablebar__density { display: inline-flex; }
.tablebar--sticky { position: sticky; top: 0; z-index: calc(var(--z-sticky) + 2); }
/* 工具条内按钮贴边时用内缩焦点环（与 .toolbar 同一补偿规则） */
.toolbar .btn:focus-visible, .toolbar .segmented button:focus-visible { outline-offset: calc(var(--focus-off) * -1); }

/* 批量操作条：有选中项时从工具条下方展开（吸附表格底部或工具条下沿） */
.bulkbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--brand-line); border-radius: var(--r);
  background: var(--brand-tint); color: var(--brand-strong); font-size: var(--fs-sm);
  box-shadow: var(--shadow-1);
}
.bulkbar[hidden] { display: none; }
.bulkbar__count { font-weight: 500; font-variant-numeric: tabular-nums; }
.bulkbar__count b { font-family: var(--mono); font-size: var(--fs-md); }
.bulkbar__acts { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-1); margin-left: auto; min-width: 0; }
.bulkbar__clear { border: 0; background: none; color: var(--brand-dim); font-size: var(--fs-xs); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.bulkbar--float { position: sticky; bottom: var(--s-3); margin: 0 var(--s-3) var(--s-3); }
.bulkbar--danger { border-color: var(--danger-line); background: var(--danger-tint); color: var(--danger); }
/* 工具条下方通栏版：无圆角、贴边、发丝下分割线 */
.bulkbar--top { padding: var(--s-3h) var(--s-7h); border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0; box-shadow: none; background: var(--brand-tint); }
.bulkbar--top.bulkbar--danger { border-bottom-color: var(--danger-line); background: var(--danger-tint); }
/* 筛选 chip 通栏：与 tablebar 上下衔接 */
.chipbar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-3h); padding: var(--s-3h) var(--s-7h); border-bottom: 1px solid var(--line-soft); background: var(--surface); }
.chipbar:empty, .chipbar[hidden] { display: none; }
.chipbar__label { color: var(--ink-3); font-size: var(--fs-2xs); }
.chipbar__clear { margin-left: auto; border: 0; background: none; color: var(--brand); font-size: var(--fs-2xs); cursor: pointer; }
.chipbar__clear:hover { text-decoration: underline; }

/* 库位面包屑：设备 → 分区 → 架号 → 孔位，最后一段为当前位 */
.locpath { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-1); font-size: var(--fs-xs); color: var(--ink-3); }
.locpath__seg { display: inline-flex; align-items: center; gap: var(--s-1); font-family: var(--mono); }
.locpath__seg + .locpath__seg::before { content: "›"; margin-right: var(--s-1); color: var(--ink-4); font-family: var(--sans); }
.locpath__seg:last-child { color: var(--ink); font-weight: 500; }
.locpath a:hover { text-decoration: underline; }

/* ── 抽屉 / 模态 ───────────────────────────────────────── */
.overlay-host { position: relative; z-index: var(--z-scrim); }
.scrim { position: fixed; inset: 0; background: rgba(10, 22, 19, 0.34); backdrop-filter: blur(1.5px); opacity: 0; transition: opacity var(--dur-3) var(--ease-out); }
.scrim.is-in { opacity: 1; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 94vw);
  display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow-4); opacity: 0; transform: translateX(24px);
  transition: transform var(--dur-4) var(--ease-out), opacity var(--dur-3) var(--ease-out);
}
.drawer.is-in { transform: none; opacity: 1; }
.drawer--wide { width: min(980px, 96vw); }
.drawer--narrow { width: min(460px, 92vw); }
.drawer--xl { width: min(1180px, 98vw); }
.drawer__head { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-7h) var(--s-5); border-bottom: 1px solid var(--line); background: var(--surface); }
.drawer__title { font-size: var(--fs-xl); font-weight: 600; line-height: var(--lh-heading); letter-spacing: var(--ls-xl); }
.drawer__sub { margin-top: var(--s-1h); color: var(--ink-3); font-size: var(--fs-xs); line-height: var(--lh-snug); }
.drawer__close { margin-left: auto; }
.drawer__body { flex: 1 1 auto; overflow-y: auto; padding: var(--s-4) var(--s-5); scrollbar-width: thin; }
.drawer__foot {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-3) var(--s-5); border-top: 1px solid var(--line); background: var(--surface-2);
}
.drawer__foot .spacer { flex: 1 1 auto; }
/* 底部动作条吸底：长表单里主按钮始终可见 */
.drawer__foot--sticky { position: sticky; bottom: 0; z-index: var(--z-sticky); box-shadow: 0 -1px 0 var(--line); }
/* 左缘拖拽手柄：鼠标可拉宽（JS 负责 width），样式只给命中区与光标 */
.drawer__resize, .drawer__grip {
  position: absolute; top: 0; bottom: 0; left: -3px; width: 7px;
  border: 0; background: transparent; cursor: col-resize; padding: 0;
}
.drawer__resize::after, .drawer__grip::after {
  content: ""; position: absolute; top: 50%; left: 3px; width: 1px; height: 40px;
  transform: translateY(-50%); background: transparent; transition: background var(--dur-2) var(--ease-out);
}
.drawer__resize:hover::after, .drawer__resize:focus-visible::after,
.drawer__grip:hover::after, .drawer__grip:focus-visible::after { background: var(--brand-dim); }

/* 抽屉内分区：标题 + 说明，区段间用发丝线分隔 */
.drawer__section { padding: var(--s-4) 0; border-bottom: 1px solid var(--line-soft); }
.drawer__section:last-child { border-bottom: 0; padding-bottom: 0; }
.drawer__section:first-child { padding-top: 0; }
.drawer__section-title {
  display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-2h);
  color: var(--ink); font-size: var(--fs-md); font-weight: 600; line-height: var(--lh-mid); letter-spacing: var(--ls-md);
}
.drawer__section-title .tag, .drawer__section-title .pill { font-weight: 400; }
.drawer__section-note { color: var(--ink-3); font-size: var(--fs-xs); line-height: var(--lh-relaxed); margin-bottom: var(--s-2h); }

.modal {
  position: fixed; left: 50%; top: 50%; width: min(520px, 94vw); max-height: 88vh; overflow: auto;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
  box-shadow: var(--shadow-3); opacity: 0; transform: translate(-50%, -48%) scale(0.99);
  transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-4) var(--ease-out);
}
.modal.is-in { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.modal--sm { width: min(400px, 94vw); }
.modal--wide { width: min(760px, 96vw); }
.modal__head { display: flex; align-items: center; gap: var(--s-2h); padding: var(--s-7h) var(--s-5); border-bottom: 1px solid var(--line-soft); }
.modal__title { font-size: var(--fs-lg); font-weight: 600; line-height: var(--lh-mid); letter-spacing: var(--ls-lg); }
.modal__body { padding: var(--s-4) var(--s-5); }
.modal__foot { display: flex; justify-content: flex-end; gap: var(--s-2); padding: var(--s-3) var(--s-5); border-top: 1px solid var(--line-soft); background: var(--surface-2); }

/* ── 菜单 / 浮层 / 气泡确认 / 命令面板 ─────────────────── */
.menu {
  min-width: 168px; max-width: 320px; padding: var(--s-1);
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  box-shadow: var(--shadow-3); font-size: var(--fs-body);
}
.menu__head { padding: var(--s-1) var(--s-2) var(--s-1); color: var(--ink-3); font-size: var(--fs-2xs); letter-spacing: var(--ls-wide); }
.menu__group + .menu__group { margin-top: var(--s-1); padding-top: var(--s-1); border-top: 1px solid var(--line-soft); }
.menu__item {
  display: flex; align-items: center; gap: var(--s-2); width: 100%;
  padding: var(--s-1) var(--s-2); border: 0; border-radius: var(--r);
  background: none; color: var(--ink-2); font-size: var(--fs-body); text-align: left;
  text-decoration: none; cursor: pointer;
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.menu__item svg { flex: 0 0 auto; opacity: 0.7; }
.menu__item:hover, .menu__item[data-active="true"] { background: var(--surface-3); color: var(--ink); }
.menu__item:focus-visible { outline: var(--focus-w) solid var(--focus-c); outline-offset: calc(var(--focus-off) * -1); }
.menu__item[aria-disabled="true"], .menu__item[disabled] { opacity: 0.45; cursor: not-allowed; }
.menu__item--danger, .menu__danger { color: var(--danger); }
.menu__item--danger:hover, .menu__danger:hover { background: var(--danger-tint); color: var(--danger); }
.menu__item .kbd, .menu__item .menu__hint { margin-left: auto; color: var(--ink-4); font-size: var(--fs-2xs); }
.menu__sep { height: 1px; margin: var(--s-1) 0; border: 0; background: var(--line-soft); }
/* <details class="menu"> 用法：summary 为触发按钮，展开后 .menu__group 绝对定位到其下 */
.menu > summary { display: inline-flex; align-items: center; gap: var(--s-1); list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::marker { content: ""; }
.menu > summary:focus-visible { outline: var(--focus-w) solid var(--focus-c); outline-offset: var(--focus-off); border-radius: var(--r); }
.menu > .menu__group {
  position: absolute; right: 0; top: calc(100% + var(--s-1)); z-index: var(--z-pop);
  display: flex; flex-direction: column; min-width: 160px; padding: var(--s-1);
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-3);
}
.menu > .menu__group > .menu__item { padding: var(--s-1) var(--s-2); border: 0; background: none; font-size: var(--fs-xs); text-align: left; border-radius: var(--r); }
.menu > .menu__group > .menu__item:hover { background: var(--surface-3); }
.menu > .menu__group > .menu__item:disabled, .menu > .menu__group > .menu__item[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }

.popover {
  position: absolute; z-index: var(--z-pop); max-width: 320px;
  padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); box-shadow: var(--shadow-3);
  color: var(--ink-2); font-size: var(--fs-sm); line-height: var(--lh-relaxed);
}
.popover__arrow { position: absolute; width: 8px; height: 8px; background: var(--surface); border: 1px solid var(--line); transform: rotate(45deg); }
.popover__title { display: block; margin-bottom: var(--s-1); color: var(--ink); font-weight: 600; }
.popover__foot { display: flex; justify-content: flex-end; gap: var(--s-1); margin-top: var(--s-2); }
.popconfirm { position: absolute; z-index: var(--z-pop); width: 248px; padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-3); }
.popconfirm__arrow { position: absolute; top: -4px; left: 16px; width: 8px; height: 8px; background: var(--surface); border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg); }

/* 命令面板：⌘K 打开，输入 + 结果列表；焦点环用内阴影避免被面板裁切 */
.cmdbar {
  position: fixed; z-index: var(--z-pop); left: 50%; top: 14vh; width: min(560px, 92vw);
  transform: translateX(-50%); overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-4);
}
.cmdbar__input {
  width: 100%; padding: var(--s-3) var(--s-4); border: 0; border-bottom: 1px solid var(--line-soft);
  background: var(--surface); color: var(--ink); font-size: var(--fs-lg);
}
.cmdbar__input:focus-visible { outline: var(--focus-w) solid var(--focus-c); outline-offset: calc(var(--focus-off) * -1); }
.cmdbar__list { max-height: 46vh; overflow-y: auto; padding: var(--s-1); scrollbar-width: thin; }
.cmdbar__group { padding: var(--s-2) var(--s-2) var(--s-1); color: var(--ink-3); font-size: var(--fs-2xs); letter-spacing: var(--ls-wide); }
.cmdbar__item {
  display: flex; align-items: center; gap: var(--s-2); width: 100%; padding: var(--s-1) var(--s-2);
  border: 0; border-radius: var(--r); background: none; color: var(--ink-2); font-size: var(--fs-body);
  text-align: left; cursor: pointer;
}
.cmdbar__item:hover { background: var(--surface-2); }
.cmdbar__item[aria-selected="true"] { background: var(--brand-tint); color: var(--brand-strong); }
.cmdbar__kbd { margin-left: auto; color: var(--ink-4); font-family: var(--mono); font-size: var(--fs-2xs); }
.cmdbar__empty { padding: var(--s-6) var(--s-4); text-align: center; color: var(--ink-3); font-size: var(--fs-sm); }
.cmdbar__foot { display: flex; gap: var(--s-3); padding: var(--s-1) var(--s-3); border-top: 1px solid var(--line-soft); background: var(--surface-2); color: var(--ink-3); font-size: var(--fs-sm); }
/* coreui 的命令面板命名为 .cmdraw；与 .cmdbar 共用同一套外观 */
.cmdraw, .cmdraw.is-in { position: fixed; z-index: var(--z-pop); left: 50%; top: 14vh; transform: translateX(-50%);
  display: flex; flex-direction: column; width: min(560px, 92vw); max-height: 70vh; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-4); }
.cmdraw__input { width: 100%; padding: var(--s-3) var(--s-4); border: 0; border-bottom: 1px solid var(--line-soft); background: var(--surface); font-size: var(--fs-lg); }
.cmdraw__list { max-height: 46vh; overflow-y: auto; padding: var(--s-1); scrollbar-width: thin; }
.cmdraw__group { padding: var(--s-2) var(--s-2) var(--s-1); color: var(--ink-3); font-size: var(--fs-2xs); letter-spacing: var(--ls-wide); }
.cmdraw__item { display: flex; align-items: center; gap: var(--s-2); width: 100%; padding: var(--s-1) var(--s-2); border: 0; border-radius: var(--r); background: none; color: var(--ink-2); font-size: var(--fs-body); text-align: left; cursor: pointer; }
.cmdraw__item[aria-selected="true"] { background: var(--brand-tint); color: var(--brand-strong); }
.cmdraw__icon { display: inline-flex; color: var(--ink-4); }
.cmdraw__hint { display: flex; align-items: center; gap: var(--s-1); margin-left: auto; color: var(--ink-4); font-size: var(--fs-2xs); }
.cmdraw__empty { padding: var(--s-6) var(--s-4); text-align: center; color: var(--ink-3); font-size: var(--fs-sm); }

/* ── 提示 ──────────────────────────────────────────────── */
.toast-host { position: fixed; top: var(--s-4); right: var(--s-4); z-index: var(--z-toast); display: flex; flex-direction: column; gap: var(--s-2); pointer-events: none; }
.toast {
  display: flex; align-items: flex-start; gap: var(--s-2); min-width: 240px; max-width: 360px;
  padding: var(--s-2h) var(--s-3); border: 1px solid #1d3a33; border-radius: var(--r);
  background: #102320; color: #e8f1ec; font-size: var(--fs-sm); line-height: var(--lh-snug);
  box-shadow: var(--shadow-2); pointer-events: auto;
  opacity: 0; transform: translateY(-6px); transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out);
}
.toast.is-in { transform: none; opacity: 1; }
.toast__mark { flex: 0 0 auto; margin-top: 1px; color: #4dc9a9; }
.toast--warn { border-color: #4a3a1c; }
.toast--warn .toast__mark { color: #e0b165; }
.toast--danger { border-color: #4c2020; }
.toast--danger .toast__mark { color: #e08b80; }
.toast small { display: block; margin-top: 1px; color: #9fb3ac; }
/* 带操作的提示（如“已删除 · 撤销”）：动作按钮右对齐，键盘可达 */
.toast--action { padding-right: var(--s-2); }
.toast__act {
  flex: 0 0 auto; align-self: center; margin-left: var(--s-1);
  padding: var(--s-1h) var(--s-2); border: 1px solid #2f554b; border-radius: var(--r);
  background: transparent; color: #8ff0d8; font-size: var(--fs-xs); cursor: pointer;
}
.toast__act:hover { background: #17342c; }
.toast__act:focus-visible { outline: 2px solid #8ff0d8; outline-offset: 2px; }

/* ── 时间线 / 步骤 ─────────────────────────────────────── */
.timeline { position: relative; padding-left: var(--s-4); }
.timeline::before { content: ""; position: absolute; left: 4px; top: var(--s-1); bottom: var(--s-3h); width: 1px; background: var(--line); }
.tl-item { position: relative; padding-bottom: var(--s-7h); }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: calc(var(--s-4) * -1 + 1px); top: var(--s-1);
  width: 7px; height: 7px; border: 1.5px solid var(--line); border-radius: 50%;
  background: var(--surface); box-shadow: 0 0 0 3px var(--surface);
}
.tl-item[data-state="done"]::before { background: var(--brand); border-color: var(--brand); }
.tl-item[data-state="now"]::before { background: var(--flag); border-color: var(--flag); }
.tl-item[data-state="bad"]::before { background: var(--danger); border-color: var(--danger); }
.tl-item__head { display: flex; align-items: baseline; gap: var(--s-2); font-size: var(--fs-sm); }
.tl-item__head b { font-weight: 500; }
.tl-item__time { margin-left: auto; color: var(--ink-3); font-family: var(--mono); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.tl-item__body { margin-top: 1px; color: var(--ink-3); font-size: var(--fs-xs); line-height: var(--lh-snug); }
/* 紧凑时间线：用于抽屉与卡片侧栏，行距减半 */
.timeline--tight { padding-left: var(--s-3); }
.timeline--tight .tl-item { padding-bottom: var(--s-2); }
.timeline--tight .tl-item::before { left: calc(var(--s-3) * -1 + 1px); }
.timeline--tight .tl-item__body { font-size: var(--fs-2xs); }

/* 流程步骤条（旧 .steps/.step 保留） */
.steps { display: flex; align-items: stretch; overflow-x: auto; padding-bottom: var(--s-1h); }
.step {
  position: relative; flex: 1 0 auto; min-width: 92px;
  padding: var(--s-2) var(--s-3) var(--s-2) var(--s-4);
  border: 1px solid var(--line); border-left: 0; background: var(--surface-2);
  color: var(--ink-3); font-size: var(--fs-xs); white-space: nowrap;
}
.step:first-child { padding-left: var(--s-3); border-left: 1px solid var(--line); border-radius: var(--r) 0 0 var(--r); }
.step:last-child { border-radius: 0 var(--r) var(--r) 0; }
.step b { display: block; color: var(--ink-3); font-family: var(--mono); font-size: var(--fs-2xs); font-weight: 400; }
.step[data-state="done"] { border-color: #cde2da; background: var(--brand-tint); color: var(--brand-strong); }
.step[data-state="done"] b { color: var(--brand-dim); }
.step[data-state="now"] { border-color: var(--brand); background: var(--brand); color: #fff; font-weight: 500; }
.step[data-state="now"] b { color: #a9d8c9; }
.step[data-state="bad"] { border-color: var(--danger-line); background: var(--danger-tint); color: var(--danger); }

/* 步骤条增强：已完成可点、当前高亮、超时为红；.stepline 为细线进度 */
.stepbar { display: flex; align-items: flex-start; gap: 0; overflow-x: auto; padding: var(--s-1) var(--focus-off); }
.stepbar__item {
  position: relative; display: flex; align-items: flex-start; gap: var(--s-2); flex: 1 1 0; min-width: 104px;
  padding: var(--s-2) var(--s-3) var(--s-2) 0;
  border: 0; background: none; color: var(--ink-3); font-size: var(--fs-xs); text-align: left;
}
.stepbar__item::after { content: ""; position: absolute; left: 26px; right: var(--s-3); top: 14px; height: 1px; background: var(--line); }
.stepbar__item:last-child::after { display: none; }
.stepbar__dot {
  position: relative; z-index: 1; display: grid; place-items: center; flex: 0 0 auto;
  width: 18px; height: 18px; border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface); color: var(--ink-4);
  font-family: var(--mono); font-size: var(--fs-2xs); line-height: 1;
}
.stepbar__body { min-width: 0; line-height: var(--lh-snug); }
.stepbar__body b { display: block; color: var(--ink-2); font-weight: 500; font-size: var(--fs-xs); }
.stepbar__body span { color: var(--ink-3); font-size: var(--fs-2xs); }
.stepbar__item[data-state="done"] .stepbar__dot { border-color: var(--brand); background: var(--brand); color: #fff; }
.stepbar__item[data-state="done"]::after { background: var(--brand-dim); }
.stepbar__item[data-state="done"] { cursor: pointer; }
.stepbar__item[data-state="done"]:hover .stepbar__body b { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.stepbar__item[data-state="now"] .stepbar__dot { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-strong); font-weight: 600; box-shadow: 0 0 0 3px var(--brand-wash); }
.stepbar__item[data-state="now"] .stepbar__body b { color: var(--ink); }
.stepbar__item[data-state="bad"] .stepbar__dot { border-color: var(--danger); background: var(--danger-tint); color: var(--danger); }
.stepbar__item[data-state="bad"] .stepbar__body b { color: var(--danger); }
.stepbar__item:disabled { cursor: default; }
.stepbar__item:focus-visible { outline: var(--focus-w) solid var(--focus-c); outline-offset: var(--focus-off); border-radius: var(--r); }
.stepline { position: relative; height: 3px; border-radius: var(--r); background: var(--surface-3); overflow: hidden; }
.stepline > i { display: block; height: 100%; background: var(--brand); border-radius: var(--r); transform-origin: left; transition: transform var(--dur-4) var(--ease-out); }
.stepline--warn > i { background: var(--flag); }
.stepline--danger > i { background: var(--danger); }

/* 审计差异：before → after，删除段划线、新增段墨绿底 */
.auditdiff { display: inline-flex; align-items: center; flex-wrap: wrap; gap: var(--s-1); font-size: var(--fs-xs); }
.auditdiff__from { padding: 0 var(--s-1); border-radius: var(--r); background: var(--surface-3); color: var(--ink-3); text-decoration: line-through; text-decoration-color: #b56a6a; }
.auditdiff__to { padding: 0 var(--s-1); border-radius: var(--r); background: var(--brand-tint); color: var(--brand-strong); }
.auditdiff__arrow { color: var(--ink-4); font-family: var(--mono); font-size: var(--fs-2xs); }
.auditdiff--empty .auditdiff__from { text-decoration: none; opacity: 0.6; }
.auditdiff__more { color: var(--ink-3); font-size: var(--fs-2xs); }
/* 版本比对表：.cmp 内差异单元格上色（删/增），不加粗以免行高跳动 */
.cmp td.diff__del { background: var(--danger-tint); color: var(--danger); }
.cmp td.diff__ins { background: var(--ok-tint); color: var(--ok); }
.cmp td.diff__del::before { content: "− "; font-family: var(--mono); }
.cmp td.diff__ins::before { content: "+ "; font-family: var(--mono); }
/* 勾选清单：项级容器（多行说明时顶端对齐） */
.check-list { display: flex; flex-direction: column; gap: var(--s-1); }
.check-list .check { align-items: flex-start; gap: var(--s-2); padding: var(--s-3h) var(--s-2); border: 1px solid var(--line-soft); border-radius: var(--r); }
.check-list .check:hover { border-color: var(--line); background: var(--surface-2); }
.check-row--flag { border-color: var(--danger-line) !important; background: var(--danger-tint); }
/* 确认框：风险提示、影响清单、常用理由 chip（coreui 注入 DOM，样式在此） */
.confirm-risk { margin-bottom: var(--s-2h); }
.confirm-impact { margin-top: var(--s-2h); padding: var(--s-2) var(--s-2h); border: 1px solid var(--line-soft); border-radius: var(--r); background: var(--surface-2); }
.confirm-impact li { position: relative; padding-left: var(--s-3); color: var(--ink-2); line-height: var(--lh-loose); }
.confirm-impact li::before { content: ""; position: absolute; left: var(--s-1h); top: 9px; width: 4px; height: 4px; border-radius: 50%; background: var(--ink-4); }
.confirm-reasons { display: flex; flex-wrap: wrap; gap: var(--s-1); margin-bottom: var(--s-3h); }
.confirm-reasons .chip { cursor: pointer; }
.confirm-reasons .chip:hover { border-color: var(--brand-dim); background: var(--brand-tint); }

/* ── 数据格：.statgrid 替代散落的 .kpis ────────────────── */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--sp-gutter, var(--s-4)); }
.stat {
  min-width: 0; padding: var(--s-3) var(--s-7h);
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.stat:hover { border-color: var(--line); box-shadow: var(--shadow-1); }
.stat__label { display: flex; align-items: center; gap: var(--s-1); color: var(--ink-3); font-size: var(--fs-xs); }
.stat__value { margin-top: var(--s-1); color: var(--ink); font-size: var(--fs-4xl); font-weight: 600; line-height: var(--lh-tight); letter-spacing: var(--ls-4xl); font-variant-numeric: tabular-nums; }
.stat__value small { margin-left: var(--s-1); color: var(--ink-3); font-size: var(--fs-sm); font-weight: 400; letter-spacing: 0; }
.stat__foot { display: flex; align-items: center; gap: var(--s-1); margin-top: var(--s-1); color: var(--ink-3); font-size: var(--fs-2xs); }
.stat__delta { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.stat--flag { border-left: 2px solid var(--flag); }
.stat--danger { border-left: 2px solid var(--danger); }
.stat--brand { border-left: 2px solid var(--brand); }

/* 旧指标卡（保留兼容） */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-gutter, var(--s-4)); }
.kpi { min-width: 0; padding: var(--s-2h) var(--s-3); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.kpi__label { display: flex; align-items: center; gap: var(--s-3h); color: var(--ink-3); font-size: var(--fs-sm); }
.kpi__value { margin-top: var(--s-1); font-size: var(--fs-4xl); font-weight: 600; line-height: var(--lh-tight); letter-spacing: var(--ls-4xl); font-variant-numeric: tabular-nums; }
.kpi__value small { margin-left: 1px; color: var(--ink-3); font-size: var(--fs-sm); font-weight: 400; }
.kpi__foot { display: flex; align-items: center; gap: var(--s-3h); margin-top: var(--s-1); color: var(--ink-3); font-size: var(--fs-sm); }
.kpi--flag { border-left: 2px solid var(--flag); }
.kpi--danger { border-left: 2px solid var(--danger); }
.kpi--brand { border-left: 2px solid var(--brand); }
.trend-up { color: var(--ok); }
.trend-down { color: var(--danger); }

.meter { height: 5px; overflow: hidden; border-radius: var(--r); background: var(--surface-3); }
.meter > i { display: block; height: 100%; border-radius: var(--r); background: var(--brand); transform-origin: left; }
.meter--flag > i { background: var(--flag); }
.meter--danger > i { background: var(--danger); }

.bars { display: flex; align-items: flex-end; gap: var(--s-3h); height: 116px; }
.bars__col { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: flex-end; gap: var(--s-1); min-width: 0; }
.bars__bar { position: relative; width: 100%; max-width: 34px; border: 1px solid #cde2da; border-bottom: 2px solid var(--brand);
  border-radius: 1px 1px 0 0; background: var(--brand-tint); transform-origin: bottom; }
.bars__bar[data-muted="true"] { border-color: var(--line); border-bottom-color: var(--ink-4); background: var(--surface-3); }
.bars__col span { color: var(--ink-3); font-family: var(--mono); font-size: var(--fs-2xs); }
.bars__val { color: var(--ink); font-family: var(--mono); font-size: var(--fs-2xs); }

.hbar { display: grid; grid-template-columns: 92px minmax(0, 1fr) 46px; align-items: center; gap: var(--s-2); margin-bottom: var(--s-2h); font-size: var(--fs-xs); }
.hbar__label { overflow: hidden; color: var(--ink-2); text-overflow: ellipsis; white-space: nowrap; }
.hbar__track { height: var(--s-3); overflow: hidden; border-radius: 1px; background: var(--surface-3); }
.hbar__fill { height: 100%; background: var(--brand); opacity: 0.85; transform-origin: left; }
.hbar__fill--flag { background: var(--flag); }
.hbar__fill--danger { background: var(--danger); }
.hbar__fill--info { background: var(--info); }
.hbar__fill--violet { background: var(--violet); }
.hbar__val { color: var(--ink-3); font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; }

.donut { position: relative; display: grid; place-items: center; }
.donut svg { transform: rotate(-90deg); }
.donut__center { position: absolute; text-align: center; }
.donut__center b { display: block; font-size: var(--fs-3xl); font-weight: 600; font-variant-numeric: tabular-nums; line-height: var(--lh-tight); }
.donut__center span { color: var(--ink-3); font-size: var(--fs-2xs); }
.legend { display: flex; flex-direction: column; gap: var(--s-1); font-size: var(--fs-xs); }
.legend__row { display: flex; align-items: center; gap: var(--s-1h); }
.legend__dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 2px; }
.legend__val { margin-left: auto; color: var(--ink-2); font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ── 板位图（96/384 孔） ───────────────────────────────── */
.plate { display: block; width: 100%; max-width: 640px; }
.plate__body { display: flex; flex-direction: column; gap: var(--s-1); }
.plate__head, .plate__line { display: flex; align-items: center; gap: var(--s-1); }
.plate__head { margin-bottom: var(--s-1); }
.plate__axis { flex: 0 0 13px; width: 13px; color: var(--ink-3); font-family: var(--mono); font-size: var(--fs-2xs); text-align: center; }
.plate__axis--col { flex: 1 1 0; width: auto; text-align: center; }
.wellgrid { display: grid; flex: 1 1 auto; gap: var(--s-1); min-width: 0; }
.well {
  position: relative; display: grid; place-items: center; aspect-ratio: 1;
  border: 1px solid #cfd6cd; border-radius: 50%; background: #f7f8f4;
  color: var(--ink-4); font-family: var(--mono); font-size: var(--fs-2xs);
  cursor: pointer; transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.well:hover { z-index: 2; transform: scale(1.18); box-shadow: 0 2px 8px rgba(14, 26, 23, 0.18); }
.well[data-state="sample"] { border-color: #8cbab0; background: #cfe6df; color: #145a4e; }
.well[data-state="qc"] { border-color: #8798c9; background: #d8e0f3; color: #2b3a6d; }
.well[data-state="blank"] { border-color: #c3bfae; background: #efeee6; color: #6b6450; }
.well[data-state="control"] { border-color: #ab92c4; background: #eadff2; color: #523a6c; }
.well[data-state="excluded"] { border-color: #d8a9a2; background: repeating-linear-gradient(45deg, #f4e3e1, #f4e3e1 3px, #fbf1f0 3px, #fbf1f0 6px); color: #8d3830; }
.well[data-state="empty"] { border-color: #e3e7df; background: #fafbf8; }
.well[data-state="flag"] { box-shadow: 0 0 0 2px var(--flag); }
.well[aria-pressed="true"] { outline: 2px solid var(--brand); outline-offset: 1px; }
.well__idx { position: absolute; right: 1px; bottom: -1px; font-size: 6.5px; opacity: 0.55; }

/* 孔位标记位（data-mark 可叠加）：图例命中、非匹配淡化、多选、待审批 */
.well[data-mark~="legend"] { box-shadow: 0 0 0 2px var(--info); z-index: 1; }
.well[data-mark~="no-match"] { opacity: 0.28; }
.well[data-mark~="sel"] { outline: 2px solid var(--brand); outline-offset: 2px; background-image: linear-gradient(135deg, rgba(13, 92, 80, 0.18), transparent 60%); }
.well[data-mark~="pend"]::after {
  content: ""; position: absolute; top: -2px; right: -2px; width: 6px; height: 6px;
  border: 1px solid var(--surface); border-radius: 50%; background: var(--flag);
}
/* 扫描未完成时孔位不可点，视觉上压灰但不改色相 */
.plate[data-scanned="0"] .well { cursor: not-allowed; filter: saturate(0.45); }
.plate[data-scanned="0"] .well:hover { transform: none; box-shadow: none; }

.platelegend { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2h); color: var(--ink-3); font-size: var(--fs-2xs); }
.platelegend i { display: inline-block; width: 9px; height: 9px; margin-right: var(--s-1); border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 50%; vertical-align: -1px; }
.plate__meta { display: flex; justify-content: space-between; color: var(--ink-3); font-family: var(--mono); font-size: var(--fs-2xs); }
/* 缩放档：sm 用于侧栏预览、lg 用于全屏浏览；孔位字号随档位走 */
.plate--sm, .plate[data-zoom="sm"] { max-width: 520px; }
.plate--lg, .plate[data-zoom="lg"] { max-width: 780px; }
.plate--sm .well, .plate[data-zoom="sm"] .well { font-size: 7.5px; }
.plate--lg .well, .plate[data-zoom="lg"] .well { font-size: 9.5px; }
.plate--sm .plate__axis, .plate[data-zoom="sm"] .plate__axis { font-size: 9px; }
.plate--lg .plate__axis, .plate[data-zoom="lg"] .plate__axis { font-size: 10.5px; }

/* ── 库位图（冻存管架） ────────────────────────────────── */
/* 孔位图：桌面 10 列；窄屏降到 5 列并允许横滑，避免 14px 孔位被压到 <121px 时撑破卡片 */
.rack { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; padding: var(--s-2); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.rack .well { border-radius: 2px; font-size: var(--fs-2xs); }
.rack__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-1); color: var(--ink-3); font-family: var(--mono); font-size: var(--fs-2xs); }
.cryo-legend { display: flex; flex-wrap: wrap; gap: var(--s-3); color: var(--ink-3); font-size: var(--fs-2xs); }
.cryo-legend i { display: inline-block; width: 9px; height: 9px; margin-right: var(--s-1); border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 2px; vertical-align: -1px; }

/* ── 谱系条 ────────────────────────────────────────────── */
.lineage { display: flex; align-items: center; overflow-x: auto; padding: var(--s-1h) 0; }
.lineage__node { display: flex; flex-direction: column; gap: 1px; padding: var(--s-1) var(--s-2h); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); white-space: nowrap; }
.lineage__node b { font-family: var(--mono); font-size: var(--fs-2xs); font-weight: 500; }
.lineage__node span { color: var(--ink-3); font-size: var(--fs-2xs); }
.lineage__arrow { position: relative; flex: 0 0 16px; width: 16px; height: 1px; margin: 0 var(--s-1h); background: var(--line); }
.lineage__arrow::after { content: ""; position: absolute; top: -2.5px; right: 0; border-top: 3px solid transparent; border-bottom: 3px solid transparent; border-left: 4px solid var(--line); }

/* ── 统一列表页（.page--fill + .listcard）────────────────
   页面标题下直接是「工具条 → 表格 → 分页」；表格主体撑满视口并在内部滚动，
   首列（编号列）横向滚动时固定。仅作用于显式声明 .page--fill 的列表页。 */
.app:has(.page--fill) { height: 100vh; overflow: hidden; }
.app:has(.page--fill) .shell { min-height: 0; }
.view:has(> .page--fill) { display: flex; flex-direction: column; min-height: 0; padding-bottom: var(--sp-page); }
.page--fill { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; width: 100%; }
.page--fill .page-head { flex: 0 0 auto; margin-bottom: var(--s-3); }
.page--fill .page-head__actions { display: none; }
.page--fill .page-sub { max-width: none; }
.listcard { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
.listcard > .tablebar { flex: 0 0 auto; }
.listcard > .tablebar .tablebar__left { flex: 1 1 auto; }
.listcard > .tablebar .tablebar__right { flex: 0 0 auto; }
.listcard__body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--ink-4) var(--surface-3); }
.listcard__body::-webkit-scrollbar { width: 10px; height: 10px; }
.listcard__body::-webkit-scrollbar-track { background: var(--surface-3); }
.listcard__body::-webkit-scrollbar-thumb { border: 2px solid var(--surface-3); border-radius: 6px; background: var(--ink-4); }
.listcard__body::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }
.listcard__body::-webkit-scrollbar-corner { background: var(--surface-3); }
.listcard__body > .tablewrap, .listcard__body > .tblwrap { overflow: visible; min-width: 100%; padding: 0; }
/* 表格按内容取宽、至少铺满容器：列多或长编号时由外层滚动容器出横向滚动条，
   而不是把列压到换行；首列仍由 .tbl--fixed 固定在左侧。 */
.listcard__body .tbl { width: max-content; min-width: 100%; }
/* 双栏列表页：.page--fill + .split（左目录／右侧表），两栏撑满并各自滚动 */
.page--fill > .split { flex: 1 1 auto; align-items: stretch; min-height: 0; }
.page--fill > .split > .card { display: flex; flex-direction: column; min-height: 0; }
.page--fill > .split > .card > .card__body { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow: hidden; }
.page--fill > .split > .card > .card__body > * { flex: 0 0 auto; }
.page--fill > .split > .card > .card__body > .tablewrap { flex: 1 1 auto; min-height: 0; overflow: auto; }
.page--fill > .split > .card > .card__body > div > .tablebar { width: 100%; }
.page--fill > .split > .card > .card__body > div > .tablebar > .tablebar__left { flex: 1 1 auto; }
/* 方案编排抽屉（四个页签：基本信息／编制依据文档／四节点编排／发布检查清单） */
.plan-ed__bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1h); padding-bottom: var(--s-2); margin-bottom: var(--s-2); border-bottom: 1px solid var(--line-soft); }
.plan-ed__bar .btn { flex: 0 0 auto; }
.plan-ed__pane { padding-top: var(--s-2); }
.plan-ed .tabs { margin-bottom: var(--s-2); }
@media (max-width: 900px) {
  /* 窄屏：方案信息回到「标签／取值」两列，避免编号被拆成多行 */
  .plan-ed .kv--2,
  .plan-preview .kv--2 { grid-template-columns: minmax(70px, auto) minmax(0, 1fr); }
}
@media (max-width: 640px) {
  /* 窄屏：表单字段表保持可读宽度，横向滚动在字段块内部 */
  .formdef .tbl { min-width: 420px; }
  .formdef .tablewrap { overflow-x: auto; }
}

/* 表单结构预览：步骤内表单可就地展开字段定义 */
.formdef > summary { margin-top: 2px; color: var(--brand); font-size: var(--fs-2xs); cursor: pointer; list-style-position: inside; }
.formdef > summary:hover { text-decoration: underline; }
.formdef[open] > summary { margin-bottom: var(--s-1); }
.formdef .tablewrap { margin-top: var(--s-1); border: 1px solid var(--line-soft); border-radius: var(--r); }

/* 方案列表：方案行就地展开的版本链子表 */
.plan-caret { display: inline-flex; align-items: center; margin-right: var(--s-1h); color: var(--ink-3); vertical-align: -1px; transition: transform var(--dur-2) var(--ease-out); transform: rotate(-90deg); }
tr[aria-expanded="true"] .plan-caret { transform: none; color: var(--brand); }
tr.plan-vers > td { padding: 0 !important; background: var(--surface-2); }
tr.plan-vers .tablewrap { padding: 0; }
tr.plan-vers .tbl { background: var(--surface); }
.plan-vers__note { padding: var(--s-1h) var(--s-3); }
@media (max-width: 1180px) {
  /* 窄屏：双栏退化为单列、回到文档流滚动，避免两栏被压扁 */
  .app:has(.page--fill > .split) { height: auto; overflow: visible; }
  .page--fill > .split { display: block; }
  .page--fill > .split > .card { display: block; }
  .page--fill > .split > .card + .card { margin-top: var(--sp-gutter); }
  .page--fill > .split > .card > .card__body { display: block; overflow: visible; }
}
.listcard .table-foot {
  display: flex; flex: 0 0 auto; align-items: center; gap: var(--s-2);
  padding: var(--s-2) var(--sp-card, var(--s-7h)); border-top: 1px solid var(--line-soft);
  background: var(--surface); color: var(--ink-3); font-size: var(--fs-xs);
}
.pager { display: inline-flex; align-items: center; gap: 2px; }
.pager button {
  min-width: 26px; height: 24px; padding: 0 6px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--ink-2);
  font-family: var(--mono); font-size: var(--fs-xs); line-height: 1; cursor: pointer;
  transition: border-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out), background var(--dur-2) var(--ease-out);
}
.pager button:hover:not(:disabled) { border-color: var(--brand-dim); color: var(--brand); }
.pager button[aria-current="true"] { border-color: var(--brand); background: var(--brand); color: #fff; }
.pager button:disabled { opacity: 0.42; cursor: not-allowed; }
.pager__gap { padding: 0 2px; color: var(--ink-4); }

/* ── 报告模板 · Word 版面预览 ──────────────────────────── */
.doc-preview { display: flex; flex-direction: column; align-items: center; gap: var(--s-5); padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-3); }
.doc-page-wrap { width: min(100%, 720px); }
.doc-page-label { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-2); color: var(--ink-3); font-size: var(--fs-2xs); letter-spacing: var(--ls-wide); }
.doc-page-label b { color: var(--brand-strong); font-size: var(--fs-xs); }
.doc-page { display: flex; flex-direction: column; min-height: 860px; padding: 48px 56px 32px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-2); color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.75; }
.doc-page__header, .doc-page__footer { display: flex; justify-content: space-between; gap: var(--s-3); color: var(--ink-3); font-size: var(--fs-2xs); }
.doc-page__header { padding-bottom: var(--s-1); border-bottom: 1px solid var(--line); }
.doc-page__footer { margin-top: auto; padding-top: var(--s-1); border-top: 1px solid var(--line); }
.doc-page__body { flex: 1 1 auto; min-height: 0; }
.doc-org { margin-top: 38px; color: var(--ink-3); font-size: var(--fs-xs); letter-spacing: 4px; text-align: center; }
.doc-kind { margin-top: var(--s-2); color: var(--brand); font-size: var(--fs-md); letter-spacing: 6px; text-align: center; }
.doc-title { margin-top: var(--s-2); font-size: 26px; font-weight: 600; line-height: 1.35; letter-spacing: 2px; text-align: center; }
.doc-subtitle { margin-top: var(--s-1); color: var(--ink-3); font-size: var(--fs-sm); letter-spacing: 1px; text-align: center; }
.doc-cover-meta { width: min(100%, 440px); margin: 34px auto 0; border-top: 1px solid var(--line); }
.doc-cover-meta > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); border-bottom: 1px solid var(--line-soft); }
.doc-cover-meta dt, .doc-cover-meta dd { margin: 0; padding: 5px 8px; font-size: var(--fs-xs); }
.doc-cover-meta dt { color: var(--ink-3); }
.doc-cover-meta dd { font-family: var(--mono); }
.doc-stamp { width: min(100%, 440px); margin: 26px auto 0; padding: var(--s-2); border: 1px dashed var(--brand-line); background: var(--brand-tint); color: var(--brand-strong); font-size: var(--fs-2xs); text-align: center; }
.doc-cover-foot { margin-top: 26px; color: var(--ink-3); font-size: var(--fs-2xs); text-align: center; }
.doc-ph { display: inline-block; max-width: 100%; padding: 0 3px; border: 1px dashed var(--brand-line); border-radius: 2px; background: var(--brand-tint); color: var(--brand-strong); font-family: var(--mono); font-size: 0.92em; line-height: 1.4; overflow-wrap: anywhere; }
.doc-section { margin-top: var(--s-4); }
.doc-section__title { display: flex; align-items: center; gap: var(--s-3h); margin: 0 0 var(--s-1); padding-left: 7px; border-left: 3px solid var(--brand); color: var(--ink); font-size: var(--fs-sm); font-weight: 600; }
.doc-section__sub { color: var(--ink-3); font-size: var(--fs-2xs); }
.doc-table { width: 100%; margin-top: var(--s-1); border-collapse: collapse; table-layout: fixed; font-size: var(--fs-2xs); }
.doc-table th, .doc-table td { padding: 4px 6px; border: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.doc-table th { background: var(--surface-2); color: var(--ink-3); font-weight: 500; }
.doc-table .num { text-align: right; }
.doc-line { display: flex; gap: var(--s-2); font-size: var(--fs-2xs); }
.doc-line b { min-width: 64px; color: var(--ink-3); font-weight: 400; }
.doc-loop { margin-top: var(--s-3); padding: var(--s-1) var(--s-2); border: 1px dashed var(--brand-line); background: var(--brand-wash); color: var(--brand-strong); font-size: var(--fs-2xs); }
.doc-drug { margin-top: var(--s-3); padding-top: var(--s-2); border-top: 1px dashed var(--line); }
.doc-drug__head { display: flex; align-items: center; gap: var(--s-2); }
.doc-drug__no { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 18px; border-radius: var(--r); background: var(--brand); color: var(--surface); font-family: var(--mono); font-size: var(--fs-2xs); }
.doc-drug__head b { font-size: var(--fs-sm); }
.doc-chart { width: 100%; height: 62px; margin-top: var(--s-1); color: var(--brand); }
.doc-chart__grid { stroke: var(--line-soft); stroke-width: 1; }
.doc-chart__line { fill: none; stroke: currentColor; stroke-width: 1.6; }
.doc-chart__dot { fill: currentColor; }
.doc-chart-cap { color: var(--ink-3); font-size: var(--fs-2xs); text-align: center; }
.doc-sign { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); margin-top: var(--s-4); font-size: var(--fs-2xs); }
.doc-sign > div { padding: var(--s-1) var(--s-2); border: 1px solid var(--line); }
.doc-sign span { display: block; color: var(--ink-3); }
.doc-terms { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.doc-term { padding: 0 5px; border: 1px solid var(--line); border-radius: var(--r); font-size: var(--fs-2xs); }
.doc-prompt { margin-top: var(--s-5); }
.prompt-block { margin-top: var(--s-2); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.prompt-block__head { display: flex; align-items: center; gap: var(--s-3h); padding: var(--s-1) var(--s-2); border-bottom: 1px solid var(--line-soft); background: var(--surface-2); font-size: var(--fs-xs); font-weight: 500; }
.prompt-block__body { padding: var(--s-2); font-size: var(--fs-xs); line-height: 1.7; }
.prompt-block__body ul { padding-left: 16px; list-style: disc; }
.prompt-block__body li { margin: 2px 0; }
.prompt-block__body code { font-family: var(--mono); font-size: var(--fs-2xs); color: var(--brand-strong); }
.tpl-tabbar { margin: calc(var(--s-2) * -1) 0 var(--s-2); padding: 0; border-bottom: 1px solid var(--line-soft); background: transparent; }
.tpl-tabbar .tabs { padding: 0; border-bottom: 0; }
.tpl-tabbar .tabs__item { padding-top: var(--s-3h); padding-bottom: var(--s-3h); }
.tpl-tabbar .tabs__item:first-child { padding-left: 0; }
.tpl-tabbar .tabs__item:first-child::after { left: 0; }
.tpl-tabbar .tabs__item:focus-visible { outline: none; border-radius: 0; box-shadow: inset 0 -2px 0 var(--brand-line); }
.tabpane[hidden] { display: none; }
.tpl-test { display: flex; flex-direction: column; gap: var(--s-3); }
.tpl-test__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-4); }
.tpl-test__out { min-height: 240px; padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.tpl-test textarea { width: 100%; min-height: 150px; font-family: var(--mono); font-size: var(--fs-2xs); line-height: 1.6; }
.tpl-test__step { display: flex; align-items: flex-start; gap: var(--s-2); padding: var(--s-1) 0; border-bottom: 1px dashed var(--line-soft); font-size: var(--fs-xs); }
.tpl-test__step b { flex: 0 0 auto; min-width: 62px; color: var(--ink-3); font-weight: 400; }
.tpl-test__ok { color: var(--ok); }
.tpl-test__warn { color: var(--flag); }
.pdf-viewer { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-3); }
.pdf-viewer__bar { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-1) var(--s-2); background: var(--ink); color: var(--surface); font-size: var(--fs-2xs); }
.pdf-viewer__bar b { font-family: var(--mono); font-size: var(--fs-xs); font-weight: 500; }
.pdf-viewer__bar .tag { background: var(--surface); color: var(--ink); border-color: transparent; }
.pdf-sheet { display: flex; flex-direction: column; width: min(100%, 640px); min-height: 560px; margin: var(--s-3) auto; padding: 26px 32px 22px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-2); color: var(--ink-2); font-size: var(--fs-2xs); line-height: 1.65; }
.pdf-sheet__head, .pdf-sheet__foot { display: flex; justify-content: space-between; gap: var(--s-2); color: var(--ink-3); font-size: var(--fs-2xs); }
.pdf-sheet__head { padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.pdf-sheet__foot { margin-top: auto; padding-top: 4px; border-top: 1px solid var(--line); }
.pdf-sheet__title { margin-top: var(--s-3); color: var(--ink); font-size: var(--fs-2xl); font-weight: 600; letter-spacing: 1px; text-align: center; }
.pdf-sheet__sub { margin-top: 2px; color: var(--ink-3); font-size: var(--fs-2xs); text-align: center; }
.pdf-sheet__meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px var(--s-4); margin-top: var(--s-3); }
.pdf-sheet__meta span { color: var(--ink-3); }
.pdf-sheet__meta b { font-family: var(--mono); font-weight: 400; }
.pdf-sheet__note { margin-top: var(--s-2); padding: var(--s-1) var(--s-2); border: 1px dashed var(--line); color: var(--ink-3); font-size: var(--fs-2xs); }
.pdf-viewer__foot { padding: var(--s-1) var(--s-2) var(--s-2); color: var(--ink-3); font-size: var(--fs-2xs); text-align: center; }
.pdf-viewer__pages { max-height: 640px; overflow: auto; padding: var(--s-3); }
.pdf-viewer__pages .doc-page-label { display: none; }
.pdf-viewer__pages .doc-page-wrap + .doc-page-wrap { margin-top: var(--s-3); }
.tpl-test__parsed { margin-top: var(--s-2); padding: var(--s-2); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.tpl-test > .row .check { white-space: nowrap; }
.tpl-raw-table { margin-top: var(--s-2); border: 1px solid var(--line); border-radius: var(--r); overflow: auto; background: var(--surface); }
.tpl-raw-table table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: var(--fs-2xs); }
.tpl-raw-table th, .tpl-raw-table td { padding: 3px 5px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; }
.tpl-raw-table th { background: var(--surface-2); color: var(--ink-3); font-weight: 500; white-space: nowrap; }
.tpl-raw-table input[type="text"] { width: 100%; height: 24px; padding: 1px 4px; border: 1px solid transparent; background: transparent; color: var(--ink-2); font-family: var(--mono); font-size: var(--fs-2xs); }
.tpl-raw-table input[type="text"]:focus { border-color: var(--brand-dim); background: var(--surface); }
.tpl-raw-table tr[aria-selected="true"] { background: var(--brand-tint); }
.tpl-raw-table .btn { height: 22px; padding: 0 5px; }
@media (max-width: 900px) {
  .tpl-test__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .doc-page { min-height: 0; padding: 24px 20px; }
  .doc-title { font-size: 21px; }
  .doc-sign { grid-template-columns: minmax(0, 1fr); }
}

/* ── 说明标注（原型模式） ──────────────────────────────── */
[data-anno] { position: relative; }
body.anno-on [data-anno] { outline: 1px dashed rgba(13, 92, 80, 0.45); outline-offset: 2px; cursor: help; }
body.anno-on [data-anno]::after {
  content: attr(data-anno); position: absolute; left: 0; top: calc(100% + var(--s-3h)); z-index: 60;
  width: max-content; max-width: 300px; padding: var(--s-1) var(--s-2);
  border: 1px solid #1d3a33; border-radius: var(--r); background: #102320; color: #e8f1ec;
  font-size: var(--fs-2xs); line-height: var(--lh-relaxed); white-space: normal;
  box-shadow: var(--shadow-2); pointer-events: none;
  opacity: 0; transform: translateY(-2px); transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
}
body.anno-on [data-anno]:hover::after { opacity: 1; transform: none; }
.anno-hint { display: inline-flex; align-items: center; gap: var(--s-3h); padding: var(--s-1) var(--s-2);
  border: 1px dashed #a9cdc2; border-radius: var(--r); background: var(--brand-tint); color: var(--brand-strong); font-size: var(--fs-2xs); }

/* ── 杂项 ──────────────────────────────────────────────── */
.row { display: flex; align-items: center; gap: var(--s-2); }
.row--wrap > * { min-width: 0; }