/* ==========================================================================
   Particle Studio — base layout, shell, panels
   ========================================================================== */

:root {
  --bg-0: #080a0f;
  --bg-1: #0f1218;
  --bg-2: #141821;
  --bg-3: #1a1f2a;
  --bg-hover: #1e2432;
  --line: #242b38;
  --line-soft: #1b212c;

  --text: #dfe5f0;
  --text-2: #9aa4b8;
  --text-3: #6b7488;

  --accent: #e8a33d;
  --accent-ink: #2a1d08;
  --accent-soft: rgba(232, 163, 61, 0.12);
  --ok: #4ec9a0;
  --warn: #e8b84b;
  --err: #e5657a;
  --info: #6c9cf5;

  --r-sm: 4px;
  --r-md: 7px;
  --r-lg: 10px;

  --font-ui: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system,
    "PingFang SC", "Microsoft YaHei UI", "Noto Sans SC", sans-serif;
  --font-mono: "Cascadia Mono", "Cascadia Code", "SF Mono", Consolas,
    "JetBrains Mono", "Courier New", monospace;

  --topbar-h: 46px;
  --status-h: 26px;
  --dock-h: 218px;
  --left-w: 228px;
  --right-w: 326px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg-0);
  color: var(--text);
  font: 400 12.5px/1.45 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
}

button, input, select { font-family: inherit; }

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #2b3242;
  border-radius: 8px;
  border: 2px solid var(--bg-1);
}
::-webkit-scrollbar-thumb:hover { background: #3a4356; }

/* ==========================================================================
   App frame
   ========================================================================== */

.app {
  height: 100vh;
  display: grid;
  grid-template-rows: var(--topbar-h) minmax(0, 1fr) var(--dock-h) var(--status-h);
  background: var(--bg-0);
}

.workspace {
  display: grid;
  grid-template-columns: var(--left-w) minmax(0, 1fr) var(--right-w);
  min-height: 0;
}

/* ==========================================================================
   Top bar
   ========================================================================== */

.topbar {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  width: var(--left-w);
  flex: none;
  padding: 0 14px;
  height: 100%;
  border-right: 1px solid var(--line-soft);
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  color: var(--accent);
  background: linear-gradient(150deg, #2a2013, #161a23);
  border: 1px solid #3a2c17;
  display: grid;
  place-items: center;
  flex: none;
}
.brand-mark svg { width: 17px; height: 17px; stroke-width: 1.2; }

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}
.brand-name {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.brand-tag {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  color: var(--text-3);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 3px;
  transform: translateY(-1px);
}

.doc-id {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  flex: none;
  min-width: 0;
}
.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(78, 201, 160, 0.12);
  flex: none;
}
.doc-name {
  font-size: 12.5px;
  font-weight: 550;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 4px;
}

.transport {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.timecode {
  font-family: var(--font-mono);
  font-size: 12px;
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 0 6px 0 8px;
  color: var(--text-2);
  letter-spacing: 0.02em;
}
.tc-cur { color: var(--text); font-weight: 600; min-width: 42px; text-align: right; }
.tc-sep { color: var(--text-3); }
.tc-total { min-width: 38px; }

.speed-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 10px;
  border-left: 1px solid var(--line-soft);
}
.speed-label { font-size: 10.5px; color: var(--text-3); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  flex: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-2);
  margin-right: 4px;
}
.chip-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ok);
}
.chip-sub { color: var(--text-3); }
.chip.is-btn { cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease; }
.chip.is-btn:hover { border-color: rgba(232, 163, 61, 0.45); background: var(--bg-1); }
.chip.is-btn:hover .chip-sub { color: var(--text-2); }

/* ==========================================================================
   Generic buttons
   ========================================================================== */

.icon-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  position: relative;
  flex: none;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn:active { transform: translateY(0.5px); }
.icon-btn.is-disabled { opacity: 0.35; pointer-events: none; }
.icon-btn.xs { width: 22px; height: 22px; border-radius: 5px; }
.icon-btn.xs svg { width: 13px; height: 13px; }

.play-btn {
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: var(--accent-ink);
  border-color: #f0b45c;
}
.play-btn:hover { background: #f2af4f; color: var(--accent-ink); }
.play-btn svg { width: 15px; height: 15px; }

.ghost-btn,
.primary-btn {
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border-radius: var(--r-md);
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text-2);
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.ghost-btn:hover { background: var(--bg-hover); color: var(--text); }
/* 开关型幽灵按钮的激活态（合成预览等）与组行拖拽高亮同色系 */
.ghost-btn[data-on="1"] {
  color: var(--accent);
  border-color: rgba(232, 163, 61, 0.45);
  background: rgba(232, 163, 61, 0.12);
  box-shadow: 0 0 0 1px rgba(232, 163, 61, 0.18) inset;
}
.ghost-btn[data-on="1"]:hover {
  color: var(--accent);
  border-color: rgba(232, 163, 61, 0.6);
  background: rgba(232, 163, 61, 0.18);
}
.primary-btn {
  background: var(--accent);
  border-color: #f0b45c;
  color: var(--accent-ink);
}
.primary-btn:hover { background: #f2af4f; }
.btn-ico { width: 13px; height: 13px; stroke-width: 1.5; }
.ghost-btn.sm, .primary-btn.sm { height: 24px; padding: 0 8px; font-size: 11.5px; }

/* tooltip */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%) translateY(-3px);
  background: #232a38;
  color: var(--text);
  font-size: 10.5px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 5px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s, transform 0.12s;
  z-index: 100;
  border: 1px solid #313a4b;
}
[data-tip]:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ==========================================================================
   Panels
   ========================================================================== */

.panel {
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
/* 左栏内容较多（资产树 + 预设 + 色板 + 贴图抓取 + 贴图列表），
   整栏纵向滚动、各块不收缩：任何高度下抓取区都不会被压扁后溢出到下方 dock 上 */
.panel-left {
  border-right: 1px solid var(--line);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.panel-left > .tree {
  flex: 0 0 auto;
  min-height: 56px;
  max-height: min(220px, 26vh);
}
.panel-left > .preset-list { flex: none; max-height: min(150px, 22vh); }
.panel-left > .color-presets {
  flex: none;
  max-height: min(150px, 22vh);
  overflow-y: auto;
}
.panel-left > .tex-grabber { flex: none; }
.panel-left > .tex-grid { flex: 1 1 auto; min-height: 120px; }

.panel-right { border-left: 1px solid var(--line); }

.panel-head {
  height: 34px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-1);
}
.panel-head.sub {
  border-top: 1px solid var(--line-soft);
  margin-top: 4px;
}
.panel-title {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.panel-head-acts { display: flex; gap: 1px; }
.panel-head-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- asset tree ---------- */

.tree {
  flex: 1 1 auto;
  min-height: 80px;
  overflow-y: auto;
  padding: 6px 6px 8px;
}

.tree-row {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 8px;
  border-radius: 5px;
  color: var(--text-2);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}
.tree-row:hover { background: var(--bg-hover); color: var(--text); }
.tree-row svg { width: 13px; height: 13px; flex: none; opacity: 0.85; }
.tree-row .twisty {
  width: 12px;
  height: 12px;
  display: grid;
  place-items: center;
  color: var(--text-3);
  transition: transform 0.12s;
}
.tree-row .twisty svg { width: 10px; height: 10px; }
.tree-row.is-open .twisty { transform: rotate(90deg); }
.tree-row .tr-name {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}
.tree-row .tr-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-3);
  padding: 0 4px;
  border-radius: 3px;
  background: var(--bg-2);
}
.tree-row.is-selected {
  background: var(--accent-soft);
  color: var(--text);
}
.tree-row.is-selected::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.tree-row.is-effect { color: var(--text); font-weight: 550; }
.tree-row .tr-tools {
  display: none;
  gap: 0;
  margin-left: 2px;
}
.tree-row:hover .tr-tools { display: flex; }
.tree-row:hover .tr-count { display: none; }
.tr-tool {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text-3);
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
}
.tr-tool:hover { background: #2a3142; color: var(--text); }
.tr-tool svg { width: 11px; height: 11px; }
.tree-child { padding-left: 16px; }

.tree-empty {
  padding: 10px 12px;
  font-size: 11.5px;
  color: var(--text-3);
}

/* ---------- preset list ---------- */

.preset-list {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px;
  max-height: 240px;
  overflow-y: auto;
}
/* 模板叠加 / 组合条 */
.preset-combo {
  grid-column: 1 / -1;
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 7px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--bg-1);
  font-size: 11px;
  color: var(--text-3);
}

.preset-combo.is-on {
  border-color: rgba(232, 163, 61, 0.45);
  background: var(--accent-soft);
  color: var(--text-2);
}

.pc-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-count { color: var(--accent); font-weight: 650; }

.pc-btn {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--bg-3);
  color: var(--text-2);
  font: inherit;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}

.pc-btn:hover:not(:disabled) { border-color: #3c4557; color: var(--text); background: var(--bg-2); }
.pc-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.pc-btn.is-ghost { background: transparent; border-color: transparent; color: var(--text-3); }
.pc-btn.is-ghost:hover { background: var(--bg-3); }

.preset-card {
  position: relative;
  border: 1px solid var(--line-soft);
  background: var(--bg-2);
  border-radius: var(--r-md);
  padding: 8px 8px 7px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color 0.12s, background 0.12s, transform 0.12s;
  min-width: 0;
}
.preset-card:hover {
  border-color: #3c4557;
  background: var(--bg-3);
}
.preset-card.is-active { border-color: rgba(232, 163, 61, 0.55); background: rgba(232, 163, 61, 0.06); }

/* 卡片右上角的叠加按钮 */
.preset-add {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(15, 18, 24, 0.82);
  color: var(--text-3);
  font: inherit;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, border-color 0.12s, color 0.12s;
}

.preset-card:hover .preset-add,
.preset-add:focus-visible { opacity: 1; }
.preset-add:hover { border-color: var(--accent); color: var(--accent); }
.preset-list.is-combo .preset-add { display: none; }

/* 组合模式下的选中态 */
.preset-card.is-picked { border-color: var(--accent); background: rgba(232, 163, 61, 0.15); }
.preset-card.is-picked::after {
  content: "✓";
  position: absolute;
  top: 3px;
  right: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  pointer-events: none;
}
.preset-swatch {
  height: 32px;
  border-radius: 5px;
  position: relative;
  overflow: hidden;
}
.preset-swatch::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 68%, rgba(255, 255, 255, 0.65) 0 6%, transparent 34%),
    radial-gradient(circle at 62% 40%, rgba(255, 255, 255, 0.4) 0 4%, transparent 26%);
  mix-blend-mode: screen;
  opacity: 0.85;
}
.preset-name {
  font-size: 11.5px;
  font-weight: 550;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preset-card:hover .preset-name { color: var(--text); }

/* ==========================================================================
   Viewport
   ========================================================================== */

.stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: var(--bg-0);
}

.viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(115% 85% at 50% 40%, #151a25 0%, #0b0e14 58%, #070910 100%);
}

#gl-canvas,
.overlay-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
#gl-canvas { cursor: grab; }
#gl-canvas.is-dragging { cursor: grabbing; }
.overlay-canvas { pointer-events: none; }

.vp-hud {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 1px;
  background: rgba(12, 15, 21, 0.72);
  border: 1px solid rgba(58, 68, 88, 0.55);
  border-radius: 8px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  pointer-events: none;
  z-index: 7;
}
.hud-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 6px 10px;
  font-family: var(--font-mono);
}
.hud-row + .hud-row { border-left: 1px solid rgba(58, 68, 88, 0.4); }
.hud-row b { font-size: 12.5px; font-weight: 600; color: var(--text); }
.hud-row span { font-size: 9.5px; color: var(--text-3); }

.vp-tools {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 5px;
  z-index: 7;
}
.vp-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid rgba(58, 68, 88, 0.55);
  background: rgba(12, 15, 21, 0.72);
  color: var(--text-2);
  cursor: pointer;
  backdrop-filter: blur(10px);
}
.vp-btn:hover { color: var(--text); background: rgba(30, 36, 50, 0.9); }
.vp-btn svg { width: 14px; height: 14px; }
.vp-btn[data-on="1"] { color: var(--accent); border-color: rgba(232, 163, 61, 0.4); }

/* 呈现模式开关按钮：默认隐藏，进入呈现后浮在顶部中央 */
.vp-exit {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(58, 68, 88, 0.6);
  background: rgba(12, 15, 21, 0.78);
  color: var(--text-2);
  font-size: 11px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.vp-exit span {
  font-family: var(--font-mono);
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(58, 68, 88, 0.7);
  color: var(--text-3);
}
.vp-exit:hover { color: var(--text); background: rgba(30, 36, 50, 0.92); }
body.is-present .vp-exit { display: inline-flex; opacity: 1; transform: translateX(-50%) translateY(0); }

/* 合成预览状态条（PMC-04）：贴在 HUD 正下方，退出按钮自带 */
.compprev-bar {
  position: absolute;
  top: 56px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 5px 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(232, 163, 61, 0.32);
  background: rgba(12, 15, 21, 0.82);
  color: var(--text-2);
  font-size: 11px;
  backdrop-filter: blur(10px);
  z-index: 7;
}
.compprev-bar[hidden] { display: none; }
.cp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 163, 61, 0.14);
}
.cp-label { color: var(--text); letter-spacing: 0.02em; }
.cp-stat {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  padding-left: 8px;
  border-left: 1px solid rgba(58, 68, 88, 0.6);
}
.cp-exit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(58, 68, 88, 0.7);
  background: transparent;
  color: var(--text-2);
  font-size: 10.5px;
  cursor: pointer;
}
.cp-exit span {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-3);
}
.cp-exit:hover { color: var(--text); background: rgba(30, 36, 50, 0.9); }
/* 预览期间常驻提示语让位给状态条 */
body.is-comppreview .vp-hint { display: none; }

.vp-caption {
  position: absolute;
  left: 14px;
  bottom: 13px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.04em;
  pointer-events: none;
}
.vp-hint {
  position: absolute;
  left: 50%;
  bottom: 13px;
  transform: translateX(-50%);
  font-size: 10.5px;
  color: var(--text-3);
  opacity: 0.75;
  pointer-events: none;
  white-space: nowrap;
}

/* ==========================================================================
   Status bar
   ========================================================================== */

.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-1);
  border-top: 1px solid var(--line);
  padding: 0 12px;
  font-size: 10.5px;
  color: var(--text-2);
  overflow: hidden;
}
.sb-left, .sb-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sb-left { gap: 8px; }
.sb-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  flex: none;
}
.sb-led.is-busy { background: var(--accent); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.sb-sep { width: 1px; height: 11px; background: var(--line); }
.sb-item {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  white-space: nowrap;
}
.sb-item b { font-weight: 600; color: var(--text-2); font-size: 10.5px; }
.sb-muted { color: var(--text-3); }

/* ==========================================================================
   Toast
   ========================================================================== */

.toast-host {
  position: fixed;
  right: 16px;
  bottom: 42px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 400;
  pointer-events: none;
}
.toast {
  min-width: 180px;
  max-width: 340px;
  background: #1c222e;
  border: 1px solid #313a4b;
  border-left: 2px solid var(--accent);
  color: var(--text);
  font-size: 11.5px;
  padding: 9px 12px;
  border-radius: 7px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  animation: toast-in 0.18s ease-out;
}
.toast.is-ok { border-left-color: var(--ok); }
.toast.is-err { border-left-color: var(--err); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1280px) {
  :root { --left-w: 206px; --right-w: 300px; }
  .doc-id { display: none; }
}
@media (max-width: 1040px) {
  :root { --left-w: 188px; --right-w: 280px; --dock-h: 196px; }
  .brand-tag, .speed-label { display: none; }
  .topbar-actions .ghost-btn { display: none; }
}
@media (max-width: 860px) {
  :root { --right-w: 260px; }
  .preset-list { display: none; }
  .vp-hint { display: none; }
}

/* ==========================================================================
   呈现模式（P）：隐藏编辑界面与坐标线，只留画面
   ========================================================================== */

body.is-present .topbar,
body.is-present .dock,
body.is-present .vp-hud,
body.is-present .vp-caption,
body.is-present .vp-hint,
body.is-present .vp-tools { display: none !important; }

/* 画面占满整个窗口，但左右编辑栏保留：全屏时仍能抓贴图 / 调参数 */
body.is-present .workspace {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: var(--left-w) minmax(0, 1fr) var(--right-w);
}
body.is-present .stage { background: #05070a; }

/* ======================================================================
   贴图抓取（左栏）
   ====================================================================== */
.tex-grabber {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 8px 9px;
  border-bottom: 1px solid var(--line-soft);
}

.tg-row { display: flex; gap: 5px; }
.tg-row .field-input {
  flex: 1;
  min-width: 0;
  height: 25px;
  padding: 0 7px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.tg-row .field-input::placeholder { color: var(--text-3); }
.tg-row .field-input:focus {
  outline: none;
  border-color: rgba(232, 163, 61, 0.55);
  background: var(--bg-3);
}

.tg-btn {
  height: 25px;
  padding: 0 10px;
  font: 600 11px/1 var(--font-ui);
  color: var(--accent-ink);
  background: var(--accent);
  border: 0;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: filter 0.14s;
}
.tg-btn:hover { filter: brightness(1.08); }
.tg-btn:active { filter: brightness(0.94); }

.tg-drop {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  justify-content: center;
  padding: 11px 8px;
  font-size: 11px;
  color: var(--text-3);
  text-align: center;
  background: var(--bg-1);
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s, color 0.14s;
}
.tg-drop b { font-weight: 600; color: var(--text-2); }
.tg-drop:hover { border-color: rgba(232, 163, 61, 0.4); color: var(--text-2); }
.tg-drop.is-over {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
}
.tg-drop.is-over b { color: var(--accent); }
.tg-hint { font-family: var(--font-mono); font-size: 9.5px; color: var(--text-3); }

.tg-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 14px;
}
.tg-status {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tg-status[data-kind="warn"] { color: var(--warn); }
.tg-status[data-kind="err"] { color: var(--err); }
.tg-link {
  padding: 0;
  font: 500 10.5px/1 var(--font-ui);
  color: var(--text-2);
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  cursor: pointer;
}
.tg-link:hover { color: var(--accent); border-bottom-color: rgba(232, 163, 61, 0.4); }

/* 抓取中的「取消」：只在忙时露出，颜色用告警色区分于普通链接 */
.tg-cancel {
  flex: none;
  height: 18px;
  padding: 0 8px;
  font: 500 10px/1 var(--font-ui);
  color: var(--warn);
  background: rgba(232, 163, 61, 0.12);
  border: 1px solid rgba(232, 163, 61, 0.35);
  border-radius: 999px;
  cursor: pointer;
}
.tg-cancel:hover { background: rgba(232, 163, 61, 0.22); }
.tg-cancel[hidden] { display: none; }
.tg-drop.is-busy { opacity: 0.55; pointer-events: none; }

.tg-progress {
  height: 2px;
  overflow: hidden;
  background: var(--line-soft);
  border-radius: 2px;
}
.tg-progress > i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.12s linear;
}

/* 贴图网格 */
.tex-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  overflow-y: auto;
}
.tex-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px;
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s;
}
.tex-card:hover { background: var(--bg-2); border-color: var(--line); }
.tex-card.is-picked { border-color: rgba(232, 163, 61, 0.6); }
.tex-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  image-rendering: auto;
  background:
    repeating-conic-gradient(var(--bg-2) 0% 25%, var(--bg-1) 0% 50%) 50% / 10px 10px;
  border-radius: 2px;
}
.tex-name {
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tex-card.is-picked .tex-name { color: var(--text-2); }
.tex-grade {
  position: absolute;
  top: 6px;
  left: 6px;
  min-width: 14px;
  padding: 1px 3px;
  font: 700 9px/1.2 var(--font-mono);
  text-align: center;
  border-radius: 2px;
}
.tex-grade.gA { color: #0d2418; background: var(--ok); }
.tex-grade.gB { color: var(--accent-ink); background: var(--warn); }
.tex-grade.gC { color: #2a1216; background: var(--err); }
.tex-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 15px;
  height: 15px;
  padding: 0;
  font: 600 12px/1 var(--font-ui);
  color: var(--text-2);
  background: rgba(8, 10, 15, 0.72);
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, color 0.12s;
}
.tex-card:hover .tex-del { opacity: 1; }
.tex-del:hover { color: var(--err); border-color: rgba(229, 101, 122, 0.5); }

/* 卡片右下角放大镜：hover 才露出，点开预览层 */
.tex-zoom-btn {
  position: absolute;
  right: 4px;
  bottom: 17px;
  width: 16px;
  height: 16px;
  padding: 2px;
  color: var(--text-2);
  background: rgba(8, 10, 15, 0.72);
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: zoom-in;
  opacity: 0;
  transition: opacity 0.12s, color 0.12s, border-color 0.12s;
}
.tex-zoom-btn svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
}
.tex-card:hover .tex-zoom-btn { opacity: 1; }
.tex-zoom-btn:hover { color: var(--accent); border-color: rgba(232, 163, 61, 0.5); }

.tex-empty,
.fit-empty {
  grid-column: 1 / -1;
  padding: 18px 10px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-3);
  text-align: center;
  border: 1px dashed var(--line-soft);
  border-radius: var(--r-md);
}
.tex-empty span { font-family: var(--font-mono); font-size: 10px; }

/* ======================================================================
   纹理试衣间（底部 dock）
   ====================================================================== */
.fit-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.fit-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line-soft);
}
.fit-target {
  overflow: hidden;
  font-size: 11px;
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fit-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  margin-left: auto;
}
.fit-actions .mini-select { height: 22px; font-size: 10.5px; }
.fit-actions .ghost-btn.sm { height: 22px; padding: 0 8px; font-size: 10.5px; }

.fit-grid {
  display: flex;
  flex: 1;
  gap: 8px;
  min-height: 0;
  padding: 8px 10px;
  overflow-x: auto;
  overflow-y: hidden;
}
.fit-card {
  display: flex;
  flex: 0 0 224px;
  gap: 8px;
  padding: 6px;
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s, transform 0.14s;
}
.fit-card:hover { background: var(--bg-2); border-color: var(--line); }
.fit-card.is-picked { border-color: rgba(232, 163, 61, 0.6); background: var(--bg-2); }
.fit-card:hover .fit-acts { opacity: 1; }

.fit-thumb {
  position: relative;
  flex: 0 0 62px;
  height: 62px;
  background:
    repeating-conic-gradient(var(--bg-2) 0% 25%, var(--bg-1) 0% 50%) 50% / 8px 8px;
  border-radius: var(--r-sm);
}
.fit-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--r-sm);
}
.fit-score {
  position: absolute;
  right: -4px;
  bottom: -4px;
  padding: 1px 4px;
  font: 700 10px/1.25 var(--font-mono);
  border-radius: 3px;
  box-shadow: 0 0 0 2px var(--bg-1);
}
.fit-score.sA { color: #0d2418; background: var(--ok); }
.fit-score.sB { color: var(--accent-ink); background: var(--warn); }
.fit-score.sC { color: #2a1216; background: var(--err); }

.fit-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding-top: 1px;
}
.fit-name {
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fit-meta {
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fit-meta svg {
  width: 10px;
  height: 10px;
  margin-right: 3px;
  vertical-align: -1px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
}
.fit-swatches { display: flex; gap: 3px; margin-top: auto; }
.fit-swatches i {
  width: 12px;
  height: 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
}

.fit-acts {
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: center;
  opacity: 0.35;
  transition: opacity 0.14s;
}
.fit-acts .ghost-btn.xs {
  height: 18px;
  padding: 0 5px;
  font-size: 9.5px;
  white-space: nowrap;
}

.fit-foot {
  padding: 5px 10px 7px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-3);
  border-top: 1px solid var(--line-soft);
}

/* 检查器里的贴图参数行 */
.asset-field { display: flex; flex-direction: column; gap: 5px; }
.asset-field .asset-pick { display: flex; gap: 6px; align-items: center; }
.asset-field .asset-thumb {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  object-fit: contain;
  background:
    repeating-conic-gradient(var(--bg-2) 0% 25%, var(--bg-1) 0% 50%) 50% / 8px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.asset-field .asset-thumb.is-none { border-style: dashed; }
.asset-field select {
  flex: 1;
  min-width: 0;
  height: 24px;
  font-size: 11px;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

/* === 颜色预设 === */
.color-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 2px 8px 8px;
}
.cpr {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--bg-1);
  color: var(--text-2);
  font-family: inherit;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s, color 0.14s;
}
.cpr:hover { border-color: var(--line); background: var(--bg-hover); color: var(--text); }
.cpr:focus-visible { outline: 1px solid var(--accent); outline-offset: 1px; }
.cpr.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.cpr-bar {
  flex: none;
  width: 14px;
  height: 18px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.cpr-name { font-weight: 600; white-space: nowrap; }
.cpr-en { margin-left: auto; color: var(--text-3); font-size: 10px; }
.cpr.is-active .cpr-en { color: var(--text-2); }

/* 自定义颜色：取色器 + 预览 + 动作 */
.cpr-custom {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 1px 2px 0;
}
.cpr-custom-label {
  color: var(--text-3);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}
.cpr-pick {
  position: relative;
  width: 26px;
  height: 20px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: var(--bg-1);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.cpr-pick:hover { border-color: var(--line); }
.cpr-pick input[type="color"] {
  position: absolute;
  inset: -4px;
  width: calc(100% + 8px);
  height: calc(100% + 8px);
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.cpr-pick input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.cpr-pick input[type="color"]::-webkit-color-swatch { border: none; }
.cpr-pick input[type="color"]::-moz-color-swatch { border: none; }
.cpr-blend {
  margin-left: auto;
  height: 20px;
  max-width: 76px;
  padding: 0 4px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: var(--bg-1);
  color: var(--text-2);
  font-family: inherit;
  font-size: 10.5px;
  cursor: pointer;
}
.cpr-blend:hover { border-color: var(--line); color: var(--text); }
.cpr-blend:focus-visible { outline: 1px solid var(--accent); outline-offset: 1px; }
.cpr-preview {
  grid-column: 1 / -1;
  height: 10px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
  transition: background 0.12s;
}
.cpr-acts {
  grid-column: 1 / -1;
  display: flex;
  gap: 5px;
}
.cpr-btn {
  flex: 1;
  height: 21px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: var(--bg-1);
  color: var(--text-2);
  font-family: inherit;
  font-size: 10.5px;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s, color 0.14s;
}
.cpr-btn:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.cpr-btn:focus-visible { outline: 1px solid var(--accent); outline-offset: 1px; }
.cpr-namerow {
  grid-column: 1 / -1;
  display: flex;
  gap: 5px;
}
.cpr-namerow .cpr-btn { flex: none; width: 44px; }
.cpr-input {
  flex: 1;
  min-width: 0;
  height: 21px;
  padding: 0 6px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--bg-0, var(--bg-1));
  color: var(--text);
  font-family: inherit;
  font-size: 10.5px;
}
.cpr-input:focus { outline: none; border-color: var(--accent); }
.cpr-user {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}
.cpr-mini { padding-right: 2px; }
.cpr-mini .cpr-bar { height: 16px; }
.cpr-mini .cpr-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 74px;
}
.cpr-del {
  flex: none;
  width: 14px;
  height: 14px;
  margin-left: auto;
  border-radius: 3px;
  color: var(--text-3);
  font-size: 11px;
  line-height: 13px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s, color 0.12s;
}
.cpr-mini:hover .cpr-del { opacity: 1; }
.cpr-del:hover { background: rgba(231, 76, 60, 0.16); color: #e74c3c; }
.cpr-empty {
  grid-column: 1 / -1;
  padding: 2px 1px;
  color: var(--text-3);
  font-size: 10px;
  line-height: 1.5;
}

/* 我的配色卡片上的工具行：常占位、悬停显形，避免 hover 时布局跳动 */
.cpr-mini { flex-wrap: wrap; row-gap: 2px; align-items: center; }
.cpr-n {
  flex: none;
  color: var(--accent);
  font-size: 9.5px;
  font-style: normal;
  letter-spacing: -0.02em;
}
.cpr-tools {
  flex: 0 0 100%;
  display: flex;
  justify-content: flex-end;
  gap: 1px;
  height: 14px;
  opacity: 0;
  transition: opacity 0.12s;
}
.cpr-mini:hover .cpr-tools,
.cpr-mini:focus-within .cpr-tools,
.cpr-mini.is-linked .cpr-tools,
.cpr-mini.is-asking .cpr-tools { opacity: 1; }
.cpr-tool,
.cpr-mini .cpr-del {
  flex: none;
  width: 15px;
  height: 14px;
  margin: 0;
  border-radius: 3px;
  color: var(--text-3);
  font-size: 10px;
  font-style: normal;
  line-height: 14px;
  text-align: center;
  cursor: pointer;
  opacity: 1;
  transition: background 0.12s, color 0.12s;
}
.cpr-tool:hover { background: var(--accent-soft); color: var(--accent); }
.cpr-del:hover,
.cpr-del.is-ask { background: rgba(231, 76, 60, 0.16); color: #e74c3c; }
.cpr-mini.is-linked { border-color: var(--accent); }
.cpr-mini.is-linked .cpr-bar { box-shadow: inset 0 0 0 1px var(--accent); }
.cpr.is-editing { border-color: var(--accent); background: var(--accent-soft); }
.cpr .cpr-tool {
  flex: none;
  width: 13px;
  opacity: 0;
  transition: opacity 0.12s, color 0.12s;
}
.cpr:hover .cpr-tool, .cpr.is-editing .cpr-tool { opacity: 1; }

/* 导入入口 */
.cpr-imp { grid-column: 1 / -1; display: flex; }
.cpr-import {
  flex: 1;
  display: block;
  height: 21px;
  border: 1px dashed var(--line-soft);
  border-radius: 4px;
  background: none;
  color: var(--text-3);
  font-size: 10.5px;
  line-height: 19px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.14s, color 0.14s, background 0.14s;
}
.cpr-import:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }

/* === 配方编辑器（cpe = color preset editor）=== */
.cpe {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 7px;
  border: 1px solid var(--accent);
  border-radius: var(--r-md);
  background: var(--bg-0, var(--bg-1));
}
.cpe-head { display: flex; align-items: center; gap: 6px; }
.cpe-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cpe-title b { font-weight: 700; }
.cpe-tag {
  margin-left: 4px;
  color: var(--text-3);
  font-size: 9.5px;
  font-weight: 400;
}
.cpe-x {
  flex: none;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 3px;
  background: none;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.cpe-x:hover { background: rgba(231, 76, 60, 0.16); color: #e74c3c; }
.cpe-sec { display: flex; flex-direction: column; gap: 3px; }
.cpe-sec-t {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--text-2);
  font-size: 10px;
  letter-spacing: 0.02em;
}
.cpe-sec-t em { color: var(--text-3); font-size: 9.5px; font-style: normal; }

/* 色带：一排颜色块，块上叠一个删除角标 */
.cpe-band { display: flex; flex-wrap: wrap; gap: 3px; }
.cpe-chip {
  position: relative;
  width: 24px;
  height: 20px;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.32);
}
.cpe-chip input[type="color"] {
  position: absolute;
  inset: -4px;
  width: calc(100% + 8px);
  height: calc(100% + 8px);
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.cpe-chip input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.cpe-chip input[type="color"]::-webkit-color-swatch { border: none; }
.cpe-chip input[type="color"]::-moz-color-swatch { border: none; }
.cpe-mini {
  position: absolute;
  top: 0;
  right: 0;
  width: 11px;
  height: 11px;
  border-radius: 0 3px 0 3px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 9px;
  font-style: normal;
  line-height: 11px;
  text-align: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s;
}
.cpe-chip:hover .cpe-mini,
.cpe-stop:hover .cpe-mini { opacity: 1; }
.cpe-mini:hover { background: #e74c3c; }
.cpe-plus {
  width: 24px;
  height: 20px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  background: none;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.cpe-plus:hover { border-color: var(--accent); color: var(--accent); }
.cpe-plus-w { width: auto; padding: 0 6px; font-size: 10px; }

/* 渐变色标：色块 + 位置 + 删除 */
.cpe-stops { display: flex; flex-direction: column; gap: 3px; }
.cpe-stop {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 4px;
  align-items: center;
}
.cpe-sc {
  width: 22px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 3px;
  background: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.cpe-sc::-webkit-color-swatch-wrapper { padding: 0; }
.cpe-sc::-webkit-color-swatch { border: none; border-radius: 3px; }
.cpe-sc::-moz-color-swatch { border: none; border-radius: 3px; }
.cpe-t {
  height: 18px;
  min-width: 0;
  padding: 0 5px;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  background: var(--bg-1);
  color: var(--text-2);
  font-family: inherit;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.cpe-t:focus { outline: none; border-color: var(--accent); }

/* 参数字段：标签 / 滑块 / 读数 */
.cpe-f {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 32px;
  gap: 4px;
  align-items: center;
  font-size: 10px;
}
.cpe-f > span { color: var(--text-3); white-space: nowrap; }
.cpe-f > output {
  color: var(--text-2);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.cpe-f input[type="range"] {
  width: 100%;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.cpe-sel {
  grid-column: 2 / -1;
  height: 18px;
  padding: 0 4px;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  background: var(--bg-1);
  color: var(--text-2);
  font-family: inherit;
  font-size: 10px;
  cursor: pointer;
}
.cpe-sel:hover { border-color: var(--line); }
.cpe-preview {
  height: 12px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}
.cpe-acts { display: flex; gap: 4px; }
.cpe-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg-0, #14161c);
  font-weight: 600;
}
.cpe-primary:hover { border-color: var(--accent); color: var(--bg-0, #14161c); }
.cpe-note { color: var(--text-3); font-size: 9.5px; line-height: 1.4; }

/* 导入确认条 */
.cpe-pend {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border: 1px dashed var(--accent);
  border-radius: var(--r-md);
  background: var(--accent-soft);
}
.cpe-pend-head { display: flex; gap: 5px; align-items: baseline; font-size: 10.5px; }
.cpe-pend-head span { color: var(--text-3); }
.cpe-pend-head b { color: var(--text); font-weight: 600; }
.cpe-pend-bar { height: 10px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3); }
.cpe-pend-warn { color: #e67e22; font-size: 9.5px; line-height: 1.4; }

/* 二次确认条：放弃改动 / 保存同步链接 */
.cpe-ask {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 5px 0;
  padding: 7px;
  border: 1px solid rgba(230, 126, 34, 0.55);
  border-radius: var(--r-md);
  background: rgba(230, 126, 34, 0.1);
}
.cpe-ask-t { color: #e67e22; font-size: 10.5px; font-weight: 600; line-height: 1.35; }
.cpe-ask-list {
  margin: 0;
  padding-left: 14px;
  color: var(--text-2, #c9ccd8);
  font-size: 9.5px;
  line-height: 1.5;
  max-height: 76px;
  overflow-y: auto;
}
.cpe-ask-list li { list-style: disc; }
.cpe-ask-acts { display: flex; gap: 4px; }

/* 刷新后未保存草稿的恢复条 */
.cpe-recover {
  grid-column: 1 / -1;
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
  padding: 6px 7px;
  border: 1px dashed var(--accent);
  border-radius: var(--r-md);
  background: var(--accent-soft);
  font-size: 10px;
  color: var(--text-2, #c9ccd8);
}
.cpe-recover-acts { display: flex; gap: 4px; flex: none; }

@media (max-width: 768px) {
  .cpe-f { grid-template-columns: 46px minmax(0, 1fr) 30px; }
}

/* === 贴图预览层：点卡片放大镜打开，Esc / 点遮罩关闭 === */
.tex-zoom {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 8, 12, 0.78);
}
.tex-zoom[hidden] { display: none; }
.tz-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(560px, 100%);
  padding: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
}
.tz-head { display: flex; align-items: center; gap: 8px; }
.tz-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font: 600 11.5px/1.4 var(--font-ui);
  color: var(--text-1, var(--text-2));
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tz-close {
  flex: none;
  width: 20px;
  height: 20px;
  padding: 0;
  font: 600 14px/1 var(--font-ui);
  color: var(--text-2);
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}
.tz-close:hover { color: var(--err); border-color: rgba(229, 101, 122, 0.5); }
.tz-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  max-height: 56vh;
  overflow: auto;
  background: repeating-conic-gradient(var(--bg-2) 0% 25%, var(--bg-1) 0% 50%) 50% / 12px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
}
.tz-img { max-width: 100%; max-height: 56vh; object-fit: contain; }
.tz-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
}
.tz-swatches { display: flex; gap: 4px; }
.tz-swatches i {
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
}
.tz-foot { font-size: 10px; color: var(--text-3); }

/* 许可标记：已知许可低对比，未知用警告色提示自行确认（D0-10） */
.tz-lic.is-warn { color: var(--warn); }
.tz-hash { color: var(--text-3); opacity: 0.7; }
.lic-tag {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  font-size: 9px;
  line-height: 14px;
  color: var(--text-3);
}
.lic-tag.is-warn { color: var(--warn); border-color: rgba(224, 164, 88, 0.45); }
.fit-lic { margin-top: -2px; }

/* === 亮度直方图 === */
/* 16 桶等宽柱，靠 flex 均分宽度、柱高百分比归一，任何尺寸都不变形 */
.lum-bar {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 22px;
  padding: 2px 3px;
  border-radius: var(--r-sm);
  background: var(--bg-0);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  overflow: hidden;
}
.lum-bar i {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 1px 1px 0 0;
  background: var(--accent);
  opacity: .5;
  transition: opacity .12s ease;
}
.lum-bar i:hover { opacity: 1; }
/* 卡片内嵌：更矮，避免和色块抢视线 */
.lum-bar.is-mini { height: 16px; margin-top: 6px; padding: 2px; }
.tz-lum { margin-top: 10px; }
.tz-lum:empty { display: none; }
.tz-lum .lum-bar { height: 64px; padding: 4px 6px; }
.lum-note {
  display: flex;
  gap: 14px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.lum-note .lum-mean { margin-left: auto; color: var(--text-2); }

/* === 试衣间网格预览（N4-02）=============================================
   3D 内容由 renderer 按格 scissor 渲染，这里只叠格线 / 序号 / 文件名 */
.fit-gridview {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--fg-n, 2), 1fr);
  grid-template-rows: repeat(var(--fg-n, 2), 1fr);
  pointer-events: none;
  z-index: 6;
}
.fit-gridview[hidden] { display: none; }

/* 网格预览时让常驻 HUD / 说明让位，避免与格线与标签互相压盖 */
body.is-fitgrid .vp-hud,
body.is-fitgrid .vp-caption,
body.is-fitgrid .vp-hint { display: none; }

/* 底部操作提示：浮在格线上，自带底避免与格线糊在一起 */
.fit-gridview > .fg-help {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 24px);
  padding: 4px 11px;
  border: 1px solid rgba(58, 68, 88, .55);
  border-radius: 999px;
  background: rgba(8, 10, 15, .72);
  color: var(--text-3);
  font-size: 10px;
  white-space: nowrap;
  pointer-events: none;
  backdrop-filter: blur(6px);
}

/* 键盘切换的即时反馈：第几格 / 哪张图 / 怎么操作 */
.fg-help b {
  color: var(--accent);
  font: 600 10px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.fg-help i {
  max-width: 20ch;
  overflow: hidden;
  padding-left: 8px;
  border-left: 1px solid rgba(58, 68, 88, .7);
  color: var(--text-2);
  font-style: normal;
  text-overflow: ellipsis;
}

.fg-help em {
  color: var(--text-3);
  font-style: normal;
  opacity: .8;
}

@media (max-width: 768px) {
  .fg-help em { display: none; }
}

.fg-cell {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line-soft);
  background: rgba(8, 10, 15, .12);
  /* 整层不吃指针：视口旋转 / 缩放照旧可用，只有标签可点 */
  pointer-events: none;
  transition: background .14s ease, box-shadow .14s ease;
}

/* 标签贴格子底部（顶部留给 HUD 与工具栏），自身承担点击 */
.fg-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 1px 6px 1px 2px;
  border-radius: var(--r-sm);
  background: rgba(8, 10, 15, .62);
  pointer-events: auto;
  cursor: pointer;
}

.fg-cell b {
  flex: none;
  padding: 0 4px;
  border-radius: calc(var(--r-sm) - 1px);
  background: transparent;
  color: var(--text-3);
  font: 600 10px/1.7 ui-monospace, "JetBrains Mono", Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

.fg-cell span {
  max-width: calc(100% - 30px);
  overflow: hidden;
  color: var(--text-2);
  font-size: 10px;
  line-height: 1.7;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .75);
}

.fg-cell:hover { background: rgba(232, 163, 61, .08); }

.fg-cell.is-cur {
  background: rgba(232, 163, 61, .12);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.fg-cell.is-cur b { color: var(--accent); }

.fg-cell.is-empty span { color: var(--text-3); font-style: italic; }

@media (max-width: 768px) {
  .fg-cell span { display: none; }
}

/* === 文字转粒子（M1）：文字 → 字形遮罩 → 按遮罩发射 === */
.tm-back {
  position: fixed;
  inset: 0;
  z-index: 62;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 8, 12, 0.82);
}
.tm-back[hidden] { display: none; }
.tm-box {
  display: flex;
  flex-direction: column;
  width: min(860px, 100%);
  max-height: min(640px, 92vh);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.tm-box.is-busy { cursor: progress; }
.tm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.tm-head h3 {
  margin: 0;
  font: 600 13px/1.4 var(--font-ui);
  color: var(--text);
}
.tm-sub {
  display: block;
  margin-top: 2px;
  font: 400 11px/1.4 var(--font-ui);
  color: var(--text-3);
}
.tm-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  gap: 14px;
  padding: 14px;
  overflow: auto;
}
.tm-form { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tm-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font: 500 10.5px/1.4 var(--font-ui);
  color: var(--text-3);
  letter-spacing: 0.02em;
}
.tm-field textarea,
.tm-field select {
  font: 400 12px/1.5 var(--font-ui);
  color: var(--text);
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 6px 8px;
}
.tm-field textarea {
  resize: vertical;
  min-height: 54px;
  font-size: 13px;
  letter-spacing: 0.04em;
}
.tm-field textarea:focus,
.tm-field select:focus {
  outline: none;
  border-color: rgba(232, 163, 61, 0.55);
}
.tm-sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.tm-range {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 6px;
  font: 500 10.5px/1.4 var(--font-ui);
  color: var(--text-3);
}
.tm-range b {
  font: 600 10.5px/1 var(--font-mono, monospace);
  color: var(--text-2);
}
.tm-range input {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--accent);
}
.tm-colors { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tm-swatch {
  display: flex;
  align-items: center;
  gap: 5px;
  font: 500 10.5px/1 var(--font-ui);
  color: var(--text-3);
}
.tm-swatch input {
  width: 26px;
  height: 20px;
  padding: 0;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.tm-meta {
  margin: 0;
  font: 400 10.5px/1.5 var(--font-mono, monospace);
  color: var(--text-3);
}
.tm-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  min-width: 0;
}
.tm-preview canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  background: repeating-conic-gradient(var(--bg-1) 0% 25%, var(--bg-0) 0% 50%) 50% / 12px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
}
.tm-preview figcaption {
  font: 400 10.5px/1.4 var(--font-mono, monospace);
  color: var(--text-3);
  text-align: right;
}
.tm-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--line-soft);
  background: var(--bg-1);
}
.tm-hint {
  flex: 1;
  font: 400 10.5px/1.4 var(--font-ui);
  color: var(--text-3);
}

@media (max-width: 768px) {
  .tm-back { padding: 12px; }
  .tm-body { grid-template-columns: minmax(0, 1fr); }
  .tm-sliders { grid-template-columns: 1fr; }
  .tm-preview canvas { aspect-ratio: 16 / 10; }
}

/* === 模型优化报告（P0）：分析 / 预算 / 风险 === */
.mo-back {
  position: fixed;
  inset: 0;
  z-index: 63;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 8, 12, 0.82);
}
.mo-back[hidden] { display: none; }
.mo-box {
  display: flex;
  flex-direction: column;
  width: min(920px, 100%);
  max-height: min(700px, 92vh);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.mo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.mo-head h3 {
  margin: 0;
  font: 600 13px/1.4 var(--font-ui);
  color: var(--text);
}
.mo-sub {
  display: block;
  margin-top: 2px;
  font: 400 11px/1.4 var(--font-ui);
  color: var(--text-3);
}
.mo-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-3);
}
.mo-field {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 400 11px/1.4 var(--font-ui);
  color: var(--text-2);
}
.mo-field select {
  font: 400 11px/1.4 var(--font-ui);
  padding: 3px 6px;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.mo-src {
  margin-left: auto;
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 400 10.5px/1.4 var(--font-ui);
  color: var(--text-3);
}
.mo-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mo-empty {
  padding: 22px 8px;
  text-align: left;
  color: var(--text-2);
  font: 400 12px/1.6 var(--font-ui);
}
.mo-empty p { margin: 0 0 8px; }
.mo-empty-sub { color: var(--text-3); font-size: 11px; }
.mo-top {
  display: flex;
  gap: 12px;
  align-items: stretch;
  flex-wrap: wrap;
}
.mo-verdict {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 168px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.mo-verdict b { font: 600 15px/1.3 var(--font-ui); color: var(--text); }
.mo-verdict span { font: 400 10.5px/1.4 var(--font-ui); color: var(--text-3); }
.mo-verdict.pass { border-color: rgba(89, 184, 124, 0.45); background: rgba(89, 184, 124, 0.1); }
.mo-verdict.pass b { color: #7acb98; }
.mo-verdict.warn { border-color: rgba(232, 163, 61, 0.5); background: rgba(232, 163, 61, 0.1); }
.mo-verdict.warn b { color: var(--accent); }
.mo-verdict.fail { border-color: rgba(224, 90, 79, 0.5); background: rgba(224, 90, 79, 0.12); }
.mo-verdict.fail b { color: #ea7c72; }
.mo-stats {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}
.mo-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  background: var(--bg-3);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
}
.mo-stat span { font: 400 10.5px/1.4 var(--font-ui); color: var(--text-3); }
.mo-stat b {
  font: 600 14px/1.3 var(--font-ui);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.mo-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.mo-panel {
  padding: 12px;
  background: var(--bg-3);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
}
.mo-panel h4 {
  margin: 0 0 8px;
  font: 600 11px/1.4 var(--font-ui);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
}
.mo-panel h4:not(:first-child) { margin-top: 14px; }
.mo-bar-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 122px;
  gap: 8px;
  align-items: center;
  padding: 3px 0;
  font: 400 11px/1.4 var(--font-ui);
}
.mo-bar-name { color: var(--text-2); }
.mo-bar-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.mo-bar-track i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
}
.mo-bar-row.ok .mo-bar-track i { background: #59b87c; }
.mo-bar-row.warn .mo-bar-track i { background: var(--accent); }
.mo-bar-row.fail .mo-bar-track i { background: #e05a4f; }
.mo-bar-val {
  text-align: right;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.mo-items,
.mo-facts,
.mo-risks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font: 400 11.5px/1.5 var(--font-ui);
}
.mo-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 7px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.02);
}
.mo-item.warn { background: rgba(232, 163, 61, 0.1); }
.mo-item.fail { background: rgba(224, 90, 79, 0.12); }
.mo-item-label { color: var(--text-2); }
.mo-item-val {
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mo-facts li {
  position: relative;
  padding-left: 10px;
  color: var(--text-2);
}
.mo-facts li::before {
  content: '·';
  position: absolute;
  left: 2px;
  color: var(--text-3);
}
.mo-risk {
  display: flex;
  gap: 8px;
  padding: 5px 8px;
  border-left: 2px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.02);
}
.mo-risk b {
  flex: none;
  font: 600 10px/1.6 var(--font-mono, ui-monospace, monospace);
  color: var(--text-3);
}
.mo-risk span { color: var(--text-2); }
.mo-risk.info { border-left-color: var(--line); }
.mo-risk.warn { border-left-color: var(--accent); }
.mo-risk.warn b { color: var(--accent); }
.mo-risk.fail { border-left-color: #e05a4f; }
.mo-risk.fail b { color: #ea7c72; }
.mo-risk.ok { border-left-color: #59b87c; }
.mo-risk.ok b { color: #7acb98; }
.mo-lod table {
  width: 100%;
  border-collapse: collapse;
  font: 400 11.5px/1.5 var(--font-ui);
}
.mo-lod th {
  padding: 4px 6px;
  text-align: left;
  font-weight: 500;
  color: var(--text-3);
  border-bottom: 1px solid var(--line-soft);
}
.mo-lod td {
  padding: 4px 6px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.mo-lod tr:last-child td { border-bottom: none; }
.mo-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--line-soft);
  background: var(--bg-3);
}
.mo-hint {
  flex: 1;
  font: 400 10.5px/1.4 var(--font-ui);
  color: var(--text-3);
}

@media (max-width: 768px) {
  .mo-back { padding: 12px; }
  .mo-cols { grid-template-columns: minmax(0, 1fr); }
  .mo-bar-row { grid-template-columns: 52px minmax(0, 1fr); }
  .mo-bar-val { display: none; }
  .mo-src { display: none; }
}

/* ==========================================================================
   场景树 / 大纲（PMC-02）
   ========================================================================== */

.panel-left > .ct-tree {
  max-height: min(300px, 34vh);
  min-height: 72px;
}

.ct-row {
  height: 26px;
  gap: 6px;
  padding-right: 4px;
}
.ct-row .ct-pad { flex: none; height: 100%; }

.ct-row.is-group > .tr-name { font-weight: 550; color: var(--text); }
.ct-row.is-root > .tr-name { font-weight: 600; letter-spacing: 0.01em; }

.ct-twisty {
  width: 12px;
  height: 12px;
  flex: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-3);
  display: grid;
  place-items: center;
  border-radius: 3px;
  cursor: pointer;
}
.ct-twisty svg { width: 9px; height: 9px; opacity: 0.9; }
.ct-twisty.is-open svg { transform: rotate(90deg); }
.ct-twisty:hover { color: var(--text); background: var(--bg-2); }
.ct-twisty.is-leaf { cursor: default; background: none; }

.ct-ico { width: 12px; height: 12px; }

.ct-badge {
  margin-left: auto;
  min-width: 14px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-3);
}
.ct-badge.is-plain { opacity: 0.62; }

.ct-acts {
  display: none;
  align-items: center;
  gap: 1px;
  margin-left: auto;
}
.ct-row:hover .ct-acts { display: flex; }
.ct-row:hover .ct-badge { display: none; }
.ct-acts .icon-btn.is-on { color: var(--accent); }

.ct-row.is-off .tr-name {
  opacity: 0.42;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.ct-row.is-locked { cursor: not-allowed; }
.ct-row.is-locked .tr-name { opacity: 0.75; }
.ct-row.is-dragging { opacity: 0.45; }

.ct-row.is-drop-before::after,
.ct-row.is-drop-after::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.ct-row.is-drop-before::after { top: -1px; }
.ct-row.is-drop-after::after { bottom: -1px; }
.ct-row.is-drop-inside {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(232, 163, 61, 0.45);
}

@media (max-width: 768px) {
  .panel-left > .ct-tree { max-height: min(240px, 30vh); }
  .ct-row { height: 30px; }
  .ct-acts { display: flex; }
  .ct-badge { display: none; }
}

/* ==========================================================================
   贴图转粒子（T2P）：提取预览 / 变体 / 手动映射 / 2D 预览 / 应用
   面板结构：#t2p-back 模态 → .t2p-box → 三列（贴图+提取 / 变体+映射 / 预览+诊断）
   ========================================================================== */
.t2p-back {
  position: fixed;
  inset: 0;
  z-index: 64;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 8, 12, 0.84);
}
.t2p-back[hidden] { display: none; }
/* 模态语义：面板打开时锁住背景滚动 */
body.is-t2popen { overflow: hidden; }

.t2p-box {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1220px, 100%);
  max-height: min(880px, 94vh);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.t2p-box.is-busy { cursor: progress; }

.t2p-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.t2p-head h3 {
  margin: 0;
  font: 600 14px/1.4 var(--font-ui);
  color: var(--text);
}
.t2p-sub {
  display: block;
  margin-top: 2px;
  font: 400 11px/1.4 var(--font-ui);
  color: var(--text-3);
}

/* ---- 三列布局：每列独立滚动，整体高度受 .t2p-box 限制 ---- */
.t2p-body {
  flex: 1;
  min-height: 0;
  display: flex;
  padding: 12px 14px 14px;
}
.t2p-cols {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 12px;
}
.t2p-cols[hidden] { display: none; }
.t2p-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding-right: 2px;
}

/* ---- 卡片 ---- */
.t2p-card {
  flex: none;
  padding: 10px;
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
}
.t2p-card h4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
  font: 600 11px/1.4 var(--font-ui);
  color: var(--text-2);
  letter-spacing: 0.03em;
}
.t2p-count {
  font: 400 9.5px/1 var(--font-mono);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.t2p-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.t2p-sec-head h4 { margin: 0; }
.t2p-mini { height: 20px !important; padding: 0 6px !important; font-size: 10px !important; }

/* ---- 当前贴图 ---- */
.t2p-cur {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 92px;
  max-height: 168px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: repeating-conic-gradient(var(--bg-2) 0% 25%, var(--bg-1) 0% 50%) 50% / 12px 12px;
}
.t2p-cur img,
.t2p-cur canvas {
  max-width: 100%;
  max-height: 168px;
  object-fit: contain;
}
.t2p-cur[hidden] { display: none; }
#t2p-cur-img[hidden],
#t2p-cur-cv[hidden] { display: none; }
.t2p-cur-meta {
  font: 400 9.5px/1.4 var(--font-mono);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.t2p-desc {
  margin: 4px 0 0;
  font: 400 10.5px/1.55 var(--font-ui);
  color: var(--text-3);
}
.t2p-desc:empty { display: none; }

/* ---- 贴图缩略条 ---- */
.t2p-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 132px;
  overflow: auto;
}
.t2p-strip-empty {
  padding: 6px 2px;
  font: 400 10px/1.4 var(--font-ui);
  color: var(--text-3);
}
.t2p-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  height: 26px;
  padding: 2px 7px 2px 2px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  color: var(--text-3);
  font: 400 10.5px/1 var(--font-ui);
  cursor: pointer;
}
.t2p-chip:hover { background: var(--bg-hover); color: var(--text); }
.t2p-chip.is-cur {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}
.t2p-chip img {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 3px;
  object-fit: cover;
}
.t2p-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.t2p-chip-no {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 3px;
  background: var(--bg-3);
}

/* ---- 提取结果四宫格 ---- */
.t2p-ex {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.t2p-excell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  margin: 0;
}
.t2p-excell[hidden] { display: none; }
.t2p-excell canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  background: var(--bg-0);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
}
.t2p-excell figcaption {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 25px;
  font: 400 9px/1.35 var(--font-ui);
  color: var(--text-3);
}
.t2p-excell figcaption b {
  font: 600 10px/1.3 var(--font-ui);
  color: var(--text-2);
}
.t2p-excell figcaption span {
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: var(--text-3);
  word-break: break-all;
}

/* ---- 变体卡片 ---- */
.t2p-vars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.t2p-var {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 0 8px 7px;
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  color: var(--text-2);
  cursor: pointer;
  overflow: hidden;
}
.t2p-var:hover { background: var(--bg-hover); border-color: var(--line); }
.t2p-var.is-cur {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.t2p-var-sw {
  display: block;
  height: 5px;
  margin: 0 -8px 5px;
  background: #3a4356;
}
.t2p-var-top {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}
.t2p-var-name {
  overflow: hidden;
  font: 600 11.5px/1.3 var(--font-ui);
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.t2p-var-en {
  flex: none;
  font: 400 8.5px/1.3 var(--font-mono);
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.t2p-var-score {
  flex: none;
  margin-left: auto;
  padding: 0 4px;
  font: 600 9.5px/14px var(--font-mono);
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
}
.t2p-var.is-cur .t2p-var-score {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}
.t2p-var-desc {
  display: -webkit-box;
  overflow: hidden;
  font: 400 10px/1.4 var(--font-ui);
  color: var(--text-2);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.t2p-var-sum {
  display: -webkit-box;
  overflow: hidden;
  font: 400 8.5px/1.35 var(--font-mono);
  color: var(--text-3);
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  word-break: break-all;
}
.t2p-var-empty {
  grid-column: 1 / -1;
  padding: 14px 8px;
  text-align: center;
  font: 400 10.5px/1.4 var(--font-ui);
  color: var(--text-3);
}

/* ---- 手动映射卡片 ---- */
.t2p-maps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.t2p-map {
  padding: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
}
.t2p-map[hidden] { display: none; }
.t2p-map.is-off { opacity: 0.56; }
.t2p-map-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.t2p-map-head .t2p-check { margin-right: auto; }
.t2p-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 600 10.5px/1.4 var(--font-ui);
  color: var(--text-2);
  cursor: pointer;
}
.t2p-check input {
  width: 12px;
  height: 12px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.t2p-check-line { margin-top: 2px; }
.t2p-map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin-top: 7px;
}
.t2p-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  font: 500 10px/1.4 var(--font-ui);
  color: var(--text-3);
}
.t2p-field select,
.t2p-field input[type="number"] {
  width: 100%;
  height: 24px;
  padding: 0 6px;
  font: 400 11px/1 var(--font-ui);
  color: var(--text);
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.t2p-field select:focus,
.t2p-field input:focus {
  outline: none;
  border-color: rgba(232, 163, 61, 0.55);
}
.t2p-field-wide { grid-column: 1 / -1; }
.t2p-range {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1px 6px;
  min-width: 0;
  font: 500 10px/1.4 var(--font-ui);
  color: var(--text-3);
}
.t2p-range b {
  font: 600 9.5px/1 var(--font-mono);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.t2p-range input {
  grid-column: 1 / -1;
  width: 100%;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
}
.t2p-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.t2p-swatches i {
  width: 18px;
  height: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
}
.t2p-sw-none {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  background: var(--bg-3);
}
.t2p-note {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  font: 400 9px/1.5 var(--font-ui);
  color: var(--text-3);
}
.t2p-sheet-manual {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.t2p-sheet-manual[hidden] { display: none; }

/* ---- 右列：2D 预览 / 诊断 / 来源 ---- */
.t2p-preview {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
}
.t2p-preview canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  background: var(--bg-0);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
}
.t2p-preview figcaption {
  font: 400 10px/1.4 var(--font-mono);
  color: var(--text-3);
}
.t2p-diags {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.t2p-diag {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 7px;
  padding: 6px 8px;
  background: var(--bg-2);
  border-left: 2px solid var(--line);
  border-radius: 3px;
  font: 400 10px/1.5 var(--font-ui);
  color: var(--text-2);
}
.t2p-diag b {
  font: 600 9.5px/1.5 var(--font-mono);
  color: var(--text-3);
}
.t2p-diag span { flex: 1; min-width: 0; }
.t2p-diag em {
  flex-basis: 100%;
  font: 400 9px/1.4 var(--font-ui);
  color: var(--text-3);
  font-style: normal;
}
.t2p-diag.err { border-left-color: #e05a4f; background: rgba(224, 90, 79, 0.08); }
.t2p-diag.err b { color: #ea7c72; }
.t2p-diag.warn { border-left-color: var(--accent); background: rgba(232, 163, 61, 0.08); }
.t2p-diag.warn b { color: var(--accent); }
.t2p-diag.info { border-left-color: var(--info); background: rgba(108, 156, 245, 0.07); }
.t2p-diag.info b { color: var(--info); }
.t2p-diag.ok { border-left-color: var(--ok); }
.t2p-diag.ok b { color: var(--ok); }
.t2p-fix {
  height: 20px !important;
  padding: 0 6px !important;
  font-size: 10px !important;
}
.t2p-src {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font: 400 9.5px/1.5 var(--font-mono);
  color: var(--text-3);
  word-break: break-all;
}
.t2p-src-row.is-warn { color: var(--warn); }

/* ---- 页脚：应用模式 + 状态 + 应用键 ---- */
.t2p-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--line-soft);
  background: var(--bg-1);
}
.t2p-hint {
  flex: 1 1 180px;
  font: 400 10px/1.4 var(--font-ui);
  color: var(--text-3);
}
.t2p-modes {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.t2p-radio {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 400 10.5px/1.4 var(--font-ui);
  color: var(--text-2);
  cursor: pointer;
}
.t2p-radio input {
  width: 12px;
  height: 12px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.t2p-radio.is-off { opacity: 0.45; cursor: not-allowed; }
.t2p-mode-hint {
  flex-basis: 100%;
  font: 400 9.5px/1.4 var(--font-ui);
  color: var(--text-3);
}
.t2p-status {
  flex: 0 1 auto;
  max-width: 320px;
  overflow: hidden;
  font: 400 10px/1.4 var(--font-mono);
  color: var(--text-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.t2p-status[data-kind="err"] { color: var(--err); }
.t2p-status[data-kind="warn"] { color: var(--warn); }
.t2p-status[data-kind="ok"] { color: var(--ok); }

/* ---- 空态 / 忙碌遮罩 ---- */
.t2p-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 280px;
  padding: 32px;
  text-align: center;
}
.t2p-empty[hidden] { display: none; }
.t2p-empty b {
  font: 600 14px/1.4 var(--font-ui);
  color: var(--text-2);
}
.t2p-empty span {
  max-width: 440px;
  font: 400 11px/1.7 var(--font-ui);
  color: var(--text-3);
}
.t2p-busy {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(8, 10, 15, 0.62);
  backdrop-filter: blur(2px);
}
.t2p-busy[hidden] { display: none; }
.t2p-busy b {
  font: 600 12px/1.4 var(--font-ui);
  color: var(--text);
}
.t2p-bar {
  display: block;
  width: min(260px, 60%);
  height: 4px;
  overflow: hidden;
  background: var(--bg-3);
  border-radius: 2px;
}
.t2p-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.15s ease;
}

/* ---- 窄屏：两列后单列 ---- */
@media (max-width: 1080px) {
  .t2p-body { overflow: auto; }
  .t2p-cols {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .t2p-col { overflow: visible; }
  .t2p-col:last-child {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }
  .t2p-preview { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .t2p-back { padding: 10px; }
  .t2p-cols { grid-template-columns: minmax(0, 1fr); }
  .t2p-col:last-child { display: flex; }
  .t2p-vars { grid-template-columns: minmax(0, 1fr); }
  .t2p-foot { padding: 8px 12px; }
  .t2p-status { max-width: 100%; }
}

/* ==========================================================================
   复杂粒子视图（Complex View）：全屏生成工作区
   结构：#cv-back 模态 → .cv-box → 头部 / 三列（生成 | 视口 | 检查器）
         / 底部停靠（图层大纲 + 时间轴）/ 状态条
   约定：本段选择器全部以 .cv- / #cv- 开头或限定在 .cv-back 内，
        不改动现有 UI；类名与 src/editor/complexviewpanel.js 的 _mount() 对齐。
   ========================================================================== */

/* ---- 全屏模态 ---- */
.cv-back {
  position: fixed;
  inset: 0;
  z-index: 66;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(6, 8, 12, 0.86);
  backdrop-filter: blur(2px);
}
.cv-back[hidden] { display: none; }
/* 模态语义：面板打开时锁住背景滚动 */
body.is-cvopen { overflow: hidden; }

.cv-box {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1680px, 95vw);
  height: min(1040px, 94vh);
  min-height: 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 26px 72px rgba(0, 0, 0, 0.66);
  overflow: hidden;
}
.cv-back.is-busy { cursor: progress; }
.cv-back.is-busy .cv-head button { cursor: progress; }

/* ---- 头部：标题 / 副标题 / 操作组 ---- */
.cv-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 14px;
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  border-bottom: 1px solid var(--line-soft);
}
.cv-title { min-width: 0; }
.cv-title h3 {
  margin: 0;
  font: 600 14px/1.4 var(--font-ui);
  color: var(--text);
  letter-spacing: 0.01em;
}
.cv-sub {
  display: block;
  max-width: min(560px, 52vw);
  margin-top: 2px;
  overflow: hidden;
  font: 400 10.5px/1.45 var(--font-ui);
  color: var(--text-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}
#cv-sub { transition: color 0.12s; }

.cv-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.cv-actions .ghost-btn,
.cv-actions .primary-btn {
  height: 25px;
  padding: 0 9px;
  font-size: 11px;
  white-space: nowrap;
}
.cv-actions .primary-btn { font-weight: 600; }
#cv-regen, #cv-apply { min-width: 0; }
#cv-apply { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset; }
#cv-apply:disabled { box-shadow: none; }
#cv-play[data-on="0"] { color: var(--text-3); }
#cv-play-t { font-variant-numeric: tabular-nums; }
#cv-file { display: none; }
#cv-close:hover { border-color: var(--line); }
#cv-export, #cv-import, #cv-save { color: var(--text-2); }

.cv-pick {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 500 10px/1.4 var(--font-ui);
  color: var(--text-3);
  white-space: nowrap;
}
.cv-pick .mini-select {
  width: 92px;
  height: 25px;
  font-size: 11px;
}
.cv-act-sep {
  flex: none;
  width: 1px;
  height: 16px;
  margin: 0 2px;
  background: var(--line);
}

/* ---- 三列主体 ---- */
.cv-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 340px;
  gap: 10px;
  padding: 10px 12px;
  overflow: hidden;
}
.cv-gen,
.cv-insp {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: #2b3242 transparent;
}
.cv-gen::-webkit-scrollbar,
.cv-insp::-webkit-scrollbar { width: 8px; }

/* ---- 卡片 / 小标题 / 计数 ---- */
.cv-card {
  flex: none;
  padding: 9px 10px 10px;
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
}
.cv-card h4 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
  font: 600 11px/1.4 var(--font-ui);
  color: var(--text-2);
  letter-spacing: 0.03em;
}
.cv-count {
  margin-left: auto;
  font: 400 9.5px/1 var(--font-mono);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cv-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.cv-sec-head h4 { margin: 0; }
.cv-mini {
  height: 20px !important;
  padding: 0 6px !important;
  font-size: 10px !important;
}
.cv-muted {
  margin: 4px 0 0;
  font: 400 10px/1.55 var(--font-ui);
  color: var(--text-3);
}
.cv-gen-hint {
  margin-top: 2px;
  padding-top: 7px;
  border-top: 1px dashed var(--line-soft);
}

/* ---- 左列：模板卡 ---- */
.cv-tpls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 224px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2b3242 transparent;
}
.cv-tpls::-webkit-scrollbar { width: 8px; }
.cv-tpl {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 0 8px 7px;
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  color: var(--text-2);
  cursor: pointer;
  overflow: hidden;
  transition: background 0.12s, border-color 0.12s;
}
.cv-tpl:hover { background: var(--bg-hover); border-color: var(--line); }
.cv-tpl.is-cur {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(232, 163, 61, 0.16);
}
.cv-tpl:active { transform: translateY(0.5px); }
.cv-tpl:disabled { opacity: 0.5; cursor: not-allowed; }
.cv-tpl-swatch {
  position: relative;
  display: block;
  height: 26px;
  margin: 0 -8px 5px;
  overflow: hidden;
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
}
.cv-tpl-swatch::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 28% 72%, rgba(255, 255, 255, 0.5) 0 5%, transparent 32%),
    radial-gradient(circle at 64% 38%, rgba(255, 255, 255, 0.32) 0 4%, transparent 26%);
  mix-blend-mode: screen;
  opacity: 0.75;
  pointer-events: none;
}
.cv-tpl-meta {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}
.cv-tpl-name {
  overflow: hidden;
  font: 600 11px/1.3 var(--font-ui);
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cv-tpl.is-cur .cv-tpl-name { color: var(--accent); }
.cv-tpl-en {
  flex: none;
  font: 400 8px/1.3 var(--font-mono);
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cv-tpl-desc {
  display: -webkit-box;
  overflow: hidden;
  font: 400 9.5px/1.4 var(--font-ui);
  color: var(--text-3);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.cv-tpl:hover .cv-tpl-desc { color: var(--text-2); }

/* ---- 左列：生成参数 ---- */
.cv-seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  margin-bottom: 9px;
  padding: 2px;
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.cv-seg-btn {
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--text-3);
  font: 550 10.5px/1 var(--font-ui);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.cv-seg-btn:hover { background: var(--bg-hover); color: var(--text); }
.cv-seg-btn.is-cur {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.cv-seg-btn:active { transform: translateY(0.5px); }
#cv-complexity { user-select: none; }

.cv-range {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1px 6px;
  margin: 0 0 9px;
  font: 500 10px/1.4 var(--font-ui);
  color: var(--text-3);
}
.cv-range > span {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.cv-range b {
  font: 600 9.5px/1 var(--font-mono);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.cv-range input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
}
#cv-density, #cv-events { margin-top: 1px; }
#cv-density-v, #cv-events-v, #cv-l-share-v, #cv-cam-fov-v { min-width: 30px; text-align: right; }

.cv-grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 8px;
  margin-bottom: 9px;
}
.cv-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  font: 500 10px/1.4 var(--font-ui);
  color: var(--text-3);
}
.cv-field select,
.cv-field input[type="text"],
.cv-field input[type="number"] {
  width: 100%;
  min-width: 0;
  height: 23px;
  font-size: 10.5px;
}
.cv-field input[type="text"],
.cv-field input[type="number"] { padding: 0 5px; }
.cv-field input[readonly] { color: var(--text-2); cursor: default; background: var(--bg-2); }
.cv-field input[readonly]:hover { border-color: var(--line); }
#cv-motion, #cv-palette { width: 100%; }
#cv-seed { font-family: var(--font-mono); }
#cv-gen-hint { grid-column: 1 / -1; }

.cv-seed {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 6px;
  margin-bottom: 2px;
}
.cv-seed .ghost-btn { height: 23px; padding: 0 8px; font-size: 10.5px; }

/* ---- 左列：变体卡 ---- */
.cv-variants {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 198px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2b3242 transparent;
}
.cv-variants::-webkit-scrollbar { width: 8px; }
.cv-var {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 0 8px 6px;
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  color: var(--text-2);
  cursor: pointer;
  overflow: hidden;
  transition: background 0.12s, border-color 0.12s;
}
.cv-var:hover { background: var(--bg-hover); border-color: var(--line); }
.cv-var.is-cur {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(232, 163, 61, 0.16);
}
.cv-var:active { transform: translateY(0.5px); }
.cv-var-swatch {
  display: block;
  height: 4px;
  margin: 0 -8px 5px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
}
.cv-var-head {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}
.cv-var-name {
  overflow: hidden;
  font: 600 11px/1.3 var(--font-ui);
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cv-var-score {
  flex: none;
  margin-left: auto;
  padding: 0 4px;
  font: 600 9px/13px var(--font-mono);
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
}
.cv-var.is-cur .cv-var-score {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}
.cv-var-desc {
  display: -webkit-box;
  overflow: hidden;
  font: 400 9.5px/1.4 var(--font-ui);
  color: var(--text-3);
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.cv-var-meta {
  overflow: hidden;
  font: 400 9px/1.35 var(--font-mono);
  color: var(--text-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}
#cv-var-count, #cv-tpl-count, #cv-layers-count, #cv-tl-dur,
#cv-post-count, #cv-ev-count, #cv-l-tag { font-variant-numeric: tabular-nums; }

/* ---- 左列：生成报告 ---- */
.cv-report {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
}
.cv-rep-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 10px;
  align-items: baseline;
  font: 400 10px/1.5 var(--font-ui);
}
.cv-rep-grid span { color: var(--text-3); white-space: nowrap; }
.cv-rep-grid b {
  overflow: hidden;
  color: var(--text-2);
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
}
.cv-rep-block {
  margin-top: 7px;
  padding: 6px 8px;
  background: var(--bg-2);
  border-left: 2px solid var(--line);
  border-radius: 3px;
}
.cv-rep-block em {
  font: 600 9.5px/1.4 var(--font-mono);
  font-style: normal;
  color: var(--text-2);
}
.cv-rep-block em.is-warn { color: var(--warn); }
.cv-rep-block em.is-err { color: var(--err); }
.cv-rep-block ul {
  margin: 4px 0 0;
  padding-left: 14px;
  list-style: disc;
}
.cv-rep-block li {
  font: 400 9.5px/1.5 var(--font-ui);
  color: var(--text-2);
  word-break: break-word;
}
.cv-warns {
  margin: 3px 0 0;
  font: 400 9.5px/1.5 var(--font-ui);
  color: var(--warn);
  word-break: break-word;
}
.cv-warns:empty { display: none; }
#cv-view-warn { color: var(--warn); }

/* ---- 中列：视口舞台 ---- */
.cv-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(115% 85% at 50% 40%, #151a25 0%, #0b0e14 58%, #070910 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.cv-gl,
.cv-post,
.cv-overlay {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.cv-gl { z-index: 1; cursor: grab; }
.cv-gl.is-dragging { cursor: grabbing; }
.cv-gl.is-hidden-by-post { visibility: hidden; }
.cv-post {
  z-index: 2;
  pointer-events: none;
}
.cv-post[hidden] { display: none; }
.cv-overlay {
  z-index: 3;
  pointer-events: none;
}
.cv-stage.is-post { box-shadow: inset 0 0 0 1px rgba(108, 156, 245, 0.28); }
.cv-stage.is-post::after {
  content: "POST";
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 6;
  padding: 3px 5px;
  font: 600 8px/1 var(--font-mono);
  letter-spacing: 0.14em;
  color: rgba(139, 178, 255, 0.9);
  background: rgba(12, 15, 21, 0.62);
  border: 1px solid rgba(108, 156, 245, 0.38);
  border-radius: 3px;
  pointer-events: none;
}
.cv-stage.is-fallback .cv-gl,
.cv-stage.is-fallback .cv-overlay { opacity: 0.25; }
.cv-stage.is-fallback .cv-hud { opacity: 0.6; }

.cv-hud {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  max-width: calc(100% - 78px);
  overflow: hidden;
  background: rgba(12, 15, 21, 0.72);
  border: 1px solid rgba(58, 68, 88, 0.55);
  border-radius: 8px;
  backdrop-filter: blur(10px);
  pointer-events: none;
}
.cv-hud-cell {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 5px 8px;
  font-family: var(--font-mono);
  white-space: nowrap;
}
.cv-hud-cell + .cv-hud-cell { border-left: 1px solid rgba(58, 68, 88, 0.4); }
.cv-hud-cell b {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.cv-hud-cell i {
  font-size: 9px;
  font-style: normal;
  color: var(--text-3);
}
#cv-hud-fps { color: var(--ok); }
#cv-hud-points, #cv-hud-layers, #cv-hud-draws, #cv-hud-budget,
#cv-hud-chapter, #cv-hud-events { font-variant-numeric: tabular-nums; }

.cv-hint {
  position: absolute;
  right: 12px;
  bottom: 9px;
  left: 12px;
  z-index: 6;
  overflow: hidden;
  font: 400 9.5px/1.4 var(--font-mono);
  color: rgba(120, 134, 160, 0.78);
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}
.cv-fallback,
.cv-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: min(520px, 86%);
  padding: 14px 18px;
  text-align: center;
  background: rgba(10, 13, 19, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  transform: translate(-50%, -50%);
}
.cv-fallback[hidden],
.cv-empty[hidden] { display: none; }
.cv-fallback { border-color: rgba(232, 163, 61, 0.45); }
.cv-fallback b {
  font: 600 12px/1.4 var(--font-ui);
  color: var(--accent);
}
.cv-fallback span {
  font: 400 10.5px/1.65 var(--font-ui);
  color: var(--text-2);
  word-break: break-word;
}
.cv-empty { border-color: rgba(108, 156, 245, 0.4); }
.cv-empty b {
  font: 600 12px/1.4 var(--font-ui);
  color: var(--info);
}
.cv-empty span {
  font: 400 10.5px/1.65 var(--font-ui);
  color: var(--text-2);
  word-break: break-word;
}
#cv-fallback-msg, #cv-empty-s { max-height: 132px; overflow: auto; }
#cv-empty-t { letter-spacing: 0.02em; }

/* ---- 右列：检查器 ---- */
.cv-insp-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
#cv-l-preset { font-family: var(--font-mono); font-size: 9.5px; }
.cv-checks {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  min-height: 18px;
}
.cv-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 500 10.5px/1.4 var(--font-ui);
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
}
.cv-check input {
  width: 12px;
  height: 12px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.cv-check input:disabled { cursor: not-allowed; }
.cv-checks .cv-muted { margin: 0; font-size: 9.5px; }
#cv-cam-chapter { color: var(--text-3); }

.cv-vec {
  display: grid;
  grid-template-columns: 34px repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 4px 5px;
  margin-bottom: 6px;
}
.cv-vec > span {
  font: 500 9.5px/1.4 var(--font-ui);
  color: var(--text-3);
  white-space: nowrap;
}
.cv-vec input[type="number"] {
  width: 100%;
  height: 22px;
  padding: 0 4px;
  text-align: center;
  font-size: 10px;
}
.cv-vec input:disabled { opacity: 0.45; cursor: not-allowed; }
#cv-l-px, #cv-l-py, #cv-l-pz,
#cv-l-rx, #cv-l-ry, #cv-l-rz,
#cv-l-sx, #cv-l-sy, #cv-l-sz { font-variant-numeric: tabular-nums; }
#cv-l-name { font-family: var(--font-ui); font-size: 11px; }

/* 图层锁定时检查器整体提示（面板在 #cv-back 上挂 cv-layer-locked） */
.cv-back.cv-layer-locked .cv-insp-body .cv-field,
.cv-back.cv-layer-locked .cv-insp-body .cv-vec { opacity: 0.72; }
.cv-back.cv-layer-locked #cv-l-lock { cursor: pointer; }

/* ---- 右列：相机 / 后处理 ---- */
#cv-cam-rig { width: 100%; }
#cv-cam-fov { margin-top: 1px; }
.cv-postfx {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}
.cv-post-row {
  padding: 7px 8px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  transition: opacity 0.12s, border-color 0.12s;
}
.cv-post-row:hover { border-color: var(--line); }
.cv-post-row.is-off { opacity: 0.62; }
.cv-post-row.is-off:hover { opacity: 0.8; }
.cv-post-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  cursor: pointer;
}
.cv-post-head input {
  width: 12px;
  height: 12px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.cv-post-head b {
  overflow: hidden;
  font: 600 10.5px/1.4 var(--font-ui);
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cv-post-row.is-off .cv-post-head b { color: var(--text-3); }
.cv-post-params {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
  margin-top: 6px;
}
.cv-post-row.is-off .cv-post-params { opacity: 0.55; }
.cv-post-params .cv-range { margin: 0; }
.cv-range.cv-param { margin: 0; }
.cv-param b { font-size: 9px; color: var(--text-3); }
.cv-param input[type="range"] { height: 12px; }

/* ---- 右列：事件列表 ---- */
.cv-events {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 176px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2b3242 transparent;
}
.cv-events::-webkit-scrollbar { width: 8px; }
#cv-event-list { font-family: var(--font-mono); }
.cv-ev {
  display: grid;
  grid-template-columns: 42px minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 3px 6px;
  text-align: left;
  background: var(--bg-2);
  border: 1px solid transparent;
  border-left: 2px solid var(--line);
  border-radius: 3px;
  color: var(--text-2);
  font: 400 9.5px/1.4 var(--font-mono);
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}
.cv-ev:hover { background: var(--bg-hover); border-color: var(--line); }
.cv-ev:active { transform: translateY(0.5px); }
.cv-ev-t {
  font-size: 9px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.cv-ev-a {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cv-ev-g {
  overflow: hidden;
  font-size: 8.5px;
  color: var(--text-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cv-ev.is-dropped { opacity: 0.55; border-left-color: var(--err); }
.cv-ev.is-dropped .cv-ev-a { color: var(--text-3); text-decoration: line-through; }
.cv-view-stats {
  margin-top: 0;
  font: 400 9px/1.5 var(--font-mono);
  color: var(--text-3);
  word-break: break-all;
}
#cv-view-name { font-family: var(--font-ui); font-size: 11px; }

/* ---- 底部停靠：图层大纲 + 时间轴 ---- */
.cv-dock {
  flex: none;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 10px;
  height: 190px;
  min-height: 0;
  padding: 0 12px 10px;
}
.cv-dock-layers,
.cv-dock-tl {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 7px 9px 8px;
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  overflow: hidden;
}
.cv-dock-head {
  flex: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.cv-dock-head h4 {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
  font: 600 10.5px/1.4 var(--font-ui);
  color: var(--text-2);
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.cv-dock-hint {
  overflow: hidden;
  font: 400 9px/1.4 var(--font-ui);
  color: var(--text-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cv-layers {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 1px;
  scrollbar-width: thin;
  scrollbar-color: #2b3242 transparent;
}
.cv-layers::-webkit-scrollbar { width: 8px; }
.cv-layer {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 6px 0 2px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  transition: background 0.1s, border-color 0.1s;
}
.cv-layer:hover { background: var(--bg-2); }
.cv-layer.is-sel {
  background: var(--accent-soft);
  border-color: rgba(232, 163, 61, 0.4);
}
.cv-layer.is-off .cv-layer-name {
  opacity: 0.62;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.cv-layer.is-off .cv-layer-preset,
.cv-layer.is-off .cv-layer-pts,
.cv-layer.is-off .cv-layer-share { opacity: 0.5; }
.cv-layer.is-locked { color: var(--text-3); }
.cv-layer.is-missing .cv-layer-name { color: var(--warn); }
.cv-layer.is-dragging { opacity: 0.45; }
.cv-layer.is-drop-before::after,
.cv-layer.is-drop-after::after {
  content: "";
  position: absolute;
  right: 6px;
  left: 6px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  pointer-events: none;
}
.cv-layer.is-drop-before::after { top: -1px; }
.cv-layer.is-drop-after::after { bottom: -1px; }
.cv-layer.is-sel .cv-layer-name { color: var(--text); font-weight: 600; }

.cv-layer-grip {
  flex: none;
  width: 12px;
  font: 700 9px/1 var(--font-mono);
  color: var(--text-3);
  letter-spacing: -1px;
  text-align: center;
  cursor: grab;
}
.cv-layer[draggable="false"] .cv-layer-grip { cursor: not-allowed; opacity: 0.35; }
.cv-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-3);
  font-size: 10.5px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.cv-icon:hover { background: var(--bg-hover); color: var(--text); }
.cv-icon.is-on { color: var(--accent); background: var(--accent-soft); }
.cv-layer-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font: 500 10.5px/1.4 var(--font-ui);
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cv-layer-preset {
  flex: 0 1 118px;
  min-width: 0;
  overflow: hidden;
  font: 400 9px/1.4 var(--font-mono);
  color: var(--text-3);
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cv-layer-pts {
  flex: none;
  width: 50px;
  font: 400 9.5px/1.4 var(--font-mono);
  color: var(--text-2);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.cv-layer-share {
  flex: none;
  width: 54px;
  height: 5px;
  overflow: hidden;
  background: var(--bg-3);
  border-radius: 3px;
}
.cv-layer-share i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--info), var(--accent));
  border-radius: inherit;
  transition: width 0.12s ease;
}
.cv-layers-empty {
  padding: 10px 2px;
  font-size: 10.5px;
  text-align: center;
}

.cv-tl-legend {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 6px;
  min-width: 0;
  font: 400 8.5px/1.4 var(--font-ui);
  color: var(--text-3);
  white-space: nowrap;
}
.cv-lg {
  display: inline-block;
  flex: none;
  width: 7px;
  height: 7px;
  margin-right: 2px;
  border-radius: 2px;
}
.cv-lg-intro { background: #6c9cf5; }
.cv-lg-loop { background: #4ec9a0; }
.cv-lg-outro { background: #e8a33d; }
.cv-lg-ev {
  background: #e5657a;
  border-radius: 1px;
  transform: rotate(45deg) scale(0.9);
}
.cv-lg-cam { background: #e8a33d; border-radius: 50%; }
.cv-timeline {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  background: var(--bg-0);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  cursor: ew-resize;
  touch-action: none;
}
#cv-timeline:active { cursor: grabbing; }

/* ---- 状态条 ---- */
.cv-status {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 28px;
  padding: 0 14px;
  overflow: hidden;
  background: var(--bg-1);
  border-top: 1px solid var(--line-soft);
  font: 400 10px/1.4 var(--font-mono);
  color: var(--text-3);
  white-space: nowrap;
}
#cv-status-profile,
#cv-status-budget,
#cv-status-degrade,
#cv-status-warn,
#cv-status-play {
  flex: none;
  font-variant-numeric: tabular-nums;
}
#cv-status-profile { color: var(--text-2); }
#cv-status-budget { color: var(--text-2); }
#cv-status-degrade.is-warn { color: var(--warn); }
#cv-status-degrade.is-err { color: var(--err); }
#cv-status-warn.is-warn { color: var(--warn); }
#cv-status-warn.is-err { color: var(--err); }
#cv-status-play { color: var(--ok); }
.cv-status-msg {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  color: var(--text-3);
}
.cv-status-msg[data-kind="ok"] { color: var(--ok); }
.cv-status-msg[data-kind="warn"] { color: var(--warn); }
.cv-status-msg[data-kind="err"] { color: var(--err); }
#cv-status-msg:empty { opacity: 0; }

/* ---- 交互态：焦点 / 禁用 / 滚动条 ---- */
.cv-back button:focus-visible,
.cv-back input:focus-visible,
.cv-back select:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}
.cv-back button:disabled,
.cv-back select:disabled,
.cv-back input:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}
.cv-back input[type="range"]:disabled { accent-color: var(--text-3); }
.cv-back ::selection { background: rgba(232, 163, 61, 0.28); }

/* ---- id 级兜底（JS 主要按 id 更新节点；外观以 class 为主，这里补动态态） ---- */
#cv-templates { max-height: 224px; }
#cv-profile { font-size: 10.5px; }
#cv-campath { font-variant-numeric: tabular-nums; }
#cv-canvas { cursor: grab; }
#cv-canvas.is-dragging { cursor: grabbing; }
#cv-l-name { font-weight: 500; }
#cv-l-blend { font-size: 10.5px; }
#cv-l-vis,
#cv-l-lock,
#cv-cam-path { accent-color: var(--accent); }
#cv-l-share { accent-color: var(--accent); }
#cv-stage { isolation: isolate; }
#cv-hud { user-select: none; }
#cv-post,
#cv-overlay { pointer-events: none; }
#cv-variants,
#cv-report,
#cv-postfx,
#cv-layers,
#cv-view-stats,
#cv-fallback,
#cv-empty { min-width: 0; }

/* ---- 窄屏：压缩三列 → 检查器换行 → 单列 ---- */
@media (max-width: 1280px) {
  .cv-body { grid-template-columns: 292px minmax(0, 1fr) 312px; }
  .cv-dock { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .cv-layer-preset { flex-basis: 88px; }
  .cv-hud-cell { padding: 4px 7px; }
}

@media (max-width: 1180px) {
  .cv-back { padding: 10px; }
  .cv-box { width: 97vw; height: 93vh; }
  .cv-body {
    grid-template-columns: 278px minmax(0, 1fr);
    grid-template-rows: minmax(340px, 1fr) auto;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #2b3242 transparent;
  }
  .cv-gen { max-height: 520px; }
  .cv-insp {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 8px;
    overflow: visible;
    max-height: none;
  }
  .cv-stage { min-height: 340px; }
  .cv-dock { height: 168px; }
  .cv-dock-hint { display: none; }
  .cv-hud { max-width: calc(100% - 64px); }
  .cv-sub { max-width: 70vw; }
}

@media (max-width: 900px) {
  .cv-head { align-items: flex-start; flex-direction: column; }
  .cv-actions { justify-content: flex-start; }
  .cv-sub { max-width: 88vw; white-space: normal; }
  .cv-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(300px, 1fr) auto;
  }
  .cv-gen {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    max-height: 300px;
  }
  .cv-gen > .cv-card:first-child { grid-column: 1 / -1; }
  .cv-insp { grid-template-columns: minmax(0, 1fr); }
  .cv-dock {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(96px, 1fr) 108px;
    height: 236px;
  }
  .cv-act-sep { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cv-back *,
  .cv-back *::before,
  .cv-back *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ==========================================================================
   星云生成器（Nebula）：全屏生成工作区
   结构：#nb-back 模态 → .nb-box → 头部 / 三列（生成 | 星云视口 | 检查器）/ 状态条
   约定：本段选择器全部以 .nb- / #nb- 开头或限定在 .nb-back 内，
        不改动现有 UI；类名与 src/editor/nebulapanel.js 的 _mount() 对齐。
   ========================================================================== */

/* ---- 全屏模态 ---- */
.nb-back {
  position: fixed;
  inset: 0;
  z-index: 67;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(5, 7, 12, 0.88);
  backdrop-filter: blur(2px);
}
.nb-back[hidden] { display: none; }
/* 模态语义：面板打开时锁住背景滚动 */
body.is-nbopen { overflow: hidden; }

.nb-box {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1720px, 96vw);
  height: min(1060px, 94vh);
  min-height: 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 26px 72px rgba(0, 0, 0, 0.66);
  overflow: hidden;
}
.nb-back.is-busy { cursor: progress; }
.nb-back.is-busy .nb-head button { cursor: progress; }

/* ---- 头部：标题 / 副标题 / 操作组 ---- */
.nb-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 14px;
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  border-bottom: 1px solid var(--line-soft);
}
.nb-title { min-width: 0; }
.nb-title h3 {
  margin: 0;
  font: 600 14px/1.4 var(--font-ui);
  color: var(--text);
  letter-spacing: 0.01em;
}
.nb-sub {
  display: block;
  max-width: min(560px, 52vw);
  margin-top: 2px;
  overflow: hidden;
  font: 400 10.5px/1.45 var(--font-ui);
  color: var(--text-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}
#nb-sub { transition: color 0.12s; }

.nb-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.nb-actions .ghost-btn,
.nb-actions .primary-btn {
  height: 25px;
  padding: 0 9px;
  font-size: 11px;
  white-space: nowrap;
}
.nb-actions .primary-btn { font-weight: 600; }
#nb-regen, #nb-apply, #nb-toview { min-width: 0; }
#nb-apply { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset; }
#nb-apply:disabled { box-shadow: none; }
#nb-drift[data-on="0"] { color: var(--text-3); }
#nb-file { display: none; }
#nb-close:hover { border-color: var(--line); }
#nb-export, #nb-import, #nb-save, #nb-toview { color: var(--text-2); }

.nb-pick {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 500 10px/1.4 var(--font-ui);
  color: var(--text-3);
  white-space: nowrap;
}
.nb-pick .mini-select {
  width: 92px;
  height: 25px;
  font-size: 11px;
}
.nb-act-sep {
  flex: none;
  width: 1px;
  height: 16px;
  margin: 0 2px;
  background: var(--line);
}

/* ---- 三列主体 ---- */
.nb-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr) 352px;
  gap: 10px;
  padding: 10px 12px;
  overflow: hidden;
}
.nb-gen,
.nb-insp {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: #2b3242 transparent;
}
.nb-gen::-webkit-scrollbar,
.nb-insp::-webkit-scrollbar { width: 8px; }

/* ---- 卡片 / 小标题 / 计数 ---- */
.nb-card {
  flex: none;
  padding: 9px 10px 10px;
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
}
.nb-card h4 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
  font: 600 11px/1.4 var(--font-ui);
  color: var(--text-2);
  letter-spacing: 0.03em;
}
.nb-count {
  margin-left: auto;
  font: 400 9.5px/1 var(--font-mono);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.nb-muted {
  margin: 4px 0 0;
  font: 400 10px/1.55 var(--font-ui);
  color: var(--text-3);
}
.nb-gen-hint {
  margin-top: 2px;
  padding-top: 7px;
  border-top: 1px dashed var(--line-soft);
}

/* ---- 左列：星云类型卡 ---- */
.nb-types {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 252px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2b3242 transparent;
}
.nb-types::-webkit-scrollbar { width: 8px; }
.nb-type {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 0 8px 7px;
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  color: var(--text-2);
  cursor: pointer;
  overflow: hidden;
  transition: background 0.12s, border-color 0.12s;
}
.nb-type:hover { background: var(--bg-hover); border-color: var(--line); }
.nb-type.is-cur {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(232, 163, 61, 0.16);
}
.nb-type:active { transform: translateY(0.5px); }
.nb-type:disabled { opacity: 0.5; cursor: not-allowed; }
.nb-type-swatch {
  position: relative;
  display: block;
  height: 30px;
  margin: 0 -8px 5px;
  overflow: hidden;
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
}
.nb-type-swatch::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 68%, rgba(255, 255, 255, 0.5) 0 5%, transparent 34%),
    radial-gradient(circle at 66% 36%, rgba(255, 255, 255, 0.3) 0 4%, transparent 28%);
  mix-blend-mode: screen;
  opacity: 0.75;
  pointer-events: none;
}
.nb-type-meta {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}
.nb-type-name {
  overflow: hidden;
  font: 600 11px/1.3 var(--font-ui);
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nb-type.is-cur .nb-type-name { color: var(--accent); }
.nb-type-en {
  flex: none;
  font: 400 8px/1.3 var(--font-mono);
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.nb-type-desc {
  display: -webkit-box;
  overflow: hidden;
  font: 400 9.5px/1.4 var(--font-ui);
  color: var(--text-3);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.nb-type:hover .nb-type-desc { color: var(--text-2); }

/* ---- 左列：生成参数 ---- */
.nb-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  margin-bottom: 8px;
  font: 500 10px/1.4 var(--font-ui);
  color: var(--text-3);
}
.nb-field:last-child { margin-bottom: 0; }
.nb-field select,
.nb-field input[type="text"],
.nb-field input[type="number"] {
  width: 100%;
  min-width: 0;
  height: 23px;
  font-size: 10.5px;
}
.nb-field input[type="text"],
.nb-field input[type="number"] { padding: 0 5px; }
.nb-field input[readonly] { color: var(--text-2); cursor: default; background: var(--bg-2); }
.nb-field input[readonly]:hover { border-color: var(--line); }
#nb-seed { font-family: var(--font-mono); }
#nb-palette, #nb-quality { width: 100%; }
#nb-noise-type { width: 100%; }

.nb-pal-swatch {
  display: block;
  height: 8px;
  margin: -2px 0 9px;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.nb-seed {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 6px;
}
.nb-seed .nb-field { margin-bottom: 8px; }
.nb-seed .ghost-btn { height: 23px; padding: 0 8px; font-size: 10.5px; margin-bottom: 8px; }

.nb-range {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1px 6px;
  margin: 0 0 9px;
  font: 500 10px/1.4 var(--font-ui);
  color: var(--text-3);
}
.nb-range > span {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.nb-range b {
  font: 600 9.5px/1 var(--font-mono);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.nb-range input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
}
.nb-range input[type="range"]:disabled { accent-color: var(--text-3); }
#nb-density-v, #nb-turb-v, #nb-layer-count-v, #nb-stars-v, #nb-glow-v, #nb-exposure-v,
#nb-noise-oct-v, #nb-noise-scale-v, #nb-noise-warp-v,
#nb-star-count-v, #nb-star-bright-v,
#nb-l-density-v, #nb-l-hdr-v, #nb-l-depth-v { min-width: 42px; text-align: right; }

.nb-grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 8px;
}
.nb-grid2 .nb-field { margin-bottom: 0; }

/* ---- 左列：变体卡 ---- */
.nb-variants {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 210px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2b3242 transparent;
}
.nb-variants::-webkit-scrollbar { width: 8px; }
.nb-var {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 0 8px 6px;
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  color: var(--text-2);
  cursor: pointer;
  overflow: hidden;
  transition: background 0.12s, border-color 0.12s;
}
.nb-var:hover { background: var(--bg-hover); border-color: var(--line); }
.nb-var.is-cur {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(232, 163, 61, 0.16);
}
.nb-var:active { transform: translateY(0.5px); }
.nb-var-swatch {
  display: block;
  height: 4px;
  margin: 0 -8px 5px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
}
.nb-var-head {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}
.nb-var-name {
  overflow: hidden;
  font: 600 11px/1.3 var(--font-ui);
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nb-var-score {
  flex: none;
  margin-left: auto;
  padding: 0 4px;
  font: 600 9px/13px var(--font-mono);
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
}
.nb-var.is-cur .nb-var-score {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}
.nb-var-desc {
  display: -webkit-box;
  overflow: hidden;
  font: 400 9.5px/1.4 var(--font-ui);
  color: var(--text-3);
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.nb-var-meta {
  overflow: hidden;
  font: 400 9px/1.35 var(--font-mono);
  color: var(--text-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}
#nb-var-count, #nb-type-count, #nb-l-tag, #nb-post-count { font-variant-numeric: tabular-nums; }

/* ---- 左列：生成报告 ---- */
.nb-report {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
}
.nb-rep-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 10px;
  align-items: baseline;
  font: 400 10px/1.5 var(--font-ui);
}
.nb-rep-grid span { color: var(--text-3); white-space: nowrap; }
.nb-rep-grid b {
  overflow: hidden;
  color: var(--text-2);
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
}
.nb-rep-block {
  margin-top: 7px;
  padding: 6px 8px;
  background: var(--bg-2);
  border-left: 2px solid var(--line);
  border-radius: 3px;
}
.nb-rep-block em {
  font: 600 9.5px/1.4 var(--font-mono);
  font-style: normal;
  color: var(--text-2);
}
.nb-rep-block em.is-warn { color: var(--warn); }
.nb-rep-block em.is-err { color: var(--err); }
.nb-rep-block ul {
  margin: 4px 0 0;
  padding-left: 14px;
  list-style: disc;
}
.nb-rep-block li {
  font: 400 9.5px/1.5 var(--font-ui);
  color: var(--text-2);
  word-break: break-word;
}

/* ---- 中列：星云视口 ---- */
.nb-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 38%, #141a28 0%, #0a0d15 56%, #05070c 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
  isolation: isolate;
}
.nb-gl,
.nb-post,
.nb-overlay {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.nb-gl { z-index: 1; cursor: grab; }
.nb-gl.is-dragging { cursor: grabbing; }
.nb-gl.is-hidden-by-post { visibility: hidden; }
.nb-post {
  z-index: 2;
  pointer-events: none;
}
.nb-post[hidden] { display: none; }
.nb-overlay {
  z-index: 3;
  pointer-events: none;
}
.nb-stage.is-post { box-shadow: inset 0 0 0 1px rgba(108, 156, 245, 0.28); }
.nb-stage.is-post::after {
  content: "POST";
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 6;
  padding: 3px 5px;
  font: 600 8px/1 var(--font-mono);
  letter-spacing: 0.14em;
  color: rgba(139, 178, 255, 0.9);
  background: rgba(12, 15, 21, 0.62);
  border: 1px solid rgba(108, 156, 245, 0.38);
  border-radius: 3px;
  pointer-events: none;
}
.nb-stage.is-fallback .nb-gl,
.nb-stage.is-fallback .nb-overlay { opacity: 0.22; }
.nb-stage.is-fallback .nb-hud { opacity: 0.6; }

.nb-hud {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  max-width: calc(100% - 78px);
  overflow: hidden;
  background: rgba(12, 15, 21, 0.72);
  border: 1px solid rgba(58, 68, 88, 0.55);
  border-radius: 8px;
  backdrop-filter: blur(10px);
  pointer-events: none;
  user-select: none;
}
.nb-hud-cell {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 5px 8px;
  font-family: var(--font-mono);
  white-space: nowrap;
}
.nb-hud-cell + .nb-hud-cell { border-left: 1px solid rgba(58, 68, 88, 0.4); }
.nb-hud-cell b {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.nb-hud-cell i {
  font-size: 9px;
  font-style: normal;
  color: var(--text-3);
}
#nb-hud-fps { color: var(--ok); }
#nb-hud-points, #nb-hud-layers, #nb-hud-draws, #nb-hud-overdraw, #nb-hud-quality {
  font-variant-numeric: tabular-nums;
}
#nb-hud-quality { color: var(--info); }

.nb-hint {
  position: absolute;
  right: 12px;
  bottom: 9px;
  left: 12px;
  z-index: 6;
  overflow: hidden;
  font: 400 9.5px/1.4 var(--font-mono);
  color: rgba(120, 134, 160, 0.78);
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}
.nb-fallback,
.nb-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: min(540px, 86%);
  padding: 14px 18px;
  text-align: center;
  background: rgba(10, 13, 19, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  transform: translate(-50%, -50%);
}
.nb-fallback[hidden],
.nb-empty[hidden] { display: none; }
.nb-fallback { border-color: rgba(232, 163, 61, 0.45); }
.nb-fallback b {
  font: 600 12px/1.4 var(--font-ui);
  color: var(--accent);
}
.nb-fallback span {
  font: 400 10.5px/1.65 var(--font-ui);
  color: var(--text-2);
  word-break: break-word;
  max-height: 132px;
  overflow: auto;
}
.nb-empty { border-color: rgba(108, 156, 245, 0.4); }
.nb-empty b {
  font: 600 12px/1.4 var(--font-ui);
  color: var(--info);
}
.nb-empty span {
  font: 400 10.5px/1.65 var(--font-ui);
  color: var(--text-2);
  word-break: break-word;
  max-height: 132px;
  overflow: auto;
}

/* ---- 中列：密度遮罩进度浮层 ---- */
.nb-mask {
  position: absolute;
  bottom: 34px;
  left: 50%;
  z-index: 9;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 236px;
  max-width: 78%;
  padding: 8px 12px;
  background: rgba(12, 15, 21, 0.9);
  border: 1px solid rgba(108, 156, 245, 0.4);
  border-radius: var(--r-md);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  transform: translateX(-50%);
  pointer-events: none;
}
.nb-mask[hidden] { display: none; }
.nb-mask b {
  overflow: hidden;
  font: 500 10px/1.4 var(--font-mono);
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nb-mask-bar {
  display: block;
  height: 4px;
  overflow: hidden;
  background: var(--bg-3);
  border-radius: 2px;
}
.nb-mask-bar i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--info), var(--accent));
  border-radius: inherit;
  transition: width 0.15s ease;
}
.nb-mask-bar.is-indeterminate i {
  width: 38% !important;
  animation: nb-mask-pulse 1.1s ease-in-out infinite;
}
@keyframes nb-mask-pulse {
  0% { margin-left: -38%; }
  100% { margin-left: 100%; }
}

/* ---- 右列：层列表 ---- */
.nb-layer-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 190px;
  margin-bottom: 8px;
  overflow-y: auto;
  padding-right: 1px;
  scrollbar-width: thin;
  scrollbar-color: #2b3242 transparent;
}
.nb-layer-list::-webkit-scrollbar { width: 8px; }
.nb-layer-list.is-empty { opacity: 0.7; }
.nb-layer {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 6px 0 2px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  transition: background 0.1s, border-color 0.1s;
}
.nb-layer:hover { background: var(--bg-2); }
.nb-layer.is-sel {
  background: var(--accent-soft);
  border-color: rgba(232, 163, 61, 0.4);
}
.nb-layer.is-off .nb-layer-name {
  opacity: 0.62;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.nb-layer.is-off .nb-layer-role,
.nb-layer.is-off .nb-layer-pts,
.nb-layer.is-off .nb-layer-icon { opacity: 0.5; }
.nb-layer.is-sel .nb-layer-name { color: var(--text); font-weight: 600; }
.nb-eye {
  flex: none;
  width: 13px;
  height: 13px;
  margin: 0 1px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.nb-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-3);
  font-size: 10.5px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.nb-icon:hover { background: var(--bg-hover); color: var(--text); }
.nb-icon.is-on { color: var(--accent); background: var(--accent-soft); }
.nb-layer-icon {
  flex: none;
  width: 14px;
  color: var(--info);
  font-size: 10.5px;
  text-align: center;
}
.nb-layer-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font: 500 10.5px/1.4 var(--font-ui);
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nb-layer-role {
  flex: 0 1 62px;
  min-width: 0;
  overflow: hidden;
  font: 400 9px/1.4 var(--font-mono);
  color: var(--text-3);
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nb-layer-pts {
  flex: none;
  width: 52px;
  font: 400 9.5px/1.4 var(--font-mono);
  color: var(--text-2);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---- 右列：层属性 / 通用检查器块 ---- */
.nb-insp-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.nb-checks {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  min-height: 18px;
}
.nb-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 500 10.5px/1.4 var(--font-ui);
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
}
.nb-check input {
  width: 12px;
  height: 12px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.nb-check input:disabled { cursor: not-allowed; }
.nb-l-swatch {
  display: inline-block;
  flex: 1 1 auto;
  height: 8px;
  min-width: 48px;
  max-width: 180px;
  margin-left: auto;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
#nb-l-role { font-family: var(--font-mono); font-size: 9.5px; }
#nb-l-blend { font-size: 10.5px; }
#nb-l-enabled, #nb-transparent, #nb-exp-transparent { accent-color: var(--accent); }
#nb-l-density, #nb-l-hdr, #nb-l-depth { accent-color: var(--accent); }

/* ---- 右列：后处理链 ---- */
.nb-postfx {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}
.nb-post-row {
  padding: 7px 8px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  transition: opacity 0.12s, border-color 0.12s;
}
.nb-post-row:hover { border-color: var(--line); }
.nb-post-row.is-off { opacity: 0.62; }
.nb-post-row.is-off:hover { opacity: 0.8; }
.nb-post-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  cursor: pointer;
}
.nb-post-head input {
  width: 12px;
  height: 12px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.nb-post-head b {
  overflow: hidden;
  font: 600 10.5px/1.4 var(--font-ui);
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nb-post-row.is-off .nb-post-head b { color: var(--text-3); }
.nb-post-params {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
  margin-top: 6px;
}
.nb-post-row.is-off .nb-post-params { opacity: 0.55; }
.nb-post-params .nb-range { margin: 0; }
.nb-range.nb-param { margin: 0; }
.nb-param b { font-size: 9px; color: var(--text-3); }
.nb-param input[type="range"] { height: 12px; }

/* ---- 右列：导出 / 视图统计 ---- */
#nb-scale-custom:disabled { opacity: 0.45; }
.nb-prog {
  height: 5px;
  margin-top: 6px;
  overflow: hidden;
  background: var(--bg-3);
  border-radius: 3px;
}
.nb-prog[hidden] { display: none; }
.nb-prog i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--info), var(--accent));
  border-radius: inherit;
  transition: width 0.18s ease;
}
#nb-exp-run { margin-top: 2px; }
#nb-exp-size, #nb-exp-info, #nb-exp-status { font-family: var(--font-mono); }
#nb-exp-status { margin-top: 2px; color: var(--text-3); }
#nb-exp-status:empty { display: none; }
#nb-name { font-family: var(--font-ui); font-size: 11px; }
.nb-view-stats {
  margin: 0;
  font: 400 9px/1.5 var(--font-mono);
  color: var(--text-3);
  word-break: break-all;
}
.nb-warns {
  margin: 0;
  font: 400 9.5px/1.5 var(--font-ui);
  color: var(--warn);
  word-break: break-word;
}
.nb-warns:empty { display: none; }
#nb-export-file { margin-top: 2px; }

/* ---- 状态条 ---- */
.nb-status {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 28px;
  padding: 0 14px;
  overflow: hidden;
  background: var(--bg-1);
  border-top: 1px solid var(--line-soft);
  font: 400 10px/1.4 var(--font-mono);
  color: var(--text-3);
  white-space: nowrap;
}
#nb-status-prof,
#nb-status-points,
#nb-status-degrade,
#nb-status-warn,
#nb-status-mask,
#nb-status-play {
  flex: none;
  font-variant-numeric: tabular-nums;
}
#nb-status-prof { color: var(--text-2); }
#nb-status-points { color: var(--text-2); }
#nb-status-degrade.is-warn { color: var(--warn); }
#nb-status-degrade.is-err { color: var(--err); }
#nb-status-warn.is-warn { color: var(--warn); }
#nb-status-warn.is-err { color: var(--err); }
#nb-status-play { color: var(--ok); }
#nb-status-mask { color: var(--info); }
.nb-status-msg {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  color: var(--text-3);
}
.nb-status-msg[data-kind="ok"] { color: var(--ok); }
.nb-status-msg[data-kind="warn"] { color: var(--warn); }
.nb-status-msg[data-kind="err"] { color: var(--err); }
#nb-status-msg:empty { opacity: 0; }

/* ---- 交互态：焦点 / 禁用 / 滚动条 ---- */
.nb-back button:focus-visible,
.nb-back input:focus-visible,
.nb-back select:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}
.nb-back button:disabled,
.nb-back select:disabled,
.nb-back input:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}
.nb-back ::selection { background: rgba(232, 163, 61, 0.28); }

/* ---- 窄屏：压缩三列 → 检查器换行 → 单列 ---- */
@media (max-width: 1280px) {
  .nb-body { grid-template-columns: 300px minmax(0, 1fr) 320px; }
  .nb-layer-role { flex-basis: 48px; }
  .nb-hud-cell { padding: 4px 7px; }
}

@media (max-width: 1180px) {
  .nb-back { padding: 10px; }
  .nb-box { width: 97vw; height: 93vh; }
  .nb-body {
    grid-template-columns: 286px minmax(0, 1fr);
    grid-template-rows: minmax(340px, 1fr) auto;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #2b3242 transparent;
  }
  .nb-gen { max-height: 540px; }
  .nb-insp {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 8px;
    overflow: visible;
    max-height: none;
  }
  .nb-stage { min-height: 340px; }
  .nb-hud { max-width: calc(100% - 64px); }
  .nb-sub { max-width: 70vw; }
}

@media (max-width: 900px) {
  .nb-head { align-items: flex-start; flex-direction: column; }
  .nb-actions { justify-content: flex-start; }
  .nb-sub { max-width: 88vw; white-space: normal; }
  .nb-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(300px, 1fr) auto;
  }
  .nb-gen {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    max-height: 320px;
  }
  .nb-gen > .nb-card:first-child { grid-column: 1 / -1; }
  .nb-insp { grid-template-columns: minmax(0, 1fr); }
  .nb-act-sep { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .nb-back *,
  .nb-back *::before,
  .nb-back *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ===== 渲染与视效（VFX） ===== */
/* ==========================================================================
   渲染与视效（VFX）：全屏渲染工作台
   结构：#vfx-back 模态 → .vfx-box → 头部 / 三列（节点库+链+预设 | 视口 | 检查器）
         / 状态条；视口内叠 HUD / 调试角标 / fallback / 空态。
   约定：本段选择器全部以 .vfx- / #vfx- 开头或限定在 .vfx-back 内，
        不改动现有 UI；类名与 src/editor/vfxpanel.js 的 _mount() 对齐。
   ========================================================================== */

/* ---- 全屏模态 ---- */
.vfx-back {
  position: fixed;
  inset: 0;
  z-index: 68;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(5, 7, 12, 0.88);
  backdrop-filter: blur(2px);
}
.vfx-back[hidden] { display: none; }
.vfx-back [hidden] { display: none !important; }
/* 模态语义：面板打开时锁住背景滚动 */
body.is-vfxopen { overflow: hidden; }

.vfx-box {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1720px, 96vw);
  height: min(1060px, 94vh);
  min-height: 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 26px 72px rgba(0, 0, 0, 0.66);
  overflow: hidden;
}

/* ---- 头部：标题 / 副标题 / 操作组 ---- */
.vfx-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 14px;
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  border-bottom: 1px solid var(--line-soft);
}
.vfx-title { min-width: 0; }
.vfx-title h3 {
  margin: 0;
  font: 600 14px/1.4 var(--font-ui);
  color: var(--text);
  letter-spacing: 0.01em;
}
.vfx-sub {
  display: block;
  max-width: min(620px, 52vw);
  margin-top: 2px;
  overflow: hidden;
  font: 400 10.5px/1.45 var(--font-ui);
  color: var(--text-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}
#vfx-sub { transition: color 0.12s; }

.vfx-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.vfx-actions .ghost-btn,
.vfx-actions .primary-btn {
  height: 25px;
  padding: 0 9px;
  font-size: 11px;
  white-space: nowrap;
}
#vfx-export, #vfx-import, #vfx-save { color: var(--text-2); }
#vfx-close:hover { border-color: var(--line); }
#vfx-file { display: none; }
.vfx-toggle { font-variant-numeric: tabular-nums; }
.vfx-toggle[data-on="0"] { color: var(--text-3); }

.vfx-pick {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 500 10px/1.4 var(--font-ui);
  color: var(--text-3);
  white-space: nowrap;
}
.vfx-pick select {
  width: auto;
  min-width: 84px;
  max-width: 132px;
  height: 25px;
  font-size: 11px;
}
#vfx-preset { max-width: 108px; }
#vfx-quality { max-width: 122px; }
#vfx-debug { max-width: 122px; }
.vfx-act-sep {
  flex: none;
  width: 1px;
  height: 16px;
  margin: 0 2px;
  background: var(--line);
}

/* ---- 三列主体 ---- */
.vfx-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 344px minmax(0, 1fr) 364px;
  gap: 10px;
  padding: 10px 12px;
  overflow: hidden;
}
.vfx-left,
.vfx-insp {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: #2b3242 transparent;
}
.vfx-left::-webkit-scrollbar,
.vfx-insp::-webkit-scrollbar { width: 8px; }

/* ---- 卡片 / 小标题 / 计数 ---- */
.vfx-card {
  flex: none;
  padding: 9px 10px 10px;
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
}
.vfx-card h4 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
  font: 600 11px/1.4 var(--font-ui);
  color: var(--text-2);
  letter-spacing: 0.03em;
}
.vfx-count {
  margin-left: auto;
  font: 400 9.5px/1 var(--font-mono);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.vfx-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.vfx-sec-head h4 { margin: 0; }
.vfx-muted {
  margin: 4px 0 0;
  font: 400 10px/1.55 var(--font-ui);
  color: var(--text-3);
}
.vfx-mini {
  height: 20px !important;
  padding: 0 6px !important;
  font-size: 10px !important;
}
.vfx-chain-hint { margin: 0; flex: none; white-space: nowrap; }

/* ---- 左列：视效节点库 ---- */
.vfx-library {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 306px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2b3242 transparent;
}
.vfx-library::-webkit-scrollbar { width: 8px; }
.vfx-group { display: flex; flex-direction: column; gap: 4px; }
.vfx-group-head {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 0 1px;
  font: 500 9.5px/1.5 var(--font-ui);
  color: var(--text-3);
}
.vfx-group-head b {
  font: 600 10px/1.5 var(--font-ui);
  color: var(--text-2);
  letter-spacing: 0.02em;
}
.vfx-group-head i {
  font: 400 8px/1.5 var(--font-mono);
  font-style: normal;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.vfx-group-head span { margin-left: auto; font-variant-numeric: tabular-nums; }
.vfx-lib {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}
.vfx-lib-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  padding: 5px 7px;
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.vfx-lib-btn:hover { background: var(--bg-hover); border-color: var(--line); color: var(--text); }
.vfx-lib-btn:active { transform: translateY(0.5px); }
.vfx-lib-btn:disabled { opacity: 0.42; cursor: not-allowed; }
.vfx-lib-name {
  overflow: hidden;
  font: 600 11px/1.3 var(--font-ui);
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vfx-lib-en {
  overflow: hidden;
  font: 400 8px/1.3 var(--font-mono);
  font-style: normal;
  color: var(--text-3);
  text-overflow: ellipsis;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.vfx-lib-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 13px;
  margin-top: 1px;
}
.vfx-lib-cost {
  padding: 0 4px;
  border-radius: 3px;
  font: 600 8.5px/1.4 var(--font-mono);
  font-style: normal;
  color: var(--text-3);
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
}
.vfx-lib-cost[data-cost="low"] { color: var(--ok); border-color: rgba(78, 201, 160, 0.32); background: rgba(78, 201, 160, 0.1); }
.vfx-lib-cost[data-cost="mid"] { color: var(--warn); border-color: rgba(232, 184, 75, 0.32); background: rgba(232, 184, 75, 0.1); }
.vfx-lib-cost[data-cost="high"] { color: var(--err); border-color: rgba(229, 101, 122, 0.34); background: rgba(229, 101, 122, 0.1); }
.vfx-lib-half {
  font: 600 8.5px/1.4 var(--font-mono);
  font-style: normal;
  color: var(--info);
  opacity: 0.85;
}

/* ---- 左列：当前链 ---- */
.vfx-chain {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 44px;
  max-height: 292px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2b3242 transparent;
}
.vfx-chain::-webkit-scrollbar { width: 8px; }
.vfx-chain-empty {
  padding: 13px 8px;
  text-align: center;
  font: 400 10px/1.6 var(--font-ui);
  color: var(--text-3);
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
}
.vfx-node {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 5px 6px 5px 4px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  cursor: grab;
  user-select: none;
  transition: background 0.12s, border-color 0.12s, opacity 0.12s;
}
.vfx-node:hover { background: var(--bg-hover); border-color: var(--line); }
.vfx-node:active { cursor: grabbing; }
.vfx-node.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(232, 163, 61, 0.16);
}
.vfx-node.is-off { opacity: 0.56; }
.vfx-node.is-skipped { border-style: dashed; }
.vfx-node.is-dragging { opacity: 0.38; }
.vfx-node.is-drop-before::before,
.vfx-node.is-drop-after::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  height: 2px;
  border-radius: 1px;
  background: var(--accent);
  box-shadow: 0 0 5px rgba(232, 163, 61, 0.7);
}
.vfx-node.is-drop-before::before { top: -3px; }
.vfx-node.is-drop-after::after { bottom: -3px; }
.vfx-node-order {
  flex: none;
  width: 15px;
  text-align: center;
  font: 400 8.5px/1 var(--font-mono);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.vfx-node-en {
  flex: none;
  width: 12px;
  height: 12px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.vfx-node-name {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}
.vfx-node-name b {
  overflow: hidden;
  font: 600 10.5px/1.35 var(--font-ui);
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vfx-node.is-selected .vfx-node-name b { color: var(--accent); }
.vfx-node-name i {
  flex: none;
  font: 400 7.5px/1.35 var(--font-mono);
  font-style: normal;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.vfx-node-tags {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 47%;
}
.vfx-tag {
  padding: 0 3px;
  border-radius: 3px;
  font: 500 8.5px/1.5 var(--font-mono);
  color: var(--text-3);
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  white-space: nowrap;
}
.vfx-tag[data-kind="quality"] { color: var(--info); }
.vfx-tag[data-kind="half"] { color: var(--warn); }
.vfx-tag[data-kind="cost"] { color: var(--text-3); }
.vfx-tag.is-warn {
  color: var(--err);
  border-color: rgba(229, 101, 122, 0.42);
  background: rgba(229, 101, 122, 0.1);
}
.vfx-node-acts {
  display: flex;
  align-items: center;
  gap: 1px;
  flex: none;
  opacity: 0;
  transition: opacity 0.12s;
}
.vfx-node:hover .vfx-node-acts,
.vfx-node.is-selected .vfx-node-acts { opacity: 1; }
.vfx-node-btn {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--text-3);
  font: 500 10px/1 var(--font-mono);
  cursor: pointer;
}
.vfx-node-btn:hover { background: var(--bg-1); color: var(--text); }
.vfx-node-btn[data-act="node-del"]:hover { color: var(--err); }
.vfx-insp-acts {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: none;
}
#vfx-ab { min-width: 34px; justify-content: center; }
#vfx-node-quality { width: auto; min-width: 64px; }
#vfx-node-half { margin-left: 1px; }
#vfx-copy, #vfx-export2, #vfx-save, #vfx-export, #vfx-import { white-space: nowrap; }
#vfx-hud-fps, #vfx-hud-nodes, #vfx-hud-quality, #vfx-hud-ms, #vfx-hud-cost,
#vfx-budget-fill, #vfx-pass-total, #vfx-caps-count, #vfx-chain-count,
#vfx-lib-count, #vfx-preset-count, #vfx-status-quality, #vfx-status-caps,
#vfx-fallback-msg, #vfx-empty-t, #vfx-empty-s, #vfx-post-badge,
#vfx-node-empty, #vfx-node-tag, #vfx-preset-reset { font-variant-numeric: tabular-nums; }

/* ---- 左列：预设卡 ---- */
.vfx-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 272px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2b3242 transparent;
}
.vfx-presets::-webkit-scrollbar { width: 8px; }
.vfx-preset {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 0 8px 7px;
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  color: var(--text-2);
  cursor: pointer;
  overflow: hidden;
  transition: background 0.12s, border-color 0.12s;
}
.vfx-preset:hover { background: var(--bg-hover); border-color: var(--line); }
.vfx-preset:active { transform: translateY(0.5px); }
.vfx-preset.is-cur {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(232, 163, 61, 0.16);
}
.vfx-preset-swatch {
  position: relative;
  display: block;
  height: 26px;
  margin: 0 -8px 5px;
  overflow: hidden;
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
}
.vfx-preset-swatch::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 26% 74%, rgba(255, 255, 255, 0.42) 0 4%, transparent 30%),
    radial-gradient(circle at 66% 34%, rgba(255, 255, 255, 0.26) 0 3%, transparent 24%);
  mix-blend-mode: screen;
  opacity: 0.7;
  pointer-events: none;
}
.vfx-preset-head { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.vfx-preset-head b {
  overflow: hidden;
  font: 600 11px/1.3 var(--font-ui);
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vfx-preset.is-cur .vfx-preset-head b { color: var(--accent); }
.vfx-preset-head i {
  flex: none;
  font: 400 8px/1.3 var(--font-mono);
  font-style: normal;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.vfx-preset-desc {
  display: -webkit-box;
  overflow: hidden;
  font: 400 9.5px/1.4 var(--font-ui);
  color: var(--text-3);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.vfx-preset:hover .vfx-preset-desc { color: var(--text-2); }
.vfx-preset-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 1px;
  font: 400 8.5px/1.4 var(--font-mono);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.vfx-preset-meta em { font-style: normal; }
.vfx-reset {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
  height: 24px;
  padding: 0 8px;
  font-size: 10.5px;
}

/* ---- 中列：预览舞台 ---- */
.vfx-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.vfx-preview {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #04060b;
  cursor: grab;
}
.vfx-preview:active { cursor: grabbing; }
.vfx-gl,
.vfx-demo,
.vfx-overlay,
.vfx-post {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.vfx-demo { z-index: 1; }
.vfx-gl { z-index: 1; }
.vfx-overlay { z-index: 2; pointer-events: none; }
.vfx-post { z-index: 3; pointer-events: none; }
.vfx-gl.is-covered,
.vfx-demo.is-covered { visibility: hidden; }

.vfx-hud {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 6;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  max-width: calc(100% - 24px);
  pointer-events: none;
}
.vfx-hud-cell {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 3px 6px;
  background: rgba(8, 11, 18, 0.72);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  backdrop-filter: blur(3px);
}
.vfx-hud-cell b {
  font: 600 11px/1 var(--font-mono);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.vfx-hud-cell i {
  font: 400 8.5px/1 var(--font-ui);
  font-style: normal;
  color: var(--text-3);
  white-space: nowrap;
}
.vfx-hud-budget { position: relative; padding-bottom: 7px; }
.vfx-budget-bar {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}
.vfx-budget-bar > i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 2px;
  background: var(--ok);
  transition: width 0.2s linear, background 0.12s;
}
.vfx-budget-bar > i.is-over { background: var(--err); }

.vfx-stage-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 6;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(232, 163, 61, 0.16);
  border: 1px solid rgba(232, 163, 61, 0.5);
  color: var(--accent);
  font: 600 10px/1.4 var(--font-ui);
  pointer-events: none;
  white-space: nowrap;
}
.vfx-stage-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  padding: 6px 10px 5px;
  background: linear-gradient(0deg, rgba(5, 7, 12, 0.88), rgba(5, 7, 12, 0));
  color: var(--text-3);
  font: 400 10px/1.4 var(--font-ui);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.vfx-fallback {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 26px;
  z-index: 7;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  background: rgba(232, 184, 75, 0.1);
  border: 1px solid rgba(232, 184, 75, 0.4);
  border-radius: var(--r-sm);
  color: var(--warn);
  font: 400 10px/1.5 var(--font-ui);
  pointer-events: none;
}
.vfx-fallback b { font-size: 10.5px; font-weight: 600; }
.vfx-fallback span { color: var(--text-2); }
.vfx-empty {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  background: rgba(6, 8, 12, 0.72);
}
.vfx-empty b { font: 600 13px/1.4 var(--font-ui); color: var(--text); }
.vfx-empty span {
  max-width: 440px;
  font: 400 10.5px/1.65 var(--font-ui);
  color: var(--text-3);
}
.vfx-stage.is-fallback .vfx-preview { cursor: default; }

/* ---- 右列：节点参数 / 耗时 / 能力 / 统计 / 导出 ---- */
.vfx-node-head {
  padding: 8px;
  margin-bottom: 7px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
}
.vfx-node-head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 7px;
  min-width: 0;
}
.vfx-node-kind {
  overflow: hidden;
  font: 600 11px/1.35 var(--font-ui);
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vfx-node-kind i {
  font: 400 8px/1.35 var(--font-mono);
  font-style: normal;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.vfx-node-type {
  flex: none;
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font: 400 8.5px/1.5 var(--font-mono);
  color: var(--text-3);
}
.vfx-node-head-edit {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 10px;
}
.vfx-node-head-edit .vfx-check { font-size: 10px; }
.vfx-node-head-edit .vfx-field { flex: none; }
.vfx-node-head-edit .vfx-field-inline { flex-direction: row; align-items: center; gap: 5px; }
.vfx-node-head-edit .vfx-field select { width: auto; min-width: 64px; height: 22px; font-size: 10px; }

.vfx-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 500 10px/1.4 var(--font-ui);
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
}
.vfx-check input[type="checkbox"] {
  width: 12px;
  height: 12px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.vfx-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  font: 500 10px/1.4 var(--font-ui);
  color: var(--text-3);
}
.vfx-field select,
.vfx-field input[type="text"],
.vfx-field input[type="number"],
.vfx-field input[type="color"] {
  width: 100%;
  min-width: 0;
  height: 23px;
  font-size: 10.5px;
}
.vfx-field input[type="text"],
.vfx-field input[type="number"] { padding: 0 5px; }
.vfx-field-inline { flex-direction: row; align-items: center; gap: 5px; }

.vfx-params { display: flex; flex-direction: column; gap: 7px; }
.vfx-node-empty {
  padding: 20px 8px;
  text-align: center;
  font: 400 10.5px/1.6 var(--font-ui);
  color: var(--text-3);
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
}
.vfx-param { min-width: 0; }
.vfx-param-check { padding: 1px 0; }
.vfx-range {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1px 6px;
  font: 500 10px/1.4 var(--font-ui);
  color: var(--text-3);
}
.vfx-range > span {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.vfx-range b {
  font: 600 9.5px/1 var(--font-mono);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.vfx-range input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
}
.vfx-param-num .vfx-num-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.vfx-num-wrap input[type="number"] { flex: 1 1 auto; }
.vfx-num-wrap b {
  flex: none;
  min-width: 46px;
  text-align: right;
  font: 600 9.5px/1 var(--font-mono);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.vfx-param-color input[type="color"] {
  padding: 0;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
}

.vfx-stages {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 188px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2b3242 transparent;
}
.vfx-stages::-webkit-scrollbar { width: 8px; }
.vfx-stages-empty {
  padding: 8px 4px;
  text-align: center;
  font: 400 10px/1.6 var(--font-ui);
  color: var(--text-3);
}
.vfx-stages-empty.is-err { color: var(--err); }
.vfx-stage-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 6px;
}
.vfx-stage-name {
  overflow: hidden;
  font: 400 10px/1.5 var(--font-ui);
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vfx-stage-half {
  margin-left: 4px;
  font: 600 8px/1 var(--font-mono);
  font-style: normal;
  color: var(--warn);
}
.vfx-stage-bar {
  height: 5px;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  background: var(--bg-0);
  overflow: hidden;
}
.vfx-stage-bar > i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--info), var(--accent));
}
.vfx-stage-row b {
  font: 600 9px/1 var(--font-mono);
  color: var(--text-3);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.vfx-stage-skip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding-top: 5px;
  border-top: 1px dashed var(--line-soft);
  font: 400 9.5px/1.5 var(--font-ui);
  color: var(--text-3);
}
.vfx-stage-skip span { color: var(--warn); font-weight: 600; }
.vfx-stage-skip em {
  padding: 0 4px;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  font-style: normal;
  color: var(--text-2);
}

.vfx-caps { display: flex; flex-direction: column; gap: 2px; }
.vfx-cap {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  font: 400 10px/1.5 var(--font-ui);
  color: var(--text-2);
}
.vfx-cap i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
}
.vfx-cap.is-ok i { background: var(--ok); box-shadow: 0 0 5px rgba(78, 201, 160, 0.5); }
.vfx-cap.is-bad i { background: var(--err); }
.vfx-cap b {
  font: 600 9.5px/1.4 var(--font-mono);
  color: var(--text-3);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.vfx-cap.is-ok b { color: var(--ok); }
.vfx-cap.is-bad b { color: var(--warn); }

.vfx-stats { display: flex; flex-direction: column; gap: 3px; }
.vfx-stat {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 6px;
  font: 400 10px/1.5 var(--font-ui);
}
.vfx-stat span { color: var(--text-3); }
.vfx-stat b {
  font-weight: 500;
  color: var(--text-2);
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}
.vfx-warns {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px dashed var(--line-soft);
}
.vfx-warn-row {
  font: 400 9.5px/1.5 var(--font-ui);
  color: var(--warn);
  word-break: break-word;
}
.vfx-warn-row::before { content: "⚠ "; color: var(--warn); }
.vfx-ok { font: 400 10px/1.5 var(--font-ui); color: var(--text-3); }
.vfx-ok::before { content: "✓ "; color: var(--ok); }

.vfx-preset-info { display: flex; flex-direction: column; gap: 3px; }
.vfx-preset-json {
  margin: 8px 0 0;
  padding: 6px 8px;
  max-height: 132px;
  overflow: auto;
  background: var(--bg-0);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  font: 400 9px/1.5 var(--font-mono);
  color: var(--text-3);
  white-space: pre-wrap;
  word-break: break-all;
  user-select: text;
}
.vfx-preset-json::-webkit-scrollbar { width: 8px; height: 8px; }
.vfx-io-row { display: flex; gap: 6px; margin-top: 8px; }
.vfx-io-row .ghost-btn {
  flex: 1 1 0;
  justify-content: center;
  height: 24px;
  padding: 0 6px;
  font-size: 10.5px;
}

/* ---- 底部状态条 ---- */
.vfx-status {
  flex: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding: 5px 14px;
  background: var(--bg-1);
  border-top: 1px solid var(--line-soft);
  font: 400 10px/1.5 var(--font-ui);
  color: var(--text-3);
}
.vfx-status > span { white-space: nowrap; }
#vfx-status-cost.is-warn { color: var(--warn); }
#vfx-status-ms { font-variant-numeric: tabular-nums; }
.vfx-status-msg {
  max-width: 46vw;
  margin-left: auto;
  overflow: hidden;
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vfx-status-msg[data-kind="ok"] { color: var(--ok); }
.vfx-status-msg[data-kind="warn"] { color: var(--warn); }
.vfx-status-msg[data-kind="err"] { color: var(--err); }

/* ---- 键盘可访问性 ---- */
.vfx-back button:focus-visible,
.vfx-back select:focus-visible,
.vfx-back input:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}

/* ---- 响应式 ---- */
@media (max-width: 1500px) {
  .vfx-body { grid-template-columns: 312px minmax(0, 1fr) 340px; }
}
@media (max-width: 1280px) {
  .vfx-body { grid-template-columns: 288px minmax(0, 1fr) 318px; }
  .vfx-sub { max-width: 44vw; }
  .vfx-node-tags { max-width: 52%; }
}
@media (max-width: 1080px) {
  .vfx-body { grid-template-columns: 270px minmax(0, 1fr) 300px; gap: 8px; padding: 8px; }
  .vfx-actions .ghost-btn, .vfx-actions .primary-btn { padding: 0 7px; }
  .vfx-pick select { min-width: 72px; max-width: 104px; }
}
@media (max-width: 900px) {
  .vfx-head { align-items: flex-start; flex-direction: column; }
  .vfx-actions { justify-content: flex-start; }
  .vfx-sub { max-width: 88vw; white-space: normal; }
  .vfx-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(320px, 1fr) auto;
    overflow-y: auto;
  }
  .vfx-left { max-height: 360px; }
  .vfx-insp { max-height: none; }
  .vfx-act-sep { display: none; }
  .vfx-stage { min-height: 320px; }
  .vfx-status-msg { max-width: 70vw; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .vfx-back *,
  .vfx-back *::before,
  .vfx-back *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ===== 安全中心（Security） ===== */
/* ==========================================================================
   安全中心：全屏安全策略工作台
   结构：#sec-back 模态 → .sec-box → 顶栏 / 左导航 + 主区（9 个分区）/ 状态条
   约定：本段选择器全部以 .sec- / #sec- 前缀或限定在 .sec-back 内，不改动现有 UI；
        类名与 src/editor/securitypanel.js 的 _mount() / 渲染函数对齐。
   ========================================================================== */

/* ---- 全屏模态 ---- */
.sec-back {
  position: fixed;
  inset: 0;
  z-index: 69;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(5, 7, 12, 0.9);
  backdrop-filter: blur(2px);
}
.sec-back[hidden] { display: none; }
.sec-back [hidden] { display: none !important; }
body.is-secopen { overflow: hidden; }

.sec-box {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1780px, 97vw);
  height: min(1080px, 95vh);
  min-height: 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 26px 72px rgba(0, 0, 0, 0.66);
  overflow: hidden;
}

/* ---- 顶栏 ---- */
.sec-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 14px;
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  border-bottom: 1px solid var(--line-soft);
}
.sec-title { min-width: 0; }
.sec-title h3 {
  margin: 0;
  font: 600 14px/1.4 var(--font-ui);
  color: var(--text);
  letter-spacing: 0.01em;
}
.sec-sub {
  display: block;
  max-width: min(680px, 52vw);
  margin-top: 2px;
  overflow: hidden;
  font: 400 10.5px/1.45 var(--font-ui);
  color: var(--text-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sec-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.sec-actions .ghost-btn,
.sec-actions .primary-btn {
  height: 25px;
  padding: 0 9px;
  font-size: 11px;
  white-space: nowrap;
}
.sec-pick {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 500 10px/1.4 var(--font-ui);
  color: var(--text-3);
  white-space: nowrap;
}
.sec-pick select {
  width: auto;
  min-width: 84px;
  max-width: 140px;
  height: 25px;
  font-size: 11px;
}
#sec-tier { min-width: 120px; max-width: 168px; }
#sec-report-json, #sec-report-txt { color: var(--text-2); }
#sec-close:hover { border-color: var(--line); }

.sec-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 25px;
  padding: 0 7px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  font: 400 10.5px/1 var(--font-ui);
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
}
.sec-toggle:hover { background: var(--bg-hover); color: var(--text); }
.sec-toggle input[type="checkbox"] {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.sec-act-sep {
  flex: none;
  width: 1px;
  height: 16px;
  margin: 0 2px;
  background: var(--line);
}

/* ---- 主体：左导航 + 主区 ---- */
.sec-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  overflow: hidden;
}
.sec-nav {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 2px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2b3242 transparent;
}
.sec-nav::-webkit-scrollbar { width: 8px; }
.sec-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  height: 32px;
  padding: 0 9px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  color: var(--text-2);
  font: 500 11px/1.2 var(--font-ui);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.sec-nav-item:hover { background: var(--bg-hover); color: var(--text); }
.sec-nav-item.is-cur {
  background: var(--accent-soft);
  border-color: rgba(232, 163, 61, 0.35);
  color: var(--accent);
}
.sec-nav-ico {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font: 600 8.5px/1 var(--font-mono);
  color: inherit;
  opacity: 0.72;
}
.sec-nav-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec-nav-badge {
  flex: none;
  min-width: 10px;
  font: 400 9px/1 var(--font-mono);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.sec-nav-badge.is-alert { color: var(--err); }
.sec-nav-item.is-cur .sec-nav-badge { color: var(--accent); }

.sec-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-width: thin;
  scrollbar-color: #2b3242 transparent;
}
.sec-main::-webkit-scrollbar { width: 8px; }

.sec-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.sec-grid {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.sec-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

/* ---- 卡片 / 小标题 / 计数 ---- */
.sec-card {
  min-width: 0;
  padding: 9px 11px 11px;
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
}
.sec-card h4 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 7px;
  font: 600 11px/1.4 var(--font-ui);
  color: var(--text-2);
  letter-spacing: 0.03em;
}
.sec-plugin-result-card { min-width: 0; }
.sec-sub-h {
  margin: 11px 0 6px;
  font: 600 10px/1.4 var(--font-ui);
  color: var(--text-3);
  letter-spacing: 0.05em;
}
.sec-count {
  margin-left: auto;
  font: 400 9.5px/1 var(--font-mono);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sec-muted { color: var(--text-3); }
.sec-hint {
  margin-top: 7px;
  font: 400 10.5px/1.55 var(--font-ui);
  color: var(--text-3);
}
.sec-hint code,
.sec-bullets code,
.sec-tier-note code {
  padding: 0 3px;
  background: var(--bg-3);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.95em;
  color: var(--text-2);
}
.sec-bullets {
  margin: 8px 0 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font: 400 10.5px/1.6 var(--font-ui);
  color: var(--text-2);
}
.sec-bullets li::marker { color: var(--accent); }
.sec-bullets b { color: var(--text); }
.sec-empty-row {
  padding: 10px 11px;
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  color: var(--text-3);
  font: 400 10.5px/1.6 var(--font-ui);
}

/* ---- 空态 / 禁用态 ---- */
.sec-empty {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(232, 184, 75, 0.4);
  border-radius: var(--r-md);
  background: rgba(232, 184, 75, 0.08);
  color: var(--text-2);
  font: 400 10.5px/1.6 var(--font-ui);
}
.sec-empty b { color: var(--warn); font: 600 11.5px/1.4 var(--font-ui); }
.sec-empty code {
  padding: 0 3px;
  background: var(--bg-3);
  border-radius: 3px;
  font-family: var(--font-mono);
  color: var(--text);
}
.sec-main.is-nosec .sec-card { opacity: 0.86; }
.sec-main.is-nosec [data-need-sec] { opacity: 0.45; cursor: not-allowed; }
.sec-back button:disabled,
.sec-back input:disabled,
.sec-back select:disabled,
.sec-back textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- 表单 / 通用控件 ---- */
.sec-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.sec-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 27px;
  padding: 0 8px;
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  font: 400 11.5px/1.4 var(--font-ui);
  outline: none;
}
.sec-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}
.sec-textarea {
  display: block;
  width: 100%;
  min-height: 84px;
  margin-top: 7px;
  padding: 7px 8px;
  resize: vertical;
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  font: 400 11px/1.5 var(--font-ui);
  outline: none;
}
.sec-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}
.sec-mono { font-family: var(--font-mono); font-size: 10.5px; line-height: 1.55; }
.sec-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.sec-form-media { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sec-form-media .sec-field:first-child { grid-column: 1 / -1; }
.sec-field {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font: 400 10px/1.4 var(--font-ui);
  color: var(--text-3);
  white-space: nowrap;
}
.sec-field > input,
.sec-field > select { flex: 1 1 auto; min-width: 0; }
.sec-field input[type="number"],
.sec-field input[type="text"] {
  width: 100%;
  height: 25px;
  padding: 0 7px;
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  font: 400 11px/1.4 var(--font-mono);
  outline: none;
}
.sec-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}
.sec-field select.field-select { height: 25px; font-size: 11px; }
.sec-check {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font: 400 11px/1.45 var(--font-ui);
  color: var(--text-2);
  cursor: pointer;
}
.sec-check input[type="checkbox"] {
  flex: none;
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.sec-btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.sec-result { margin-top: 9px; min-width: 0; }
.sec-icon-btn {
  flex: none;
  height: 22px;
  padding: 0 7px;
  background: transparent;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  color: var(--text-3);
  font: 400 10px/1 var(--font-ui);
  cursor: pointer;
}
.sec-icon-btn:hover {
  color: var(--err);
  border-color: rgba(229, 101, 122, 0.5);
  background: rgba(229, 101, 122, 0.08);
}

/* ---- 安全档位卡 ---- */
.sec-tier-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.sec-tier-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 9px 10px;
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
}
.sec-tier-card:hover { background: var(--bg-hover); border-color: var(--line); }
.sec-tier-card:active { transform: translateY(0.5px); }
.sec-tier-card.is-cur {
  background: var(--accent-soft);
  border-color: rgba(232, 163, 61, 0.55);
  box-shadow: inset 0 0 0 1px rgba(232, 163, 61, 0.18);
}
.sec-tier-card.is-locked { cursor: not-allowed; }
.sec-tier-head { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.sec-tier-name { font: 600 13px/1.3 var(--font-ui); color: var(--text); }
.sec-tier-card.is-cur .sec-tier-name { color: var(--accent); }
.sec-tier-en {
  overflow: hidden;
  font: 400 9px/1.4 var(--font-mono);
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sec-tier-badge {
  flex: none;
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 9px/1.5 var(--font-ui);
  white-space: nowrap;
}
.sec-tier-desc { margin: 0; font: 400 10.5px/1.5 var(--font-ui); color: var(--text-2); }
.sec-tier-points {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding-left: 12px;
  font: 400 9.5px/1.45 var(--font-ui);
  color: var(--text-3);
}
.sec-tier-points li::marker { color: var(--accent); }
.sec-tier-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  padding-top: 5px;
  border-top: 1px solid var(--line-soft);
  font: 400 9.5px/1.4 var(--font-mono);
  color: var(--text-3);
}
.sec-tier-lock { color: var(--warn); white-space: nowrap; }
.sec-tier-note {
  margin-top: 9px;
  padding: 7px 9px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  font: 400 10.5px/1.55 var(--font-ui);
  color: var(--text-2);
}
.sec-tier-note b { color: var(--warn); }

/* ---- 键值列表 ---- */
.sec-kv {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}
.sec-kv-row {
  display: flex;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px dashed var(--line-soft);
  font: 400 10.5px/1.5 var(--font-ui);
}
.sec-kv-row:last-child { border-bottom: none; }
.sec-kv-row dt {
  flex: none;
  width: 96px;
  color: var(--text-3);
}
.sec-kv-row dd {
  min-width: 0;
  margin: 0;
  color: var(--text-2);
  word-break: break-all;
}

/* ---- 域名白名单 ---- */
.sec-rule-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
#sec-rule-input { flex: 1 1 180px; height: 27px; }
.sec-rule-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 9px;
}
.sec-rule-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 5px 8px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
}
.sec-rule-item:hover { border-color: var(--line); }
.sec-rule-idx {
  flex: none;
  width: 16px;
  font: 400 9.5px/1 var(--font-mono);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.sec-rule-host {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font: 400 11px/1.4 var(--font-mono);
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sec-rule-src {
  flex: none;
  font: 400 9.5px/1.4 var(--font-mono);
  color: var(--text-3);
  white-space: nowrap;
}
.sec-rule-preview {
  margin-top: 10px;
  padding: 8px 9px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
}
.sec-rule-preview-head {
  font: 600 10px/1.4 var(--font-ui);
  color: var(--text-3);
  letter-spacing: 0.04em;
}
.sec-rule-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.sec-preview-pill {
  padding: 2px 7px;
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--line);
  border-radius: var(--r-sm);
  font: 400 10px/1.4 var(--font-mono);
  color: var(--text-2);
}
.sec-preview-pill[data-action="allow"] { border-left-color: var(--ok); }
.sec-preview-pill[data-action="deny"] { border-left-color: var(--err); }
.sec-preview-pill[data-action="require-consent"] { border-left-color: var(--warn); }
.sec-preview-pill[data-action="transform"] { border-left-color: var(--info); }

/* ---- 小徽标 / chips ---- */
.sec-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.sec-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-2);
  font: 400 9.5px/1.5 var(--font-ui);
  white-space: nowrap;
}
.sec-chip[data-action="allow"] {
  color: var(--ok);
  border-color: rgba(78, 201, 160, 0.35);
  background: rgba(78, 201, 160, 0.1);
}
.sec-chip[data-action="deny"] {
  color: var(--err);
  border-color: rgba(229, 101, 122, 0.35);
  background: rgba(229, 101, 122, 0.1);
}
.sec-chip[data-action="require-consent"] {
  color: var(--warn);
  border-color: rgba(232, 184, 75, 0.35);
  background: rgba(232, 184, 75, 0.1);
}
.sec-chip[data-action="transform"] {
  color: var(--info);
  border-color: rgba(108, 156, 245, 0.35);
  background: rgba(108, 156, 245, 0.1);
}
.sec-chip[data-tone="ok"] {
  color: var(--ok);
  border-color: rgba(78, 201, 160, 0.35);
  background: rgba(78, 201, 160, 0.1);
}
.sec-chip[data-tone="warn"] {
  color: var(--warn);
  border-color: rgba(232, 184, 75, 0.35);
  background: rgba(232, 184, 75, 0.1);
}

/* ---- 恶意 / 合法样本快捷按钮 ---- */
.sec-samples {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.sec-sample {
  padding: 3px 7px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text-2);
  font: 400 10px/1.4 var(--font-ui);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.sec-sample:hover { background: var(--bg-hover); border-color: var(--line); color: var(--text); }
.sec-sample.is-bad { border-left-color: rgba(229, 101, 122, 0.65); }
.sec-sample.is-good { border-left-color: rgba(78, 201, 160, 0.65); }
.sec-sample-label { pointer-events: none; }

/* ---- 决策卡 ---- */
.sec-decision {
  min-width: 0;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.sec-decision.is-allow { border-color: rgba(78, 201, 160, 0.45); }
.sec-decision.is-deny { border-color: rgba(229, 101, 122, 0.5); }
.sec-decision.is-consent { border-color: rgba(232, 184, 75, 0.5); }
.sec-decision.is-transform { border-color: rgba(108, 156, 245, 0.5); }
.sec-decision.is-idle { border-color: var(--line-soft); }
.sec-decision-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line-soft);
}
.sec-verdict {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  background: var(--bg-3);
  border-radius: 999px;
  color: var(--text-2);
  font: 600 10.5px/1.6 var(--font-ui);
  white-space: nowrap;
}
.sec-decision.is-allow .sec-verdict { color: var(--ok); background: rgba(78, 201, 160, 0.12); }
.sec-decision.is-deny .sec-verdict { color: var(--err); background: rgba(229, 101, 122, 0.12); }
.sec-decision.is-consent .sec-verdict { color: var(--warn); background: rgba(232, 184, 75, 0.12); }
.sec-decision.is-transform .sec-verdict { color: var(--info); background: rgba(108, 156, 245, 0.12); }
.sec-decision-code {
  padding: 0 5px;
  background: var(--bg-3);
  border-radius: 3px;
  font: 400 10px/1.6 var(--font-mono);
  color: var(--text-2);
  white-space: nowrap;
}
.sec-decision-rule {
  font: 400 9.5px/1.5 var(--font-mono);
  color: var(--text-3);
  white-space: nowrap;
}
.sec-sev {
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 400 9.5px/1.6 var(--font-ui);
  color: var(--text-2);
  white-space: nowrap;
}
.sec-sev[data-sev="info"] {
  color: var(--info);
  border-color: rgba(108, 156, 245, 0.4);
  background: rgba(108, 156, 245, 0.08);
}
.sec-sev[data-sev="warning"],
.sec-sev[data-sev="medium"] {
  color: var(--warn);
  border-color: rgba(232, 184, 75, 0.4);
  background: rgba(232, 184, 75, 0.08);
}
.sec-sev[data-sev="critical"],
.sec-sev[data-sev="block"],
.sec-sev[data-sev="high"] {
  color: var(--err);
  border-color: rgba(229, 101, 122, 0.45);
  background: rgba(229, 101, 122, 0.08);
}
.sec-sev[data-sev="low"] {
  color: var(--ok);
  border-color: rgba(78, 201, 160, 0.4);
  background: rgba(78, 201, 160, 0.08);
}
.sec-decision-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 10px 9px;
}
.sec-reason-target {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  font: 400 10px/1.4 var(--font-ui);
  color: var(--text-3);
}
.sec-reason-target > span { flex: none; }
.sec-reason-target code {
  min-width: 0;
  overflow: hidden;
  font: 400 10.5px/1.4 var(--font-mono);
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sec-decision-cat { font: 400 10px/1.4 var(--font-ui); color: var(--text-3); }
.sec-reason { font: 400 11.5px/1.55 var(--font-ui); color: var(--text); }
.sec-trace { font: 400 9.5px/1.4 var(--font-mono); color: var(--text-3); }
.sec-raw { border-top: 1px solid var(--line-soft); }
.sec-raw > summary {
  padding: 5px 9px;
  cursor: pointer;
  font: 400 9.5px/1.4 var(--font-ui);
  color: var(--text-3);
  list-style: none;
}
.sec-raw > summary::-webkit-details-marker { display: none; }
.sec-raw > summary::before { content: "▸ "; }
.sec-raw[open] > summary::before { content: "▾ "; }
.sec-raw > summary:hover { color: var(--text-2); }
.sec-raw pre {
  max-height: 220px;
  margin: 0;
  padding: 8px 10px;
  overflow: auto;
  background: var(--bg-0);
  color: var(--text-2);
  font: 400 9.5px/1.5 var(--font-mono);
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---- 插件信任 ---- */
.sec-plugin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.sec-trust {
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 600 10px/1.6 var(--font-ui);
  color: var(--text-2);
  white-space: nowrap;
}
.sec-trust[data-trust="builtin"] {
  color: var(--ok);
  border-color: rgba(78, 201, 160, 0.4);
  background: rgba(78, 201, 160, 0.08);
}
.sec-trust[data-trust="verified"] {
  color: var(--info);
  border-color: rgba(108, 156, 245, 0.4);
  background: rgba(108, 156, 245, 0.08);
}
.sec-trust[data-trust="community"] {
  color: var(--warn);
  border-color: rgba(232, 184, 75, 0.4);
  background: rgba(232, 184, 75, 0.08);
}
.sec-trust[data-trust="unknown"],
.sec-trust[data-trust="external"] {
  color: var(--err);
  border-color: rgba(229, 101, 122, 0.4);
  background: rgba(229, 101, 122, 0.08);
}
.sec-plugin-id {
  min-width: 0;
  overflow: hidden;
  font: 400 10.5px/1.4 var(--font-ui);
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sec-plugin-id code { font-family: var(--font-mono); color: var(--text); }
.sec-perm-table {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
}
.sec-perm-row {
  display: flex;
  gap: 8px;
  padding: 4px 8px;
  background: var(--bg-2);
  font: 400 10.5px/1.5 var(--font-ui);
}
.sec-perm-row + .sec-perm-row { border-top: 1px solid var(--line-soft); }
.sec-perm-key { flex: none; width: 74px; color: var(--text-3); }
.sec-perm-val {
  min-width: 0;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 10px;
  word-break: break-all;
  white-space: pre-wrap;
}
.sec-perm-row.is-risk .sec-perm-val { color: var(--err); }
.sec-findings {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.sec-finding {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 4px 7px;
  background: var(--bg-2);
  border-left: 2px solid var(--line);
  border-radius: var(--r-sm);
  font: 400 10.5px/1.5 var(--font-ui);
  color: var(--text-2);
}
.sec-finding[data-sev="warning"],
.sec-finding[data-sev="medium"] { border-left-color: var(--warn); }
.sec-finding[data-sev="critical"],
.sec-finding[data-sev="block"],
.sec-finding[data-sev="high"] { border-left-color: var(--err); }
.sec-finding[data-sev="low"] { border-left-color: var(--ok); }
.sec-scan-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.sec-risk {
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 600 10px/1.6 var(--font-ui);
  color: var(--text-2);
  white-space: nowrap;
}
.sec-risk[data-risk="low"] {
  color: var(--ok);
  border-color: rgba(78, 201, 160, 0.4);
  background: rgba(78, 201, 160, 0.08);
}
.sec-risk[data-risk="medium"] {
  color: var(--warn);
  border-color: rgba(232, 184, 75, 0.4);
  background: rgba(232, 184, 75, 0.08);
}
.sec-risk[data-risk="high"],
.sec-risk[data-risk="critical"],
.sec-risk[data-risk="block"] {
  color: var(--err);
  border-color: rgba(229, 101, 122, 0.45);
  background: rgba(229, 101, 122, 0.08);
}

/* ---- AI provider ---- */
.sec-usage {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 8px;
  font: 400 10px/1.5 var(--font-mono);
  color: var(--text-3);
}
.sec-usage b { color: var(--accent); font-weight: 600; }
.sec-redact { min-width: 0; }
.sec-redact-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 9px;
  padding: 8px 9px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
}
.sec-redact-card[data-verdict="deny"] { border-color: rgba(229, 101, 122, 0.4); }
.sec-redact-card[data-verdict="consent"] { border-color: rgba(232, 184, 75, 0.4); }
.sec-redact-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  font: 400 10.5px/1.5 var(--font-ui);
  color: var(--text-2);
}
.sec-redact-row > span:first-child { flex: none; width: 74px; color: var(--text-3); }
.sec-redact-row code {
  min-width: 0;
  overflow: hidden;
  font: 400 10.5px/1.4 var(--font-mono);
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sec-redact-row b { color: var(--text); font-weight: 600; }

/* ---- 审计事件 ---- */
.sec-audit-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.sec-audit-limits {
  margin-top: 7px;
  font: 400 9.5px/1.5 var(--font-mono);
  color: var(--text-3);
}
.sec-audit-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 46vh;
  margin-top: 8px;
  padding-right: 2px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2b3242 transparent;
}
.sec-audit-list::-webkit-scrollbar { width: 8px; }
.sec-audit-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 8px;
  padding: 4px 7px;
  background: var(--bg-2);
  border: 1px solid transparent;
  border-left: 2px solid var(--line);
  border-radius: var(--r-sm);
  font: 400 10px/1.45 var(--font-ui);
  color: var(--text-2);
}
.sec-audit-item:hover { border-color: var(--line); }
.sec-audit-item[data-sev="warning"] { border-left-color: var(--warn); }
.sec-audit-item[data-sev="critical"] { border-left-color: var(--err); }
.sec-audit-time {
  flex: none;
  font: 400 9.5px/1.4 var(--font-mono);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.sec-audit-cat,
.sec-audit-dec {
  flex: none;
  max-width: 126px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sec-audit-dec[data-decision="deny"] { color: var(--err); }
.sec-audit-dec[data-decision="require-consent"] { color: var(--warn); }
.sec-audit-dec[data-decision="transform"] { color: var(--info); }
.sec-audit-src {
  flex: 0 1 auto;
  max-width: 190px;
  overflow: hidden;
  font: 400 9.5px/1.4 var(--font-mono);
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sec-audit-rule {
  flex: none;
  font: 400 9px/1.4 var(--font-mono);
  color: var(--text-3);
  white-space: nowrap;
}
.sec-audit-detail {
  flex: 1 1 140px;
  min-width: 80px;
  overflow: hidden;
  color: var(--text-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sec-audit-scope {
  flex: none;
  padding: 0 4px;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  font: 400 9px/1.4 var(--font-mono);
  color: var(--text-3);
}

/* ---- 策略模拟器 ---- */
.sec-sim-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}
.sec-table {
  width: 100%;
  margin-top: 8px;
  border-collapse: collapse;
  font: 400 10.5px/1.5 var(--font-ui);
  color: var(--text-2);
}
.sec-table th {
  padding: 5px 7px;
  border-bottom: 1px solid var(--line);
  font: 600 9.5px/1.4 var(--font-ui);
  color: var(--text-3);
  text-align: left;
  white-space: nowrap;
}
.sec-table td {
  padding: 4px 7px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.sec-table tr:hover td { background: var(--bg-2); }
.sec-table td code { font: 400 9.5px/1.4 var(--font-mono); color: var(--text-3); }
.sec-td-sample { max-width: 220px; }
.sec-td-reason { color: var(--text-3); }

/* ---- 安全导出 ---- */
#sec-export-hash,
.sec-export-hash {
  margin-top: 9px;
  padding: 6px 8px;
  background: var(--bg-0);
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  font: 400 9.5px/1.5 var(--font-mono);
  color: var(--text-3);
  word-break: break-all;
}
#sec-export-hash.is-ok,
.sec-export-hash.is-ok {
  color: var(--ok);
  border-color: rgba(78, 201, 160, 0.35);
}
.sec-sources {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 280px;
  margin-top: 8px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2b3242 transparent;
}
.sec-sources::-webkit-scrollbar { width: 8px; }
.sec-source {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 4px 7px;
  background: var(--bg-2);
  border-radius: var(--r-sm);
  font: 400 10px/1.4 var(--font-ui);
}
.sec-source-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sec-source-domain {
  flex: none;
  font: 400 9.5px/1.4 var(--font-mono);
  color: var(--text-3);
  white-space: nowrap;
}
.sec-source-trust {
  flex: none;
  font: 400 9px/1.4 var(--font-mono);
  color: var(--text-3);
  white-space: nowrap;
}

/* ---- 状态条 ---- */
.sec-status {
  flex: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding: 5px 14px;
  background: var(--bg-1);
  border-top: 1px solid var(--line-soft);
  font: 400 10px/1.5 var(--font-ui);
  color: var(--text-3);
}
.sec-status > span { white-space: nowrap; }
.sec-status-msg {
  max-width: 48vw;
  margin-left: auto;
  overflow: hidden;
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sec-status-msg[data-kind="ok"] { color: var(--ok); }
.sec-status-msg[data-kind="warn"] { color: var(--warn); }
.sec-status-msg[data-kind="err"] { color: var(--err); }

/* ---- 键盘可访问性 ---- */
.sec-back button:focus-visible,
.sec-back select:focus-visible,
.sec-back input:focus-visible,
.sec-back textarea:focus-visible,
.sec-back summary:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}

/* ---- 响应式 ---- */
@media (max-width: 1240px) {
  .sec-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .sec-form-media { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .sec-body { grid-template-columns: 160px minmax(0, 1fr); gap: 8px; padding: 8px; }
  .sec-head { align-items: flex-start; flex-direction: column; }
  .sec-actions { justify-content: flex-start; }
  .sec-tier-cards { grid-template-columns: minmax(0, 1fr); }
  .sec-sub { max-width: 88vw; }
  .sec-actions .ghost-btn, .sec-actions .primary-btn { padding: 0 7px; }
  .sec-audit-list { max-height: none; }
}
@media (max-width: 860px) {
  .sec-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .sec-nav {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 2px;
  }
  .sec-nav::-webkit-scrollbar { height: 6px; }
  .sec-nav-item { width: auto; flex: none; }
  .sec-nav-name { white-space: nowrap; }
  .sec-nav-badge { display: none; }
  .sec-form-media { grid-template-columns: minmax(0, 1fr); }
  .sec-audit-list { max-height: 40vh; }
  .sec-status-msg { max-width: 70vw; margin-left: 0; }
  .sec-reason-target, .sec-rule-item { flex-wrap: wrap; }
  .sec-rule-host { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .sec-back *,
  .sec-back *::before,
  .sec-back *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ===== 发布中心（Distribution） ===== */
/* ==========================================================================
   发布中心：全屏发布策略工作台
   结构：#dist-back 模态 → .dist-box → 顶栏 / 左导航 + 主区（9 个分区）/ 状态条
   约定：本段选择器全部以 .dist- / #dist- 前缀或限定在 .dist-back 内，不改动现有 UI；
        类名与 src/editor/distpanel.js 的 _mount() / 渲染函数对齐。
   ========================================================================== */

/* ---- 全屏模态 ---- */
.dist-back {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(5, 7, 12, 0.9);
  backdrop-filter: blur(2px);
}
.dist-back[hidden] { display: none; }
.dist-back [hidden] { display: none !important; }
body.is-distopen { overflow: hidden; }

.dist-box {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1840px, 98vw);
  height: min(1120px, 96vh);
  min-height: 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 26px 72px rgba(0, 0, 0, 0.66);
  overflow: hidden;
}

/* ---- 顶栏 ---- */
.dist-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 14px;
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  border-bottom: 1px solid var(--line-soft);
}
.dist-title { min-width: 0; }
.dist-title h3 {
  margin: 0;
  font: 600 14px/1.4 var(--font-ui);
  color: var(--text);
  letter-spacing: 0.01em;
}
.dist-sub {
  display: block;
  max-width: min(760px, 54vw);
  margin-top: 2px;
  overflow: hidden;
  font: 400 10.5px/1.45 var(--font-ui);
  color: var(--text-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dist-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.dist-actions .ghost-btn,
.dist-actions .primary-btn {
  height: 25px;
  padding: 0 9px;
  font-size: 11px;
  white-space: nowrap;
}
.dist-pick {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 500 10px/1.4 var(--font-ui);
  color: var(--text-3);
  white-space: nowrap;
}
.dist-pick select {
  width: auto;
  min-width: 96px;
  max-width: 150px;
  height: 25px;
  font-size: 11px;
}
#dist-hdr-channel { min-width: 118px; max-width: 168px; }
.dist-act-sep {
  flex: none;
  width: 1px;
  height: 16px;
  margin: 0 2px;
  background: var(--line);
}
.dist-badge {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 500 10px/1 var(--font-ui);
  color: var(--text-2);
  background: var(--bg-1);
  white-space: nowrap;
}
.dist-badge[data-tone="ok"] { color: var(--ok); border-color: rgba(78, 201, 160, 0.4); background: rgba(78, 201, 160, 0.1); }
.dist-badge[data-tone="warn"] { color: var(--warn); border-color: rgba(232, 184, 75, 0.4); background: rgba(232, 184, 75, 0.1); }
.dist-badge[data-tone="err"] { color: var(--err); border-color: rgba(229, 101, 122, 0.4); background: rgba(229, 101, 122, 0.1); }
.dist-badge[data-tone="info"] { color: var(--info); border-color: rgba(108, 156, 245, 0.4); background: rgba(108, 156, 245, 0.1); }

/* ---- 主体：左导航 + 主区 ---- */
.dist-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  overflow: hidden;
}
.dist-nav {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 2px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2b3242 transparent;
}
.dist-nav::-webkit-scrollbar { width: 8px; }
.dist-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  height: 33px;
  padding: 0 9px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  color: var(--text-2);
  font: 500 11px/1.2 var(--font-ui);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.dist-nav-item:hover { background: var(--bg-hover); color: var(--text); }
.dist-nav-item.is-cur {
  background: var(--accent-soft);
  border-color: rgba(232, 163, 61, 0.35);
  color: var(--accent);
}
.dist-nav-ico {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font: 600 9px/1 var(--font-mono);
  color: inherit;
  opacity: 0.72;
}
.dist-nav-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dist-nav-badge {
  flex: none;
  max-width: 64px;
  overflow: hidden;
  font: 400 9px/1 var(--font-mono);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dist-nav-badge.is-alert { color: var(--err); }
.dist-nav-item.is-cur .dist-nav-badge { color: var(--accent); }

.dist-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 3px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2b3242 transparent;
}
.dist-main::-webkit-scrollbar { width: 9px; }
.dist-main::-webkit-scrollbar-thumb { background: #2b3242; border-radius: 6px; }
.dist-pane { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dist-pane[hidden] { display: none; }

.dist-empty {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 11px 14px;
  border: 1px solid rgba(232, 184, 75, 0.4);
  border-left: 3px solid var(--warn);
  border-radius: var(--r-md);
  background: rgba(232, 184, 75, 0.08);
  font: 400 11px/1.65 var(--font-ui);
  color: var(--text-2);
}
.dist-empty b { color: var(--warn); font-size: 12px; }
.dist-empty code { font-family: var(--font-mono); color: var(--text); }
.dist-main.is-nodist .dist-pane { opacity: 0.92; }
.dist-main.is-nodist .dist-result { min-height: 24px; }

/* ---- 卡片 / 栅格 / 通用文本 ---- */
.dist-grid { display: grid; gap: 10px; min-width: 0; }
.dist-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dist-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.dist-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 13px;
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
}
.dist-card > h4,
.dist-card > h5 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  font: 600 12px/1.3 var(--font-ui);
  color: var(--text);
}
.dist-card > h5 { font-size: 11.5px; color: var(--text-2); }
.dist-card-sub {
  margin-top: 2px !important;
  padding-top: 8px;
  border-top: 1px dashed var(--line-soft);
  font: 600 11.5px/1.3 var(--font-ui);
  color: var(--text-2);
}
.dist-count {
  font: 400 9.5px/1 var(--font-mono);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.dist-count[data-tone="ok"] { color: var(--ok); }
.dist-count[data-tone="err"] { color: var(--err); }
.dist-count[data-tone="muted"] { color: var(--text-3); }

.dist-hint {
  font: 400 10.5px/1.7 var(--font-ui);
  color: var(--text-3);
  word-break: break-word;
}
.dist-hint code,
.dist-meta code,
.dist-muted code,
.dist-list code {
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--bg-0);
  border: 1px solid var(--line-soft);
  font: 400 10px/1.4 var(--font-mono);
  color: var(--text-2);
  word-break: break-all;
}
.dist-hint b { color: var(--text-2); }
.dist-muted { font: 400 10.5px/1.6 var(--font-ui); color: var(--text-3); }
.dist-meta {
  font: 400 10.5px/1.65 var(--font-ui);
  color: var(--text-2);
  word-break: break-word;
}
.dist-meta b { color: var(--text); font-weight: 600; }

.dist-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.dist-btn-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.dist-btn-row .ghost-btn,
.dist-btn-row .primary-btn {
  height: 25px;
  padding: 0 10px;
  font-size: 11px;
}
.dist-btn-row .ghost-btn[disabled],
.dist-btn-row .primary-btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.dist-list {
  margin: 0;
  padding-left: 18px;
  font: 400 10.5px/1.7 var(--font-ui);
  color: var(--text-2);
  word-break: break-word;
}
.dist-list li + li { margin-top: 2px; }
.dist-list li[data-tone="warn"] { color: var(--warn); }
.dist-list li[data-tone="block"] { color: var(--err); }
.dist-list li[data-tone="info"] { color: var(--text-2); }
.dist-sub-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 7px 9px;
  border: 1px dashed var(--line-soft);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.015);
}
.dist-sub-list > b { font: 600 10.5px/1.3 var(--font-ui); color: var(--text-2); }
.dist-error-list {
  margin: 0;
  padding-left: 18px;
  font: 400 10.5px/1.7 var(--font-ui);
  color: var(--err);
  word-break: break-word;
}
.dist-reason-list { color: var(--text-2); }

.dist-placeholder {
  padding: 9px 11px;
  border: 1px dashed var(--line-soft);
  border-radius: var(--r-sm);
  font: 400 10.5px/1.6 var(--font-ui);
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.012);
}

/* ---- 表单控件 ---- */
.dist-form { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.dist-form-3 > .dist-field { flex: 1 1 150px; }
.dist-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font: 500 10px/1.4 var(--font-ui);
  color: var(--text-3);
}
.dist-field > span { color: var(--text-3); }
.dist-field-inline { flex-direction: row; align-items: center; gap: 6px; flex: 0 1 auto; }
.dist-field-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}
.dist-input,
.dist-textarea {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0 8px;
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  font: 400 11.5px/1.4 var(--font-ui);
  outline: none;
}
.dist-input { height: 27px; }
.dist-input:focus,
.dist-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}
.dist-textarea {
  min-height: 84px;
  padding: 7px 8px;
  resize: vertical;
  font-size: 11px;
  line-height: 1.55;
}
.dist-input[type="number"] { font-variant-numeric: tabular-nums; }
.dist-mono-input,
.dist-hash {
  font-family: var(--font-mono) !important;
  font-size: 10.5px !important;
  letter-spacing: 0.01em;
}
.dist-hash { color: var(--text-2); word-break: break-all; }

.dist-pre {
  margin: 0;
  max-height: 240px;
  overflow: auto;
  padding: 8px 10px;
  background: var(--bg-0);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  font: 400 10.5px/1.55 var(--font-mono);
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-all;
  scrollbar-width: thin;
}
.dist-cmd { color: var(--accent); }
.dist-release-pre { max-height: 200px; }
.dist-pre:empty { display: none; }

/* ---- 版本四件套 ---- */
.dist-version-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.dist-bump-row { display: flex; flex-wrap: wrap; gap: 6px; }
.dist-bump-row .ghost-btn {
  height: 23px;
  padding: 0 8px;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}
.dist-version-result:empty,
.dist-result:empty { display: none; }
.dist-kv {
  display: flex;
  flex-direction: column;
  margin: 0;
  border-top: 1px solid var(--line-soft);
}
.dist-kv-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 1px;
  border-bottom: 1px solid var(--line-soft);
  font: 400 10.5px/1.5 var(--font-ui);
}
.dist-kv-row dt { flex: none; color: var(--text-3); }
.dist-kv-row dd {
  margin: 0;
  min-width: 0;
  color: var(--text-2);
  text-align: right;
  word-break: break-all;
}
.dist-kv-row dd code { font-family: var(--font-mono); }
.dist-kv-row dd b { color: var(--text); }
.dist-kv-row.is-ok dd { color: var(--ok); }
.dist-kv-row.is-err dd { color: var(--err); }
.dist-kv-row.is-warn dd { color: var(--warn); }

.dist-notes-card { gap: 10px; }
.dist-notes-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.5fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
}
.dist-cmp-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  min-width: 0;
}

/* ---- 通道卡 / 灰度 ---- */
.dist-channel-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}
.dist-channel-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 9px 10px;
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.dist-channel-card:hover { background: var(--bg-hover); }
.dist-channel-card.is-on {
  border-color: rgba(232, 163, 61, 0.55);
  background: var(--accent-soft);
  color: var(--text);
}
.dist-channel-name {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font: 600 12px/1.3 var(--font-ui);
  color: var(--text);
}
.dist-channel-name em { font: 400 10px/1 var(--font-mono); color: var(--text-3); font-style: normal; }
.dist-channel-card.is-on .dist-channel-name { color: var(--accent); }
.dist-channel-desc { font: 400 10px/1.55 var(--font-ui); color: var(--text-3); }
.dist-channel-badge {
  position: absolute;
  top: 7px;
  right: 8px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 9px/1.4 var(--font-ui);
}
.dist-channel-cur { color: var(--accent); }

.dist-toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  min-width: 0;
}
.dist-check {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font: 400 10.5px/1.5 var(--font-ui);
  color: var(--text-2);
  cursor: pointer;
}
.dist-check:hover { color: var(--text); }
.dist-check input[type="checkbox"] {
  flex: none;
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.dist-check input[type="checkbox"]:disabled { cursor: not-allowed; }
.dist-check-inline { align-self: flex-end; padding-bottom: 4px; }

.dist-range-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 400 10px/1 var(--font-mono);
  color: var(--text-3);
}
.dist-range {
  flex: 1 1 auto;
  min-width: 0;
  height: 4px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.dist-bucket-demo {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 8px;
  border-top: 1px dashed var(--line-soft);
}
.dist-bucket-demo > h5 {
  margin: 0;
  font: 600 11px/1.3 var(--font-ui);
  color: var(--text-2);
}
.dist-bucket-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px 9px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: var(--bg-0);
}
.dist-bucket-title { font: 400 10.5px/1.5 var(--font-ui); color: var(--text-2); }
.dist-bucket-title b { color: var(--accent); font-family: var(--font-mono); }
.dist-bucket-list { display: flex; flex-direction: column; gap: 3px; }
.dist-bucket-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 34px 44px;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font: 400 10px/1.5 var(--font-ui);
}
.dist-bucket-seed {
  overflow: hidden;
  font: 400 10px/1.4 var(--font-mono);
  color: var(--text-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dist-bucket-bar {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-0);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.dist-bucket-bar > i {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: translateX(-1px);
}
.dist-bucket-num {
  font: 400 10px/1 var(--font-mono);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.dist-bucket-flag {
  font: 400 9.5px/1 var(--font-ui);
  text-align: right;
  color: var(--text-3);
}
.dist-bucket-flag[data-tone="ok"] { color: var(--ok); }
.dist-bucket-flag[data-tone="warn"] { color: var(--warn); }
.dist-bucket-flag[data-tone="muted"] { color: var(--text-3); }

.dist-mini-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: var(--bg-0);
  font: 400 10px/1.6 var(--font-ui);
  color: var(--text-3);
  min-width: 0;
}
.dist-mini-card b { font: 600 10.5px/1.4 var(--font-ui); color: var(--text-2); }
.dist-mini-card span { word-break: break-word; }

/* ---- 构建矩阵 ---- */
.dist-chip-row { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.dist-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 25px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-0);
  color: var(--text-2);
  font: 500 10.5px/1 var(--font-ui);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.dist-chip em { font: 400 9px/1 var(--font-mono); color: var(--text-3); font-style: normal; }
.dist-chip:hover { background: var(--bg-hover); color: var(--text); }
.dist-chip.is-on {
  border-color: rgba(232, 163, 61, 0.55);
  background: var(--accent-soft);
  color: var(--accent);
}
.dist-chip.is-on em { color: var(--accent); opacity: 0.8; }
.dist-chip[data-tone="ok"] { color: var(--ok); border-color: rgba(78, 201, 160, 0.45); background: rgba(78, 201, 160, 0.08); }
.dist-chip[data-tone="warn"] { color: var(--warn); border-color: rgba(232, 184, 75, 0.45); background: rgba(232, 184, 75, 0.08); }
.dist-chip[data-tone="info"] { color: var(--info); border-color: rgba(108, 156, 245, 0.4); background: rgba(108, 156, 245, 0.08); }
.dist-chip[data-tone="muted"] { color: var(--text-3); }

.dist-table-wrap {
  min-width: 0;
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  scrollbar-width: thin;
}
.dist-table {
  width: 100%;
  border-collapse: collapse;
  font: 400 10.5px/1.5 var(--font-ui);
  color: var(--text-2);
}
.dist-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 6px 9px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--line);
  font: 600 10px/1.3 var(--font-ui);
  color: var(--text-3);
  text-align: left;
  white-space: nowrap;
}
.dist-table td {
  padding: 6px 9px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  word-break: break-word;
}
.dist-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.dist-table tbody tr:last-child td { border-bottom: none; }
.dist-td-form { color: var(--text); white-space: nowrap; }
.dist-td-platform { white-space: nowrap; }
.dist-td-platform em { font: 400 9.5px/1 var(--font-mono); color: var(--text-3); font-style: normal; }
.dist-td-out code {
  font: 400 10px/1.5 var(--font-mono);
  color: var(--text-2);
  word-break: break-all;
}
.dist-td-sign,
.dist-td-updater { color: var(--text-3); }
.dist-td-size { white-space: nowrap; font-variant-numeric: tabular-nums; }
.dist-matrix-note:empty { display: none; }

/* ---- 发布检查 ---- */
.dist-check-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}
.dist-check-item {
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr) auto;
  grid-template-areas: "box name sev" "box detail detail";
  align-items: start;
  gap: 1px 7px;
  padding: 5px 6px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  cursor: pointer;
  min-width: 0;
}
.dist-check-item:hover { background: var(--bg-hover); }
.dist-check-item input[type="checkbox"] {
  grid-area: box;
  width: 13px;
  height: 13px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.dist-check-name {
  grid-area: name;
  font: 500 11px/1.4 var(--font-ui);
  color: var(--text);
  word-break: break-word;
}
.dist-check-sev {
  grid-area: sev;
  align-self: start;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 400 9px/1.3 var(--font-ui);
  color: var(--text-3);
  white-space: nowrap;
}
.dist-check-sev[data-sev="block"] { color: var(--err); border-color: rgba(229, 101, 122, 0.4); }
.dist-check-sev[data-sev="warn"] { color: var(--warn); border-color: rgba(232, 184, 75, 0.4); }
.dist-check-detail {
  grid-area: detail;
  font: 400 9.5px/1.5 var(--font-ui);
  color: var(--text-3);
  word-break: break-word;
}
.dist-check-item[data-status="pass"] .dist-check-name { color: var(--text-2); }

.dist-verdict-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-1);
  min-width: 0;
}
.dist-verdict-card.is-ok { border-left-color: var(--ok); background: rgba(78, 201, 160, 0.05); }
.dist-verdict-card.is-err { border-left-color: var(--err); background: rgba(229, 101, 122, 0.05); }
.dist-verdict-card.is-warn { border-left-color: var(--warn); background: rgba(232, 184, 75, 0.05); }
.dist-verdict-card.is-info { border-left-color: var(--info); background: rgba(108, 156, 245, 0.04); }
.dist-verdict-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.dist-verdict {
  font: 600 11.5px/1.4 var(--font-ui);
  color: var(--text);
}
.dist-verdict-card.is-ok .dist-verdict { color: var(--ok); }
.dist-verdict-card.is-err .dist-verdict { color: var(--err); }
.dist-verdict-card.is-warn .dist-verdict { color: var(--warn); }
.dist-verdict-card.is-info .dist-verdict { color: var(--info); }
.dist-verdict-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dist-score {
  margin-left: auto;
  font: 600 11px/1 var(--font-mono);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.dist-score-bar {
  height: 5px;
  border-radius: 999px;
  background: var(--bg-0);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.dist-score-bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--err), var(--warn) 55%, var(--ok));
  border-radius: 999px;
}
.dist-check-results {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}
.dist-check-result {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 2px 8px;
  align-items: baseline;
  min-width: 0;
  padding: 2px 1px;
  font: 400 10.5px/1.5 var(--font-ui);
}
.dist-check-result b { color: var(--text-2); font-weight: 500; word-break: break-word; }
.dist-check-status {
  font: 400 9.5px/1.5 var(--font-ui);
  text-align: right;
  color: var(--text-3);
  white-space: nowrap;
}
.dist-check-result[data-status="pass"] .dist-check-status { color: var(--ok); }
.dist-check-result[data-status="warn"] .dist-check-status { color: var(--warn); }
.dist-check-result[data-status="fail"] .dist-check-status { color: var(--err); }
.dist-check-result[data-status="skip"] .dist-check-status { color: var(--text-3); }
.dist-check-msg {
  grid-column: 2;
  font: 400 9.5px/1.5 var(--font-ui);
  color: var(--text-3);
  word-break: break-word;
}
.dist-blockers,
.dist-warnings {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px 8px;
  border: 1px solid rgba(229, 101, 122, 0.35);
  border-radius: var(--r-sm);
  background: rgba(229, 101, 122, 0.07);
  font: 400 10px/1.55 var(--font-ui);
  color: var(--text-2);
}
.dist-warnings {
  border-color: rgba(232, 184, 75, 0.35);
  background: rgba(232, 184, 75, 0.07);
}
.dist-blockers > b { color: var(--err); font-size: 10.5px; }
.dist-warnings > b { color: var(--warn); font-size: 10.5px; }
.dist-blockers ul,
.dist-warnings ul { margin: 0; padding-left: 16px; }
.dist-blockers li,
.dist-warnings li { word-break: break-word; }

/* ---- 更新决策 ---- */
.dist-samples { display: flex; flex-wrap: wrap; gap: 5px; }
.dist-samples .ghost-btn { height: 23px; padding: 0 8px; font-size: 10.5px; }
.dist-manifest-ta { min-height: 168px; font-family: var(--font-mono); font-size: 10px; }

.dist-decision {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-1);
  min-width: 0;
}
.dist-decision.is-update { border-left-color: var(--ok); background: rgba(78, 201, 160, 0.05); }
.dist-decision.is-forced { border-left-color: var(--warn); background: rgba(232, 184, 75, 0.05); }
.dist-decision.is-blocked { border-left-color: var(--err); background: rgba(229, 101, 122, 0.05); }
.dist-decision.is-none { border-left-color: var(--info); background: rgba(108, 156, 245, 0.04); }
.dist-decision.is-update .dist-verdict { color: var(--ok); }
.dist-decision.is-forced .dist-verdict { color: var(--warn); }
.dist-decision.is-blocked .dist-verdict { color: var(--err); }
.dist-decision.is-none .dist-verdict { color: var(--info); }
.dist-decision-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.dist-decision-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dist-decision-code {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font: 400 9.5px/1.6 var(--font-mono);
  color: var(--text-3);
  background: var(--bg-0);
}
.dist-decision-target {
  padding: 1px 6px;
  border: 1px solid rgba(232, 163, 61, 0.35);
  border-radius: 999px;
  font: 400 9.5px/1.6 var(--font-mono);
  color: var(--accent);
  background: var(--accent-soft);
}
.dist-reason { font: 400 10.5px/1.65 var(--font-ui); color: var(--text-2); word-break: break-word; }
.dist-decision-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font: 400 10px/1.6 var(--font-ui);
  color: var(--text-3);
}
.dist-decision-meta b { color: var(--text-2); font-family: var(--font-mono); font-weight: 500; }
.dist-raw { min-width: 0; }
.dist-raw > summary {
  font: 400 10px/1.6 var(--font-ui);
  color: var(--text-3);
  cursor: pointer;
}
.dist-raw > summary:hover { color: var(--text-2); }
.dist-raw pre {
  margin: 5px 0 0;
  max-height: 220px;
  overflow: auto;
  padding: 7px 9px;
  background: var(--bg-0);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  font: 400 9.5px/1.5 var(--font-mono);
  color: var(--text-3);
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---- 完整性与 SBOM ---- */
.dist-artifacts { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dist-artifact-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(76px, 0.7fr)) minmax(72px, 0.6fr);
  grid-template-areas:
    "name form plat arch size"
    "sha sha url url actions";
  gap: 6px 8px;
  padding: 7px 9px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: var(--bg-0);
  min-width: 0;
}
.dist-art-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  font: 500 9.5px/1.3 var(--font-ui);
  color: var(--text-3);
}
.dist-art-field .dist-input,
.dist-art-field .field-select { height: 25px; font-size: 10.5px; }
.dist-art-name { grid-area: name; }
.dist-art-field:nth-of-type(2) { grid-area: form; }
.dist-art-field:nth-of-type(3) { grid-area: plat; }
.dist-art-field:nth-of-type(4) { grid-area: arch; }
.dist-art-field:nth-of-type(5) { grid-area: size; }
.dist-art-sha { grid-area: sha; }
.dist-art-url { grid-area: url; }
.dist-art-actions {
  grid-area: actions;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 5px;
}
.dist-art-actions .ghost-btn { height: 25px; padding: 0 8px; font-size: 10.5px; }
.dist-checksums { max-height: 170px; }
.dist-artifact-result:empty { display: none; }

/* ---- 迁移链 ---- */
.dist-mig-plan {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding-left: 0;
  list-style: none;
  counter-reset: distmig;
}
.dist-mig-step {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 9px;
  border-left: 2px solid var(--line);
  background: var(--bg-0);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font: 400 10px/1.55 var(--font-ui);
  color: var(--text-3);
  min-width: 0;
}
.dist-mig-step b { font: 500 10.5px/1.4 var(--font-ui); color: var(--text-2); }
.dist-mig-step span { word-break: break-word; }

/* ---- 企业策略 ---- */
.dist-policy-conflicts:empty { display: none; }
.dist-ls {
  padding: 6px 8px;
  border: 1px dashed var(--line-soft);
  border-radius: var(--r-sm);
  font: 400 9.5px/1.6 var(--font-mono);
  color: var(--text-3);
  word-break: break-all;
}
#dist-pol-proxy,
#dist-pol-minversion { font-family: var(--font-mono); font-size: 10.5px; }
.dist-policy-json { max-height: 280px; }

/* ---- 首启与运行时 ---- */
.dist-cap-kv { margin-bottom: 2px; }
#dist-runtime-result .dist-kv,
#dist-firstrun-result .dist-kv { margin-top: 2px; }

/* ---- 状态条 ---- */
.dist-status {
  flex: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 16px;
  min-height: 26px;
  padding: 4px 14px;
  background: var(--bg-1);
  border-top: 1px solid var(--line-soft);
  font: 400 10px/1.5 var(--font-ui);
  color: var(--text-3);
}
.dist-status > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dist-status-msg {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
  color: var(--text-2);
}
.dist-status-msg[data-kind="ok"] { color: var(--ok); }
.dist-status-msg[data-kind="warn"] { color: var(--warn); }
.dist-status-msg[data-kind="err"] { color: var(--err); }

/* ---- 响应式 ---- */
@media (max-width: 1320px) {
  .dist-body { grid-template-columns: 188px minmax(0, 1fr); }
  .dist-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dist-notes-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dist-notes-grid > .dist-field:first-child { grid-column: 1 / -1; }
  .dist-field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dist-artifact-row {
    grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(70px, 0.7fr));
    grid-template-areas:
      "name form plat arch"
      "sha sha size size"
      "url url url actions";
  }
}
@media (max-width: 1040px) {
  .dist-body { grid-template-columns: 168px minmax(0, 1fr); gap: 8px; }
  .dist-grid-2,
  .dist-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .dist-channel-cards { grid-template-columns: minmax(0, 1fr); }
  .dist-toggle-grid { grid-template-columns: minmax(0, 1fr); }
  .dist-notes-grid { grid-template-columns: minmax(0, 1fr); }
  .dist-notes-grid > .dist-field:first-child { grid-column: auto; }
  .dist-field-row { grid-template-columns: minmax(0, 1fr); }
  .dist-sub { max-width: 62vw; }
  .dist-status { gap: 3px 10px; }
  .dist-status > span:not(.dist-status-msg) { display: none; }
}
@media (max-width: 760px) {
  .dist-body { grid-template-columns: minmax(0, 1fr); }
  .dist-nav { flex-direction: row; flex-wrap: wrap; overflow: visible; }
  .dist-nav-item { height: 28px; padding: 0 8px; }
  .dist-nav-ico { display: none; }
  .dist-nav-badge { display: none; }
  .dist-box { height: 96vh; }
  .dist-main { padding-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .dist-back *,
  .dist-back *::before,
  .dist-back *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ===== 版本更新（Updater） ===== */
/* ==========================================================================
   版本更新中心：全屏更新工作台（检查 / 下载 / 校验 / 激活 / 回滚 / 设置）
   结构：#upd-back 模态 → .upd-box → 顶栏 / 主区（6 个上下分区：环境 / 更新 / 本机版本 / 演示 / 分享下载 / 帮助）/ 状态条
   约定：本段选择器全部以 .upd- / #upd- 前缀或限定在 .upd-back 内，不改动现有
         UI；类名与 src/editor/updatepanel.js 的 _mount() / 渲染函数对齐。
   ========================================================================== */

/* ---- 全屏模态 ---- */
.upd-back {
  position: fixed;
  inset: 0;
  z-index: 72;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(5, 7, 12, 0.9);
  backdrop-filter: blur(2px);
}
.upd-back[hidden] { display: none; }
.upd-back [hidden] { display: none !important; }
body.is-updopen { overflow: hidden; }

.upd-box {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1420px, 97vw);
  height: min(1080px, 96vh);
  min-height: 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 26px 72px rgba(0, 0, 0, 0.66);
  overflow: hidden;
}

/* ---- 顶栏 ---- */
.upd-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 14px;
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  border-bottom: 1px solid var(--line-soft);
}
.upd-title { min-width: 0; }
.upd-title h3 {
  margin: 0;
  font: 600 14px/1.4 var(--font-ui);
  color: var(--text);
  letter-spacing: 0.01em;
}
.upd-sub {
  display: block;
  max-width: min(760px, 54vw);
  margin-top: 2px;
  overflow: hidden;
  font: 400 10.5px/1.45 var(--font-ui);
  color: var(--text-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upd-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.upd-actions .ghost-btn,
.upd-actions .primary-btn {
  height: 25px;
  padding: 0 9px;
  font-size: 11px;
  white-space: nowrap;
}
.upd-act-sep {
  flex: none;
  width: 1px;
  height: 16px;
  margin: 0 2px;
  background: var(--line);
}
.upd-badge {
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  height: 19px;
  padding: 0 7px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 500 10px/1 var(--font-ui);
  color: var(--text-2);
  background: var(--bg-1);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upd-badge[data-tone="ok"] { color: var(--ok); border-color: rgba(78, 201, 160, 0.4); background: rgba(78, 201, 160, 0.1); }
.upd-badge[data-tone="warn"] { color: var(--warn); border-color: rgba(232, 184, 75, 0.4); background: rgba(232, 184, 75, 0.1); }
.upd-badge[data-tone="err"] { color: var(--err); border-color: rgba(229, 101, 122, 0.4); background: rgba(229, 101, 122, 0.1); }
.upd-badge[data-tone="info"] { color: var(--info); border-color: rgba(108, 156, 245, 0.4); background: rgba(108, 156, 245, 0.1); }
.upd-badge[data-tone="accent"] { color: var(--accent); border-color: rgba(232, 163, 61, 0.42); background: var(--accent-soft); }
.upd-badge[data-tone="muted"] { color: var(--text-3); }

/* ---- 主区（上下分区） ---- */
.upd-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2b3242 transparent;
}
.upd-body::-webkit-scrollbar { width: 9px; }
.upd-body::-webkit-scrollbar-thumb { background: #2b3242; border-radius: 6px; }
.upd-body.is-noupd .upd-sec { opacity: 0.94; }

.upd-sec { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.upd-sec-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
}
.upd-sec-head h4 {
  margin: 0;
  font: 600 12.5px/1.35 var(--font-ui);
  color: var(--text);
  letter-spacing: 0.01em;
}
.upd-count {
  font: 400 9.5px/1.45 var(--font-ui);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.upd-sec-head .ghost-btn { margin-left: auto; height: 23px; padding: 0 8px; font-size: 10.5px; }

.upd-empty {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 11px 14px;
  border: 1px solid rgba(232, 184, 75, 0.4);
  border-left: 3px solid var(--warn);
  border-radius: var(--r-md);
  background: rgba(232, 184, 75, 0.08);
  font: 400 11px/1.65 var(--font-ui);
  color: var(--text-2);
}
.upd-empty b { color: var(--warn); font-size: 12px; }
.upd-empty code { font-family: var(--font-mono); color: var(--text); }

/* ---- 卡片 / 栅格 ---- */
.upd-grid { display: grid; gap: 10px; min-width: 0; }
.upd-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.upd-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 13px;
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
}
.upd-card > h5 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  font: 600 11.5px/1.3 var(--font-ui);
  color: var(--text-2);
}
.upd-update-card { gap: 10px; }

/* ---- 通用文本 / 提示 ---- */
.upd-hint {
  font: 400 10.5px/1.7 var(--font-ui);
  color: var(--text-3);
  word-break: break-word;
}
.upd-hint code,
.upd-muted code,
.upd-help-list code {
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--bg-0);
  border: 1px solid var(--line-soft);
  font: 400 10px/1.4 var(--font-mono);
  color: var(--text-2);
  word-break: break-all;
}
.upd-hint b { color: var(--text-2); }
.upd-muted { font: 400 10.5px/1.6 var(--font-ui); color: var(--text-3); }
.upd-meta { font: 400 10.5px/1.6 var(--font-ui); color: var(--text-2); }

/* ---- 键值表 ---- */
.upd-kv {
  display: flex;
  flex-direction: column;
  margin: 0;
  border-top: 1px solid var(--line-soft);
}
.upd-kv-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 1px;
  border-bottom: 1px solid var(--line-soft);
  font: 400 10.5px/1.5 var(--font-ui);
}
.upd-kv-row dt { flex: none; color: var(--text-3); }
.upd-kv-row dd {
  margin: 0;
  min-width: 0;
  color: var(--text-2);
  text-align: right;
  word-break: break-all;
}
.upd-kv-row dd code { font-family: var(--font-mono); }
.upd-kv-row dd b { color: var(--text); }

/* ---- 表单控件 ---- */
.upd-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font: 500 10px/1.4 var(--font-ui);
  color: var(--text-3);
}
.upd-field-inline {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  padding-bottom: 3px;
  white-space: nowrap;
}
.upd-field-inline input[type="checkbox"] { accent-color: var(--accent); }
.upd-field-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1fr) minmax(110px, 0.6fr);
  gap: 8px;
  align-items: end;
  min-width: 0;
}
.upd-input,
.upd-select {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0 8px;
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  font: 400 11.5px/1.4 var(--font-ui);
  outline: none;
}
.upd-input { height: 27px; }
.upd-select { height: 27px; cursor: pointer; }
.upd-input:focus,
.upd-select:focus,
.upd-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}
.upd-textarea {
  min-height: 96px;
  padding: 7px 8px;
  resize: vertical;
  font: 400 10.5px/1.55 var(--font-mono);
  white-space: pre;
}
.upd-mono-input { font-family: var(--font-mono) !important; font-size: 10.5px !important; }
.upd-input[type="number"] { font-variant-numeric: tabular-nums; }

/* ---- 按钮行 ---- */
.upd-btn-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.upd-btn-row .ghost-btn,
.upd-btn-row .primary-btn {
  height: 25px;
  padding: 0 10px;
  font-size: 11px;
  white-space: nowrap;
}
.upd-btn-row .ghost-btn[disabled],
.upd-btn-row .primary-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.upd-btn-hint {
  flex: 1 1 220px;
  min-width: 0;
  font: 400 10px/1.55 var(--font-ui);
  color: var(--text-3);
}

/* ---- 能力矩阵 ---- */
.upd-caps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
  min-width: 0;
}
.upd-cap-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 3px 6px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: var(--bg-0);
  font: 400 10.5px/1.5 var(--font-ui);
}
.upd-cap-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upd-cap-val { flex: none; color: var(--ok); font-weight: 600; }
.upd-cap-row[data-tone="warn"] .upd-cap-val { color: var(--warn); }

.upd-mode { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.upd-mode-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.upd-mode-badge {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 600 10.5px/1 var(--font-ui);
  color: var(--text-2);
  background: var(--bg-0);
  white-space: nowrap;
}
.upd-mode-badge[data-tone="ok"] { color: var(--ok); border-color: rgba(78, 201, 160, 0.45); background: rgba(78, 201, 160, 0.08); }
.upd-mode-badge[data-tone="warn"] { color: var(--warn); border-color: rgba(232, 184, 75, 0.45); background: rgba(232, 184, 75, 0.08); }
.upd-mode-badge[data-tone="err"] { color: var(--err); border-color: rgba(229, 101, 122, 0.45); background: rgba(229, 101, 122, 0.08); }
.upd-mode-id {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg-0);
  font: 400 9.5px/1.6 var(--font-mono);
  color: var(--text-3);
}
.upd-mode-env { font: 400 10px/1.6 var(--font-ui); color: var(--text-3); word-break: break-word; }
.upd-mode-env code { font-family: var(--font-mono); }

/* ---- 更新卡 ---- */
.upd-update-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.upd-update-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.upd-target {
  padding: 1px 9px;
  border: 1px solid rgba(232, 163, 61, 0.45);
  border-radius: 999px;
  background: var(--accent-soft);
  font: 600 12px/1.5 var(--font-mono);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.upd-update-head .upd-muted { margin-left: auto; }

.upd-notes {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 7px 9px;
  border: 1px dashed var(--line-soft);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.015);
}
.upd-notes > b { font: 600 10.5px/1.3 var(--font-ui); color: var(--text-2); }
.upd-notes-body {
  max-height: 150px;
  overflow: auto;
  font: 400 10.5px/1.65 var(--font-ui);
  color: var(--text-2);
  word-break: break-word;
  scrollbar-width: thin;
}

.upd-placeholder {
  padding: 9px 11px;
  border: 1px dashed var(--line-soft);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.012);
  font: 400 10.5px/1.65 var(--font-ui);
  color: var(--text-3);
}

.upd-checking {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px dashed var(--line-soft);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.015);
  font: 400 11px/1.5 var(--font-ui);
  color: var(--text-2);
}
.upd-spinner {
  flex: none;
  width: 13px;
  height: 13px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: upd-spin 0.8s linear infinite;
}
@keyframes upd-spin { to { transform: rotate(360deg); } }

.upd-error-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid rgba(229, 101, 122, 0.45);
  border-left: 3px solid var(--err);
  border-radius: var(--r-sm);
  background: rgba(229, 101, 122, 0.07);
  font: 400 10.5px/1.65 var(--font-ui);
  color: var(--text-2);
}
.upd-error-card b { font: 600 11.5px/1.35 var(--font-ui); color: var(--err); }
.upd-error-card code {
  padding: 1px 6px;
  border: 1px solid rgba(229, 101, 122, 0.4);
  border-radius: 3px;
  background: var(--bg-0);
  font: 400 9.5px/1.6 var(--font-mono);
  color: var(--err);
}
.upd-error-card p { margin: 0; word-break: break-word; }

.upd-blocked {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 9px 11px;
  border: 1px solid rgba(232, 184, 75, 0.45);
  border-left: 3px solid var(--warn);
  border-radius: var(--r-sm);
  background: rgba(232, 184, 75, 0.07);
  font: 400 10.5px/1.65 var(--font-ui);
  color: var(--text-2);
}
.upd-blocked b { font: 600 11.5px/1.35 var(--font-ui); color: var(--warn); }
.upd-blocked code {
  padding: 1px 6px;
  border: 1px solid rgba(232, 184, 75, 0.4);
  border-radius: 3px;
  background: var(--bg-0);
  font: 400 9.5px/1.6 var(--font-mono);
  color: var(--warn);
}
.upd-blocked span { word-break: break-word; }

.upd-success {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid rgba(78, 201, 160, 0.42);
  border-left: 3px solid var(--ok);
  border-radius: var(--r-sm);
  background: rgba(78, 201, 160, 0.07);
  font: 400 10.5px/1.65 var(--font-ui);
  color: var(--text-2);
}
.upd-success > b { font: 600 11.5px/1.35 var(--font-ui); color: var(--ok); }
.upd-success > span { word-break: break-word; }
.upd-success[data-tone="warn"] {
  border-color: rgba(232, 184, 75, 0.42);
  border-left-color: var(--warn);
  background: rgba(232, 184, 75, 0.07);
}
.upd-success[data-tone="warn"] > b { color: var(--warn); }

/* ---- 进度条 ---- */
.upd-progress { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.upd-progress[hidden] { display: none; }
.upd-progress-track {
  position: relative;
  height: 7px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--bg-0);
}
.upd-progress-track > i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #f0bf6e);
  transition: width 0.16s linear;
}
.upd-progress-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  font: 400 10px/1.5 var(--font-ui);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.upd-progress-meta > span:last-child { color: var(--text-2); }
#upd-progress-text { color: var(--accent); font-family: var(--font-mono); }

/* ---- 本机版本 ---- */
.upd-installed { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.upd-installed .upd-placeholder { margin: 0; }
.upd-installed-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: var(--bg-0);
}
.upd-installed-row.is-active { border-color: rgba(232, 163, 61, 0.4); background: var(--accent-soft); }
.upd-installed-version {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: none;
  font: 600 11.5px/1.4 var(--font-mono);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.upd-installed-meta {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font: 400 10px/1.5 var(--font-ui);
  color: var(--text-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upd-installed-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.upd-installed-actions .ghost-btn { height: 23px; padding: 0 8px; font-size: 10.5px; }
.upd-installed-actions .ghost-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.upd-tag {
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 500 9px/1.5 var(--font-ui);
  font-style: normal;
  color: var(--text-3);
}
.upd-tag[data-tone="ok"] { color: var(--accent); border-color: rgba(232, 163, 61, 0.45); }
.upd-tag[data-tone="info"] { color: var(--info); border-color: rgba(108, 156, 245, 0.42); }

/* ---- 演示 / 自定义清单 ---- */
.upd-parse-result { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.upd-parse-result:empty { display: none; }
.upd-parse-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.upd-parse-head > b { font: 600 11px/1.35 var(--font-ui); color: var(--text-2); }
#upd-manifest-result .upd-kv { margin-top: 2px; }

/* ---- 帮助 ---- */
.upd-help-list {
  margin: 0;
  padding-left: 18px;
  font: 400 10.5px/1.7 var(--font-ui);
  color: var(--text-2);
  word-break: break-word;
}
.upd-help-list li + li { margin-top: 3px; }
.upd-help-list b { color: var(--text); font-weight: 600; }
.upd-code {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: var(--bg-0);
  font: 400 10px/1.6 var(--font-mono);
  color: var(--text-2);
  white-space: pre;
  scrollbar-width: thin;
}

/* ---- 状态条 ---- */
.upd-status {
  flex: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 16px;
  min-height: 26px;
  padding: 4px 14px;
  background: var(--bg-1);
  border-top: 1px solid var(--line-soft);
  font: 400 10px/1.5 var(--font-ui);
  color: var(--text-3);
}
.upd-status > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upd-status-msg {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
  color: var(--text-2);
}
.upd-status-msg[data-kind="ok"] { color: var(--ok); }
.upd-status-msg[data-kind="warn"] { color: var(--warn); }
.upd-status-msg[data-kind="err"] { color: var(--err); }

/* ---- 响应式 ---- */
@media (max-width: 1320px) {
  .upd-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .upd-field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upd-caps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1040px) {
  .upd-sub { max-width: 62vw; }
  .upd-caps { grid-template-columns: minmax(0, 1fr); }
  .upd-field-row { grid-template-columns: minmax(0, 1fr); }
  .upd-status { gap: 3px 10px; }
  .upd-status > span:not(.upd-status-msg) { display: none; }
}
@media (max-width: 760px) {
  .upd-box { height: 96vh; }
  .upd-actions { justify-content: flex-start; }
  .upd-update-head .upd-muted { display: none; }
  .upd-installed-actions { width: 100%; }
  .upd-code { max-height: 160px; }
}

@media (prefers-reduced-motion: reduce) {
  .upd-back *,
  .upd-back *::before,
  .upd-back *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ===== 分享下载（版本更新中心 · 第 ⑤ 分区） ===== */
/* 只追加 .upd-share-* / .upd-share 选择器，不改动既有 upd 段；样式并入 upd 段末尾。 */
.upd-share {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.upd-share-empty { margin: 0; }
.upd-share-base-card,
.upd-share-links-card { min-width: 0; }
.upd-share-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.upd-share-head > h5 { margin: 0; min-width: 0; }
.upd-share-head-btns {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-left: auto;
  min-width: 0;
}
.upd-share-head-btns .ghost-btn {
  height: 23px;
  padding: 0 8px;
  font-size: 10.5px;
  white-space: nowrap;
}
.upd-share-head-btns .ghost-btn[disabled] { opacity: 0.42; cursor: not-allowed; }
.upd-share-links { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.upd-share-link {
  display: grid;
  grid-template-columns: minmax(64px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: var(--bg-0);
}
.upd-share-link-label {
  font: 500 10px/1.4 var(--font-ui);
  color: var(--text-3);
  white-space: nowrap;
}
.upd-share-url {
  min-width: 0;
  overflow: hidden;
  font: 400 10px/1.5 var(--font-mono);
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: text;
  -webkit-user-select: text;
}
.upd-share-link .upd-share-copy {
  height: 21px;
  padding: 0 7px;
  font-size: 10px;
  white-space: nowrap;
}
.upd-share-link .upd-share-copy[disabled] { opacity: 0.4; cursor: not-allowed; }
.upd-share-base-card .upd-kv { margin: 0; }
#upd-share-links .upd-hint { margin-top: 2px; }

@media (max-width: 760px) {
  .upd-share-head-btns { margin-left: 0; }
  .upd-share-link { grid-template-columns: minmax(0, 1fr) auto; }
  .upd-share-link-label { grid-column: 1 / -1; color: var(--text-2); }
}

@media (prefers-reduced-motion: reduce) {
  .upd-share *,
  .upd-share *::before,
  .upd-share *::after { transition: none !important; animation: none !important; }
}

/* ===== 应用内下载（下载网域 / DownloadPanel） ===== */
.dl-back { position: fixed; inset: 0; z-index: 76; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(4, 7, 12, .62); backdrop-filter: blur(4px); }
.dl-back[hidden] { display: none; }
.dl-box { width: min(780px, 96vw); max-height: 90vh; overflow: auto; background: #101621; border: 1px solid #263246; border-radius: 16px; box-shadow: 0 28px 90px rgba(0, 0, 0, .55); color: #dce6f5; }
.dl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 20px 22px 14px; border-bottom: 1px solid #1f2a3b; }
.dl-head h3 { margin: 0 0 4px; font-size: 18px; }
.dl-sub { margin: 0; color: #8fa3bd; font-size: 12px; }
.dl-body { padding: 16px 22px 20px; display: flex; flex-direction: column; gap: 12px; }
.dl-card { padding: 14px; border: 1px solid #223047; border-radius: 12px; background: #0c121b; }
.dl-card h4 { margin: 0 0 10px; font-size: 13px; color: #a9bed8; letter-spacing: .02em; }
.dl-fixed { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; border: 1px solid #3b6a9e; background: #122033; color: #8ec7ff; font-size: 10px; vertical-align: 1px; }
.dl-input.is-fixed { background: #0d1622; color: #8fa3bd; cursor: not-allowed; }
.dl-input { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 9px; border: 1px solid #2b3b52; background: #0a0f17; color: #e6effa; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.dl-input:focus { outline: none; border-color: #52a7ff; box-shadow: 0 0 0 3px rgba(82, 167, 255, .16); }
.dl-hint { margin-top: 8px; font-size: 12px; line-height: 1.5; color: #8fa3bd; }
.dl-hint.is-ok { color: #62d39a; }
.dl-hint.is-warn { color: #e3b45f; }
.dl-hint.is-bad { color: #ff7f7f; }
.dl-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.dl-meta { color: #8fa3bd; font-size: 12px; margin-bottom: 8px; }
.dl-links { display: flex; flex-direction: column; gap: 6px; }
.dl-link { display: flex; gap: 10px; align-items: baseline; padding: 6px 8px; border-radius: 8px; background: #0a0f17; border: 1px solid #1b2637; }
.dl-link-label { flex: 0 0 96px; color: #a9bed8; font-size: 12px; }
.dl-link-url { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #8ec7ff; font-family: ui-monospace, Consolas, monospace; font-size: 11px; }
.dl-link-copy { flex: 0 0 auto; margin-left: auto; }
.dl-note { margin: 0; color: #7f94ae; font-size: 11px; line-height: 1.7; }
.dl-status { min-height: 18px; color: #8fa3bd; font-size: 12px; }
.dl-status.is-ok { color: #62d39a; }
.dl-status.is-bad { color: #ff7f7f; }
body.is-dlopen { overflow: hidden; }
@media (max-width: 640px) {
  .dl-back { padding: 10px; }
  .dl-box { width: 100%; max-height: 94vh; }
  .dl-head, .dl-body { padding-left: 14px; padding-right: 14px; }
  .dl-link { flex-direction: column; gap: 2px; }
  .dl-link-label { flex: none; }
  .dl-link-url { white-space: normal; word-break: break-all; }
}
@media (prefers-reduced-motion: reduce) { .dl-back { backdrop-filter: none; } }








