@import url("/static/fonts/inter.css");

/* 本地 Material Symbols 图标字体，避免外网依赖 */
@font-face {
  font-family: "Material Symbols Outlined";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("/static/fonts/MaterialSymbolsOutlined.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --background: #f8fafc;
  --surface: #ffffff;
  --surface-low: #f3f3fb;
  --surface-mid: #ededf5;
  --surface-high: #e7e7ef;
  --text: #191b21;
  --muted: #424752;
  --subtle: #737783;
  --line: #c3c6d3;
  --line-soft: #e2e2ea;
  --primary: #003778;
  --primary-dark: #00234f;
  --primary-ui: #0a4da1;
  --primary-soft: #e0e7ff;
  --success: #2d8a5e;
  --warning: #d97706;
  --critical: #dc2626;
  --slate: #334155;
  --radius: 4px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

[hidden] {
  display: none !important;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--background);
}

a { color: var(--primary-ui); text-decoration: none; }
a:hover { text-decoration: underline; }

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-size: 20px;
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}

/* 本地 SVG 图标：与 material-symbols-outlined 对齐 */
.local-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  vertical-align: middle;
  object-fit: contain;
  flex-shrink: 0;
}
.local-icon--strain { color: #2563eb; }
.local-icon--metabolite { color: #00897b; }
.local-icon--disease { color: #dc2626; }

#app {
  min-height: 100vh;
  width: 100%;
}

.app-shell {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
}

.content-shell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: visible;
}

.app-nav {
  position: fixed;
  top: 12px;
  left: 24px;
  right: 24px;
  width: auto;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(37, 49, 72, 0.96), rgba(15, 23, 42, 0.94)),
    rgba(15, 23, 42, 0.96);
  color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08),
    0 18px 48px rgba(15, 23, 42, 0.28);
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 0;
  border-bottom: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  overflow: hidden;
  text-decoration: none;
}

.brand-mark img {
  width: 27px;
  height: 27px;
  display: block;
  object-fit: contain;
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-sub {
  margin-top: 3px;
  color: var(--subtle);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}

.app-nav nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  padding: 6px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.84);
  transition: 160ms ease;
  white-space: nowrap;
}

.nav-link .material-symbols-outlined {
  color: inherit;
  font-size: 17px;
  line-height: 1;
}

.nav-link b {
  display: block;
  color: inherit;
  font-size: 12px;
  line-height: 1;
}

.nav-link:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  text-decoration: none;
}

.nav-link.active {
  border-color: rgba(255, 255, 255, 0.36);
  background: #c2410c;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(194, 65, 12, 0.3);
}

.top-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}

.app-main {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  padding: 82px 24px 36px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.page-toolbar,
.entity-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin-bottom: 10px;
}

.entity-toolbar {
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}

.entity-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.entity-actions .button {
  min-height: 38px;
}

.entity-actions .button.ok {
  border-color: rgba(22, 163, 74, 0.3);
  background: rgba(22, 163, 74, 0.1);
  color: var(--success);
}

.entity-mode-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface-low);
}

.entity-mode-tabs a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 5px 13px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.entity-mode-tabs a.active {
  background: var(--primary);
  color: #fff;
}

.page-head > div:first-child {
  min-width: 0;
}

.page-head h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.page-head p,
.section-desc,
.muted {
  margin: 0;
  color: var(--subtle);
  line-height: 1.6;
}

.eyebrow,
.stat-label,
.analysis-label {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.page-actions,
.actions,
.doc-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.page-actions {
  justify-content: flex-end;
  flex: 0 1 auto;
  max-width: none;
}

.page-actions select {
  width: auto;
  min-width: 180px;
}

.page-actions .actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.panel,
.card,
.chart-card,
.report-document {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
  min-width: 0;
}

.panel,
.chart-card,
.report-document {
  padding: 16px;
  min-width: 0;
}

.card {
  padding: 14px;
}

.panel h2,
.chart-card h2,
.report-document h2,
.chart-title {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.35;
  font-weight: 700;
}

.panel > table,
.report-document table,
.chart-card table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

svg,
canvas {
  max-width: 100%;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.stack,
.demo-paths,
.focus-list,
.action-grid,
.evidence-panel,
.flow,
.science-list,
.hotspot-grid {
  display: grid;
  gap: 12px;
}

.grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
  min-width: 0;
}

.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.dashboard { grid-template-columns: minmax(0, 1fr) minmax(300px, 0.36fr); }
.grid.search-layout { grid-template-columns: minmax(240px, 280px) minmax(0, 1fr); align-items: start; }
.grid.detail-layout { grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr); align-items: start; }
.grid.report-layout { grid-template-columns: minmax(220px, 250px) minmax(0, 1fr); align-items: start; }

.home-top-row {
  display: grid;
  grid-template-columns: minmax(210px, 0.92fr) minmax(250px, 1.08fr) minmax(190px, 0.7fr);
  gap: 12px;
  align-items: stretch;
  margin-bottom: 18px;
  min-width: 0;
}

.home-data-section,
.home-insight-section,
.home-flow-section {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  min-width: 0;
}

.home-data-section {
  background: linear-gradient(180deg, #f4f8ff 0%, #ffffff 100%);
}

.home-insight-section {
  background: linear-gradient(180deg, #f5fbf7 0%, #ffffff 100%);
}

.home-flow-section {
  background: linear-gradient(180deg, #fff8ef 0%, #ffffff 100%);
}

.home-top-row > * {
  margin-bottom: 0;
}

.home-insight-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.home-factor-section {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #ebebeb;
}

.home-factor-section > .topology-head {
  margin-bottom: 12px;
}

.home-factor-overview {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.home-vfdb-category-panel {
  margin-bottom: 18px;
  background: linear-gradient(180deg, #fff7fb 0%, #ffffff 100%);
}

.home-vfdb-category-panel > .topology-head {
  margin-bottom: 12px;
}

.home-vfdb-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.home-vfdb-category-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
  color: var(--text);
}

.home-vfdb-category-card:hover {
  border-color: var(--primary-ui);
  text-decoration: none;
}

.home-vfdb-category-card > div:first-child {
  display: grid;
  gap: 3px;
}

.home-vfdb-category-card b {
  color: var(--primary);
  overflow-wrap: anywhere;
}

.home-vfdb-category-card span,
.home-vfdb-category-card p {
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.45;
}

.home-vfdb-category-card p {
  margin: 0;
}

.home-data-section .stat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 0;
}

.home-data-section .stat-card {
  min-height: 74px;
  padding: 10px;
  background: var(--surface);
}

.home-data-section .stat-value {
  margin-top: 5px;
  font-size: 20px;
}

.home-data-section .stat-sub {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.2;
  text-transform: uppercase;
}

.home-insight-grid .chart-title,
.home-data-section h2,
.home-insight-section h2,
.home-flow-section h2,
.home-factor-section h2,
.home-vfdb-category-panel h2,
.topology-panel h2 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 20px;
  line-height: 1.3;
  font-weight: 800;
}

.home-insight-grid .panel h2 {
  font-size: 18px;
}

.home-insight-section .chart-card {
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

.home-insight-section .bar-chart {
  gap: 6px;
}

.home-insight-section .bar-row {
  grid-template-columns: minmax(86px, 120px) minmax(0, 1fr) 58px;
  gap: 8px;
}

.home-insight-section .bar-track {
  height: 7px;
}

.home-insight-section .bar-label,
.home-insight-section .bar-value {
  font-size: 11px;
}

.home-flow-section .timeline {
  gap: 10px;
  margin-top: 10px;
}

.home-flow-section .timeline b {
  font-size: 13px;
}

.home-flow-section .timeline p {
  font-size: 11px;
  line-height: 1.35;
}

.home-data-section p,
.home-insight-section p,
.home-flow-section p,
.home-insight-grid p,
.home-factor-section p,
.home-vfdb-category-panel p,
.topology-panel p {
  font-size: 13px;
  line-height: 1.55;
}

.home-factor-section small,
.home-vfdb-category-panel small {
  font-size: 12px;
  line-height: 1.5;
}

.screening-layout {
  display: grid;
  grid-template-columns: minmax(220px, 240px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.candidate-pool-panel {
  margin-bottom: 12px;
  padding: 12px;
}

.candidate-pool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.candidate-pool-head span,
.candidate-pool-panel p {
  margin: 0;
  color: var(--subtle);
  font-size: 13px;
}

.candidate-pool-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 8px;
}

.candidate-pool-table-frame {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.candidate-pool-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  table-layout: fixed;
  background: var(--surface);
}

.candidate-pool-table th,
.candidate-pool-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
  line-height: 1.4;
}

.candidate-pool-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--surface-low);
}

.candidate-pool-table tr:last-child td {
  border-bottom: 0;
}

.candidate-pool-table tr.scored td:first-child {
  border-left: 4px solid var(--success);
}

.candidate-pool-table th:nth-child(1),
.candidate-pool-table td:nth-child(1) {
  width: 24%;
}

.candidate-pool-table th:nth-child(2),
.candidate-pool-table td:nth-child(2) {
  width: 22%;
}

.candidate-pool-table th:nth-child(3),
.candidate-pool-table td:nth-child(3) {
  width: 10%;
}

.candidate-pool-table th:nth-child(4),
.candidate-pool-table td:nth-child(4) {
  width: 34%;
}

.candidate-pool-table th:nth-child(5),
.candidate-pool-table td:nth-child(5) {
  width: 10%;
  text-align: right;
}

.candidate-pool-title {
  display: inline-grid;
  min-width: 0;
  max-width: 100%;
  color: var(--text);
  text-decoration: none;
}

.candidate-pool-title b,
.candidate-pool-type,
.candidate-pool-table .id-mono {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-pool-type {
  display: block;
  margin-bottom: 2px;
  color: var(--subtle);
  font-size: 11px;
  text-transform: uppercase;
}

.candidate-pool-total b {
  width: 44px;
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius);
  background: rgba(22, 163, 74, 0.09);
  color: var(--primary);
  font-family: "JetBrains Mono", monospace;
}

.candidate-pool-actions-cell button {
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.candidate-pool-actions-cell button:hover {
  border-color: rgba(220, 38, 38, 0.28);
  color: var(--critical);
}

.candidate-pool-item {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(0, 1.2fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.candidate-pool-item.scored {
  border-color: rgba(22, 163, 74, 0.28);
  background: rgba(22, 163, 74, 0.06);
}

.candidate-pool-item a {
  display: inline-grid;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.candidate-pool-item b,
.candidate-pool-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-pool-item span {
  color: var(--subtle);
  font-size: 11px;
}

.candidate-pool-score {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.candidate-pool-score > b {
  width: 38px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: #fff;
  color: var(--primary);
  font-family: "JetBrains Mono", monospace;
}

.candidate-pool-score .score-breakdown {
  min-width: 0;
}

.candidate-pool-unscored {
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff;
  color: var(--subtle);
  font-size: 12px;
  width: fit-content;
}

.candidate-pool-item button {
  min-height: 24px;
  padding: 2px 7px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.screening-sidebar {
  gap: 10px;
}

.screening-page {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.screening-command-bar {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  align-items: center;
  padding-bottom: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.screening-command-bar::-webkit-scrollbar {
  display: none;
}

.screening-command-bar .eyebrow {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.screening-tabs {
  position: relative;
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  align-items: flex-end;
  flex: 0 0 auto;
  align-self: flex-end;
  min-height: 40px;
  padding: 0 4px;
  z-index: 1;
}

.screening-tabs::after {
  content: "";
  display: none;
}

.screening-tab {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  min-width: 84px;
  min-height: 36px;
  margin: 0;
  padding: 0 18px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  border: 0;
  border-radius: 10px 10px 0 0;
  z-index: 1;
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.34, 1.3, 0.64, 1),
              background 0.22s, color 0.22s, box-shadow 0.25s;
}

.screening-tab::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%) scaleX(0);
  width: 60%;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--primary, #2563eb);
  transition: transform 0.3s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.screening-tab:hover {
  background: rgba(37, 99, 235, 0.06);
  color: var(--primary-ui);
  text-decoration: none;
  transform: translateY(-1px);
}

.screening-tab.active {
  background: rgba(37, 99, 235, 0.1) !important;
  color: var(--primary, #2563eb) !important;
  font-weight: 700 !important;
  transform: translateY(-4px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.1),
              0 1px 0 rgba(37, 99, 235, 0.15) inset;
}

.screening-tab.active::after {
  transform: translateX(-50%) scaleX(1);
}

.screening-inline-filter {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 88px 82px 92px 92px;
  gap: 8px;
  align-items: end;
  flex: 1 0 720px;
  min-width: 0;
}

.screening-inline-filter > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.screening-inline-filter input {
  min-height: 32px;
  padding: 6px 10px;
}

.screening-method-link {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 6px 10px;
  white-space: nowrap;
}

.species-overview-grid {
  display: grid;
  grid-template-columns: minmax(min(100%, 780px), 1fr) minmax(260px, clamp(280px, 24vw, 360px));
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
  min-width: 0;
}

.strain-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.28fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
  min-width: 0;
}

.strain-integrated-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.strain-integrated-grid article {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-low);
  box-sizing: border-box;
}

.strain-integrated-grid h3 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  padding-bottom: 5px;
  border-bottom: 1px dashed var(--line-soft);
}

/* ============================================================
   Detail Page · 统一纵向节奏（Strain / Species / Genome）
   
   目标：
   - 所有 panel 一致的圆角 / 边框 / 标题样式
   - panel 之间统一 14px 间距
   - 子网格列统一最小高度，视觉平衡
   - 列表行统一高度与内边距
   ============================================================ */

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 0 16px;
  width: 100%;
  min-width: 0;
}

/* 统一 panel 外观 */
.stack > .panel,
.stack > section.panel,
.stack > section.result-shell {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  overflow: hidden;
}

/* 统一的 panel 标题栏 —— result-toolbar 或 section-head 都用同一套 */
.stack .result-toolbar,
.stack .panel > .section-head,
.stack .panel.result-shell > .result-toolbar {
  padding: 10px 14px;
  background: #fbfdff;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 0;
}

.stack .result-toolbar h2,
.stack .section-head h2 {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.03em;
  margin: 0;
  line-height: 1.35;
}

.stack .section-head p {
  margin: 4px 0 0;
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.45;
}

/* 统一 body 子元素的内容内边距 */
.stack .panel > :not(.result-toolbar):not(.section-head),
.stack .panel.result-shell > :not(.result-toolbar):not(.section-head) {
  padding: 14px 18px;
}

/* panel 内部的 p.section-desc */
.stack .panel .section-desc {
  padding: 0 14px 10px;
  margin: 4px 0 0;
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.5;
}

/* ===== Entity Health 紧凑卡片 ===== */
.entity-health-panel {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}

.stack .entity-health-panel > .entity-health-compact {
  padding: 10px 14px;
  background: var(--surface-low);
  border-bottom: 1px solid var(--line-soft);
  display: grid;
  grid-template-columns: minmax(160px, 0.45fr) minmax(0, 1.55fr);
  gap: 12px;
  align-items: center;
}

.stack .entity-health-panel > .entity-health-review {
  padding: 10px 14px;
  display: grid;
  gap: 6px;
}

.stack .entity-health-review article {
  padding: 6px 9px;
  background: var(--surface-low);
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  font-size: 12px;
  margin: 0;
  line-height: 1.4;
}

/* ===== 外部标准化证据（单列 · 流式布局）===== */
.stack .external-standard-panel .external-standard-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 14px 12px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.stack .external-standard-panel .external-standard-grid > article {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-low);
  min-width: 0;
  box-sizing: border-box;
}

.stack .external-subtitle {
  margin: 10px 0 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stack .external-subtitle:first-child {
  margin-top: 2px;
}

.stack .external-standard-grid h3 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.stack .external-mini-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: 8px;
  border-left: 2px solid var(--line-soft);
  padding-left: 12px;
}

.stack .external-mini-list.identity-list {
  border-left: none;
  margin-left: 0;
  padding-left: 20px;
}

.stack .external-mini-list.identity-list .external-mini-row {
  padding-left: 0;
}

.stack .external-mini-list.identity-list .external-mini-row::before {
  display: none;
}

.stack .external-mini-list.identity-list .external-mini-row b {
  font-size: 10.5px;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.stack .external-mini-list.identity-list .external-mini-row small {
  font-size: 12px;
  color: var(--ink);
  font-weight: 500;
  margin-top: 1px;
}

.stack .external-mini-row {
  padding: 5px 0 5px 18px;
  position: relative;
  font-size: 11.5px;
  line-height: 1.4;
  min-width: 0;
  border: none;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
}

.stack .external-mini-row:last-child {
  border-bottom: none;
}

.stack .external-mini-row::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 11px;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--line-soft);
}

.stack .external-mini-row b {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
}

.stack .external-mini-row small {
  display: block;
  color: var(--subtle);
  font-size: 10.5px;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.stack .external-source-strip,
.stack .external-count-pills,
.stack .external-gap-summary {
  padding: 8px 14px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.stack .external-source-strip.compact {
  padding: 6px 14px 8px;
  gap: 4px;
}

.stack .external-source-strip .pill,
.stack .external-count-pills .pill,
.stack .external-gap-summary .pill {
  padding: 2px 7px;
  font-size: 10.5px;
  border-radius: 999px;
  background: var(--surface-low);
  border: 1px solid var(--line-soft);
  color: var(--slate);
  font-weight: 500;
  letter-spacing: 0;
}

.stack .external-source-strip .pill.warn,
.stack .external-gap-summary .pill.warn {
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.25);
  color: var(--warning-text);
}

.stack .external-source-strip .pill.ok,
.stack .external-gap-summary .pill.ok {
  background: rgba(22, 163, 74, 0.06);
  border-color: rgba(22, 163, 74, 0.25);
  color: var(--success-text);
}

.stack .external-gap-summary {
  margin-top: 4px;
  padding-top: 4px;
}

.stack .pill.micro {
  padding: 0 5px;
  font-size: 10px;
  font-weight: 500;
  border-radius: 999px;
  background: var(--surface-low);
  border: 1px solid var(--line-soft);
  color: var(--subtle);
  margin-left: auto;
}

.stack .empty.compact.inline {
  padding: 4px 8px;
  font-size: 10.5px;
  color: var(--subtle);
  background: var(--surface);
  border: 1px dashed var(--line-soft);
  border-radius: 5px;
}

/* ===== 培养条件、形态与表型（单列 · 流式列表）===== */
.stack .strain-culture-phenotype-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 14px 12px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* ===== 菌株背景资料（bacdive）===== */
.stack .strain-background-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  padding: 12px 14px;
}

.stack .strain-bg-block {
  background: var(--surface-low);
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stack .strain-bg-block.strain-bg-wide {
  grid-column: 1 / -1;
}

.stack .strain-bg-block > h3 {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--line-soft);
}

.stack .strain-bg-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px 12px;
  padding: 12px 14px;
  min-width: 0;
}

.stack .strain-bg-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px 10px;
  min-width: 0;
}

.stack .strain-bg-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.5;
  padding: 6px 8px;
  background: var(--surface);
  border-radius: 6px;
  border: 1px solid var(--line-soft);
}

.stack .strain-bg-field span {
  color: var(--subtle);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.stack .strain-bg-field b {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.stack .strain-bg-inline-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.stack .strain-bg-inline-grid > div {
  min-width: 0;
  box-sizing: border-box;
}

.stack .strain-bg-inline-grid > div > h4 {
  margin: 0 0 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--slate);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stack .strain-bg-inline-grid ul,
.stack .ref-list {
  margin: 0;
  padding-left: 16px;
}

.stack > .panel > .ref-list,
.stack > section.panel > .ref-list,
.stack > section.result-shell > .ref-list {
  margin: 0;
  padding: 12px 14px 12px 32px;
}

.stack .strain-bg-inline-grid li,
.stack .ref-list li {
  margin-bottom: 3px;
  line-height: 1.5;
  font-size: 12px;
  color: var(--slate);
  overflow-wrap: anywhere;
}

.stack .ref-list > li > b {
  display: block;
  font-weight: 600;
  color: var(--ink);
  font-size: 12.5px;
}

.stack .ref-list small {
  display: inline-block;
  margin-right: 10px;
  font-size: 11px;
  color: var(--subtle);
}

/* ===== 因子覆盖 / KEGG 模块线索（单列 · 流式布局）===== */
.stack .strain-factor-modules-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px;
  width: 100%;
  box-sizing: border-box;
}

.stack .related-genome-context {
  margin-top: 14px;
  border-top: 1px solid var(--line-soft);
  padding: 14px;
  background: var(--surface-muted);
}

.stack .related-genome-context h3,
.stack .related-genome-context h4 {
  margin: 0;
}

.stack .related-genome-metrics,
.stack .related-genome-columns {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.stack .related-genome-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  color: var(--subtle);
  font-size: 12px;
}

.stack .related-genome-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stack .related-genome-columns > div {
  min-width: 0;
}

.stack .related-genome-columns p {
  margin: 6px 0 0;
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.55;
}

.stack .related-genome-boundary {
  margin: 12px 0 0;
}

@media (max-width: 720px) {
  .stack .related-genome-metrics,
  .stack .related-genome-columns {
    grid-template-columns: 1fr;
  }
}

.stack .strain-factor-modules-grid > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-low);
  box-sizing: border-box;
}

.stack .strain-factor-modules-grid > div > h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  padding-bottom: 5px;
  border-bottom: 1px dashed var(--line-soft);
}

.stack .factor-coverage-list,
.stack .kegg-module-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.stack .factor-row {
  min-width: 0;
  padding: 5px 9px;
  background: var(--surface-low);
  border: 1px solid var(--line-soft);
  border-radius: 7px;
}

.stack .factor-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  min-width: 0;
}

.stack .factor-row-head b {
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.stack .factor-count-pill {
  flex-shrink: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  background: rgba(36, 87, 255, 0.10);
  color: var(--primary-ui);
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.stack .factor-track {
  height: 5px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  overflow: hidden;
}

.stack .factor-fill {
  height: 100%;
  background: linear-gradient(90deg, #2457ff, #7c9bff);
  border-radius: 999px;
}

.stack .kegg-row {
  padding: 6px 10px;
  background: var(--surface-low);
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  min-width: 0;
}

.stack .kegg-row.high {
  background: rgba(15, 118, 110, 0.07);
  border-color: rgba(15, 118, 110, 0.28);
}

.stack .kegg-row.mid {
  background: rgba(184, 134, 11, 0.07);
  border-color: rgba(184, 134, 11, 0.28);
}

.stack .kegg-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
  min-width: 0;
}

.stack .kegg-row-head b {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.stack .kegg-row-head small {
  flex-shrink: 0;
  font-size: 10.5px;
}

.stack .kegg-desc {
  margin: 1px 0 4px;
  font-size: 11.5px;
  color: var(--slate);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.stack .kegg-row-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--subtle);
}

.stack .kegg-row-meta b {
  color: var(--ink);
  font-weight: 600;
}

.stack .kegg-row .factor-fill {
  background: linear-gradient(90deg, #0f766e, #34d399);
}

.stack .kegg-row.mid .factor-fill {
  background: linear-gradient(90deg, #b45309, #f59e0b);
}

.stack .kegg-row.low .factor-fill {
  background: linear-gradient(90deg, #64748b, #94a3b8);
}

/* ===== 关联 Genome ===== */
.stack .strain-genome-table {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-soft);
}

.stack .strain-genome-row {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(160px, 1.4fr) minmax(100px, 0.7fr) minmax(100px, 0.5fr) minmax(180px, 1.2fr);
  align-items: start;
  gap: 10px;
  min-width: 0;
  padding: 5px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.stack .strain-genome-row > div {
  min-width: 0;
  padding: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.4;
}

.stack .strain-genome-row > div a {
  font-weight: 600;
  font-size: 12px;
}

.stack .strain-genome-row > div small {
  display: block;
  color: var(--subtle);
  font-size: 10.5px;
  margin-top: 1px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.stack .strain-genome-head > div {
  background: transparent;
  color: var(--subtle);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stack .strain-genome-row:not(.strain-genome-head):hover {
  background: #fbfdff;
}

.stack .strain-genome-row-external {
  background: #fbfdff;
  border-left: 3px solid var(--line-soft);
}

.stack .strain-genome-row-external > div:first-child a::after {
  content: "External candidate";
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef2ff;
  color: #334155;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}

.stack .strain-genome-row > div:nth-child(2) {
  color: var(--slate);
  font-style: italic;
}

.stack .strain-safety-cell {
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
  line-height: 1.5;
}

/* ===== KG triples / Clinical Evidence tables ===== */
.stack .evidence-table {
  font-size: 12px;
  margin: 0;
  border-collapse: collapse;
  width: 100%;
}

.stack .evidence-table th {
  padding: 6px 14px;
  background: var(--surface-low);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--subtle);
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}

.stack .evidence-table td {
  padding: 5px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  line-height: 1.4;
}

.stack .evidence-table tr:nth-child(even) td {
  background: #fbfdff;
}

.stack .kg-table-foot {
  padding: 8px 14px 12px;
  font-size: 12px;
  color: var(--subtle);
}

/* ===== Hero section ===== */
.stack .species-hero {
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(36, 87, 255, 0.06), rgba(255, 255, 255, 0.6));
  margin-bottom: 0;
}

.stack .species-hero h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
}

.stack .species-hero p {
  color: var(--slate);
  font-size: 12.5px;
  margin: 0 0 10px;
}

.stack .species-hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.stack .species-hero-stats .hero-stat {
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
}

.strain-detail-stack .species-hero-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.strain-detail-stack .species-hero-stats .hero-stat {
  min-width: 0;
}

.stack .hero-stat b {
  font-size: 13px;
  color: var(--ink);
  font-weight: 700;
}

.stack .hero-stat span {
  display: block;
  color: var(--subtle);
  font-size: 11px;
  margin-top: 3px;
}

/* ===== 响应式 · 窄屏 ===== */
@media (max-width: 900px) {
  .stack .external-standard-panel .external-standard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .stack .strain-bg-block.strain-bg-wide {
    grid-column: auto;
  }
  .stack .strain-bg-inline-grid {
    grid-template-columns: 1fr;
  }
  .stack .external-standard-panel .external-standard-grid {
    grid-template-columns: 1fr;
  }
  .stack .strain-genome-row {
    grid-template-columns: 1fr;
  }
}



.species-chart-row {
  display: grid;
  grid-template-columns: minmax(260px, 0.32fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
  min-width: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  min-width: 0;
}

.analysis-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  min-width: 0;
}

.workflow-card,
.analysis-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  min-width: 0;
}

.workflow-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
}

.workflow-card:hover {
  border-color: var(--line);
  border-bottom: 2px solid var(--primary-ui);
  background: var(--surface-low);
  text-decoration: none;
}

.workflow-step {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--primary);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 700;
}

.workflow-card h3,
.analysis-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.workflow-card p,
.analysis-card p {
  margin: 0;
  color: var(--subtle);
  line-height: 1.5;
}

.analysis-card {
  padding: 15px;
  border-left: 4px solid var(--primary-ui);
}

.vfdb-category-card:hover {
  border-color: var(--line);
  border-left-color: var(--primary-ui);
  background: #fbfdff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  text-decoration: none;
  transform: translateY(-2px);
}

.analysis-card.ok { border-left-color: var(--success); }
.analysis-card.warn { border-left-color: var(--warning); }
.analysis-card.info { border-left-color: var(--primary-ui); }
.analysis-card.danger { border-left-color: var(--critical); }

.strain-detail-stack .analysis-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.strain-detail-stack .analysis-card {
  min-height: 0;
  padding: 10px 12px;
  border-left-width: 3px;
}

.strain-detail-stack .analysis-label {
  font-size: 11px;
  line-height: 1.2;
}

.strain-detail-stack .analysis-value {
  margin-top: 2px;
  font-size: 20px;
  line-height: 1.05;
}

.strain-detail-stack .analysis-card p {
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.35;
}

.vfdb-category-card.ok:hover { border-left-color: var(--success); }
.vfdb-category-card.warn:hover { border-left-color: var(--warning); }
.vfdb-category-card.info:hover { border-left-color: var(--primary-ui); }
.vfdb-category-card.danger:hover { border-left-color: var(--critical); }

.vfdb-category-card {
  display: grid;
  gap: 5px;
  min-height: 136px;
  padding-top: 13px;
  padding-bottom: 13px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.vfdb-category-card p {
  color: #7d8491;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.25;
}

.vfdb-share-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 0;
  color: var(--subtle);
  font-size: 11px;
}

.vfdb-share-row b {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  white-space: nowrap;
}

.vfdb-share-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-mid);
}

.vfdb-share-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary-ui);
}

.vfdb-category-card.ok .vfdb-share-track span { background: var(--success); }
.vfdb-category-card.warn .vfdb-share-track span { background: var(--warning); }
.vfdb-category-card.info .vfdb-share-track span { background: var(--primary-ui); }
.vfdb-category-card.danger .vfdb-share-track span { background: var(--critical); }

.analysis-value {
  margin: 3px 0 2px;
  font-size: 24px;
  line-height: 1.1;
  font-weight: 800;
}

.vfdb-category-hit-count {
  margin-left: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  vertical-align: baseline;
}

.demo-paths a,
.action-grid a,
.focus-list div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
  color: var(--text);
}

.demo-paths a:hover,
.action-grid a:hover {
  border-color: var(--line);
  border-bottom: 2px solid var(--primary-ui);
  text-decoration: none;
}

.demo-paths span,
.action-grid span,
.focus-list span {
  color: var(--subtle);
  line-height: 1.5;
}

.action-hub {
  background: #fbfdff;
}

.quick-access a {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  color: var(--text);
  min-width: 0;
}

.quick-access a b,
.quick-access a small,
.demo-paths span,
.action-grid span,
.focus-list span {
  overflow-wrap: anywhere;
}

.quick-access a:hover {
  border-color: var(--primary-ui);
  background: rgba(224, 231, 255, 0.35);
  text-decoration: none;
}

.quick-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--surface-mid);
  color: var(--primary-ui);
}

.timeline {
  position: relative;
  display: grid;
  gap: 22px;
  margin: 20px 0 0 9px;
  padding-left: 20px;
  border-left: 2px solid rgba(10, 77, 161, 0.25);
}

.timeline div {
  position: relative;
}

.timeline div::before {
  content: "";
  position: absolute;
  left: -30px;
  top: 4px;
  width: 12px;
  height: 12px;
  border: 4px solid var(--surface-low);
  border-radius: 999px;
  background: var(--primary-ui);
}

.timeline p {
  margin: 3px 0 0;
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.45;
}

.filter-panel {
  position: sticky;
  top: 0;
}

.filter-group {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.filter-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.result-shell {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0;
}

.panel > table.member-genome-table {
  display: table;
  width: 100%;
  min-width: clamp(760px, 100%, 1040px);
  table-layout: auto;
  overflow: visible;
}

.panel > table.member-genome-table th,
.panel > table.member-genome-table td {
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
}

.panel > table.member-genome-table th:nth-child(1),
.panel > table.member-genome-table td:nth-child(1) {
  width: 14ch;
  white-space: nowrap;
}

.panel > table.member-genome-table th:nth-child(2),
.panel > table.member-genome-table td:nth-child(2) {
  width: 34%;
  min-width: 220px;
  overflow-wrap: anywhere;
}

.panel > table.member-genome-table th:nth-child(3),
.panel > table.member-genome-table td:nth-child(3) {
  width: 13%;
  min-width: 96px;
}

.panel > table.member-genome-table th:nth-child(4),
.panel > table.member-genome-table td:nth-child(4) {
  width: 12ch;
  white-space: nowrap;
}

.panel > table.member-genome-table th:nth-child(5),
.panel > table.member-genome-table td:nth-child(5) {
  width: 18ch;
  white-space: nowrap;
}

.panel > table.member-genome-table td {
  vertical-align: middle;
}

.result-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: #fbfdff;
}

.result-toolbar > * {
  min-width: 0;
}

.result-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.result-count b {
  color: var(--primary-ui);
  font-size: 24px;
}

.confidence {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.confidence-track {
  width: 64px;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-mid);
}

.confidence-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--success);
}

.status-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(45, 138, 94, 0.16);
}

.status-dot.warn {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.16);
}

.score-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.score-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface-low);
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.score-chip b {
  font-weight: 700;
}

.score-chip em {
  font-family: "JetBrains Mono", monospace;
  font-style: normal;
  font-weight: 800;
}

.score-chip.bonus {
  border-color: rgba(45, 138, 94, 0.24);
  background: rgba(45, 138, 94, 0.08);
  color: var(--success);
}

.score-chip.penalty {
  border-color: rgba(220, 38, 38, 0.22);
  background: rgba(220, 38, 38, 0.07);
  color: var(--critical);
}

.score-chip.base {
  color: var(--slate);
}

.weight-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 8px;
  margin-top: 12px;
}

.weight-row > span {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.weight-row > b {
  color: var(--primary-ui);
  font-family: "JetBrains Mono", monospace;
}

.weight-row > div {
  grid-column: 1 / -1;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-mid);
}

.weight-row > div span {
  display: block;
  height: 100%;
  background: var(--primary-ui);
}

.weight-row > div span.warn { background: var(--warning); }
.weight-row > div span.ok { background: var(--success); }

.weight-row p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.4;
}

.screening-sidebar .panel {
  padding: 14px;
}

.screening-sidebar h2 {
  font-size: 16px;
}

/* ===== 候选筛选：双栏布局 ===== */
.layout-with-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 12px;
  align-items: start;
}

@media (max-width: 1100px) {
  .layout-with-sidebar {
    grid-template-columns: 1fr;
  }
}

.screening-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.screening-detail-panel {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 20px 22px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid rgba(100, 116, 139, 0.15);
}

.candidate-table {
  display: table !important;
  width: 100% !important;
  table-layout: fixed;
  border-collapse: collapse;
  box-sizing: border-box;
}

.candidate-table.compact {
  min-width: 0;
}

.screening-result-shell {
  width: 100%;
  margin-top: 4px;
  box-sizing: border-box;
  overflow: visible;
}

.screening-result-shell > .candidate-table {
  display: table !important;
  width: 100% !important;
  table-layout: fixed;
  border-collapse: collapse;
  box-sizing: border-box;
  overflow: visible;
}

.screening-result-shell .candidate-table {
  display: table;
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  overflow: visible;
}

.candidate-col-rank { width: 70px; }
.candidate-col-strainname { width: auto; }
.candidate-col-score-big { width: 110px; }

.candidate-table th,
.candidate-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(100, 116, 139, 0.12);
  vertical-align: middle;
}

.candidate-table th {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(100, 116, 139, 0.04);
  text-align: left;
  font-weight: 700;
}

.candidate-table th.score-big-cell,
.candidate-table td.score-big-cell {
  text-align: center;
}

.candidate-table .rank-cell {
  text-align: center;
}

.candidate-table .rank-num {
  display: inline-block;
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  background: rgba(100, 116, 139, 0.08);
  padding: 3px 10px;
  border-radius: 999px;
  min-width: 28px;
  line-height: 1.6;
}

.candidate-table .strainname-cell {
  text-align: left;
  min-width: 0;
}

.candidate-table .strainname-cell .strain-name-main {
  font-size: 15px;
  font-weight: 600;
  color: var(--slate-700);
  line-height: 1.4;
  word-break: break-word;
}

.candidate-table .strainname-cell .strain-species-cn {
  font-size: 12.5px;
  color: var(--slate-500);
  margin-top: 3px;
  line-height: 1.4;
}

.candidate-table .strainname-cell .strain-aliases {
  margin-top: 6px;
  line-height: 1.8;
}

.candidate-table .candidate-row {
  cursor: pointer;
  transition: background 0.1s ease;
}

.candidate-table .candidate-row:hover {
  background: rgba(37, 99, 235, 0.025);
}

.candidate-table .candidate-row.active {
  background: rgba(37, 99, 235, 0.08);
  box-shadow: inset 3px 0 0 var(--link);
}

.candidate-table .score-big-cell {
  text-align: center;
}

.candidate-table .score-big {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.candidate-table .score-big.chain-ok {
  color: var(--success);
}

.candidate-table .score-big.chain-missing {
  color: var(--slate-500);
}

/* ===== 别名 chip ===== */
.alias-chip {
  display: inline-block;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 4px;
  background: rgba(100, 116, 139, 0.08);
  color: var(--slate-600);
  margin-right: 4px;
  margin-top: 2px;
  line-height: 1.6;
}

/* ===== 评分 chip 通用 ===== */
.score-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(100, 116, 139, 0.25);
  background: rgba(100, 116, 139, 0.08);
  color: var(--slate-700);
  line-height: 1.4;
  font-weight: 600;
  white-space: nowrap;
}

.score-chip.chain-ok {
  border-color: rgba(45, 138, 94, 0.35);
  background: rgba(45, 138, 94, 0.12);
  color: var(--success);
}

.score-chip.chain-missing {
  border-color: rgba(217, 6, 6, 0.25);
  background: rgba(217, 6, 6, 0.08);
  color: #c23030;
}

.score-chip.small {
  font-size: 10px;
  padding: 1px 6px;
  min-width: auto;
}

.score-chip.level-A { background: rgba(45, 138, 94, 0.12); color: var(--success); border-color: rgba(45, 138, 94, 0.35); }
.score-chip.level-B { background: rgba(217, 119, 6, 0.1); color: var(--warning); border-color: rgba(217, 119, 6, 0.35); }
.score-chip.level-C { background: rgba(100, 116, 139, 0.12); color: var(--slate); border-color: rgba(100, 116, 139, 0.35); }
.score-chip.level-D { background: rgba(217, 6, 6, 0.08); color: #c23030; border-color: rgba(217, 6, 6, 0.3); }

/* ===== 进度条 ===== */
#screeningProgressBar {
  height: 3px;
  margin: 0 0 1px;
  background: transparent;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#screeningProgressBar.loading {
  opacity: 1;
}

.screening-progress-track {
  width: 100%;
  height: 100%;
  background: transparent;
  position: relative;
  overflow: hidden;
}

.screening-progress-fill {
  position: absolute;
  top: 0;
  left: -30%;
  width: 30%;
  height: 100%;
  background: linear-gradient(90deg,
    transparent,
    rgba(37, 99, 235, 0.4),
    rgba(37, 99, 235, 0.75),
    rgba(37, 99, 235, 0.4),
    transparent
  );
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.2s ease;
  animation: screening-progress-slide 1.6s ease-in-out infinite;
}

#screeningProgressBar.loading .screening-progress-fill {
  opacity: 1;
}

@keyframes screening-progress-slide {
  0% { transform: translateX(0); }
  100% { transform: translateX(500%); }
}

/* ===== 空状态 ===== */
.candidate-table .empty,
.candidate-detail-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.screening-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 150px;
  align-content: center;
  color: var(--muted);
  text-align: center;
}

.screening-state b {
  color: inherit;
  font-size: 13px;
  font-weight: 700;
}

.screening-state-icon {
  display: inline-block;
  width: 26px;
  height: 26px;
  border: 3px solid rgba(37, 99, 235, 0.18);
  border-top-color: var(--primary-ui);
  border-radius: 50%;
  animation: screening-state-spin 0.8s linear infinite;
}

.screening-state.error {
  color: var(--critical);
}

.screening-state.error .screening-state-icon {
  border-color: rgba(220, 38, 38, 0.18);
  border-top-color: var(--critical);
}

.screening-state.empty .screening-state-icon {
  display: none;
}

@keyframes screening-state-spin {
  to { transform: rotate(360deg); }
}

/* ===== 详情面板头部 ===== */
.candidate-detail-head {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(100, 116, 139, 0.15);
  margin-bottom: 16px;
}

.candidate-detail-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--slate-700);
  line-height: 1.35;
  word-break: break-word;
}

.candidate-detail-cn {
  margin-top: 4px;
  font-size: 13px;
  color: var(--slate-500);
}

.candidate-detail-score-frame {
  margin-top: 14px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.score-super-big {
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.score-super-big.chain-ok { color: var(--success); }
.score-super-big.chain-missing { color: var(--slate-500); }

.score-super-big-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.chain-badge-line {
  flex: 1;
  min-width: 100%;
  margin-top: 8px;
}

/* ===== 详情面板内容 ===== */
.candidate-detail-body .detail-section {
  margin-bottom: 20px;
}

.detail-h {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px 0;
  font-weight: 700;
}

.detail-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
  line-height: 1.5;
}

.detail-row .detail-k {
  flex: 0 0 80px;
  color: var(--muted);
  font-size: 12px;
  padding-top: 1px;
}

.detail-row .detail-v {
  flex: 1;
  min-width: 0;
  word-break: break-word;
  color: var(--slate-700);
}

.detail-row .detail-v a {
  color: var(--link);
  text-decoration: none;
}

.detail-row .detail-v a:hover {
  text-decoration: underline;
}

.detail-sub {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin: 12px 0 6px;
}

.detail-trial-item {
  padding: 7px 0;
  border-bottom: 1px dashed rgba(100, 116, 139, 0.12);
  font-size: 12.5px;
  line-height: 1.5;
}

.detail-muted {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 2px;
}

/* ===== 详情面板评分构成 ===== */
.detail-score-components {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.detail-score-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  padding: 4px 0;
}

.detail-score-label {
  flex: 0 0 82px;
  color: var(--slate-600);
  font-weight: 600;
  padding-top: 2px;
}

.detail-score-chip {
  min-width: 44px;
  justify-content: center;
  text-align: center;
  flex-shrink: 0;
}

.detail-score-note {
  flex: 1;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
  word-break: break-word;
  min-width: 0;
}

/* ===== 参考文献条目 ===== */
.detail-ref-item {
  padding: 8px 0;
  border-bottom: 1px dashed rgba(100, 116, 139, 0.12);
}

.detail-ref-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.detail-ref-scope {
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-ref-pmid {
  font-size: 11.5px;
  color: var(--link);
  text-decoration: none;
  font-family: var(--mono-font, ui-monospace, monospace);
}

.detail-ref-pmid:hover {
  text-decoration: underline;
}

.detail-ref-title {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--slate-700);
  word-break: break-word;
}

/* ===== 按钮小样式 ===== */
.button.small {
  font-size: 12px;
  padding: 5px 12px;
  margin-right: 6px;
  border: 1px solid rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.06);
  color: var(--link);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.12s ease;
}

.button.small:hover {
  background: rgba(37, 99, 235, 0.12);
}

.button.small.secondary {
  border-color: rgba(100, 116, 139, 0.3);
  background: rgba(100, 116, 139, 0.06);
  color: var(--slate-700);
}

.button.small.secondary:hover {
  background: rgba(100, 116, 139, 0.12);
}

.review-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin: 3px 0 0 6px;
  padding: 3px 7px;
  border: 1px solid rgba(100, 116, 139, 0.22);
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.08);
  color: var(--slate);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}

.review-pill.ok {
  border-color: rgba(45, 138, 94, 0.24);
  background: rgba(45, 138, 94, 0.08);
  color: var(--success);
}

.review-pill.warn {
  border-color: rgba(217, 119, 6, 0.28);
  background: rgba(217, 119, 6, 0.08);
  color: var(--warning);
}

.review-pill.danger {
  border-color: rgba(220, 38, 38, 0.22);
  background: rgba(220, 38, 38, 0.08);
  color: var(--critical);
}

.review-pill.muted {
  color: var(--subtle);
}

.review-page {
  display: grid;
  gap: 14px;
}

.review-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.review-hero h1 {
  margin: 2px 0 4px;
  font-size: 28px;
  line-height: 1.15;
}

.review-hero p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
}

.review-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.review-stat-grid article {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(195, 198, 211, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
}

.review-stat-grid span,
.review-stat-grid small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.review-stat-grid b {
  display: block;
  margin: 4px 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 24px;
  line-height: 1.1;
}

.review-filter-panel {
  display: grid;
  grid-template-columns: 170px 170px minmax(220px, 1fr) 120px auto;
  align-items: end;
  gap: 10px;
}

.review-filter-panel label {
  min-width: 0;
}

.review-filter-panel label span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.review-table-panel {
  padding: 16px;
}

.review-table-frame {
  width: 100%;
  overflow-x: auto;
}

.review-table {
  width: 100%;
  min-width: 1520px;
  border-collapse: collapse;
  table-layout: fixed;
}

.review-table th,
.review-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
  font-size: 12px;
  line-height: 1.4;
}

.review-table th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  white-space: nowrap;
}

.review-table th:nth-child(1),
.review-table td:nth-child(1) {
  width: 10%;
}

.review-table th:nth-child(2),
.review-table td:nth-child(2) {
  width: 15%;
}

.review-table th:nth-child(3),
.review-table td:nth-child(3) {
  width: 9%;
}

.review-table th:nth-child(4),
.review-table td:nth-child(4) {
  width: 12%;
}

.review-table th:nth-child(5),
.review-table td:nth-child(5) {
  width: 18%;
}

.review-table th:nth-child(6),
.review-table td:nth-child(6) {
  width: 17%;
}

.review-table th:nth-child(7),
.review-table td:nth-child(7) {
  width: 13%;
}

.review-table th:nth-child(8),
.review-table td:nth-child(8) {
  width: 14%;
}

.review-table th:nth-child(9),
.review-table td:nth-child(9) {
  width: 72px;
  text-align: center;
}

.review-table b,
.review-table small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.review-table small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.review-status-select {
  min-height: 28px;
  padding: 4px 22px 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.review-status-ok {
  border-color: rgba(45, 138, 94, 0.26);
  background: rgba(45, 138, 94, 0.08);
  color: var(--success);
}

.review-status-warning,
.review-status-pending {
  border-color: rgba(217, 119, 6, 0.28);
  background: rgba(217, 119, 6, 0.08);
  color: var(--warning);
}

.review-status-danger {
  border-color: rgba(220, 38, 38, 0.22);
  background: rgba(220, 38, 38, 0.08);
  color: var(--critical);
}

.review-table textarea {
  min-height: 58px;
  resize: vertical;
  font-size: 12px;
}

.review-table textarea.input-error {
  border-color: var(--critical);
}

.review-actions-cell {
  white-space: nowrap;
}

.review-actions-cell .project-icon-action {
  margin-top: 8px;
}

.review-empty {
  min-height: 180px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.a4-report {
  width: 100%;
  max-width: 900px;
  min-height: 980px;
  margin: 0 auto;
  padding: clamp(22px, 3vw, 42px);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.report-toc {
  position: sticky;
  top: 0;
  align-self: start;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  min-height: 108px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.stat-value {
  margin-top: 8px;
  font-size: 24px;
  line-height: 1.1;
  font-weight: 800;
  color: var(--text);
}

.stat-sub {
  margin-top: 8px;
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.4;
}

.strain-detail-stack .stat-grid {
  gap: 8px;
  margin-bottom: 10px;
}

.strain-detail-stack .stat-card {
  min-height: 54px;
  padding: 8px 10px;
}

.strain-detail-stack .stat-label {
  font-size: 11px;
}

.strain-detail-stack .stat-value {
  margin-top: 2px;
  font-size: 20px;
}

.strain-detail-stack .stat-sub {
  margin-top: 3px;
  font-size: 11px;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
  background: #fff;
  color: var(--slate);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:hover,
.button:hover {
  border-color: var(--primary-ui);
  color: var(--primary-ui);
  text-decoration: none;
}

.button.compact {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

.favorite-menu,
.account-menu,
.tool-menu {
  position: relative;
}

.login-link,
.favorite-nav-link,
.favorite-menu summary,
.account-menu summary,
.tool-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
  text-decoration: none;
}

.favorite-menu summary::-webkit-details-marker,
.account-menu summary::-webkit-details-marker,
.tool-menu summary::-webkit-details-marker {
  display: none;
}

.login-link:hover,
.favorite-nav-link:hover,
.favorite-menu[open] summary,
.account-menu[open] summary,
.tool-menu[open] summary,
.favorite-menu summary:hover,
.account-menu summary:hover,
.tool-menu summary:hover,
.tool-menu summary.active {
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.favorite-panel,
.account-panel,
.tool-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(360px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(18px);
  z-index: 80;
}

.tool-panel {
  display: grid;
  gap: 8px;
}

.tool-panel > b,
.tool-panel > span {
  display: block;
}

.tool-panel > b {
  color: var(--text);
  font-size: 13px;
}

.tool-panel > span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.tool-panel a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.tool-panel a:hover,
.tool-panel a.active {
  border-color: rgba(194, 65, 12, 0.28);
  background: rgba(194, 65, 12, 0.08);
  color: var(--primary-ui);
}

.tool-panel .material-symbols-outlined {
  font-size: 18px;
}

.favorite-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.favorite-panel-head button {
  min-height: 28px;
  padding: 4px 9px;
  font-size: 12px;
}

.favorite-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  color: var(--subtle);
}

.favorite-list a {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
  color: var(--text);
}

.favorite-list a:hover {
  border-color: var(--primary-ui);
  text-decoration: none;
}

.favorite-list span,
.account-panel span {
  color: var(--subtle);
  font-size: 12px;
}

.personal-list {
  display: grid;
  gap: 8px;
}

.personal-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.personal-list-item a {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.personal-list-item b,
.personal-list-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personal-list-item span {
  color: var(--subtle);
  font-size: 12px;
}

.personal-list-item button {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 12px;
}

.account-panel {
  display: grid;
  gap: 8px;
  width: 220px;
}

.account-page {
  display: grid;
  gap: 16px;
}

.account-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.account-sidebar {
  position: sticky;
  top: 116px;
  display: grid;
  gap: 16px;
  padding: 16px;
}

.account-card h2 {
  margin: 5px 0 4px;
  font-size: 22px;
}

.account-card p {
  margin: 0;
  color: var(--subtle);
  font-size: 13px;
}

.account-avatar {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0b4ea2, #0f172a);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.account-avatar.tiny {
  width: 30px;
  height: 30px;
  margin: 0;
  font-size: 13px;
}

.account-side-nav {
  display: grid;
  gap: 6px;
}

.account-side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
}

.account-side-nav a:hover,
.account-side-nav a.active {
  border-color: var(--line-soft);
  background: var(--surface-low);
}

.account-side-nav a.active {
  color: var(--primary-ui);
}

.account-side-nav .material-symbols-outlined {
  font-size: 20px;
}

.account-main {
  min-width: 0;
}

.account-auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: center;
  gap: 20px;
  padding: 24px;
}

.account-auth-panel.logged-in {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.account-auth-panel h2 {
  margin: 6px 0 8px;
  font-size: 28px;
}

.account-auth-panel p {
  margin: 0;
  color: var(--subtle);
}

.account-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.account-user-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.account-profile-editor {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.account-profile-form {
  align-self: stretch;
}

.compact-profile {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

.account-avatar-preview,
.account-modal-avatar {
  display: grid;
  gap: 10px;
  align-content: start;
}

.account-avatar-image {
  display: block;
  width: 240px;
  min-width: 200px;
  height: 240px;
  object-fit: cover;
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  background: var(--surface-low);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12);
}

.account-avatar-preview span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 700;
}

.account-form.compact {
  grid-template-columns: minmax(0, 1fr);
}

.account-form label {
  display: grid;
  gap: 6px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 700;
}

.account-form select {
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font: inherit;
}

.account-form button {
  align-self: end;
}

.account-link-button {
  justify-self: start;
  border: 0;
  background: transparent;
  color: var(--primary-ui);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}

.account-link-button:hover {
  text-decoration: underline;
}

.account-password-help {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid rgba(12, 74, 140, 0.16);
  border-radius: var(--radius);
  background: rgba(12, 74, 140, 0.06);
  color: var(--subtle);
  font-size: 13px;
  line-height: 1.55;
}

.account-password-help b {
  color: var(--primary);
}

.account-password-help p,
.account-password-help ul {
  margin: 0;
}

.account-password-help ul {
  padding-left: 18px;
}

.account-password-help code {
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--primary);
  font-family: var(--mono);
  font-weight: 800;
}

.form-error {
  grid-column: 1 / -1;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(220, 38, 38, 0.22);
  border-radius: var(--radius);
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  font-size: 13px;
}

.account-section {
  padding: 16px;
}

.account-metric-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.account-metric-row.compact {
  margin-bottom: 10px;
}

.account-metric {
  min-width: 96px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.account-metric span {
  display: block;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 700;
}

.account-metric b {
  display: block;
  margin-top: 2px;
  font-size: 20px;
}

.account-user-table {
  overflow-x: auto;
}

.account-user-table .data-table {
  table-layout: fixed;
  margin-top: 0;
}

.account-user-table th,
.account-user-table td {
  vertical-align: middle;
}

.account-user-table th:nth-child(1),
.account-user-table td:nth-child(1) {
  width: 20%;
}

.account-user-table th:nth-child(2),
.account-user-table td:nth-child(2) {
  width: 20%;
}

.account-user-table th:nth-child(3),
.account-user-table td:nth-child(3) {
  width: 14%;
}

.account-user-table th:nth-child(4),
.account-user-table td:nth-child(4) {
  width: 12%;
}

.account-user-table th:nth-child(5),
.account-user-table td:nth-child(5) {
  width: 22%;
  white-space: nowrap;
}

.account-user-table th:nth-child(6),
.account-user-table td:nth-child(6) {
  width: 12%;
}

.account-user-actions {
  text-align: right;
  white-space: nowrap;
}

.account-user-actions button {
  min-height: 28px;
  padding: 4px 9px;
  margin-left: 6px;
  font-size: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 14px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.28), transparent 34%),
    rgba(246, 248, 252, 0.72);
  backdrop-filter: blur(22px) saturate(1.25);
}

.account-user-modal {
  width: min(430px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow:
    0 34px 90px rgba(15, 23, 42, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.account-modal-hero {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 16px 22px 6px;
  text-align: center;
}

.account-modal-hero .icon-button {
  position: absolute;
  top: 12px;
  right: 12px;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
  background: rgba(241, 245, 249, 0.9);
}

.account-modal-hero .icon-button .material-symbols-outlined {
  display: block;
  width: 20px;
  height: 20px;
  font-size: 20px;
  line-height: 20px;
}

.account-modal-hero h3 {
  margin: 2px 0 0;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: 0;
}

.account-modal-hero p {
  max-width: 380px;
  margin: 0;
  color: var(--subtle);
  line-height: 1.4;
  font-size: 12px;
}

.account-modal-mini-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: linear-gradient(135deg, #0b4ea2, #111827);
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line-soft);
}

.modal-head h3 {
  margin: 0 0 6px;
  font-size: 24px;
}

.modal-head p {
  margin: 0;
  color: var(--subtle);
}

.account-modal-form {
  display: grid;
  gap: 8px;
  padding: 6px 22px 18px;
}

.apple-account-form {
  grid-template-columns: 1fr;
}

.account-modal-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.account-modal-fields label {
  display: grid;
  gap: 5px;
  color: #5f6673;
  font-size: 11px;
  font-weight: 700;
}

.account-modal-fields input,
.account-modal-fields select {
  min-height: 38px;
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(248, 250, 252, 0.96);
  border-color: rgba(148, 163, 184, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.account-modal-fields input:focus,
.account-modal-fields select:focus {
  border-color: rgba(0, 113, 227, 0.7);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
  outline: none;
}

.account-modal-avatar .account-avatar-image {
  width: 124px;
  min-width: 124px;
  height: 124px;
  border-radius: 30px;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.18);
}

.password-field {
  grid-column: 1 / -1;
}

.password-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.96);
}

.password-input-wrap input {
  border: 0;
  background: transparent;
  box-shadow: none;
  min-height: 38px;
}

.password-input-wrap input:focus {
  box-shadow: none;
}

.password-input-wrap button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  margin-right: 3px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--subtle);
}

.password-input-wrap button:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--primary-ui);
}

.password-field small {
  color: var(--subtle);
  font-weight: 500;
  line-height: 1.4;
  font-size: 11px;
}

.modal-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}

.modal-actions .button {
  min-width: 108px;
  min-height: 36px;
  border-radius: 999px;
}

.app-footer {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 18px;
  width: min(1560px, calc(100% - 48px));
  margin: 0 auto 18px;
  padding: 18px 22px 22px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(16px);
  color: var(--subtle);
  font-size: 12px;
}

.app-footer > div {
  display: grid;
  gap: 6px;
  max-width: none;
}

.footer-brand span {
  max-width: 760px;
  line-height: 1.55;
}

.footer-sources {
  width: 100%;
}

.app-footer b {
  color: var(--primary);
}

.app-footer nav,
.footer-sources nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 8px 4px 4px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  text-decoration: none;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.source-link:hover {
  transform: translateY(-1px);
  border-color: rgba(12, 74, 140, 0.28);
  background: #fff;
  color: var(--primary);
}

.source-logo {
  display: inline-grid;
  place-items: center;
  min-width: 54px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #0c4a8c;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
}

.source-link:nth-child(2) .source-logo {
  background: #315f8f;
}

.source-link:nth-child(3) .source-logo {
  background: #9b2c2c;
}

.source-link:nth-child(4) .source-logo {
  background: #1f6f52;
}

.source-link:nth-child(5) .source-logo {
  background: #6f3f86;
}

.source-link:nth-child(6) .source-logo {
  background: #475569;
}

.primary {
  border-color: var(--primary-ui);
  background: var(--primary-ui);
  color: #fff;
}

.primary:hover {
  color: #fff;
  filter: brightness(0.96);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-width: 16px;
  height: 16px;
  padding: 0;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--primary-soft);
  border-color: var(--primary-ui);
}

textarea {
  min-height: 172px;
  resize: vertical;
}

.search-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.search-console {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
}

.search-console-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 150px;
  gap: 12px;
  align-items: end;
  min-width: 0;
}

.search-box,
.search-sort-box {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.search-stat-box {
  min-height: 32px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 3px 3px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.search-stat-box b {
  color: var(--primary-ui);
  font-size: 24px;
  line-height: 1;
}

.search-stat-box span:last-child {
  color: var(--subtle);
  font-size: 12px;
}

.search-filter-strip {
  display: flex;
  align-items: center;
  gap: 8px 14px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.search-filter-strip select {
  width: auto;
  min-width: 210px;
  min-height: 34px;
  padding: 6px 10px;
}

.filter-divider {
  width: 1px;
  height: 22px;
  background: var(--line-soft);
}

.search-filter-strip label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.search-filter-strip button {
  margin-left: auto;
  min-height: 30px;
  padding: 5px 10px;
}

.search-results {
  display: grid;
  gap: 10px;
}

.search-result-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.search-result-card:hover {
  border-color: rgba(10, 77, 161, 0.42);
  background: #fbfdff;
}

.search-result-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.search-result-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(45, 138, 94, 0.1);
  color: var(--success);
  font-size: 11px;
  font-weight: 800;
}

.search-status.warn {
  background: rgba(217, 119, 6, 0.12);
  color: var(--warning);
}

.search-count {
  color: var(--subtle);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

.search-result-title {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-title:hover {
  color: var(--primary-ui);
  text-decoration: none;
}

.search-result-meta {
  overflow: hidden;
  color: var(--subtle);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-side {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.search-result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.vfdb-search-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 0;
}

.vfdb-search-panel {
  margin-bottom: 16px;
}

.vfdb-loading-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.vfdb-loading-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vfdb-loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line-soft);
  border-top-color: var(--primary-ui);
  border-radius: 999px;
  animation: vfdb-spin 800ms linear infinite;
}

.vfdb-loading-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-mid);
}

.vfdb-loading-track span {
  display: block;
  width: 36%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-ui), #7bb89a);
  animation: vfdb-progress 1.05s ease-in-out infinite;
}

.vfdb-loading-panel p {
  margin: 0;
  color: var(--subtle);
}

@keyframes vfdb-spin {
  to { transform: rotate(360deg); }
}

@keyframes vfdb-progress {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(300%); }
}

.vfdb-result-message {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.vfdb-tabs-meta .pill {
  white-space: nowrap;
}

.vfdb-page-status {
  color: var(--subtle);
  font-size: 12px;
  white-space: nowrap;
}

.vfdb-page-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.vfdb-page-controls .button {
  width: auto;
  height: 26px;
  min-height: 26px;
  min-width: 54px;
  padding: 0 9px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.vfdb-page-controls .button.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.vfdb-hit-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.vfdb-result-card.has-local-hit {
  border-color: #8fcaa9;
  background: linear-gradient(180deg, #e8f6ee 0%, #f7fcf9 62%);
}

.vfdb-result-card.has-local-hit .result-toolbar {
  background: #dff1e8;
}

.vfdb-local-hit {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.vfdb-local-hit-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.vfdb-local-hit-head small {
  color: var(--subtle);
}

.vfdb-local-hit .data-table {
  min-width: 760px;
  font-size: 12px;
}

.vfdb-local-hit th,
.vfdb-local-hit td {
  padding: 7px 8px;
}

.search-line select {
  max-width: 270px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 13px;
  min-width: 720px;
}

th,
td {
  border-bottom: 1px solid var(--line-soft);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  background: var(--surface-low);
  color: var(--subtle);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

tbody tr:hover {
  background: var(--primary-soft);
}

td:first-child,
.id-mono {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

.clinical-table th:first-child,
.clinical-table td:first-child {
  min-width: 210px;
  width: 220px;
  white-space: nowrap;
}

.pill,
.evidence-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
}

.pill {
  background: rgba(10, 77, 161, 0.1);
  color: var(--primary-ui);
}

.pill.ok,
.evidence-badge.level-A,
.evidence-badge.level-B {
  background: rgba(45, 138, 94, 0.1);
  color: var(--success);
}

.pill.warn,
.evidence-badge.level-C {
  background: rgba(217, 119, 6, 0.12);
  color: var(--warning);
}

.pill.danger {
  background: rgba(220, 38, 38, 0.1);
  color: var(--critical);
}

.evidence-badge {
  border: 1px solid var(--line-soft);
}

.evidence-badge.level-D {
  background: var(--surface-low);
  color: var(--subtle);
}

.empty,
.error {
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface-low);
  color: var(--subtle);
  text-align: center;
}

.error { color: var(--critical); }

.science-notice {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid rgba(217, 119, 6, 0.35);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius);
  background: rgba(217, 119, 6, 0.08);
  color: #69420e;
}

.science-notice p {
  margin: 6px 0 0;
  line-height: 1.6;
}

.report-evidence-profile,
.evidence-workbench {
  border: 1px solid rgba(12, 74, 140, 0.18);
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.86), rgba(255, 255, 255, 0.78));
}

.report-evidence-profile {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin: 14px 0;
  padding: 14px;
  border-radius: var(--radius);
}

.report-evidence-profile b,
.review-item b {
  display: block;
  color: var(--text);
}

.report-evidence-profile p,
.review-item p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.evidence-table {
  width: 100%;
  table-layout: fixed;
}

.report-document:has(.report-wide-section) {
  max-width: 100%;
}

.report-wide-section {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  overflow-x: auto;
  transform: none;
}

.report-wide-section > .evidence-table {
  display: table;
  width: 100%;
  max-width: none;
}

.evidence-table th:first-child,
.evidence-table td:first-child {
  width: 120px;
}

.evidence-table th:nth-child(2),
.evidence-table td:nth-child(2) {
  width: 140px;
}

.evidence-table th:nth-child(3),
.evidence-table td:nth-child(3) {
  width: 88px;
}

.evidence-table td {
  vertical-align: top;
  line-height: 1.55;
}

.star-strain-evidence-table {
  min-width: 1080px;
}

.star-strain-evidence-table th:nth-child(1),
.star-strain-evidence-table td:nth-child(1) {
  width: 130px;
}

.star-strain-evidence-table th:nth-child(2),
.star-strain-evidence-table td:nth-child(2) {
  width: 160px;
}

.star-strain-evidence-table th:nth-child(3),
.star-strain-evidence-table td:nth-child(3) {
  width: 34%;
}

.star-strain-evidence-table th:nth-child(4),
.star-strain-evidence-table td:nth-child(4) {
  width: 150px;
}

.star-strain-evidence-table th:nth-child(5),
.star-strain-evidence-table td:nth-child(5) {
  width: 220px;
}

.star-conclusion-cell {
  overflow-wrap: anywhere;
}

.star-conclusion-title,
.star-conclusion-summary {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.star-conclusion-title {
  -webkit-line-clamp: 2;
}

.star-conclusion-summary {
  margin-top: 4px;
  color: var(--muted);
  -webkit-line-clamp: 2;
}

.star-conclusion-details {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.star-conclusion-details summary {
  width: fit-content;
  cursor: pointer;
  color: var(--primary-ui);
  font-weight: 700;
}

.star-conclusion-details p {
  margin: 6px 0 0;
  line-height: 1.5;
}

.species-reference-context {
  display: grid;
  gap: 12px;
  margin: 16px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  background: var(--panel-soft);
}

.species-reference-context h3,
.species-reference-context p {
  margin: 0;
}

.species-reference-context p {
  margin-top: 4px;
  color: var(--muted);
}

.species-reference-context-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 1.2fr);
  gap: 14px;
}

.species-reference-context-grid > div {
  display: grid;
  gap: 8px;
}

.species-reference-module-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.species-reference-module-list span {
  padding: 3px 6px;
  border: 1px solid var(--line-soft);
  background: var(--surface-low);
}

@media (max-width: 760px) {
  .species-reference-context-grid {
    grid-template-columns: 1fr;
  }
}

.entity-evidence-table {
  min-width: 0;
}

.entity-evidence-table th,
.entity-evidence-table td {
  overflow-wrap: anywhere;
}

.project-report-toolbar {
  justify-content: flex-end;
  margin-bottom: 14px;
}

.project-report-toolbar .pill:nth-child(2) {
  margin-right: auto;
}

.project-report-document .stat-grid {
  margin: 14px 0;
}

.project-report-document .science-notice {
  margin-bottom: 18px;
}

.project-report-document .evidence-table {
  min-width: 920px;
}

.project-report-candidate-table th:first-child,
.project-report-candidate-table td:first-child {
  width: 12%;
}

.project-report-candidate-table th:nth-child(2),
.project-report-candidate-table td:nth-child(2) {
  width: 24%;
}

.project-report-candidate-table th:nth-child(3),
.project-report-candidate-table td:nth-child(3) {
  width: 8%;
  text-align: center;
}

.project-report-candidate-table th:nth-child(4),
.project-report-candidate-table td:nth-child(4),
.project-report-candidate-table th:nth-child(5),
.project-report-candidate-table td:nth-child(5) {
  width: 11%;
}

.project-report-candidate-table th:nth-child(6),
.project-report-candidate-table td:nth-child(6) {
  width: 14%;
}

.project-report-candidate-table th:nth-child(7),
.project-report-candidate-table td:nth-child(7) {
  width: 20%;
}

.project-report-candidate-table small,
.project-report-validation-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.4;
}

.project-report-weight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.project-report-weight-grid span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.project-report-weight-grid em {
  color: var(--primary-ui);
  font-style: normal;
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
}

.project-score-formula {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.project-score-formula b {
  color: var(--ink);
  font-size: 14px;
}

.project-score-formula code {
  display: block;
  white-space: normal;
  color: var(--primary-ui);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.project-score-formula small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.report-score-formula {
  margin-top: 12px;
}

.project-report-history-table th:first-child,
.project-report-history-table td:first-child {
  width: 34%;
}

.project-report-review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.project-report-review-grid article {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.project-report-review-grid article.danger {
  border-left-color: var(--critical);
}

.project-report-review-grid article.warn {
  border-left-color: var(--warning);
}

.project-report-review-grid article.ok {
  border-left-color: var(--success);
}

.project-report-review-grid article > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.project-report-review-grid p,
.project-report-review-grid span,
.project-report-review-grid small {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.project-report-validation-table th:first-child,
.project-report-validation-table td:first-child {
  width: 20%;
}

.project-report-validation-table th:nth-child(2),
.project-report-validation-table td:nth-child(2) {
  width: 11%;
}

.project-report-validation-table th:nth-child(3),
.project-report-validation-table td:nth-child(3) {
  width: 14%;
}

.project-report-validation-table th:nth-child(4),
.project-report-validation-table td:nth-child(4) {
  width: 25%;
}

.project-report-validation-table th:nth-child(5),
.project-report-validation-table td:nth-child(5) {
  width: 30%;
}

.project-report-regulatory-table th:first-child,
.project-report-regulatory-table td:first-child,
.project-report-regulatory-source-table th:first-child,
.project-report-regulatory-source-table td:first-child,
.project-report-experiment-table th:first-child,
.project-report-experiment-table td:first-child {
  width: 16%;
}

.project-report-regulatory-table th:nth-child(2),
.project-report-regulatory-table td:nth-child(2),
.project-report-regulatory-table th:nth-child(3),
.project-report-regulatory-table td:nth-child(3),
.project-report-regulatory-table th:nth-child(4),
.project-report-regulatory-table td:nth-child(4),
.project-report-experiment-table th:nth-child(2),
.project-report-experiment-table td:nth-child(2),
.project-report-experiment-table th:nth-child(3),
.project-report-experiment-table td:nth-child(3) {
  width: 12%;
}

.project-report-regulatory-table th:nth-child(5),
.project-report-regulatory-table td:nth-child(5),
.project-report-experiment-table th:nth-child(4),
.project-report-experiment-table td:nth-child(4) {
  width: 18%;
}

.project-report-regulatory-table th:nth-child(6),
.project-report-regulatory-table td:nth-child(6),
.project-report-experiment-table th:nth-child(5),
.project-report-experiment-table td:nth-child(5),
.project-report-experiment-table th:nth-child(6),
.project-report-experiment-table td:nth-child(6) {
  width: 28%;
}

.project-report-regulatory-table small,
.project-report-regulatory-source-table small,
.project-report-experiment-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.4;
}

.project-report-regulatory-source-table th:nth-child(4),
.project-report-regulatory-source-table td:nth-child(4),
.project-report-regulatory-source-table th:nth-child(6),
.project-report-regulatory-source-table td:nth-child(6) {
  width: 22%;
}

.project-report-experiment-coverage-table th:first-child,
.project-report-experiment-coverage-table td:first-child {
  width: 18%;
}

.project-report-experiment-coverage-table th:nth-child(4),
.project-report-experiment-coverage-table td:nth-child(4) {
  width: 42%;
}

.project-report-assay-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.project-report-assay-grid span {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.project-report-assay-grid em {
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
}

.entity-evidence-table th:nth-child(1),
.entity-evidence-table td:nth-child(1) {
  width: 14%;
}

.entity-evidence-table th:nth-child(2),
.entity-evidence-table td:nth-child(2) {
  width: 18%;
}

.entity-evidence-table th:nth-child(3),
.entity-evidence-table td:nth-child(3) {
  width: 18%;
}

.entity-evidence-table th:nth-child(4),
.entity-evidence-table td:nth-child(4) {
  width: 8%;
  white-space: nowrap;
}

.entity-evidence-table th:nth-child(5),
.entity-evidence-table td:nth-child(5) {
  width: 42%;
}

.entity-evidence-table .evidence-badge {
  max-width: 100%;
  align-items: flex-start;
  border-radius: 6px;
  white-space: normal;
  line-height: 1.35;
}

.report-evidence-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

.report-evidence-table th,
.report-evidence-table td {
  overflow-wrap: anywhere;
}

.report-evidence-table .evidence-badge {
  max-width: 100%;
  align-items: flex-start;
  border-radius: 6px;
  white-space: normal;
  line-height: 1.35;
}

.report-evidence-table th:first-child,
.report-evidence-table td:first-child {
  width: 14%;
}

.report-evidence-table th:nth-child(2),
.report-evidence-table td:nth-child(2) {
  width: 17%;
}

.report-evidence-table th:nth-child(3),
.report-evidence-table td:nth-child(3) {
  width: 21%;
}

.report-evidence-table th:nth-child(4),
.report-evidence-table td:nth-child(4) {
  width: 8%;
}

.report-evidence-table th:nth-child(5),
.report-evidence-table td:nth-child(5) {
  width: 40%;
}

.report-document .report-section .clinical-table {
  display: table;
  width: 100%;
  min-width: 0 !important;
  max-width: 100%;
  table-layout: fixed !important;
}

.report-document .report-section .clinical-table th,
.report-document .report-section .clinical-table td {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.report-document .report-section .clinical-table th:nth-child(1),
.report-document .report-section .clinical-table td:nth-child(1) {
  width: 13%;
}

.report-document .report-section .clinical-table th:nth-child(2),
.report-document .report-section .clinical-table td:nth-child(2) {
  width: 33%;
}

.report-document .report-section .clinical-table th:nth-child(3),
.report-document .report-section .clinical-table td:nth-child(3) {
  width: 24%;
}

.report-document .report-section .clinical-table th:nth-child(4),
.report-document .report-section .clinical-table td:nth-child(4) {
  width: 30%;
}

.factor-quality-table {
  min-width: 980px;
  width: 100%;
  table-layout: fixed;
}

.factor-quality-table th:nth-child(1),
.factor-quality-table td:nth-child(1) {
  width: 9%;
}

.factor-quality-table th:nth-child(2),
.factor-quality-table td:nth-child(2) {
  width: 10%;
}

.factor-quality-table th:nth-child(3),
.factor-quality-table td:nth-child(3) {
  width: 13%;
}

.factor-quality-table th:nth-child(4),
.factor-quality-table td:nth-child(4) {
  width: 15%;
}

.factor-quality-table th:nth-child(5),
.factor-quality-table td:nth-child(5) {
  width: 53%;
}

.annotation-evidence-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.annotation-evidence-overview > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.annotation-evidence-overview span,
.annotation-evidence-overview small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.annotation-evidence-overview b {
  display: block;
  margin: 4px 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
}

.annotation-evidence-boundary {
  margin: 10px 0 12px;
  color: var(--muted);
  line-height: 1.65;
}

.missing-field-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.missing-field-summary span,
.required-field-chip {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface-low);
}

.missing-field-summary b,
.missing-field-summary em,
.required-field-chip b,
.required-field-chip em {
  display: block;
  overflow-wrap: anywhere;
  font-style: normal;
  line-height: 1.35;
}

.missing-field-summary b,
.required-field-chip b {
  color: var(--text);
  font-size: 12px;
}

.missing-field-summary em,
.required-field-chip em {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.missing-field-summary .present,
.required-field-chip.present {
  border-color: rgba(22, 163, 74, 0.24);
  background: rgba(22, 163, 74, 0.07);
}

.missing-field-summary .missing,
.required-field-chip.missing {
  border-color: rgba(217, 119, 6, 0.26);
  background: rgba(217, 119, 6, 0.08);
}

.required-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.annotation-evidence-summary-table,
.annotation-evidence-hit-table {
  width: 100%;
  table-layout: fixed;
}

.annotation-evidence-summary-table {
  min-width: 1120px;
  margin-bottom: 12px;
}

.annotation-evidence-summary-table th:nth-child(1),
.annotation-evidence-summary-table td:nth-child(1) {
  width: 9%;
}

.annotation-evidence-summary-table th:nth-child(2),
.annotation-evidence-summary-table td:nth-child(2) {
  width: 12%;
}

.annotation-evidence-summary-table th:nth-child(3),
.annotation-evidence-summary-table td:nth-child(3) {
  width: 15%;
}

.annotation-evidence-summary-table th:nth-child(4),
.annotation-evidence-summary-table td:nth-child(4) {
  width: 12%;
}

.annotation-evidence-summary-table th:nth-child(5),
.annotation-evidence-summary-table td:nth-child(5) {
  width: 14%;
}

.annotation-evidence-summary-table th:nth-child(6),
.annotation-evidence-summary-table td:nth-child(6) {
  width: 8%;
}

.annotation-evidence-summary-table th:nth-child(7),
.annotation-evidence-summary-table td:nth-child(7) {
  width: 10%;
}

.annotation-evidence-summary-table th:nth-child(8),
.annotation-evidence-summary-table td:nth-child(8) {
  width: 20%;
}

.annotation-evidence-hit-table {
  min-width: 1480px;
}

.annotation-evidence-hit-table th:nth-child(1),
.annotation-evidence-hit-table td:nth-child(1) {
  width: 7%;
}

.annotation-evidence-hit-table th:nth-child(2),
.annotation-evidence-hit-table td:nth-child(2) {
  width: 12%;
}

.annotation-evidence-hit-table th:nth-child(3),
.annotation-evidence-hit-table td:nth-child(3) {
  width: 13%;
  overflow-wrap: anywhere;
}

.annotation-evidence-hit-table th:nth-child(4),
.annotation-evidence-hit-table td:nth-child(4) {
  width: 8%;
}

.annotation-evidence-hit-table th:nth-child(5),
.annotation-evidence-hit-table td:nth-child(5) {
  width: 24%;
}

.annotation-evidence-hit-table th:nth-child(6),
.annotation-evidence-hit-table td:nth-child(6) {
  width: 14%;
}

.annotation-evidence-hit-table th:nth-child(7),
.annotation-evidence-hit-table td:nth-child(7) {
  width: 12%;
}

.annotation-evidence-hit-table th:nth-child(8),
.annotation-evidence-hit-table td:nth-child(8) {
  width: 10%;
}

.safety-review-summary {
  display: grid;
  grid-template-columns: minmax(180px, 0.34fr) minmax(0, 1fr);
  gap: 10px;
  margin: 12px 0;
}

.safety-review-summary > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.safety-review-summary span,
.safety-review-summary small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.safety-review-summary b {
  display: block;
  margin: 4px 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.3;
}

.safety-review-summary p {
  margin: 4px 0 0;
  color: var(--text);
  line-height: 1.65;
}

.safety-review-table {
  min-width: 760px;
  width: 100%;
  table-layout: fixed;
}

.safety-review-table th:nth-child(1),
.safety-review-table td:nth-child(1) {
  width: 22%;
}

.safety-review-table th:nth-child(2),
.safety-review-table td:nth-child(2) {
  width: 12%;
  text-align: right;
}

.safety-review-table th:nth-child(3),
.safety-review-table td:nth-child(3) {
  width: 66%;
}

.safety-hit-table {
  min-width: 1040px;
  width: 100%;
  table-layout: fixed;
}

.safety-hit-table th,
.safety-hit-table td {
  white-space: normal;
}

.safety-hit-table th:nth-child(1),
.safety-hit-table td:nth-child(1) {
  width: 8%;
}

.safety-hit-table th:nth-child(2),
.safety-hit-table td:nth-child(2) {
  width: 17%;
}

.safety-hit-table th:nth-child(3),
.safety-hit-table td:nth-child(3) {
  width: 24%;
  word-break: normal;
  overflow-wrap: anywhere;
}

.safety-hit-table th:nth-child(4),
.safety-hit-table td:nth-child(4) {
  width: 11%;
}

.safety-hit-table th:nth-child(6),
.safety-hit-table td:nth-child(6) {
  width: 12%;
}

.safety-hit-table th:nth-child(5),
.safety-hit-table td:nth-child(5) {
  width: 28%;
  min-width: 0;
}

.regulatory-reference-table {
  min-width: 820px;
}

.regulatory-reference-table th:first-child,
.regulatory-reference-table td:first-child {
  width: 18%;
}

.regulatory-reference-table th:nth-child(2),
.regulatory-reference-table td:nth-child(2) {
  width: 32%;
}

.regulatory-reference-table th:nth-child(3),
.regulatory-reference-table td:nth-child(3) {
  width: 50%;
}

.review-item-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.review-item {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
}

.review-item span {
  display: inline-flex;
  margin-bottom: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(10, 77, 161, 0.1);
  color: var(--primary-ui);
  font-size: 11px;
  font-weight: 800;
}

.review-item.high {
  border-color: rgba(220, 38, 38, 0.28);
  background: rgba(254, 242, 242, 0.82);
}

.review-item.high span {
  background: rgba(220, 38, 38, 0.12);
  color: var(--critical);
}

.review-item.medium {
  border-color: rgba(217, 119, 6, 0.24);
}

.factor-quality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.factor-quality-card {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(12, 74, 140, 0.16);
  border-radius: var(--radius);
  background: rgba(248, 250, 252, 0.86);
}

.factor-quality-card > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--primary);
}

.factor-position-panel {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-low);
}

.factor-position-panel h3,
.factor-position-panel h4,
.factor-position-panel p {
  margin: 0;
}

.factor-position-panel h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 16px;
}

.factor-position-panel p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.factor-map-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.factor-map-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.factor-dot,
.factor-marker {
  --factor-color: var(--primary-ui);
}

.factor-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--factor-color);
}

.factor-dot.ARG,
.factor-marker.ARG { --factor-color: #dc2626; }

.factor-dot.VFDB,
.factor-marker.VFDB { --factor-color: #7c3aed; }

.factor-dot.Prophage,
.factor-marker.Prophage { --factor-color: #0f766e; }

.factor-dot.MGC,
.factor-marker.MGC { --factor-color: #b45309; }

.factor-dot.rRNA,
.factor-marker.rRNA { --factor-color: #2563eb; }

.factor-contig-map {
  display: grid;
  gap: 12px;
}

.factor-contig-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
}

.factor-contig-head {
  min-width: 0;
}

.factor-contig-head b,
.factor-contig-head small {
  display: block;
  overflow-wrap: anywhere;
}

.factor-contig-head b {
  color: var(--ink);
  font-size: 13px;
}

.factor-contig-head small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.factor-contig-tracks {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.factor-contig-tracks .factor-track {
  height: auto;
  overflow: visible;
  background: none;
  border: none;
  border-radius: 0;
}

.factor-track {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.factor-track > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.factor-track-line {
  position: relative;
  height: 20px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(90deg, transparent 0, transparent calc(20% - 1px), rgba(100, 116, 139, 0.18) calc(20% - 1px), rgba(100, 116, 139, 0.18) 20%),
    var(--surface-mid);
}

.factor-marker {
  appearance: none;
  display: block;
  position: absolute;
  top: 4px;
  height: 12px;
  min-height: 0;
  min-width: 7px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: var(--factor-color);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
  color: transparent;
  cursor: default;
  font-size: 0;
  line-height: 0;
  overflow: hidden;
}

.factor-marker.high {
  height: 16px;
  top: 2px;
  border-color: rgba(127, 29, 29, 0.55);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

.factor-marker.medium {
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.14);
}

.factor-marker:hover,
.factor-marker:focus-visible {
  z-index: 2;
  outline: 2px solid var(--primary-ui);
  outline-offset: 2px;
}

.factor-proximity-panel {
  display: grid;
  gap: 10px;
}

.factor-proximity-panel h4 {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 13px;
}

.factor-proximity-panel h4 span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.factor-proximity-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.factor-proximity-list article {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
}

.factor-proximity-list b,
.factor-proximity-list span {
  overflow-wrap: anywhere;
}

.factor-proximity-list b {
  color: var(--primary);
  font-size: 12px;
}

.factor-proximity-list span {
  color: var(--muted);
  font-size: 12px;
}

.factor-proximity-list i {
  color: var(--ink);
  font-style: normal;
  font-weight: 800;
}

.factor-quality-card p,
.factor-quality-card small,
.factor-quality-card em,
.factor-detail-table small {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  font-style: normal;
}

.factor-detail-table td {
  vertical-align: top;
}

.factor-detail-table td:nth-child(3),
.factor-detail-table td:nth-child(5) {
  min-width: 150px;
}

.compact-list {
  margin: 0;
  padding-left: 20px;
  color: var(--subtle);
  line-height: 1.55;
}

.json-preview {
  max-height: 560px;
  overflow: auto;
  border-radius: var(--radius);
  background: var(--surface-low);
  color: var(--text);
  padding: 14px;
}

.bar-chart {
  display: grid;
  gap: 9px;
}

.bar-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 76px;
  gap: 10px;
  align-items: center;
}

.bar-label {
  overflow: hidden;
  color: var(--subtle);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-mid);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--primary-ui);
}

.bar-value {
  color: var(--subtle);
  font-size: 12px;
  text-align: right;
}

.donut-layout {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.species-source-card {
  align-self: start;
}

.species-source-card .donut-layout {
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.species-source-card .donut {
  width: 108px;
  height: 108px;
}

.species-source-card .donut::after {
  inset: 28px;
}

.species-source-card .legend {
  gap: 6px;
  font-size: 12px;
}

.species-kegg-card {
  align-self: start;
}

.module-rank-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.module-rank-row {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.module-rank-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.module-rank-head span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-rank-head b {
  color: var(--primary-ui);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

.clinical-wide-panel {
  margin-top: 16px;
  overflow-x: auto;
  overflow-y: visible;
}

.stack > section.clinical-wide-panel,
.stack > section.result-shell.clinical-wide-panel {
  overflow-y: visible;
}

.clinical-wide-panel .clinical-table {
  display: table;
  width: 100%;
  min-width: clamp(760px, 100%, 1120px);
  table-layout: fixed;
}

.clinical-wide-panel .clinical-table th,
.clinical-wide-panel .clinical-table td {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.clinical-wide-panel .clinical-table th:nth-child(1),
.clinical-wide-panel .clinical-table td:nth-child(1) {
  width: 8%;
  min-width: 0;
  white-space: nowrap;
}

.clinical-wide-panel .clinical-table th:nth-child(2),
.clinical-wide-panel .clinical-table td:nth-child(2) {
  width: 54%;
  min-width: 0;
  overflow-wrap: break-word;
}

.clinical-wide-panel .clinical-table th:nth-child(3),
.clinical-wide-panel .clinical-table td:nth-child(3) {
  width: 20%;
  min-width: 0;
}

.clinical-wide-panel .clinical-table th:nth-child(4),
.clinical-wide-panel .clinical-table td:nth-child(4) {
  width: 18%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.stack > section.result-shell.clinical-wide-panel {
  max-height: none;
  overflow-x: auto;
  overflow-y: auto;
}

.stack > section.result-shell.clinical-wide-panel .clinical-table {
  max-height: none;
}

.donut {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  background: var(--surface);
}

.legend {
  display: grid;
  gap: 8px;
  color: var(--subtle);
  font-size: 13px;
}

.legend span {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 7px;
  border-radius: 2px;
}

.sparkline {
  width: 100%;
  min-height: 160px;
}

.sparkline polyline {
  fill: none;
  stroke: var(--success);
  stroke-width: 4;
}

.sparkline circle { fill: var(--success); }

.topology {
  width: 100%;
  height: 420px;
  min-height: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.topology line {
  stroke: rgba(100, 100, 100, 0.26);
  stroke-width: 1;
  marker-end: url(#topology-arrow);
}

.topology marker path {
  fill: rgba(10, 77, 161, 0.58);
}

.topology-node {
  cursor: grab;
  filter: drop-shadow(0 10px 18px rgba(15, 23, 42, 0.08));
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.topology-node.dragging {
  cursor: grabbing;
}

.topology-node rect {
  fill: rgb(213, 213, 213);
  stroke: rgba(63, 63, 63, 0.35);
  stroke-width: 2;
}

.topology-node.dragging rect {
  fill: rgba(255, 255, 255, 0.98);
  stroke: var(--primary-ui);
}

.topology text {
  fill: var(--text);
  pointer-events: none;
}

.topology .node-label {
  font-size: 11px;
  font-weight: 800;
}

.topology .node-desc {
  fill: var(--muted);
  font-size: 8.5px;
}

.topology .node-value {
  fill: var(--subtle);
  font-size: 8.5px;
  font-family: "JetBrains Mono", monospace;
}

.topology-panel {
  margin-bottom: 18px;
  padding: 18px;
  overflow: hidden;
  background: #ebebeb;
  background-size: 32px 32px;
}

.topology-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 10px;
}

.topology-panel .topology {
  height: clamp(330px, 40vw, 470px);
}

.topology-panel .topology-head {
  margin-bottom: 12px;
}

.topology-panel .section-desc {
  max-width: 900px;
}

.topology-panel .topology-node {
  filter: drop-shadow(0 6px 10px rgba(15, 23, 42, 0.06));
}

.roadmap {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.roadmap div,
.flow div {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.roadmap b {
  display: block;
  margin-bottom: 6px;
}

.roadmap span {
  color: var(--subtle);
  line-height: 1.5;
}

.tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.tabs-links {
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.tabs a {
  padding: 10px 14px;
  color: var(--subtle);
  white-space: nowrap;
}

.tabs a.active {
  border-color: var(--primary-ui);
  color: var(--primary-ui);
  text-decoration: none;
}

.vfdb-tabs-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  padding: 4px 0 14px;
}

.vfdb-tabs {
  align-items: flex-start;
  padding-bottom: 8px;
}

.vfdb-tabs .tabs-links {
  flex: 0 0 auto;
}

.factor-tabs {
  align-items: center;
}

.factor-tabs-note {
  margin-left: auto;
  color: var(--subtle);
  font-size: 13px;
  white-space: nowrap;
}

.factor-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.factor-summary-strip div {
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.factor-summary-strip span {
  display: block;
  color: var(--subtle);
  font-size: 12px;
}

.factor-summary-strip b {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  line-height: 1.1;
}

.factor-overview-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.factor-overview-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: var(--text);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.factor-overview-card:hover {
  border-color: var(--primary-ui);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  text-decoration: none;
  transform: translateY(-2px);
}

.factor-card-head {
  display: grid;
  gap: 2px;
}

.factor-card-head span {
  color: var(--primary);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 800;
}

.factor-card-head b {
  font-size: 14px;
}

.factor-card-metric,
.factor-card-reference {
  display: grid;
  gap: 3px;
}

.factor-card-metric span,
.factor-card-reference span {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 700;
}

.factor-card-metric b {
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
}

.factor-card-reference {
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: baseline;
  width: fit-content;
  max-width: 100%;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--primary-soft);
}

.factor-card-reference b {
  color: var(--primary);
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
}

.factor-card-reference small {
  color: var(--subtle);
  font-size: 11px;
  white-space: nowrap;
}

.factor-card-sub,
.factor-overview-card small {
  color: var(--subtle);
  font-size: 12px;
}

.factor-overview-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.factor-meter {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-mid);
}

.factor-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary-ui);
}

.factor-meter.arg span,
.factor-meter.mgc span { background: var(--warning); }
.factor-meter.prophage span { background: #8b5cf6; }
.factor-meter.rrna span { background: var(--success); }
.factor-meter.vfdb span { background: var(--critical); }

.factor-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: 14px;
  align-items: start;
}

.factor-source-list {
  display: grid;
  gap: 10px;
}

.factor-source-list div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.factor-source-list span,
.factor-source-list small {
  color: var(--subtle);
  line-height: 1.45;
}

.factor-search-panel {
  margin-bottom: 14px;
}

.factor-search-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.factor-search-line label {
  display: grid;
  gap: 6px;
}

.factor-search-line label span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 700;
}

.factor-result-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  color: var(--muted);
}

.factor-result-list {
  display: grid;
  gap: 12px;
}

.factor-result-card {
  display: grid;
  gap: 12px;
}

.factor-result-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.factor-result-head h3 {
  margin: 8px 0 0;
  font-size: 20px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.factor-result-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(88px, auto));
  gap: 8px;
  align-items: stretch;
  min-width: 220px;
  text-align: right;
}

.factor-result-metrics div {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.factor-result-metrics b {
  color: var(--text);
  font-size: 18px;
  line-height: 1;
}

.factor-result-metrics span {
  color: var(--subtle);
  font-size: 11px;
  white-space: nowrap;
}

.factor-result-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.factor-result-foot {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--subtle);
  font-size: 12px;
}

.factor-result-foot span {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-low);
}

.factor-external-ref {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--primary-ui);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f4f8ff 0%, #ffffff 100%);
}

.factor-external-ref.phrogs-ref {
  border-left-color: #8b5cf6;
  background: linear-gradient(180deg, #f8f5ff 0%, #ffffff 100%);
}

.factor-external-ref-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.factor-external-ref-head b {
  color: var(--primary);
}

.factor-external-ref-head span,
.factor-external-ref small {
  color: var(--subtle);
  font-size: 12px;
}

.factor-ref-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.factor-ref-grid div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.8);
}

.factor-ref-grid span {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 700;
}

.factor-ref-grid b {
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.factor-ref-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.factor-ref-tags span {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-low);
  color: var(--muted);
  font-size: 11px;
}

.science-notice.compact {
  padding: 10px 12px;
  margin: 0;
}

.science-notice.compact p {
  margin: 3px 0 0;
  font-size: 12px;
}

.factor-compact-table {
  min-width: 780px;
}

.entity-hero {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.entity-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.entity-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.entity-hero h1 {
  margin: 0;
  color: var(--primary);
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.entity-hero p {
  margin: 0;
  color: var(--subtle);
}

.species-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-low);
  margin-bottom: 12px;
  align-items: center;
}

.species-hero-name h1 {
  margin: 0 0 4px 0;
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.species-hero-name p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.species-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.hero-stat {
  padding: 8px 10px;
  border-left: 3px solid var(--line-soft);
  background: var(--surface);
  border-radius: 4px;
  min-width: 0;
}

.hero-stat.ok {
  border-left-color: var(--success);
}

.hero-stat.warn {
  border-left-color: var(--warning);
}

.hero-stat b {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 3px;
}

.hero-stat span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.entity-health-panel {
  display: grid;
  gap: 10px;
}

.entity-health-compact {
  display: grid;
  grid-template-columns: minmax(180px, 0.5fr) minmax(0, 1.5fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-low);
}

.entity-health-score-col {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.entity-health-score-col b,
.entity-health-score-col small {
  display: block;
}

.entity-health-score-col b {
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 13px;
}

.entity-health-score-col small {
  color: var(--muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
  font-size: 11px;
}

.entity-score-ring {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  position: relative;
}

.entity-score-ring::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--surface);
}

.entity-score-ring span {
  position: relative;
  z-index: 1;
  color: var(--primary);
  font-size: 20px;
  font-weight: 900;
}

.entity-health-metrics-col {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.entity-health-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.entity-health-row .row-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  min-width: 64px;
}

.entity-health-row span {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.entity-health-row b {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.entity-health-review {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.entity-health-review article {
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--warning);
  border-radius: 6px;
  background: var(--surface-low);
}

.entity-health-review article.high {
  border-left-color: var(--critical);
}

.entity-health-review article.low {
  border-left-color: var(--success);
}

.entity-health-review b,
.entity-health-review p {
  display: block;
  margin: 0;
}

.entity-health-review b {
  color: var(--ink);
  font-size: 12px;
}

.entity-health-review p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.genome-primary-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
  min-width: 0;
}

.panel > table.genome-identity-table {
  display: table;
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
  overflow: visible;
}

.panel > table.genome-identity-table th {
  width: 150px;
  white-space: nowrap;
}

.panel > table.genome-identity-table td {
  width: auto;
  overflow-wrap: anywhere;
}

.genome-reason-list {
  display: grid;
  gap: 7px;
  padding-left: 18px;
}

.genome-factor-panel {
  margin-bottom: 14px;
  overflow: hidden;
}

.factor-panel-head {
  align-items: center;
  margin-bottom: 12px;
}

.factor-panel-head h2 {
  margin-bottom: 0;
}

.factor-summary-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.factor-risk-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.15fr);
  gap: 12px;
}

.factor-risk-grid > div {
  min-width: 0;
}

.factor-risk-grid p {
  margin: 6px 0 0;
  color: var(--subtle);
}

.factor-risk-pills {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.factor-risk-reasons {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.factor-risk-reasons > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 86px;
  overflow: auto;
}

.factor-type-block {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.factor-type-block h4 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.factor-type-block h4 span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 600;
}

.factor-detail-frame {
  max-height: 360px;
  overflow: auto;
}

.factor-detail-table {
  min-width: 860px;
  font-size: 12px;
}

.factor-detail-table th,
.factor-detail-table td {
  padding: 8px;
}

.factor-detail-table td:nth-child(4) {
  max-width: 360px;
}

.genome-clinical-panel {
  margin-bottom: 14px;
}

.clinical-preview-frame {
  max-height: 420px;
  overflow: auto;
}

.clinical-preview-foot {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
  color: var(--subtle);
  font-size: 13px;
}

.report-document {
  max-width: 1120px;
  width: 100%;
}

.report-console {
  margin-bottom: 16px;
}

.report-console-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.report-generator-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
}

.report-generator-line h2 {
  margin: 0;
  white-space: nowrap;
}

.report-form {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: stretch;
}

.report-target-field {
  position: relative;
  min-width: 0;
}

.report-target-field input {
  width: 100%;
}

.report-suggestions {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  display: grid;
  gap: 4px;
  max-height: 340px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.report-suggestions[hidden] {
  display: none !important;
}

.report-suggestion-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  text-align: left;
}

.report-suggestion-item:hover {
  background: var(--surface-low);
}

.report-suggestion-item b,
.report-suggestion-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-suggestion-item small {
  color: var(--subtle);
  font-size: 12px;
}

.report-suggestion-item em {
  padding: 3px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.report-preview-layout {
  display: grid;
  grid-template-columns: minmax(220px, 264px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
  min-width: 0;
}

.report-toc-panel {
  position: sticky;
  top: 0;
  display: grid;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  min-width: 0;
}

.report-toc-panel nav {
  display: grid;
  gap: 6px;
}

.report-toc-panel a {
  padding: 8px 10px;
  border-left: 2px solid transparent;
  color: var(--subtle);
}

.report-toc-panel a.active,
.report-toc-panel a:hover {
  border-color: var(--primary-ui);
  background: var(--surface-low);
  color: var(--primary-ui);
  text-decoration: none;
}

.report-actions {
  display: grid;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.report-actions button {
  width: 100%;
  gap: 8px;
}

.report-template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.report-template {
  display: block;
  min-height: 120px;
  padding: 16px;
  text-align: left;
  background: #fff;
  min-width: 0;
}

.report-template span {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 800;
}

.report-template small {
  display: block;
  color: var(--subtle);
  line-height: 1.5;
}

.report-template.active {
  border-color: var(--primary-ui);
  border-bottom: 2px solid var(--primary-ui);
  background: var(--primary-soft);
}

.report-variant-shell {
  display: block;
  min-width: 0;
}

.report-variant-docs {
  min-width: 0;
}

.report-variant-pane {
  display: none;
}

.report-variant-pane.active {
  display: block;
}

.report-variant-tabs {
  display: grid;
  gap: 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.report-variant-tabs.empty {
  opacity: 0.48;
}

.report-variant-tab {
  display: grid;
  gap: 5px;
  min-height: 58px;
  padding: 9px 10px;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.report-variant-tab b {
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.report-variant-tab span {
  color: var(--subtle);
  font-size: 11px;
  line-height: 1.35;
}

.report-variant-tab.active {
  border-left-color: var(--primary-ui) !important;
  background: var(--surface-low) !important;
  color: var(--primary-ui) !important;
}

.report-variant-tab.active b {
  color: var(--primary-ui);
}

.report-variant-tab.active span {
  color: var(--muted);
}

.demo-report-card {
  display: grid;
  gap: 10px;
}

.demo-report-card .button {
  width: fit-content;
}

.recent-report-list {
  display: grid;
  gap: 10px;
}

.recent-report-list a {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
  color: var(--text);
}

.recent-report-list a:hover {
  border-color: var(--primary-ui);
  text-decoration: none;
}

.recent-report-list span {
  color: var(--subtle);
  font-size: 12px;
}

.report-brief {
  max-width: 1120px;
}

.demo-report-stack {
  display: grid;
  gap: 8px;
}

.demo-report-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: auto;
  padding: 12px;
  text-align: left;
  min-width: 0;
}

.demo-report-row b,
.demo-report-row small {
  display: block;
}

.demo-report-row small {
  margin-top: 4px;
  color: var(--subtle);
  line-height: 1.45;
}

.report-doc-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--primary-ui);
}

.report-doc-header h2 {
  margin: 6px 0 0;
  color: var(--primary);
  font-size: 30px;
  line-height: 1.2;
}

.report-doc-meta {
  color: var(--subtle);
  font-size: 12px;
  text-align: right;
  white-space: normal;
}

.report-placeholder {
  display: grid;
  align-content: start;
  gap: 18px;
}

.report-meta-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
  color: var(--subtle);
  font-size: 12px;
}

.report-meta-row span {
  padding: 5px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface-low);
}

.report-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.report-section h3 {
  margin-top: 0;
}

.report-section[id] {
  scroll-margin-top: 20px;
}

.knowledge-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 8px;
}

.toc a {
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--muted);
}

.toc a:hover {
  background: var(--surface-low);
  text-decoration: none;
}

.knowledge-entry dl {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px 14px;
  margin: 12px 0 0;
}

.knowledge-entry dt {
  color: var(--subtle);
  font-weight: 700;
}

.knowledge-entry dd {
  margin: 0;
  line-height: 1.6;
}

.knowledge-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 264px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  min-width: 0;
}

.knowledge-toc {
  position: sticky;
  top: 80px;
  display: grid;
  gap: 18px;
}

.knowledge-toc h3 {
  margin: 0;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.knowledge-toc nav {
  display: grid;
  gap: 5px;
  padding-left: 14px;
  border-left: 1px solid var(--line-soft);
}

.knowledge-toc nav a {
  margin-left: -15px;
  padding: 8px 10px 8px 14px;
  border-left: 2px solid transparent;
  color: var(--subtle);
}

.knowledge-toc nav a.active,
.knowledge-toc nav a:hover {
  border-left-color: var(--primary-ui);
  color: var(--primary-ui);
  background: var(--surface-low);
  text-decoration: none;
}

.knowledge-paths {
  display: grid;
  gap: 10px;
}

.knowledge-paths a {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.knowledge-paths a:hover {
  border-color: var(--primary-ui);
  text-decoration: none;
}

.knowledge-paths small {
  color: var(--subtle);
  line-height: 1.45;
}

.knowledge-article {
  width: 100%;
  max-width: none;
  min-width: 0;
  padding: 28px 32px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.knowledge-article header {
  margin-bottom: 30px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line-soft);
}

.knowledge-article h1 {
  margin: 8px 0 14px;
  color: var(--text);
  font-size: 38px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.knowledge-article header p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.knowledge-article-section {
  margin-top: 34px;
  scroll-margin-top: 18px;
}

.knowledge-article-section h2 {
  margin: 0 0 14px;
  font-size: 21px;
  line-height: 1.35;
}

.knowledge-article-section p {
  color: var(--muted);
  line-height: 1.7;
}

.table-frame {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  max-width: 100%;
}

.table-frame table {
  margin-top: 0;
}

.project-page {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.project-sidebar,
.project-main,
.project-workbench,
.project-hero-panel {
  min-width: 0;
}

.project-sidebar {
  position: sticky;
  top: 82px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  max-height: calc(100vh - 104px);
}

.project-list-head,
.section-head.compact {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.project-list-head h2,
.section-head.compact h2 {
  margin-bottom: 2px;
  font-size: 16px;
}

.project-list-head .section-desc {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
}

.project-add-button,
.project-list-item button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
  color: var(--primary-ui);
  cursor: pointer;
}

.project-add-button:hover,
.project-list-item button:hover {
  border-color: rgba(0, 55, 120, 0.34);
  background: rgba(224, 231, 255, 0.72);
}

.project-list {
  display: grid;
  gap: 6px;
  align-content: start;
  overflow: auto;
  min-height: 0;
}

.project-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 5px;
  align-items: center;
  padding: 6px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
}

.project-list-item a {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 1px 3px;
  color: var(--text);
  text-decoration: none;
}

.project-list-item:hover,
.project-list-item.active {
  border-color: rgba(0, 55, 120, 0.34);
  background: rgba(224, 231, 255, 0.55);
}

.project-list-item a b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.25;
}

.project-list-item a span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.project-form {
  display: grid;
  gap: 8px;
}

.project-modal {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 34px 90px rgba(15, 23, 42, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.project-modal-backdrop {
  z-index: 2200;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.82), transparent 34%),
    #eef3f8;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.modal-open .app-footer {
  visibility: hidden;
  pointer-events: none;
}

.project-modal-form {
  padding: 8px 22px 18px;
}

.project-modal-form .project-note-field {
  grid-column: 1 / -1;
}

.project-form label {
  display: grid;
  gap: 4px;
}

.project-form label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.project-form input,
.project-form select {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font: inherit;
}

.project-modal-form input,
.project-modal-form select {
  min-height: 38px;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.96);
  border-color: rgba(148, 163, 184, 0.34);
}

.modal-actions .danger {
  margin-right: auto;
  border-color: rgba(220, 38, 38, 0.22);
  color: var(--critical);
}

.project-main {
  display: grid;
  gap: 14px;
}

.project-hero-panel {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px;
}

.project-hero-panel h1 {
  margin: 2px 0 4px;
  font-size: 24px;
  line-height: 1.2;
}

.project-hero-panel p {
  margin: 0;
  color: var(--muted);
}

.project-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.project-view-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.project-density-control {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.project-density-control button {
  min-height: 28px;
  padding: 4px 10px;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.project-density-control button.active {
  background: #fff;
  color: var(--primary-ui);
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.08);
}

.project-section-bulk-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.project-section-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.project-section-toggle {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  color: var(--primary-ui);
  cursor: pointer;
}

.project-section-toggle .material-symbols-outlined {
  font-size: 18px;
  line-height: 1;
}

.project-section-panel.is-collapsed > :not(.section-head) {
  display: none !important;
}

.project-section-panel.is-collapsed {
  padding-bottom: 8px;
}

.project-matrix-frame,
.project-regulatory-source-frame,
.project-regulatory-table-frame,
.project-review-table-frame,
.project-validation-table-frame,
.project-experiment-table-frame {
  max-width: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.project-pool-list,
.project-score-history,
.project-assay-grid,
.project-experiment-coverage-grid {
  max-height: 260px;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.project-score-history {
  max-height: 220px;
}

.project-assay-grid {
  max-height: 230px;
}

.project-experiment-coverage-grid {
  max-height: 300px;
}

.project-matrix-frame {
  max-height: min(58vh, 640px);
}

.project-regulatory-source-frame {
  max-height: min(42vh, 420px);
}

.project-regulatory-table-frame,
.project-review-table-frame,
.project-validation-table-frame,
.project-experiment-table-frame {
  max-height: min(64vh, 720px);
}

.project-matrix-table thead th,
.project-regulatory-source-table thead th,
.project-regulatory-table thead th,
.project-review-table thead th,
.project-validation-table thead th,
.project-experiment-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: inset 0 -1px 0 var(--line-soft);
}

.project-main.density-compact {
  gap: 10px;
}

.project-main.density-detailed {
  gap: 18px;
}

.project-main.density-compact .project-hero-panel,
.project-main.density-compact .project-workbench,
.project-main.density-compact .project-pool-panel,
.project-main.density-compact .project-score-panel,
.project-main.density-compact .project-validation-panel,
.project-main.density-compact .project-review-card-panel,
.project-main.density-compact .project-regulatory-panel,
.project-main.density-compact .project-experiment-panel {
  padding: 12px;
}

.project-main.density-compact .project-pool-panel,
.project-main.density-compact .project-score-panel,
.project-main.density-compact .project-validation-panel,
.project-main.density-compact .project-review-card-panel,
.project-main.density-compact .project-regulatory-panel,
.project-main.density-compact .project-experiment-panel {
  gap: 8px;
}

.project-main.density-compact .section-head.compact {
  align-items: center;
  margin-bottom: 4px;
}

.project-main.density-compact .section-head.compact h2 {
  font-size: 15px;
}

.project-main.density-compact .section-desc {
  line-height: 1.35;
}

.project-main.density-compact .project-metric {
  padding: 8px;
}

.project-main.density-compact .project-metric b {
  font-size: 18px;
}

.project-main.density-compact .project-pool-item,
.project-main.density-compact .project-weight-control,
.project-main.density-compact .project-experiment-form {
  padding: 8px;
}

.project-main.density-compact .project-regulatory-source-frame {
  max-height: min(36vh, 320px);
}

.project-main.density-compact .project-matrix-frame {
  max-height: min(52vh, 520px);
}

.project-main.density-compact .project-regulatory-table-frame,
.project-main.density-compact .project-review-table-frame,
.project-main.density-compact .project-validation-table-frame,
.project-main.density-compact .project-experiment-table-frame {
  max-height: min(56vh, 560px);
}

.project-main.density-compact .project-pool-list,
.project-main.density-compact .project-score-history,
.project-main.density-compact .project-assay-grid,
.project-main.density-compact .project-experiment-coverage-grid {
  max-height: 190px;
}

.project-main.density-compact .project-matrix-table th,
.project-main.density-compact .project-matrix-table td,
.project-main.density-compact .project-regulatory-source-table th,
.project-main.density-compact .project-regulatory-source-table td,
.project-main.density-compact .project-regulatory-table th,
.project-main.density-compact .project-regulatory-table td,
.project-main.density-compact .project-review-table th,
.project-main.density-compact .project-review-table td,
.project-main.density-compact .project-validation-table th,
.project-main.density-compact .project-validation-table td,
.project-main.density-compact .project-experiment-table th,
.project-main.density-compact .project-experiment-table td {
  padding: 5px 6px;
  font-size: 12px;
  line-height: 1.3;
}

.project-main.density-compact .project-regulatory-source-table input,
.project-main.density-compact .project-regulatory-source-table select,
.project-main.density-compact .project-regulatory-table input,
.project-main.density-compact .project-regulatory-table select,
.project-main.density-compact .project-regulatory-table textarea,
.project-main.density-compact .project-review-table select,
.project-main.density-compact .project-review-table textarea,
.project-main.density-compact .project-validation-table input,
.project-main.density-compact .project-validation-table select,
.project-main.density-compact .project-validation-table textarea,
.project-main.density-compact .project-experiment-form input,
.project-main.density-compact .project-experiment-form select,
.project-main.density-compact .project-experiment-form textarea {
  min-height: 28px;
  padding: 4px 6px;
  font-size: 12px;
}

.project-main.density-compact .project-regulatory-table textarea,
.project-main.density-compact .project-review-table textarea,
.project-main.density-compact .project-validation-table textarea,
.project-main.density-compact .project-experiment-form textarea {
  min-height: 30px;
  max-height: 56px;
}

.project-main.density-compact .project-table-title {
  gap: 2px;
}

.project-main.density-compact .project-table-title small,
.project-main.density-compact .project-validation-table small,
.project-main.density-compact .project-validation-table em,
.project-main.density-compact .project-experiment-table small,
.project-main.density-compact .project-source-version-text {
  display: -webkit-box;
  max-height: 34px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.project-main.density-detailed .project-hero-panel,
.project-main.density-detailed .project-workbench,
.project-main.density-detailed .project-pool-panel,
.project-main.density-detailed .project-score-panel,
.project-main.density-detailed .project-validation-panel,
.project-main.density-detailed .project-review-card-panel,
.project-main.density-detailed .project-regulatory-panel,
.project-main.density-detailed .project-experiment-panel {
  padding: 18px;
}

.project-main.density-detailed .project-regulatory-source-frame {
  max-height: min(50vh, 540px);
}

.project-main.density-detailed .project-matrix-frame {
  max-height: min(68vh, 780px);
}

.project-main.density-detailed .project-regulatory-table-frame,
.project-main.density-detailed .project-review-table-frame,
.project-main.density-detailed .project-validation-table-frame,
.project-main.density-detailed .project-experiment-table-frame {
  max-height: min(78vh, 920px);
}

.project-main.density-detailed .project-pool-list,
.project-main.density-detailed .project-score-history,
.project-main.density-detailed .project-assay-grid,
.project-main.density-detailed .project-experiment-coverage-grid {
  max-height: 420px;
}

.project-main.density-detailed .project-matrix-table th,
.project-main.density-detailed .project-matrix-table td,
.project-main.density-detailed .project-regulatory-source-table th,
.project-main.density-detailed .project-regulatory-source-table td,
.project-main.density-detailed .project-regulatory-table th,
.project-main.density-detailed .project-regulatory-table td,
.project-main.density-detailed .project-review-table th,
.project-main.density-detailed .project-review-table td,
.project-main.density-detailed .project-validation-table th,
.project-main.density-detailed .project-validation-table td,
.project-main.density-detailed .project-experiment-table th,
.project-main.density-detailed .project-experiment-table td {
  padding: 10px 11px;
  line-height: 1.5;
}

.project-main.density-detailed .project-regulatory-table textarea,
.project-main.density-detailed .project-review-table textarea,
.project-main.density-detailed .project-validation-table textarea,
.project-main.density-detailed .project-experiment-form textarea {
  min-height: 54px;
  max-height: 132px;
}

.project-main.density-detailed .project-table-title small,
.project-main.density-detailed .project-validation-table small,
.project-main.density-detailed .project-validation-table em,
.project-main.density-detailed .project-experiment-table small,
.project-main.density-detailed .project-source-version-text {
  max-height: 96px;
}

.project-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}

.project-metric {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(195, 198, 211, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
}

.project-metric span,
.project-metric small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.project-metric b {
  display: block;
  margin: 3px 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 22px;
  line-height: 1.1;
}

.project-workbench {
  padding: 16px;
}

.project-pool-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.project-pool-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}

.project-pool-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.project-pool-item input {
  margin-top: 2px;
}

.project-pool-item span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.project-pool-item b,
.project-pool-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-pool-item small {
  color: var(--muted);
}

.project-pool-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.project-pool-actions > span:first-child {
  margin-right: auto;
}

.project-score-panel,
.project-validation-panel,
.project-review-card-panel,
.project-regulatory-panel,
.project-experiment-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.project-regulatory-source-grid,
.project-assay-grid,
.project-experiment-coverage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.project-regulatory-source-grid article,
.project-assay-grid span,
.project-experiment-coverage-grid span {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
  color: inherit;
  text-decoration: none;
}

.project-regulatory-source-grid article > div:first-child {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.project-regulatory-source-grid a {
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
}

.project-regulatory-source-grid span,
.project-assay-grid small,
.project-experiment-coverage-grid small {
  color: var(--muted);
  line-height: 1.45;
}

.project-experiment-coverage-grid em {
  color: var(--accent);
  font-style: normal;
  font-weight: 800;
}

.project-regulatory-source-grid label {
  display: grid;
  gap: 3px;
}

.project-regulatory-source-grid small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.project-regulatory-source-grid input,
.project-regulatory-source-grid select {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 6px 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.project-regulatory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.project-regulatory-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-regulatory-status-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
  color: var(--muted);
  font-size: 12px;
}

.project-regulatory-status-row b {
  color: var(--text);
  font-size: 13px;
}

.project-regulatory-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.project-regulatory-card.status-reference_found {
  border-left-color: var(--success);
}

.project-regulatory-card.status-needs_documentation {
  border-left-color: var(--warning);
}

.project-regulatory-card.status-out_of_scope {
  border-left-color: var(--critical);
}

.project-regulatory-card > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  grid-column: 1 / -1;
}

.project-regulatory-card p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
}

.project-regulatory-card label,
.project-experiment-form label {
  display: grid;
  gap: 4px;
}

.project-regulatory-card label span,
.project-experiment-form label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.project-regulatory-card input,
.project-regulatory-card select,
.project-regulatory-card textarea,
.project-experiment-form input,
.project-experiment-form select,
.project-experiment-form textarea {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 7px 9px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.project-experiment-form textarea {
  min-height: 64px;
  max-height: 120px;
  resize: vertical;
}

.project-regulatory-card label.wide {
  grid-column: 1 / -1;
}

.project-regulatory-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  grid-column: 1 / -1;
}

.project-regulatory-source-frame,
.project-regulatory-table-frame {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.project-regulatory-source-table,
.project-regulatory-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: var(--surface);
}

.project-regulatory-source-table {
  min-width: 980px;
}

.project-regulatory-table {
  min-width: 2300px;
}

.project-regulatory-source-table th,
.project-regulatory-source-table td,
.project-regulatory-table th,
.project-regulatory-table td {
  padding: 8px 9px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.project-regulatory-source-table th,
.project-regulatory-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--surface-low);
}

.project-regulatory-source-table tr:last-child td,
.project-regulatory-table tr:last-child td {
  border-bottom: 0;
}

.project-regulatory-row-main td:first-child {
  border-left: 4px solid var(--line);
}

.project-regulatory-row-main.status-reference_found td:first-child {
  border-left-color: var(--success);
}

.project-regulatory-row-main.status-needs_documentation td:first-child {
  border-left-color: var(--warning);
}

.project-regulatory-row-main.status-out_of_scope td:first-child {
  border-left-color: var(--critical);
}

.project-regulatory-source-table th:nth-child(1),
.project-regulatory-source-table td:nth-child(1) {
  width: 30%;
}

.project-regulatory-source-table th:nth-child(2),
.project-regulatory-source-table td:nth-child(2) {
  width: 14%;
}

.project-regulatory-source-table th:nth-child(3),
.project-regulatory-source-table td:nth-child(3) {
  width: 36%;
}

.project-regulatory-source-table th:nth-child(4),
.project-regulatory-source-table td:nth-child(4) {
  width: 13%;
}

.project-regulatory-source-table th:nth-child(5),
.project-regulatory-source-table td:nth-child(5) {
  width: 7%;
}

.project-source-version-text {
  display: block;
  max-height: 48px;
  overflow: auto;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.project-regulatory-source-main-row td {
  border-bottom: 0;
  padding-bottom: 5px;
}

.project-regulatory-source-note-row td {
  padding-top: 0;
  background: color-mix(in srgb, var(--surface-low) 70%, #fff 30%);
}

.project-regulatory-source-note {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
}

.project-regulatory-source-note span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.project-regulatory-table th:nth-child(1),
.project-regulatory-table td:nth-child(1) {
  width: 13%;
}

.project-regulatory-table th:nth-child(2),
.project-regulatory-table td:nth-child(2) {
  width: 9%;
}

.project-regulatory-table th:nth-child(3),
.project-regulatory-table td:nth-child(3) {
  width: 8%;
}

.project-regulatory-table th:nth-child(4),
.project-regulatory-table td:nth-child(4) {
  width: 16%;
}

.project-regulatory-table th:nth-child(5),
.project-regulatory-table td:nth-child(5) {
  width: 15%;
}

.project-regulatory-table th:nth-child(6),
.project-regulatory-table td:nth-child(6) {
  width: 13%;
}

.project-regulatory-table th:nth-child(7),
.project-regulatory-table td:nth-child(7) {
  width: 13%;
}

.project-regulatory-table th:nth-child(8),
.project-regulatory-table td:nth-child(8) {
  width: 10%;
}

.project-regulatory-table th:nth-child(9),
.project-regulatory-table td:nth-child(9) {
  width: 9%;
}

.project-regulatory-source-table input,
.project-regulatory-source-table select,
.project-regulatory-table input,
.project-regulatory-table select,
.project-regulatory-table textarea {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 6px 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.project-regulatory-table textarea {
  min-height: 34px;
  max-height: 68px;
  resize: vertical;
}

.project-regulatory-table input + input {
  margin-top: 6px;
}

.project-regulatory-source-actions,
.project-regulatory-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

.project-regulatory-source-actions .project-regulatory-save-icon,
.project-regulatory-actions .project-regulatory-save-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-color: rgba(0, 55, 120, 0.2);
  background: rgba(224, 231, 255, 0.62);
  color: var(--primary-ui);
}

.project-regulatory-row-main td {
  border-bottom: 1px solid var(--line-soft);
  padding-top: 8px;
  padding-bottom: 8px;
}

.project-regulatory-row-detail td {
  padding: 0 10px 12px;
  background: color-mix(in srgb, var(--surface-low) 70%, #fff 30%);
}

.project-regulatory-detail-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(220px, 1fr) minmax(240px, 1.1fr) minmax(240px, 1.1fr) minmax(180px, 0.8fr);
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
}

.project-regulatory-detail-grid label {
  display: grid;
  gap: 4px;
}

.project-regulatory-detail-grid label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.project-experiment-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.project-experiment-form label.wide,
.project-experiment-actions {
  grid-column: 1 / -1;
}

.project-experiment-actions {
  display: flex;
  justify-content: flex-end;
}

.project-experiment-table-frame {
  width: 100%;
}

.project-experiment-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  table-layout: fixed;
}

.project-experiment-table th,
.project-experiment-table td {
  padding: 8px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.project-experiment-table th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.project-experiment-table th:nth-child(1),
.project-experiment-table td:nth-child(1) {
  width: 14%;
}

.project-experiment-table th:nth-child(2),
.project-experiment-table td:nth-child(2),
.project-experiment-table th:nth-child(3),
.project-experiment-table td:nth-child(3) {
  width: 10%;
}

.project-experiment-table th:nth-child(4),
.project-experiment-table td:nth-child(4) {
  width: 14%;
}

.project-experiment-table th:nth-child(5),
.project-experiment-table td:nth-child(5) {
  width: 21%;
}

.project-experiment-table th:nth-child(6),
.project-experiment-table td:nth-child(6) {
  width: 22%;
}

.project-experiment-table th:nth-child(7),
.project-experiment-table td:nth-child(7) {
  width: 8%;
  text-align: center;
}

.project-experiment-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

.project-experiment-delete-icon {
  color: var(--critical);
}

.project-experiment-table small {
  display: block;
  color: var(--muted);
}

.project-weight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.project-weight-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 6px 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.project-weight-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.project-weight-control input {
  grid-column: 1 / -1;
  width: 100%;
}

.project-weight-control output {
  color: var(--primary-ui);
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
  text-align: right;
}

.project-score-note-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.project-score-note-row input {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  font: inherit;
}

.project-score-history {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.project-score-history article {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--surface-low);
}

.project-score-history small {
  color: var(--muted);
}

.project-review-table-frame,
.project-validation-table-frame {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.project-review-table,
.project-validation-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
  background: var(--surface);
}

.project-review-table {
  min-width: 1120px;
}

.project-validation-table {
  min-width: 1500px;
}

.project-review-table th,
.project-review-table td,
.project-validation-table th,
.project-validation-table td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.project-review-table th,
.project-validation-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--surface-low);
}

.project-review-table tr:last-child td,
.project-validation-table tr:last-child td {
  border-bottom: 0;
}

.project-review-table td:first-child,
.project-validation-table td:first-child {
  border-left: 4px solid var(--line);
}

.project-review-row.danger td:first-child,
.project-validation-row.status-blocked td:first-child {
  border-left-color: var(--critical);
}

.project-review-row.warn td:first-child,
.project-validation-row.status-in_progress td:first-child,
.project-validation-row.status-planned td:first-child {
  border-left-color: var(--warning);
}

.project-review-row.ok td:first-child,
.project-validation-row.status-completed td:first-child {
  border-left-color: var(--success);
}

.project-review-table th:nth-child(1),
.project-review-table td:nth-child(1) {
  width: 42%;
}

.project-review-table th:nth-child(2),
.project-review-table td:nth-child(2) {
  width: 28%;
}

.project-review-table th:nth-child(3),
.project-review-table td:nth-child(3) {
  width: 22%;
}

.project-review-table th:nth-child(4),
.project-review-table td:nth-child(4) {
  width: 8%;
}

.project-validation-table th:nth-child(1),
.project-validation-table td:nth-child(1) {
  width: 18%;
}

.project-validation-table th:nth-child(2),
.project-validation-table td:nth-child(2) {
  width: 22%;
}

.project-validation-table th:nth-child(3),
.project-validation-table td:nth-child(3) {
  width: 9%;
}

.project-validation-table th:nth-child(4),
.project-validation-table td:nth-child(4) {
  width: 17%;
}

.project-validation-table th:nth-child(5),
.project-validation-table td:nth-child(5) {
  width: 14%;
}

.project-validation-table th:nth-child(6),
.project-validation-table td:nth-child(6) {
  width: 14%;
}

.project-validation-table th:nth-child(7),
.project-validation-table td:nth-child(7) {
  width: 6%;
}

.project-table-title {
  display: grid;
  gap: 4px;
}

.project-table-title b {
  font-size: 14px;
}

.project-table-title small,
.project-validation-table small,
.project-validation-table em {
  display: block;
  color: var(--muted);
  font-style: normal;
}

.project-table-title small,
.project-validation-table small,
.project-validation-table em {
  max-height: 42px;
  overflow: auto;
}

.project-validation-table small,
.project-validation-table em {
  max-height: 34px;
}

.project-review-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 7px;
}

.project-review-counts span {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--surface-low);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.project-review-table select,
.project-review-table textarea,
.project-validation-table input,
.project-validation-table select,
.project-validation-table textarea {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 6px 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.project-review-table textarea,
.project-validation-table textarea {
  min-height: 36px;
  max-height: 76px;
  resize: vertical;
}

.project-review-table input + input,
.project-validation-table input + input,
.project-validation-table textarea + input {
  margin-top: 6px;
}

.project-validation-field-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(118px, 0.9fr);
  gap: 6px;
  align-items: start;
}

.project-validation-field-pair input + input,
.project-validation-field-pair textarea + input {
  margin-top: 0;
}

.project-review-actions,
.project-validation-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
}

.project-review-save-icon,
.project-validation-save-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-color: rgba(0, 55, 120, 0.2);
  background: rgba(224, 231, 255, 0.62);
  color: var(--primary-ui);
}

.project-review-actions .project-review-save-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-color: rgba(0, 55, 120, 0.2);
  background: rgba(224, 231, 255, 0.62);
  color: var(--primary-ui);
}

.project-review-row-main td {
  border-bottom: 0;
  padding-top: 10px;
  padding-bottom: 6px;
}

.project-review-row-detail td {
  padding: 0 10px 12px;
  background: color-mix(in srgb, var(--surface-low) 70%, #fff 30%);
}

.project-review-row-detail td:first-child {
  padding-left: 9px;
}

.project-review-note-line {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
}

.project-review-note-line span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 32px;
}

.project-matrix-frame {
  width: 100%;
}

.project-matrix-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  table-layout: fixed;
}

.project-matrix-table th,
.project-matrix-table td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
  font-size: 12px;
  line-height: 1.35;
}

.project-matrix-table th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.project-matrix-table td small {
  margin-left: 4px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
}

.project-strain-label,
.project-matrix-table td:nth-child(2) i {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-matrix-table th:nth-child(1),
.project-matrix-table td:nth-child(1) {
  width: 22%;
}

.project-matrix-table th:nth-child(2),
.project-matrix-table td:nth-child(2) {
  width: 17%;
}

.project-matrix-table th:nth-child(3),
.project-matrix-table td:nth-child(3),
.project-matrix-table th:nth-child(4),
.project-matrix-table td:nth-child(4),
.project-matrix-table th:nth-child(5),
.project-matrix-table td:nth-child(5),
.project-matrix-table th:nth-child(6),
.project-matrix-table td:nth-child(6) {
  width: 7%;
  white-space: nowrap;
}

.project-matrix-table th:nth-child(7),
.project-matrix-table td:nth-child(7) {
  width: 7%;
  text-align: center;
}

.project-matrix-table th:nth-child(8),
.project-matrix-table td:nth-child(8) {
  width: 12%;
  text-align: center;
}

.project-review-cell .review-pill {
  margin: 0;
}

.project-status-head,
.project-status-cell {
  width: 11%;
}

.project-status-select {
  width: 78px;
  height: 24px;
  min-height: 24px;
  padding: 2px 18px 2px 9px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.96);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.project-status-select.status-enter_experiment {
  border-color: rgba(45, 138, 94, 0.26);
  background: rgba(45, 138, 94, 0.08);
  color: var(--success);
}

.project-status-select.status-need_more_data {
  border-color: rgba(217, 119, 6, 0.28);
  background: rgba(217, 119, 6, 0.08);
  color: var(--warning);
}

.project-status-select.status-hold {
  border-color: rgba(100, 116, 139, 0.3);
  background: rgba(100, 116, 139, 0.08);
  color: var(--slate);
}

.project-matrix-table th:nth-child(10),
.project-matrix-table td:nth-child(10) {
  width: 48px;
  padding-left: 2px;
  padding-right: 4px;
  text-align: center;
}

.project-row-actions-cell {
  vertical-align: middle;
}

.project-row-actions {
  width: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  white-space: nowrap;
}

.project-icon-action {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  line-height: 1;
}

.project-icon-action .material-symbols-outlined {
  font-size: 16px;
  line-height: 1;
}

.project-icon-action:hover {
  border-color: rgba(0, 55, 120, 0.18);
  background: rgba(224, 231, 255, 0.58);
  color: var(--primary-ui);
  text-decoration: none;
}

button.project-icon-action {
  cursor: pointer;
}

.project-empty,
.project-empty-table {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  color: var(--muted);
}

.project-empty .material-symbols-outlined {
  font-size: 38px;
  color: var(--primary-ui);
}

.project-page.project-page-v2 {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  max-width: 1480px;
  margin: 0 auto;
}

.project-page-v2 .project-sidebar {
  position: static;
  top: auto;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
  grid-template-rows: auto;
  align-items: center;
  max-height: none;
  padding: 10px;
}

.project-page-v2 .project-list-head {
  margin: 0;
  align-items: center;
}

.project-page-v2 .project-list-head .section-desc {
  display: none;
}

.project-page-v2 .project-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  min-height: auto;
  padding-bottom: 2px;
}

.project-page-v2 .project-list-item {
  flex: 0 0 220px;
  min-width: 0;
}

.project-main-v2 {
  gap: 10px;
}

.project-main-v2 .project-hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid rgba(195, 198, 211, 0.8);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.92));
}

.project-main-v2 .project-hero-panel h1 {
  margin: 3px 0;
  font-size: 23px;
  line-height: 1.15;
}

.project-main-v2 .project-hero-panel p {
  font-size: 13px;
}

.project-actions-v2 {
  align-items: center;
}

.project-actions-v2 .button {
  min-height: 34px;
  padding: 7px 11px;
}

.project-export-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
}

.project-export-actions .project-icon-action {
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  border-radius: var(--radius);
}

.project-status-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.project-status-strip .project-metric {
  min-height: 72px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.86);
}

.project-status-strip .project-metric b {
  font-size: 20px;
}

.project-workspace-tabs {
  display: flex;
  gap: 6px;
  max-width: 100%;
  overflow-x: auto;
  padding: 7px;
  border: 1px solid rgba(195, 198, 211, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
}

.project-workspace-tab {
  flex: 0 0 auto;
  min-width: 118px;
  min-height: 42px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.project-workspace-tab .material-symbols-outlined {
  font-size: 18px;
}

.project-workspace-tab b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  font-size: 12px;
}

.project-workspace-tab em {
  min-width: 24px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.09);
  color: var(--subtle);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  text-align: center;
}

.project-workspace-tab:hover {
  border-color: rgba(0, 55, 120, 0.18);
  background: rgba(224, 231, 255, 0.42);
}

.project-workspace-tab.active {
  border-color: rgba(0, 55, 120, 0.28);
  background: var(--primary-ui);
  color: #fff;
}

.project-workspace-tab.active em {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.project-main-v2 .project-overview-panel,
.project-main-v2 .project-workbench,
.project-main-v2 .project-pool-panel,
.project-main-v2 .project-score-panel,
.project-main-v2 .project-validation-panel,
.project-main-v2 .project-review-card-panel,
.project-main-v2 .project-regulatory-panel,
.project-main-v2 .project-experiment-panel {
  padding: 16px;
}

.project-main-v2 .project-overview-panel,
.project-main-v2 .project-workbench,
.project-main-v2 .project-pool-panel,
.project-main-v2 .project-score-panel,
.project-main-v2 .project-validation-panel,
.project-main-v2 .project-review-card-panel,
.project-main-v2 .project-regulatory-panel,
.project-main-v2 .project-experiment-panel {
  display: grid;
  gap: 12px;
}

.project-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(280px, 0.85fr);
  gap: 12px;
  align-items: stretch;
}

.project-focus-card {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.project-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.project-card-head h2 {
  margin: 0 0 3px;
  font-size: 15px;
}

.project-priority-list,
.project-progress-stack,
.project-quick-actions {
  display: grid;
  gap: 8px;
}

.project-priority-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 8px 9px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  text-decoration: none;
}

.project-priority-item span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.project-priority-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.project-progress-line {
  display: grid;
  gap: 7px;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
}

.project-progress-line > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.project-progress-line b {
  color: var(--text);
}

.project-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
}

.project-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary-ui);
}

.project-quick-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-quick-actions button {
  min-width: 0;
  min-height: 58px;
  display: grid;
  justify-items: start;
  align-content: center;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.project-quick-actions .material-symbols-outlined {
  color: var(--primary-ui);
  font-size: 20px;
}

.project-quick-actions b {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.project-main-v2 .project-matrix-frame {
  max-height: min(66vh, 760px);
}

.project-main-v2 .project-regulatory-source-frame {
  max-height: min(32vh, 360px);
}

.project-main-v2 .project-regulatory-table-frame,
.project-main-v2 .project-review-table-frame,
.project-main-v2 .project-validation-table-frame,
.project-main-v2 .project-experiment-table-frame {
  max-height: min(62vh, 700px);
}

.project-main-v2 .project-assay-grid {
  max-height: 170px;
}

.project-main-v2 .project-experiment-coverage-grid {
  max-height: 180px;
}

.project-experiment-summary-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.project-main-v2 .project-experiment-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-height: 380px;
  overflow: auto;
  overscroll-behavior: contain;
}

.project-main-v2 .project-experiment-form label.wide {
  grid-column: span 2;
}

.project-main-v2 .project-experiment-actions {
  grid-column: 1 / -1;
}

.project-main-v2 .section-head.compact {
  margin-bottom: 0;
}

.project-main-v2 .section-head.compact h2 {
  font-size: 17px;
}

.project-main-v2 .section-desc {
  max-width: 860px;
  line-height: 1.45;
}

.project-list-page,
.project-detail-page,
.project-edit-page {
  display: grid;
  gap: 12px;
  max-width: 1480px;
  margin: 0 auto;
}

.project-edit-main {
  min-width: 0;
}

.project-edit-chooser,
.project-info-edit-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.project-edit-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.project-edit-choice {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 6px 10px;
  align-items: center;
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  text-decoration: none;
}

.project-edit-choice:hover {
  border-color: rgba(0, 55, 120, 0.28);
  background: rgba(224, 231, 255, 0.38);
}

.project-edit-choice .material-symbols-outlined {
  color: var(--primary-ui);
  font-size: 22px;
}

.project-edit-choice b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-edit-choice em {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-low);
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
}

.project-edit-choice small {
  grid-column: 2 / -1;
  color: var(--muted);
  line-height: 1.45;
}

.project-info-edit-panel .project-modal-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
}

.project-info-edit-panel .project-modal-form .project-note-field,
.project-info-edit-panel .project-modal-form .modal-actions {
  grid-column: 1 / -1;
}

.project-list-hero,
.project-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
}

.project-list-hero h1,
.project-detail-hero h1 {
  margin: 3px 0;
  font-size: 25px;
  line-height: 1.15;
}

.project-list-hero p,
.project-detail-hero p {
  margin: 0;
  color: var(--muted);
}

.project-list-stats,
.project-detail-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.project-list-stats article,
.project-detail-status .project-metric {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
}

.project-list-stats span,
.project-list-stats small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.project-comparison-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.project-comparison-summary .project-metric {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(248, 250, 252, 0.9);
}

.project-comparison-row.danger {
  background: rgba(254, 242, 242, 0.54);
}

.project-comparison-row.warn {
  background: rgba(255, 251, 235, 0.52);
}

.project-comparison-row.ok {
  background: rgba(240, 253, 244, 0.4);
}

.project-matrix-table .id-mono {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.project-matrix-table td small {
  display: block;
  margin: 3px 0 0;
  white-space: normal;
}

.project-matrix-table th:nth-child(n),
.project-matrix-table td:nth-child(n) {
  width: auto;
  text-align: left;
  white-space: normal;
}

.project-matrix-table th:nth-child(1),
.project-matrix-table td:nth-child(1) {
  width: 18%;
}

.project-matrix-table th:nth-child(2),
.project-matrix-table td:nth-child(2) {
  width: 13%;
}

.project-list-stats b {
  display: block;
  margin: 3px 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 22px;
  line-height: 1.1;
}

.project-list-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}

.project-list-form .section-head,
.project-list-form .wide,
.project-list-form-actions {
  grid-column: 1 / -1;
}

.project-list-form label {
  display: grid;
  gap: 4px;
}

.project-list-form label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.project-list-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.project-list-grid {
  display: grid;
  gap: 10px;
}

.project-list-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, auto) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
}

.project-list-card-main {
  min-width: 0;
}

.project-list-card-main h2 {
  margin: 3px 0;
  font-size: 18px;
}

.project-list-card-main a {
  color: var(--text);
  text-decoration: none;
}

.project-list-card-main p {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-list-card-meta {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 8px;
  align-items: center;
}

.project-list-card-meta span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 12px;
}

.project-list-card-meta b {
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
}

.project-list-card-actions,
.project-detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.project-section-edit-link {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.project-section-edit-link .material-symbols-outlined {
  font-size: 16px;
  line-height: 1;
}

.project-detail-section .project-section-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.project-detail-note {
  margin-top: 8px !important;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.project-detail-section {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.project-detail-subsection {
  display: grid;
  gap: 8px;
}

.project-detail-subsection h3 {
  margin: 0;
  font-size: 14px;
}

.project-readonly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.project-readonly-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.project-readonly-card {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.project-readonly-card.danger {
  border-left-color: var(--critical);
}

.project-readonly-card.warn {
  border-left-color: var(--warning);
}

.project-readonly-card.ok {
  border-left-color: var(--success);
}

.project-readonly-card > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.project-readonly-card p {
  margin: 0;
  color: var(--muted);
}

.project-readonly-card dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}

.project-readonly-card dt,
.project-readonly-card dd {
  margin: 0;
}

.project-readonly-card dt {
  color: var(--muted);
  font-size: 11px;
}

.project-readonly-card dd {
  font-weight: 800;
}

.project-strain-registry-table {
  min-width: 900px;
}

.project-strain-registry-table small,
.project-regulatory-table small,
.project-experiment-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.4;
}

.project-audit-list {
  display: grid;
  gap: 8px;
}

.project-audit-list article {
  display: grid;
  grid-template-columns: minmax(145px, auto) minmax(0, 1fr) minmax(180px, auto);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
}

.project-audit-list b {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
}

.project-audit-list small {
  min-width: 0;
  color: var(--muted);
  text-align: right;
}

.project-detail-page input,
.project-detail-page select,
.project-detail-page textarea {
  pointer-events: none;
}

.score-deduct {
  color: var(--critical);
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.candidate-weight {
  color: var(--primary-ui);
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.method-note {
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.method-note p {
  margin: 0 0 10px;
}

.method-note p:last-child {
  margin-bottom: 0;
}

.evidence-grid,
.application-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.evidence-grid div,
.application-grid div {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.evidence-grid span,
.application-grid small {
  color: var(--subtle);
  line-height: 1.45;
}

.application-grid .material-symbols-outlined {
  color: var(--primary-ui);
}

.assistant-board {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 16px;
  margin-bottom: 16px;
  min-width: 0;
}

.rag-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
  gap: 16px;
  min-height: calc(100vh - 160px);
  min-width: 0;
}

.chat-shell {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 620px;
  padding: 0;
  overflow: hidden;
  min-width: 0;
}

.chat-panel {
  display: grid;
  align-content: start;
  gap: 18px;
  overflow: auto;
  padding: 22px;
}

.chat-message {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 800;
}

.chat-message > div:last-child {
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.chat-message.assistant > div:last-child {
  background: #fff;
}

.chat-input {
  position: relative;
  padding: 14px;
  border-top: 1px solid var(--line-soft);
  background: var(--background);
}

.chat-input textarea {
  min-height: 76px;
  padding-right: 54px;
}

.chat-input > .primary {
  position: absolute;
  right: 26px;
  top: 26px;
  width: 36px;
  min-height: 36px;
  padding: 0;
}

.chat-input .actions {
  margin-top: 8px;
}

.evidence-sidebar {
  min-height: 620px;
  overflow: auto;
  min-width: 0;
}

.evidence-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.evidence-item p {
  margin: 6px 0;
  color: var(--text);
  line-height: 1.55;
}

.evidence-item small {
  color: var(--subtle);
}

.assistant-workbench {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 330px;
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.assistant-left,
.assistant-center,
.assistant-right {
  min-width: 0;
}

.assistant-left {
  position: sticky;
  top: 112px;
  display: grid;
  gap: 18px;
  padding: 18px;
}

.assistant-left h2 {
  margin: 6px 0 8px;
  font-size: 24px;
  line-height: 1.18;
}

.assistant-left p,
.assistant-source-card span,
.assistant-task span,
.assistant-llm-state span {
  color: var(--subtle);
  line-height: 1.5;
}

.assistant-left h3,
.assistant-side-section h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.assistant-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface-low);
}

.assistant-mode-switch button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
}

.assistant-mode-switch button.active {
  background: var(--primary-ui);
  color: #fff;
}

.assistant-task-list,
.assistant-source-list,
.assistant-evidence-list,
.assistant-action-list {
  display: grid;
  gap: 8px;
}

.assistant-task,
.assistant-source-card {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #fff;
  text-align: left;
}

.assistant-task {
  cursor: pointer;
}

.assistant-task:hover,
.assistant-task.active {
  border-color: rgba(18, 95, 184, 0.38);
  background: #f2f7ff;
}

.assistant-task strong,
.assistant-source-card strong {
  color: var(--text);
  font-size: 14px;
}

.assistant-task span,
.assistant-source-card span {
  font-size: 12px;
}

.assistant-center {
  display: grid;
  grid-template-rows: minmax(540px, calc(100vh - 250px)) auto;
  padding: 0;
  overflow: hidden;
}

.assistant-chat {
  display: grid;
  align-content: start;
  gap: 14px;
  overflow: auto;
  padding: 18px;
  min-width: 0;
}

.assistant-message {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.assistant-message > div:last-child {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: #fff;
}

.assistant-message.user > div:last-child {
  background: #f7f9fe;
}

.assistant-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #0a4d9c, #082b5a);
  color: #fff;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 900;
}

.assistant-answer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 10px;
}

.assistant-answer-head h2 {
  margin: 4px 0 0;
  font-size: 24px;
}

.assistant-summary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.assistant-summary-pills span {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-ui);
  font-size: 12px;
  font-weight: 700;
}

.assistant-main-answer {
  margin: 12px 0 16px;
  color: var(--text);
  line-height: 1.65;
  white-space: pre-line;
}

.assistant-answer-section {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--surface-low);
}

.assistant-answer-section h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.assistant-answer-section ul,
.assistant-answer-section ol {
  margin: 0;
  padding-left: 18px;
}

.assistant-answer-section li {
  margin: 5px 0;
  color: var(--muted);
  line-height: 1.55;
}

.assistant-composer {
  position: relative;
  padding: 14px;
  border-top: 1px solid var(--line-soft);
  background: #fff;
}

.assistant-composer textarea {
  min-height: 88px;
  padding-right: 58px;
  resize: vertical;
}

.assistant-composer .primary {
  position: absolute;
  right: 26px;
  top: 26px;
  width: 38px;
  min-height: 38px;
  padding: 0;
}

.assistant-right {
  position: sticky;
  top: 112px;
  display: grid;
  gap: 16px;
  max-height: calc(100vh - 132px);
  overflow: auto;
  padding: 18px;
}

.assistant-side-section {
  display: grid;
  gap: 8px;
}

.assistant-evidence-card {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #fff;
}

.assistant-evidence-index {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-ui);
  font-size: 12px;
  font-weight: 800;
}

.assistant-evidence-card p {
  margin: 4px 0 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.assistant-evidence-card a {
  font-size: 12px;
  font-weight: 800;
}

.assistant-llm-state {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(14, 145, 104, 0.2);
  border-radius: 14px;
  background: #eefbf7;
}

.assistant-loading {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 260px;
  color: var(--muted);
  text-align: center;
}

.factor-loader {
  width: 34px;
  height: 34px;
  border: 3px solid var(--primary-soft);
  border-top-color: var(--primary-ui);
  border-radius: 999px;
  animation: lc-spin 0.8s linear infinite;
}

.assistant-conversation-page {
  display: block;
  max-width: none;
  min-height: calc(100vh - 118px);
}

.assistant-conversation-main {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: calc(100vh - 118px);
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  overflow: hidden;
}

.assistant-conversation-stream {
  display: grid;
  align-content: start;
  gap: 22px;
  min-height: 0;
  padding: 28px clamp(18px, 5vw, 72px) 22px;
  overflow: auto;
  background: transparent;
}

.assistant-empty-state {
  width: min(980px, 100%);
  min-height: 52vh;
  margin: 0 auto;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 28px;
  text-align: center;
}

.home-hero-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 4px;
}

.home-hero-brand img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.home-hero-brand b {
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
}

.assistant-empty-state h1 {
  max-width: 860px;
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.assistant-empty-state p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.assistant-turn {
  width: min(1100px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 9px;
  min-width: 0;
}

.assistant-turn-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  padding: 0 4px;
}

.assistant-turn-user .assistant-turn-meta {
  justify-content: flex-end;
}

.assistant-turn-meta time {
  line-height: 1;
}

.assistant-turn-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.assistant-turn-actions time {
  margin-right: 6px;
}

.assistant-turn-actions button {
  background: transparent;
  border: 0;
  padding: 4px;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  transition: background 120ms ease, color 120ms ease;
}

.assistant-turn-actions button:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

.assistant-turn-actions button .material-symbols-outlined {
  font-size: 16px;
  line-height: 1;
}

.assistant-turn-user .assistant-turn-actions {
  order: -1;
}

.assistant-actor {
  min-width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.assistant-actor-user {
  width: 30px;
  padding: 0;
  background: var(--primary-ui);
  color: #fff;
}

.assistant-actor-user .material-symbols-outlined {
  font-size: 18px;
}

.assistant-actor-ai {
  background: #0f172a;
  color: #fff;
}

.assistant-actor-system {
  border: 1px solid var(--line-soft);
  background: #f8fafc;
  color: #475569;
}

.assistant-user-bubble {
  width: min(760px, 82%);
  justify-self: end;
  padding: 11px 15px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: #eef2ff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.assistant-user-bubble p,
.assistant-response-text p {
  margin: 0 0 10px;
  line-height: 1.68;
}

.assistant-user-bubble p:last-child,
.assistant-response-text p:last-child {
  margin-bottom: 0;
}

.assistant-response-grid {
  display: block;
  min-width: 0;
}

.assistant-response-card {
  min-width: 0;
  display: grid;
  gap: 14px;
  padding: 4px 4px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.assistant-response-text {
  color: var(--text);
  font-size: 15px;
  line-height: 1.72;
}

.assistant-markdown h1,
.assistant-markdown h2,
.assistant-markdown h3 {
  margin: 18px 0 8px;
  color: var(--text);
  font-weight: 850;
  line-height: 1.28;
}

.assistant-markdown h1 {
  font-size: 24px;
}

.assistant-markdown h2 {
  font-size: 20px;
}

.assistant-markdown h3 {
  font-size: 17px;
}

.assistant-markdown p {
  margin: 0 0 12px;
}

.assistant-markdown ul,
.assistant-markdown ol {
  margin: 8px 0 14px;
  padding-left: 24px;
}

.assistant-markdown li {
  margin: 5px 0;
  line-height: 1.66;
}

.assistant-markdown a {
  color: var(--primary-ui);
  text-decoration: none;
  border-bottom: 1px solid rgba(10, 77, 161, 0.28);
}

.assistant-markdown strong {
  font-weight: 850;
}

.assistant-markdown code {
  padding: 2px 5px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 6px;
  background: #f1f5f9;
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
}

.assistant-markdown pre {
  margin: 12px 0 16px;
  padding: 13px 14px;
  overflow: auto;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
}

.assistant-markdown pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  white-space: pre;
}

.assistant-markdown blockquote {
  margin: 12px 0 16px;
  padding: 8px 12px;
  border-left: 3px solid var(--primary-ui);
  background: rgba(241, 245, 249, 0.72);
  color: var(--muted);
}

.assistant-markdown-table {
  max-width: 100%;
  margin: 12px 0 16px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fff;
}

.assistant-markdown-table table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 13px;
}

.assistant-markdown-table th,
.assistant-markdown-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.assistant-markdown-table th {
  background: var(--surface-low);
  color: var(--muted);
  font-weight: 850;
}

.assistant-provider-note {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.assistant-generated-image {
  display: grid;
  gap: 6px;
  margin: 0;
  width: min(760px, 100%);
}

.assistant-generated-image img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.assistant-generated-image figcaption {
  color: var(--muted);
  font-size: 12px;
}

.assistant-evidence-drawer {
  width: min(1100px, 100%);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
}

.assistant-evidence-drawer summary {
  cursor: pointer;
  padding: 9px 12px;
  color: var(--muted);
  font-weight: 800;
}

.assistant-evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
  padding: 0 12px 12px;
}

.assistant-evidence-grid article {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.assistant-evidence-grid p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.compact-evidence-grid {
  gap: 6px;
}

.compact-evidence-grid article {
  padding: 8px 9px;
}

.compact-evidence-grid b {
  font-size: 12px;
}

.compact-evidence-grid p,
.compact-evidence-grid span {
  font-size: 11px;
  line-height: 1.35;
}

.assistant-image-strip,
.assistant-attachment-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.assistant-image-strip img {
  width: 92px;
  height: 70px;
  object-fit: cover;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.assistant-dock-composer {
  width: min(1040px, calc(100% - 32px));
  display: grid;
  gap: 8px;
  justify-self: center;
  margin: 0 auto 14px;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.1);
}

.assistant-context-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.assistant-context-tags {
  min-width: 0;
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 8px;
}

.assistant-context-tags span {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-low);
}

.assistant-clear-button {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.assistant-clear-button:hover {
  color: var(--primary-ui);
  border-color: rgba(10, 77, 161, 0.28);
  background: rgba(10, 77, 161, 0.04);
}

.assistant-clear-button .material-symbols-outlined {
  font-size: 16px;
}

.assistant-input-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: end;
}

.assistant-file-button,
.assistant-send-button,
.assistant-cancel-button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
}

.assistant-file-button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.assistant-file-button input {
  display: none;
}

.assistant-input-row textarea {
  width: 100%;
  min-height: 42px;
  max-height: 180px;
  padding: 10px 4px;
  border: 0;
  border-radius: 0;
  resize: none;
  font: inherit;
  line-height: 1.5;
  outline: none;
}

.assistant-send-button {
  border-radius: 999px;
}

.assistant-cancel-button {
  border: 0;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.08);
  color: var(--critical);
  cursor: pointer;
}

.assistant-attachment-strip {
  margin-top: 0;
}

.assistant-attachment-strip span {
  position: relative;
  display: inline-block;
}

.assistant-attachment-strip img {
  width: 74px;
  height: 56px;
  object-fit: cover;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.assistant-attachment-strip button {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: #fff;
  color: var(--critical);
  cursor: pointer;
}

.assistant-attachment-strip .material-symbols-outlined {
  font-size: 14px;
}

@keyframes lc-spin {
  to {
    transform: rotate(360deg);
  }
}

.topic-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.topic-tabs button {
  min-height: 36px;
}

.topic-tabs button.active {
  border-color: var(--primary-ui);
  border-bottom: 2px solid var(--primary-ui);
  background: var(--primary-soft);
  color: var(--primary-ui);
}

.science-stage {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
  gap: 16px;
  margin-bottom: 16px;
  align-items: stretch;
}

.science-copy,
.science-visual {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.science-copy {
  padding: 24px;
}

.science-copy h2 {
  margin: 8px 0 12px;
  font-size: 34px;
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: 0;
}

.science-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.science-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 18px;
}

.science-tags span {
  padding: 5px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--subtle);
  background: var(--surface-low);
  font-size: 12px;
}

.science-example {
  margin: 14px 0 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.science-example h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.science-visual {
  position: relative;
  overflow: hidden;
  min-height: 430px;
  background:
    radial-gradient(circle at 48% 38%, rgba(10, 77, 161, 0.12), transparent 31%),
    linear-gradient(135deg, #ffffff, #eef4fb);
}

.science-visual::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  pointer-events: none;
}

.science-visual canvas {
  display: block;
  width: 100%;
  height: 430px;
  cursor: grab;
}

.science-visual canvas:active {
  cursor: grabbing;
}

.viewer-caption {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  color: var(--text);
  line-height: 1.45;
}

.science-list div,
.hotspot-button {
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
  color: var(--text);
  text-align: left;
}

.hotspot-button {
  display: grid;
  gap: 5px;
  min-height: auto;
}

.hotspot-button span {
  color: var(--subtle);
  line-height: 1.5;
}

.hotspot-button:hover {
  background: var(--primary-soft);
}

.science-topic-tabs {
  margin-bottom: 18px;
}

.science-bento {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(320px, 4fr);
  gap: 18px;
  margin-bottom: 18px;
}

.science-hero-card,
.science-mini-card {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.science-canvas-wrap {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(173, 198, 255, 0.34), transparent 30%),
    linear-gradient(135deg, #003778, #001a41);
}

.science-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 420px;
  cursor: grab;
}

.science-canvas-wrap canvas:active {
  cursor: grabbing;
}

.science-canvas-wrap .viewer-caption {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.visual-hotspot {
  position: absolute;
  z-index: 2;
  min-height: 30px;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  backdrop-filter: blur(12px);
}

.visual-hotspot:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.hotspot-1 { left: 18%; top: 28%; }
.hotspot-2 { right: 18%; top: 58%; }
.hotspot-3 { left: 42%; bottom: 28%; }

.hotspot-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ffb692;
  box-shadow: 0 0 0 5px rgba(255, 182, 146, 0.24);
}

.science-card-body {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  flex-wrap: wrap;
  padding: 18px 18px 8px;
}

.science-card-body h2 {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 22px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.mini-label {
  display: inline-flex;
  width: fit-content;
  padding: 4px 7px;
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--primary-ui);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.science-card-copy {
  margin: 0;
  padding: 0 18px 18px;
  color: var(--muted);
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.science-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 0 18px 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.science-highlights div {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.science-highlights .material-symbols-outlined {
  color: var(--primary-ui);
  font-size: 18px;
}

button.active {
  background: var(--primary-soft) !important;
  border-color: var(--primary-ui) !important;
  color: var(--primary-ui) !important;
}

.science-side-stack {
  display: grid;
  gap: 18px;
}

.science-mini-card {
  display: grid;
  grid-template-rows: 190px auto;
  min-width: 0;
}

.mini-canvas {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(224, 231, 255, 0.25), transparent 35%),
    linear-gradient(135deg, #334155, #191b21);
}

.mini-canvas.taxonomy {
  background: linear-gradient(135deg, #f9f9ff, #e7e7ef);
}

.mini-canvas canvas {
  display: block;
  width: 100%;
  height: 190px;
}

.mini-caption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 12px;
  backdrop-filter: blur(12px);
}

.taxonomy .mini-caption {
  border-color: var(--line-soft);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
}

.science-card-copy-block {
  padding: 16px;
}

.science-card-copy-block h3 {
  margin: 8px 0 8px;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.science-card-copy-block p {
  margin: 0 0 12px;
  color: var(--subtle);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.science-landing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.38fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.science-landing > div:first-child,
.science-role-split,
.science-path-card,
.science-section-panel {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.science-landing > div:first-child {
  padding: 28px;
}

.science-landing h1 {
  margin: 8px 0 10px;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.05;
  letter-spacing: 0;
}

.science-landing p {
  max-width: 920px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.science-role-split {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.science-role-split div {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.science-role-split b {
  color: var(--primary);
  font-size: 15px;
}

.science-role-split span {
  color: var(--subtle);
  font-size: 13px;
}

.science-path-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.science-path-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  color: var(--text);
  text-decoration: none;
}

.science-path-card:hover {
  border-color: rgba(10, 77, 161, 0.42);
  background: #fbfdff;
  text-decoration: none;
}

.science-path-card b {
  font-size: 18px;
}

.science-path-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.science-path-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.science-path-card span {
  padding: 5px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface-low);
  color: var(--subtle);
  font-size: 12px;
}

.science-section-panel {
  margin-bottom: 18px;
  padding: 18px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.science-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.science-video-card {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.science-video-card:hover,
.science-video-card:focus-visible {
  border-color: rgba(10, 85, 170, 0.36);
  box-shadow: var(--shadow-soft);
  outline: none;
  transform: translateY(-2px);
}

.science-video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: radial-gradient(circle at 26% 22%, rgba(255, 255, 255, 0.28), transparent 28%),
    linear-gradient(135deg, #003778, #334155);
}

.science-video-frame video,
.science-video-placeholder {
  width: 100%;
  height: 100%;
}

.science-video-frame video {
  display: block;
  object-fit: cover;
}

.science-video-placeholder {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 14px;
  color: #fff;
  text-align: center;
}

.science-video-placeholder .material-symbols-outlined {
  font-size: 34px;
}

.science-video-placeholder small {
  max-width: 100%;
  color: rgba(255, 255, 255, 0.72);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  overflow-wrap: anywhere;
}

.science-video-body {
  display: grid;
  gap: 8px;
  padding: 13px;
}

.science-video-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.science-video-meta span {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-ui);
  font-size: 11px;
  font-weight: 800;
}

.science-video-body h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}

.science-video-body p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.science-video-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.science-video-tags span {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--surface-low);
  color: var(--subtle);
  font-size: 11px;
  font-weight: 700;
}

.science-video-concept {
  width: fit-content;
  color: var(--primary-ui);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.science-video-modal[hidden] {
  display: none;
}

.science-video-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 84px 24px 24px;
}

.science-video-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 12, 20, 0.72);
  backdrop-filter: blur(12px);
}

.science-video-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  width: min(1120px, 100%);
  max-height: calc(100vh - 112px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  background: #f8fafc;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.35);
  padding: 18px;
}

.science-video-dialog-head,
.science-video-dialog-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.science-video-dialog-head h2 {
  margin: 4px 0 6px;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.15;
}

.science-video-dialog-head p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.science-video-close {
  flex: 0 0 auto;
}

.science-video-large-shell {
  display: grid;
  gap: 12px;
}

.science-video-large-shell iframe {
  width: 100%;
  min-height: min(62vh, 620px);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: #fff;
}

.science-video-open-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(10, 85, 170, 0.16);
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--text);
}

.science-video-open-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.modal-open {
  overflow: hidden;
}

.science-explorer-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.45fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.science-explorer-card {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.science-canvas-wrap.compact {
  min-height: 360px;
}

.science-canvas-wrap.compact canvas {
  height: 360px;
}

.science-topic-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.science-topic-panel h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
}

.science-topic-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.science-highlights.compact {
  grid-template-columns: 1fr;
  margin: 0;
  padding: 0;
  border-top: 0;
}

.science-topic-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

.science-misread-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.science-misread-card {
  box-shadow: none;
}

.science-misread-card b {
  display: block;
  margin-bottom: 8px;
  color: var(--primary);
}

.science-misread-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

@media (max-width: 1380px) {
  .grid.dashboard,
  .report-preview-layout,
  .knowledge-workspace,
  .rag-layout {
    grid-template-columns: 1fr;
  }

  .factor-overview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .factor-two-col {
    grid-template-columns: 1fr;
  }

  .grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-toc-panel,
  .knowledge-toc {
    position: static;
  }

  .report-toc-panel nav,
  .knowledge-toc nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    overflow-x: auto;
    padding-left: 0;
    border-left: 0;
  }

  .report-toc-panel nav a,
  .knowledge-toc nav a {
    flex: 0 1 auto;
    margin-left: 0;
    border-left: 0;
    border-bottom: 2px solid transparent;
    white-space: normal;
  }

  .report-toc-panel a.active,
  .report-toc-panel a:hover,
  .knowledge-toc nav a.active,
  .knowledge-toc nav a:hover {
    border-bottom-color: var(--primary-ui);
  }

  .evidence-sidebar {
    min-height: auto;
  }
}

.standards-page {
  display: flow-root;
}

.standards-page > .panel,
.standards-page > .science-notice {
  margin-bottom: 28px;
}

.standards-page > .panel:last-child,
.standards-page > .science-notice:last-child {
  margin-bottom: 0;
}

.standards-page .section-head {
  margin-bottom: 18px;
}

.standards-page .stat-grid,
.standards-page .factor-summary-strip,
.standards-page .factor-overview-grid,
.standards-page .professional-readiness-grid,
.standards-page .professional-completion-grid,
.standards-page .professional-grade-grid,
.standards-page .professional-plan-grid,
.standards-page .professional-roadmap,
.standards-page .professional-regulatory-source-table,
.standards-page .professional-source-grid,
.standards-page .topology {
  margin-top: 14px;
}

.standards-page .professional-platform-overview .factor-summary-strip {
  margin-top: 18px;
}

.professional-vfdb-category-panel {
  overflow: hidden;
}

.professional-vfdb-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.professional-vfdb-summary span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-low);
  color: var(--muted);
  font-size: 12px;
}

.professional-vfdb-summary b {
  color: var(--text);
  font-family: var(--mono);
}

.professional-vfdb-category-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.full-data-map-panel {
  overflow: hidden;
}

.data-relation-map {
  display: grid;
  gap: 18px;
  margin-top: 16px;
}

.data-relation-layer {
  position: relative;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.data-relation-layer:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 89px;
  bottom: -18px;
  width: 2px;
  height: 18px;
  background: linear-gradient(to bottom, rgba(10, 77, 161, 0.38), rgba(10, 77, 161, 0));
}

.data-relation-layer-title {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 118px;
  padding: 16px;
  border: 1px solid rgba(10, 77, 161, 0.18);
  border-radius: 8px;
  background: rgba(10, 77, 161, 0.06);
}

.data-relation-layer-title span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary-ui);
  color: #fff;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 800;
}

.data-relation-layer-title b {
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
}

.data-relation-node-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.data-relation-node {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.data-relation-node.accent {
  border-color: rgba(45, 138, 94, 0.28);
  background: rgba(236, 253, 245, 0.72);
}

.data-relation-node.attention {
  border-color: rgba(217, 119, 6, 0.3);
  background: rgba(255, 251, 235, 0.76);
}

.data-relation-node.output {
  border-color: rgba(10, 77, 161, 0.28);
  background: rgba(239, 246, 255, 0.8);
}

.data-relation-node h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
}

.data-relation-node p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.data-relation-table-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.data-relation-table-list span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--slate);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  line-height: 1;
}

.data-relation-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.data-relation-flow span {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.data-relation-flow span:not(:last-child)::after {
  content: "→";
  margin-left: 8px;
  color: var(--primary-ui);
}

.professional-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
  gap: 18px;
  align-items: stretch;
}

.professional-hero h1 {
  margin: 8px 0 10px;
  font-size: 30px;
  line-height: 1.18;
}

.professional-hero p,
.professional-boundary span,
.professional-readiness-card p,
.professional-readiness-card small,
.professional-plan-step p,
.professional-plan-step small,
.professional-plan-step em,
.professional-source-card p {
  line-height: 1.65;
}

.professional-boundary {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.04);
}

.professional-readiness-grid,
.professional-completion-grid,
.professional-grade-grid,
.professional-plan-grid,
.professional-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.professional-regulatory-source-table {
  margin-bottom: 14px;
  overflow-x: auto;
}

.professional-regulatory-source-table table {
  min-width: 860px;
}

.professional-readiness-card,
.professional-completion-card,
.professional-grade-card,
.professional-plan-column,
.professional-source-card,
.professional-roadmap-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.professional-readiness-card {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.professional-completion-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-color: rgba(21, 128, 61, 0.22);
  background: rgba(240, 253, 244, 0.62);
}

.professional-completion-card.warn {
  border-color: rgba(217, 119, 6, 0.24);
  background: rgba(255, 251, 235, 0.74);
}

.professional-completion-card.danger {
  border-color: rgba(220, 38, 38, 0.22);
  background: rgba(254, 242, 242, 0.74);
}

.professional-completion-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.professional-completion-card h3 {
  margin: 0;
  font-size: 16px;
}

.professional-completion-card strong {
  color: var(--text);
  font-family: var(--mono);
  font-size: 18px;
}

.professional-completion-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.professional-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.professional-readiness-card h3,
.professional-grade-card h3,
.professional-plan-column h3,
.professional-roadmap-item h3 {
  margin: 0;
}

.professional-readiness-card strong {
  font-family: var(--mono);
  font-size: 22px;
}

.professional-readiness-card.danger {
  border-color: rgba(185, 28, 28, 0.28);
}

.professional-readiness-card.warn {
  border-color: rgba(180, 83, 9, 0.28);
}

.professional-readiness-card.ok {
  border-color: rgba(21, 128, 61, 0.24);
}

.professional-grade-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  padding: 14px;
}

.grade-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.professional-grade-card ul,
.professional-roadmap-item ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.professional-plan-column {
  padding: 14px;
}

.professional-plan-column h3 {
  margin-bottom: 12px;
}

.professional-plan-step {
  display: grid;
  gap: 6px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.professional-plan-step:first-of-type {
  border-top: 0;
}

.professional-plan-step span,
.professional-source-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.professional-plan-step em {
  color: var(--ink);
  font-style: normal;
  font-weight: 700;
}

.professional-roadmap {
  display: grid;
  gap: 12px;
}

.professional-roadmap-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  padding: 14px;
}

.professional-roadmap-item > span {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: rgba(2, 132, 199, 0.1);
  color: #0369a1;
  font-weight: 800;
}

.professional-source-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  color: inherit;
  text-decoration: none;
}

.professional-source-card b {
  font-size: 18px;
}

.screening-method-note {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.04);
}

@media (max-width: 1180px) {
  .project-page {
    grid-template-columns: minmax(200px, 235px) minmax(0, 1fr);
  }

  .project-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-shell {
    grid-template-columns: none;
    grid-template-rows: minmax(0, 1fr);
  }

  .app-nav {
    position: fixed;
    top: 8px;
    left: 10px;
    right: 10px;
    width: auto;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
  }

  .app-nav nav {
    display: flex;
    min-width: 0;
    gap: 6px;
  }

  .nav-link {
    min-width: auto;
  }

  .app-main {
    width: 100%;
    padding: 72px 16px 16px;
  }

  .app-footer {
    grid-template-columns: 1fr;
    width: calc(100% - 32px);
  }

  .content-shell {
    min-height: 100vh;
    overflow: visible;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .annotation-evidence-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .missing-field-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .review-filter-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.two,
  .grid.three,
  .grid.dashboard,
  .search-console-grid,
  .home-insight-grid,
  .species-overview-grid,
  .strain-overview-grid,
  .species-chart-row,
  .grid.search-layout,
  .screening-layout,
  .screening-controls,
  .screening-command-bar,
  .screening-filter-grid,
  .grid.detail-layout,
  .grid.report-layout,
  .genome-primary-grid,
  .factor-risk-grid,
  .rag-layout,
  .assistant-board,
  .assistant-workbench,
  .knowledge-layout,
  .knowledge-workspace,
  .report-preview-layout,
  .report-form,
  .roadmap,
  .report-template-grid,
  .science-stage,
  .science-bento,
  .science-landing,
  .science-path-grid,
  .science-explorer-grid,
  .factor-summary-strip,
  .science-highlights,
  .science-video-grid,
  .science-misread-grid {
    grid-template-columns: 1fr;
  }

  .assistant-left,
  .assistant-right {
    position: static;
    max-height: none;
  }

  .assistant-center {
    grid-template-rows: minmax(420px, auto) auto;
  }

  .factor-tabs {
    align-items: flex-start;
  }

  .factor-tabs-note {
    width: 100%;
    margin-left: 0;
    white-space: normal;
  }

  .screening-tabs {
    flex-wrap: nowrap;
  }

  .screening-inline-filter {
    grid-template-columns: minmax(240px, 1fr) 88px 82px 92px 92px;
    flex-basis: 690px;
  }

  .science-visual,
  .science-visual canvas,
  .science-canvas-wrap,
  .science-canvas-wrap canvas {
    min-height: 380px;
    height: 380px;
  }

  .science-video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .science-misread-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .knowledge-toc,
  .report-toc-panel {
    position: static;
  }

  .account-layout,
  .account-profile-editor {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 720px) {
  .app-main {
    padding: 70px 12px 12px;
  }

  .panel > table.member-genome-table,
  .clinical-wide-panel .clinical-table {
    display: block;
    width: 100%;
    min-width: 0;
    margin-top: 0;
  }

  .panel > table.member-genome-table thead,
  .clinical-wide-panel .clinical-table thead {
    display: none;
  }

  .panel > table.member-genome-table tbody,
  .clinical-wide-panel .clinical-table tbody {
    display: grid;
    gap: 10px;
    padding: 10px;
  }

  .panel > table.member-genome-table tr,
  .clinical-wide-panel .clinical-table tr {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: var(--surface);
  }

  .panel > table.member-genome-table td,
  .clinical-wide-panel .clinical-table td {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    padding: 0;
    border-bottom: 0;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  .panel > table.member-genome-table td::before,
  .clinical-wide-panel .clinical-table td::before {
    display: block;
    margin-bottom: 2px;
    color: var(--subtle);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .clinical-wide-panel .clinical-table td:nth-child(2),
  .clinical-wide-panel .clinical-table td:nth-child(4) {
    grid-column: 1 / -1;
  }

  .panel > table.member-genome-table td:nth-child(1)::before { content: "Genome"; }
  .panel > table.member-genome-table td:nth-child(2)::before { content: "Strain"; }
  .panel > table.member-genome-table td:nth-child(3)::before { content: "Origin"; }
  .panel > table.member-genome-table td:nth-child(4)::before { content: "Quality"; }
  .panel > table.member-genome-table td:nth-child(5)::before { content: "Safety"; }

  .clinical-wide-panel .clinical-table td:nth-child(1)::before { content: "Trial"; }
  .clinical-wide-panel .clinical-table td:nth-child(2)::before { content: "Component"; }
  .clinical-wide-panel .clinical-table td:nth-child(3)::before { content: "Match"; }
  .clinical-wide-panel .clinical-table td:nth-child(4)::before { content: "Reference"; }

  .nav-link {
    min-width: auto;
    min-height: 34px;
    padding: 6px 12px;
  }

  .account-user-modal {
    width: min(420px, calc(100vw - 20px));
  }

  .account-modal-fields {
    grid-template-columns: 1fr;
  }

  .brand-title {
    font-size: 16px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .favorite-menu summary span:last-child {
    display: none;
  }

  .app-footer {
    display: grid;
    grid-template-columns: 1fr;
    width: calc(100% - 24px);
    gap: 10px;
  }

  .source-link {
    width: 100%;
    justify-content: flex-start;
  }

  .page-head {
    display: block;
  }

  .entity-hero {
    display: block;
  }

  .species-hero {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .species-hero-name h1 {
    font-size: 20px;
  }

  .species-hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .entity-toolbar,
  .entity-actions {
    align-items: stretch;
  }

  .entity-mode-tabs {
    width: 100%;
  }

  .entity-mode-tabs a {
    flex: 1 1 0;
    justify-content: center;
  }

  .entity-health-compact,
  .entity-health-metrics-col {
    grid-template-columns: 1fr;
  }

  .entity-health-score-col {
    align-items: flex-start;
  }

  .entity-health-row {
    gap: 10px;
  }

  .factor-contig-row,
  .factor-track {
    grid-template-columns: 1fr;
  }

  .factor-map-legend {
    justify-content: flex-start;
  }

  .factor-proximity-panel h4 {
    display: grid;
  }

  .assistant-left,
  .assistant-center,
  .assistant-right {
    padding: 14px;
  }

  .assistant-message {
    grid-template-columns: 1fr;
  }

  .assistant-answer-head {
    display: grid;
  }

  .assistant-summary-pills span {
    flex: 1 1 calc(50% - 8px);
  }

  .page-head h1 {
    font-size: 20px;
  }

  .page-actions {
    margin-top: 12px;
    max-width: none;
    justify-content: flex-start;
  }

  .page-actions .button,
  .page-actions button,
  .actions .button,
  .actions button {
    max-width: 100%;
  }

  .result-toolbar {
    align-items: stretch;
  }

  .result-toolbar .actions,
  .page-head .actions {
    width: 100%;
  }

  .report-form,
  .report-generator-line,
  .screening-weight-grid,
  .report-template-grid,
  .annotation-evidence-overview,
  .missing-field-summary,
  .safety-review-summary,
  .review-filter-panel,
  .review-stat-grid,
  .stat-grid,
  .workflow-grid,
  .analysis-summary,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .required-field-grid {
    grid-template-columns: 1fr;
  }

  .search-line {
    grid-template-columns: 1fr;
  }

  .search-result-card {
    grid-template-columns: 1fr;
  }

  .search-result-side {
    justify-items: start;
  }

  .search-result-actions {
    justify-content: flex-start;
  }

  .search-filter-strip button {
    margin-left: 0;
  }

  .vfdb-search-line {
    grid-template-columns: 1fr;
  }

  .factor-overview-grid,
  .factor-search-line {
    grid-template-columns: 1fr;
  }

  .factor-card-reference {
    grid-template-columns: auto auto;
  }

  .factor-card-reference small {
    grid-column: 1 / -1;
    white-space: normal;
  }

  .factor-result-head {
    display: grid;
  }

  .factor-result-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    text-align: left;
  }

  .factor-ref-grid {
    grid-template-columns: 1fr;
  }

  .search-line select {
    max-width: none;
  }

  .bar-row {
    grid-template-columns: 100px minmax(0, 1fr);
  }

  .bar-value {
    display: none;
  }

  .donut-layout {
    grid-template-columns: 1fr;
  }

  .species-source-card .donut-layout,
  .module-rank-grid {
    grid-template-columns: 1fr;
  }

  .topic-tabs button {
    flex: 1 1 calc(50% - 6px);
  }

  .science-copy {
    padding: 14px;
  }

  .science-copy h2 {
    font-size: 26px;
  }

  .science-visual,
  .science-visual canvas,
  .science-canvas-wrap,
  .science-canvas-wrap canvas {
    min-height: 330px;
    height: 330px;
  }

  .science-landing > div:first-child,
  .science-section-panel {
    padding: 14px;
  }

  .science-video-grid,
  .science-misread-grid,
  .science-path-grid {
    grid-template-columns: 1fr;
  }

  .science-video-modal {
    padding: 70px 10px 10px;
  }

  .science-video-dialog {
    max-height: calc(100vh - 86px);
    border-radius: 18px;
    padding: 12px;
  }

  .science-video-dialog-head,
  .science-video-dialog-foot,
  .science-video-open-panel {
    display: grid;
  }

  .science-video-large-shell iframe {
    min-height: 420px;
  }

  .section-head {
    display: grid;
  }

  .science-card-body,
  .report-doc-header {
    display: block;
  }

  .report-doc-meta {
    margin-top: 12px;
    text-align: left;
  }

  .knowledge-article,
  .a4-report {
    padding: 20px;
  }

  table {
    min-width: 640px;
  }

  .viewer-caption {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .evidence-item {
    grid-template-columns: 1fr;
  }

  .clinical-table th:first-child,
  .clinical-table td:first-child {
    min-width: 150px;
    width: 150px;
  }

  .knowledge-entry dl {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  .report-generator-line {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .report-generator-line h2 {
    flex: 0 0 auto;
  }

  .report-generator-line .report-form {
    grid-template-columns: 160px 300px auto auto;
    flex: 0 0 720px;
  }
}

@media (max-width: 820px) {
  .professional-hero,
  .professional-roadmap-item {
    grid-template-columns: 1fr;
  }

  .data-relation-layer {
    grid-template-columns: 1fr;
  }

  .data-relation-layer:not(:last-child)::after {
    display: none;
  }

  .data-relation-layer-title {
    min-height: auto;
  }

  .data-relation-node-grid {
    grid-template-columns: 1fr;
  }

  .professional-hero h1 {
    font-size: 26px;
  }

  .project-page {
    grid-template-columns: 1fr;
  }

  .project-sidebar {
    position: static;
  }

  .project-hero-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-view-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-density-control {
    width: 100%;
  }

  .project-density-control button {
    flex: 1 1 0;
  }

  .project-section-bulk-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .project-actions,
  .inline-actions {
    justify-content: flex-start;
  }

  .project-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-validation-form {
    grid-template-columns: 1fr;
  }

  .project-regulatory-card {
    grid-template-columns: 1fr;
  }

  .project-experiment-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-layout {
    grid-template-columns: 1fr;
  }

  .account-sidebar {
    position: static;
  }

  .account-auth-panel,
  .account-auth-panel.logged-in,
  .account-form,
  .account-user-form {
    grid-template-columns: 1fr;
  }

  .account-auth-panel {
    padding: 18px;
  }

  .account-metric-row {
    width: 100%;
  }

  .account-metric {
    flex: 1 1 120px;
  }
}

@media (max-width: 1080px) {
  .assistant-response-grid {
    grid-template-columns: 1fr;
  }

  .project-list-card {
    grid-template-columns: 1fr;
  }

  .project-list-card-actions,
  .project-detail-actions {
    justify-content: flex-start;
  }

  .project-list-hero,
  .project-detail-hero {
    grid-template-columns: 1fr;
  }

  .project-list-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-info-edit-panel .project-modal-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-status-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .project-overview-grid {
    grid-template-columns: 1fr;
  }

  .project-main-v2 .project-experiment-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .project-page-v2 .project-sidebar {
    grid-template-columns: 1fr;
  }

  .project-main-v2 .project-hero-panel {
    grid-template-columns: 1fr;
  }

  .project-status-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .project-workspace-tab {
    min-width: 108px;
  }

}

@media (max-width: 560px) {
  .project-page-v2 .project-sidebar {
    grid-template-columns: 1fr;
  }

  .project-page-v2 .project-list-head {
    align-items: center;
  }

  .project-experiment-form {
    grid-template-columns: 1fr;
  }

  .project-main-v2 .project-experiment-form {
    grid-template-columns: 1fr;
  }

  .project-experiment-summary-row {
    grid-template-columns: 1fr;
  }

  .project-status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-list-form {
    grid-template-columns: 1fr;
  }

  .project-info-edit-panel .project-modal-form {
    grid-template-columns: 1fr;
  }

  .project-list-card-meta {
    grid-template-columns: 1fr;
  }

  .project-readonly-card dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.kg-evidence-page {
  display: grid;
  gap: 10px;
}


.kg-evidence-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding-top: 14px;
  padding-bottom: 14px;
}

.kg-evidence-toolbar h1 {
  margin: 0 0 4px;
  font-size: 22px;
  line-height: 1.2;
}

.kg-evidence-toolbar p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
  font-size: 13px;
  max-width: 820px;
}

.kg-evidence-toolbar form {
  display: grid;
  grid-template-columns: auto minmax(220px, 360px) 150px auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.kg-evidence-toolbar input,
.kg-evidence-toolbar select {
  min-height: 34px;
}

.kg-evidence-toolbar input {
  min-width: 0;
}

.kg-evidence-toolbar .button {
  min-height: 34px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.kg-evidence-toolbar .segmented-control {
  display: inline-flex;
  gap: 4px;
}

.kg-evidence-toolbar .segmented-control button {
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.kg-evidence-toolbar .segmented-control button.active {
  border-color: var(--primary-ui);
  background: rgba(10, 77, 161, 0.08);
  color: var(--primary-ui);
}

.kg-compact-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.kg-compact-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-low);
}

.kg-compact-stats b {
  color: var(--text);
  font-size: 15px;
  line-height: 1;
}

.kg-compact-stats em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.kg-boundary-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  padding-top: 9px;
  padding-bottom: 9px;
}

.kg-boundary-panel .material-symbols-outlined {
  color: var(--warning);
}

.kg-boundary-panel p {
  margin: 0;
  line-height: 1.35;
  font-size: 13px;
}

.kg-boundary-panel code {
  margin-left: auto;
  white-space: nowrap;
  color: var(--text);
}

.kg-evidence-panel .section-head {
  margin-bottom: 8px;
}

.kg-evidence-panel .section-head h2 {
  margin-bottom: 4px;
  font-size: 20px;
}

.kg-evidence-panel .section-head p {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}

.kg-table-wrap {
  overflow-x: auto;
}

.kg-evidence-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

.kg-evidence-table th,
.kg-evidence-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.kg-evidence-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  background: var(--panel-soft);
}

.kg-evidence-table strong,
.kg-evidence-table b,
.kg-evidence-table span {
  display: block;
}

.kg-evidence-table small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.kg-evidence-table a {
  color: var(--primary-ui);
  font-weight: 700;
  text-decoration: none;
}

.kg-evidence-table a:hover {
  text-decoration: underline;
}

.kg-evidence-table .kg-entity-link {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  color: var(--primary);
  background: transparent;
  border: 0;
  padding: 0;
  overflow-wrap: anywhere;
}

.kg-evidence-table .kg-entity-link.kg-entity-primary {
  font-weight: 800;
}

.kg-evidence-table .kg-entity-link.kg-entity-secondary {
  color: var(--primary-ui);
  font-weight: 700;
}

.kg-entity-actions a {
  display: inline-flex;
  width: fit-content;
  padding: 2px 8px;
  border: 1px solid rgba(12, 74, 140, 0.18);
  border-radius: 999px;
  background: rgba(12, 74, 140, 0.06);
  font-size: 12px;
  font-weight: 800;
}

.kg-reference-links {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 4px;
}

.kg-reference-links a,
.kg-reference-links span {
  display: inline-flex;
}

.clinical-trial-links {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.clinical-trial-links span {
  display: inline;
  color: var(--muted);
}

.clinical-trial-links a {
  display: inline-flex;
  padding: 1px 0;
}

.kg-evidence-table .pill {
  display: inline-flex;
}

.kg-evidence-table .evidence-badge {
  display: inline-flex;
  margin-bottom: 4px;
  padding: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.kg-evidence-table.detail {
  min-width: 1320px;
}

.kg-evidence-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.kg-evidence-pager .kg-page-status {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
}

/* ================================================================
   三元组工具栏 (简化版)
   ================================================================ */
.kg-evidence-page--triples {
  padding-top: 16px;
}

.triples-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 16px 0;
  gap: 16px;
}

.triples-toolbar-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.triples-toolbar-left h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text, #1e293b);
}

.triples-count {
  font-size: 13px;
  color: var(--muted, #64748b);
}

.triples-toolbar-right .segmented-control {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-low, #f3f3fb);
  border-radius: 8px;
  border: 1px solid var(--line-soft, #e2e2ea);
}

.triples-toolbar-right .segmented-control button {
  padding: 6px 16px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
}

.triples-toolbar-right .segmented-control button:hover {
  color: var(--text, #1e293b);
}

.triples-toolbar-right .segmented-control button.active {
  background: var(--surface, #fff);
  color: var(--primary, #003778);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  font-weight: 600;
}

/* 简洁等级标签 */
.level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
}

/* ================================================================
   三元组页面 —— 紧凑布局，最大化利用屏幕空间
   ================================================================ */
.app-main:has(.triples-view) {
  padding: 70px 12px 0;
}

/* ================================================================
   三元组列表 + 详情面板 (triples view)
   ================================================================ */
.triples-view {
  position: relative;
  display: flex;
  gap: 0;
  height: calc(100vh - 70px);
  min-height: 500px;
  border: 1px solid var(--line-soft, #e2e8f0);
  border-radius: 10px;
  overflow: visible;
  background: var(--surface, #fff);
}

/* ---- 左侧列表 ---- */
.triples-list-panel {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.triples-list-top {
  flex: 0 0 36%;
  display: flex;
  flex-direction: column;
  overflow: visible;
  border-right: 1px solid var(--line-soft, #e2e8f0);
  min-height: 0;
}

.triples-list-header {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 2.4fr 1.6fr 2fr;
  gap: 0;
  padding: 10px 14px;
  background: var(--surface-low, #f8fafc);
  border-bottom: 2px solid var(--line-soft, #e2e8f0);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
  white-space: nowrap;
}

.triples-list-col { padding: 0 8px; }
.triples-list-col--predicate { text-align: center; }
.triples-list-col--object { text-align: left; }

/* 快捷筛选条（列表单选样式） */
.triples-filter-bar {
  flex-shrink: 0;
  padding: 12px 44px 0 12px;
  background: #fafbfc;
  border-bottom: 1px solid var(--line-soft, #e2e8f0);
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.filter-section {
  flex-shrink: 0;
  min-width: 140px;
  max-width: 220px;
  border-right: 1px solid var(--line-soft, #e2e8f0);
  padding-right: 18px;
}
.filter-section:last-child {
  border-right: none;
  padding-right: 0;
}
.filter-section__title {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--line-soft, #e2e8f0);
}
.filter-option-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 8px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text, #1e293b);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.1s ease, color 0.1s ease;
}
.filter-option:hover {
  background: #eef2f7;
}
.filter-option__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid #6c757d;
  flex-shrink: 0;
}
.filter-option__label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-option__check {
  width: 14px;
  flex-shrink: 0;
  font-size: 11px;
  color: var(--primary, #003778);
  text-align: center;
  font-weight: 700;
}
.filter-option__count {
  flex-shrink: 0;
  font-size: 10px;
  color: var(--muted, #64748b);
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
  min-width: 30px;
  text-align: right;
  padding: 0 2px;
}
.filter-option--active {
  background: var(--primary, #003778);
  color: #fff;
}
.filter-option--active:hover {
  background: #1e3a8a;
}
.filter-option--active .filter-option__count {
  color: rgba(255, 255, 255, 0.8);
}
.filter-option--active .filter-option__check {
  color: #fff;
}
.filter-clear-btn {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid var(--primary, #003778);
  border-radius: 6px;
  background: var(--primary, #003778);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  margin-top: 4px;
}
.filter-clear-btn:hover { background: #1e3a8a; border-color: #1e3a8a; }

/* 搜索框样式 */
.filter-bar-search {
  position: relative;
  display: flex;
  align-items: center;
  margin-right: auto;
}
.filter-bar-search__input {
  padding: 4px 28px 4px 8px;
  border: 1px solid var(--line-soft, #e2e8f0);
  border-radius: 5px;
  font-size: 12px;
  width: 140px;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.filter-bar-search__input:focus {
  outline: none;
  border-color: var(--primary, #003778);
  box-shadow: 0 0 0 3px rgba(0, 55, 120, 0.1);
}
.filter-bar-search__input:not(:placeholder-shown) + .filter-bar-search__clear {
  opacity: 1;
}
.filter-bar-search__clear {
  position: absolute;
  right: 2px;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  transition: color 0.15s ease, background 0.15s ease;
  opacity: 0.6;
}
.filter-bar-search__clear .material-symbols-outlined {
  font-size: 14px !important;
}
.filter-bar-search__clear:hover {
  color: #64748b;
  background: #f1f5f9;
  opacity: 1;
}

/* 下拉选择样式 */
.triples-filter-bar--select {
  padding: 6px 10px;
  gap: 8px;
  align-items: center;
  overflow: visible;
  position: relative;
  z-index: 100;
  flex-shrink: 0;
}
.filter-section-select {
  flex-shrink: 0;
  min-width: 160px;
}
.filter-section-select .filter-section__title {
  margin-bottom: 2px;
  padding-bottom: 0;
  border-bottom: none;
}
.filter-select {
  position: relative;
  width: 100%;
}
.filter-select__trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--line-soft, #e2e8f0);
  border-radius: 5px;
  background: #fff;
  color: var(--text, #1e293b);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.filter-select__trigger:hover {
  border-color: var(--primary, #003778);
}
.filter-select__trigger:focus {
  outline: none;
  border-color: var(--primary, #003778);
  box-shadow: 0 0 0 3px rgba(0, 55, 120, 0.1);
}
.filter-select__trigger-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-select__trigger-count {
  font-size: 11px;
  color: var(--muted, #64748b);
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
}
.filter-select__caret {
  font-size: 16px !important;
  color: var(--muted, #64748b);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.filter-select__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line-soft, #e2e8f0);
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  max-height: 320px;
  overflow-y: auto;
  z-index: 9999;
  display: none;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.filter-select__dropdown--open {
  display: block;
}
.filter-select-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text, #1e293b);
  cursor: pointer;
  transition: background 0.1s ease;
}
.filter-select-option:hover {
  background: #eef2f7;
}
.filter-select__dot,
.filter-select-option__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid #6c757d;
  flex-shrink: 0;
}
.filter-select-option__label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-select-option__count {
  font-size: 12px;
  color: var(--muted, #64748b);
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
}

.triples-list-body {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.triple-list--empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  gap: 12px;
  color: var(--muted, #64748b);
  font-size: 14px;
}

/* ---- 左侧分页导航 ---- */
.triples-list-pager {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  background: var(--surface-low, #f8fafc);
  border-top: 1px solid var(--line-soft, #e2e8f0);
  border-bottom-left-radius: 10px;
}

.triples-page-link {
  padding: 5px 12px;
  border: 1px solid var(--line-soft, #e2e2ea);
  border-radius: 6px;
  background: var(--surface, #fff);
  color: var(--muted, #64748b);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
}

.triples-page-link:hover {
  border-color: var(--primary, #003778);
  color: var(--primary, #003778);
}

.triples-page-link.active {
  background: var(--primary, #003778);
  border-color: var(--primary, #003778);
  color: #fff;
  font-weight: 600;
}

.triples-page-link[aria-disabled="true"] {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}

.triples-page-link--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  line-height: 1;
  border: 1px solid rgba(100, 116, 139, 0.25);
  border-radius: 6px;
  background: #fff;
  color: #334155;
  transition: all 0.15s ease;
  cursor: pointer;
}

.triples-page-link--icon:hover:not([aria-disabled="true"]) {
  background: #155eef;
  color: #fff;
  border-color: #155eef;
  box-shadow: 0 2px 8px rgba(21, 94, 239, 0.25);
}

.triples-page-link--icon .material-symbols-outlined {
  font-size: 22px;
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
}

.triples-page-window {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.triples-page-status {
  margin-left: auto;
  padding-left: 12px;
  font-size: 12px;
  color: var(--muted, #64748b);
  font-family: "JetBrains Mono", monospace;
}

/* ---- 左侧面板图钉按钮（收起/展开） ---- */
.triples-view { position: relative; }
.triples-list-pin {
  position: absolute;
  z-index: 30;
  left: 448px;
  top: 10px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line-soft, #e2e8f0);
  border-radius: 8px;
  background: var(--surface, #ffffff);
  color: var(--muted, #64748b);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.triples-list-pin:hover {
  background: #eff6ff;
  color: #2563eb;
  border-color: #93c5fd;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.2);
}
.triples-list-pin .material-symbols-outlined {
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
/* 激活态（未收起）：图钉旋转 45°，表示"已固定" */
.triples-list-pin:not(.is-unpinned) .material-symbols-outlined {
  transform: rotate(45deg);
  color: #2563eb;
}
.triples-list-pin:not(.is-unpinned) {
  background: #eff6ff;
  border-color: #bfdbfe;
}

/* 收起状态：图钉移到详情面板左上角 */
.triples-view--list-collapsed .triples-list-pin {
  left: 10px;
  top: 10px;
  opacity: 1;
  z-index: 100;
}

/* 收起状态：列表宽度收缩为 0 */
.triples-view--list-collapsed .triples-list-top {
  flex: 0 0 0;
  min-width: 0;
  border-right: none;
  opacity: 0;
  overflow: hidden;
  transition: flex 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}
.triples-list-top {
  transition: flex 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

/* ===== 全屏模式：详情面板布局优化 ===== */
.triples-view--list-collapsed .triples-detail-panel {
  flex: 1 1 100%;
  width: 100%;
  max-width: 100%;
}
.triples-view--list-collapsed .detail-section {
  padding: 20px 32px;
}
.triples-view--list-collapsed .detail-section--identity {
  padding: 48px 32px 16px;
}
.triples-view--list-collapsed .detail-section--meta {
  padding: 16px 32px;
}
/* 证据概览卡片：全屏时更宽的卡片 */
.triples-view--list-collapsed .ev-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
/* 字段网格：全屏时更宽 */
.triples-view--list-collapsed .detail-fields-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
/* 关系判读网格：全屏时 4 列 */
.triples-view--list-collapsed .relationship-assessment__grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
/* 链路 SVG 滚动容器：全屏时更宽 */
.triples-view--list-collapsed .cc-scroll {
  max-width: 100%;
}
/* 关系解释链区域 */
.triples-view--list-collapsed .detail-section--causal {
  padding: 20px 32px;
}
.triples-view--list-collapsed .relationship-assessment {
  padding: 16px 20px;
}
/* 摘要区域全宽 */
.triples-view--list-collapsed .detail-abstract {
  max-width: 100%;
}
/* 数据表格全宽 */
.triples-view--list-collapsed .data-table {
  width: 100%;
}
/* identity header 全宽布局优化 */
.triples-view--list-collapsed .detail-identity-header {
  gap: 12px;
}
.triples-view--list-collapsed .identity-subject-name {
  font-size: 22px;
}

/* 响应式：小屏幕隐藏收起按钮 */
@media (max-width: 900px) {
  .triples-list-pin { display: none; }
  .triples-view { flex-direction: column; height: auto; }
  .triples-list-panel { flex: none; border-right: none; border-bottom: 2px solid var(--line-soft, #e2e8f0); min-height: 50vh; }
  .triples-detail-panel { min-height: 50vh; }
}

.triple-list--empty .material-symbols-outlined { font-size: 48px; opacity: 0.4; }

/* ---- 列表行 ---- */
.triple-row {
  display: grid;
  grid-template-columns: 2.4fr 1.6fr 2fr;
  align-items: center;
  gap: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft, #f1f5f9);
  cursor: pointer;
  transition: background 0.1s ease;
  min-height: 56px;
}
.triple-row:hover { background: var(--surface-low, #f8fafc); }
.triple-row--selected { background: #eff6ff !important; }
.triple-row--selected + .triple-row { border-top-color: #bfdbfe; }

.triple-row__subject {
  padding: 0 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #1e293b);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}
.subject-type-badge {
  display: inline-block;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 999px;
  text-align: center;
  letter-spacing: 0.02em;
}
.subject-type-badge--strain {
  color: #1e40af;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
}
.subject-type-badge--species {
  color: #166534;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
}

.triple-row__predicate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 8px;
  font-size: 12px;
  color: var(--pred-color, #6c757d);
  font-weight: 500;
  text-align: center;
}
.pred-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pred-color, #6c757d);
  flex-shrink: 0;
}

.triple-row__object {
  padding: 0 8px;
  font-size: 12px;
  color: var(--text, #1e293b);
  line-height: 1.4;
}
.object-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
}
.object-tag {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  background: #e8f4fd;
  color: #003778;
  white-space: nowrap;
}
.object-tag--en {
  background: #f1f5f9;
  color: #64748b;
  font-style: italic;
}


/* ---- 右侧详情面板 ---- */
.triples-detail-panel {
  flex: 1;
  overflow-y: auto;
  background: var(--surface, #fff);
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.detail-panel--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 400px;
}
.detail-empty {
  text-align: center;
  color: var(--muted, #94a3b8);
}
.detail-empty .material-symbols-outlined {
  font-size: 64px;
  opacity: 0.3;
  display: block;
  margin-bottom: 16px;
}
.detail-empty p { font-size: 14px; line-height: 1.6; color: var(--muted, #94a3b8); }

/* 详情各区块 */
.detail-panel { padding: 0; }

.detail-section {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-soft, #f1f5f9);
}
.detail-section:last-child { border-bottom: none; }

/* 折叠手风琴 */
.detail-section[data-collapsible] .detail-section-title {
  cursor: pointer;
  user-select: none;
}
.detail-section[data-collapsible] .collapse-icon {
  margin-left: auto;
  font-size: 20px;
  color: var(--muted, #94a3b8);
  transition: transform 0.15s;
}
.detail-section[data-collapsed="true"] .detail-section-body {
  display: none;
}
.detail-section[data-collapsed="false"] .collapse-icon {
  transform: rotate(180deg);
}
.section-count-badge {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.detail-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #64748b);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.detail-section-title::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--primary, #2563eb);
  border-radius: 2px;
}

.detail-empty-text {
  font-size: 13px;
  color: var(--muted, #94a3b8);
  font-style: italic;
}

/* Section 1: 核心身份头部（强化主体显示，压缩高度） */
.detail-section--identity {
  padding: 12px 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border-bottom: 2px solid var(--line-soft, #e2e8f0);
}
.detail-identity-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.identity-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted, #64748b);
  background: var(--surface, #fff);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-soft, #e2e8f0);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.detail-identity-subject {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.identity-subject-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text, #0f172a);
  line-height: 1.25;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}
.identity-subject-name .detail-entity-link {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary, #2563eb);
}
.identity-subject-name small {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted, #64748b);
}

.detail-identity-object-predicate {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.identity-object-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text, #0f172a);
  line-height: 1.3;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.identity-object-name .object-tag {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  background: #e8f4fd;
  color: #003778;
}
.identity-object-name .object-tag--en {
  background: #f1f5f9;
  color: #64748b;
  font-style: italic;
  font-weight: 500;
}
.identity-object-en {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted, #64748b);
  font-style: italic;
}
.pred-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--pred-color, #6c757d);
  letter-spacing: 0.04em;
  padding: 2px 10px;
  background: var(--surface, #fff);
  border: 1px solid var(--pred-color, #6c757d);
  border-radius: 999px;
  white-space: nowrap;
}

.detail-entity-link {
  color: var(--primary, #2563eb);
  text-decoration: none;
  transition: color 0.1s;
}
.detail-entity-link:hover { color: var(--primary-hover, #1d4ed8); text-decoration: underline; }
.detail-entity-link--secondary { color: var(--secondary, #64748b); }
.identity-species-text {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted, #64748b);
  font-style: italic;
}

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f1f5f9;
  color: #64748b;
}
.tag--strain { background: #dcfce7; color: #166534; }
.tag--species { background: #dbeafe; color: #1e40af; }

/* Section 2: 证据等级 */
/* 证据概览卡片网格 (ev-grid / ev-card) */
.ev-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}
.ev-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface, #fff);
  border: 1px solid var(--line-soft, #e2e8f0);
  border-left: 3px solid var(--ev-color, #6366f1);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
  min-width: 0;
  position: relative;
  overflow: hidden;
}
/* 填充型卡片：带渐变背景 */
.ev-card--fill {
  background: linear-gradient(135deg, var(--ev-color, #6366f1), color-mix(in srgb, var(--ev-color, #6366f1) 75%, #000));
  border-color: transparent;
  border-left: none;
  color: #fff;
}
.ev-card__head {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted, #94a3b8);
  margin-bottom: 2px;
}
.ev-card__head--light {
  color: rgba(255, 255, 255, 0.85);
}
.ev-card__head .material-symbols-outlined { font-size: 13px; }
.ev-card__level-badge {
  font-size: 36px;
  font-weight: 900;
  color: var(--ev-color, #6366f1);
  line-height: 1;
  font-family: "JetBrains Mono", monospace;
  margin: 2px 0;
}
.ev-card__level-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #1e293b);
  line-height: 1.2;
}
.ev-card__dir-icon {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.ev-card__dir-icon .material-symbols-outlined { font-size: 32px; line-height: 1; }
.ev-card__dir-text {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.ev-card__big-num {
  font-size: 32px;
  font-weight: 900;
  color: var(--text, #1e293b);
  line-height: 1;
  margin: 2px 0;
}
.ev-card__big-num small { font-size: 11px; font-weight: 500; color: var(--muted, #94a3b8); margin-left: 3px; }
.ev-card--fill .ev-card__big-num { color: #fff; }
.ev-card--fill .ev-card__big-num small { color: rgba(255, 255, 255, 0.7); }
.ev-card__bar {
  height: 4px;
  background: var(--surface-low, #f1f5f9);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.ev-card__bar-fill {
  height: 100%;
  background: var(--ev-color, #6366f1);
  border-radius: 2px;
  transition: width 0.5s ease;
}
.ev-card__text-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #1e293b);
  line-height: 1.3;
  word-break: break-word;
  margin-top: 2px;
}
.ev-card__sig {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 2px;
}
.ev-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.design-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-low, #f1f5f9);
  color: var(--muted, #64748b);
  white-space: nowrap;
}


.detail-meta-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 8px;
  font-size: 13px;
}
.meta-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted, #64748b);
  min-width: 64px;
  flex-shrink: 0;
}
.meta-value { color: var(--text, #1e293b); word-break: break-word; }
.ext-link { color: var(--primary, #2563eb); text-decoration: none; }
.ext-link:hover { text-decoration: underline; }

/* 数据表格 (基因组 / 临床) — 撑满宽度 */
.data-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 12px;
  background: var(--surface, #fff);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.data-table thead {
  background: var(--surface-low, #f3f3fb);
}
.data-table thead th {
  padding: 8px 10px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted, #424752);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--line-soft, #e2e2ea);
  word-break: break-word;
  overflow-wrap: break-word;
}
.data-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft, #e2e2ea);
  font-size: 12px;
  color: var(--text, #191b21);
  vertical-align: top;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.4;
}
.data-table tbody tr:hover {
  background: #f8fafc;
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.data-table--small tbody td {
  padding: 6px 8px;
  font-size: 11px;
}
.data-table--small thead th {
  padding: 6px 8px;
  font-size: 10px;
}

/* 菌株/物种名称单元格不换行，溢出时截断显示省略号 */
.data-table .strain-name-cell,
.data-table .species-name-cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* VFDB 相关菌株表格：固定列宽防止内容溢出 */
.data-table.vfdb-related-table {
  table-layout: fixed;
  width: 100%;
}

/* 临床表格 - 8列以上，在一个带水平滚动的包装容器中 */
.detail-table-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  margin-top: 10px;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.detail-table-scroll .data-table {
  margin-top: 0;
  border-radius: 0;
  box-shadow: none;
}
.data-table--clinical {
  font-size: 11px;
  table-layout: auto;
  min-width: 800px;
}
.data-table--clinical thead th {
  padding: 6px 8px;
  white-space: nowrap;
  font-size: 10px;
}
.data-table--clinical tbody td {
  font-size: 11px;
  padding: 6px 8px;
  word-break: break-word;
  white-space: normal;
}

/* 其他关系表 — 撑满宽度 */
.related-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 2px;
}
.related-table thead th {
  text-align: left;
  padding: 6px 8px;
  background: var(--surface-low, #f8fafc);
  color: var(--muted, #64748b);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--line-soft, #e2e8f0);
}
.related-table thead th:first-child { width: 60%; }
.related-table thead th:last-child { width: 40%; }
.related-table tbody td {
  padding: 8px;
  border-bottom: 1px solid var(--line-soft, #e2e8f0);
  vertical-align: middle;
  line-height: 1.4;
  word-break: break-word;
}
.related-table tbody tr:last-child td {
  border-bottom: none;
}
.related-table tbody tr:hover {
  background: var(--surface-low, #f8fafc);
}

/* 研究设计字段网格 — 撑满整个水平空间 */
.detail-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}
.detail-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  background: var(--surface-low, #f8fafc);
  border-radius: 8px;
  border: 1px solid var(--line-soft, #f1f5f9);
  box-sizing: border-box;
  min-width: 0;
}
.detail-field__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail-field__value {
  font-size: 13px;
  color: var(--text, #1e293b);
  font-weight: 500;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.4;
}
.related-obj {
  display: table-cell;
}
.related-obj small {
  font-size: 11px;
  color: var(--muted, #64748b);
  font-weight: 400;
  margin-left: 2px;
}
.related-pred {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text, #1e293b);
  font-weight: 500;
}
.related-pred__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Section 4: 临床发现 */
.direction-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.direction-tag--pos { background: #dcfce7; color: #166534; }
.direction-tag--neg { background: #fee2e2; color: #991b1b; }
.direction-tag--neutral { background: #fef9c3; color: #713f12; }

.detail-conclusion {
  margin-top: 10px;
  padding: 14px 16px;
  background: var(--surface-low, #f8fafc);
  border-radius: 8px;
  border-left: 4px solid var(--primary, #2563eb);
}
.detail-conclusion__en {
  font-size: 13px;
  color: var(--muted, #64748b);
  line-height: 1.7;
  word-break: break-word;
  margin-bottom: 12px;
}
.detail-conclusion__zh {
  font-size: 13px;
  color: var(--text, #1e293b);
  line-height: 1.8;
  word-break: break-word;
  padding-top: 10px;
  border-top: 1px dashed var(--line-soft, #e2e2ea);
  font-weight: 500;
}

/* Relationship explanation: evidence-aware because -> therefore chain. */
.detail-section--causal {
  background: #fcfdff;
}

.causal-loading,
.causal-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted, #64748b);
  font-size: 13px;
  line-height: 1.5;
}

.causal-loading .material-symbols-outlined {
  font-size: 17px;
  color: var(--primary, #2563eb);
}

.relationship-assessment {
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #f8fbff;
}

.relationship-assessment__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #0f172a;
  font-size: 15px;
  font-weight: 700;
}

.relationship-assessment__action {
  flex: 0 1 auto;
  padding: 4px 10px;
  border-radius: 4px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.relationship-assessment__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.relationship-assessment__grid > div {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #dbeafe;
  border-radius: 4px;
  background: #fff;
}

.relationship-assessment__grid span,
.relationship-assessment__subhead {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.relationship-assessment__grid strong {
  display: block;
  margin-top: 3px;
  color: #1e3a5f;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.relationship-assessment__boundary,
.relationship-assessment__result,
.relationship-assessment__conclusion,
.relationship-assessment__mechanism {
  margin: 8px 0 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.relationship-assessment__boundary {
  padding: 7px 8px;
  border-left: 3px solid #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

.relationship-assessment__source-status {
  display: inline-flex;
  margin-top: 8px;
  padding: 3px 7px;
  border: 1px solid #fcd34d;
  border-radius: 4px;
  background: #fffbeb;
  color: #92400e;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.triple-row__predicate {
  position: relative;
}

.triple-row__source-status {
  display: block;
  margin: 2px 0 0 16px;
  color: #a16207;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
}

.relationship-assessment__subhead {
  margin-top: 12px;
  color: #475569;
  text-transform: none;
}

.relationship-assessment__reference {
  margin-top: 4px;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.relationship-assessment__reference span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 500;
}

.relationship-assessment__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.relationship-assessment__facts .fact-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 4px 10px;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
}

.relationship-assessment__facts .fact-chip b {
  color: #64748b;
  font-weight: 600;
}

.relationship-assessment__missing {
  margin-top: 6px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 520px) {
  .relationship-assessment__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .relationship-assessment__grid {
    grid-template-columns: 1fr;
  }
}

.causal-statement {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line-soft, #e2e8f0);
  border-radius: 6px;
}

.causal-statement b {
  color: var(--primary, #2563eb);
  font-size: 13px;
}

.causal-statement p,
.causal-path p,
.causal-support p {
  margin: 0;
  color: var(--text, #1e293b);
  font-size: 13px;
  line-height: 1.65;
}

.causal-statement--because {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.causal-statement--therefore {
  margin-top: 10px;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.causal-statement--therefore b {
  color: #166534;
}

.causal-source-quote {
  margin: 8px 0 0;
  padding: 8px 12px;
  border-left: 3px solid #94a3b8;
  color: #475569;
  background: #f8fafc;
  font-size: 12px;
  line-height: 1.55;
  word-break: break-word;
}

.causal-paths {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.causal-path,
.causal-support,
.causal-outcome {
  padding: 10px 12px;
  border: 1px solid var(--line-soft, #e2e8f0);
  border-radius: 6px;
  background: #fff;
  min-width: 0;
}

.causal-edge-wrap {
  min-width: 0;
}

.causal-path--candidate {
  border-color: #c4b5fd;
  background: #ffffff;
}

.causal-path--cross {
  border-color: #e2e8f0;
  background: #ffffff;
}

.causal-support {
  background: #ffffff;
  border-color: #e2e8f0;
}

.causal-outcome {
  margin-top: 10px;
  background: #f8fafc;
}


.causal-path-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--text, #1e293b);
  font-size: 12px;
  font-weight: 700;
}

.causal-status {
  color: #6d28d9;
  font-size: 11px;
  font-weight: 700;
}

.causal-status--neutral {
  color: #92400e;
}

.causal-edge-wrap + .causal-edge-wrap {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #dbe3ee;
}

.causal-edge {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.causal-node {
  display: inline-flex;
  flex-direction: row;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 6px;
  min-width: 0;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.causal-node small {
  margin-top: 0;
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
}

.causal-node--bacteria { border-color: #93c5fd; background: #eff6ff; }
.causal-node--metabolite { border-color: #86efac; background: #f0fdf4; }
.causal-node--biologicalprocess { border-color: #c4b5fd; background: #faf5ff; }
.causal-node--hostphenotype { border-color: #fcd34d; background: #fffbeb; }
.causal-node--disease { border-color: #fca5a5; background: #fef2f2; }

.causal-arrow {
  color: #64748b;
  font-size: 16px;
  line-height: 1;
}

.causal-relation {
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

/* ---- 链式机制路径：膜玻璃效果，窄卡片横向链路 ---- */
.causal-chain {
  width: 100%;
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(255,255,255,0.35));
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.15);
  margin-bottom: 16px;
  overflow: hidden;
}

/* 内部轨道：横向排列，允许换行 */
.causal-chain-track {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: 100%;
}

/* 节点卡片：竖向窄卡片，图标在上、名称在中、编号在下 */
.causal-chain .causal-node {
  flex: 0 0 auto;
  width: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 6px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
}

.causal-chain .causal-node:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 1);
}

.causal-chain .causal-node-icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.causal-chain .causal-node-label {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  color: #1e293b;
  text-shadow: 0 1px 0 rgba(255,255,255,0.8);
  word-break: break-all;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-height: 30px;
}
.causal-chain .causal-node-id {
  font-size: 9px;
  color: #94a3b8;
  font-weight: 500;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* 箭头：紧凑圆形 */
.causal-chain .causal-arrow {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 12px;
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

/* 关系标签：紧凑胶囊 */
.causal-chain .causal-relation {
  flex: 0 0 auto;
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  color: #64748b;
  font-weight: 500;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 节点类型着色 - 膜玻璃半透明风格 */
.causal-chain .causal-node--strain, .causal-chain .causal-node--species, .causal-chain .causal-node--bacteria { 
  border-color: rgba(59, 130, 246, 0.4); 
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.85), rgba(219, 234, 254, 0.4)); 
}
.causal-chain .causal-node--strain .causal-node-icon, .causal-chain .causal-node--species .causal-node-icon, .causal-chain .causal-node--bacteria .causal-node-icon { color: #2563eb; }

.causal-chain .causal-node--metabolite, .causal-chain .causal-node--compound { 
  border-color: rgba(34, 197, 94, 0.4); 
  background: linear-gradient(135deg, rgba(220, 252, 231, 0.85), rgba(220, 252, 231, 0.4)); 
}
.causal-chain .causal-node--metabolite .causal-node-icon, .causal-chain .causal-node--compound .causal-node-icon { color: #16a34a; }

.causal-chain .causal-node--disease { 
  border-color: rgba(239, 68, 68, 0.4); 
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.85), rgba(254, 226, 226, 0.4)); 
}
.causal-chain .causal-node--disease .causal-node-icon { color: #dc2626; }

.causal-chain .causal-node--health, .causal-chain .causal-node--hostphenotype { 
  border-color: rgba(245, 158, 11, 0.4); 
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.85), rgba(254, 243, 199, 0.4)); 
}
.causal-chain .causal-node--health .causal-node-icon, .causal-chain .causal-node--hostphenotype .causal-node-icon { color: #d97706; }

.causal-chain .causal-node--biologicalprocess, .causal-chain .causal-node--process { 
  border-color: rgba(167, 139, 250, 0.4); 
  background: linear-gradient(135deg, rgba(237, 233, 254, 0.85), rgba(237, 233, 254, 0.4)); 
}
.causal-chain .causal-node--biologicalprocess .causal-node-icon, .causal-chain .causal-node--process .causal-node-icon { color: #7c3aed; }

.causal-chain .causal-node--function { 
  border-color: rgba(236, 72, 153, 0.4); 
  background: linear-gradient(135deg, rgba(252, 231, 243, 0.85), rgba(252, 231, 243, 0.4)); 
}
.causal-chain .causal-node--function .causal-node-icon { color: #db2777; }

.causal-chain .causal-node--outcome, .causal-chain .causal-node--target { 
  border-color: rgba(6, 182, 212, 0.4); 
  background: linear-gradient(135deg, rgba(207, 250, 254, 0.85), rgba(207, 250, 254, 0.4)); 
}
.causal-chain .causal-node--outcome .causal-node-icon, .causal-chain .causal-node--target .causal-node-icon { color: #0891b2; }

.causal-chain .causal-node--gene, .causal-chain .causal-node--protein { 
  border-color: rgba(99, 102, 241, 0.4); 
  background: linear-gradient(135deg, rgba(224, 231, 255, 0.85), rgba(224, 231, 255, 0.4)); 
}
.causal-chain .causal-node--gene .causal-node-icon, .causal-chain .causal-node--protein .causal-node-icon { color: #4f46e5; }

.causal-chain .causal-node--pathway { 
  border-color: rgba(249, 115, 22, 0.4); 
  background: linear-gradient(135deg, rgba(255, 237, 213, 0.85), rgba(255, 237, 213, 0.4)); 
}
.causal-chain .causal-node--pathway .causal-node-icon { color: #ea580c; }

.causal-chain .causal-node--food { 
  border-color: rgba(132, 204, 22, 0.4); 
  background: linear-gradient(135deg, rgba(247, 254, 231, 0.85), rgba(247, 254, 231, 0.4)); 
}
.causal-chain .causal-node--food .causal-node-icon { color: #65a30d; }

/* ====================================================================
   SVG 地铁线式链路（causal-chain-svg / cc-*）
   短链横向单行，长链（>4 节点）纵向瀑布流；节点为站点卡片，关系标签
   悬于连线之上，证据等级以连线颜色表达；节点内容固定宽度 + 截断。
   ==================================================================== */
.causal-chain-svg {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  margin-bottom: 10px;
  overflow: visible;
}
.causal-chain-svg .cc-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 2px 4px;
  border-radius: 14px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 8px, #000 calc(100% - 8px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 8px, #000 calc(100% - 8px), transparent 100%);
}
.causal-chain-svg .cc-scroll::-webkit-scrollbar { height: 6px; }
.causal-chain-svg .cc-scroll::-webkit-scrollbar-track { background: transparent; }
.causal-chain-svg .cc-scroll::-webkit-scrollbar-thumb { background: rgba(99, 102, 241, 0.28); border-radius: 3px; }
.causal-chain-svg .cc-scroll::-webkit-scrollbar-thumb:hover { background: rgba(99, 102, 241, 0.45); }
.causal-chain-svg svg { display: block; }

/* 纵向布局：上下滚动、不显示左右渐隐 */
.causal-chain-svg--vertical .cc-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-mask-image: none;
  mask-image: none;
  padding: 4px 6px;
  max-height: 420px;
}
.causal-chain-svg--vertical .cc-scroll::-webkit-scrollbar { width: 6px; height: 0; }
.causal-chain-svg--vertical .cc-scroll::-webkit-scrollbar-thumb { background: rgba(99, 102, 241, 0.28); border-radius: 3px; }

/* 节点卡片（foreignObject 内 HTML） */
.cc-node {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 7px 6px 6px;
  border-radius: 13px;
  background: #ffffff;
  border: 1.5px solid rgba(99, 102, 241, 0.22);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07), inset 0 1px 0 rgba(255, 255, 255, 1);
  box-sizing: border-box;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s;
  opacity: 0;
  transform: translateY(8px) scale(0.9);
  animation: ccNodeIn 0.5s cubic-bezier(0.34, 1.3, 0.64, 1) forwards;
  cursor: default;
}
.cc-node:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 9px 24px rgba(0, 0, 0, 0.13), inset 0 1px 0 rgba(255, 255, 255, 1);
}
.cc-node-icon {
  font-size: 18px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  flex-shrink: 0;
  font-family: 'Material Symbols Outlined';
  font-variation-settings: 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.cc-node-label {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  color: #0f172a;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  max-height: 48px;
}
.cc-node-type-zh {
  font-size: 10.5px;
  color: #64748b;
  font-weight: 600;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  line-height: 1.2;
  margin-top: 1px;
}
.cc-node--vertical .cc-node-label {
  -webkit-line-clamp: 3;
  max-height: 46px;
}

/* 节点类型着色 */
.cc-node--strain, .cc-node--species, .cc-node--bacteria {
  border-color: rgba(59, 130, 246, 0.4);
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.96), rgba(255, 255, 255, 0.88));
}
.cc-node--strain .cc-node-icon, .cc-node--species .cc-node-icon, .cc-node--bacteria .cc-node-icon { color: #2563eb; background: rgba(37, 99, 235, 0.1); }
.cc-node--metabolite, .cc-node--compound {
  border-color: rgba(34, 197, 94, 0.4);
  background: linear-gradient(135deg, rgba(220, 252, 231, 0.96), rgba(255, 255, 255, 0.88));
}
.cc-node--metabolite .cc-node-icon, .cc-node--compound .cc-node-icon { color: #16a34a; background: rgba(22, 163, 74, 0.1); }
.cc-node--disease {
  border-color: rgba(239, 68, 68, 0.4);
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.96), rgba(255, 255, 255, 0.88));
}
.cc-node--disease .cc-node-icon { color: #dc2626; background: rgba(220, 38, 38, 0.1); }
.cc-node--health, .cc-node--hostphenotype, .cc-node--safety {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.96), rgba(255, 255, 255, 0.88));
}
.cc-node--health .cc-node-icon, .cc-node--hostphenotype .cc-node-icon, .cc-node--safety .cc-node-icon { color: #d97706; background: rgba(217, 119, 6, 0.1); }
.cc-node--biologicalprocess, .cc-node--process {
  border-color: rgba(167, 139, 250, 0.4);
  background: linear-gradient(135deg, rgba(237, 233, 254, 0.96), rgba(255, 255, 255, 0.88));
}
.cc-node--biologicalprocess .cc-node-icon, .cc-node--process .cc-node-icon { color: #7c3aed; background: rgba(124, 58, 237, 0.1); }
.cc-node--function {
  border-color: rgba(236, 72, 153, 0.4);
  background: linear-gradient(135deg, rgba(252, 231, 243, 0.96), rgba(255, 255, 255, 0.88));
}
.cc-node--function .cc-node-icon { color: #db2777; background: rgba(219, 39, 119, 0.1); }
.cc-node--outcome, .cc-node--target {
  border-color: rgba(6, 182, 212, 0.4);
  background: linear-gradient(135deg, rgba(207, 250, 254, 0.96), rgba(255, 255, 255, 0.88));
}
.cc-node--outcome .cc-node-icon, .cc-node--target .cc-node-icon { color: #0891b2; background: rgba(8, 145, 178, 0.1); }
.cc-node--gene, .cc-node--protein {
  border-color: rgba(99, 102, 241, 0.4);
  background: linear-gradient(135deg, rgba(224, 231, 255, 0.96), rgba(255, 255, 255, 0.88));
}
.cc-node--gene .cc-node-icon, .cc-node--protein .cc-node-icon { color: #4f46e5; background: rgba(79, 70, 229, 0.1); }
.cc-node--pathway {
  border-color: rgba(249, 115, 22, 0.4);
  background: linear-gradient(135deg, rgba(255, 237, 213, 0.96), rgba(255, 255, 255, 0.88));
}
.cc-node--pathway .cc-node-icon { color: #ea580c; background: rgba(234, 88, 12, 0.1); }
.cc-node--food {
  border-color: rgba(132, 204, 22, 0.4);
  background: linear-gradient(135deg, rgba(247, 254, 231, 0.96), rgba(255, 255, 255, 0.88));
}
.cc-node--food .cc-node-icon { color: #65a30d; background: rgba(101, 163, 13, 0.1); }

/* 连线绘制动画 */
.cc-line {
  stroke-dasharray: var(--len, 200);
  stroke-dashoffset: var(--len, 200);
  animation: ccLineDraw 0.55s ease forwards;
}
.cc-arrow, .cc-grade {
  opacity: 0;
  animation: ccFadeIn 0.4s ease forwards;
}
@keyframes ccNodeIn { to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes ccLineDraw { to { stroke-dashoffset: 0; } }
@keyframes ccFadeIn { to { opacity: 1; } }

/* 关系标签（连线上方） */
.cc-rel {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: #475569;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(4px);
  animation: ccFadeIn 0.4s ease forwards;
  cursor: default;
  height: 100%;
  box-sizing: border-box;
}
.cc-rel:hover {
  color: #6366f1;
}
.cc-rel--vertical {
  text-align: left;
  justify-content: flex-start;
  align-items: center;
  padding: 4px 8px;
  border-radius: 8px;
  white-space: normal;
  max-height: 44px;
  overflow: hidden;
}

/* 完整模式卡片 */
.causal-node-card {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  min-width: 120px;
  max-width: 220px;
}
.causal-node-card-head {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}
.causal-node-card-head .causal-node-icon { font-size: 14px; }
.causal-node-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.causal-node-card-label {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  overflow-wrap: anywhere;
}
.causal-node-card-id {
  font-size: 10px;
  color: #94a3b8;
  font-family: var(--mono, monospace);
}

.causal-edge-meta {
  margin-top: 5px;
  color: #64748b;
  font-family: var(--mono, monospace);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.causal-paths-expand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.causal-paths-expand:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #2563eb;
}
.causal-paths-expand .material-symbols-outlined {
  font-size: 18px;
}

.causal-more-hint {
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 4px;
  background: #f8fafc;
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
}

.causal-limitations {
  margin: 10px 0 0;
  padding: 0 0 0 18px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
}

.causal-limitations li + li {
  margin-top: 4px;
}


/* Section 5: 参考文献 */
.ref-title-text {
  font-size: 12px;
  color: var(--muted, #64748b);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.detail-refs-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ref-item {
  padding: 10px 14px;
  background: var(--surface-low, #f8fafc);
  border-radius: 8px;
  border: 1px solid var(--line-soft, #f1f5f9);
}
.ref-title {
  font-size: 12px;
  color: var(--text, #1e293b);
  line-height: 1.5;
  word-break: break-word;
  margin-bottom: 6px;
}
.ref-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.ref-link {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--primary, #2563eb);
  color: #fff;
  text-decoration: none;
  transition: background 0.1s;
}
.ref-link:hover { background: var(--primary-hover, #1d4ed8); color: #fff; text-decoration: none; }

/* 聚合参考文献列表 */
.detail-refs-list--aggregated {
  gap: 6px;
}
.ref-item--aggregated {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
}
.ref-item__main {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ref-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.ref-type-badge--pmid { background: #dbeafe; color: #1e40af; }
.ref-type-badge--doi { background: #dcfce7; color: #166534; }
.ref-item--aggregated .ref-link {
  font-size: 12px;
  padding: 1px 8px;
}
.ref-item__title {
  font-size: 11px;
  color: #475569;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ref-item__sources {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding-left: 2px;
}
.ref-source-tag {
  font-size: 9px;
  color: #64748b;
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid #e2e8f0;
}

/* Section 6: 元数据 */
.detail-section--meta { padding: 12px 24px; background: #f8fafc; }
.detail-meta-info { display: flex; gap: 16px; flex-wrap: wrap; }
.meta-id { font-size: 11px; color: var(--muted, #94a3b8); font-family: var(--mono); }

/* ---- Evidence badge (inline for triples view) ---- */
.triples-detail-panel .evidence-badge { font-size: 11px; padding: 3px 10px; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .triples-view { flex-direction: column; height: auto; }
  .triples-list-panel { flex: none; border-right: none; border-bottom: 2px solid var(--line-soft, #e2e8f0); height: 50vh; }
  .triples-detail-panel { height: 50vh; }
  .detail-fields-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

@media (max-width: 640px) {
  .triples-list-header { font-size: 10px; padding: 8px 12px; }
  .triple-row { padding: 8px 12px; min-height: 44px; }
  .triple-row__subject { font-size: 12px; }
  .detail-section { padding: 14px 16px; }
  .detail-section--identity { padding: 16px; }
}

.kg-page-window {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.kg-page-link,
.kg-page-jump button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.kg-page-link:hover,
.kg-page-jump button:hover {
  border-color: var(--primary-ui);
  color: var(--primary-ui);
}

.kg-page-link.active {
  border-color: var(--primary-ui);
  background: rgba(10, 77, 161, 0.08);
  color: var(--primary-ui);
}

.kg-page-link[aria-disabled="true"] {
  color: var(--muted);
  opacity: 0.48;
  pointer-events: none;
}

.kg-page-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.kg-page-jump label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.kg-page-jump input {
  width: 68px;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  font-size: 13px;
}

.clinical-detail-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

.clinical-detail-hero h1 {
  margin: 8px 0;
}

.clinical-detail-id {
  padding: 12px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--primary-ui);
  font-weight: 900;
  white-space: nowrap;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary-ui);
  font-weight: 800;
  text-decoration: none;
}

.clinical-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
  min-width: 0;
}

.clinical-detail-field {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-low);
}

.clinical-detail-field span,
.clinical-detail-field b {
  display: block;
}

.clinical-detail-field span {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.clinical-detail-field b {
  line-height: 1.45;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.strain-identity-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.strain-identity-grid .clinical-detail-field:nth-child(3),
.strain-identity-grid .clinical-detail-field:nth-child(4),
.strain-identity-grid .clinical-detail-field:nth-child(8) {
  grid-column: span 2;
}

.clinical-detail-table {
  min-width: 1080px;
}

.clinical-detail-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0 16px;
  width: 100%;
  min-width: 0;
}

.clinical-detail-page > .panel,
.clinical-detail-page > section.panel {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  overflow: hidden;
}

.clinical-detail-page > .panel.kg-boundary-panel {
  padding: 12px 14px;
}

.clinical-detail-page .section-head {
  padding: 10px 14px;
  background: #fbfdff;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin: 0;
}

.clinical-detail-page .section-head h2 {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.03em;
  margin: 0 0 4px;
  line-height: 1.35;
}

.clinical-detail-page .section-head p {
  margin: 4px 0 0;
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.45;
}

.clinical-detail-page .panel > :not(.section-head):not(.result-toolbar),
.clinical-detail-page .panel.result-shell > :not(.section-head):not(.result-toolbar) {
  padding: 12px 14px;
}

.clinical-detail-page .panel .section-desc {
  padding: 0 14px 10px;
  margin: 4px 0 0;
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.5;
}

.clinical-detail-page .stat-grid {
  padding: 12px 14px 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 0;
}

.clinical-detail-page .stat-card {
  min-height: 64px;
  padding: 10px 12px;
}

.clinical-detail-page .stat-value {
  margin-top: 4px;
  font-size: 20px;
}

.clinical-detail-page .stat-sub {
  margin-top: 4px;
  font-size: 11px;
}

.clinical-detail-page .clinical-detail-hero {
  padding: 16px 18px;
}

.clinical-detail-page .clinical-detail-hero h1 {
  margin: 4px 0 8px;
  font-size: 22px;
}

.clinical-detail-page .clinical-detail-hero p {
  margin: 0;
  color: var(--subtle);
  font-size: 13px;
  line-height: 1.55;
}

.clinical-detail-page .clinical-detail-id {
  padding: 8px 12px;
  font-size: 13px;
}

.clinical-detail-page .clinical-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.clinical-detail-page .clinical-detail-field {
  padding: 10px 12px;
}

.clinical-detail-page .kg-table-wrap {
  padding: 0;
}

.clinical-detail-page .kg-table-wrap table {
  margin: 0;
}

.clinical-detail-page .clinical-detail-table {
  min-width: 1080px;
  table-layout: fixed;
}

.clinical-detail-page .clinical-detail-table th:nth-child(1),
.clinical-detail-page .clinical-detail-table td:nth-child(1) {
  width: 260px;
  min-width: 260px;
}

.clinical-detail-page .clinical-detail-table th:nth-child(2),
.clinical-detail-page .clinical-detail-table td:nth-child(2) {
  width: 140px;
  min-width: 140px;
}

.clinical-detail-page .clinical-detail-table th:nth-child(3),
.clinical-detail-page .clinical-detail-table td:nth-child(3) {
  width: 180px;
  min-width: 180px;
}

.clinical-detail-page .clinical-detail-table th:nth-child(4),
.clinical-detail-page .clinical-detail-table td:nth-child(4) {
  width: 160px;
  min-width: 160px;
}

.clinical-detail-page .clinical-detail-table th:nth-child(5),
.clinical-detail-page .clinical-detail-table td:nth-child(5) {
  width: 180px;
  min-width: 180px;
}

.clinical-detail-page .clinical-detail-table th:nth-child(6),
.clinical-detail-page .clinical-detail-table td:nth-child(6) {
  width: 160px;
  min-width: 160px;
}

.clinical-detail-page .clinical-detail-table.pubmed-table {
  min-width: 1080px;
}

.clinical-detail-page .clinical-detail-table.pubmed-table th:nth-child(1),
.clinical-detail-page .clinical-detail-table.pubmed-table td:nth-child(1) {
  width: 320px;
  min-width: 320px;
}

.clinical-detail-page .clinical-detail-table.pubmed-table th:nth-child(2),
.clinical-detail-page .clinical-detail-table.pubmed-table td:nth-child(2) {
  width: 260px;
  min-width: 260px;
}

.clinical-detail-page .clinical-detail-table.pubmed-table th:nth-child(3),
.clinical-detail-page .clinical-detail-table.pubmed-table td:nth-child(3) {
  width: 260px;
  min-width: 260px;
}

.clinical-detail-page .clinical-detail-table.pubmed-table th:nth-child(4),
.clinical-detail-page .clinical-detail-table.pubmed-table td:nth-child(4) {
  width: 240px;
  min-width: 240px;
}

.clinical-detail-page .clinical-detail-table.evidence-table {
  min-width: 1080px;
}

.clinical-detail-page .clinical-detail-table.evidence-table th:nth-child(1),
.clinical-detail-page .clinical-detail-table.evidence-table td:nth-child(1) {
  width: 200px;
  min-width: 200px;
}

.clinical-detail-page .clinical-detail-table.evidence-table th:nth-child(2),
.clinical-detail-page .clinical-detail-table.evidence-table td:nth-child(2) {
  width: 220px;
  min-width: 220px;
}

.clinical-detail-page .clinical-detail-table.evidence-table th:nth-child(3),
.clinical-detail-page .clinical-detail-table.evidence-table td:nth-child(3) {
  width: 260px;
  min-width: 260px;
}

.clinical-detail-page .clinical-detail-table.evidence-table th:nth-child(4),
.clinical-detail-page .clinical-detail-table.evidence-table td:nth-child(4) {
  width: 200px;
  min-width: 200px;
}

.clinical-detail-page .clinical-detail-table.evidence-table th:nth-child(5),
.clinical-detail-page .clinical-detail-table.evidence-table td:nth-child(5) {
  width: 200px;
  min-width: 200px;
}

.bacdive-detail-page .clinical-detail-hero .button {
  margin-top: 12px;
}

.bacdive-description {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.external-standard-panel {
  display: grid;
  gap: 12px;
}

.external-source-strip,
.external-count-pills,
.external-gap-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.external-standard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.external-standard-grid > article {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-low);
}

.external-standard-grid h3 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
}

/* === 以下规则与 .stack .external-mini-* 保持一致，由高优先级规则覆盖 === */
.external-mini-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: 8px;
  border-left: 2px solid var(--line-soft);
  padding-left: 12px;
}

.external-mini-row {
  padding: 5px 0 5px 18px;
  position: relative;
  font-size: 11.5px;
  line-height: 1.4;
  min-width: 0;
  border: none;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
}

.external-mini-row:last-child {
  border-bottom: none;
}

.external-mini-row::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 11px;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--line-soft);
}

.external-mini-row b {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
}

.external-mini-row .import-plan-note {
  color: #334155;
  font-weight: 600;
}

.external-mini-row .candidate-type-note {
  width: fit-content;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef2ff;
  color: #334155;
  font-weight: 700;
}

.external-reference-genomes,
.external-annotation-backlog {
  margin: 10px 12px 12px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.external-reference-title,
.external-annotation-backlog > b {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.external-annotation-backlog p {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}

.annotation-task-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.annotation-clue-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin: 8px 0 10px;
}

.annotation-clue-row {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(37, 99, 235, .18);
  border-radius: 7px;
  background: #f8fbff;
}

.annotation-clue-row div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.annotation-clue-row b {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--primary-ui);
}

.annotation-clue-row p {
  margin: 5px 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--ink);
}

.annotation-clue-row small {
  display: block;
  min-width: 0;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.annotation-task-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) minmax(120px, .8fr) minmax(160px, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--surface-low);
}

.annotation-task-row b,
.annotation-task-row span {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
}

.annotation-task-row small {
  display: block;
  min-width: 0;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.import-checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  padding: 12px 14px;
}

.import-checklist-card {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-low);
}

.import-checklist-card b {
  display: block;
  font-size: 12.5px;
  color: var(--ink);
}

.import-checklist-card small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}

.import-checklist-card ol {
  margin: 8px 0 0 18px;
  padding: 0;
}

.import-checklist-card li {
  margin: 4px 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--slate);
  overflow-wrap: anywhere;
}

.gap-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  padding: 12px 14px;
}

.strain-detail-stack .gap-summary-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.strain-detail-stack .import-readiness-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.import-readiness-grid {
  padding-top: 0;
}

.gap-summary-card {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-low);
}

.gap-summary-card.ready {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.gap-summary-card.pending {
  border-color: #fde68a;
  background: #fffdf5;
}

.gap-summary-card.missing {
  border-color: #e2e8f0;
  background: #f8fafc;
}

.gap-summary-card span,
.gap-summary-card small {
  display: block;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}

.gap-summary-card b {
  display: block;
  margin: 3px 0;
  font-size: 15px;
  color: var(--ink);
}

.empty-section-resolution-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 14px 12px;
}

.empty-section-resolution-row {
  display: grid;
  grid-template-columns: minmax(160px, .75fr) minmax(0, 1fr) minmax(180px, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.empty-section-resolution-row b {
  display: block;
  font-size: 12px;
  color: var(--ink);
}

.empty-section-resolution-row p {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text);
}

.empty-section-resolution-row small {
  display: block;
  min-width: 0;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.candidate-review-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
}

.candidate-review-row {
  padding: 10px 12px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffdf5;
}

.candidate-review-row b {
  display: block;
  font-size: 12.5px;
  color: var(--ink);
}

.candidate-review-row small,
.candidate-review-row p {
  display: block;
  margin: 3px 0 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}

.candidate-review-row span {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 700;
}

.clinical-mention-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  padding: 12px 14px;
}

.clinical-mention-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-low);
}

.clinical-mention-card.has-genome-candidate {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.clinical-mention-card.needs-alias-review {
  border-color: #fde68a;
  background: #fffdf5;
}

.clinical-mention-card.has-biosample-candidate {
  border-color: #bae6fd;
  background: #f0f9ff;
}

.clinical-mention-card.has-accession-gap {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.clinical-mention-card b {
  font-size: 12.5px;
  color: var(--ink);
}

.clinical-mention-card small {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}

.clinical-mention-card .candidate-link-note {
  width: fit-content;
  margin-top: 2px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eef2ff;
  color: #334155;
  font-weight: 700;
}

.identity-candidate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  padding: 12px 14px;
}

.identity-candidate-card {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  background: var(--surface-low);
}

.identity-candidate-card.assembly_candidate {
  border-left-color: var(--success);
}

.identity-candidate-card.biosample_only {
  border-left-color: #0ea5e9;
}

.identity-candidate-card.alias_review,
.identity-candidate-card.taxonomic_review,
.identity-candidate-card.no_public_strain_accession {
  border-left-color: var(--warning);
}

.identity-candidate-card b {
  display: block;
  margin-bottom: 4px;
  font-size: 12.5px;
  color: var(--ink);
}

.identity-candidate-card small {
  display: block;
  min-width: 0;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.identity-candidate-card p {
  margin: 7px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text);
}

.clinical-evidence-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  padding: 12px 14px 6px;
}

.clinical-evidence-metric {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-low);
}

.clinical-evidence-metric span,
.clinical-evidence-metric small {
  display: block;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--muted);
}

.clinical-evidence-metric b {
  display: block;
  margin: 3px 0;
  font-size: 17px;
  color: var(--ink);
}

.clinical-evidence-lists {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  padding: 6px 14px 12px;
}

.clinical-evidence-lists > div {
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.clinical-evidence-lists b {
  display: block;
  margin-bottom: 5px;
  font-size: 11.5px;
  color: var(--ink);
}

.clinical-evidence-lists p {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.accession-audit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
}

.accession-audit-row {
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(0, 1.4fr);
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  background: var(--surface-low);
}

.accession-audit-row.assembly_found {
  border-left-color: var(--success);
}

.accession-audit-row.alias_review,
.accession-audit-row.taxonomic_review {
  border-left-color: var(--warning);
}

.accession-audit-row.biosample_only {
  border-left-color: #0ea5e9;
}

.accession-audit-row.no_public_strain_accession {
  border-left-color: var(--critical);
}

.accession-audit-row b {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
  color: var(--ink);
}

.accession-audit-row small {
  display: block;
  min-width: 0;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.accession-audit-row p {
  margin: 4px 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text);
}

.provenance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  padding: 12px 14px;
}

.provenance-grid > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.provenance-grid > div > b {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--ink);
}

.provenance-row {
  display: grid;
  grid-template-columns: minmax(110px, .8fr) 42px minmax(0, 1.3fr);
  gap: 8px;
  align-items: start;
  padding: 7px 0;
  border-top: 1px solid var(--line-soft);
}

.provenance-row:first-of-type {
  border-top: 0;
}

.provenance-row span,
.provenance-row small {
  min-width: 0;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.provenance-row b {
  font-size: 13px;
  color: var(--ink);
  text-align: right;
}

.external-mini-row small {
  display: block;
  color: var(--subtle);
  font-size: 10.5px;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.external-mini-row a {
  margin-top: 4px;
  color: var(--primary-ui);
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
}

.business-governance-panel {
  display: grid;
  gap: 14px;
}

.business-view-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.business-view-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-low);
}

.business-view-card h3 {
  margin: 10px 0 6px;
  font-size: 14px;
}

.business-view-card b {
  display: block;
  color: var(--text);
  font-size: 22px;
}

.business-view-card p,
.business-view-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.business-governance-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 10px;
}

.business-governance-grid > article {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-low);
}

.business-governance-grid h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.business-page-group,
.business-policy-list {
  display: grid;
  gap: 8px;
}

.business-page-group {
  margin-bottom: 12px;
}

.business-page-group > b {
  font-size: 12px;
  color: var(--muted);
}

.business-page-group a,
.business-policy-list > div {
  display: block;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.business-page-group a:hover {
  border-color: rgba(194, 65, 12, 0.28);
  color: var(--primary-ui);
}

.business-page-group span,
.business-policy-list b {
  display: block;
  font-size: 13px;
  font-weight: 800;
}

.business-page-group small,
.business-policy-list p,
.business-policy-list small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.business-edge-frame {
  max-height: 360px;
}

.server-jobs-panel {
  display: grid;
  gap: 14px;
}

.server-job-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.server-job-summary span {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  padding: 7px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-low);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.server-job-summary b {
  color: var(--text);
  font-size: 18px;
}

.server-job-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.server-job-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-low);
}

.server-job-card.ok {
  border-color: rgba(22, 163, 74, 0.22);
}

.server-job-card.warn {
  border-color: rgba(217, 119, 6, 0.24);
}

.server-job-card.danger {
  border-color: rgba(220, 38, 38, 0.24);
}

.server-job-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.server-job-card h3 {
  margin: 10px 0 4px;
  font-size: 15px;
}

.server-job-card small,
.server-job-card p,
.server-job-card dd {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.server-job-card p {
  margin: 8px 0;
  color: var(--text);
  font-weight: 800;
}

.server-job-card dl {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 5px 8px;
  margin: 8px 0;
}

.server-job-card dt {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.server-job-card dd {
  margin: 0;
}

.server-job-card code {
  display: block;
  max-height: 86px;
  padding: 8px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.factor-meter.ok span { background: var(--success); }
.factor-meter.warn span { background: var(--warning); }
.factor-meter.danger span { background: var(--critical); }

.bacdive-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.bacdive-list-item {
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-low);
  min-width: 0;
  box-sizing: border-box;
}

.bacdive-list-item b,
.bacdive-list-item small,
.bacdive-list-item a {
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.bacdive-list-item small,
.bacdive-list-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.bacdive-list-item a {
  margin-top: 4px;
  color: var(--primary-ui);
  font-size: 12px;
  font-weight: 700;
}

.bacdive-list.compact {
  flex-direction: column;
  margin-top: 8px;
  padding: 0;
}

.bacdive-list.compact .bacdive-list-item {
  padding: 8px 10px;
}

@media (max-width: 980px) {
  .strain-detail-stack .analysis-summary,
  .strain-detail-stack .stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .strain-identity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .strain-integrated-grid {
    grid-template-columns: 1fr;
  }

  .external-standard-grid {
    grid-template-columns: 1fr;
  }

  .business-view-grid,
  .business-governance-grid,
  .server-job-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 640px) {
  .strain-detail-stack .analysis-summary,
  .strain-detail-stack .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .strain-identity-grid,
  .clinical-detail-grid {
    grid-template-columns: 1fr;
  }

  .strain-identity-grid .clinical-detail-field:nth-child(3),
  .strain-identity-grid .clinical-detail-field:nth-child(4),
  .strain-identity-grid .clinical-detail-field:nth-child(8) {
    grid-column: auto;
  }

}

@media (max-width: 900px) {
  .kg-evidence-toolbar {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .kg-evidence-toolbar form {
    justify-content: flex-start;
    grid-template-columns: auto minmax(130px, 1fr) 112px auto;
  }

  .kg-evidence-toolbar .segmented-control {
    grid-column: 1 / 2;
  }

  .kg-evidence-toolbar input {
    grid-column: 2 / 3;
  }

  .kg-evidence-toolbar select {
    grid-column: 3 / 4;
  }

  .kg-evidence-toolbar .button {
    grid-column: 4 / 5;
    grid-row: auto;
    align-self: stretch;
  }

  .kg-boundary-panel {
    align-items: flex-start;
    flex-direction: row;
  }

  .kg-boundary-panel code {
    margin-left: 0;
    white-space: normal;
  }
}

@media print {
  body {
    background: #fff;
    color: #111827;
  }

  .app-nav,
  .page-head,
  .report-template-grid,
  .report-brief,
  .doc-toolbar,
  .science-notice {
    display: none !important;
  }

  .app-shell,
  #app {
    display: block;
  }

  .app-main {
    width: auto;
    padding: 0;
  }

  .report-document {
    max-width: none;
    border: 0;
    background: #fff;
  }

  .stat-card,
  .panel,
  .card {
    border-color: #d1d5db;
    background: #fff;
  }

  body.report-printing .app-nav,
  body.report-printing .page-head,
  body.report-printing .report-console,
  body.report-printing .report-toc-panel,
  body.report-printing .app-footer,
  body.report-printing .doc-toolbar,
  body.report-printing .science-notice {
    display: none !important;
  }

  body.report-printing .app-shell,
  body.report-printing #app,
  body.report-printing .content-shell,
  body.report-printing .app-main,
  body.report-printing .report-preview-layout,
  body.report-printing #reportOutput,
  body.report-printing .report-variant-shell,
  body.report-printing .report-variant-docs {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  body.report-printing .report-variant-pane {
    display: none !important;
  }

  body.report-printing .report-variant-pane.active {
    display: block !important;
  }

  body.report-printing .report-document {
    width: auto !important;
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 18mm !important;
    border: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
  }
}

/* ==================== kg-evidence 增强样式 ==================== */

/* 章节图标 (Material Symbols) */
.section-icon {
  font-size: 18px;
  vertical-align: -3px;
  margin-right: 6px;
  color: var(--primary, #003778);
  font-variation-settings: 'FILL' 1, 'wght' 500;
}

/* 各模块图标专属配色 - 通过父容器class区分 */
.detail-section--micro-graph .section-icon { color: #155eef; }
.detail-section--identity .section-icon { color: #003778; }
.detail-section--meta .section-icon { color: #64748b; }

/* 临床效果摘要 - medical_services */
.detail-section .section-icon { }
/* 以下通过icon名称着色 (需JS配合data-icon属性) */
.section-icon[data-icon="conversion_path"] { color: #2563eb; }
.section-icon[data-icon="hub"] { color: #155eef; }
.section-icon[data-icon="alt_route"] { color: #7c3aed; }
.section-icon[data-icon="menu_book"] { color: #0d9488; }
.section-icon[data-icon="article"] { color: #2563eb; }
.section-icon[data-icon="dna"] { color: #0891b2; }
.section-icon[data-icon="clinical_notes"] { color: #dc2626; }
.section-icon[data-icon="medical_services"] { color: #059669; }
.section-icon[data-icon="science"] { color: #7c3aed; }
.section-icon[data-icon="table_chart"] { color: #0891b2; }

/* 论文标题 */
.article-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #191b21);
  line-height: 1.5;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: #eff6ff;
  border-radius: 6px;
  border-left: 3px solid var(--primary, #003778);
}

/* 论文摘要中英文对照 */
.detail-abstract {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.detail-abstract__en,
.detail-abstract__zh {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted, #424752);
  line-height: 1.75;
  border-left: 3px solid #cbd5e1;
  background: #f8fafc;
}
.detail-abstract__zh {
  background: #f0fdf4;
  border-left-color: #4ade80;
}
.detail-abstract__en {
  background: #f8fafc;
  border-left-color: #93c5fd;
}
.detail-abstract__label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  color: var(--subtle, #737783);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.detail-abstract__text {
  display: block;
  color: var(--text, #1e293b);
  white-space: pre-wrap;
  word-break: break-word;
}
.detail-abstract__loading-text {
  display: inline-block;
  font-style: italic;
  color: var(--muted, #94a3b8);
  font-size: 12px;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== 摘要翻译按钮 ===== */
.detail-abstract__translate {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: #fef3c7;
  border: 1px dashed #f59e0b;
  border-radius: 8px;
  margin-top: 2px;
}
.detail-abstract__translate-tip {
  font-size: 12px;
  color: #92400e;
  font-weight: 600;
}
.detail-abstract__translate-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 6px 12px;
  background: #d97706;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.detail-abstract__translate-btn:hover:not([disabled]) {
  background: #b45309;
}
.detail-abstract__translate-btn.is-loading {
  background: #a16207;
  opacity: 0.8;
  cursor: not-allowed;
}
.detail-abstract__translate-btn .material-symbols-outlined {
  font-size: 16px;
}
.detail-abstract__translate-error {
  margin-top: 6px;
  padding: 8px 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 11px;
  border-radius: 6px;
}

/* 结论标签 */
.detail-conclusion__label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--subtle, #737783);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

/* 数据表格 (基因组 / 临床) */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 12px;
  background: var(--surface, #fff);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.data-table thead {
  background: var(--surface-low, #f3f3fb);
}
.data-table thead th {
  padding: 8px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted, #424752);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--line-soft, #e2e2ea);
}
.data-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft, #e2e2ea);
  font-size: 12px;
  color: var(--text, #191b21);
  vertical-align: top;
}
.data-table tbody tr:hover {
  background: #f8fafc;
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.data-table--small tbody td {
  padding: 6px 10px;
  font-size: 11px;
}
.data-table--small thead th {
  padding: 6px 10px;
  font-size: 10px;
}

/* 临床表格 - 横向滚动 */
.data-table--clinical {
  font-size: 11px;
}
.data-table--clinical tbody td {
  font-size: 11px;
  padding: 6px 10px;
  word-break: break-word;
}

/* 滚动容器 — 废弃：旧的 display:block 方式已移除，改用 .detail-table-scroll */

/* 标签 (tag) */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #e2e8f0;
  color: #334155;
  margin-left: 6px;
}
.tag--strain { background: #fef3c7; color: #92400e; }
.tag--species { background: #dbeafe; color: #1e40af; }

/* 链接样式 */
.detail-entity-link {
  color: var(--primary, #003778);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s;
}
.detail-entity-link:hover {
  color: #0a2540;
  text-decoration: underline;
}
.detail-entity-link--secondary {
  color: var(--muted, #424752);
  font-weight: 400;
}

/* 空文本 */
.detail-empty-text {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--subtle, #737783);
  font-style: italic;
}

/* 客体标签增强 */
.object-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.object-tag {
  padding: 3px 8px;
  background: #e0f2fe;
  color: #0c4a6e;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}
.object-tag--en {
  background: #f1f5f9;
  color: #334155;
}

/* ---------- Compact footer ---------- */
.compact-footer {
  padding: 14px 22px 16px;
}
.compact-footer .footer-brand {
  display: grid;
  gap: 4px;
}
.compact-footer .footer-brand small {
  margin-top: 2px;
  font-size: 12px;
}
.footer-inline-link {
  color: #0c4a8c;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}
.footer-inline-link:hover {
  text-decoration: underline;
}

/* ---------- Data sources section ---------- */
.data-sources-section {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}
.data-sources-section .section-intro {
  color: #475569;
  line-height: 1.65;
  margin-bottom: 28px;
  font-size: 14px;
  max-width: 780px;
}
.data-sources-section .section-intro strong {
  color: #0c4a8c;
}
.data-source-category {
  margin-bottom: 32px;
}
.data-source-category h3 {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 16px 0;
  padding-left: 14px;
  border-left: 4px solid #0c4a8c;
}
.data-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}
.data-source-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 14px;
  background: #fff;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.data-source-card:hover {
  transform: translateY(-2px);
  border-color: rgba(12, 74, 140, 0.35);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}
.data-source-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.data-source-title a {
  font-size: 15px;
  color: #0c4a8c;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}
.data-source-title a:hover {
  text-decoration: underline;
}
.data-source-title .link-icon {
  font-size: 16px;
  opacity: 0.55;
}
.data-source-country {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 5px;
  background: #f1f5f9;
  border-radius: 999px;
  font-size: 11.5px;
  color: #475569;
  white-space: nowrap;
  flex-shrink: 0;
}
.country-flag {
  font-size: 16px;
  line-height: 1;
}
.country-name {
  font-weight: 600;
}
.data-source-institution {
  font-size: 12.5px;
  color: #64748b;
  font-style: italic;
  line-height: 1.5;
}
.data-source-description {
  font-size: 13px;
  color: #334155;
  line-height: 1.6;
  margin: 0;
}
.data-source-usage {
  margin-top: 2px;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 9px;
  font-size: 12.5px;
  line-height: 1.55;
  color: #475569;
}
.data-source-usage .usage-label {
  color: #0c4a8c;
  font-weight: 600;
}

@media (max-width: 640px) {
  .data-source-grid {
    grid-template-columns: 1fr;
  }
  .data-source-header {
    flex-wrap: wrap;
  }
}

/* ===== Knowledge: 目录中英文 */
.toc-en {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #7a8699;
  font-weight: 500;
}
.knowledge-toc > h3 {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.knowledge-toc > h3 .toc-en {
  margin-top: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #94a3b8;
}
.knowledge-toc nav a {
  display: grid;
  padding: 9px 10px 9px 14px;
}
.knowledge-toc nav a .toc-zh {
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
}

/* ===== Knowledge: 页脚信息说明（原 footer-brand 区） */
.knowledge-footer-info {
  display: grid;
  gap: 6px;
  padding: 18px 20px;
  margin: 6px 0 22px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.75);
}
.knowledge-footer-info .kfi-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.knowledge-footer-info .kfi-key {
  font-size: 13px;
  font-weight: 700;
  color: #0c4a8c;
}
.knowledge-footer-info .kfi-key-en {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.knowledge-footer-info .kfi-main,
.knowledge-footer-info .kfi-main-en,
.knowledge-footer-info .kfi-sub {
  margin: 0;
  line-height: 1.65;
}
.knowledge-footer-info .kfi-main {
  font-size: 13.5px;
  color: #334155;
}
.knowledge-footer-info .kfi-main-en {
  font-size: 12.5px;
  color: #64748b;
}
.knowledge-footer-info .kfi-sub {
  font-size: 12.5px;
  color: #7a8699;
}
.knowledge-footer-info .kfi-sub a {
  color: #0c4a8c;
  font-weight: 600;
  text-decoration: none;
}
.knowledge-footer-info .kfi-sub a:hover {
  text-decoration: underline;
}

/* ===== Knowledge: 章节标题双语 ===== */
.knowledge-article-section > h2 {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.knowledge-article-section > h2 .section-zh-title {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  padding-left: 14px;
  border-left: 4px solid #0c4a8c;
}
.knowledge-article-section > h2 .section-en-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #64748b;
  padding-left: 18px;
  letter-spacing: 0.05em;
  text-transform: none;
}

/* === 异步加载进度条与骨架屏 === */
.entity-loading-panel {
  padding: 16px 18px;
}
.entity-loading-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.entity-loading-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #334155;
}
.entity-progress-track {
  position: relative;
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.entity-progress-track.compact {
  height: 4px;
}
.entity-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary, #2563eb), #60a5fa);
  border-radius: inherit;
  animation: entity-progress-pulse 1.4s ease-in-out infinite;
  transform-origin: left center;
  transition: width 0.3s ease;
}
@keyframes entity-progress-pulse {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 1; }
}

/* === 合并页面：左侧检索 + 右侧详情 === */
.data-layout {
  gap: 16px;
}

/* 左侧：检索区 */
.data-sidebar {
  background: rgba(255, 255, 255, 0.6);
  border-radius: 10px;
  padding: 14px 14px 12px;
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.data-search-header h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 10px;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.03em;
}

.data-search-header h3 .material-symbols-outlined {
  font-size: 18px;
  color: var(--primary-ui, #2563eb);
}

.data-search-line {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.data-search-line input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  font-size: 13px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s;
  background: #fff;
}

.data-search-line input[type="search"]:focus {
  border-color: var(--primary-ui, #2563eb);
}

.data-search-line button {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--primary-ui, #2563eb);
  background: var(--primary-ui, #2563eb);
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.data-search-line button:hover {
  background: #1d4ed8;
}

.data-filter-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 8px;
  font-size: 12px;
  color: #475569;
}

.data-filter-strip label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
}

.data-filter-strip select {
  font-size: 12px;
  padding: 3px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
}

.data-compact-results {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 100px;
  margin: 4px -6px 0;
  padding: 4px 6px;
}

.data-compact-results::-webkit-scrollbar {
  width: 6px;
}

.data-compact-results::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

/* 紧凑列表项 */
.compact-list-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 8px;
  margin-bottom: 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  border: 1px solid transparent;
  background: transparent;
}

.compact-list-row:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.compact-list-row.active {
  background: #e0ecff;
  border-color: #b3cfff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.15);
}

.compact-list-main {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.3;
}

.compact-list-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-list-name i {
  font-style: italic;
  font-weight: 600;
}

.compact-list-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
}

.compact-list-meta .muted {
  color: #64748b;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.pill.small {
  font-size: 10px;
  padding: 1px 6px;
  font-weight: 600;
}

.pill.tiny {
  font-size: 10px;
  padding: 1px 5px;
  background: #f1f5f9;
  color: #475569;
  border-radius: 4px;
  font-weight: 600;
}

.pill.small.count {
  background: #fff8e1;
  color: #b26a00;
  margin-left: auto;
}

/* 右侧：详情区 */
.data-main-view {
  min-width: 0;
}

.data-main-view > * + * {
  margin-top: 16px;
}

/* 欢迎面板 */
.data-welcome-panel {
  padding: 28px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.data-welcome-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
}

.data-welcome-head .material-symbols-outlined {
  font-size: 26px;
  color: var(--primary-ui, #2563eb);
}

.data-welcome-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
}

.data-welcome-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  margin-bottom: 18px;
}

.data-welcome-main h3,
.data-welcome-side h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 12px;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 6px;
}

.data-welcome-main h3 .material-symbols-outlined,
.data-welcome-side h3 .material-symbols-outlined {
  font-size: 18px;
  color: var(--primary-ui, #2563eb);
}

.data-welcome-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.data-welcome-method {
  background: #f8fafc;
  border-radius: 8px;
  padding: 10px 14px;
}

.data-welcome-method b {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  display: block;
  margin-bottom: 3px;
}

.data-welcome-method p {
  font-size: 12px;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

.data-welcome-side ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.data-welcome-side ul li {
  font-size: 12px;
  color: #475569;
  line-height: 1.5;
  padding-left: 8px;
  border-left: 2px solid #e2e8f0;
}

.data-welcome-side ul li b {
  color: #1e293b;
  font-weight: 600;
}

.data-welcome-foot {
  font-size: 12px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  text-align: center;
}

/* 响应式：小屏幕切换为上下布局 */
@media (max-width: 900px) {
  .data-layout {
    grid-template-columns: 1fr;
  }
  .data-sidebar {
    position: static;
    max-height: none;
  }
  .data-welcome-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Search + Entity 合并布局 (Left 搜索列表 + Right 详情)
   ============================================================ */
.grid.search-layout {
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  height: calc(100vh - 32px);
  overflow: hidden;
}

.search-layout-left {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.search-layout-right {
  min-width: 0;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  padding-bottom: 56px;
}

.search-left-panel {
  display: flex;
  flex-direction: column;
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
  height: 100%;
  min-height: 0;
}

.search-box-wrapper {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.search-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
}
.search-input:focus {
  border-color: var(--primary);
}

.search-btn {
  padding: 8px 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.search-btn:hover { background: var(--primary-hover); }

.search-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  padding: 8px;
  background: rgba(148,163,184,.08);
  border-radius: 6px;
}

.search-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  min-width: 34px;
}

.filter-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #334155;
  cursor: pointer;
  user-select: none;
}
.filter-check input {
  margin: 0;
}

.sort-btn {
  padding: 3px 8px;
  background: #fff;
  color: #475569;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
}
.sort-btn-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.sort-btn:hover:not(.sort-btn-active) { background: #f1f5f9; }

.compact-list-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
}

.compact-list-count {
  font-size: 11px;
  color: #64748b;
  padding: 0 2px;
}

.compact-list-scroll {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-right: 4px;
  overscroll-behavior: contain;
}

.compact-list-row {
  display: flex;
  flex-direction: column;
  padding: 7px 10px;
  margin-bottom: 5px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  background: rgba(148,163,184,.05);
  transition: all .15s;
}
.compact-list-row:hover {
  background: rgba(59,130,246,.08);
  border-color: rgba(59,130,246,.2);
}
.compact-list-row-active {
  background: rgba(59,130,246,.12);
  border-color: var(--primary);
}

.compact-list-row-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.compact-list-row-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.compact-list-row-sub {
  font-size: 11px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.welcome-panel {
  padding: 20px 24px;
}
.welcome-header h2 {
  margin: 0 0 8px 0;
  font-size: 20px;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}
.welcome-suggest {
  margin-top: 16px;
  padding: 12px;
  background: rgba(59,130,246,.05);
  border-radius: 6px;
}
.welcome-suggest-title {
  font-size: 13px;
  color: #475569;
  margin-bottom: 8px;
  font-weight: 600;
}
.welcome-suggest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-btn {
  padding: 5px 12px;
  background: #fff;
  color: #3b82f6;
  border: 1px solid rgba(59,130,246,.3);
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}
.tag-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.entity-progress-track {
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0 6px 0;
}
.entity-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  border-radius: 999px;
  transition: width .4s ease;
}

/* 响应式：窄屏切换为上下布局 */
@media (max-width: 900px) {
  .grid.search-layout {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
  .search-layout-left {
    height: auto;
    overflow: visible;
  }
  .search-layout-right {
    height: auto;
    overflow: visible;
  }
  .compact-list-scroll {
    max-height: 300px;
  }
}

/* ============ 微型关系图样式 ============ */
.detail-section--micro-graph {
  padding: 16px 20px;
}

.micro-graph-canvas-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px;
  background: linear-gradient(135deg, #fafbfc 0%, #f0f4f8 100%);
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.micro-graph-canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.micro-graph-legend {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  gap: 10px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(100, 116, 139, 0.2);
  border-radius: 6px;
  font-size: 10px;
  color: #475569;
}

.micro-graph-legend__row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.micro-graph-legend__row .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.micro-graph-hint {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(100, 116, 139, 0.15);
  border-radius: 4px;
  font-size: 10px;
  color: #64748b;
}

/* 展开按钮 */
.micro-graph-expand-btn {
  margin-left: auto;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #475569;
  font-size: 11px;
  font-weight: 500;
  transition: all .15s;
}

.micro-graph-expand-btn:hover {
  background: #003778;
  border-color: #003778;
  color: #fff;
}

.micro-graph-expand-btn .material-symbols-outlined {
  font-size: 14px;
}

/* Viz Dashboard */
.viz-dashboard-panel {
  padding-top: 20px;
}

.viz-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.viz-stat-card {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px 16px;
  transition: border-color 0.15s;
}

.viz-stat-card:hover {
  border-color: #003778;
}

.viz-stat-label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
  margin-bottom: 6px;
}

.viz-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #191b21;
  line-height: 1.2;
}

.viz-stat-sub {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 4px;
}

.viz-section {
  margin-bottom: 24px;
}

.viz-section:last-child {
  margin-bottom: 0;
}

.viz-section-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px;
  color: #191b21;
}

.viz-section-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.viz-section-row-3 {
  grid-template-columns: repeat(3, 1fr);
}

.viz-section-row .viz-section {
  margin-bottom: 0;
}

.viz-chart {
  height: 300px;
  width: 100%;
}

.viz-chart-tall {
  height: 540px;
}

@media (max-width: 900px) {
  .viz-section-row,
  .viz-section-row-3 {
    grid-template-columns: 1fr;
  }
}

.manuscript-page {
  display: grid;
  gap: 16px;
  width: 100%;
}

.app-main:has(.manuscript-page) {
  max-width: none;
}

.manuscript-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.manuscript-header h1 {
  margin: 4px 0 8px;
  font-size: 28px;
  line-height: 1.2;
}

.manuscript-header p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.manuscript-toolbar {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.manuscript-meta,
.manuscript-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.manuscript-meta {
  margin-top: 14px;
}

.manuscript-actions {
  justify-content: flex-end;
  flex: 0 0 auto;
}

.manuscript-document {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 28px;
}

.manuscript-document h1 {
  margin: 0 0 18px;
  font-size: 30px;
  line-height: 1.25;
  color: var(--text);
}

.manuscript-document h2 {
  margin: 34px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  font-size: 22px;
  line-height: 1.3;
}

.manuscript-document h3 {
  margin: 24px 0 10px;
  font-size: 17px;
  line-height: 1.4;
}

.manuscript-document p,
.manuscript-document li {
  color: var(--slate);
  font-size: 15px;
  line-height: 1.85;
}

.manuscript-document p {
  margin: 0 0 14px;
}

.manuscript-document ul,
.manuscript-document ol {
  margin: 0 0 16px 22px;
  padding: 0;
}

.manuscript-document strong {
  color: var(--text);
}

.manuscript-document code {
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 1px 5px;
  background: var(--soft);
  font-size: 0.92em;
}

.manuscript-table-wrap {
  width: 100%;
  margin: 18px 0 20px;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.manuscript-table {
  width: 100%;
  min-width: 1020px;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
  color: var(--slate);
  font-size: 14px;
  line-height: 1.55;
}

.manuscript-table th,
.manuscript-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.manuscript-table th {
  background: var(--soft);
  color: var(--text);
  font-weight: 700;
  white-space: normal;
}

.manuscript-table th:nth-child(1),
.manuscript-table td:nth-child(1) {
  width: 12%;
}

.manuscript-table th:nth-child(2),
.manuscript-table td:nth-child(2) {
  width: 16%;
}

.manuscript-table th:nth-child(3),
.manuscript-table td:nth-child(3),
.manuscript-table th:nth-child(4),
.manuscript-table td:nth-child(4) {
  width: 14%;
}

.manuscript-table th:nth-child(5),
.manuscript-table td:nth-child(5) {
  width: 17%;
}

.manuscript-table th:nth-child(6),
.manuscript-table td:nth-child(6) {
  width: 27%;
}

.manuscript-table tr:last-child td {
  border-bottom: 0;
}

.manuscript-inline-figure {
  width: 100%;
  max-width: 880px;
  margin: 20px auto 12px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.manuscript-inline-figure.wide {
  max-width: 1040px;
}

.manuscript-inline-figure.compact {
  max-width: 660px;
}

.manuscript-inline-figure img,
.manuscript-inline-figure object {
  display: block;
  width: 100%;
}

.manuscript-inline-figure img {
  height: auto;
}

.manuscript-inline-figure object {
  height: clamp(280px, 35vw, 500px);
  border: 0;
}

.manuscript-inline-figure.wide object {
  height: clamp(320px, 38vw, 560px);
}

.manuscript-inline-figure.compact object {
  height: clamp(230px, 28vw, 360px);
}

.manuscript-figures {
  display: grid;
  gap: 16px;
}

.manuscript-figure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.manuscript-figure-card {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.manuscript-figure-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--soft);
}

.manuscript-figure-title b {
  color: var(--text);
  font-size: 13px;
}

.manuscript-figure-title span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
  text-align: right;
}

.manuscript-figure-svg {
  padding: 12px;
  overflow-x: auto;
}

.manuscript-figure-svg svg {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 760px) {
  .manuscript-header {
    display: grid;
  }

  .manuscript-actions {
    justify-content: flex-start;
  }

  .manuscript-document {
    padding: 18px;
  }

  .manuscript-document h1 {
    font-size: 24px;
  }

  .manuscript-inline-figure {
    padding: 8px;
    margin: 16px auto 10px;
  }

  .manuscript-inline-figure object,
  .manuscript-inline-figure.wide object,
  .manuscript-inline-figure.compact object {
    height: clamp(230px, 74vw, 360px);
  }

  .manuscript-figure-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
 * Metabolite search & detail modal
 * ============================================================ */

.met-link {
  color: #0f766e;
  text-decoration: none;
}
.met-link:hover { text-decoration: underline; }

/* Modal */
.met-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}
.met-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
  backdrop-filter: blur(2px);
}
.met-modal-card {
  position: relative;
  max-width: 1080px;
  width: calc(100vw - 64px);
  height: calc(100vh - 96px);
  margin: 48px auto 0;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line-soft);
}
.met-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #f8fafc, #fff);
}
.met-modal-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.met-modal-head .close {
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  color: var(--subtle);
  cursor: pointer;
  width: 36px; height: 36px;
  border-radius: 10px;
  transition: background .15s;
}
.met-modal-head .close:hover { background: var(--surface-mid); color: var(--text); }

.met-modal-body {
  overflow-y: auto;
  padding: 24px 28px 40px;
}

.met-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 18px 22px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 60%, #f8fafc 100%);
  border: 1px solid #bbf7d0;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.met-header h2 {
  font-size: 26px;
  font-weight: 800;
  color: #0f766e;
  letter-spacing: -0.3px;
}
.met-header .pill { margin-right: 8px; }
.met-summary {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 18px;
}
.met-summary > div {
  text-align: center;
  min-width: 86px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.7);
  border-radius: 12px;
  border: 1px solid rgba(15,118,110,0.15);
}
.met-summary b {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: #0f766e;
  line-height: 1.1;
}
.met-summary span {
  font-size: 11px;
  color: var(--subtle);
  margin-top: 4px;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.met-section {
  margin-bottom: 22px;
}
.met-section h4 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--line-soft);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  list-style: none;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #075985;
  border-radius: 999px;
  line-height: 1.4;
}
.chip code {
  font-size: 11px;
  background: rgba(255,255,255,0.6);
  padding: 1px 5px;
  border-radius: 4px;
}

.ext-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 8px;
}
.ext-list li {
  padding: 9px 12px;
  background: var(--surface-low);
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  font-size: 13px;
}
.ext-db {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  background: #e0e7ff;
  color: #3730a3;
  margin-right: 6px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tbl th, .tbl td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.tbl th {
  font-size: 11px;
  font-weight: 700;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: var(--surface-low);
}
.tbl tr:hover td { background: #fafafa; }
.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .ev {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  max-width: 380px;
}
.pmid {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: #1d4ed8;
  margin: 1px 2px;
  padding: 1px 5px;
  background: #eff6ff;
  border-radius: 4px;
}

@media (max-width: 768px) {
  .met-modal-card {
    width: calc(100vw - 20px);
    height: calc(100vh - 40px);
    margin: 20px auto 0;
    border-radius: 12px;
  }
  .met-summary { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .met-summary > div { min-width: 0; }
  .ext-list { grid-template-columns: 1fr; }
  .tbl { font-size: 11px; }
  .tbl th, .tbl td { padding: 6px 8px; }
}

/* ====================================================================
   Search 页面：顶部搜索框 + Tab 标签 + 卡片列表（v=search-tabs-v1）
   ==================================================================== */
.search-header-panel {
  display: grid;
  gap: 8px;
  padding: 12px 16px 10px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-low) 100%);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.search-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-header-title .material-symbols-outlined {
  font-size: 20px;
  color: var(--primary-ui);
}

.search-header-title h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.search-header-title .pill {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
  font-size: 11px;
  padding: 2px 8px;
}

.search-header-line {
  display: flex;
  gap: 8px;
  align-items: stretch;
  flex-wrap: wrap;
}

.search-header-line input[type="search"] {
  flex: 1 1 360px;
  min-width: 240px;
  min-height: 38px;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.search-header-line input[type="search"]:focus {
  outline: none;
  border-color: var(--primary-ui);
  box-shadow: 0 0 0 3px rgba(10, 77, 161, 0.12);
}

.search-header-line .button {
  min-height: 38px;
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
}

.search-header-hint {
  margin: 0;
  font-size: 11px;
  color: var(--subtle);
  line-height: 1.4;
}

/* Tab 标签条 */
.search-tab-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 6px 8px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  margin-bottom: 6px;
}

.search-tab-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.search-tab-item .material-symbols-outlined {
  font-size: 16px;
}

.search-tab-item b {
  font-weight: 700;
}

.search-tab-item:hover {
  background: var(--surface-low);
  color: var(--text);
  text-decoration: none;
}

.search-tab-item.active {
  background: var(--primary-dark, #0056b3);
  color: #fff;
  border-color: var(--primary-dark, #0056b3);
}

.search-tab-item.active .material-symbols-outlined {
  color: #fff;
}

.search-tab-item.active b {
  color: #fff;
}

.search-tab-item.active .search-tab-count {
  background: #fff;
  color: var(--primary-dark, #0056b3);
}

.search-tab-count {
  display: inline-block;
  min-width: 16px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
  line-height: 15px;
}

.search-tab-item:not(.active) .search-tab-count:empty {
  display: none;
}

.search-tab-item:not(.active) .search-tab-count:not(:empty) {
  background: var(--surface-mid);
  color: var(--muted);
}

.search-tab-note {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 10px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--subtle);
  background: var(--surface-low);
  border-radius: 6px;
}

.search-tab-note .material-symbols-outlined {
  font-size: 14px;
  color: var(--primary-ui);
}

.search-tab-body {
  min-height: 200px;
}

/* 搜索推荐面板 */
.search-recommend-panel {
  margin-top: 6px;
  padding: 14px 16px 16px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}

.search-recommend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.search-recommend-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.search-recommend-title .material-symbols-outlined {
  font-size: 18px;
  color: var(--primary-ui);
}

.search-recommend-refresh {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-low);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.search-recommend-refresh:hover {
  color: var(--primary-ui);
  border-color: var(--primary-ui);
  background: var(--primary-soft);
}

.search-recommend-refresh .material-symbols-outlined {
  font-size: 14px;
}

.search-recommend-groups {
  display: grid;
  gap: 12px;
}

.search-recommend-group {
  display: grid;
  gap: 6px;
}

.search-recommend-group-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  padding-left: 2px;
}

.search-recommend-group-label .material-symbols-outlined {
  font-size: 13px;
}

.search-recommend-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.search-recommend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface-low);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  line-height: 1.3;
}

.search-recommend-chip:hover {
  color: var(--primary-ui);
  background: var(--primary-soft);
  border-color: var(--primary-ui);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(10, 77, 161, 0.1);
}

.search-recommend-chip .material-symbols-outlined {
  font-size: 14px;
  opacity: 0.7;
}

.search-recommend-chip .chip-hint {
  font-size: 10px;
  color: var(--subtle);
  font-weight: 400;
  opacity: 0.8;
}

.search-recommend-chip:hover .chip-hint {
  color: var(--primary-ui);
}

/* 分组样式区分 */
.search-recommend-group[data-kind="hot"] .search-recommend-chip {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}
.search-recommend-group[data-kind="hot"] .search-recommend-chip:hover {
  background: #ffedd5;
  border-color: #fb923c;
  color: #7c2d12;
}

.search-recommend-group[data-kind="hot"] .search-recommend-group-label {
  color: #ea580c;
}

.search-recommend-group[data-kind="star"] .search-recommend-chip {
  background: #fefce8;
  border-color: #fde68a;
  color: #854d0e;
}
.search-recommend-group[data-kind="star"] .search-recommend-chip:hover {
  background: #fef9c3;
  border-color: #facc15;
  color: #713f12;
}

.search-recommend-group[data-kind="star"] .search-recommend-group-label {
  color: #ca8a04;
}

.search-recommend-group[data-kind="entry"] .search-recommend-chip {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}
.search-recommend-group[data-kind="entry"] .search-recommend-chip:hover {
  background: #dcfce7;
  border-color: #4ade80;
  color: #14532d;
}

.search-recommend-group[data-kind="entry"] .search-recommend-group-label {
  color: #16a34a;
}

.search-recommend-group[data-kind="research"] .search-recommend-chip {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}
.search-recommend-group[data-kind="research"] .search-recommend-chip:hover {
  background: #dbeafe;
  border-color: #60a5fa;
  color: #1e3a8a;
}

.search-recommend-group[data-kind="research"] .search-recommend-group-label {
  color: #2563eb;
}

/* 搜索结果卡片 */
.search-card-list {
  display: grid;
  gap: 10px;
}

.search-card {
  padding: 14px 16px;
  display: grid;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-card:hover {
  border-color: var(--primary-ui);
  box-shadow: 0 2px 12px rgba(10, 77, 161, 0.08);
}

.search-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.search-card-headline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1 1 320px;
}

.search-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.search-card-meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.search-card-sub {
  font-size: 12px;
  color: var(--subtle);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.search-card-abstract {
  margin-top: 4px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
  background: var(--surface-low);
  border-left: 3px solid var(--line);
  border-radius: 4px;
  overflow-wrap: anywhere;
}

.search-card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.search-card-actions .button {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 12px;
}

.search-card-actions .button .material-symbols-outlined {
  font-size: 16px;
}

/* 分页 */
.search-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
}

.search-pager-controls {
  display: flex;
  gap: 6px;
}

.search-pager-controls .button {
  min-height: 32px;
  padding: 4px 12px;
  font-size: 12px;
}

.search-pager-controls .button.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ====================================================================
   Entity 页面：统一 Hero / 行动工具条 / 各类型详情面板
   ==================================================================== */

/* 统一行动工具条 */
.entity-action-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.entity-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.id-mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 3px 8px;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

.entity-action-toolbar .entity-actions .button {
  min-height: 34px;
  padding: 4px 12px;
  font-size: 13px;
}

/* 统一 Hero 默认样式（其他类型保留 grid 布局） */
.entity-detail-hero {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 24px 28px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-low) 100%);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.entity-detail-hero-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
}

.entity-detail-hero-icon .material-symbols-outlined {
  font-size: 36px;
}

.entity-detail-hero-body {
  min-width: 0;
}

.entity-detail-hero-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.entity-detail-hero-body h1 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.entity-detail-hero-body p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.entity-detail-hero-body p.muted {
  color: var(--subtle);
  font-size: 12px;
  margin-top: 4px;
}

.entity-detail-hero-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 220px;
}

.entity-detail-hero-stats .hero-stat {
  flex: 1 1 70px;
  min-width: 70px;
  padding: 8px 10px;
  border-left: 3px solid var(--primary-ui);
  background: var(--surface);
  border-radius: 4px;
  text-align: left;
}

.entity-detail-hero-stats .hero-stat b {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink, var(--text));
  line-height: 1.1;
  margin-bottom: 3px;
}

.entity-detail-hero-stats .hero-stat span {
  display: block;
  font-size: 11px;
  color: var(--subtle);
  line-height: 1.3;
}

/* ============ Reference Hero：扁平 4 行布局 ============ */
.entity-detail-hero.reference-hero {
  display: block;
}

.entity-detail-hero-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.entity-detail-hero.reference-hero .entity-detail-hero-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}

.entity-detail-hero.reference-hero .entity-detail-hero-icon .material-symbols-outlined {
  font-size: 22px;
}

.entity-detail-hero.reference-hero .pill,
.entity-detail-hero.reference-hero .id-mono {
  text-decoration: none;
  flex-shrink: 0;
}

.entity-detail-hero.reference-hero .id-mono {
  color: var(--muted);
}

.entity-detail-hero.reference-hero .hero-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  padding: 4px 10px;
  border-left: 3px solid var(--primary-ui);
  background: var(--surface);
  border-radius: 4px;
  white-space: nowrap;
}

.entity-detail-hero.reference-hero .hero-stat b {
  display: inline;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink, var(--text));
  line-height: 1.4;
  margin: 0;
}

.entity-detail-hero.reference-hero .hero-stat span {
  display: inline;
  font-size: 11px;
  color: var(--subtle);
  line-height: 1.4;
  white-space: nowrap;
}

.entity-detail-hero.reference-hero h1 {
  margin: 0 0 2px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.entity-detail-hero.reference-hero p {
  margin: 0 0 2px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.entity-detail-hero.reference-hero p.muted {
  color: var(--subtle);
  font-size: 12px;
}

/* 统一 Hero 内 stat 卡片状态色：选择器优先级匹配父规则 */
.entity-detail-hero-stats .hero-stat.ok {
  border-left-color: var(--success);
}
.entity-detail-hero-stats .hero-stat.warn {
  border-left-color: var(--warning);
}
.entity-detail-hero-stats .hero-stat.bad {
  border-left-color: var(--danger, #dc2626);
}

/* Factor 类型颜色变体 */
.factor-hero-icon.factor-arg { background: #fee2e2; color: #b91c1c; }
.factor-hero-icon.factor-prophage { background: #ffedd5; color: #c2410c; }
.factor-hero-icon.factor-mgc { background: #ede9fe; color: #6d28d9; }
.factor-hero-icon.factor-rrna { background: #cffafe; color: #0e7490; }
.factor-hero-icon.factor-vfdb { background: #fee2e2; color: #991b1b; }

.reference-hero-icon { background: #ecfccb; color: #4d7c0f; }
.clinical-hero-icon { background: #dbeafe; color: #1d4ed8; }
.metabolite-hero-icon { background: #ccfbf1; color: #0f766e; }
.species-hero-icon { background: #e0f2fe; color: #0369a1; }
.genome-hero-icon { background: #f3e8ff; color: #7e22ce; }
.strain-hero-icon { background: #fef3c7; color: #b45309; }

/* 兼容旧 species-hero 的过渡样式：统一为 entity-detail-hero 后保留兼容 */
.species-detail-hero .entity-detail-hero-body h1 { font-style: italic; }
.species-detail-hero .entity-detail-hero-body h1.no-italic { font-style: normal; }

/* KG 边界提示 */
.kg-boundary-panel {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  font-size: 12px;
  color: #92400e;
  line-height: 1.5;
}

.kg-boundary-panel .material-symbols-outlined {
  font-size: 18px;
  color: var(--warning);
  flex-shrink: 0;
  margin-top: 1px;
}

.kg-boundary-panel p {
  margin: 0;
}

/* Factor 详情子面板 */
.factor-ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 12px;
  margin: 8px 0;
}

.factor-ref-grid > div {
  display: grid;
  gap: 2px;
  padding: 6px 10px;
  background: var(--surface-low);
  border-radius: 4px;
}

.factor-ref-grid > div span {
  font-size: 11px;
  color: var(--subtle);
}

.factor-ref-grid > div b {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.factor-ref-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.factor-ref-tags span {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  background: var(--surface-mid);
  color: var(--muted);
  border-radius: 999px;
}

/* Reference 详情子面板 */
.reference-external-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 20px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.reference-external-links .button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.reference-abstract {
  margin: 0;
  padding: 14px 18px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.65;
  background: transparent;
  border-left: none;
  border-radius: 0;
  overflow-wrap: anywhere;
}

.reference-abstract-zh {
  margin: 0;
  padding: 14px 18px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  background: transparent;
  border-left: none;
  border-radius: 0;
  overflow-wrap: anywhere;
}

/* 响应式：小屏 */
@media (max-width: 768px) {
  .entity-detail-hero {
    gap: 12px;
    padding: 14px;
  }
  .entity-detail-hero-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
  }
  .entity-detail-hero-icon .material-symbols-outlined {
    font-size: 28px;
  }
  .entity-detail-hero.reference-hero {
    padding: 14px;
  }
  .entity-detail-hero-top {
    gap: 8px;
    margin-bottom: 10px;
  }
  .search-header-line input[type="search"] {
    flex: 1 1 100%;
  }
  .search-header-line .button {
    flex: 1 1 auto;
  }
  .search-tab-item {
    padding: 6px 10px;
    font-size: 12px;
  }
  .search-pager {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ===== 应用菌株库 · 查看全部 ===== */
.pool-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(10, 77, 161, 0.05);
  border: 1px solid rgba(10, 77, 161, 0.18);
  margin-bottom: 14px;
}
.pool-bar.slim {
  padding: 8px 12px;
  border-radius: 12px;
  margin-bottom: 10px;
}
.pool-bar-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.pool-bar-icon {
  color: var(--primary-ui, #0a4da1);
  font-size: 22px;
  flex: 0 0 auto;
}
.pool-bar-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #191b21);
  line-height: 1.45;
}
.pool-bar-title b {
  color: var(--primary-ui, #0a4da1);
  font-size: 15px;
  font-weight: 700;
}
.pool-bar-sub {
  font-size: 12px;
  color: var(--subtle, #737783);
  margin-top: 2px;
}
.pool-bar .button { flex: 0 0 auto; white-space: nowrap; }
.pool-bar-loading {
  height: 58px;
  border-radius: 14px;
  margin-bottom: 14px;
  background: linear-gradient(90deg, rgba(10, 77, 161, 0.05), rgba(10, 77, 161, 0.13), rgba(10, 77, 161, 0.05));
  background-size: 200% 100%;
  animation: poolShimmer 1.3s infinite;
}
@keyframes poolShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 模态框遮罩与面板 */
.pool-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.pool-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.pool-modal {
  width: min(1180px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--surface, #ffffff);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.26);
  overflow: hidden;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.24s cubic-bezier(0.34, 1.3, 0.64, 1);
}
.pool-modal-overlay.open .pool-modal {
  transform: none;
}

/* 头部 */
.pool-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft, #e2e2ea);
  background: linear-gradient(180deg, rgba(10, 77, 161, 0.04), transparent);
}
.pool-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.pool-modal-title > .material-symbols-outlined {
  color: var(--primary-ui, #0a4da1);
  font-size: 26px;
}
.pool-modal-title h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text, #191b21);
  line-height: 1.3;
}
.pool-modal-title small {
  display: block;
  font-size: 11px;
  color: var(--subtle, #737783);
  font-weight: 400;
  margin-top: 1px;
}
.pool-modal-tabs {
  display: flex;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.pool-modal-tabs::-webkit-scrollbar { display: none; }
.pool-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid var(--line, #c3c6d3);
  border-radius: 999px;
  background: var(--surface, #ffffff);
  color: var(--muted, #424752);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.18s;
}
.pool-tab:hover {
  border-color: var(--primary-ui, #0a4da1);
  color: var(--primary-ui, #0a4da1);
}
.pool-tab.active {
  background: var(--primary-ui, #0a4da1);
  border-color: var(--primary-ui, #0a4da1);
  color: #ffffff;
}
.pool-tab-count {
  font-size: 11px;
  font-weight: 700;
  background: rgba(10, 77, 161, 0.12);
  color: var(--primary-ui, #0a4da1);
  border-radius: 999px;
  padding: 0 7px;
  line-height: 1.6;
}
.pool-tab.active .pool-tab-count {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}
.pool-modal-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--subtle, #737783);
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.pool-modal-close:hover {
  background: rgba(15, 23, 42, 0.07);
  color: var(--text, #191b21);
}

/* 工具栏 */
.pool-modal-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line-soft, #e2e2ea);
}
.pool-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  max-width: 460px;
}
.pool-search-wrap .pool-search-icon {
  position: absolute;
  left: 10px;
  color: var(--subtle, #737783);
  font-size: 18px;
  pointer-events: none;
}
.pool-search-wrap input {
  width: 100%;
  min-height: 34px;
  padding: 6px 34px 6px 34px;
  border: 1px solid var(--line, #c3c6d3);
  border-radius: 10px;
  background: var(--surface, #ffffff);
  color: var(--text, #191b21);
  font-size: 13px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.pool-search-wrap input:focus {
  border-color: var(--primary-ui, #0a4da1);
  box-shadow: 0 0 0 3px rgba(10, 77, 161, 0.12);
}
.pool-search-clear {
  position: absolute;
  right: 6px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--subtle, #737783);
  cursor: pointer;
}
.pool-search-clear:hover { background: rgba(15, 23, 42, 0.07); color: var(--text); }
.pool-search-wrap input:not(:placeholder-shown) ~ .pool-search-clear,
.pool-search-wrap .visible { display: inline-flex; }
.pool-modal-summary {
  font-size: 12px;
  color: var(--muted, #424752);
  flex: 0 0 auto;
  white-space: nowrap;
}
.pool-modal-summary b { color: var(--primary-ui, #0a4da1); }
.pool-summary-loading { color: var(--subtle, #737783); font-style: italic; }

/* 表格区 */
.pool-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0;
}
.pool-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 48px 0;
  color: var(--subtle, #737783);
  font-size: 13px;
}
.pool-loading .screening-state-icon {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(10, 77, 161, 0.25);
  border-top-color: var(--primary-ui, #0a4da1);
  border-radius: 50%;
  animation: poolSpin 0.8s linear infinite;
}
@keyframes poolSpin { to { transform: rotate(360deg); } }

.pool-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.pool-table th,
.pool-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft, #e2e2ea);
  vertical-align: middle;
}
.pool-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-low, #f3f3fb);
  color: var(--muted, #424752);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}
.pool-table tbody tr { transition: background 0.12s; }
.pool-table tbody tr:hover { background: rgba(10, 77, 161, 0.04); }
.pool-rank {
  color: var(--subtle, #737783);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.pool-strain { min-width: 220px; max-width: 320px; }
.pool-sp {
  font-weight: 700;
  color: var(--text, #191b21);
  white-space: nowrap;
}
.pool-strain-name {
  font-size: 12px;
  color: var(--muted, #424752);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}
.pool-acc {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--subtle, #737783);
  margin-top: 1px;
}
.pool-acc-tag {
  display: inline-block;
  font-family: inherit;
  font-size: 9.5px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 4px;
  padding: 1.5px 4px;
  margin-right: 5px;
  vertical-align: 1px;
}
.pool-num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pool-host {
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted, #424752);
}
.pool-risk {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.09);
  color: #b91c1c;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.pool-ok { color: var(--line, #c3c6d3); }
.pool-open {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-ui, #0a4da1);
  white-space: nowrap;
}
.pool-open:hover { text-decoration: underline; }

.pool-quality {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.pool-quality.q-a { background: rgba(45, 138, 94, 0.12); color: #1e7a52; }
.pool-quality.q-b { background: rgba(10, 77, 161, 0.1); color: var(--primary-ui, #0a4da1); }
.pool-quality.q-c { background: rgba(217, 119, 6, 0.12); color: #b45309; }
.pool-quality.q-d { background: rgba(115, 119, 131, 0.12); color: var(--subtle, #737783); }

/* 分页 */
.pool-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 18px;
  border-top: 1px solid var(--line-soft, #e2e2ea);
  background: var(--surface-low, #f3f3fb);
}
.pool-page-info {
  font-size: 12px;
  color: var(--muted, #424752);
  white-space: nowrap;
}
.pool-pager {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.pool-pager::-webkit-scrollbar { display: none; }
.pool-page-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--line, #c3c6d3);
  border-radius: 8px;
  background: var(--surface, #ffffff);
  color: var(--muted, #424752);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pool-page-btn:hover:not(:disabled) {
  border-color: var(--primary-ui, #0a4da1);
  color: var(--primary-ui, #0a4da1);
}
.pool-page-btn.active {
  background: var(--primary-ui, #0a4da1);
  border-color: var(--primary-ui, #0a4da1);
  color: #ffffff;
  cursor: default;
}
.pool-page-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.pool-page-ellipsis {
  color: var(--subtle, #737783);
  padding: 0 2px;
}

@media (max-width: 900px) {
  .pool-modal-header { flex-wrap: wrap; }
  .pool-modal-tabs { order: 3; width: 100%; flex-basis: 100%; }
  .pool-modal-toolbar { flex-wrap: wrap; }
  .pool-search-wrap { max-width: none; flex-basis: 100%; }
  .pool-modal-summary { flex-basis: 100%; white-space: normal; }
  .pool-modal-footer { flex-direction: column; align-items: stretch; }
  .pool-pager { justify-content: center; }
}

/* ============ 新首页（视频 Hero + 数据概览） ============ */
.new-home-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.home-video-hero {
  position: relative;
  height: 100vh;
  margin-top: -82px;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  width: auto;
  margin-bottom: 18px;
  border-radius: 0;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(160deg, #0b1526, #12243f);
}

.home-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.home-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at 22% 38%, rgba(6, 30, 58, 0.28) 0%, rgba(6, 30, 58, 0.62) 58%, rgba(5, 18, 36, 0.88) 100%),
    linear-gradient(180deg, rgba(10, 18, 34, 0.35) 0%, rgba(10, 18, 34, 0.1) 42%, rgba(8, 16, 32, 0.9) 100%);
}

.home-hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  padding: 0 32px 64px;
  color: #fff;
  max-width: 920px;
  margin: 0 auto;
}

.home-hero-content .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 22px;
}

.home-hero-content h1 {
  font-size: clamp(20px, 3.4vw, 52px);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
  white-space: nowrap;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.home-hero-content p {
  font-size: clamp(12px, 1.3vw, 15px);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
  max-width: none;
  margin: 0 0 30px;
  white-space: nowrap;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
}

.home-hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.home-hero-actions .button {
  min-height: 44px;
  padding: 10px 22px;
  font-size: 14px;
  border-radius: 999px;
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  backdrop-filter: blur(10px);
}

.home-hero-actions .button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #fff;
  box-shadow: 0 8px 26px rgba(37, 99, 235, 0.38);
}

.home-hero-actions .button:hover {
  filter: brightness(1.08);
  text-decoration: none;
}

.home-scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.home-scroll-hint .material-symbols-outlined {
  font-size: 22px;
  animation: home-scroll-bounce 1.8s ease-in-out infinite;
}

@keyframes home-scroll-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.65; }
  50% { transform: translateY(6px); opacity: 1; }
}

/* 问答引导板块（浅色主题：与全局 glass 风格一致）
   ⚠️ glass-theme.css 的 .panel 规则带 !important，此面板必须用 !important 突破 */
.panel.home-chat-guide {
  position: relative;
  padding: 40px 40px 36px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 10% -8%, rgba(0, 122, 255, 0.05) 0%, transparent 52%),
    radial-gradient(ellipse at 92% 108%, rgba(6, 182, 212, 0.04) 0%, transparent 46%),
    linear-gradient(160deg, #ffffff 0%, #f6f8fc 52%, #ffffff 100%) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06), 0 1px 0 rgba(255, 255, 255, 0.7) inset !important;
}

.panel.home-chat-guide:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.10), 0 1px 0 rgba(255, 255, 255, 0.8) inset !important;
}

.home-chat-guide::before {
  content: "";
  position: absolute;
  top: -90px;
  right: -80px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 122, 255, 0.05) 0%, transparent 68%);
  pointer-events: none;
  z-index: 0;
}

.home-chat-guide::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(0, 122, 255, 0.3), transparent);
  pointer-events: none;
  z-index: 0;
}

.chat-guide-hero {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 28px;
  margin-bottom: 26px;
  border-bottom: 1px dashed var(--line);
}

.chat-guide-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(0, 122, 255, 0.10);
  border: 1px solid rgba(0, 122, 255, 0.20);
  color: #007aff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.home-chat-guide .chat-guide-title h2 {
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  color: var(--text) !important;
  text-shadow: none;
}

.home-chat-guide .chat-guide-title p {
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--muted) !important;
  max-width: 660px;
  margin: 0;
}

.chat-guide-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 28px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
  color: #fff !important;
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.42) !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.chat-guide-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 38px rgba(59, 130, 246, 0.5) !important;
  filter: brightness(1.08);
  text-decoration: none !important;
  color: #fff !important;
}

.chat-guide-cta-arrow {
  font-size: 18px;
  transition: transform 0.18s ease;
}

.chat-guide-cta:hover .chat-guide-cta-arrow {
  transform: translateX(4px);
}

.chat-guide-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.chat-guide-card {
  display: flex;
  flex-direction: column;
  padding: 18px 18px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--surface-low);
  backdrop-filter: blur(8px);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.chat-guide-card:hover {
  border-color: rgba(0, 122, 255, 0.30);
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.chat-guide-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.chat-guide-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.12), rgba(6, 182, 212, 0.08));
  font-size: 18px;
  flex-shrink: 0;
}

.home-chat-guide .chat-guide-card-head b {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text) !important;
  line-height: 1.3;
}

.home-chat-guide .chat-guide-card-head small {
  display: block;
  font-size: 11.5px;
  color: var(--subtle) !important;
  margin-top: 2px;
}

.chat-guide-card-questions {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-chat-guide .chat-guide-question {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 8px;
  border-radius: 9px;
  color: var(--muted) !important;
  font-size: 13px;
  line-height: 1.55;
  transition: background 0.15s ease, color 0.15s ease;
}

.home-chat-guide .chat-guide-question:hover {
  background: rgba(0, 122, 255, 0.08);
  color: #1d4ed8 !important;
  text-decoration: none;
}

.chat-guide-q {
  flex: 1;
}

.home-chat-guide .chat-guide-arrow {
  font-size: 12px;
  color: var(--subtle) !important;
  opacity: 0;
  transform: translate(-3px, 2px);
  transition: opacity 0.16s ease, transform 0.16s ease, color 0.16s ease;
  flex-shrink: 0;
}

.home-chat-guide .chat-guide-question:hover .chat-guide-arrow {
  opacity: 1;
  transform: translate(0, 2px);
  color: #1d4ed8 !important;
}

@media (max-width: 1080px) {
  .chat-guide-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .panel.home-chat-guide {
    padding: 26px 20px 22px;
  }
  .chat-guide-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .chat-guide-grid {
    grid-template-columns: 1fr;
  }
}

/* 数据来源精简区 */
.home-source-links {
  background: linear-gradient(180deg, #ffffff, #f6f7fb);
}

.home-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.home-source-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
}

.home-source-item b {
  font-size: 13px;
  color: var(--text);
}

.home-source-item span {
  font-size: 12px;
  color: var(--subtle);
}

@media (max-width: 760px) {
  .home-video-hero {
    height: 72vh;
    margin-top: -72px;
  }
  .home-hero-content {
    padding: 0 20px 72px;
  }
  .home-hero-content h1 {
    font-size: 26px;
    white-space: normal;
    line-height: 1.3;
  }
  .home-hero-content p {
    white-space: normal;
    max-width: 92%;
  }
}

/* 首页视频全屏：禁止横向滚动溢出 */
body:has(.home-video-hero) {
  overflow-x: clip;
}

/* 首页定位板块（复用 professional-hero 两栏布局） */
.home-positioning {
  background:
    radial-gradient(ellipse at 92% 18%, rgba(37, 99, 235, 0.08) 0%, transparent 55%),
    linear-gradient(180deg, #ffffff, #f6f9ff);
}

.home-positioning h2 {
  margin: 8px 0 10px;
  font-size: 26px;
  line-height: 1.2;
}

@media (max-width: 760px) {
  .home-positioning {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   AI 问答页（全新重构 · 三区布局）
   ============================================================ */
.app-main:has(.chat-workspace) {
  max-width: none;
  padding: 64px 18px 18px;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.chat-workspace {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  width: 100%;
  margin: 0;
}

/* 桌面端：面板为可收起浮窗 */
.chat-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  width: 248px;
  padding: 14px 12px;
  border-radius: 18px;
  background: var(--surface-high, rgba(255, 255, 255, 0.72));
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--glass-shadow, 0 8px 32px rgba(0, 0, 0, 0.08));
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  overflow: hidden;
  transition: width 0.32s cubic-bezier(0.34, 1.3, 0.64, 1),
              opacity 0.24s ease,
              padding 0.32s ease,
              border-width 0.32s ease,
              transform 0.32s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.chat-sidebar.chat-sidebar-collapsed {
  width: 0;
  padding: 0;
  border-width: 0;
  opacity: 0;
  transform: translateX(-20px);
  pointer-events: none;
}

/* 左面板恢复 tab */
.chat-sidebar-tab {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 45;
  width: 30px;
  padding: 12px 4px;
  border-radius: 0 10px 10px 0;
  background: var(--surface-high, rgba(255, 255, 255, 0.72));
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-left: none;
  box-shadow: 4px 4px 16px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(16px);
  cursor: pointer;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text, #1d1d1f);
  letter-spacing: 0.08em;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
  user-select: none;
  transition: background 0.18s ease, transform 0.18s ease;
}
.chat-sidebar-tab:hover {
  background: rgba(255, 255, 255, 0.92);
  transform: translateY(-50%) translateX(2px);
}
.chat-sidebar-tab .material-symbols-outlined {
  font-size: 16px;
  transform: rotate(90deg);
}
.chat-sidebar.chat-sidebar-collapsed + .chat-sidebar-tab {
  display: flex;
}

/* 侧栏头部 */
.chat-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line, rgba(0, 0, 0, 0.08));
}
.chat-sidebar-head b {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text, #1d1d1f);
}
.chat-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--subtle, #6e6e73);
  cursor: pointer;
}
.chat-sidebar-toggle:hover { background: rgba(0, 0, 0, 0.06); }
.chat-sidebar-toggle .material-symbols-outlined { font-size: 17px; }

/* 批量操作栏 */
.chat-batch-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 6px 2px;
}
.chat-batch-bar.active { display: flex; }
.chat-batch-checkall {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted, #424752);
  cursor: pointer;
  user-select: none;
}
.chat-batch-checkall input { margin: 0; width: 14px; height: 14px; cursor: pointer; }
.chat-batch-del {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: none;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.10);
  color: #dc2626;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.14s ease;
}
.chat-batch-del:hover:not(:disabled) { background: rgba(239, 68, 68, 0.20); }
.chat-batch-del:disabled { opacity: 0.4; cursor: not-allowed; }
.chat-batch-del .material-symbols-outlined { font-size: 15px; }

/* 会话项复选框 */
.chat-session-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  cursor: pointer;
  flex-shrink: 0;
}
.chat-session-check input {
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
  accent-color: #2563eb;
}
.chat-session-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 6px;
  align-items: center;
  padding: 9px 8px;
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.14s ease;
}
.chat-session-item:hover { background: rgba(0, 0, 0, 0.04); }
.chat-session-item.active { background: rgba(37, 99, 235, 0.10); }
.chat-session-item.checked { background: rgba(37, 99, 235, 0.06); }

/* 清空全部按钮 */
.chat-clearall-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px;
  border: 1px dashed var(--line, rgba(0, 0, 0, 0.12));
  border-radius: 10px;
  background: transparent;
  color: var(--subtle, #6e6e73);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
  flex-shrink: 0;
}
.chat-clearall-btn:hover {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.25);
  color: #dc2626;
}
.chat-clearall-btn .material-symbols-outlined { font-size: 15px; }

.chat-new-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(59, 130, 246, 0.35);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}
.chat-new-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.07);
}
.chat-new-btn .material-symbols-outlined {
  font-size: 19px;
}

.chat-session-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}
.chat-session-list::-webkit-scrollbar { width: 4px; }
.chat-session-list::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.14); border-radius: 4px; }

.chat-session-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 9px 10px;
  border-radius: 11px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.chat-session-item:hover {
  background: rgba(0, 122, 255, 0.06);
}
.chat-session-item.active {
  background: rgba(0, 122, 255, 0.10);
  border-color: rgba(0, 122, 255, 0.22);
}
.chat-session-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chat-session-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #1d1d1f);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-session-meta {
  font-size: 11px;
  color: var(--subtle, #6e6e73);
}
.chat-session-ops {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.chat-session-item:hover .chat-session-ops,
.chat-session-item.active .chat-session-ops {
  opacity: 1;
}
.chat-session-ops button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--subtle, #6e6e73);
  cursor: pointer;
}
.chat-session-ops button:hover {
  background: rgba(0, 0, 0, 0.07);
  color: var(--text, #1d1d1f);
}
.chat-session-ops .material-symbols-outlined {
  font-size: 16px;
}
.chat-session-empty {
  padding: 22px 12px;
  text-align: center;
  font-size: 12.5px;
  color: var(--subtle, #6e6e73);
}
.chat-sidebar-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 6px 2px;
  border-top: 1px solid var(--line, rgba(0, 0, 0, 0.08));
  font-size: 11px;
  color: var(--subtle, #6e6e73);
}
.chat-sidebar-foot .material-symbols-outlined {
  font-size: 15px;
}

/* ---------- 对话流主区 ---------- */
.chat-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: hidden;
}

.chat-stream {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-stream::-webkit-scrollbar { width: 6px; }
.chat-stream::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.14); border-radius: 6px; }

/* ---------- 空状态 ---------- */
.chat-empty {
  margin: 48px auto 0;
  max-width: 940px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 8px 4px 24px;
}
.chat-empty-hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 0 4px;
}
.chat-empty-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #1d1d1f);
}
.chat-empty-brand img {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  object-fit: cover;
}
.chat-empty-hero h1 {
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text, #1d1d1f);
}
.chat-empty-hero p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted, #424752);
  max-width: 720px;
  margin: 0;
}

.chat-guide-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.chat-guide-card {
  display: flex;
  flex-direction: column;
  padding: 16px 16px 12px;
  border: 1px solid var(--line-soft, rgba(255, 255, 255, 0.6));
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.chat-guide-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 122, 255, 0.30);
}
.chat-guide-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line, rgba(0, 0, 0, 0.07));
}
.chat-guide-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(6, 182, 212, 0.10));
  font-size: 17px;
  flex-shrink: 0;
}
.chat-guide-card-head b {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text, #1d1d1f);
  line-height: 1.3;
}
.chat-guide-card-head small {
  display: block;
  font-size: 11px;
  color: var(--subtle, #6e6e73);
  margin-top: 1px;
}
.chat-guide-card-questions {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chat-guide-question {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  padding: 7px 6px;
  border: none;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted, #424752);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.chat-guide-question:hover {
  background: rgba(0, 122, 255, 0.08);
  color: #1d4ed8;
}
.chat-guide-q { flex: 1; }
.chat-guide-arrow {
  font-size: 11px;
  color: var(--subtle, #6e6e73);
  opacity: 0;
  transform: translate(-3px, 1px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  flex-shrink: 0;
}
.chat-guide-question:hover .chat-guide-arrow {
  opacity: 1;
  transform: translate(0, 1px);
}

.chat-empty-tip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 12px;
  background: rgba(0, 122, 255, 0.07);
  border: 1px dashed rgba(0, 122, 255, 0.28);
  font-size: 12.5px;
  color: var(--muted, #424752);
}
.chat-empty-tip .material-symbols-outlined {
  font-size: 16px;
  color: #2563eb;
}

/* ---------- 消息 ---------- */
.chat-turn {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chat-turn-user {
  align-items: flex-end;
}
.chat-turn-ai {
  align-items: flex-start;
}
.chat-user-bubble {
  max-width: min(56%, 480px);
  padding: 4px 8px;
  border-radius: 10px 10px 2px 10px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  font-size: 14px;
  line-height: 1.35;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.18);
  white-space: pre-line;
  word-break: break-word;
}
.chat-image-strip {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.chat-image-strip img {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.45);
}
.chat-turn-time {
  font-size: 10.5px;
  color: var(--subtle, #6e6e73);
  padding: 0 4px;
}

/* ---------- 回答卡片 ---------- */
.chat-answer-card {
  width: 100%;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line-soft, rgba(255, 255, 255, 0.6));
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
}
.chat-intent-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.chat-intent-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(0, 122, 255, 0.10);
  border: 1px solid rgba(0, 122, 255, 0.20);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.chat-intent-badge .material-symbols-outlined {
  font-size: 15px;
}
.chat-conclusion {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--text, #1d1d1f);
}
.chat-plan-hint {
  font-size: 11.5px;
  color: var(--subtle, #6e6e73);
}
.chat-retrieval-progress {
  height: 4px;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(0, 122, 255, 0.10);
  position: relative;
}
.chat-progress-bar {
  position: absolute;
  inset: 0;
  width: 40%;
  border-radius: 4px;
  background: linear-gradient(90deg, transparent, #3b82f6, transparent);
  animation: chat-progress-slide 1.2s ease-in-out infinite;
}
@keyframes chat-progress-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* 命中概览 */
.chat-hit-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chat-hit-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.045);
  border: 1px solid var(--line, rgba(0, 0, 0, 0.08));
  font-size: 11.5px;
  color: var(--muted, #424752);
}
.chat-hit-pill b {
  font-size: 12.5px;
  color: #1d4ed8;
}

/* markdown 正文 */
.chat-md-body {
  font-size: 14px;
  line-height: 1.85;
  color: var(--text, #1d1d1f);
}
.chat-md-body p { margin: 0 0 10px; }
.chat-md-body p:last-child { margin-bottom: 0; }
.chat-md-body h1, .chat-md-body h2, .chat-md-body h3 {
  margin: 14px 0 8px;
  font-weight: 700;
  line-height: 1.4;
}
.chat-md-body h1 { font-size: 17px; }
.chat-md-body h2 { font-size: 15.5px; }
.chat-md-body h3 { font-size: 14.5px; }
.chat-md-body ul, .chat-md-body ol { margin: 6px 0 10px; padding-left: 22px; }
.chat-md-body li { margin: 3px 0; }
.chat-md-body code {
  padding: 1.5px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.06);
  font-size: 12.5px;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
}
.chat-md-body pre {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.92);
  color: #e2e8f0;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.6;
  margin: 10px 0;
}
.chat-md-body pre code { background: transparent; color: inherit; padding: 0; }
.chat-md-body blockquote {
  margin: 10px 0;
  padding: 8px 14px;
  border-left: 3px solid #3b82f6;
  background: rgba(0, 122, 255, 0.06);
  border-radius: 0 10px 10px 0;
  color: var(--muted, #424752);
}
.chat-md-body strong { font-weight: 700; }
.chat-md-body a { color: #2563eb; text-decoration: underline; text-underline-offset: 2px; }
.chat-md-muted { color: var(--subtle, #6e6e73); font-size: 13px; }
.chat-md-live { transition: opacity 0.1s ease; }

/* markdown 表格 */
.chat-md-table {
  overflow-x: auto;
  margin: 10px 0;
  border-radius: 12px;
  border: 1px solid var(--line, rgba(0, 0, 0, 0.08));
}
.chat-md-table table { border-collapse: collapse; width: 100%; font-size: 13px; }
.chat-md-table th, .chat-md-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line, rgba(0, 0, 0, 0.07));
  text-align: left;
  white-space: nowrap;
}
.chat-md-table th {
  background: rgba(0, 0, 0, 0.035);
  font-weight: 700;
  color: var(--muted, #424752);
}
.chat-md-table tr:last-child td { border-bottom: none; }

/* 引用 chip（正文 [E1]） */
.chat-cite {
  display: inline-flex;
  align-items: center;
  padding: 0 5px;
  margin: 0 1px;
  border-radius: 6px;
  background: rgba(0, 122, 255, 0.10);
  border: 1px solid rgba(0, 122, 255, 0.22);
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  font-style: normal;
  cursor: pointer;
  vertical-align: baseline;
  transition: background 0.14s ease, box-shadow 0.14s ease;
  position: relative;
}
.chat-cite:hover {
  background: rgba(0, 122, 255, 0.18);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.14);
}

/* 引用 hover 浮卡（由 chat.js 动态挂到 body，fixed 定位 + 视口坐标） */
#chatCiteTip {
  display: none;
  position: fixed;
  z-index: 300;
  width: 320px;
  padding: 12px 14px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(0, 0, 0, 0.10);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.18);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted, #424752);
  pointer-events: none;
  backdrop-filter: blur(14px);
}
#chatCiteTip b { display: block; font-size: 12.5px; color: var(--text, #1d1d1f); margin: 4px 0 2px; }
#chatCiteTip p { margin: 4px 0 0; font-size: 12px; color: var(--subtle, #6e6e73); }
.chat-cite-tip-grade { display: inline-block; }

/* 证据链 */
.chat-evidence-drawer {
  border: 1px solid var(--line, rgba(0, 0, 0, 0.08));
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.025);
  overflow: hidden;
}
.chat-evidence-drawer summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #1d1d1f);
  list-style: none;
  user-select: none;
}
.chat-evidence-drawer summary::-webkit-details-marker { display: none; }
.chat-evidence-drawer summary .material-symbols-outlined {
  font-size: 16px;
  color: #2563eb;
}
.chat-evidence-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 10px 10px;
}
.chat-evidence-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line-soft, rgba(255, 255, 255, 0.6));
  transition: background 0.14s ease, box-shadow 0.14s ease;
  scroll-margin-top: 80px;
}
.chat-evidence-item:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}
.chat-evidence-item.chat-evidence-flash {
  background: rgba(0, 122, 255, 0.10);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.35);
}
.chat-evidence-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.chat-evidence-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text, #1d1d1f);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.chat-evidence-text {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted, #424752);
}
.chat-evidence-pmid {
  display: inline-block;
  margin-top: 5px;
  font-size: 11px;
  color: #2563eb;
  text-decoration: none;
}
.chat-evidence-pmid:hover { text-decoration: underline; }

/* 证据等级徽标 */
.chat-grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}
.chat-grade-A { background: rgba(52, 199, 89, 0.16); color: #15803d; border: 1px solid rgba(52, 199, 89, 0.35); }
.chat-grade-B { background: rgba(0, 122, 255, 0.14); color: #1d4ed8; border: 1px solid rgba(0, 122, 255, 0.32); }
.chat-grade-C { background: rgba(255, 149, 0, 0.16); color: #b45309; border: 1px solid rgba(255, 149, 0, 0.35); }
.chat-grade-D { background: rgba(255, 59, 48, 0.13); color: #b91c1c; border: 1px solid rgba(255, 59, 48, 0.30); }
.chat-grade-X { background: rgba(0, 0, 0, 0.06); color: var(--subtle, #6e6e73); border: 1px solid var(--line, rgba(0, 0, 0, 0.10)); }

/* 行动区 */
.chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chat-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--line, rgba(0, 0, 0, 0.10));
  background: rgba(255, 255, 255, 0.9);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text, #1d1d1f);
  text-decoration: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}
.chat-action-btn:hover {
  border-color: rgba(0, 122, 255, 0.40);
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.12);
  transform: translateY(-1px);
  color: #1d4ed8;
  text-decoration: none;
}
.chat-action-btn .material-symbols-outlined {
  font-size: 15px;
  color: #2563eb;
}

/* 追问 */
.chat-followups {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px dashed var(--line, rgba(0, 0, 0, 0.10));
}
.chat-followups-label {
  font-size: 11.5px;
  color: var(--subtle, #6e6e73);
  font-weight: 600;
}
.chat-followup-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 122, 255, 0.25);
  background: rgba(0, 122, 255, 0.06);
  color: #1d4ed8;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.14s ease, transform 0.14s ease;
}
.chat-followup-chip:hover {
  background: rgba(0, 122, 255, 0.14);
  transform: translateY(-1px);
}

/* 反馈 */
.chat-feedback {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 4px;
}
.chat-feedback-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--subtle, #6e6e73);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.chat-feedback-btn:hover {
  background: rgba(0, 122, 255, 0.10);
  color: #2563eb;
}
.chat-feedback-btn.sent {
  background: rgba(0, 122, 255, 0.14);
  color: #1d4ed8;
  pointer-events: none;
}
.chat-feedback-btn .material-symbols-outlined { font-size: 17px; }
.chat-feedback-tip {
  font-size: 11px;
  color: #b45309;
}

/* 流式光标 */
.chat-stream-caret {
  display: flex;
  gap: 4px;
  padding: 2px 0 6px;
}
.chat-stream-caret span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3b82f6;
  animation: chat-caret-bounce 1s ease-in-out infinite;
}
.chat-stream-caret span:nth-child(2) { animation-delay: 0.16s; }
.chat-stream-caret span:nth-child(3) { animation-delay: 0.32s; }
@keyframes chat-caret-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ---------- 输入区 ---------- */
.chat-composer-wrap {
  padding: 8px 16px 16px;
  background: transparent;
  border-top: none;
}
.chat-composer-wrap-inner {
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  padding: 10px 14px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.50);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.03);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
}
.chat-focus-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  margin-bottom: 8px;
  padding: 5px 8px 5px 12px;
  border-radius: 999px;
  background: rgba(0, 122, 255, 0.10);
  border: 1px solid rgba(0, 122, 255, 0.22);
  font-size: 12px;
  color: #1d4ed8;
}
.chat-focus-tag .material-symbols-outlined { font-size: 14px; }
.chat-focus-tag button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.chat-focus-tag button:hover { background: rgba(0, 122, 255, 0.16); }
.chat-focus-tag button .material-symbols-outlined { font-size: 13px; }

.chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.chat-composer textarea {
  flex: 1 1 auto;
  min-height: 44px;
  max-height: 160px;
  padding: 11px 14px;
  border: 1px solid var(--line, rgba(0, 0, 0, 0.12));
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.95);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text, #1d1d1f);
  resize: none;
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
  font-family: inherit;
}
.chat-composer textarea:focus {
  border-color: rgba(0, 122, 255, 0.50);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}
.chat-composer textarea::placeholder { color: var(--subtle, #6e6e73); }
.chat-send-btn,
.chat-stop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: none;
  border-radius: 13px;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}
.chat-send-btn {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.35);
}
.chat-send-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}
.chat-stop-btn {
  background: rgba(255, 59, 48, 0.12);
  color: #dc2626;
  border: 1px solid rgba(255, 59, 48, 0.28);
}
.chat-stop-btn:hover { background: rgba(255, 59, 48, 0.20); }
.chat-composer-hint {
  margin-top: 8px;
  font-size: 11px;
  color: var(--subtle, #6e6e73);
  text-align: center;
}

/* ---------- 证据面板（右） ---------- */
.chat-evidence-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  min-width: 0;
  width: 300px;
  padding: 14px 14px;
  border-radius: 18px;
  background: var(--surface-high, rgba(255, 255, 255, 0.72));
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--glass-shadow, 0 8px 32px rgba(0, 0, 0, 0.08));
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.32s cubic-bezier(0.34, 1.3, 0.64, 1),
              opacity 0.24s ease,
              padding 0.32s ease,
              border-width 0.32s ease,
              transform 0.32s cubic-bezier(0.34, 1.3, 0.64, 1);
}
.chat-evidence-panel.chat-evidence-collapsed {
  width: 0;
  padding: 0;
  border-width: 0;
  opacity: 0;
  transform: translateX(20px);
  pointer-events: none;
}

/* 右面板恢复 tab */
.chat-evidence-tab {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 45;
  width: 30px;
  padding: 12px 4px;
  border-radius: 10px 0 0 10px;
  background: var(--surface-high, rgba(255, 255, 255, 0.72));
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-right: none;
  box-shadow: -4px 4px 16px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(16px);
  cursor: pointer;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text, #1d1d1f);
  letter-spacing: 0.08em;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
  user-select: none;
  transition: background 0.18s ease, transform 0.18s ease;
}
.chat-evidence-tab:hover {
  background: rgba(255, 255, 255, 0.92);
  transform: translateY(-50%) translateX(-2px);
}
.chat-evidence-tab .material-symbols-outlined {
  font-size: 16px;
  transform: rotate(90deg);
}
.chat-evidence-panel.chat-evidence-collapsed + .chat-evidence-tab {
  display: flex;
}
.chat-evidence-panel::-webkit-scrollbar { width: 4px; }
.chat-evidence-panel::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.14); border-radius: 4px; }
.chat-ep-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line, rgba(0, 0, 0, 0.08));
}
.chat-ep-head b { font-size: 14px; font-weight: 800; color: var(--text, #1d1d1f); }
.chat-ep-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--subtle, #6e6e73);
  cursor: pointer;
}
.chat-ep-toggle:hover { background: rgba(0, 0, 0, 0.06); }
.chat-ep-toggle .material-symbols-outlined { font-size: 18px; }

.chat-ep-focus {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 13px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.10), rgba(6, 182, 212, 0.07));
  border: 1px solid rgba(37, 99, 235, 0.18);
}
.chat-ep-focus-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #1d4ed8;
  text-transform: uppercase;
}
.chat-ep-focus-entity {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text, #1d1d1f);
  word-break: break-word;
}
.chat-ep-focus small {
  font-size: 11px;
  color: var(--subtle, #6e6e73);
}
.chat-ep-empty {
  padding: 18px 8px;
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
  color: var(--subtle, #6e6e73);
  border: 1px dashed var(--line, rgba(0, 0, 0, 0.12));
  border-radius: 12px;
}
.chat-ep-section { display: flex; flex-direction: column; gap: 8px; }
.chat-ep-section-title {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--subtle, #6e6e73);
  text-transform: uppercase;
}
.chat-ep-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-ep-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.80);
  border: 1px solid var(--line-soft, rgba(255, 255, 255, 0.6));
  cursor: default;
  transition: background 0.14s ease, box-shadow 0.14s ease;
  scroll-margin-top: 60px;
}
.chat-ep-item:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
}
.chat-ep-item.chat-evidence-flash {
  background: rgba(0, 122, 255, 0.12);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.35);
}
.chat-ep-item-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.chat-ep-item-body b {
  font-size: 11px;
  color: #1d4ed8;
  font-weight: 800;
}
.chat-ep-item-body span {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted, #424752);
  word-break: break-word;
}
.chat-ep-links { display: flex; flex-direction: column; gap: 6px; }
.chat-ep-links .chat-action-btn { justify-content: flex-start; }

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
  .chat-workspace {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .chat-evidence-panel {
    position: fixed;
    top: 84px;
    right: 18px;
    bottom: 18px;
    width: 320px;
    z-index: 50;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
    transition: transform 0.32s cubic-bezier(0.34, 1.3, 0.64, 1), opacity 0.24s ease;
  }
  .chat-evidence-panel.chat-evidence-collapsed {
    transform: translateX(calc(100% + 30px));
    opacity: 0;
    pointer-events: none;
    width: 320px;
    padding: 14px 14px;
    border-width: 1px;
  }
  .chat-evidence-tab { z-index: 49; }
}

@media (max-width: 768px) {
  .app-main:has(.chat-workspace) {
    padding: 72px 10px 10px;
  }
  .chat-workspace {
    grid-template-columns: 1fr;
  }
  .chat-sidebar {
    position: fixed;
    top: 72px;
    left: 10px;
    bottom: 10px;
    width: 250px;
    z-index: 50;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
    transition: transform 0.32s cubic-bezier(0.34, 1.3, 0.64, 1), opacity 0.24s ease;
  }
  .chat-sidebar.chat-sidebar-collapsed {
    transform: translateX(calc(-100% - 30px));
    opacity: 0;
    pointer-events: none;
    width: 250px;
    padding: 14px 12px;
    border-width: 1px;
  }
  .chat-sidebar-tab { z-index: 49; }
  .chat-guide-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .chat-user-bubble { max-width: 88%; }
}

@media (max-width: 520px) {
  .chat-guide-grid { grid-template-columns: 1fr; }
  .chat-stream { padding: 16px 14px 10px; }
  .chat-answer-card { padding: 14px 14px 12px; }
}

/* ============================================================
   知识库管理页（/kb-admin）
   ============================================================ */
.kb-page {
  display: grid;
  gap: 12px;
  padding-bottom: 28px;
}

/* ---- 头部（页面标题已移除，样式保留占位） ---- */

/* ---- 统计卡片 ---- */
.kb-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.kb-stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line-soft, rgba(255, 255, 255, 0.6));
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
  border-top: 3px solid #2563eb;
}
.kb-stat-card > .material-symbols-outlined {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 22px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}
.kb-stat-card.purple { border-top-color: #7c3aed; }
.kb-stat-card.purple > .material-symbols-outlined { background: rgba(124, 58, 237, 0.1); color: #7c3aed; }
.kb-stat-card.teal { border-top-color: #0d9488; }
.kb-stat-card.teal > .material-symbols-outlined { background: rgba(13, 148, 136, 0.1); color: #0d9488; }
.kb-stat-card.amber { border-top-color: #d97706; }
.kb-stat-card.amber > .material-symbols-outlined { background: rgba(217, 119, 6, 0.1); color: #d97706; }
.kb-stat-card b {
  display: block;
  font-size: 24px;
  line-height: 1.1;
  color: #0f172a;
}
.kb-stat-card small {
  color: var(--subtle, #64748b);
  font-size: 12px;
}

/* ---- 检索测试 ---- */
.kb-test-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.kb-test-input-wrap {
  position: relative;
  flex: 1 1 320px;
  display: flex;
  align-items: center;
}
.kb-test-input-wrap > .material-symbols-outlined {
  position: absolute;
  left: 12px;
  color: var(--subtle, #64748b);
  font-size: 20px;
  pointer-events: none;
}
.kb-test-input-wrap input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 40px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  outline: none;
}
.kb-test-input-wrap input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.kb-test-result {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(241, 245, 249, 0.7);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

/* ---- 检索测试紧凑行（整合到知识条目标题下方） ---- */
.kb-test-bar-compact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 12px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.kb-test-bar-compact .kb-test-input-wrap {
  flex: 1 1 auto;
  min-width: 200px;
}
.kb-test-bar-compact .kb-test-input-wrap input {
  height: 38px;
  font-size: 13.5px;
  border-radius: 10px;
}
.kb-test-bar-compact .button.small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.kb-test-result-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.kb-test-result-head span { color: var(--subtle, #64748b); font-size: 12px; }
.kb-test-hits { display: grid; gap: 6px; }
.kb-test-hit {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.85);
  font-size: 13px;
}
.kb-test-hit small { color: var(--subtle, #64748b); }
.kb-test-empty {
  padding: 8px 4px;
  color: var(--subtle, #64748b);
  font-size: 13px;
}

/* ---- 列表 ---- */
.kb-list-head { align-items: flex-start; }
.kb-count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 11px;
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  font-size: 12px;
  vertical-align: 2px;
}
.kb-list-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kb-filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
/* ---- 合并 toolbar：测试 + 筛选 单行 ---- */
.kb-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: nowrap;
}
.kb-toolbar .kb-test-input-wrap {
  position: relative;
  flex: 0 0 176px;
  width: 176px;
  display: flex;
  align-items: center;
}
.kb-toolbar .kb-test-input-wrap input {
  width: 100%;
  height: 34px;
  padding: 0 10px 0 34px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  outline: none;
}
.kb-toolbar .kb-test-input-wrap > .material-symbols-outlined {
  position: absolute;
  left: 9px;
  color: var(--subtle, #64748b);
  font-size: 18px;
  pointer-events: none;
}
.kb-toolbar .kb-test-input-wrap input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.kb-toolbar .kb-search-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
}
.kb-toolbar .kb-search-wrap input {
  width: 100%;
  height: 34px;
  padding: 0 10px 0 34px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  outline: none;
}
.kb-toolbar .kb-search-wrap > .material-symbols-outlined {
  position: absolute;
  left: 9px;
  color: var(--subtle, #64748b);
  font-size: 18px;
  pointer-events: none;
}
.kb-toolbar .kb-search-wrap input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.kb-test-btn {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  border-radius: 8px;
}
.kb-test-btn:hover {
  background: rgba(37, 99, 235, 0.15);
  color: #2563eb;
}
.kb-rebuild-btn {
  color: #64748b;
  background: rgba(100, 116, 139, 0.06);
  border-radius: 8px;
}
.kb-rebuild-btn:hover {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}
.kb-search-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
}
.kb-search-wrap > .material-symbols-outlined {
  position: absolute;
  left: 11px;
  color: var(--subtle, #64748b);
  font-size: 19px;
  pointer-events: none;
}
.kb-search-wrap input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  outline: none;
}
.kb-filter-select {
  height: 38px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  color: #334155;
  outline: none;
  cursor: pointer;
  flex: 0 0 auto;
}
.kb-filter-select.kb-filter-category { width: 138px; flex-basis: 138px; }
.kb-filter-select.kb-filter-status { width: 96px; flex-basis: 96px; }
.kb-table-wrap { overflow-x: auto; }
.kb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.kb-table th {
  text-align: left;
  padding: 9px 10px;
  color: var(--subtle, #64748b);
  font-size: 12px;
  font-weight: 700;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  white-space: nowrap;
}
.kb-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  vertical-align: middle;
}
.kb-table tbody tr { transition: background 0.15s; }
.kb-table tbody tr:hover { background: rgba(241, 245, 249, 0.6); }
.kb-table tbody tr.selected { background: rgba(37, 99, 235, 0.06); }
.kb-col-check { width: 34px; }
.kb-col-ops { width: 90px; text-align: right; white-space: nowrap; }
.kb-title-cell { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kb-title-cell b { color: #0f172a; }
.kb-id {
  display: block;
  margin-top: 2px;
  color: #94a3b8;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.kb-pill-builtin { background: rgba(124, 58, 237, 0.12); color: #6d28d9; }
.kb-pill-overridden { background: rgba(217, 119, 6, 0.12); color: #b45309; }
.kb-kw-cell { max-width: 260px; }
.kb-kw {
  display: inline-block;
  margin: 1px 3px 1px 0;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  font-size: 11px;
  white-space: nowrap;
}
.kb-kw-more { color: #94a3b8; font-size: 11px; }
.kb-concl-cell { max-width: 320px; color: #475569; }
.kb-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}
.kb-icon-btn:hover { background: rgba(37, 99, 235, 0.1); color: #2563eb; }
.kb-icon-btn.danger:hover { background: rgba(220, 38, 38, 0.1); color: #dc2626; }
.kb-icon-btn .material-symbols-outlined { font-size: 18px; }
.kb-batch-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.07);
  border: 1px solid rgba(37, 99, 235, 0.15);
  font-size: 13px;
}
.kb-batch-bar b { color: #2563eb; }
.kb-loading, .kb-empty { padding: 34px 12px; text-align: center; color: var(--subtle, #64748b); }
.kb-empty .material-symbols-outlined { font-size: 40px; color: #cbd5e1; }
.kb-empty p { margin: 8px 0 14px; }
.kb-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--glass-bg, rgba(255, 255, 255, 0.55));
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.45));
  box-shadow: var(--glass-shadow, 0 8px 32px rgba(0, 0, 0, 0.08));
  font-size: 13px;
  color: var(--subtle, #64748b);
  white-space: nowrap;
  flex-wrap: nowrap;
}
.kb-pagination b { color: #2563eb; font-weight: 600; }
.kb-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(100, 116, 139, 0.25);
  background: transparent;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}
.kb-page-btn:hover:not(:disabled) { background: rgba(37, 99, 235, 0.08); border-color: #2563eb; color: #2563eb; }
.kb-page-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.kb-page-btn .material-symbols-outlined { font-size: 17px; }
.kb-page-size {
  height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid rgba(100, 116, 139, 0.25);
  background: transparent;
  color: #475569;
  font-size: 13px;
  cursor: pointer;
  outline: none;
}
.kb-page-size:focus { border-color: #2563eb; }

/* ---- 开关 ---- */
.kb-switch-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.kb-switch-row input { display: none; }
.kb-switch {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.2s;
  flex: none;
}
.kb-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}
.kb-switch-row input:checked + .kb-switch { background: #2563eb; }
.kb-switch-row input:checked + .kb-switch::after { transform: translateX(14px); }
.kb-switch-label { font-size: 13px; color: #475569; }
.kb-switch-mini .kb-switch { transform: scale(0.85); transform-origin: left center; }
.kb-state-label { font-size: 12px; color: var(--subtle, #64748b); }

/* ---- 编辑器弹窗 ---- */
.kb-editor-backdrop { z-index: 2100; }
.kb-modal {
  width: min(680px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 34px 90px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}
.kb-editor-modal { width: min(720px, calc(100vw - 28px)); }
.kb-editor-body {
  padding: 18px 24px;
  overflow-y: auto;
  display: grid;
  gap: 4px;
}
.kb-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.kb-field { display: grid; gap: 5px; }
.kb-field-wide { grid-column: 1 / -1; }
.kb-field > span {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}
.kb-field > span em {
  font-style: normal;
  font-weight: 400;
  color: #94a3b8;
  margin-left: 6px;
}
.kb-field input,
.kb-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 11px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(248, 250, 252, 0.9);
  font-size: 13px;
  color: #0f172a;
  outline: none;
  font-family: inherit;
  resize: vertical;
}
.kb-field input:focus,
.kb-field textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: #fff;
}
.kb-editor-body .kb-switch-row { margin-top: 12px; }

/* ---- 导入弹窗 ---- */
.kb-import-body {
  padding: 18px 24px;
  display: grid;
  gap: 12px;
  overflow-y: auto;
}
.kb-import-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.kb-file-pick {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px dashed rgba(37, 99, 235, 0.45);
  background: rgba(37, 99, 235, 0.05);
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.kb-file-pick input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.kb-import-format {
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  font-size: 13px;
}
.kb-import-text {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(248, 250, 252, 0.9);
  font-size: 12.5px;
  line-height: 1.6;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  resize: vertical;
  outline: none;
}
.kb-import-text:focus { border-color: #2563eb; }
.kb-import-help summary {
  cursor: pointer;
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
}
.kb-import-help-body {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(241, 245, 249, 0.8);
  font-size: 12.5px;
  color: #475569;
  display: grid;
  gap: 8px;
}
.kb-import-help-body pre {
  margin: 4px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.05);
  font-size: 12px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
}

/* ---- Toast ---- */
.kb-toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  z-index: 3000;
  padding: 11px 20px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 13.5px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.34, 1.3, 0.64, 1);
  max-width: min(480px, calc(100vw - 40px));
}
.kb-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.kb-toast-warn { background: rgba(180, 83, 9, 0.95); }
.kb-toast-error { background: rgba(220, 38, 38, 0.95); }

/* ---- 响应式 ---- */
@media (max-width: 860px) {
  .kb-form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .kb-test-result-head { flex-direction: column; }
  .kb-list-actions .button { font-size: 12px; padding: 7px 10px; }
}
