:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #23272e;
  --ink-soft: #454b54;
  --muted: #8a8f98;
  --faint: #aeb3ba;
  --line: #e7e4dd;
  --line-2: #f0ede7;
  --accent: #2e6b66;
  --accent-weak: #e9f0ee;
  --accent-edge: #cfe0db;
  --link: #345f86;
  --green: #3f7a52;
  --rust: #a85a2a;
  --gold: #8a6d1f;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink); background: var(--bg);
  display: flex; flex-direction: column; height: 100vh;
  font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 顶栏 */
.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 8px 22px;
  min-height: 64px;
  flex-shrink: 0;
}
.brand { font-weight: 600; font-size: 15px; letter-spacing: 1px; color: var(--ink); white-space: nowrap; }
.nav-boards { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; min-width: 0; }
.nav-board {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 40px;
  padding: 4px 7px 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}
.nav-board-title {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1;
  white-space: nowrap;
  padding-right: 9px;
  border-right: 1px solid var(--line);
}
.tabs { display: flex; gap: 3px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { background: none; border: 1px solid transparent; border-radius: 5px; color: var(--muted); font-size: 13px; padding: 4px 9px; min-height: 30px; cursor: pointer; font-family: inherit; white-space: nowrap; flex-shrink: 0; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent); font-weight: 600; border-color: var(--accent-edge); background: var(--accent-weak); }
.search { border: 1px solid var(--line); border-radius: 6px; padding: 6px 11px; font-size: 13px; min-width: 180px; background: var(--surface); color: var(--ink); font-family: inherit; }
.search::placeholder { color: var(--faint); }
.search:focus { outline: none; border-color: var(--accent); }
.compare-btn { margin-left: auto; color: var(--ink-soft); text-decoration: none; font-size: 13px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 6px; white-space: nowrap; }
.compare-btn:hover { border-color: var(--accent); color: var(--accent); }

/* 工具按钮组（天然耐药 / 关系图 / 折点判读 / 生化对比 / 药敏卡对比） */
.tools { display: flex; gap: 5px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tools::-webkit-scrollbar { display: none; }
.tool-btn { color: var(--ink-soft); text-decoration: none; font-size: 13px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 6px; white-space: nowrap; flex-shrink: 0; }
.tool-btn:hover { border-color: var(--accent); color: var(--accent); }
.tool-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-weak); font-weight: 600; }

/* 布局 */
.layout { display: flex; flex: 1; min-height: 0; }
.sidebar { width: 248px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; padding: 14px 12px; font-size: 13px; flex-shrink: 0; }
.main { flex: 1; overflow-y: auto; padding: 30px 40px; }

/* 侧栏分类树 */
.cat-group { margin-bottom: 4px; }
.cat-group-name { color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing: 1px; margin: 12px 0 4px; }
.cat-subgroup { color: var(--ink-soft); font-weight: 500; padding: 3px 6px; margin-top: 2px; }
.collapsible { cursor: pointer; user-select: none; }
.collapsible:hover { color: var(--accent); }
.entry-link { display: block; color: var(--ink-soft); text-decoration: none; padding: 4px 8px 4px 16px; border-radius: 4px; border-left: 2px solid transparent; }
.entry-link:hover { color: var(--ink); background: var(--line-2); }
.entry-link.selected { color: var(--accent); font-weight: 600; border-left-color: var(--accent); }

/* 详情头 */
.detail-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.detail-title { font-size: 23px; font-weight: 600; margin: 0; letter-spacing: .3px; color: var(--ink); }
.badge { color: var(--muted); font-size: 12px; border: 1px solid var(--line); border-radius: 4px; padding: 1px 8px; font-weight: 500; }
.latin { color: var(--muted); font-style: italic; margin: 5px 0 22px; font-size: 14px; }
.abbr { font-family: var(--mono); background: var(--accent-weak); color: var(--accent); font-size: 11.5px; padding: 2px 8px; border-radius: 4px; letter-spacing: .5px; }

/* 机制图 */
.mechanism-fig { margin: 18px 0 10px; }
.mechanism-img { display: block; width: 100%; max-width: 520px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.mechanism-cap { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* 通用小标题 */
.section-title, .morph-title, .biochem-title, .diff-title, .card-drugs-title, .relations-label, .refs-label {
  font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 1.2px; margin-bottom: 8px;
}

/* 文字小节（无卡片框，编辑式分隔） */
.section-card { background: none; border: none; border-top: 1px solid var(--line); padding: 14px 0 0; margin: 0 0 14px; max-width: 700px; }
.section-body { color: var(--ink-soft); line-height: 1.72; white-space: pre-wrap; }

/* 形态 */
.morphology { margin: 22px 0; max-width: 660px; }
.morph-row { font-size: 13.5px; line-height: 1.65; color: var(--ink-soft); margin-top: 6px; }
.morph-tag { display: inline-block; font-size: 11px; color: var(--ink-soft); background: var(--line-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 7px; white-space: nowrap; }
.morph-tag.morph-med { background: var(--accent-weak); border-color: var(--accent-edge); color: var(--accent); }

/* 生化反应 */
.biochem { margin: 22px 0; }
.biochem-rows { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; max-width: 460px; }
.biochem-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 12px; font-size: 13px; }
.biochem-row:nth-child(even) { background: var(--line-2); }
.biochem-key { color: var(--muted); }
.biochem-link { text-decoration: none; }
.biochem-link:hover { text-decoration: underline; color: var(--link); }
.biochem-val { color: var(--ink); font-weight: 600; font-family: var(--mono); }

/* 鉴别 */
.differential { margin: 22px 0; }
.diff-item { border: 1px solid var(--line); border-left: 2px solid var(--accent); border-radius: 6px; padding: 10px 14px; margin-bottom: 8px; max-width: 700px; background: var(--surface); }
.diff-head { margin-bottom: 6px; }
.diff-link { color: var(--link); text-decoration: none; font-weight: 600; }
.diff-link:hover { text-decoration: underline; }
.diff-name { font-weight: 600; color: var(--ink-soft); }
.diff-line { font-size: 13px; line-height: 1.65; color: var(--ink-soft); margin-top: 3px; }
.diff-tag { display: inline-block; font-size: 11px; color: var(--muted); background: var(--line-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 7px; }
.diff-tag.diff-key { background: var(--accent-weak); border-color: var(--accent-edge); color: var(--accent); }

/* 对比 */
.biochem-head, .card-drugs-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; max-width: 460px; }
.cmp-add { background: var(--surface); color: var(--accent); border: 1px solid var(--line); border-radius: 5px; padding: 4px 10px; font-size: 12px; cursor: pointer; white-space: nowrap; font-family: inherit; }
.cmp-add:hover { border-color: var(--accent); background: var(--accent-weak); }
.cmp-search { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; font-size: 13px; margin: 6px 0 8px; font-family: inherit; }
.cmp-search:focus { outline: none; border-color: var(--accent); }
.cmp-pick { padding: 5px 9px; border-radius: 4px; cursor: pointer; color: var(--ink-soft); font-size: 13px; user-select: none; }
.cmp-pick:hover { background: var(--line-2); }
.cmp-pick.sel { color: var(--accent); font-weight: 600; }
.table-scroll { max-width: 100%; overflow-x: auto; padding-bottom: 2px; }
.cmp { border-collapse: collapse; margin-top: 10px; font-size: 13px; min-width: 560px; }
.cmp th, .cmp td { border: 1px solid var(--line); padding: 7px 12px; text-align: left; }
.cmp thead th { background: var(--line-2); color: var(--ink); font-weight: 600; }
.cmp .cmp-col { color: var(--link); text-decoration: none; }
.cmp .cmp-col:hover { text-decoration: underline; }
.cmp .cmp-item { font-weight: 600; color: var(--ink-soft); background: var(--surface); }
.cmp-cell { font-family: var(--mono); }
.cmp tr.cmp-diff td { background: #faf5e6; }
.cmp tr.cmp-diff .cmp-item { background: #f1e8cf; color: #715711; }
.cmp-hint { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* 关联 / 标签 */
.relations { border-top: 1px solid var(--line); margin-top: 26px; padding-top: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12.5px; padding: 3px 10px; border-radius: 4px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); }
.chip:hover { border-color: var(--faint); }
.chip-microbes { color: var(--link); }
.chip-antibiotics { color: var(--green); }
.chip-resistance { color: var(--rust); }
.chip-tests { color: var(--gold); }
.chip-cards { color: #4a6d8c; }
.chip-media { color: #6b4e8a; }
.chip-staining { color: #8a4a6b; }
.chip-biochem-tests { color: #4a7a6b; }
.chip-missing, .chip-plain { color: var(--muted); background: var(--line-2); }

/* 折点表 */
.breakpoints { margin: 22px 0; }
.bp-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.bp-title { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 1.2px; }
.bp-source { font-size: 11px; color: var(--muted); }
.bp-table { border-collapse: collapse; margin-top: 6px; font-size: 13px; min-width: 680px; }
.bp-table th, .bp-table td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.bp-table thead th { background: var(--line-2); color: var(--ink); font-weight: 600; font-size: 11.5px; white-space: nowrap; }
.bp-table .bp-drug { color: var(--ink); min-width: 200px; }
.bp-table .bp-drug strong { color: var(--accent); font-family: var(--mono); font-size: 12px; }
.bp-drug-link { color: var(--link); text-decoration: none; }
.bp-drug-link:hover { text-decoration: underline; }
.bp-table .bp-mic { font-family: var(--mono); color: var(--ink-soft); white-space: nowrap; }
.bp-table .bp-disk { font-family: var(--mono); color: var(--ink-soft); white-space: nowrap; }
.bp-table .bp-comment { color: var(--muted); font-size: 12px; max-width: 240px; }
.bp-table .bp-note { color: var(--muted); font-size: 11px; }
.bp-table tbody tr:hover { background: var(--line-2); }
.bp-foot { font-size: 11.5px; color: var(--muted); margin-top: 8px; }

/* 参考链接 */
.refs { border-top: 1px solid var(--line); margin-top: 26px; padding-top: 18px; }
.ref-link { font-size: 12.5px; padding: 3px 10px; border-radius: 4px; text-decoration: none; background: var(--surface); color: var(--accent); border: 1px solid var(--line); }
.ref-link:hover { border-color: var(--accent); background: var(--accent-weak); }

/* 天然耐药 */
.intrinsic { margin: 20px 0; max-width: 700px; border-left: 2px solid var(--rust); background: #fbf3ef; border-radius: 0 6px 6px 0; padding: 10px 14px; }
.intrinsic-title { font-size: 12px; font-weight: 700; color: var(--rust); letter-spacing: 1.2px; margin-bottom: 5px; }
.intrinsic-body { color: var(--ink-soft); line-height: 1.7; font-size: 13.5px; }

.treatment { margin: 20px 0; max-width: 700px; border-left: 2px solid var(--teal, #2a8a78); background: #eef7f4; border-radius: 0 6px 6px 0; padding: 10px 14px; }
.treatment-title { font-size: 12px; font-weight: 700; color: var(--teal, #2a8a78); letter-spacing: 1.2px; margin-bottom: 5px; }
.treatment-body { color: var(--ink-soft); line-height: 1.7; font-size: 13.5px; }

/* 天然耐药速查（独立模块） */
.intrinsic-group { margin: 18px 0; }
.intrinsic-group-title { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 1.2px; margin-bottom: 8px; }
.intrinsic-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.intrinsic-card { background: var(--surface); border: 1px solid var(--line); border-left: 2px solid var(--rust); border-radius: 6px; padding: 10px 14px; }
.intrinsic-card-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.intrinsic-link { color: var(--link); text-decoration: none; font-weight: 600; font-size: 14px; }
.intrinsic-link:hover { text-decoration: underline; }
.intrinsic-card .latin { margin: 0; font-size: 12px; }

/* 关联关系图 */
.graph-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.graph-ctrl-label { font-size: 12px; color: var(--muted); }
.graph-controls .cmp-add.sel { background: var(--accent-weak); border-color: var(--accent); color: var(--accent); }
.graph-center-info { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 10px; }
.graph-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin: 14px 0; }
.graph-svg { display: block; width: 100%; max-width: 720px; height: auto; margin: 0 auto; }
.graph-svg .graph-edge { opacity: 0; transition: opacity 0.45s ease-out; }
.graph-svg .graph-edge.visible { opacity: 1; }
.graph-svg .graph-edge.reverse.visible { opacity: 0.85; }
.graph-svg .graph-node-inner {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  transform: scale(0);
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease-out;
}
.graph-svg .graph-node-inner.visible { opacity: 1; transform: scale(1); }
.graph-svg .graph-node-inner.center.visible {
  animation: graph-center-pulse 2.8s ease-in-out infinite 0.6s;
}
.graph-svg g[transform]:not(.graph-node-inner) { cursor: pointer; }
.graph-svg g[transform]:not(.graph-node-inner):hover .graph-node-inner,
.graph-svg g[transform]:not(.graph-node-inner):focus-visible .graph-node-inner { transform: scale(1.2); transition: transform 0.2s ease; }
.graph-svg g[transform]:not(.graph-node-inner):focus-visible { outline: none; }
.graph-svg g[transform]:not(.graph-node-inner):focus-visible circle { stroke: var(--ink, #2a2f36); stroke-width: 3.5; }
.graph-svg text { font-family: -apple-system, "PingFang SC", system-ui, sans-serif; pointer-events: none; user-select: none; }
.graph-svg .graph-label { pointer-events: none; }
.graph-svg .graph-label-bg {
  fill: rgba(255,255,255,.88);
  stroke: rgba(212,218,214,.9);
  stroke-width: .8;
}
.graph-svg .graph-label-text {
  paint-order: stroke;
  stroke: rgba(255,255,255,.84);
  stroke-width: 2.4px;
  stroke-linejoin: round;
}
.graph-svg .graph-label.center-label .graph-label-text {
  paint-order: normal;
  stroke: none;
}
.graph-svg .graph-label.secondary {
  opacity: 0;
  transition: opacity .18s ease-out;
}
.graph-svg g[transform]:not(.graph-node-inner):hover .graph-label.secondary { opacity: 1; }
@keyframes graph-center-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}
@media (prefers-reduced-motion: reduce) {
  .graph-svg .graph-edge, .graph-svg .graph-node-inner { transition: none; opacity: 1; transform: none; }
  .graph-svg .graph-node-inner.center.visible { animation: none; }
}
.graph-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin: 10px 0; }
.graph-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.graph-legend-line { display: inline-block; width: 22px; height: 2px; background: #cfe0db; }
.graph-legend-line.dashed { background: repeating-linear-gradient(to right, #e7c9c0 0 4px, transparent 4px 7px); height: 2px; }
.graph-legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; }
.graph-legend-dot.center { background: #2e6b66; }
.graph-legend-dot.l1 { background: #345f86; }
.graph-legend-dot.l2 { background: #8a8f98; }

/* 2 层密图：更宽画布 + 默认淡化连线；悬停聚焦时高亮该节点的关联并显示邻居标签，其余淡出 */
.graph-wrap.graph-dense .graph-svg { max-width: 880px; }
.graph-wrap.graph-dense .graph-edge.visible { opacity: .5; }
.graph-svg.focusing .graph-node-inner { opacity: .16; transition: opacity .2s ease; }
.graph-svg.focusing .gnode.adj .graph-node-inner { opacity: 1; }
.graph-svg.focusing .graph-edge.visible { opacity: .05; }
.graph-svg.focusing .graph-edge.visible.adj { opacity: 1; }
.graph-svg.focusing .gnode.adj .graph-label.secondary { opacity: 1; }
.graph-svg.focusing .gnode.adj .graph-label-bg { fill: rgba(255,255,255,.97); }
.graph-svg.focusing .graph-node-inner.center { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .graph-svg .graph-edge, .graph-svg .graph-node-inner, .graph-svg .graph-node-inner.center {
    animation: none; opacity: 1; transform: none;
  }
}

/* 折点独立查询 + MIC 判读 */
.bp-filters { margin: 12px 0 16px; }
.bp-group { margin: 18px 0; }
.bp-group-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.bp-group-list { display: flex; flex-direction: column; gap: 2px; }
.bp-judge-form { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; margin: 16px 0; max-width: 560px; }
.bp-judge-row { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.bp-judge-row label { width: 50px; color: var(--muted); font-size: 13px; }
.bp-select { flex: 1; border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; font-size: 13px; font-family: inherit; background: var(--surface); color: var(--ink); }
.bp-select:focus { outline: none; border-color: var(--accent); }
.bp-judge-result { margin: 16px 0; }
.bp-judge-bp { font-size: 13px; color: var(--muted); margin-bottom: 10px; font-family: var(--mono); }
.bp-verdict { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 8px; border: 1px solid var(--line); }
.bp-verdict.v-s { background: #edf6ef; border-color: #b6d9bf; }
.bp-verdict.v-i { background: #fff7e6; border-color: #e8cf8e; }
.bp-verdict.v-r { background: #fdecea; border-color: #e8b8b3; }
.bp-verdict.v-unknown { background: var(--line-2); }
.bp-verdict-tag { font-size: 22px; font-weight: 700; padding: 4px 14px; border-radius: 4px; background: var(--surface); }
.bp-verdict.v-s .bp-verdict-tag { color: var(--green); }
.bp-verdict.v-i .bp-verdict-tag { color: var(--gold); }
.bp-verdict.v-r .bp-verdict-tag { color: var(--rust); }
.bp-verdict.v-unknown .bp-verdict-tag { color: var(--muted); }
.bp-verdict-reason { font-size: 13.5px; color: var(--ink-soft); }
.bp-judge-note { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.6; }

/* 异常药敏 / 修正规则 */
.ast-disclaimer { max-width: 760px; margin: 8px 0 16px; }
.ast-filter-controls { align-items: stretch; gap: 5px; }
.ast-filter-controls .cmp-add { flex: 1 1 auto; min-width: 72px; }
.ast-group { margin: 20px 0; }
.ast-group-title { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 1.2px; margin-bottom: 8px; }
.ast-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; max-width: 1120px; }
.ast-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 13px 15px; box-shadow: 0 1px 0 rgba(20,24,28,.02); }
.ast-card-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 9px; }
.ast-title { margin: 1px 0 0; font-size: 15px; line-height: 1.45; color: var(--ink); font-weight: 650; letter-spacing: 0; }
.ast-level { flex: 0 0 auto; font-size: 11px; font-weight: 700; line-height: 1; border: 1px solid var(--line); border-radius: 4px; padding: 5px 7px; color: var(--ink-soft); background: var(--line-2); white-space: nowrap; }
.ast-critical { color: #8b3d28; background: #fbefe8; border-color: #edcbb8; }
.ast-review { color: #6d5a13; background: #fbf5df; border-color: #e6d99d; }
.ast-limit { color: #345f86; background: #edf3f8; border-color: #c9d9e8; }
.ast-line { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 10px; margin: 7px 0; line-height: 1.65; }
.ast-line-label { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .8px; }
.ast-line-text { color: var(--ink-soft); font-size: 13.5px; }
.ast-tags { margin-top: 10px; gap: 5px; }

/* 药敏卡-包含药物 */
.card-drugs { margin: 22px 0; }

/* 搜索结果 */
.search-head { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.search-list { display: flex; flex-direction: column; gap: 6px; max-width: 700px; }
.search-item { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 9px 13px; text-decoration: none; color: var(--ink); }
.search-item:hover { border-color: var(--accent); }
.search-summary { display: block; color: var(--muted); font-size: 12px; margin: 3px 0 0 48px; line-height: 1.45; }
.tag { font-size: 10.5px; padding: 1px 7px; border-radius: 3px; margin-right: 8px; border: 1px solid var(--line); color: var(--muted); }
.tag-microbes { color: var(--link); }
.tag-antibiotics { color: var(--green); }
.tag-resistance { color: var(--rust); }
.tag-tests { color: var(--gold); }
.tag-cards { color: #4a6d8c; }
.tag-media { color: #6b4e8a; }
.tag-staining { color: #8a4a6b; }
.tag-biochem-tests { color: #4a7a6b; }

/* 空状态 */
.empty { color: var(--muted); padding: 48px 0; text-align: center; }
.empty-sm { color: var(--muted); font-size: 13px; }

/* 汉堡按钮 / 抽屉遮罩（桌面端隐藏） */
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); font-size: 16px; line-height: 1; padding: 5px 10px; cursor: pointer; font-family: inherit; }
.nav-backdrop { display: none; }

/* ===== 移动端 ===== */
@media (max-width: 760px) {
  .topbar {
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 8px 10px;
    padding: 8px 12px;
    padding-top: max(8px, env(safe-area-inset-top));
  }
  .menu-btn { display: inline-flex; grid-column: 1; grid-row: 1; }
  .brand { grid-column: 2; grid-row: 1; font-size: 14px; }
  .search { grid-column: 3; grid-row: 1; min-width: 0; width: 100%; }
  .nav-boards { grid-column: 1 / -1; grid-row: 2; display: flex; flex-direction: column; gap: 8px; }
  .nav-board { height: auto; min-height: 44px; align-items: flex-start; flex-direction: column; gap: 6px; padding: 8px 10px; }
  .nav-board-title { width: 100%; padding: 0 0 6px; border-right: 0; border-bottom: 1px solid var(--line); }
  .tools, .tabs { width: 100%; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { min-height: 30px; }

  .layout { position: relative; }
  .sidebar { position: absolute; z-index: 40; top: 0; left: 0; bottom: 0; width: 84%; max-width: 300px; transform: translateX(-100%); transition: transform .24s ease; box-shadow: 2px 0 16px rgba(15,18,22,.18); }
  body.nav-open .sidebar { transform: translateX(0); }
  .nav-backdrop { display: block; position: absolute; inset: 0; z-index: 35; background: rgba(15,18,22,.35); opacity: 0; pointer-events: none; transition: opacity .24s ease; }
  body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
  .main { padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); }
  .detail-title { font-size: 20px; }
  .entry-link, .cmp-pick, .tab { min-height: 32px; }
  /* 表格瘦身：折点表 / 对比表在小屏更紧凑，尽量不横向溢出、行高更低 */
  .bp-table, .cmp { min-width: 0; width: 100%; font-size: 10.5px; table-layout: fixed; }
  .bp-table th, .bp-table td { padding: 3px 4px; word-break: break-word; }
  .bp-table thead th { font-size: 9.5px; white-space: normal; }
  .bp-table .bp-drug { min-width: 0; width: 38%; }
  .bp-table .bp-drug strong { font-size: 9.5px; }
  .bp-table .bp-mic, .bp-table .bp-disk { white-space: normal; font-size: 10px; }  /* S/I/R 竖排，列更窄 */
  .bp-table .bp-comment { width: 24%; font-size: 9px; }
  .bp-source, .bp-foot { font-size: 10.5px; }
  .cmp th, .cmp td { padding: 4px 6px; }
  .cmp .cmp-item { font-size: 10.5px; }
  .search-summary { margin-left: 0; }
  .ast-list { grid-template-columns: 1fr; }
  .ast-card { padding: 12px; }
  .ast-card-head { flex-direction: column; gap: 7px; }
  .ast-line { grid-template-columns: 1fr; gap: 1px; margin: 9px 0; }
}

@media (max-width: 1120px) and (min-width: 761px) {
  .topbar { gap: 10px; padding: 8px 14px; }
  .tab { padding: 4px 8px; }
  .search { min-width: 150px; }
}

/* 页脚免责声明 + 关于页 */
.site-footer { max-width: 1180px; margin: 8px auto 0; padding: 14px 22px 26px; border-top: 1px solid var(--line); color: var(--muted); }
.footer-disclaimer { font-size: 12px; line-height: 1.7; margin: 0 0 6px; }
.footer-disclaimer strong { color: var(--rust); }
.footer-links { font-size: 12px; margin: 0; }
.footer-links a { color: var(--link); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.about-card { max-width: 760px; margin: 16px 0; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-left: 2px solid var(--teal, #2a8a78); border-radius: 0 6px 6px 0; }
.about-h { font-size: 14px; font-weight: 700; color: var(--ink); margin: 0 0 8px; }
.about-p { font-size: 13.5px; line-height: 1.8; color: var(--ink-soft); margin: 0 0 6px; }
.about-p:last-child { margin-bottom: 0; }

/* 品牌副标题（主名"知微" + 小字"微生物速查"） */
.brand-sub { font-weight: 400; font-size: 11px; letter-spacing: .5px; color: var(--muted); margin-left: 8px; }
@media (max-width: 600px) { .brand-sub { display: none; } }
