/* ============================================================
   FLMC 工作台样式：无限画布 + 对话创作
   独立于主站 style.css，仅用于 editor.html
   ============================================================ */

/* ---------- 整体布局 ---------- */
.editor-body {
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* sb-shell 右侧的应用容器（工具栏 + 主区纵向排列） */
.ed-app {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ---------- 顶部工具栏 ---------- */
.ed-toolbar {
  /* 截图实测：原站顶栏 36px 单行（35 内容 + 1px 边框）。
     模型选择器已收进「模型设置」弹出面板，故任何宽度都能保持单行。 */
  flex: 0 0 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 12px;
  padding: 0 14px;
  background: rgba(18, 18, 18, 0.92);
  border-bottom: 1px solid var(--border);
  z-index: 60;
}

.ed-toolbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 0 1 auto;
}

.ed-project-name {
  font-size: 13px;
  color: var(--text-dim);
  border-left: 1px solid var(--border);
  padding-left: 14px;
  white-space: nowrap;
}

.ed-toolbar-center {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-start;
}

.ed-style-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ed-label {
  font-size: 12px;
  color: var(--text-faint);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.ed-select {
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  outline: none;
  transition: border-color var(--dur);
}

/* ---------- 模型设置弹出面板（工具栏单行的关键） ---------- */
.ed-model-menu {
  position: relative;
}

.ed-model-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--dur);
}

.ed-model-btn:hover,
.ed-model-btn[aria-expanded="true"] {
  color: var(--text);
  border-color: var(--border-strong);
}

.ed-model-pop {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 80;
  grid-template-columns: 1fr;
  gap: 10px;
  min-width: 300px;
  padding: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.ed-model-pop.open {
  display: grid;
}

.ed-model-pop .ed-style-wrap {
  justify-content: space-between;
}

.ed-model-pop .ed-select {
  max-width: 190px;
}

.ed-select:hover,
.ed-select:focus {
  border-color: var(--accent);
}

.ed-select option {
  background: var(--bg-elev);
  color: var(--text);
}

.ed-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  justify-content: flex-end;
}

.ed-zoom {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-dim);
  min-width: 44px;
  text-align: center;
}

.ed-sep {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 6px;
}

/* 工具栏图标按钮（undo/redo/缩放） */
.ed-tool-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.ed-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  transition: color var(--dur), background var(--dur);
}

.ed-icon-btn svg {
  width: 16px;
  height: 16px;
}

.ed-icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.ed-icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* 保存状态指示（原站 saveStatus） */
.ed-save-status {
  font-size: 11.5px;
  color: var(--text-faint);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.ed-save-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
  transition: background var(--dur), box-shadow var(--dur);
}

.ed-save-status.saving::before {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
  animation: pulse 1.2s infinite;
}

.ed-save-status.error::before {
  background: var(--danger);
  box-shadow: 0 0 6px rgba(248, 113, 113, 0.5);
}

/* ---------- 主区域 ---------- */
.ed-main {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* ---------- 左侧节点面板（原站 Panels，用户要求取消，画布占满） ---------- */
.ed-panels {
  display: none;
  flex-direction: column;
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  min-height: 0;
}

.ed-panels-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.ed-panels-head h3 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.ed-panels-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
}

.ed-panels-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ed-panel-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
  padding: 7px 9px;
  border-radius: 7px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--dur);
  user-select: none;
}

.ed-panel-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.ed-panel-item.active {
  color: var(--text);
  background: var(--accent-glow);
  border-color: rgba(232, 99, 43, 0.3);
}

.ed-panel-item .pip {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
  background: var(--accent);
  opacity: 0.7;
}

.ed-panel-item.shot .pip {
  background: #60a5fa;
}

.ed-panel-item .lbl {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ed-panel-item .st {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-faint);
  flex-shrink: 0;
}

.ed-panel-empty {
  padding: 24px 14px;
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.6;
}

/* ================= 无限画布 ================= */
.ed-canvas-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  cursor: grab;
  background: var(--bg-canvas); /* 截图实测画布底 #141d23 */
  user-select: none;
  -webkit-user-select: none;
}

.ed-grid {
  position: absolute;
  inset: 0;
  /* 截图实测：原站画布是纯净色块，标准差 0.000，没有任何网格线 */
  background-image: none;
  background-size: 40px 40px;
  pointer-events: none;
}

.ed-world {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.ed-links {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.ed-nodes {
  position: absolute;
  top: 0;
  left: 0;
}

/* ---------- 场景节点卡片 ---------- */
.node {
  position: absolute;
  width: 260px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  /* ⚠️ 2026-09-17（第 96 轮 B）：端口挂在卡片边缘外侧（left/right:-7px），
     原来的 overflow:hidden 会把端口裁掉 → 看得见但点不到、拖不上。
     改成 visible，并让图片区自带上方圆角，保持原外观。 */
  overflow: visible;
  cursor: grab;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
/* 🧩 第 107 轮：选中态（橙色描边 + 外发光）与变形过渡 */
.node.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(232, 99, 43, 0.45), 0 12px 32px rgba(0, 0, 0, 0.5);
}
.node {
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform 0.18s var(--ease);
}

/* 🧩 第 107 轮：变形面板（挂在左侧竖排工具条右侧，只在选中节点时出现） */
/* 🧩 第 108 轮：节点上方的"拖拽旋转手柄"（自由角度） */
.node-rot-handle {
  position: absolute;
  top: -34px;
  left: 50%;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  line-height: 24px;
  text-align: center;
  cursor: grab;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  user-select: none;
  z-index: 5;
}
.node-rot-handle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 2px;
  height: 10px;
  margin-left: -1px;
  background: var(--accent);
}
.node-rot-handle:active { cursor: grabbing; }
body.is-rotating { cursor: grabbing; }
body.is-rotating .node-rot-handle { cursor: grabbing; }

/* 🧩 第 109 轮：右下角"拖拽缩放手柄"（自由缩放） */
.node-scale-handle {
  position: absolute;
  right: -10px;
  bottom: -10px;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  line-height: 20px;
  text-align: center;
  cursor: nwse-resize;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  user-select: none;
  z-index: 5;
}
body.is-scaling { cursor: nwse-resize; }

.ed-transform {
  position: absolute;
  left: 100%;
  margin-left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 176px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(16, 18, 23, 0.96);
  border: 1px solid var(--border-strong);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  z-index: 7;
}
.ed-transform-head {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ed-transform-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
}
.ed-transform-btn {
  flex: 1;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.ed-transform-btn:hover { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.ed-transform-val {
  min-width: 44px;
  text-align: center;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.ed-transform-hint {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.5;
}

.node:hover {
  border-color: var(--accent);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(232, 99, 43, 0.25);
}

.node:active {
  cursor: grabbing;
}

.node-img {
  position: relative;
  width: 100%;
  height: 146px;
  background: #000;
  overflow: hidden;
  /* 卡片改成 overflow:visible 后，图片区的上方圆角要自己带（否则会盖住圆角） */
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
}

.node-img-status {
  position: absolute;
  inset: 0;
}

.node-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Ken Burns 动画的溢出承载 */
  transform-origin: center;
  will-change: transform;
}

/* ---------- Ken Burns 镜头运动 ---------- */
.kb-push { animation: kb-push 9s var(--ease) infinite alternate; }
.kb-pull { animation: kb-pull 9s var(--ease) infinite alternate; }
.kb-panL { animation: kb-panL 9s var(--ease) infinite alternate; }
.kb-panR { animation: kb-panR 9s var(--ease) infinite alternate; }
.kb-rise { animation: kb-rise 9s var(--ease) infinite alternate; }
.kb-orbit { animation: kb-orbit 11s linear infinite; }
.kb-still { animation: none; }

@keyframes kb-push {
  from { transform: scale(1); }
  to { transform: scale(1.18); }
}
@keyframes kb-pull {
  from { transform: scale(1.18); }
  to { transform: scale(1); }
}
@keyframes kb-panL {
  from { transform: scale(1.12) translateX(2%); }
  to { transform: scale(1.12) translateX(-2%); }
}
@keyframes kb-panR {
  from { transform: scale(1.12) translateX(-2%); }
  to { transform: scale(1.12) translateX(2%); }
}
@keyframes kb-rise {
  from { transform: scale(1.1) translateY(2%); }
  to { transform: scale(1.1) translateY(-2%); }
}
@keyframes kb-orbit {
  from { transform: scale(1.14) rotate(-1deg); }
  to { transform: scale(1.14) rotate(1deg); }
}

/* 节点图片内层让动画不溢出卡片 */
.node-img-status { overflow: hidden; border-radius: inherit; }

/* ---------- 生成状态 ---------- */
.node-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background:
    radial-gradient(80% 100% at 50% 0%, rgba(232, 99, 43, 0.08), transparent 70%),
    var(--bg-elev);
  color: var(--text-dim);
  font-size: 12.5px;
}

.node-loading p { margin: 0; }

.node-error p { color: var(--danger); }

/* ---------- 节点视频区 ---------- */
.node-video {
  margin: 10px 0 0;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
}

.node-video-player {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  object-fit: cover;
}

.node-video-pending {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 12px;
  background:
    radial-gradient(80% 100% at 50% 0%, rgba(232, 99, 43, 0.08), transparent 70%),
    var(--bg-elev);
  color: var(--text-dim);
  font-size: 12px;
  text-align: center;
}

/* 放映模式视频铺满 */
.player-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

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

/* ---------- 节点正文 ---------- */
.node-body {
  padding: 12px 14px 14px;
}

.node-title {
  font-size: 14.5px;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node-desc {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.node-desc-muted {
  color: var(--text-faint);
  font-style: italic;
}

.node-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

/* ============================================================
   🗺 小地图 + 🧭 流程引导 + 渲染层 LOD（第 101 轮 P1+P2）
   ============================================================ */
.ed-minimap {
  position: absolute;
  right: 14px;
  bottom: 46px;
  width: 180px;
  height: 120px;
  border-radius: 10px;
  background: rgba(10, 12, 16, 0.72);
  border: 1px solid var(--border-strong);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  cursor: pointer;
  z-index: 6;
}
.ed-minimap canvas { width: 100%; height: 100%; display: block; }
.ed-minimap-label {
  position: absolute;
  right: 6px;
  bottom: 4px;
  font-size: 10px;
  color: #8b8b99;
  font-family: var(--font-mono);
  pointer-events: none;
}
/* 远景降级（阈值见 js/editor.js applyLod）：
   · 中景（<0.7）：只藏"次要信息"（元信息标签、视频播放器）—— 按钮保留，不然点不到
   · 远景（<0.4）：只留轮廓 + 标题，正文/按钮/端口全藏（节点多时明显省渲染） */
.ed-nodes.lod-far .node .node-body > *:not(.node-title) { display: none; }
.ed-nodes.lod-far .node .node-img { height: 74px; }
.ed-nodes.lod-far .node .node-actions,
.ed-nodes.lod-far .node .node-meta,
.ed-nodes.lod-far .node .node-video,
.ed-nodes.lod-far .node .node-port { display: none; }
.ed-nodes.lod-mid .node .node-meta,
.ed-nodes.lod-mid .node .node-video { display: none; }

/* 🧭 画布里的流程引导（P1） */
.ed-guide {
  position: absolute;
  top: 52px;
  /* 第 105 轮：画布最左让给"竖排工具条"（宽约 50px），引导面板右移，两者不再互相遮点击 */
  left: 72px;
  width: 238px;
  max-height: calc(100% - 120px);
  overflow: auto;
  padding: 10px;
  border-radius: 12px;
  background: rgba(16, 18, 23, 0.86);
  border: 1px solid var(--border-strong);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  z-index: 6;
  backdrop-filter: blur(6px);
}
.ed-guide[hidden] { display: none; }
.ed-guide-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: #cfcfd8; margin-bottom: 8px; }
.ed-guide-toggle { background: none; border: none; color: #8b8b99; cursor: pointer; font-size: 12px; padding: 0 2px; }
.ed-guide-toggle:hover { color: #cfcfd8; }
.ed-guide-list { display: flex; flex-direction: column; gap: 4px; }
.ed-guide-item {
  display: flex; align-items: center; gap: 7px;
  width: 100%; text-align: left;
  padding: 6px 8px; border-radius: 8px;
  background: #1e1f26; border: 1px solid transparent;
  color: #c9c9d4; font-size: 12px; cursor: pointer;
}
.ed-guide-item:hover { background: #262832; }
.ed-guide-item.is-done { color: #7fd6a5; }
.ed-guide-item.is-current { border-color: var(--accent); background: rgba(232, 99, 43, 0.14); color: #fff; }
.ed-guide-item em { font-style: normal; color: #8b8b99; font-size: 10.5px; margin-left: auto; }
.ed-guide-foot { margin-top: 8px; display: flex; gap: 6px; }
.ed-guide-foot button { flex: 1; }
.ed-guide-mini { font-size: 11px; color: #8b8b99; margin-top: 6px; line-height: 1.5; }

/* 🍁 小枫在流水线标题旁（第 100 轮）：气泡在文档流里，不遮任何东西 */
.ed-pipe-mascot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 132px;
  flex: 0 0 auto;
}
.ed-mascot { width: 96px; height: 110px; }
.ed-mascot-say {
  position: relative;
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
}
.ed-mascot-say .mx-bubble {
  position: relative;
  transform: translateX(-4px) scale(0.98);
  margin: 0;
  max-width: 132px;
  padding: 7px 9px;
  font-size: 11.5px;
  opacity: 0;
}
.ed-mascot-say .mx-bubble.open { transform: none; }
.ed-mascot-say .mx-bubble::after {
  left: 50%;
  top: -6px;
  bottom: auto;
  margin-left: -5px;
  border-right: none;
  border-left: 1px solid #3b3b45;
  border-top: 1px solid #3b3b45;
}

/* 🧩 导入画布弹层（第 97 轮 C） */
.import-modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 12, 0.62);
}
.import-card {
  width: 460px;
  max-height: 86vh;
  overflow: auto;
  padding: 18px 20px;
  border-radius: 14px;
  background: #1b1b20;
  border: 1px solid #3b3b45;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.import-card h3 { margin: 0 0 6px; font-size: 16px; color: #f2f2f7; }
.import-card .import-sub { margin: 0 0 14px; font-size: 12.5px; color: #9a9aa8; line-height: 1.6; }
.import-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 13px; color: #d6d6de; }
.import-row select { flex: 1; max-width: 300px; }
.import-check { justify-content: flex-start; gap: 8px; }
.import-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* 🧩 画布工具栏（第 96 轮 B）：对齐原站的"生成图片/生成视频/文字/分组" */
.ed-canvas-tools {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);      /* 左侧竖排工具条（第 105 轮）：垂直居中，不占画布顶部 */
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
  border-radius: 14px;
  background: rgba(14, 21, 25, 0.72);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  max-height: calc(100% - 24px);
  overflow-y: auto;
}
.ed-canvas-tools .chip { backdrop-filter: blur(6px); }
.ed-tool {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.ed-tool:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  border-color: var(--border-strong);
}
.ed-tool.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.ed-tools-sep {
  width: 22px;
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}
.ed-tools-zoom {
  margin-top: 4px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
  letter-spacing: 0.2px;
}
/* 竖排时只显图标（说明文字挂在 title 里，鼠标停一下就有） */
.ed-canvas-tools .ed-tool-txt { display: none; }
/* 窄屏（手机）把工具条缩一点，别挡住画布 */
@media (max-width: 720px) {
  .ed-canvas-tools { padding: 6px 4px; gap: 4px; }
  .ed-tool { width: 32px; height: 32px; font-size: 15px; }
}

/* 🧩 节点端口（第 96 轮 B）：右侧产出、左侧输入，拖出来就能连 */
.node-port {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #0e1519;
  background: #6b7280;
  cursor: crosshair;
  z-index: 4;
}
.node-port:hover { transform: scale(1.25); }
.node-port-out { right: -7px; top: 74px; background: #48c78e; }
.node-port-in { left: -7px; background: #8b8b99; }
.node-port-in.port-prompt { top: 172px; background: #60a5fa; }
.node-port-in.port-image { top: 196px; background: #48c78e; }
.node-port-in.port-video { top: 220px; background: #f0a35e; }
.node-port .port-label {
  position: absolute;
  left: 14px;
  top: -4px;
  font-size: 10px;
  color: #8b8b99;
  white-space: nowrap;
  pointer-events: none;
}
/* 用户连的线（与"故事顺序"的装饰虚线区分开） */
.edge-line { cursor: pointer; }
.edge-line:hover { stroke-width: 4 !important; }
body.is-linking { cursor: crosshair; }

/* 文字节点 / 分组节点（第 96 轮 B） */
.node.kind-text .node-img { height: 74px; background: #171a22; }
.node.kind-text .node-desc { white-space: pre-wrap; max-height: 120px; overflow: auto; }
.node.kind-section { border-style: dashed; border-color: rgba(96, 165, 250, 0.6); background: rgba(23, 26, 34, 0.75); }

/* 🧩 节点上的模型标签（第 95 轮 A）：点一下换模型，对齐原站的 changeModel */
.tag-model {
  cursor: pointer;
  color: #b6f0c9;
  border-color: rgba(72, 199, 142, 0.45);
  background: rgba(72, 199, 142, 0.12);
  max-width: 168px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.tag-model:hover {
  background: rgba(72, 199, 142, 0.24);
  border-color: rgba(72, 199, 142, 0.75);
}
/* 模型选择器弹层 */
.node-model-pop {
  position: fixed;
  z-index: 9999;
  width: 320px;
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
  border-radius: 12px;
  background: #1b1b20;
  border: 1px solid #3b3b45;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
}
.node-model-pop .nmp-head {
  font-size: 12px;
  font-weight: 600;
  color: #e8e8ee;
  padding: 4px 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.node-model-pop .nmp-sub {
  font-weight: 400;
  color: #8b8b99;
  font-size: 11px;
}
.node-model-pop .nmp-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  margin-bottom: 4px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: #23232a;
  color: #e8e8ee;
  cursor: pointer;
  font-size: 12.5px;
}
.node-model-pop .nmp-item:hover { background: #2c2c35; }
.node-model-pop .nmp-item.is-on { border-color: #48c78e; background: rgba(72, 199, 142, 0.14); }
.node-model-pop .nmp-item i { font-style: normal; color: #9a9aa8; font-size: 11.5px; }
.node-model-pop .nmp-item em { font-style: normal; color: #ffb340; font-size: 11px; }

/* 时长与视频提示词标签 */
.tag-dur {
  color: #96c8ff;
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(96, 165, 250, 0.1);
  font-family: var(--font-mono);
}

/* AIGC 显式标识（节点上的「AI」标签，2026-09-13） */
.tag-ai {
  color: #ffd479;
  border-color: rgba(255, 212, 121, 0.45);
  background: rgba(255, 212, 121, 0.12);
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: help;
}

.tag-vp {
  color: var(--accent);
  border-color: rgba(232, 99, 43, 0.35);
  cursor: help;
}

.tag-sound {
  color: #c084fc;
  border-color: rgba(192, 132, 252, 0.4);
  background: rgba(192, 132, 252, 0.1);
  cursor: help;
}

/* 节点类型图标（2026-09-19）：统一由 .node-kind-icon span 渲染（text/image/video/character/prop 等） */
.node-kind-icon { margin-right: 4px; font-size: 13px; }

.node-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.node-btn {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 8px;
  cursor: pointer;
  transition: all var(--dur);
}

.node-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.node-btn-danger:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* ---------- 空状态提示 ---------- */
.ed-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
  /* 空画布时左侧「流程引导」浮窗占了约 310px（left:72 + 宽 238）：
     居中区域避开它，否则空状态引导的左半（场记板+「从」字）被浮窗压住 */
  padding-left: 340px;
}

.ed-empty-inner {
  text-align: center;
  pointer-events: auto;
  max-width: 520px;
  padding: 32px;
  background: rgba(18, 18, 18, 0.72);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
}

.ed-empty-icon {
  font-size: 44px;
  margin-bottom: 12px;
}

.ed-empty h3 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
}

.ed-empty p {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 18px;
}

.ed-empty-samples {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

/* .chip 基础样式已统一到 style.css（全站通用），此处只保留工作台内的密度覆盖 */

.ed-zoom-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--text-faint);
  background: rgba(18, 18, 18, 0.7);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 16px;
  pointer-events: none;
  white-space: nowrap;
}

/* ================= 对话面板 ================= */
.ed-chat {
  /* 宽度可用：拖动左边缘的竖线即可左右调整（2026-09-13）；默认仍是截图实测的 250.5 */
  flex: 0 0 var(--flmc-chat-w, 250px);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--bg);   /* 截图实测：右对话栏底 = #0e1519（与页面同色，仅靠边框分隔） */
  min-height: 0;
  position: relative;      /* 拖拽手柄要绝对定位在左边缘 */
}

.ed-chat-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.ed-chat-head h2 {
  font-size: 15px;
  font-weight: 800;
}

.ed-chat-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-dim);
}

.ed-chat-status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
}

.ed-chat-status .dot-busy {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: pulse 1.2s infinite;
}

.ed-chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg {
  max-width: 88%;
  font-size: 13.5px;
  line-height: 1.65;
  padding: 10px 14px;
  border-radius: 14px;
  animation: fade-up 0.3s var(--ease) both;
}

.msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #0e1519;
  font-weight: 500;
  border-bottom-right-radius: 4px;
}

.msg-system {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-bottom-left-radius: 4px;
}

.msg-assistant {
  align-self: flex-start;
  background: var(--bg-elev);
  border: 1px solid rgba(232, 99, 43, 0.3);
  color: var(--text);
  border-bottom-left-radius: 4px;
  border-left: 3px solid var(--accent);
}

.msg-system b { color: var(--text); }
.msg-system i { color: var(--accent); }

/* 深化结果预览（对话内灰字） */
.msg-dim {
  color: var(--text-faint);
  font-size: 12px;
  display: block;
  margin-top: 4px;
}

/* 分镜（镜头）子节点：稍窄 + 蓝色角标 */
.node[data-shot] {
  width: 230px;
}

.node[data-shot] .node-img {
  height: 129px; /* 230 * 9/16 */
}

.node[data-shot] .node-title::before {
  content: "🎬 ";
  font-size: 12px;
}

/* 待确认（proposal）节点：虚线边框 + 琥珀强调 */
.node.is-proposal {
  border: 1.5px dashed rgba(232, 99, 43, 0.55);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.node.is-proposal:hover {
  border-color: var(--accent);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(232, 99, 43, 0.3);
}

.node-proposal {
  gap: 8px;
}

.node-proposal p {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.node-btn-confirm {
  color: #0e1519;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent;
  font-weight: 700;
}

.node-btn-confirm:hover {
  color: #0e1519;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--accent-glow);
}

/* 快捷指令 */
.ed-quick {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 18px 4px;
}

.ed-quick .chip {
  font-size: 11.5px;
  padding: 5px 11px;
}

/* 输入区 */
.ed-chat-input {
  flex: 0 0 auto;
  padding: 10px 18px 16px;
  border-top: 1px solid var(--border);
}

.ed-chat-input textarea {
  width: 100%;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 10px 14px;
  resize: none;
  outline: none;
  transition: border-color var(--dur);
}

.ed-chat-input textarea:focus {
  border-color: var(--accent);
}

.ed-chat-input textarea::placeholder {
  color: var(--text-faint);
}

.ed-chat-input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.ed-hint {
  font-size: 11.5px;
  color: var(--text-faint);
}

/* ================= 全屏放映 ================= */
.ed-player {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: #000;
}

.ed-player.open {
  display: flex;
}

.ed-player-close {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 4;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 18px;
  display: grid;
  place-items: center;
  transition: background var(--dur);
}

.ed-player-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.ed-player-stage {
  flex: 1;
  width: 100%;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.ed-player-slide {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  position: relative;
}

.ed-player-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ed-player-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 48px 40px 36px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  text-align: center;
}

.ed-player-caption h3 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 6px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.ed-player-caption p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
}

.player-pending {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--text-dim);
}

.player-pending .spinner {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

.ed-player-bar {
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 16px 20px 22px;
  background: #000;
  border-top: 1px solid var(--border);
}

.ed-player-progress {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  min-width: 70px;
  text-align: center;
}

/* ---------- 响应式 ---------- */
/* 模型选择器收进弹出面板后，工具栏恒为单行 36px，无需再折行 */

@media (max-width: 900px) {
  .ed-toolbar-center { display: none; }
  .ed-chat { flex-basis: 320px; }
  /* 小屏画布高度有限：空状态卡片压缩到一屏内，避免第三个示例按钮被裁掉点不到 */
  .ed-empty {
    align-items: flex-start;
    padding: 14px 12px;
  }
  .ed-empty-inner {
    max-width: 100%;
    padding: 16px 14px;
  }
  .ed-empty-icon {
    font-size: 28px;
    margin-bottom: 4px;
  }
  .ed-empty h3 {
    font-size: 16px;
    margin-bottom: 6px;
  }
  .ed-empty p { display: none; }
  .ed-empty-samples { gap: 6px; }
}

@media (max-width: 720px) {
  .ed-main { flex-direction: column; }
  .ed-chat {
    flex-basis: 46vh;
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .ed-zoom-hint { display: none; }
  .ed-project-name { display: none; }
  /* 小屏工具栏：只留放映 / 保存，撤销与缩放走快捷键 */
  .ed-toolbar-right .ed-tool-group,
  .ed-toolbar-right .ed-sep,
  .ed-save-status {
    display: none;
  }
  .ed-toolbar { padding: 8px 12px; }
}

/* ============================================================
   项目二级导航 + 子标签视图（剧本 / 3D片场 / 视频编辑器）
   ============================================================ */

/* ---------- 项目二级导航栏 ---------- */
.ed-subnav {
  /* 截图实测：原站二级行（视图标签）约 24~28px 高 */
  flex: 0 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 14px;
  background: rgba(18, 18, 18, 0.85);
  border-bottom: 1px solid var(--border);
  z-index: 55;
}

.ed-subnav-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ed-subnav-project {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.ed-subnav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

.ed-subnav-tab {
  position: relative;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  padding: 4px 12px;   /* 二级行 30px，标签不外溢 */
  border-radius: 8px;
  transition: color var(--dur), background var(--dur);
}

.ed-subnav-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.ed-subnav-tab.active {
  color: var(--text);
}

/* 激活项红点（指令要求） */
.ed-subnav-tab.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 6px rgba(248, 113, 113, 0.7);
}

.ed-subnav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 二级行 30px：右侧「分享」按钮同步压缩 */
.ed-subnav-right .btn {
  padding: 3px 10px;
  font-size: 12px;
}

.ed-subnav-credits {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.ed-subnav-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  color: #0e1519;
  background: var(--accent);
}

/* ---------- 视图切换（画布/剧本/3D片场/视频编辑器） ---------- */
.ed-view {
  display: none;
  flex: 1;
  min-height: 0;
}

.ed-view.active {
  display: flex;
}

/* ================= 剧本视图 ================= */
.ed-view-script {
  flex-direction: row;
}

/* 截图实测：剧本页左侧场景栏右边界 189 */
.ed-view-script .ed-3d-panels {
  flex: 0 0 189px;
  background: var(--bg);   /* 截图实测：剧本页左栏底 = #0e1519 */
}

.ed-script-editor {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);   /* 截图实测：剧本正文区底色 = 页面底色 #0e1519 */
  border-right: 1px solid var(--border);
}

.ed-script-toolbar {
  flex: 0 0 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
}

.ed-script-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.ed-script-actions {
  display: flex;
  gap: 8px;
}

.ed-script-text {
  flex: 1;
  margin: 0;
  padding: 22px 26px;
  overflow-y: auto;
  font-family: "Courier New", var(--font-mono), monospace;
  font-size: 14px;
  line-height: 1.9;
  color: #eae7e2;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---- 剧本深化：标准电影剧本格式排版 ---- */
.ed-script-placeholder {
  color: var(--text-faint);
  font-size: 13.5px;
  line-height: 1.9;
}

.ed-script-scene {
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  transition: background var(--dur);
}

.ed-script-scene.flash {
  background: rgba(232, 99, 43, 0.12);
  outline: 1px solid rgba(232, 99, 43, 0.4);
}

.ed-script-slug {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.05em;
  color: #ffffff;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.ed-script-action {
  color: #eae7e2;
  margin-bottom: 10px;
}

.ed-script-line {
  color: #f4f1ec;
  margin: 0 0 4px 0;
}

.ed-script-char {
  color: var(--accent);
  font-weight: 700;
}

/* ---- 剧本深化：整本小说拆分成集（集 → 场景 → 分镜） ---- */
.ed-script-series {
  margin-bottom: 30px;
}

.ed-script-scene-title {
  font-weight: 700;
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.ed-script-shot {
  margin: 3px 0 3px 14px;
  color: #c9c4bc;
  font-size: 13px;
}

/* ---- 剧本：拆分成集结果区「映射到画布」入口 ---- */
.ed-script-mapbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: rgba(232, 99, 43, 0.08);
  border: 1px solid rgba(232, 99, 43, 0.25);
  border-radius: 10px;
}

.ed-script-maphint {
  font-size: 12px;
  color: var(--text-faint);
}

/* 剧本拖拽导入高亮（拖文件到编辑区时） */
.ed-script-editor.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: -6px;
  background: rgba(232, 99, 43, 0.06);
}

/* ================= 3D片场视图 ================= */
.ed-view-3d {
  flex-direction: row;
  display: none;
  position: relative;
}

.ed-view-3d.active {
  display: grid;
  /* 截图实测：场景栏右边界 189、助手栏左边界 962.5（视口 1248）→ 189 / 1fr / 285 */
  grid-template-columns: 189px 1fr var(--flmc-assist-3d-w, 285px);
  grid-template-rows: 1fr 54px;
  grid-template-areas:
    "panels stage assist"
    "timeline timeline timeline";
}

.ed-3d-panels {
  display: flex;
  grid-area: panels;
  flex-direction: column;
  background: #202020;   /* 截图实测：3D片场左场景栏 #202122 */
  border-right: 1px solid var(--border);
  min-height: 0;
}

.ed-3d-scenes {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.ed-3d-scene-item {
  font-size: 12.5px;
  color: var(--text-dim);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color var(--dur), color var(--dur);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ed-3d-scene-item:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.ed-3d-scene-item.active {
  border-color: var(--accent);
  color: var(--text);
}

/* ---------- 🎭 P0-4：角色资产面板（参考包的界面入口） ---------- */
#s3dAssetsList {
  flex: none;
  max-height: 210px;
}
.ed-3d-assets-acts {
  padding: 6px 10px 10px;
  border-top: 1px solid var(--border, #27353d);
}
.ed-3d-assets-acts .chip {
  width: 100%;
  justify-content: center;
  font-size: 12.5px;
}
.ed-3d-asset-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  margin-bottom: 6px;
  overflow: hidden;
}
.ed-3d-asset-item img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  flex: none;
  background: #222;
}
.ed-3d-asset-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ed-3d-asset-info b {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ed-3d-asset-kind {
  font-size: 11px;
  color: var(--text-dim);
}
.ed-3d-asset-inc {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
}
.ed-3d-asset-inc input {
  accent-color: var(--accent, #e8632b);
}

.ed-3d-stage {
  grid-area: stage;
  position: relative;
  min-width: 0;
  overflow: hidden;
  background:
    radial-gradient(80% 60% at 50% 40%, rgba(232, 99, 43, 0.05), transparent 70%),
    #16202a;   /* 截图实测：片场舞台底 #16202a */
}

/* Canvas 3D 片场引擎视口 */
#stage3dCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  display: block;
}
#stage3dCanvas:active { cursor: grabbing; }

/* ---------- 运镜编排面板（A+C 方案） ---------- */
.ed3d-motion {
  position: absolute;
  left: 12px;
  bottom: 12px;
  width: 268px;
  max-height: calc(100% - 24px);
  overflow: auto;
  padding: 10px 11px 11px;
  border-radius: 10px;
  border: 1px solid var(--border, #27353d);
  background: rgba(20, 20, 22, 0.92);
  backdrop-filter: blur(6px);
  z-index: 5;
}
.ed3d-motion-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #d9e2e6);
  margin-bottom: 8px;
}
.ed3d-motion-time { font-weight: 500; color: var(--muted, #93a4ab); }
.ed3d-motion-head-right { display: flex; align-items: center; gap: 8px; }
.ed-collapse-arrow { cursor: pointer; color: var(--text-faint, #6b7a82); font-size: 12px; transition: transform .15s; }
.ed3d-motion-head { cursor: pointer; }
/* 折叠态：运镜面板只剩标题条（按钮列表全部收起） */
.ed3d-motion.collapsed > :not(.ed3d-motion-head) { display: none; }
.ed3d-motion.collapsed .ed-collapse-arrow { transform: rotate(-90deg); }
/* 折叠态：左侧场景栏整个收起 */
.ed-view-3d.panels-collapsed .ed-3d-panels { display: none; }
.ed3d-motion-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.ed3d-motion-acts .chip {
  min-height: 26px;   /* 满足可点击区域下限，避免体检报 tiny */
  padding: 4px 9px;
  font-size: 12px;
}
.ed3d-keys { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.ed3d-keys-empty { font-size: 11px; color: var(--muted, #7e9099); }
.ed3d-key {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text, #d9e2e6);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  padding: 3px 6px;
}
.ed3d-key-no { color: var(--accent, #e8632b); font-weight: 600; }
.ed3d-key-dur { color: var(--muted, #93a4ab); }
.ed3d-key button {
  min-width: 22px;
  min-height: 22px;
  line-height: 1;
  padding: 2px 5px;
  font-size: 11px;
  background: transparent;
  color: var(--text, #d9e2e6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  cursor: pointer;
}
.ed3d-key button:hover { border-color: var(--accent, #e8632b); color: #fff; }
.ed3d-key .ed3d-key-del { margin-left: auto; }
.ed3d-gen { width: 100%; margin-top: 9px; }
.ed3d-plan {
  margin-top: 8px;
  border: 1px solid rgba(232, 99, 43, 0.25);
  background: rgba(232, 99, 43, 0.06);
  border-radius: 8px;
  padding: 7px 8px;
}
.ed3d-plan-head {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent, #e8632b);
  margin-bottom: 5px;
}
.ed3d-plan-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 11px;
  color: var(--text, #d9e2e6);
  padding: 2px 0;
  line-height: 1.45;
}
.ed3d-plan-i {
  flex: 0 0 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  border-radius: 50%;
  background: rgba(232, 99, 43, 0.18);
  color: var(--accent, #e8632b);
  font-weight: 600;
}
.ed3d-plan-t { flex: 0 0 auto; }
.ed3d-plan-d { flex: 1 1 auto; color: var(--muted, #93a4ab); }

/* 镜头缩略图（一键成片时逐镜生成后填充） */
.ed3d-plan-thumb {
  flex: 0 0 46px;
  width: 46px;
  height: 26px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--muted, #7e9099);
  cursor: default;
}
.ed3d-plan-thumb.ready { cursor: pointer; border-color: rgba(232, 99, 43, 0.5); }
.ed3d-plan-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ed3d-plan-row.is-running .ed3d-plan-thumb::after { content: "⏳"; }
.ed3d-plan-row.is-done .ed3d-plan-thumb::after { content: ""; }
.ed3d-plan-row.is-failed .ed3d-plan-thumb { border-color: rgba(255, 128, 128, 0.5); color: #ff8080; }
.ed3d-plan-row.is-running .ed3d-plan-t { color: var(--accent, #e8632b); }
.ed3d-plan-row.is-done .ed3d-plan-t::after { content: " ✅"; }
.ed3d-plan-row.is-failed .ed3d-plan-t::after { content: " ⚠️"; }

/* 一键成片进度条 */
.ed3d-progress { margin-top: 8px; }
.ed3d-progress-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.ed3d-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, #e8632b, #ff9f2e);
  transition: width 0.4s ease;
}
.ed3d-progress-text {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted, #93a4ab);
  line-height: 1.5;
}
.ed3d-motion-tip {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.55;
  color: var(--muted, #7e9099);
}
.ed3d-motion.busy { opacity: 0.6; pointer-events: none; }

/* 透视地板网格 */
.ed-3d-floor {
  position: absolute;
  left: -50%;
  right: -50%;
  bottom: -40%;
  height: 90%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 44px 44px;
  transform: perspective(520px) rotateX(62deg);
  transform-origin: top center;
  pointer-events: none;
}

.ed-3d-actor,
.ed-3d-cam {
  position: absolute;
  width: 46px;
  height: 58px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  cursor: grab;
  user-select: none;
  z-index: 2;
}

.ed-3d-actor:nth-of-type(2) { left: 24%; bottom: 30%; }
.ed-3d-actor:nth-of-type(3) { left: 58%; bottom: 42%; }
.ed-3d-cam { left: 72%; bottom: 58%; border-color: rgba(232, 99, 43, 0.5); }

.ed-3d-actor:active,
.ed-3d-cam:active {
  cursor: grabbing;
}

.ed-3d-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
  pointer-events: none;
}

/* 3D 时间轴工具栏 */
.ed-3d-timeline {
  grid-area: timeline;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  background: #16202a;
  border-top: 1px solid var(--border);
  overflow-x: auto;
}

.ed-3d-timeline .chip {
  flex-shrink: 0;
}

.ed-3d-timeline-hint {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-faint);
  white-space: nowrap;
  padding-right: 6px;
}

/* ================= 通用助手面板（剧本/3D/视频视图） ================= */
.ed-assist {
  grid-area: assist;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);   /* 截图实测：剧本页助手栏底 = #0e1519 */
  border-left: 1px solid var(--border);
  position: relative;      /* 拖拽手柄定位用（2026-09-13） */
}

/* ================= 助手栏宽度拖拽手柄（2026-09-13） =================
   鼠标移到「智能体对话框 / AI 助手」的左边缘竖线上：光标变 col-resize，按住可左右拖动调宽度，
   宽度记在 localStorage，下次打开还是你调好的宽度。 */
.flmc-resizer {
  position: absolute;
  /* 手柄完全落在面板内部（left:0）：之前用 left:-3px 会伸到面板外面，
     窄屏体检会判成"元素超出屏幕左侧"（2026-09-13 踩过）。 */
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  z-index: 30;
  cursor: col-resize;
  background: transparent;
  touch-action: none;
}

.flmc-resizer::after {
  content: "";
  position: absolute;
  left: 1px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: transparent;
  transition: background var(--dur, 0.2s), box-shadow var(--dur, 0.2s);
}

.flmc-resizer:hover::after,
.flmc-resizer.dragging::after {
  background: var(--accent, #e8632b);
  box-shadow: 0 0 8px rgba(232, 99, 43, 0.6);
}

/* 拖动时别让页面选中文字 / 光标乱跳 */
body.flmc-resizing {
  cursor: col-resize;
  user-select: none;
  -webkit-user-select: none;
}

.ed-view-script .ed-assist {
  grid-area: auto;
  /* 默认仍是截图实测的 285.5；宽度可拖动左边缘的竖线调整（2026-09-13） */
  flex: 0 0 var(--flmc-assist-script-w, 285px);
}

.ed-assist-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 6px;
}

.ed-assist-head h3 {
  font-size: 14px;
  font-weight: 700;
}

.ed-assist-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
}

.ed-assist-greet {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--text-faint);
  padding: 0 16px 8px;
}

.ed-assist-quick {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 10px;
}

.ed-assist-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 4px 16px 8px;
  min-height: 40px;
}

.ed-assist-msg {
  font-size: 12.5px;
  line-height: 1.6;
  padding: 8px 11px;
  border-radius: 10px;
  margin-bottom: 8px;
  max-width: 92%;
}

.ed-assist-msg.user {
  margin-left: auto;
  background: var(--accent);
  color: #0e1519;
}

.ed-assist-msg.bot {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
}

.ed-assist-input {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--border);
}

.ed-assist-input textarea {
  flex: 1;
  resize: none;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 8px 10px;
  outline: none;
  max-height: 90px;
}

.ed-assist-input textarea:focus {
  border-color: var(--accent);
}

/* ================= 3D片场欢迎弹窗 ================= */
.ed3d-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ed3d-modal.open {
  display: flex;
}

.ed3d-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

.ed3d-modal-box {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 30px 32px 28px;
  text-align: center;
  animation: pop-in 0.3s var(--ease);
}

.ed3d-modal-box h2 {
  font-size: 21px;
  font-weight: 800;
  margin-bottom: 20px;
}

.ed3d-demo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 18px;
}

.ed3d-demo-card {
  width: 130px;
  height: 96px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.ed3d-real {
  background: linear-gradient(160deg, #2b1055, #7597de);
}

.ed3d-layout {
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.08) 0 8px,
    transparent 8px 16px
  ), var(--bg-card);
}

.ed3d-demo-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.45);
  padding: 3px 8px;
  border-radius: 999px;
}

.ed3d-demo-arrow {
  font-size: 22px;
  color: var(--accent);
}

.ed3d-tagline {
  font-size: 14.5px;
  color: var(--text-dim);
  margin-bottom: 22px;
}

.ed3d-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ================= 响应式补充 ================= */
@media (max-width: 1100px) {
  .ed-view-3d.active {
    grid-template-columns: 1fr 280px;
  }
}

@media (max-width: 900px) {
  .ed-view-3d.active {
    grid-template-columns: 1fr;
    grid-template-areas:
      "stage"
      "timeline";
  }
  .ed-view-3d .ed-assist {
    display: none;
  }
  .ed-view-script {
    flex-direction: column;
  }
  .ed-view-script .ed-assist {
    flex: 0 0 40vh;
    border-left: none;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 720px) {
  .ed-subnav-left { display: none; }
  .ed-subnav-right .btn-ghost { display: none; }
  .ed-subnav-tab { padding: 7px 10px; font-size: 12.5px; }
  .ed-view-3d.active {
    grid-template-columns: 1fr;
    grid-template-areas:
      "stage"
      "timeline";
  }
  .ed-3d-panels { display: none; }
}

/* ================= 视频编辑器视图 ================= */
.ed-view-video {
  display: none;
  position: relative;
}

.ed-view-video.active {
  display: grid;
  /* 截图实测：素材栏右边界 155.5、助手栏左边界 966（视口 1210）→ 156 / 1fr / 240 / 244 */
  grid-template-columns: 156px 1fr 240px var(--flmc-assist-video-w, 244px);
  grid-template-rows: 1fr 132px;
  grid-template-areas:
    "assets preview props assist"
    "timeline timeline timeline assist";
}

/* ---- 左上：素材面板（用户要求取消） ---- */
.edv-assets {
  display: flex;
  grid-area: assets;
  flex-direction: column;
  min-height: 0;
  background: #16202a;
  border-right: 1px solid var(--border);
}

.edv-assets-tabs {
  flex: 0 0 auto;
  display: flex;
  gap: 4px;
  padding: 10px 12px 0;
}

.edv-assets-tab {
  flex: 1;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 7px 0;
  border-radius: 8px 8px 0 0;
  border-bottom: 2px solid transparent;
  transition: color var(--dur), border-color var(--dur);
}

.edv-assets-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.edv-assets-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.edv-assets-empty {
  font-size: 12.5px;
  color: var(--text-faint);
  text-align: center;
  padding: 24px 0;
}

.edv-asset-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-dim);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color var(--dur), color var(--dur);
}

.edv-asset-item:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.edv-asset-item .edv-asset-ico {
  font-size: 16px;
}

.edv-asset-item .edv-asset-dur {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}

.edv-assets-foot {
  flex: 0 0 auto;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border);
}

.edv-assets-foot .btn {
  width: 100%;
}

/* ---- 中上：预览窗口 ---- */
.edv-preview {
  grid-area: preview;
  min-width: 0;
  min-height: 0;
  background: #16202a;   /* 截图实测：预览区空态底 #16202a */
  display: grid;
  place-items: center;
  position: relative;
}

.edv-preview-empty {
  text-align: center;
}

.edv-preview-empty p {
  font-size: 13.5px;
  color: var(--text-faint);
  margin-bottom: 14px;
}

.edv-preview-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 3D 片场：布光 / 焦段 / 取景辅助（2026-09-14） */
.ed3d-light-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 6px 0 2px;
}

.ed3d-mini-select {
  padding: 3px 6px;
  font-size: 11.5px;
  font-family: inherit;
  color: var(--text);
  background: #1b2733;
  border: 1px solid var(--border);
  border-radius: 6px;
  max-width: 132px;
}

.ed3d-mini {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-faint);
}

.ed3d-mini input[type="range"] {
  width: 84px;
  accent-color: var(--accent);
}

.ed3d-mini span { min-width: 38px; color: var(--text-dim); }

.ed3d-shot-label {
  font-size: 11.5px;
  color: var(--accent);
  border: 1px solid rgba(232, 99, 43, 0.45);
  background: rgba(232, 99, 43, 0.1);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.ed3d-light-adv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
  margin: 4px 0 2px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.ed3d-light-adv label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-faint);
}

.ed3d-light-adv input[type="range"] { width: 96px; accent-color: var(--accent); }
.ed3d-light-adv .ed3d-light-note {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.5;
}

/* 3D 片场：多视图 / 走位 blocking / 灯具附件 / A-B 对比（2026-09-14 深化） */
.ed3d-view-label,
.ed3d-block-note {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.5;
}

.ed3d-view-label {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.ed3d-block-note {
  margin: 2px 0 0;
}

.ed3d-block-note.ok { color: #7fd6a2; }
.ed3d-block-note.warn { color: #ffb37a; }

.ed3d-attach {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ed3d-attach .chip {
  padding: 2px 7px;
  font-size: 11px;
}

.ed3d-ab {
  margin: 6px 0 2px;
  padding: 7px 8px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.ed3d-ab-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11.5px;
  color: var(--text-faint);
}

.ed3d-ab-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.ed3d-ab-acts .chip {
  padding: 2px 8px;
  font-size: 11px;
}

.ed3d-ab-cells {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ed3d-ab-cells canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 260 / 176;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0e1519;
}

/* 时间轴 / 走位 / 姿势变化（2026-09-14 第三轮） */
.ed3d-tl-label { white-space: nowrap; }

#s3dClock {
  flex: 1 1 96px;
  min-width: 90px;
  accent-color: var(--accent);
}

.ed3d-tl-val {
  font-size: 11.5px;
  color: var(--accent);
  white-space: nowrap;
}

.ed3d-block-note.on { color: #7fd6a2; }

/* 时间轴缩略图条（2026-09-15）：横向可滚，当前时刻那一格高亮 */
.ed3d-thumbs {
  display: flex;
  gap: 4px;
  margin: 4px 0 2px;
  padding-bottom: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.ed3d-thumbs .ed3d-thumb {
  flex: 0 0 auto;
  width: 62px;
  height: 35px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #0e1519;
  cursor: pointer;
}

.ed3d-thumbs .ed3d-thumb.on {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(232, 99, 43, 0.55);
}

.ed3d-cam-btn { padding: 3px 8px; font-size: 11.5px; }

/* 镜头条（2026-09-15 第五轮）：一格一个镜头点，可拖拽换顺序 */
.ed3d-shots {
  display: flex;
  gap: 6px;
  margin: 2px 0 4px;
  padding-bottom: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.ed3d-shots-tip { font-size: 10.5px; color: var(--text-faint); }
.ed3d-shots-empty { font-size: 11px; color: var(--text-faint); }

.ed3d-shot {
  flex: 0 0 auto;
  width: 78px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0e1519;
  cursor: grab;
  user-select: none;
}

.ed3d-shot canvas {
  display: block;
  width: 76px;
  height: 43px;
  border-radius: 5px 5px 0 0;
}

.ed3d-shot.dragging { border-color: var(--accent); cursor: grabbing; }
.ed3d-shot.drop { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(232, 99, 43, 0.35); }

.ed3d-shot-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 1px 4px 2px;
  font-size: 9.5px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
}

.ed3d-shot-bar b { color: var(--accent); font-size: 10px; }

/* 镜头条上的三个小按钮（2026-09-15 第六轮）：插空镜 / 复制 / 删除 */
.ed3d-shot-ops {
  display: flex;
  gap: 2px;
  padding: 0 3px 3px;
}

.ed3d-shot-ops button {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-faint);
  font-size: 10px;
  line-height: 1.5;
  cursor: pointer;
  padding: 0;
}

.ed3d-shot-ops button:hover { border-color: var(--accent); color: var(--accent); }
.ed3d-shot-ops .ed3d-shot-del:hover { border-color: #ff8a6a; color: #ff8a6a; }

/* 转场时长滑杆（2026-09-15 第六轮） */
.ed3d-key-trans-wrap { display: inline-flex; align-items: center; gap: 4px; }

.ed3d-key-transdur {
  width: 54px;
  accent-color: var(--accent);
}

.ed3d-pose-custom { margin: 2px 0 4px; }

/* 3D 素材库（2026-09-15 第七十六轮） */
.ed3d-assets {
  display: block;
  margin: 8px 0;
  overflow-y: auto;
}

.ed3d-assets-empty { font-size: 11px; color: var(--text-faint); }

.ed3d-asset {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px 2px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 10.5px;
  color: var(--text-dim);
  max-width: 100%;
}

.ed3d-asset img { width: 22px; height: 22px; object-fit: cover; border-radius: 4px; }

.ed3d-asset .ed3d-asset-name {
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 📦 素材包标记（主模型 + .mtl + 贴图，2026-09-16 第八十轮） */
.ed3d-asset .ed3d-asset-pack {
  flex: 0 0 auto;
  padding: 0 4px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 16px;
  color: #14181b;
  background: var(--accent, #e8632b);
  opacity: 0.9;
}

.ed3d-asset button {
  border: 0;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 11px;
  padding: 0 2px;
}

.ed3d-asset button:hover { color: var(--accent); }
.ed3d-asset button.ed3d-asset-del:hover { color: #ff8a6a; }

.ed3d-shot-trans {
  color: #7fd6a2;
  border: 1px solid rgba(127, 214, 162, 0.4);
  border-radius: 999px;
  padding: 0 4px;
}

/* 姿势库小图（2026-09-15 第五轮） */
.ed3d-pose-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0 2px;
}

.ed3d-pose-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 3px 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-faint);
  font-size: 9.5px;
  cursor: pointer;
  font-family: inherit;
}

.ed3d-pose-btn:hover { border-color: var(--accent); color: var(--text); }

.ed3d-pose-btn.on {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--accent);
}

.ed3d-pose-btn canvas { display: block; }

.ed3d-posetrack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  flex: 1 1 100%;
}

.ed3d-posetrack-who {
  font-size: 11px;
  color: var(--text-dim);
}

.ed3d-posetrack-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 6px 1px 8px;
  background: rgba(255, 255, 255, 0.03);
}

.ed3d-posetrack-item b { color: var(--accent); font-weight: 600; }

.ed3d-posetrack-item button {
  border: 0;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 10px;
  padding: 0 1px;
  line-height: 1;
}

.ed3d-posetrack-item button:hover { color: #ff8a6a; }

.ed3d-posetrack-empty {
  font-size: 11px;
  color: var(--text-faint);
}

.ed3d-ab-tip {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.5;
}

/* 运镜面板只有约 244px 内容宽：长文案按钮允许换行，别把面板撑出横向滚动条（2026-09-14） */
#s3dMotion .chip {
  max-width: 100%;
  padding: 6px 11px;
  white-space: normal;
  text-align: left;
  line-height: 1.45;
}

/* 安全区参考线（竖屏/方形，2026-09-14）：覆盖在预览视频上，按当前画幅撑出比例 */
.edv-safe-area {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 92%;
  max-width: 96%;
  pointer-events: none;
  z-index: 3;
}

.edv-safe-band {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(232, 99, 43, 0.16);
  border: 1px dashed rgba(232, 99, 43, 0.85);
  box-sizing: border-box;
}

.edv-safe-band b {
  font-size: 10px;
  font-weight: 500;
  color: #ffd9c7;
  background: rgba(0, 0, 0, 0.45);
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  max-width: 96%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.edv-safe-top { top: 0; left: 0; right: 0; }
.edv-safe-bottom { bottom: 0; left: 0; right: 0; }
.edv-safe-left { top: 0; bottom: 0; left: 0; }
.edv-safe-right { top: 0; bottom: 0; right: 0; }

/* 字幕越界提醒（属性面板里的一行提示） */
.edv-safe-warn {
  margin: 8px 0 0;
  padding: 6px 8px;
  font-size: 11.5px;
  line-height: 1.5;
  color: #ffd9c7;
  background: rgba(232, 99, 43, 0.12);
  border: 1px solid rgba(232, 99, 43, 0.45);
  border-radius: 7px;
}

/* 字幕浮层（预览用；导出时同一份字幕会被画进画面） */
.edv-subtitle {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  max-width: 84%;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 14.5px;
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
}

/* 成片设置（字幕 / 配乐） */
.edv-props-out {
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 4px;
}

.edv-props-out .edv-prop-row {
  border-bottom: 0;
}

/* ================= 制作流水线（2026-09-13） ================= */
.ed-view-pipeline {
  display: none;
  padding: 18px 22px 26px;
  overflow: auto;
}

.ed-view-pipeline.active {
  display: block;
}

.ed-pipe {
  max-width: 1060px;
  margin: 0 auto;
}

.ed-pipe-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.ed-pipe-title h2 {
  margin: 0 0 6px;
  font-size: 19px;
  color: #fff;
}

.ed-pipe-title p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-faint);
  line-height: 1.7;
}

.ed-pipe-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.ed-pipe-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.ed-pipe-bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #e8632b, #ffa06a);
  transition: width var(--dur);
}

#pipePct {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  min-width: 42px;
  text-align: right;
}

.ed-pipe-start {
  display: flex;
  gap: 8px;
  margin: 16px 0 6px;
  flex-wrap: wrap;
}

#pipeIdea {
  flex: 1;
  min-width: 260px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}

#pipeIdea:focus {
  outline: none;
  border-color: var(--accent);
}

.ed-pipe-stages {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.ed-pipe-stage {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ed-pipe-stage.is-current {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(232, 99, 43, 0.25);
}

.ed-pipe-stage.is-done {
  border-color: rgba(53, 201, 192, 0.45);
}

.ed-pipe-stage-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ed-pipe-no {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: none;
}

.ed-pipe-stage.is-done .ed-pipe-no {
  background: rgba(53, 201, 192, 0.18);
  color: #7fe3dd;
}

.ed-pipe-stage.is-current .ed-pipe-no {
  background: rgba(232, 99, 43, 0.2);
  color: #ffb08a;
}

.ed-pipe-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex: 1;
}

.ed-pipe-badge {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-faint);
  white-space: nowrap;
}

.ed-pipe-stage.is-done .ed-pipe-badge {
  color: #7fe3dd;
  border-color: rgba(53, 201, 192, 0.4);
}

.ed-pipe-stage.is-current .ed-pipe-badge {
  color: #ffb08a;
  border-color: rgba(232, 99, 43, 0.4);
}

.ed-pipe-desc {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-faint);
}

.ed-pipe-cost {
  font-size: 11.5px;
  color: var(--muted, #93a4ab);
}

.ed-pipe-cost.is-paid {
  color: #ffcf6b;
}

.ed-pipe-stage-acts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

.ed-pipe-foot {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--text-faint);
}

/* 逐节点进度清单（⑤ 画面 / ⑥ 视频） */
.ed-pipe-nodes {
  margin: 4px 0 2px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.ed-pipe-nodes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.ed-pipe-fail {
  color: #ff9e9e;
}

.ed-pipe-nodes-list {
  max-height: 190px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ed-pipe-node {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
}

.ed-pipe-node.is-run {
  border-color: rgba(96, 165, 250, 0.35);
  background: rgba(96, 165, 250, 0.08);
}

.ed-pipe-node.is-ok {
  border-color: rgba(53, 201, 192, 0.3);
}

.ed-pipe-node.is-fail {
  border-color: rgba(255, 128, 128, 0.4);
  background: rgba(255, 128, 128, 0.08);
}

.ed-pipe-node-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
}

.ed-pipe-node-st {
  color: var(--text-faint);
  white-space: nowrap;
}

.ed-pipe-node.is-fail .ed-pipe-node-st {
  color: #ffa3a3;
}

.ed-pipe-node .chip {
  min-height: 22px;
  padding: 2px 8px;
  font-size: 11px;
}

.ed-pipe-nodes-empty {
  font-size: 11.5px;
  color: var(--text-faint);
  margin: 2px 0 0;
}

/* 首帧缩略图（清单每行左侧，点开可放大，2026-09-13） */
.ed-pipe-node-thumb {
  flex: none;
  width: 54px;
  height: 30px;
  border-radius: 5px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  cursor: zoom-in;
}

.ed-pipe-node-thumb img,
.ed-pipe-node-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ed-pipe-node-thumb.is-fail {
  border-color: rgba(255, 128, 128, 0.65);
}

.ed-pipe-node-thumb.is-run {
  border-color: rgba(96, 165, 250, 0.6);
}

.ed-pipe-thumb-ph {
  font-size: 13px;
  line-height: 1;
  font-style: normal;
  opacity: 0.75;
}

.ed-pipe-nodes-tools {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* 放大查看弹层 */
.ed-pipe-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ed-pipe-lightbox-box {
  width: min(92vw, 860px);
  background: #18232a;
  border: 1px solid var(--border-strong, #33454f);
  border-radius: 12px;
  overflow: hidden;
}

.ed-pipe-lightbox-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-faint);
}

.ed-pipe-lightbox-head b {
  color: #fff;
  font-size: 14px;
}

.ed-pipe-lightbox-head .chip {
  margin-left: auto;
}

.ed-pipe-lightbox-desc {
  margin: 0;
  padding: 10px 14px 14px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-dim);
}

/* ---- 右上：属性面板 ---- */
.edv-props {
  grid-area: props;
  min-height: 0;
  overflow-y: auto;
  background: #16202a;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 14px;
}

.edv-props h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-faint);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.edv-props-empty {
  font-size: 12.5px;
  color: var(--text-faint);
}

.edv-prop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-dim);
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.edv-prop-row span {
  color: var(--text-faint);
}

.edv-prop-row b {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.edv-prop-row input[type="range"] {
  width: 90px;
  accent-color: var(--accent);
}

/* 配音音色下拉（① TTS）：做成细长控件，避免撑破属性面板 */
.edv-prop-row select.edv-select {
  max-width: 132px;
  padding: 3px 6px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text);
  background: #1b2733;
  border: 1px solid var(--border);
  border-radius: 6px;
}

/* MP4 导出按钮：服务器没装 ffmpeg 时变淡（悬停有说明；点了也会明确报原因并退回 WebM） */
.edv-timeline-bar .btn.is-off {
  opacity: 0.45;
}

/* ③ 首尾帧模式弹窗（2026-09-14） */
.flmc-frame-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(4, 8, 11, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.flmc-frame-box {
  width: min(680px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: #16202a;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

.flmc-frame-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.flmc-frame-head b { font-size: 15px; }
.flmc-frame-head span { flex: 1; font-size: 12px; color: var(--text-faint); }
.flmc-frame-body { padding: 6px 18px 10px; }

.flmc-frame-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-dim);
}

.flmc-frame-row > label { width: 56px; color: var(--text-faint); flex: 0 0 auto; }
.flmc-frame-row select,
.flmc-frame-row textarea {
  flex: 1 1 220px;
  min-width: 160px;
  padding: 6px 8px;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--text);
  background: #1b2733;
  border: 1px solid var(--border);
  border-radius: 7px;
}

.flmc-frame-row .fm-thumb {
  width: 84px;
  height: 48px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-faint);
  overflow: hidden;
  flex: 0 0 auto;
}

.flmc-frame-row .fm-thumb img { width: 100%; height: 100%; object-fit: cover; }
.flmc-frame-row .fm-cost { color: var(--accent); font-weight: 600; }
.fm-hint { font-size: 12px; color: var(--text-faint); margin: 10px 0 0; line-height: 1.6; }

.flmc-frame-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

.flmc-frame-foot .fm-status { font-size: 12px; color: var(--text-dim); }

/* ---- 底部：时间轴 ---- */
.edv-timeline {
  grid-area: timeline;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #16202a;
  border-top: 1px solid var(--border);
}

.edv-ruler {
  flex: 0 0 22px;
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  padding: 0 80px;
}

.edv-ruler-mark {
  flex: 0 0 48px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-faint);
  padding-bottom: 2px;
  border-left: 1px solid var(--border-strong);
  padding-left: 4px;
  white-space: nowrap;
}

.edv-track {
  flex: 1;
  display: flex;
  align-items: stretch;
  min-height: 0;
}

.edv-track-label {
  flex: 0 0 70px;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--text-faint);
  border-right: 1px solid var(--border);
}

.edv-track-lane {
  flex: 1;
  position: relative;
  min-width: 0;
}

.edv-clip {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 34px;
  background: linear-gradient(135deg, rgba(232, 99, 43, 0.25), rgba(232, 99, 43, 0.08));
  border: 1px solid rgba(232, 99, 43, 0.45);
  border-radius: 7px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 11px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: filter var(--dur);
}

.edv-clip:hover {
  filter: brightness(1.2);
}

.edv-clip.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

/* ---- 视频编辑器深化：控制栏 / 播放头 / 片段手柄 ---- */
.edv-timeline-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}

.edv-timeline-hint {
  flex: 1;
  text-align: right;
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.edv-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--accent);
  pointer-events: none;
  z-index: 5;
  box-shadow: 0 0 6px rgba(232, 99, 43, 0.6);
}

.edv-clip-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edv-clip-dur {
  margin-left: 6px;
  font-size: 10px;
  color: var(--text-faint);
}

.edv-clip-grip {
  flex: 0 0 8px;
  height: 100%;
  margin-left: 6px;
  cursor: ew-resize;
  border-left: 2px dotted rgba(232, 99, 43, 0.5);
}

.edv-clip.playing {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(232, 99, 43, 0.55);
  background: linear-gradient(135deg, rgba(232, 99, 43, 0.45), rgba(232, 99, 43, 0.15));
}

/* ================= 视频编辑器响应式 ================= */
@media (max-width: 1100px) {
  .ed-view-video.active {
    grid-template-columns: 200px 1fr 240px;
    grid-template-areas:
      "assets preview props"
      "timeline timeline timeline";
  }
  .ed-view-video .ed-assist {
    display: none;
  }
}

@media (max-width: 800px) {
  .ed-view-video.active {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 132px;
    grid-template-areas:
      "preview"
      "timeline";
  }
  .edv-assets,
  .edv-props {
    display: none;
  }
}

/* 连线流动动画（2026-09-19）：数据流沿连线从源流向目标 */
.edge-line.edge-flow {
  animation: edge-dash-flow 0.7s linear infinite;
}
@keyframes edge-dash-flow {
  to { stroke-dashoffset: -12; }
}
@media (prefers-reduced-motion: reduce) {
  .edge-line.edge-flow { animation: none; }
}

/* 空画布"点卡片建节点"（SHUO 风格，2026-09-19） */
.ed-empty-nodes { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 20px; }
.empty-node-card {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 20px; background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12); border-radius: 12px;
  color: #e8eaf0; font-size: 14px; cursor: pointer; transition: background .15s, border-color .15s;
}
.empty-node-card:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.28); }
.enc-ic { font-size: 18px; }

/* 点节点→下方编辑框（SHUO 逻辑，2026-09-19） */
.node-inspector {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%) translateY(20px);
  width: min(720px, 92%);
  background: rgba(24, 26, 34, 0.97); border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px; padding: 14px 16px; z-index: 60;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
}
.node-inspector.open { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.ni-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ni-kind { font-size: 15px; }
.ni-title {
  flex: 1; background: transparent; border: none; color: #eef0f6;
  font-size: 15px; font-weight: 600; outline: none; border-bottom: 1px solid transparent;
}
.ni-title:focus { border-bottom-color: rgba(255,255,255,.25); }
.ni-close { background: none; border: none; color: #9aa; cursor: pointer; font-size: 15px; }
.ni-close:hover { color: #fff; }
.ni-desc {
  width: 100%; min-height: 56px; resize: vertical;
  background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px; color: #dfe2ec; padding: 8px 10px; font-size: 13px; outline: none;
  box-sizing: border-box;
}
.ni-desc:focus { border-color: rgba(96,165,250,.5); }
.ni-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.ni-select { background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.12); color: #dfe2ec; border-radius: 8px; padding: 6px 10px; font-size: 13px; }

/* 节点右键菜单（SHUO 风格，2026-09-19） */
.node-menu {
  position: fixed; z-index: 200; min-width: 168px;
  background: rgba(28, 30, 40, 0.98); border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px; padding: 6px; box-shadow: 0 10px 34px rgba(0,0,0,.55);
  display: none;
}
.node-menu.open { display: block; }
.node-menu-item {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 8px 12px; border-radius: 6px; color: #e6e9f2; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.node-menu-item:hover { background: rgba(255,255,255,.1); }
.node-menu-item.danger { color: #ff6b6b; }
.node-menu-item.danger:hover { background: rgba(255,107,107,.12); }
.node-menu-item .km { color: #787e90; font-size: 11px; }
.node-menu-sep { height: 1px; background: rgba(255,255,255,.1); margin: 6px 4px; }

/* 节点大纲（2026-09-19） */
.node-outline {
  position: absolute; left: 12px; top: 60px; z-index: 50;
  width: 168px; max-height: 70%;
  background: rgba(24,26,34,.92); border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px; overflow: hidden; display: flex; flex-direction: column;
}
.node-outline .no-head {
  padding: 8px 10px; font-size: 12px; color: #cfd3e0; cursor: pointer; user-select: none;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.node-outline .no-count { color: #787e90; }
.node-outline .no-list { overflow-y: auto; padding: 4px; }
.node-outline .no-item {
  padding: 6px 8px; border-radius: 6px; font-size: 12px; color: #c8ccda; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.node-outline .no-item:hover { background: rgba(255,255,255,.1); }
.node-outline .no-item.active { background: rgba(96,165,250,.25); color: #fff; }
.node-outline.collapsed .no-list { display: none; }

/* 资产库画廊网格（2026-09-19） */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; padding: 4px; width: 100%; box-sizing: border-box; }
.asset-card { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.ag-thumb { width: 100%; height: 130px; background: #14161e; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ag-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ag-model { flex-direction: column; gap: 4px; color: #888; font-size: 28px; }
.ag-path { font-size: 10px; color: #666; max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-info { padding: 8px; }
.ag-name { font-size: 12px; color: #dfe2ec; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-size { color: #787e90; font-size: 10px; }
.ag-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.ag-row select { flex: 1; min-width: 0; font-size: 11px; background: rgba(0,0,0,.3); color: #dfe2ec; border: 1px solid rgba(255,255,255,.1); border-radius: 6px; padding: 3px 4px; }
.ag-btns { flex-wrap: wrap; }
.ag-btns button { font-size: 11px; padding: 3px 7px; border-radius: 6px; background: rgba(255,255,255,.08); color: #dfe2ec; border: none; cursor: pointer; }
.ag-btns button:hover { background: rgba(255,255,255,.16); }
.ed3d-asset-del { color: #ff6b6b !important; }

/* 资产库网格图片墙（2026-09-19） */
#viewAssets { display: none; padding: 12px; box-sizing: border-box; }
#viewAssets.active { display: block; }
#viewAssets .ed3d-light-row { width: 100%; box-sizing: border-box; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; width: 100%; box-sizing: border-box; }
.asset-card { background: #1c1f2a; border: 1px solid #2a2e3d; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.ag-thumb { width: 100%; height: 150px; background: #10121a; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ag-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ag-model { font-size: 32px; color: #555; }
.ag-name { font-size: 12px; color: #dfe2ec; padding: 6px 8px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-meta { padding: 2px 8px 6px; }
.ag-meta select { width: 100%; font-size: 11px; background: #14161e; color: #dfe2ec; border: 1px solid #2a2e3d; border-radius: 6px; padding: 3px; }
.ag-btns { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 8px 8px; }
.ag-btns button { font-size: 11px; padding: 3px 7px; border-radius: 6px; background: #2a2e3d; color: #dfe2ec; border: none; cursor: pointer; }
.ag-btns button:hover { background: #3a3f52; }
.ed3d-asset-del { color: #ff6b6b !important; }

/* 3D 片场首次引导（2026-09-19） */
.s3d-welcome { position: absolute; inset: 0; z-index: 300; background: rgba(10,12,18,.82); display: flex; align-items: center; justify-content: center; }
.s3d-w-card { background: #1a1d27; border: 1px solid #2a2e3d; border-radius: 14px; padding: 32px 40px; text-align: center; max-width: 460px; }
.s3d-w-title { font-size: 22px; color: #fff; font-weight: 600; }
.s3d-w-sub { font-size: 15px; color: #aab; margin: 10px 0 24px; }
.s3d-w-demo { display: flex; align-items: center; justify-content: center; gap: 24px; margin-bottom: 28px; }
.s3d-w-col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.s3d-w-box { width: 150px; height: 100px; background: #2a2e3d; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #cfd3e0; font-size: 14px; }
.s3d-w-tag { font-size: 12px; color: #888; }
.s3d-w-arrow { font-size: 24px; color: #888; }
.s3d-w-start { background: #fff; color: #111; border: none; border-radius: 10px; padding: 10px 36px; font-size: 15px; cursor: pointer; }
.s3d-w-skip { margin-top: 12px; font-size: 13px; color: #778; cursor: pointer; }
.s3d-w-skip:hover { color: #aab; }

/* 对话面板 FLICK 风格（2026-09-19） */
.ed-newchat { background: rgba(255,255,255,.08); color: #e8eaf2; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.ed-newchat:hover { background: rgba(255,255,255,.14); }
.chat-welcome { padding: 24px 16px; text-align: center; }
.chat-welcome-film { font-size: 40px; margin-bottom: 12px; }
.chat-welcome h3 { font-size: 18px; color: #fff; margin: 0 0 6px; }
.chat-welcome p { font-size: 13px; color: #888; margin: 0 0 18px; }
.chat-sug { display: flex; flex-direction: column; gap: 8px; }
.chat-sug button { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 10px 12px; color: #dfe2ec; font-size: 13px; cursor: pointer; text-align: left; }
.chat-sug button:hover { background: rgba(255,255,255,.09); }
.chat-sug .cs-ic { font-size: 18px; }

/* 对话面板 FLICK 风格（2026-09-19） */
.ed-newchat { background: rgba(255,255,255,.08); color: #e8eaf2; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.ed-newchat:hover { background: rgba(255,255,255,.14); }
.chat-welcome { padding: 24px 16px; text-align: center; }
.chat-welcome-film { font-size: 40px; margin-bottom: 12px; }
.chat-welcome h3 { font-size: 18px; color: #fff; margin: 0 0 6px; }
.chat-welcome p { font-size: 13px; color: #888; margin: 0 0 18px; }
.chat-sug { display: flex; flex-direction: column; gap: 8px; }
.chat-sug button { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 10px 12px; color: #dfe2ec; font-size: 13px; cursor: pointer; text-align: left; }
.chat-sug button:hover { background: rgba(255,255,255,.09); }
.chat-sug .cs-ic { font-size: 18px; }

/* 提示词库（2026-09-19） */
.pl-mask { position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; }
.pl-box { background: #1a1d27; border-radius: 14px; padding: 20px; width: 560px; max-width: 90vw; max-height: 80vh; display: flex; flex-direction: column; }
.pl-box h3 { color: #fff; margin: 0 0 12px; font-size: 16px; }
.pl-tagsrow { margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.pl-list { overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pl-item { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 8px; padding: 10px; cursor: pointer; color: #dfe2ec; font-size: 13px; }
.pl-item:hover { background: rgba(255,255,255,.1); }
.pl-tags { margin-top: 4px; }
.pl-tag { display: inline-block; background: rgba(96,165,250,.2); color: #9cc; border-radius: 4px; padding: 1px 6px; font-size: 11px; margin-right: 4px; }

/* 故事页四段式（2026-09-19） */
.script-sections { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid #2a2e3d; margin-bottom: 8px; }
.ss-tab { background: transparent; color: #888; border: none; padding: 6px 14px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.ss-tab.active { background: rgba(255,255,255,.1); color: #fff; }
.ss-tab:hover { color: #ccc; }

.pl-cover { width: 100%; height: 80px; object-fit: cover; border-radius: 6px; margin-bottom: 4px; }
.pl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }

.s3d-cat { display:flex; gap:4px; flex-wrap:wrap; } .cat-tab { background:transparent; border:1px solid #333; color:#aaa; padding:4px 10px; border-radius:6px; cursor:pointer; font-size:12px; } .cat-tab.active { background:#4a6cf7; color:#fff; border-color:#4a6cf7; } .s3d-cat-body { margin:8px 0; } .s3d-cat-item { padding:6px 8px; background:#2a2e3d; border-radius:6px; cursor:pointer; margin-bottom:4px; font-size:13px; } .s3d-cat-item:hover { background:#3a3e4d; }

/* 📚 提示词库升级版（2026-09-19b） */
.pl-box-wide { width: 960px; max-width: 94vw; height: 86vh; max-height: 86vh; }
.pl-search { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 8px; border: 1px solid #333; background: #12141c; color: #fff; font-size: 14px; margin-bottom: 10px; }
.pl-search:focus { outline: none; border-color: #4a6cf7; }
.pl-catsrow, .pl-tagsrow { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; max-height: 78px; overflow-y: auto; }
.pl-list { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); overflow-y: auto; flex: 1; min-height: 0; padding-right: 4px; }
.pl-cover-empty { display: flex; align-items: center; justify-content: center; background: #262a38; color: #5a6076; font-size: 26px; }
.pl-item b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; min-height: 34px; }
.chip.pl-cat.active, .chip.pl-tagbtn.active { background: #4a6cf7; color: #fff; border-color: #4a6cf7; }
#plMore { margin-top: 10px; }

/* ============================================================
   窄屏遮挡修复（2026-09-19 · 第 119 轮）
   问题来源：画布上的浮动层（竖排工具条 / 节点大纲 / 流程引导 / 小地图 /
             节点检查器）各自定位，窄屏下互相压住。
   实测（lint.js，同一套视口）：1536 有 2 处、1280 有 4 处、手机(390) 有 21 处
   （外加手机 17 个触控目标过小）。下面每一条都对应一处实测出来的遮挡。
   ============================================================ */

/* ① 隐藏中的「节点检查器」不再参与命中测试。
      它原来只写了 opacity:0，元素仍在那儿 —— lint 报的
      niTitle / niDesc / niClose 被挡，全是这个看不见的面板造成的假遮挡。 */
.node-inspector { visibility: hidden; }
.node-inspector.open { visibility: visible; }

/* ② 节点大纲从"画布左上角"挪到右上角。
      左上角 left:10px 是竖排工具条（.ed-canvas-tools，宽 38），
      大纲原来 left:12px，正好把前两个工具按钮（🖱/⤢）压在底下点不到。
      右上角在窄屏是空的（小地图在右下、流程引导在左、检查器在底部居中）。 */
.node-outline { left: auto; right: 14px; }

/* ③ 工具条按钮不再被 flex 压扁。
      工具条是"垂直居中 + max-height + overflow:auto"的纵向 flex，
      14 个按钮超过可用高度时会被 flex-shrink 压成 17px 高（实测手机端 32×17），
      这既是"触控目标过小"的根因，也让图标贴着看不清。固定不收缩后改为滚动。 */
.ed-canvas-tools .ed-tool,
.ed-canvas-tools .ed-tools-sep { flex: 0 0 auto; }

/* ④ ≤1280：小地图会压住空状态卡片（实测 1280 下「📦 道具」卡被盖住点不到）。 */
@media (max-width: 1280px) {
  .ed-minimap { display: none; }
}

/* ⑤ ≤900：空画布时只留"空状态引导"，把流程引导浮窗收起。
      两者都在左上且 z-index 反着（引导 6 > 空状态 5），
      空状态里的示例 chip / 建节点卡片成片被盖住点不到。
      同时让空状态自身可滚动：原来它比画布高，最后一行卡片落到聊天面板底下。 */
@media (max-width: 900px) {
  .ed-canvas-wrap.is-empty .ed-guide { display: none; }
  /* 空画布时"节点大纲"里本来就没有节点可列（面板上写着 📋 节点 0），
     在手机上却正好压住空状态最后一行卡片 → 窄屏直接收起，建了节点再出现 */
  .ed-canvas-wrap.is-empty .node-outline { display: none; }
  .ed-empty { overflow-y: auto; overflow-x: hidden; }
  .ed-empty-inner { margin: auto 0; }
}

/* ⑥ ≤720：左下角「菜单」圆钮（fixed）压住对话框的「发送」按钮（实测 390×844）；
      节点大纲改锚到画布右下（此时小地图已隐藏），避免和流程引导抢右上角。 */
@media (max-width: 720px) {
  /* 注：sidebar.css 在 editor.css 之后加载，同为单类选择器时后者会覆盖前者，
     所以这里用 body 提升一级特异性（不要用 !important，免得以后改不动） */
  body .sb-toggle { bottom: 96px; }
  /* 工具条改成从画布顶部开始排（原来是垂直居中），配合上面的"不收缩"改为滚动 */
  .ed-canvas-tools { top: 8px; transform: none; }
  .node-outline { top: auto; bottom: 14px; right: 14px; max-height: 52%; }
}
