/* ============================================================================
   专利星图 PatentAtlas · UI 2.0（深空玻璃拟态 · 精修版）
   结构：设计变量 → 基础层 → 顶栏 → 工作区 → 面板 → 控件 → 中央视图
        → 表格/聚类/分布/热力/总览 → 右栏档案 → 检索/近邻
        → 状态栏 → 抽屉/灯箱/Toast → 响应式/无障碍
   ========================================================================== */

/* ---------------------------------------------------------------- 设计变量 */
:root {
  color-scheme: dark;

  /* 底色三层：深海 → 墨蓝 → 夜黑 */
  --bg-0: #05080f;
  --bg-1: #080d18;
  --bg-2: #0b1220;

  /* 面板与描边 */
  --glass: linear-gradient(180deg, rgba(18, 27, 46, 0.92), rgba(11, 18, 31, 0.9));
  --glass-soft: linear-gradient(180deg, rgba(22, 32, 52, 0.55), rgba(12, 19, 33, 0.6));
  --surface: #0f1728;
  --surface-2: rgba(16, 25, 42, 0.72);
  --line: rgba(126, 163, 208, 0.13);
  --line-2: rgba(126, 163, 208, 0.24);
  --line-3: rgba(126, 163, 208, 0.42);

  /* 文字 */
  --ink-1: #e9eff8;
  --ink-2: #a8b7cc;
  --ink-3: #74869f;
  --ink-4: #55647c;

  /* 强调色 */
  --accent: #5eead4;
  --accent-2: #7dd3fc;
  --accent-3: #38bdf8;
  --accent-soft: rgba(94, 234, 212, 0.1);
  --accent-line: rgba(94, 234, 212, 0.32);
  --gold: #f2c879;
  --gold-2: #e6a95a;
  --gold-soft: rgba(242, 200, 121, 0.1);
  --gold-line: rgba(242, 200, 121, 0.32);
  --danger: #fb7185;
  --ok: #4ade80;

  /* 圆角阶梯 */
  --r-xs: 6px;
  --r-sm: 9px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* 阴影阶梯 */
  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.24);
  --sh-2: 0 8px 24px rgba(0, 0, 0, 0.34);
  --sh-3: 0 18px 48px rgba(0, 0, 0, 0.46);
  --sh-panel: 0 18px 46px rgba(2, 6, 15, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  --ring: 0 0 0 3px rgba(94, 234, 212, 0.14);

  /* 动效 */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.18s;

  /* 字体 */
  --font: "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei",
    "PingFang SC", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Mono", "Consolas", "SFMono-Regular", ui-monospace, monospace;
}

/* ---------------------------------------------------------------- 基础层 */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-1);
  background:
    radial-gradient(1200px 620px at 10% -12%, rgba(56, 130, 190, 0.2), transparent 62%),
    radial-gradient(1000px 520px at 92% 2%, rgba(94, 234, 212, 0.09), transparent 60%),
    radial-gradient(1100px 700px at 50% 116%, rgba(72, 112, 190, 0.16), transparent 64%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 极淡网格，给“工程感”但完全不抢内容 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(126, 163, 208, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 163, 208, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(80% 70% at 50% 30%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(80% 70% at 50% 30%, #000 40%, transparent 100%);
}

.hidden { display: none !important; }

::selection { background: rgba(94, 234, 212, 0.26); color: #fff; }

button,
input,
select,
textarea { font: inherit; color: inherit; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(94, 234, 212, 0.62);
  outline-offset: 2px;
}

/* 滚动条：细、暗、悬停微亮 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(126, 163, 208, 0.24), rgba(126, 163, 208, 0.14));
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(126, 163, 208, 0.4); background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* ---------------------------------------------------------------- 顶栏 */
.topbar {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
  padding: 0 20px;
  background: linear-gradient(180deg, rgba(10, 16, 28, 0.94), rgba(9, 14, 25, 0.78));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.32), 0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

/* 顶栏底部一线极光 */
.topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(94, 234, 212, 0.5) 20%, rgba(125, 211, 252, 0.45) 62%, transparent);
  opacity: 0.55;
}

.brand { display: flex; align-items: center; gap: 13px; min-width: 262px; }

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 18px;
  font-weight: 700;
  color: #04141b;
  background: linear-gradient(140deg, #7defdd, #59c8f5 55%, #f2c879 130%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.16) inset,
    0 6px 18px rgba(70, 200, 220, 0.28);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 14px;
  background: radial-gradient(60% 60% at 50% 50%, rgba(94, 234, 212, 0.28), transparent 70%);
  z-index: -1;
  filter: blur(4px);
}

.brand-copy { min-width: 0; }

.brand-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.brand-title span {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.9;
}

.brand-sub {
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 指标：分隔线 + 等宽数字 */
.top-stats {
  display: flex;
  align-items: stretch;
  flex: 1;
  justify-content: center;
  gap: 0;
}

.stat {
  position: relative;
  padding: 3px 22px;
  text-align: center;
  min-width: 92px;
}

.stat:not(:first-child)::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 1px; height: 22px;
  background: linear-gradient(180deg, transparent, var(--line-2), transparent);
}

.stat small {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 1px;
}

.stat strong {
  font-size: 17.5px;
  font-weight: 650;
  color: var(--ink-1);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.top-actions { display: flex; align-items: center; gap: 12px; }

.header-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(12, 20, 35, 0.55);
  font-size: 11.5px;
  color: var(--ink-2);
  white-space: nowrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.14);
}

.dot.on {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.16), 0 0 10px rgba(94, 234, 212, 0.6);
  animation: breathe 2.8s ease-in-out infinite;
}

@keyframes breathe { 50% { opacity: 0.5; } }

/* ---------------------------------------------------------------- 工作区 */
.workspace {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--left-w, 306px) 8px minmax(0, 1fr) 8px var(--right-w, 392px);
  gap: 0;
  padding: 12px 14px;
  transition: grid-template-columns 0.34s var(--ease);
}

.workspace.dragging { transition: none; user-select: none; }

.left-panel { grid-column: 1; }
#splitLeft { grid-column: 2; }
.center-panel { grid-column: 3; }
#splitRight { grid-column: 4; }
.right-panel { grid-column: 5; }

.workspace.left-collapsed { grid-template-columns: 30px 0 minmax(0, 1fr) 8px var(--right-w, 392px); }
.workspace.right-collapsed { grid-template-columns: var(--left-w, 306px) 8px minmax(0, 1fr) 0 52px; }
.workspace.left-collapsed.right-collapsed { grid-template-columns: 30px 0 minmax(0, 1fr) 0 52px; }
.workspace.left-collapsed #splitLeft,
.workspace.right-collapsed #splitRight { display: none; }

/* 分隔条：默认一条细线，悬停显形 */
.col-splitter {
  position: relative;
  cursor: col-resize;
  border-radius: 4px;
  touch-action: none;
}

.col-splitter::after {
  content: "";
  position: absolute;
  top: 12%; bottom: 12%;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: linear-gradient(180deg, transparent, var(--line-2) 18%, var(--line-2) 82%, transparent);
  opacity: 0;
  transition: opacity var(--dur) var(--ease), background var(--dur) var(--ease);
}

.col-splitter:hover::after,
.workspace.dragging .col-splitter::after {
  opacity: 1;
  background: linear-gradient(180deg, transparent, rgba(94, 234, 212, 0.55) 20%, rgba(94, 234, 212, 0.55) 80%, transparent);
}

.col-splitter::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 6px; height: 34px;
  transform: translate(-50%, -50%);
  border-radius: 4px;
  background: repeating-linear-gradient(180deg, rgba(126, 163, 208, 0.45) 0 2px, transparent 2px 6px);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.col-splitter:hover::before { opacity: 0.8; }

/* ---------------------------------------------------------------- 面板 */
.panel {
  position: relative;
  min-height: 0;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-panel);
  backdrop-filter: blur(16px) saturate(1.15);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

.panel::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
  pointer-events: none;
}

.panel-toggle {
  position: sticky;
  top: 10px;
  z-index: 8;
  float: right;
  margin: 10px 10px 0 0;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: rgba(14, 22, 38, 0.92);
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--dur), border-color var(--dur), background var(--dur);
}

.panel-toggle:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  background: rgba(94, 234, 212, 0.1);
}

.workspace.left-collapsed .left-panel > *:not(.panel-toggle):not(.panel-rail-label),
.workspace.right-collapsed .right-panel > *:not(.panel-toggle):not(.panel-rail-label) { display: none; }

.workspace.left-collapsed .left-panel,
.workspace.right-collapsed .right-panel { overflow: hidden; }

.workspace.left-collapsed .panel-toggle.left,
.workspace.right-collapsed .panel-toggle.right {
  float: none;
  display: grid;
  margin: 12px auto;
}

/* 折叠后的竖向“书脊”标签：不让窄条变成一块空白 */
.panel-rail-label { display: none; }

.workspace.right-collapsed .right-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.workspace.right-collapsed .right-panel .panel-rail-label,
.sim-panel.sim-mini .sim-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 6px 0;
  padding: 10px 4px 14px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: rgba(14, 22, 38, 0.6);
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10.5px;
  cursor: pointer;
  transition: color var(--dur), border-color var(--dur), background var(--dur);
}

.rail-idx {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.rail-name {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.16em;
  white-space: nowrap;
}

.workspace.right-collapsed .right-panel .panel-rail-label:hover,
.sim-panel.sim-mini .sim-rail:hover { color: var(--accent); border-color: var(--accent-line); }

/* 收起后只留书脊，不再同时挂一个看不清的小箭头 */
.workspace.right-collapsed .right-panel .panel-toggle { display: none; }
.workspace.sim-docked.sim-mini #splitSim { display: none; }

.sim-empty {
  margin-top: 16px;
  padding: 16px 14px;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
  color: var(--ink-4);
  font-size: 11.5px;
  line-height: 1.8;
}

.sim-empty strong { display: block; margin-bottom: 6px; color: var(--ink-2); font-size: 12.5px; letter-spacing: 0.02em; }

/* 区块：顶部留白给折叠按钮让位，底部细渐变分割线 */
.panel-section {
  position: relative;
  padding: 16px 18px 18px;
}

.panel-section:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2) 22%, var(--line-2) 78%, transparent);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.14em;
  color: var(--ink-1);
}

/* 左栏区块折叠：03 关注与分组等区块可收起，让长栏在一屏内可读 */
.panel-section.collapsed > :not(.section-title) { display: none; }
.panel-section.collapsed .section-title { margin-bottom: 0; }
.panel-section.collapsed { padding-bottom: 2px; }
.section-toggle.left-fold {
  margin-left: auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.section-toggle.left-fold:hover { color: var(--accent); border-color: var(--line-3); }

.section-index {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 4px;
  border-radius: var(--r-xs);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: rgba(94, 234, 212, 0.1);
  border: 1px solid var(--accent-line);
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-2), transparent);
  opacity: 0.7;
}

/* ---------------------------------------------------------------- 表单控件 */
.field-label {
  display: block;
  margin: 12px 0 5px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  text-transform: none;
}

.text-input,
.select-input,
.query-input {
  width: 100%;
  padding: 0 10px;
  height: 34px;
  background: rgba(6, 11, 21, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink-1);
  font-size: 12.5px;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur);
}

.text-input::placeholder,
.query-input::placeholder { color: var(--ink-4); }

.text-input:hover,
.select-input:hover,
.query-input:hover { border-color: var(--line-2); }

.text-input:focus,
.select-input:focus,
.query-input:focus {
  border-color: var(--accent-line);
  background: rgba(7, 13, 24, 0.9);
  box-shadow: var(--ring);
}

.query-input {
  height: auto;
  min-height: 74px;
  padding: 10px 11px;
  line-height: 1.65;
  resize: vertical;
  font-size: 12.5px;
}

.select-input {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position:
    calc(100% - 15px) calc(50% - 2px),
    calc(100% - 10px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.select-input option { background: var(--surface); color: var(--ink-1); }

.select-input:disabled {
  color: var(--ink-3);
  opacity: 0.72;
  cursor: not-allowed;
  background-image: none;
}

.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }

.search-hint {
  font-size: 10px;
  color: var(--ink-4);
  padding-bottom: 10px;
  text-align: right;
  letter-spacing: 0.02em;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 2px;
  font-size: 11.5px;
  color: var(--ink-2);
  cursor: pointer;
  line-height: 1.5;
}

.check-row input { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }
.check-row:hover { color: var(--ink-1); }

.helper-text {
  margin-top: 9px;
  font-size: 10.5px;
  line-height: 1.65;
  color: var(--ink-3);
}

/* ---------------------------------------------------------------- 检索方式 */
.mode-row {
  display: flex;
  gap: 6px;
  margin: 12px 0 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(6, 11, 21, 0.55);
}

.mode-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: 11.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background var(--dur), color var(--dur), border-color var(--dur);
}

.mode-option input { display: none; }

.mode-option:has(input:checked) {
  color: var(--ink-1);
  font-weight: 600;
  border-color: var(--accent-line);
  background: linear-gradient(180deg, rgba(94, 234, 212, 0.16), rgba(94, 234, 212, 0.06));
  box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.08) inset;
}

.mode-option:has(input:checked)::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(94, 234, 212, 0.8);
}

.mode-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: var(--r-pill);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.06em;
  border: 1px solid transparent;
  margin-right: 6px;
}

.mode-local { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.mode-remote { background: rgba(125, 211, 252, 0.1); color: var(--accent-2); border-color: rgba(125, 211, 252, 0.3); }
.mode-fuzzy { background: var(--gold-soft); color: var(--gold); border-color: var(--gold-line); }

/* ---------------------------------------------------------------- 远程额度 */
.quota-box {
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.quota-title {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin-bottom: 9px;
}

.quota-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.quota-item { display: flex; flex-direction: column; gap: 2px; }
.quota-item small { font-size: 9.5px; color: var(--ink-4); letter-spacing: 0.04em; }
.quota-item strong { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 按钮体系 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  height: 34px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: linear-gradient(180deg, rgba(28, 40, 64, 0.85), rgba(17, 26, 44, 0.85));
  color: var(--ink-1);
  font-size: 12.5px;
  font-family: var(--font);
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur), border-color var(--dur), background var(--dur);
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--line-3);
  box-shadow: var(--sh-1);
}

.btn:active:not(:disabled) { transform: translateY(0) scale(0.985); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; }
.btn.full { width: 100%; margin-top: 10px; }

.btn-primary {
  border: none;
  color: #04222b;
  font-weight: 650;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #79f0de 0%, #67d8f7 52%, #8fd8ff 100%);
  box-shadow: 0 6px 18px rgba(72, 210, 220, 0.22);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 10px 26px rgba(72, 210, 220, 0.32);
}

.btn-accent {
  border: none;
  color: #2a1d05;
  font-weight: 650;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #f7d693, #eda858 78%, #e69b45);
  box-shadow: 0 6px 18px rgba(242, 200, 121, 0.2);
}

.btn-accent:hover:not(:disabled) {
  box-shadow: 0 10px 26px rgba(242, 200, 121, 0.32);
}

.btn-secondary {
  color: var(--accent);
  border-color: var(--accent-line);
  background: rgba(94, 234, 212, 0.08);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(94, 234, 212, 0.14);
  border-color: rgba(94, 234, 212, 0.48);
}

.btn-ghost {
  color: var(--ink-2);
  background: transparent;
  border-color: var(--line);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--ink-1);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line-2);
}

.mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 10px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(14, 22, 38, 0.7);
  color: var(--ink-2);
  font-size: 11.5px;
  font-family: var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--dur), border-color var(--dur), background var(--dur), box-shadow var(--dur);
}

.mini-btn:hover:not(:disabled) {
  color: var(--ink-1);
  border-color: var(--line-3);
  background: rgba(255, 255, 255, 0.05);
}

.mini-btn:active:not(:disabled) { transform: scale(0.97); }

.mini-btn.active {
  color: #04222b;
  font-weight: 650;
  border-color: transparent;
  background: linear-gradient(135deg, #79f0de, #6fd7f7);
  box-shadow: 0 3px 12px rgba(72, 210, 220, 0.24);
}

.mini-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------------------------------------------------------------- 中央区 */
.center-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  padding: 0 2px;
}

.center-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--glass);
  box-shadow: var(--sh-2), 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  backdrop-filter: blur(16px) saturate(1.15);
  flex-wrap: wrap;
}

.view-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(6, 11, 21, 0.5);
  flex-wrap: wrap;
}

.view-tab {
  padding: 0 12px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--dur), background var(--dur), border-color var(--dur), box-shadow var(--dur);
}

.view-tab:hover { color: var(--ink-1); background: rgba(255, 255, 255, 0.05); }

.view-tab.active {
  color: var(--accent);
  font-weight: 650;
  border-color: var(--accent-line);
  background: linear-gradient(180deg, rgba(94, 234, 212, 0.18), rgba(94, 234, 212, 0.07));
  box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.06) inset;
}

/* 工具组：胶囊容器，内部控件紧排 */
.map-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(6, 11, 21, 0.5);
}

.map-controls .layout-switch {
  width: auto;
  height: 28px;
  padding: 0 24px 0 9px;
  font-size: 11.5px;
  border-color: transparent;
  background-color: transparent;
  background-position:
    calc(100% - 13px) calc(50% - 2px),
    calc(100% - 8px) calc(50% - 2px);
}

.map-controls .layout-switch:hover { border-color: var(--line); }

.toolbar-divider {
  width: 1px;
  height: 18px;
  margin: 0 2px;
  background: var(--line-2);
}

.layout-hint {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* 视图容器 */
.map-card,
.table-card,
.cluster-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--glass);
  box-shadow: var(--sh-panel);
  backdrop-filter: blur(16px) saturate(1.15);
  overflow: hidden;
  animation: viewIn 0.34s var(--ease-out);
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
}

/* ---------------------------------------------------------------- 星图 */
.cluster-legend {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 11, 21, 0.35);
  scrollbar-width: none;
  -ms-overflow-style: none;
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent 100%);
}

.cluster-legend::-webkit-scrollbar { height: 0; display: none; }

.cluster-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(16, 25, 42, 0.72);
  color: var(--ink-2);
  font-size: 10.5px;
  font-family: var(--font);
  cursor: pointer;
  transition: color var(--dur), border-color var(--dur), background var(--dur), transform var(--dur);
}

.cluster-legend-item:hover {
  color: var(--ink-1);
  border-color: var(--line-3);
  transform: translateY(-1px);
}

.cluster-legend-item[aria-pressed="true"] {
  color: var(--ink-1);
  border-color: var(--accent-line);
  background: linear-gradient(180deg, rgba(94, 234, 212, 0.16), rgba(94, 234, 212, 0.05));
}

.cluster-swatch {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px currentColor;
}

.cluster-legend-name {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cluster-legend-count {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.cluster-legend-empty { color: var(--ink-4); font-size: 10.5px; padding: 2px 6px; }

.canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  background:
    radial-gradient(760px 400px at 68% 18%, rgba(56, 130, 190, 0.12), transparent 66%),
    radial-gradient(620px 340px at 18% 86%, rgba(94, 234, 212, 0.06), transparent 62%),
    rgba(4, 8, 15, 0.6);
}

/* 暗角：用内阴影实现无级过渡，避免径向渐变的硬色标在星图上画出圆环边界 */
.canvas-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(4, 8, 15, 0.35), transparent 12%);
  box-shadow:
    inset 0 0 90px 10px rgba(3, 7, 14, 0.28),
    inset 0 0 200px 60px rgba(3, 7, 14, 0.22);
}

#spaceCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#spaceCanvas:active { cursor: grabbing; }

.canvas-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
  color: var(--ink-2);
  pointer-events: none;
  z-index: 2;
}

.empty-glyph {
  font-size: 32px;
  color: var(--accent);
  opacity: 0.75;
  animation: breathe 3.4s infinite;
  text-shadow: 0 0 22px rgba(94, 234, 212, 0.45);
}

.canvas-empty strong { font-size: 14.5px; font-weight: 600; color: var(--ink-1); }
.canvas-empty p { font-size: 11.5px; max-width: 330px; line-height: 1.7; color: var(--ink-3); }

.canvas-tooltip {
  position: absolute;
  display: none;
  z-index: 6;
  max-width: 300px;
  padding: 9px 12px;
  border: 1px solid var(--line-3);
  border-radius: var(--r-md);
  background: rgba(8, 13, 24, 0.95);
  box-shadow: var(--sh-3);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.canvas-tooltip strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-1);
}

.canvas-tooltip span { font-size: 10.5px; color: var(--ink-3); }

.canvas-footer {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px 10px;
  font-size: 10.5px;
  color: var(--ink-4);
  background: linear-gradient(180deg, transparent, rgba(4, 8, 15, 0.88) 62%);
  pointer-events: none;
}

.canvas-footer span:first-child {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.canvas-footer span:nth-child(2) {
  color: var(--ink-2);
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.canvas-footer span:nth-child(3) { margin-left: auto; opacity: 0.75; }

/* 自转后台浮层（连点 3 次） */
.rot-console {
  position: absolute;
  right: 14px;
  bottom: 44px;
  z-index: 14;
  width: 242px;
  padding: 12px 13px 11px;
  border: 1px solid var(--line-3);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(11, 18, 32, 0.96), rgba(8, 13, 24, 0.96));
  box-shadow: var(--sh-3), 0 0 0 1px rgba(94, 234, 212, 0.06) inset;
  backdrop-filter: blur(16px);
  animation: viewIn 0.24s var(--ease-out);
}

.rot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.rot-head strong {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.2em;
  color: var(--ink-1);
}

.rot-close {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--ink-3);
  font-size: 11px;
  cursor: pointer;
  transition: color var(--dur), border-color var(--dur);
}

.rot-close:hover { color: var(--accent); border-color: var(--accent-line); }

.rot-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  font-size: 11px;
  color: var(--ink-2);
}

.rot-label {
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--ink-4);
}

.rot-speeds { display: flex; gap: 4px; margin-left: auto; }

.rot-speeds button {
  padding: 0 9px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--ink-2);
  font-size: 10.5px;
  font-family: var(--mono);
  cursor: pointer;
  transition: color var(--dur), border-color var(--dur), background var(--dur);
}

.rot-speeds button:hover { color: var(--ink-1); border-color: var(--line-3); }

.rot-speeds button.on {
  color: var(--accent);
  border-color: var(--accent-line);
  background: rgba(94, 234, 212, 0.12);
}

.rot-switches { flex-wrap: wrap; gap: 10px; }
.rot-switches label { display: flex; align-items: center; gap: 5px; font-size: 10.5px; cursor: pointer; }
.rot-switches input { accent-color: var(--accent); }

.rot-hint {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 9.5px;
  line-height: 1.6;
  color: var(--ink-4);
}

/* ---------------------------------------------------------------- 表格视图 */
.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 11, 21, 0.3);
}

.table-head h2 { font-size: 14px; font-weight: 650; letter-spacing: 0.02em; }
.table-head p { margin-top: 3px; font-size: 11px; color: var(--ink-3); }

.table-head > span {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(16, 25, 42, 0.6);
}

.table-scroll { flex: 1; overflow: auto; min-height: 0; }

table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  padding: 10px 11px;
  background: linear-gradient(180deg, #101a2d, #0d1524);
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color var(--dur);
}

thead th:hover { color: var(--accent); }
thead th.sorted-asc::after { content: " ↑"; color: var(--accent); }
thead th.sorted-desc::after { content: " ↓"; color: var(--accent); }

tbody td {
  padding: 9px 11px;
  border-bottom: 1px solid rgba(126, 163, 208, 0.06);
  vertical-align: middle;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
}

tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.014); }
tbody tr { cursor: pointer; transition: background var(--dur); }
tbody tr:hover { background: rgba(94, 234, 212, 0.06); }
tbody tr.selected { background: linear-gradient(90deg, rgba(242, 200, 121, 0.14), rgba(242, 200, 121, 0.04)); }
tbody tr.selected td:first-child { color: var(--gold); font-weight: 600; }

td.title-cell {
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-1);
}

/* 列宽定制：编号/公开号/类型/日期/技术簇/PDF 均不换行，避免窄列被挤成竖排 */

td:nth-child(1) {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.01em;
  color: var(--ink-2);
}

td:nth-child(1),
th:nth-child(1) { width: 106px; }

td:nth-child(2),
th:nth-child(2) { width: 110px; }

td:nth-child(4),
th:nth-child(4) { width: 104px; }

td:nth-child(5),
th:nth-child(5) { width: 76px; }

td:nth-child(6),
th:nth-child(6) { width: 88px; }

td:nth-child(7),
th:nth-child(7) { width: 146px; }

td:nth-child(8),
th:nth-child(8) { width: 82px; }

td:nth-child(1),
td:nth-child(2),
td:nth-child(5),
td:nth-child(6),
td:nth-child(8) { white-space: nowrap; }

td:nth-child(7) {
  max-width: 168px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

td:nth-child(7) span { margin-right: 4px; }

.pub-badge {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: var(--r-xs);
  background: rgba(125, 211, 252, 0.08);
  color: var(--accent-2);
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
}

.type-badge {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  color: var(--ink-3);
  font-size: 10px;
  white-space: nowrap;
}

.type-badge.t-grant { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.type-badge.t-app { color: var(--accent-2); border-color: rgba(125, 211, 252, 0.3); background: rgba(125, 211, 252, 0.08); }
.type-badge.t-um { color: var(--gold); border-color: var(--gold-line); background: var(--gold-soft); }

.pdf-dot { color: var(--accent); font-size: 10.5px; }
.pdf-none { color: var(--ink-4); font-size: 10.5px; }

.table-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: rgba(6, 11, 21, 0.35);
  font-size: 11.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- 聚类 / 分布 / 热力图 */
.cluster-grid {
  flex: 1;
  overflow: auto;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(224px, 1fr));
  grid-auto-rows: max-content;
  gap: 11px;
  align-content: start;
}

.cluster-tile {
  position: relative;
  padding: 14px 15px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: linear-gradient(160deg, rgba(20, 30, 50, 0.78), rgba(12, 19, 33, 0.78));
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
}

.cluster-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.2s;
  background: radial-gradient(80% 60% at 20% 0%, rgba(94, 234, 212, 0.14), transparent 70%);
  pointer-events: none;
}

.cluster-tile:hover {
  transform: translateY(-2px);
  border-color: var(--line-3);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.cluster-tile:hover::after { opacity: 1; }

.cluster-tile strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink-1);
}

.cluster-count {
  margin: 7px 0 2px;
  font-size: 24px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.cluster-tile small { color: var(--ink-3); font-size: 10px; }

.distribution-summary {
  display: flex;
  gap: 11px;
  padding: 16px 16px 0;
  flex-wrap: wrap;
}

.dist-stat {
  flex: 1;
  min-width: 140px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: linear-gradient(160deg, rgba(20, 30, 50, 0.8), rgba(12, 19, 33, 0.72));
}

.dist-stat small { display: block; margin-bottom: 5px; font-size: 9.5px; letter-spacing: 0.12em; color: var(--ink-3); }
.dist-stat strong { font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; }

.distribution-layout {
  flex: 1;
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  padding: 18px 16px;
}

.distribution-layout h3 {
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}

.distribution-bars { display: block; }

.dist-row {
  display: grid;
  grid-template-columns: 118px 1fr 46px;
  gap: 10px;
  align-items: center;
  margin-bottom: 7px;
  font-size: 10.5px;
}

.dist-row span { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dist-row b { text-align: right; font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.dist-track {
  height: 6px;
  border-radius: var(--r-pill);
  background: rgba(126, 163, 208, 0.1);
  overflow: hidden;
}

.dist-track i {
  display: block;
  min-width: 3px;
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, rgba(94, 234, 212, 0.9), rgba(125, 211, 252, 0.85));
  box-shadow: 0 0 10px rgba(94, 234, 212, 0.3);
  transition: width 0.7s var(--ease-out);
}

.heatmap-container { flex: 1; overflow: auto; padding: 18px 16px; }

.heatmap-grid {
  display: grid;
  grid-template-columns: 190px repeat(var(--heat-cols), minmax(50px, 1fr));
  gap: 3px;
  min-width: 700px;
}

.heatmap-head {
  padding: 6px 4px;
  font-size: 10px;
  color: var(--ink-3);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.term-head { writing-mode: vertical-rl; min-height: 88px; }

.heatmap-label {
  display: flex;
  align-items: center;
  padding: 6px 9px;
  font-size: 10.5px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heatmap-label small { margin-left: auto; color: var(--ink-4); font-family: var(--mono); }

.heat-cell {
  display: grid;
  place-items: center;
  height: 30px;
  border-radius: var(--r-xs);
  font-family: var(--mono);
  font-size: 9.5px;
  color: rgba(233, 239, 248, 0.9);
  font-variant-numeric: tabular-nums;
  transition: transform 0.14s var(--ease), box-shadow 0.14s;
}

.heat-cell:hover {
  transform: scale(1.09);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset, 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.muted-empty {
  padding: 22px;
  color: var(--ink-4);
  font-size: 11.5px;
  line-height: 1.8;
  text-align: center;
}

/* ---------------------------------------------------------------- 总览 */
#dashboardView { overflow: auto; }

.dash-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 11px;
  padding: 16px 16px 0;
}

.dash-stat {
  position: relative;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: linear-gradient(160deg, rgba(22, 33, 54, 0.86), rgba(12, 19, 33, 0.8));
  overflow: hidden;
}

.dash-stat::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 84px; height: 84px;
  background: radial-gradient(circle at 100% 0%, rgba(94, 234, 212, 0.16), transparent 68%);
  pointer-events: none;
}

.dash-stat small {
  display: block;
  margin-bottom: 6px;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}

.dash-stat strong { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.dash-stat em { margin-left: 6px; font-style: normal; font-size: 10.5px; color: var(--accent); }

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 14px 16px 18px;
}

.dash-card {
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(14, 22, 38, 0.6);
}

.dash-card h3 {
  margin-bottom: 13px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}

.dash-bars { max-height: 320px; overflow: auto; }

.dash-bar-row {
  display: grid;
  grid-template-columns: 126px 1fr 44px;
  gap: 10px;
  align-items: center;
  margin-bottom: 7px;
  font-size: 10.5px;
}

.dash-bar-row span { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-bar-row b { text-align: right; font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 10.5px; }
.dash-bar-row .dist-track {
  height: 8px;
  background: rgba(126, 163, 208, 0.13);
  box-shadow: inset 0 0 0 1px rgba(126, 163, 208, 0.06);
}
.dash-bar-row .dist-track i { background: linear-gradient(90deg, rgba(94, 234, 212, 0.95), rgba(125, 211, 252, 0.72)); }

.dash-donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.dash-legend { display: flex; flex-direction: column; gap: 8px; font-size: 11px; color: var(--ink-2); }
.dash-legend i { display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 3px; }
.dash-legend b { margin-left: 6px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 右栏档案 */
.detail-section { display: flex; flex-direction: column; }

.detail-empty { padding: 30px 18px 34px; text-align: center; color: var(--ink-3); }

.detail-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-lg);
  background: radial-gradient(70% 70% at 50% 20%, rgba(94, 234, 212, 0.18), rgba(94, 234, 212, 0.04));
  color: var(--accent);
  font-size: 21px;
  font-weight: 650;
  box-shadow: 0 0 26px rgba(94, 234, 212, 0.14);
}

.detail-empty strong { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 600; color: var(--ink-1); }
.detail-empty p { font-size: 11px; line-height: 1.75; }

.detail-content { animation: viewIn 0.3s var(--ease-out); }

.detail-head { padding: 2px 0 12px; border-bottom: 1px solid var(--line); }

.detail-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }

.badge {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  color: var(--ink-3);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.badge.pub { color: var(--accent-2); border-color: rgba(125, 211, 252, 0.3); background: rgba(125, 211, 252, 0.08); }
.badge.edited { color: var(--gold); border-color: var(--gold-line); background: var(--gold-soft); }
.badge.cluster { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

.detail-content h3 {
  margin-bottom: 8px;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  padding: 12px 0;
}

.meta-item { min-width: 0; }
.meta-item small {
  display: block;
  margin-bottom: 2px;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--ink-4);
}

.meta-item span {
  display: block;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-1);
  overflow-wrap: anywhere;
}

.meta-item.wide { grid-column: 1 / -1; }

.ipc-chips { display: flex; flex-wrap: wrap; gap: 5px; padding: 2px 0 10px; }

.ipc-chip {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(126, 163, 208, 0.08);
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 9.5px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px 0 13px;
}

.detail-actions .btn {
  height: 29px;
  margin-top: 0;
  padding: 0 11px;
  font-size: 11px;
}

.detail-tabs {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 11px;
  border-bottom: 1px solid var(--line);
}

.detail-tab {
  position: relative;
  padding: 7px 11px 8px;
  border: none;
  background: none;
  color: var(--ink-3);
  font-size: 11.5px;
  font-family: var(--font);
  cursor: pointer;
  transition: color var(--dur);
}

.detail-tab:hover { color: var(--ink-1); }

.detail-tab.active { color: var(--accent); font-weight: 600; }

.detail-tab.active::after {
  content: "";
  position: absolute;
  left: 9px; right: 9px; bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 10px rgba(94, 234, 212, 0.5);
}

.detail-tabpane { animation: viewIn 0.24s var(--ease-out); }

.detail-text {
  max-height: 340px;
  padding: 11px 13px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(6, 11, 21, 0.62);
  font-size: 11.5px;
  line-height: 1.9;
  color: #c3d0e2;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.coord-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 2px 0 4px;
}

.coord-cell {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(16, 25, 42, 0.66);
}

.coord-cell small { display: block; font-size: 9px; letter-spacing: 0.12em; color: var(--ink-4); }
.coord-cell strong { font-family: var(--mono); font-size: 11.5px; font-weight: 500; color: var(--ink-1); font-variant-numeric: tabular-nums; }

.section-accordion {
  margin-bottom: 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: rgba(14, 22, 38, 0.5);
}

.section-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: rgba(16, 25, 42, 0.66);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
  transition: color var(--dur);
}

.section-accordion summary::after {
  content: "▾";
  color: var(--ink-4);
  transition: transform 0.2s var(--ease), color var(--dur);
}

.section-accordion[open] summary::after { transform: rotate(180deg); color: var(--accent); }
.section-accordion summary:hover { color: var(--ink-1); }
.section-accordion summary::-webkit-details-marker { display: none; }
.section-accordion .detail-text { max-height: 300px; border: none; border-radius: 0; }

.figure-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 11px; }

.figure-item {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(16, 25, 42, 0.55);
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1.55;
}

.figure-item b { margin-right: 6px; color: var(--accent-2); font-weight: 600; }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: rgba(6, 11, 21, 0.6);
  cursor: zoom-in;
  transition: border-color var(--dur), transform var(--dur), box-shadow var(--dur);
}

.gallery-item:hover {
  border-color: var(--accent-line);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.gallery-item img { width: 100%; height: 100%; object-fit: contain; background: #f4f6f9; }

.gallery-item small {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 3px 6px;
  background: linear-gradient(180deg, transparent, rgba(4, 8, 15, 0.9));
  color: #e8eef7;
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-frame { width: 100%; height: 480px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }

.pdf-missing { padding: 24px; text-align: center; color: var(--ink-4); font-size: 11.5px; line-height: 1.8; }

.compare-row { display: flex; gap: 7px; margin-top: 10px; }
.compare-row .text-input { flex: 1; height: 32px; }
.compare-row .btn { height: 32px; margin-top: 0; padding: 0 12px; font-size: 11.5px; white-space: nowrap; }

.compare-result { margin-top: 8px; }

.compare-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(16, 25, 42, 0.62);
  font-size: 11px;
}

.compare-score span { color: var(--ink-3); }
.compare-score strong { color: var(--accent); font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 相似度分析 / 近邻 */
.similarity-section { padding-top: 16px; }

.sim-title { margin-bottom: 12px; }

.section-toggle {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  margin-left: 4px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-xs);
  background: rgba(16, 25, 42, 0.8);
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--dur), border-color var(--dur), background var(--dur);
}

.section-toggle:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.similarity-body { transition: opacity 0.2s var(--ease); }
.similarity-body.collapsed { display: none; }

.neighbor-panel {
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.neighbor-tabs { display: flex; gap: 4px; margin-bottom: 10px; }

.neighbor-tab {
  flex: 1;
  padding: 0 8px;
  height: 27px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: rgba(16, 25, 42, 0.5);
  color: var(--ink-3);
  font-size: 10.5px;
  font-family: var(--font);
  cursor: pointer;
  transition: color var(--dur), border-color var(--dur), background var(--dur);
}

.neighbor-tab:hover { color: var(--ink-1); border-color: var(--line-3); }

.neighbor-tab.active {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.neighbor-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 300px;
  overflow: auto;
}

.neighbor-item {
  position: relative;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(16, 25, 42, 0.5);
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--dur), background var(--dur), transform var(--dur);
}

.neighbor-item::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), rgba(94, 234, 212, 0));
  opacity: 0;
  transition: opacity var(--dur);
}

.neighbor-item:hover {
  border-color: var(--line-3);
  background: rgba(94, 234, 212, 0.06);
  transform: translateX(1px);
}

.neighbor-item:hover::before { opacity: 0.8; }

.neighbor-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink-1);
}

.neighbor-item small { color: var(--ink-3); font-size: 9.5px; font-family: var(--mono); }

.sim-bar {
  height: 3px;
  margin-top: 6px;
  border-radius: var(--r-pill);
  background: rgba(126, 163, 208, 0.12);
  overflow: hidden;
}

.sim-bar i {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, rgba(94, 234, 212, 0.9), rgba(125, 211, 252, 0.8));
}

/* ---------------------------------------------------------------- 检索结果 */
.search-results {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 40vh;
  margin-top: 12px;
  overflow: auto;
}

.result-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(16, 25, 42, 0.5);
  cursor: pointer;
  animation: resultIn 0.36s var(--ease-out) backwards;
  transition: border-color var(--dur), background var(--dur), transform var(--dur);
}

.result-item:hover {
  border-color: var(--gold-line);
  background: rgba(242, 200, 121, 0.05);
  transform: translateX(2px);
}

@keyframes resultIn {
  from { opacity: 0; transform: translateX(-10px); }
}

.result-title {
  margin-bottom: 6px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-1);
  overflow-wrap: anywhere;
}

.result-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  color: var(--ink-3);
}

.score-pill {
  padding: 1.5px 8px;
  border: 1px solid var(--gold-line);
  border-radius: var(--r-pill);
  background: var(--gold-soft);
  color: var(--gold);
  font-family: var(--mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- 状态栏 */
.monitor-bar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 36px;
  padding: 0 18px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(9, 15, 27, 0.94), rgba(6, 10, 19, 0.96));
  backdrop-filter: blur(12px);
  font-size: 10.5px;
  color: var(--ink-3);
}

.monitor-title {
  display: flex;
  align-items: center;
  gap: 7px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  white-space: nowrap;
}

.pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(94, 234, 212, 0.7);
  animation: breathe 2s infinite;
}

.monitor-metric { display: flex; align-items: center; gap: 7px; min-width: 148px; }

.monitor-metric small,
.monitor-task small,
.monitor-temp small { color: var(--ink-4); white-space: nowrap; }

.monitor-metric strong,
.monitor-temp strong {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.meter {
  width: 60px;
  height: 4px;
  border-radius: var(--r-pill);
  background: rgba(126, 163, 208, 0.12);
  overflow: hidden;
}

.meter i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(94, 234, 212, 0.85), rgba(125, 211, 252, 0.8));
  transition: width 0.5s var(--ease);
}

.monitor-task { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; }

.monitor-task strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
  font-weight: 500;
}

.task-progress {
  flex: 1;
  max-width: 220px;
  height: 4px;
  border-radius: var(--r-pill);
  background: rgba(126, 163, 208, 0.12);
  overflow: hidden;
}

.task-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
  transition: width 0.4s var(--ease);
}

/* ---------------------------------------------------------------- 数据管线抽屉 */
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(3, 6, 12, 0.66);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.26s var(--ease);
}

@keyframes fadeIn { from { opacity: 0; } }

.admin-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 61;
  width: 430px;
  max-width: 94vw;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0d1524, #080d18);
  border-left: 1px solid var(--line-2);
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.55);
  animation: drawerIn 0.32s var(--ease-out);
}

@keyframes drawerIn {
  from { transform: translateX(64px); opacity: 0; }
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 11, 21, 0.5);
}

.admin-head h2 { font-size: 14px; font-weight: 650; letter-spacing: 0.1em; }

.admin-body { flex: 1; overflow-y: auto; }

.field-choice-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.field-select-actions { display: flex; gap: 5px; }
.field-select-actions .btn { height: 24px; margin: 0; padding: 0 8px; font-size: 10px; }

.field-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 200px;
  margin-top: 8px;
  overflow: auto;
}

.field-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(16, 25, 42, 0.5);
  color: var(--ink-2);
  font-size: 11px;
  cursor: pointer;
  transition: border-color var(--dur), color var(--dur), background var(--dur);
}

.field-choice input { accent-color: var(--accent); cursor: pointer; }

.field-choice:has(input:checked) {
  color: var(--ink-1);
  border-color: var(--accent-line);
  background: rgba(94, 234, 212, 0.07);
}

.field-choice:has(input:disabled) { opacity: 0.45; cursor: not-allowed; }

.quality-panel {
  margin-top: 11px;
  padding: 12px 13px;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(94, 234, 212, 0.1), rgba(94, 234, 212, 0.03));
}

.quality-title { margin-bottom: 9px; font-size: 11px; font-weight: 650; letter-spacing: 0.06em; color: var(--accent); }

.quality-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 9px; }
.quality-grid small { display: block; font-size: 9px; letter-spacing: 0.08em; color: var(--ink-3); }
.quality-grid strong { font-family: var(--mono); font-size: 12.5px; color: var(--ink-1); font-variant-numeric: tabular-nums; }
.quality-panel p { font-size: 10px; line-height: 1.65; color: var(--ink-2); }

.field-import-preview {
  margin-top: 11px;
  padding: 11px;
  max-height: 300px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(6, 11, 21, 0.55);
}

.field-import-summary { margin-bottom: 9px; font-size: 10.5px; line-height: 1.7; color: var(--ink-2); }
.field-import-row { padding: 8px 0; border-top: 1px solid var(--line); font-size: 10.5px; }
.field-import-row strong { display: block; margin-bottom: 3px; color: var(--ink-1); }
.field-import-row small { color: var(--ink-3); }
.field-import-text {
  margin-top: 5px;
  padding: 7px 9px;
  border-radius: var(--r-sm);
  background: rgba(8, 13, 24, 0.7);
  color: var(--ink-3);
  line-height: 1.65;
}

.field-import-actions { display: flex; gap: 7px; margin-top: 11px; }
.field-import-actions .btn { margin-top: 0; }

.remote-block {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

/* ---------------------------------------------------------------- 附图灯箱 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 5, 10, 0.94);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.22s var(--ease);
}

.lightbox img {
  max-width: 86vw;
  max-height: 84vh;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.75);
}

.lightbox-close {
  position: absolute;
  top: 20px; right: 24px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: rgba(16, 25, 42, 0.9);
  color: var(--ink-1);
  font-size: 15px;
  cursor: pointer;
  transition: color var(--dur), border-color var(--dur);
}

.lightbox-close:hover { color: var(--accent); border-color: var(--accent-line); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 66px;
  display: grid; place-items: center;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: rgba(16, 25, 42, 0.88);
  color: var(--ink-1);
  font-size: 24px;
  cursor: pointer;
  transition: color var(--dur), border-color var(--dur), background var(--dur);
}

.lightbox-nav:hover { color: var(--accent); border-color: var(--accent-line); background: rgba(94, 234, 212, 0.1); }
.lightbox-nav.prev { left: 24px; }
.lightbox-nav.next { right: 24px; }

.lightbox-caption {
  position: absolute;
  bottom: 22px; left: 50%;
  transform: translateX(-50%);
  max-width: 80vw;
  padding: 9px 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: rgba(10, 16, 30, 0.92);
  color: var(--ink-2);
  font-size: 11.5px;
  text-align: center;
}

/* ---------------------------------------------------------------- Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 62px;
  z-index: 90;
  max-width: min(70vw, 640px);
  padding: 11px 18px;
  border: 1px solid rgba(94, 234, 212, 0.4);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(14, 22, 38, 0.98), rgba(9, 14, 25, 0.98));
  color: var(--ink-1);
  font-size: 12px;
  line-height: 1.6;
  box-shadow: var(--sh-3);
  opacity: 0;
  transform: translateX(-50%) translateY(14px);
  pointer-events: none;
  transition: opacity 0.26s var(--ease), transform 0.26s var(--ease-out);
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------------------------------------------------------- 内置 PDF 阅读器 */
.pdf-viewer { display: flex; flex-direction: column; gap: 9px; min-height: 0; }
.pdf-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.pdf-pageinfo { display: flex; align-items: center; gap: 5px; color: var(--ink-3); font-size: 11px; }
.pdf-pageinput { width: 58px; height: 28px; padding: 0 6px; font-family: var(--mono); }
.pdf-sep { width: 1px; height: 16px; margin: 0 2px; background: var(--line-2); }

.pdf-page-wrap {
  max-height: 560px;
  padding: 11px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(6, 10, 18, 0.62);
}

.pdf-page-img {
  display: block;
  margin: 0 auto;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

/* ---------------------------------------------------------------- 自转后台按钮态 */
.mini-btn.adv {
  color: var(--accent);
  border-color: rgba(94, 234, 212, 0.55);
  background: rgba(94, 234, 212, 0.12);
  box-shadow: 0 0 12px rgba(94, 234, 212, 0.22);
  animation: advPulse 2.6s ease-in-out infinite;
}

@keyframes advPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(94, 234, 212, 0.16); }
  50% { box-shadow: 0 0 18px rgba(94, 234, 212, 0.36); }
}

/* ---------------------------------------------------------------- 04 独立第四列（宽屏停靠） */
.sim-panel { grid-column: 7; display: flex; flex-direction: column; overflow: hidden; }
#splitSim { grid-column: 6; }

.workspace.sim-docked {
  grid-template-columns:
    var(--left-w, 306px) 8px minmax(0, 1fr) 8px var(--right-w, 360px) 8px var(--sim-w, 320px);
}
.workspace.sim-docked.left-collapsed {
  grid-template-columns: 30px 0 minmax(0, 1fr) 8px var(--right-w, 360px) 8px var(--sim-w, 320px);
}
.workspace.sim-docked.right-collapsed {
  grid-template-columns: var(--left-w, 306px) 8px minmax(0, 1fr) 0 52px 8px var(--sim-w, 320px);
}
.workspace.sim-docked.left-collapsed.right-collapsed {
  grid-template-columns: 30px 0 minmax(0, 1fr) 0 52px 8px var(--sim-w, 320px);
}

/* 05 折叠成竖向书脊：整列收窄为 52px，不再留一条空白高栏 */
.workspace.sim-docked.sim-mini {
  grid-template-columns:
    var(--left-w, 306px) 8px minmax(0, 1fr) 8px var(--right-w, 360px) 8px 52px;
}
.workspace.sim-docked.sim-mini.left-collapsed {
  grid-template-columns: 30px 0 minmax(0, 1fr) 8px var(--right-w, 360px) 8px 52px;
}
.workspace.sim-docked.sim-mini.right-collapsed {
  grid-template-columns: var(--left-w, 306px) 8px minmax(0, 1fr) 0 52px 8px 52px;
}
.workspace.sim-docked.sim-mini.left-collapsed.right-collapsed {
  grid-template-columns: 30px 0 minmax(0, 1fr) 0 52px 8px 52px;
}

.sim-panel.sim-mini { padding: 12px 4px; align-items: center; }
.sim-panel.sim-mini .sim-panel-host { display: none; }
.sim-rail { display: none; }

.sim-panel .sim-rail { margin-top: 8px; }

.sim-panel-host { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: auto; }

.workspace.sim-docked #similaritySection {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 16px 16px 18px;
}

.workspace.sim-docked .similarity-body { flex: 1; min-height: 0; overflow: auto; padding-right: 2px; }
.workspace.sim-docked .neighbor-list { max-height: none; }
.workspace.sim-docked .sim-sub { margin-left: auto; }

.sim-sub {
  margin-left: 6px;
  color: var(--ink-4);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.sim-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.sim-tools-label { color: var(--ink-4); font-size: 9.5px; letter-spacing: 0.08em; white-space: nowrap; }
.sim-tools .select-input { width: 72px; padding: 4px 6px; font-size: 11px; }
.sim-tools-note { margin-left: auto; color: var(--ink-4); font-size: 9.5px; white-space: nowrap; }

/* ---------------------------------------------------------------- 选择框 / 选择条 */
.select-box {
  position: absolute;
  z-index: 12;
  border: 1px dashed rgba(94, 234, 212, 0.9);
  background: rgba(94, 234, 212, 0.1);
  border-radius: 6px;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.18), 0 0 18px rgba(94, 234, 212, 0.22) inset;
}

.selection-bar {
  position: absolute;
  left: 14px;
  top: 42px;
  z-index: 14;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 12px;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-pill);
  background: rgba(8, 14, 24, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 18px rgba(94, 234, 212, 0.14);
  animation: viewIn 0.2s var(--ease-out);
}

.selection-bar span { font-size: 11px; color: var(--accent); font-variant-numeric: tabular-nums; }
.selection-bar .mini-btn { height: 24px; padding: 0 9px; font-size: 10.5px; }

/* ---------------------------------------------------------------- 选择模式分段控件 */
.seg-group {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-xs);
  background: rgba(12, 20, 33, 0.7);
}

.seg-btn {
  min-width: 42px;
  height: 24px;
  padding: 0 9px;
  border: none;
  border-radius: 5px;
  background: none;
  color: var(--ink-3);
  font-size: 11px;
  font-family: var(--font);
  cursor: pointer;
  transition: color var(--dur), background var(--dur), box-shadow var(--dur);
}

.seg-btn:hover { color: var(--ink-1); }
.seg-btn.active {
  color: #06121a;
  background: linear-gradient(180deg, #7bf0dc, #46cfb7);
  box-shadow: 0 2px 10px rgba(94, 234, 212, 0.28);
  font-weight: 600;
}

/* ---------------------------------------------------------------- 公式渲染 */
.detail-text { white-space: normal; }

.rich-line { min-height: 0; }
.rich-gap { height: 7px; }

.math-block {
  margin: 7px 0;
  padding: 8px 11px;
  border: 1px solid rgba(94, 234, 212, 0.16);
  border-radius: var(--r-sm);
  background:
    linear-gradient(180deg, rgba(94, 234, 212, 0.055), rgba(94, 234, 212, 0.02));
  overflow-x: auto;
  overflow-y: hidden;
}

.math-block .katex-display { margin: 0; text-align: left; }
.math-block .katex { font-size: 1.02em; color: #dbe7f6; }
.math-raw { border-color: rgba(240, 198, 116, 0.28); background: rgba(240, 198, 116, 0.05); }
.math-raw code { color: #f0c879; font-family: var(--mono); font-size: 11px; }

.math-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }

.math-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid rgba(94, 234, 212, 0.22);
  border-radius: 6px;
  background: rgba(94, 234, 212, 0.06);
  color: #dfeaf7;
  line-height: 1.5;
}

.math-chip .katex { font-size: 1em; }
.math-chip.math-raw code { font-size: 10.5px; }

/* ---------------------------------------------------------------- 关注与分组 */
.group-section .section-aux,
.section-aux {
  margin-left: auto;
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ink-3);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.group-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.group-tools .btn { height: 28px; margin-top: 0; padding: 0 9px; font-size: 10.5px; }

.group-favbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(16, 25, 42, 0.55);
}

.fav-note { font-size: 10px; color: var(--ink-3); }
.fav-note b { color: var(--gold); font-variant-numeric: tabular-nums; }
.group-favbar .mini-btn { height: 20px; padding: 0 7px; font-size: 9.5px; }

.group-list { display: flex; flex-direction: column; gap: 5px; margin-top: 9px; max-height: 34vh; overflow: auto; }

.group-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(16, 25, 42, 0.5);
  transition: border-color var(--dur), background var(--dur);
}

.gr-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gr-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.g-icon {
  flex: none;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  color: var(--ink-4);
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
}
.g-icon.danger:hover { color: #f87171; border-color: rgba(248, 113, 113, 0.55); }
.group-size { font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.group-row:hover { border-color: var(--line-3); background: rgba(94, 234, 212, 0.05); }
.group-row.is-active { border-color: rgba(240, 198, 116, 0.5); background: rgba(240, 198, 116, 0.05); }
.group-row.is-focus { border-color: var(--accent-line); box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.14) inset; }

.group-dot { width: 7px; height: 7px; border-radius: 50%; }

.group-name {
  min-width: 0;
  width: 100%;
  padding: 3px 5px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: none;
  color: var(--ink-1);
  font-size: 11px;
  font-family: var(--font);
}

.group-name:hover { border-color: var(--line); }
.group-name:focus { outline: none; border-color: var(--accent-line); background: rgba(6, 11, 21, 0.8); }
.group-name-static { color: var(--ink-1); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.group-size { color: var(--ink-3); font-family: var(--mono); font-size: 9.5px; font-variant-numeric: tabular-nums; }

.g-act {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(12, 20, 33, 0.7);
  color: var(--ink-3);
  font-size: 10px;
  font-family: var(--font);
  cursor: pointer;
  transition: color var(--dur), border-color var(--dur);
  white-space: nowrap;
}

.g-act:hover { color: var(--accent); border-color: var(--accent-line); }
.g-act.danger:hover { color: #f87171; border-color: rgba(248, 113, 113, 0.55); }

.group-hint { margin-top: 8px; color: var(--ink-4); font-size: 9.5px; line-height: 1.6; }

/* ---------------------------------------------------------------- 人工分类（定制） */
.tag-custom {
  padding: 1px 6px;
  border: 1px solid var(--gold-line);
  border-radius: var(--r-xs);
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.06em;
}

.manual-note { margin: 6px 0 10px; color: var(--ink-3); font-size: 10.5px; line-height: 1.7; }
.manual-note b { color: var(--accent); font-weight: 600; }

.manual-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.manual-actions .btn { height: 30px; margin-top: 0; padding: 0 8px; font-size: 10.5px; }

.manual-file { margin: 9px 0; padding: 7px 9px; border: 1px dashed var(--line-2); border-radius: var(--r-sm); color: var(--ink-3); font-size: 10px; line-height: 1.6; }
.manual-file b { color: var(--ink-1); font-weight: 600; }
.manual-file a { color: var(--accent-2); text-decoration: underline; }

.manual-params { margin: 10px 0 6px; }
.manual-toggles { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 10px; }
.manual-toggles .check-row { margin: 0; }

.manual-progress { height: 4px; margin-bottom: 8px; border-radius: var(--r-pill); background: rgba(126, 163, 208, 0.16); overflow: hidden; }
.manual-progress i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.2s linear; }

.manual-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.manual-kpis > div { padding: 7px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: rgba(16, 25, 42, 0.6); }
.manual-kpis small { display: block; color: var(--ink-4); font-size: 9px; letter-spacing: 0.1em; }
.manual-kpis strong { display: block; margin-top: 2px; color: var(--ink-1); font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.manual-kpis em { margin-left: 2px; color: var(--ink-4); font-size: 9.5px; font-style: normal; font-weight: 400; }

.manual-branches { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; }
.manual-branch { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border: 1px solid var(--line); border-radius: var(--r-pill); font-size: 10px; color: var(--ink-2); }
.manual-branch i { width: 6px; height: 6px; border-radius: 50%; }
.manual-branch b { font-family: var(--mono); font-size: 9.5px; color: var(--ink-1); font-weight: 500; }

.manual-extra { margin-bottom: 7px; color: var(--ink-3); font-size: 9.5px; line-height: 1.6; }
.manual-hintline { margin-top: 7px; color: var(--ink-4); font-size: 9.5px; line-height: 1.65; }
.manual-hint { margin-top: 8px; color: var(--ink-4); font-size: 9px; text-align: center; }

.tap-meter { display: inline-flex; gap: 3px; margin-left: auto; }
.tap-meter i { width: 5px; height: 5px; border-radius: 50%; background: rgba(126, 163, 208, 0.35); }
.tap-meter i.on { background: var(--accent); box-shadow: 0 0 8px rgba(94, 234, 212, 0.6); }

/* ---------------------------------------------------------------- 近邻列表 2.0 */
.neighbor-meta { margin: -4px 0 8px; color: var(--ink-4); font-size: 9.5px; }

.neighbor-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 20px;
  gap: 9px;
  align-items: start;
  padding: 9px 10px;
}

.neighbor-item.current { border-color: rgba(240, 198, 116, 0.5); background: rgba(240, 198, 116, 0.06); }

.nb-rank { color: var(--ink-4); font-family: var(--mono); font-size: 9.5px; line-height: 1.6; font-variant-numeric: tabular-nums; }

.nb-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--ink-1);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  word-break: break-word;
}

.nb-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-3);
}

.nb-pub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-score { color: var(--accent); flex: 0 0 auto; font-variant-numeric: tabular-nums; }

.nb-acts { display: flex; flex-direction: column; gap: 4px; }

.nb-act {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(12, 20, 33, 0.7);
  color: var(--ink-4);
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--dur), border-color var(--dur), background var(--dur);
}

.nb-act:hover { color: var(--accent); border-color: var(--accent-line); }
.nb-act.on { color: var(--gold); border-color: var(--gold-line); background: var(--gold-soft); }

/* ---------------------------------------------------------------- 检索参数 / 计数 */
.search-param-row { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.search-param-control { display: flex; align-items: center; gap: 10px; }
.select-compact { width: 96px; padding: 6px 9px; font-size: 11.5px; }
.search-hint {
  font-size: 9.5px;
  color: var(--ink-4);
  letter-spacing: 0.02em;
  margin-left: auto;
  white-space: nowrap;
}
.param-note { margin-top: 2px; color: var(--ink-4); font-size: 9.5px; line-height: 1.55; }

.search-count {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-3);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.search-count b { color: var(--accent); font-weight: 600; }

/* ---------------------------------------------------------------- 标记 */
.badge.manual { color: var(--gold); border-color: var(--gold-line); background: var(--gold-soft); }
.row-fav { margin-right: 4px; color: var(--gold); font-size: 10px; }
.row-manual { display: block; margin-top: 1px; color: var(--gold); font-size: 9px; opacity: 0.85; }
.legend-mode { flex: 0 0 auto; padding: 4px 9px; color: var(--ink-3); font-size: 10px; border-right: 1px solid var(--line); }
.legend-mode b { color: var(--ink-1); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 响应式 */
/* 表格容器自适应：05 相似度独立成列后中栏变窄，按「中栏实际宽度」而非窗口宽度收列 */
.center-panel { container-type: inline-size; }

@container (max-width: 760px) {
  #tableView th:nth-child(4),
  #tableView td:nth-child(4),
  #tableView th:nth-child(8),
  #tableView td:nth-child(8) { display: none; }
  td:nth-child(7), th:nth-child(7) { width: 112px; }
  td:nth-child(2), th:nth-child(2) { width: 102px; }
}

@container (max-width: 620px) {
  #tableView th:nth-child(6),
  #tableView td:nth-child(6) { display: none; }
  td:nth-child(1), th:nth-child(1) { width: 100px; }
  td:nth-child(2), th:nth-child(2) { width: 98px; }
  td:nth-child(5), th:nth-child(5) { width: 66px; }
}

@container (max-width: 520px) {
  #tableView th:nth-child(5),
  #tableView td:nth-child(5) { display: none; }
}

@media (max-width: 1640px) {
  /* 中栏变窄时先收起“申请人/PDF 标记”两列，保证编号、公开号、类型、日期、技术簇完整可读 */
  #tableView th:nth-child(4),
  #tableView td:nth-child(4),
  #tableView th:nth-child(8),
  #tableView td:nth-child(8) { display: none; }
}

@media (max-width: 1560px) {
  .workspace { --left-w: 288px; --right-w: 366px; padding: 10px 12px; }
  .top-stats { gap: 0; }
  .stat { padding: 3px 14px; min-width: 82px; }
  .brand { min-width: 232px; }
  .dash-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1280px) {
  .workspace { --left-w: 268px; --right-w: 340px; }
  .brand-sub { display: none; }
  .stat:nth-child(2) { display: none; }
  .dash-grid { grid-template-columns: 1fr; }
  .distribution-layout { grid-template-columns: 1fr; }
  .canvas-footer span:nth-child(3) { display: none; }
}

@media (max-width: 1080px) {
  .workspace { --left-w: 252px; --right-w: 320px; }
  .top-stats { display: none; }
  .brand { flex: 1; min-width: 0; }
}

@media (max-width: 1240px) {
  body { overflow: auto; }
  body::before { display: none; }

  .topbar { height: auto; flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .brand { min-width: 0; flex: 1; }
  .top-actions { gap: 8px; }

  .workspace,
  .workspace.left-collapsed,
  .workspace.right-collapsed,
  .workspace.left-collapsed.right-collapsed {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(480px, 62vh) auto;
    height: auto;
    flex: none;
    padding: 10px;
    gap: 10px;
  }

  .workspace.left-collapsed .left-panel > *,
  .workspace.right-collapsed .right-panel > * { display: revert; }

  .workspace.left-collapsed .left-panel,
  .workspace.right-collapsed .right-panel { overflow-y: auto; }

  .panel { max-height: 520px; }
  .panel-toggle { display: none; }
  .col-splitter { display: none; }

  .left-panel,
  #splitLeft,
  .center-panel,
  #splitRight,
  .right-panel { grid-column: 1; }

  /* 窄屏优先看到星图本身：中栏置顶，左栏其次，右栏最后 */
  .center-panel { order: 1; }
  .left-panel { order: 2; }
  .right-panel { order: 3; }

  /* 单栏时中栏恢复整宽，表格重新展示全部列 */
  #tableView th:nth-child(4),
  #tableView td:nth-child(4),
  #tableView th:nth-child(8),
  #tableView td:nth-child(8) { display: table-cell; }

  .center-panel { min-height: 520px; }

  .center-toolbar { gap: 8px; }
  .view-tabs { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
  .map-controls { flex-wrap: wrap; }

  .monitor-bar { height: auto; flex-wrap: wrap; gap: 10px; padding: 8px 12px; }
  .monitor-metric { min-width: 120px; }
  .search-results { max-height: 300px; }
  .rot-console { right: 8px; bottom: 42px; width: 200px; }
  .toast { bottom: 16px; max-width: 86vw; }
}

@media (max-width: 640px) {
  .brand-title { font-size: 14px; }
  .brand-title span { display: none; }
  .stat strong { font-size: 15px; }
  .map-controls .layout-switch { max-width: 108px; }
  .two-fields { grid-template-columns: 1fr; }
  .meta-grid { grid-template-columns: 1fr; }
  .coord-row { grid-template-columns: 1fr; }
  .dash-stats { grid-template-columns: 1fr 1fr; }
  .lightbox-nav { width: 36px; height: 54px; }
  .rot-console { width: auto; left: 8px; right: 8px; }
}

/* ---------------------------------------------------------------- 无障碍 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* 窄屏（<1520，05 未独立成列）：04 档案限高内部滚动，保证 05 始终可见 */
@media (max-width: 1519px) {
  #rightPanel #detailPanel { max-height: 52vh; overflow: auto; }
  #rightPanel #similaritySection { border-top: 1px solid var(--line-2); margin-top: 4px; }
}
