/* ═══════════════════════════════════════════════
   Muse 导演台 · 暗色影调主题
   ═══════════════════════════════════════════════ */
:root {
  --bg: #0b0d10;
  --panel: #12151a;
  --panel2: #181c23;
  --panel3: #1f242d;
  --line: #242b35;
  --line2: #2e3642;
  --text: #e8eaed;
  --dim: #8b95a1;
  --dim2: #5c6672;
  --accent: #e8b34b;       /* 场记板琥珀 */
  --accent-dim: #a97f2c;
  --danger: #e5604c;
  --ok: #57c26b;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; color: var(--text); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #2c3440; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #3a4553; }
::-webkit-scrollbar-track { background: transparent; }
.hidden { display: none !important; }

/* 键盘可达性：Tab 聚焦时给一圈琥珀描边（鼠标点击不受影响） */
:focus-visible { outline: 2px solid rgba(232,179,75,.55); outline-offset: 1px; }
/* Safari/Chrome 自动填充时输入框被刷成白底：压回暗色 */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #181c23 inset;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  transition: background-color 9999s ease-out;
}

/* ══════════ 顶栏 ══════════ */
#topbar {
  height: 44px;
  flex: 0 0 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  z-index: 20;
}
.tb-left, .tb-right { display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 8px; user-select: none; }
.brand-icon { font-size: 18px; }
.brand-name {
  font-weight: 700; letter-spacing: 2px; font-size: 13px; color: var(--text);
}
.tb-sep { width: 1px; height: 20px; background: var(--line2); }
.project-name {
  background: transparent; border: 1px solid transparent; border-radius: 6px;
  padding: 4px 8px; font-size: 13px; width: 220px; transition: .15s;
}
.project-name:hover { border-color: var(--line2); }
.project-name:focus { outline: none; border-color: var(--accent-dim); background: var(--panel); }

.pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 20px; padding: 3px 10px; font-size: 12px;
  font-family: var(--mono); color: var(--dim); white-space: nowrap;
}
.pill b { color: var(--text); font-weight: 600; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.pill-demo { border-color: rgba(232,179,75,.4); color: var(--accent); }
.pill-demo .dot { background: var(--accent); animation: blink 1.2s infinite; }
.pill-demo.urgent .dot { background: var(--danger); }
@keyframes blink { 50% { opacity: .25; } }

.tbtn {
  background: var(--panel2); border: 1px solid var(--line);
  color: var(--dim); border-radius: 7px; padding: 5px 10px; font-size: 12px;
  display: inline-flex; align-items: center; gap: 6px; transition: .15s;
}
.tbtn:hover { color: var(--text); border-color: var(--line2); background: var(--panel3); }
.tbtn-accent { border-color: rgba(232,179,75,.45); color: var(--accent); }
.tbtn-accent:hover { background: rgba(232,179,75,.1); color: var(--accent); }
.badge {
  background: var(--accent); color: #14100a; font-size: 10px; font-weight: 700;
  border-radius: 9px; padding: 1px 6px; font-family: var(--mono);
}

/* ══════════ 主区布局 ══════════ */
#main { flex: 1; display: flex; min-height: 0; }

/* —— 左：场次 —— */
#scenes {
  width: 200px; flex: 0 0 200px;
  background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
}
.side-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px 6px;
}
.side-title { font-size: 11px; letter-spacing: 3px; color: var(--dim2); font-weight: 700; }
.mini-btn {
  background: var(--panel2); color: var(--dim); border: 1px solid var(--line);
  border-radius: 6px; padding: 3px 9px; font-size: 11px; transition: .15s;
}
.mini-btn:hover { color: var(--accent); border-color: var(--accent-dim); }
.scene-list { flex: 1; overflow-y: auto; padding: 4px 8px; }
.scene-item {
  border-radius: 8px; padding: 8px 10px; margin-bottom: 4px;
  cursor: pointer; border: 1px solid transparent; transition: .15s;
  position: relative;
}
.scene-item:hover { background: var(--panel2); }
.scene-item.active { background: rgba(232,179,75,.09); border-color: rgba(232,179,75,.22); }
.scene-item.active::before {
  content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px;
  border-radius: 2px; background: var(--accent);
}
.scene-item .sc-title {
  display: flex; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 600;
}
.scene-item .sc-name {
  flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.scene-item .sc-no { font-family: var(--mono); font-size: 10px; color: var(--accent); margin-right: 6px; }
.scene-item .sc-side { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; min-width: 0; }
.scene-item .sc-count { font-family: var(--mono); font-size: 10px; color: var(--dim2); }
.scene-item .sc-desc {
  margin-top: 3px; font-size: 11px; color: var(--dim2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.scene-item.active .sc-desc { color: var(--dim); }
.sc-menu { opacity: 0; background: none; border: none; color: var(--dim2); font-size: 14px; padding: 0 2px; line-height: 1; }
.scene-item:hover .sc-menu { opacity: 1; }
.sc-menu:hover { color: var(--text); }
@media (max-width: 900px) { .sc-menu { opacity: 1; } }
.side-foot { padding: 10px 12px; border-top: 1px solid var(--line); }
.proj-stats { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.proj-stats .ps-item {
  display: inline-flex; align-items: baseline; gap: 4px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 6px;
  padding: 2px 7px; font-size: 10.5px; color: var(--dim2); white-space: nowrap;
}
.proj-stats b { color: var(--dim); font-family: var(--mono); font-weight: 600; }

/* —— 中：分镜板 —— */
#board { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-y: auto; }
.scene-header {
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(18,21,26,.6);
  position: sticky; top: 0; z-index: 5; backdrop-filter: blur(6px);
}
.sh-row1 { display: flex; align-items: center; gap: 10px; }
.sh-title {
  background: transparent; border: 1px solid transparent; border-radius: 6px;
  font-size: 15px; font-weight: 700; padding: 3px 8px; min-width: 60px; flex: 0 1 auto;
}
.sh-title:hover { border-color: var(--line2); }
.sh-title:focus { outline: none; border-color: var(--accent-dim); }
.sh-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.sh-desc {
  margin-top: 8px; width: 100%;
  background: transparent; border: 1px solid transparent; border-radius: 6px;
  color: var(--dim); font-size: 12px; padding: 4px 8px; resize: none;
  line-height: 1.5;
}
.sh-desc:hover { border-color: var(--line); }
.sh-desc:focus { outline: none; border-color: var(--accent-dim); color: var(--text); }

.add-bar { display: flex; gap: 8px; padding: 12px 18px 2px; flex-wrap: wrap; }
.add-shot {
  display: flex; align-items: center; gap: 6px;
  background: var(--panel2); border: 1px solid var(--line2); color: #b6bfca;
  border-radius: 8px; padding: 6px 13px; font-size: 12px; transition: .15s;
}
.add-shot:hover { color: var(--accent); border-color: var(--accent-dim); background: rgba(232,179,75,.06); }
.add-shot .cost { font-family: var(--mono); font-size: 10px; color: var(--dim); }

.storyboard {
  display: grid;
  /* 板子缩放（2026-11-06）：--bz 由 JS 按视图缩放比写，卡片宽跟着变、列数自然增减，间距不动 */
  grid-template-columns: repeat(auto-fill, minmax(calc(260px * var(--bz, 1)), 1fr));
  gap: 16px; padding: 16px 20px 24px;
}
.board-hint {
  grid-column: 1 / -1; margin: 48px auto; text-align: center; color: var(--dim2); line-height: 1.7;
}
.board-hint .bh-icon {
  font-size: 30px; opacity: .55; margin-bottom: 10px;
}
.board-hint .bh-title { font-size: 14px; font-weight: 700; color: var(--dim); letter-spacing: 1px; }
.board-hint .bh-sub { font-size: 12px; margin-top: 5px; }
.board-hint .btn { margin-top: 14px; }

/* —— 镜头卡 —— */
.shot {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .15s, transform .15s, box-shadow .15s;
  cursor: pointer; position: relative;
}
.shot:hover { border-color: var(--line2); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.38); }
.shot .thumb img, .shot .thumb .v-thumb { transition: transform .25s ease; }
.shot:hover .thumb img, .shot:hover .thumb .v-thumb { transform: scale(1.04); }
.shot.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.shot.approved { border-color: rgba(87,194,107,.55); }
.shot.approved::after {
  content: "✓ 定稿"; position: absolute; top: 34px; right: 8px; z-index: 3;
  background: var(--ok); color: #06130a; font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 4px;
}
.slate {
  height: 22px; display: flex; align-items: center; gap: 8px; padding: 0 9px;
  background: var(--panel2);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 10px; color: var(--dim);
}
.slate .sl-no { color: var(--accent); font-weight: 700; }
.slate .sl-type { margin-left: auto; }
.thumb {
  aspect-ratio: 16/9; background: #0d1014 center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.thumb .ph { color: #333c48; font-size: 30px; }
.thumb .play-ov {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.25);
}
.thumb .play-ov span {
  width: 38px; height: 38px; border-radius: 50%; background: rgba(20,16,10,.75);
  border: 1px solid rgba(232,179,75,.7); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .v-thumb { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.thumb-draft {
  background:
    linear-gradient(160deg, rgba(36,43,53,.55), rgba(13,16,20,.2)),
    #0d1014;
}
.thumb-draft .ph { font-size: 13px; letter-spacing: 3px; opacity: .75; }
.shot-foot { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.shot-meta { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10px; color: var(--dim2); }
.shot-meta .sp { flex: 1; }
.stchip {
  font-size: 10px; padding: 2px 8px; border-radius: 9px; font-weight: 600;
  font-family: var(--sans); white-space: nowrap;
}
.st-draft     { background: #262c35; color: #97a2ae; }
.st-queued    { background: #262c35; color: #97a2ae; }
.st-generating{ background: rgba(232,179,75,.15); color: var(--accent); animation: pulse 1.4s infinite; }
.st-done      { background: rgba(87,194,107,.14); color: var(--ok); }
.st-failed    { background: rgba(229,96,76,.15); color: var(--danger); }
.st-approved  { background: rgba(87,194,107,.24); color: #8fe0a1; }
@keyframes pulse { 50% { opacity: .45; } }
.shot-prompt {
  font-size: 11px; color: #a3adb9; line-height: 1.5; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 17px;
}
/* 失败原因（2026-11-03）：直接写在卡片/节点上，不用点进检查器才看得到 */
.shot-err {
  font-size: 11px; color: var(--danger); margin-top: 4px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.shot-acts { display: flex; gap: 6px; }
.card-btn {
  flex: 1; background: var(--panel3); border: 1px solid var(--line2); color: var(--dim);
  border-radius: 6px; padding: 4px 0; font-size: 11px; transition: .12s;
}
.card-btn:hover { color: var(--text); border-color: var(--accent-dim); }
.card-btn.danger:hover { color: var(--danger); border-color: var(--danger); }
.card-btn:disabled { opacity: .55; cursor: not-allowed; }
.card-btn:disabled:hover { color: var(--dim); border-color: var(--line2); }
/* 可执行的主操作（草稿/失败待生成）：琥珀轻底，与「重生成」区分开 */
.card-btn.card-btn-primary {
  background: rgba(232,179,75,.13); border-color: rgba(232,179,75,.4); color: var(--accent);
  font-weight: 600;
}
.card-btn.card-btn-primary:hover { background: rgba(232,179,75,.2); border-color: var(--accent); color: var(--accent); }
.card-btn.card-menu { flex: 0 0 34px; }
.draw-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.draw-card { border: 1px solid var(--line2); border-radius: 8px; padding: 8px; background: var(--panel3); }
.draw-card .thumb img { width: 100%; display: block; border-radius: 6px; }
.draw-acts { display: flex; gap: 6px; margin-top: 8px; }
.draw-err { font-size: 11px; color: var(--danger); margin-top: 6px; }
.free-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.free-zoom { font-size: 12px; color: var(--dim); min-width: 42px; text-align: center; }
.free-hint { font-size: 11px; color: var(--dim2); }
.free-canvas { position: relative; height: 640px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); cursor: grab; touch-action: none; }
.free-canvas:active { cursor: grabbing; }
.free-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.free-nodes { position: absolute; left: 0; top: 0; }
.free-node { position: absolute; cursor: grab; }
.free-node:active { cursor: grabbing; }
.free-node .shot { width: 100%; }
.free-node .shot .thumb img { width: 100%; display: block; }
#freeEdges { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.shot-bar { height: 3px; background: var(--line); position: relative; }
.shot-bar i {
  position: absolute; inset: 0 auto 0 0; background: var(--accent);
  transition: width .4s;
}

/* —— 右：镜头详情 —— */
#inspector {
  width: 324px; flex: 0 0 324px;
  background: var(--panel); border-left: 1px solid var(--line);
  overflow-y: auto; padding-bottom: 30px;
}
.insp-empty { padding: 60px 24px; text-align: center; color: var(--dim2); font-size: 12px; line-height: 2.2; }
.insp-sec { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.insp-label {
  font-size: 10.5px; letter-spacing: 2.5px; color: var(--dim2); font-weight: 700;
  margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between;
}
.insp-label .r { letter-spacing: 0; font-weight: 400; }
.type-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.type-opt {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 4px; text-align: center; font-size: 12px; color: var(--dim); transition: .12s;
}
.type-opt small { display: block; font-family: var(--mono); font-size: 9.5px; color: var(--dim2); margin-top: 2px; }
.type-opt.on { border-color: var(--accent); color: var(--accent); background: rgba(232,179,75,.08); }
textarea.prompt {
  width: 100%; min-height: 110px; resize: vertical;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 10px; font-size: 12.5px; line-height: 1.6; color: var(--text);
}
textarea.prompt:focus { outline: none; border-color: var(--accent-dim); }
.chip-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.chip-cat { width: 100%; font-size: 10px; color: var(--dim2); margin-top: 4px; font-family: var(--mono); }
.chip {
  background: var(--panel3); border: 1px solid var(--line2); border-radius: 20px;
  padding: 2px 10px; font-size: 11px; color: var(--dim); transition: .12s;
}
.chip:hover { color: var(--accent); border-color: var(--accent-dim); }
.chip.on { background: rgba(232,179,75,.14); color: var(--accent); border-color: var(--accent-dim); }
.prompt-selects {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
  margin-top: 10px;
}
.prompt-select {
  display: flex; flex-direction: column; gap: 5px; min-width: 0;
}
.prompt-select > span {
  font-size: 10px; color: var(--dim2); font-family: var(--mono);
}
.prompt-select .sel-input {
  color: var(--dim); cursor: pointer; padding: 7px 6px; font-size: 12px;
}
.prompt-select .sel-input:focus { color: var(--text); }

.ref-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-item { position: relative; width: 84px; height: 60px; border-radius: 7px; overflow: hidden; border: 1px solid var(--line2); }
.ref-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-item .ref-x {
  position: absolute; top: 3px; right: 3px; width: 17px; height: 17px; border-radius: 50%;
  background: rgba(0,0,0,.65); color: #fff; border: none; font-size: 10px; line-height: 1;
}
.ref-item .ref-tag {
  position: absolute; left: 0; right: 0; bottom: 0; font-size: 9px; text-align: center;
  background: rgba(0,0,0,.6); color: #cbd4dd; font-family: var(--mono); padding: 1px 0;
}
.ref-add {
  width: 84px; height: 60px; border-radius: 7px; border: 1px dashed var(--line2);
  background: var(--panel2); color: var(--dim2); font-size: 11px; display: flex;
  flex-direction: column; align-items: center; justify-content: center; gap: 2px; transition: .12s;
}
.ref-add:hover { color: var(--accent); border-color: var(--accent-dim); }
.insp-row { display: flex; gap: 8px; margin-top: 10px; }
.insp-note {
  width: 100%; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 9px; font-size: 12px; resize: none; min-height: 52px; line-height: 1.5;
}
.insp-note:focus { outline: none; border-color: var(--accent-dim); }
.num-input {
  width: 72px; background: var(--panel2); border: 1px solid var(--line); border-radius: 7px;
  padding: 5px 8px; font-family: var(--mono); font-size: 12px;
}
.num-input:focus { outline: none; border-color: var(--accent-dim); }

.btn {
  border-radius: 8px; border: 1px solid var(--line2); background: var(--panel3);
  color: var(--text); padding: 8px 14px; font-size: 12.5px; transition: .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.btn:hover { border-color: var(--dim2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-gen {
  flex: 1; background: var(--accent);
  border: none; color: #1d1608; font-weight: 700; padding: 10px;
}
.btn-gen:hover { filter: brightness(1.08); }
.btn-gen:disabled { filter: grayscale(.6); }
.btn-ghost { background: transparent; }
/* 琥珀轻底次主操作（如「生成本场未定稿」）：比普通 btn 更醒目、比 btn-gen 克制 */
.btn-accent-soft {
  background: rgba(232,179,75,.1); border-color: rgba(232,179,75,.4); color: var(--accent);
  font-weight: 600;
}
.btn-accent-soft:hover { background: rgba(232,179,75,.17); border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 5px 10px; font-size: 11.5px; border-radius: 6px; }
.btn-danger { color: var(--danger); border-color: rgba(229,96,76,.4); }
.btn-danger:hover { background: rgba(229,96,76,.1); }

/* 任务进度区 */
.gen-status { border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px; background: var(--panel2); }
.gs-row { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; color: var(--dim); }
.gs-row + .gs-row { margin-top: 5px; }
.gs-row b { color: var(--text); font-weight: 600; }
.gs-bar { height: 4px; border-radius: 3px; background: var(--line); margin-top: 8px; overflow: hidden; }
.gs-bar i { display: block; height: 100%; width: 30%; border-radius: 3px;
  background: var(--accent); animation: indet 1.3s ease-in-out infinite; }
@keyframes indet { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }
.gs-err {
  margin-top: 8px; border-radius: 7px; padding: 8px 10px; font-size: 11.5px; line-height: 1.6;
  background: rgba(229,96,76,.1); border: 1px solid rgba(229,96,76,.35); color: #f0a396;
}
.gs-err code { font-family: var(--mono); font-size: 10.5px; color: var(--danger); }
.gs-content {
  margin-top: 8px; font-size: 12px; color: var(--dim); line-height: 1.6;
  background: var(--panel); border-radius: 7px; padding: 8px 10px; max-height: 130px; overflow-y: auto;
  white-space: pre-wrap;
}
.result-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.result-thumbs .rt {
  position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--line2);
  width: 100%; cursor: zoom-in;
}
.result-thumbs .rt img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.result-thumbs .rt video { width: 100%; aspect-ratio: 16/9; object-fit: contain; display: block; background: #000; }
.rt-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }

/* ══════════ 时间线 ══════════ */
#timeline {
  flex: 0 0 96px; background: var(--panel); border-top: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.tl-head { display: flex; align-items: center; gap: 14px; padding: 6px 14px 3px; }
.play-btn {
  background: var(--panel3); border: 1px solid var(--accent-dim); color: var(--accent);
  border-radius: 7px; padding: 4px 14px; font-size: 12px; font-weight: 700; transition: .15s;
}
.play-btn:hover { background: rgba(232,179,75,.12); }
.tl-chk { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--dim); user-select: none; }
.tl-info { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--dim2); }
.tl-strip { flex: 1; display: flex; gap: 4px; padding: 2px 14px 10px; overflow-x: auto; align-items: stretch; }
.tl-scene-label {
  flex: 0 0 auto; writing-mode: vertical-rl; text-orientation: mixed;
  font-family: var(--mono); font-size: 9px; color: var(--accent-dim);
  display: flex; align-items: center; justify-content: center; border-left: 2px solid var(--accent-dim);
  padding-left: 3px; margin-right: 2px; user-select: none;
}
.tl-clip {
  flex: 0 0 auto; height: 100%; min-width: 46px; border-radius: 6px; overflow: hidden;
  border: 1px solid var(--line2); background: #0d1014 center/cover no-repeat;
  cursor: pointer; position: relative; display: flex; align-items: flex-end;
}
.tl-clip.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tl-clip video, .tl-clip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tl-clip .tl-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--dim2); pointer-events: none; }
.tl-clip .tl-ph.err { color: var(--danger); }
.tl-clip .tl-tag { position: relative; z-index: 1; }
.tl-clip .tl-tag {
  width: 100%; font-family: var(--mono); font-size: 9px; color: #cfd7df;
  background: linear-gradient(0deg, rgba(0,0,0,.8), transparent);
  padding: 8px 5px 3px; white-space: nowrap; overflow: hidden;
}
.tl-clip.st-generating { outline: 1.5px dashed var(--accent); outline-offset: -3px; }
.tl-clip.st-failed { outline: 1.5px solid var(--danger); outline-offset: -3px; }
.tl-clip.st-approved { border-color: rgba(87,194,107,.6); }
.tl-empty { color: var(--dim2); font-size: 11px; align-self: center; padding-left: 6px; }

/* ══════════ 任务中心抽屉 ══════════ */
.drawer {
  position: fixed; right: 16px; bottom: 122px; width: 400px; max-height: 52vh;
  background: var(--panel); border: 1px solid var(--line2); border-radius: 12px;
  box-shadow: 0 18px 60px rgba(0,0,0,.55); display: flex; flex-direction: column; z-index: 60;
}
.drawer-head {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}
.drawer-title { font-weight: 700; font-size: 13px; letter-spacing: 1px; }
.drawer-sub { flex: 1; font-family: var(--mono); font-size: 10.5px; color: var(--dim2); }
.icon-btn { background: none; border: none; color: var(--dim); font-size: 14px; padding: 2px 6px; }
.icon-btn:hover { color: var(--text); }
.task-list { overflow-y: auto; padding: 8px; }
.task-item {
  display: flex; gap: 10px; padding: 8px; border-radius: 9px; align-items: center;
  border: 1px solid transparent; cursor: pointer;
}
.task-item:hover { background: var(--panel2); border-color: var(--line); }
.task-item .ti-thumb { width: 66px; height: 40px; border-radius: 6px; background: #0d1014 center/cover no-repeat; flex: 0 0 66px; display: flex; align-items: center; justify-content: center; color: #38424f; }
.task-item .ti-main { flex: 1; min-width: 0; }
.task-item .ti-no { font-family: var(--mono); font-size: 10px; color: var(--accent); }
.task-item .ti-prompt { font-size: 11.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 2px 0; }
.task-item .ti-sub { font-family: var(--mono); font-size: 9.5px; color: var(--dim2); }
.task-empty { text-align: center; color: var(--dim2); padding: 30px 0; font-size: 12px; }

/* ══════════ 弹层 ══════════ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(5,7,9,.72); z-index: 100;
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(3px);
}
.modal {
  background: var(--panel); border: 1px solid var(--line2); border-radius: 14px;
  width: min(620px, 92vw); max-height: 86vh; display: flex; flex-direction: column;
  box-shadow: 0 30px 90px rgba(0,0,0,.6);
}
.modal.modal-lg { width: min(960px, 94vw); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-title { font-size: 14px; font-weight: 700; letter-spacing: 1px; }
.modal-sub { flex: 1; font-size: 11px; color: var(--dim2); font-family: var(--mono); }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11px; color: var(--dim); margin-bottom: 6px; letter-spacing: 1px; }
.field input[type=text], .field input[type=password] {
  width: 100%; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 11px; font-family: var(--mono); font-size: 12.5px;
}
.field input:focus { outline: none; border-color: var(--accent-dim); }
.hint { font-size: 11px; color: var(--dim2); line-height: 1.8; margin-top: 6px; }
.hint b { color: var(--dim); }

/* 媒体库网格 */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.media-card { border-radius: 9px; overflow: hidden; border: 1px solid var(--line); background: #0d1014; cursor: pointer; position: relative; transition: .13s; }
.media-card:hover { border-color: var(--accent); }
.media-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.media-card .m-meta { padding: 5px 8px 7px; font-family: var(--mono); font-size: 9.5px; color: var(--dim2); display: flex; justify-content: space-between; }
.media-card video { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.media-load { text-align: center; padding: 14px; }
.media-toolbar { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; }
.seg button { background: var(--panel2); border: none; color: var(--dim); padding: 5px 13px; font-size: 11.5px; }
.seg button.on { background: rgba(232,179,75,.14); color: var(--accent); }

/* 板子缩放（2026-11-06）：场次头里的缩放控件，只缩放板子内容，顶栏/场次/抽屉/时间线不动 */
.bz-seg button { min-width: 30px; }
.bz-label { min-width: 46px; font-family: var(--mono); }

/* 预览播放器 */
.preview-mask { position: fixed; inset: 0; background: #000; z-index: 200; display: flex; flex-direction: column; }
.preview-stage { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; position: relative; }
.preview-stage img { max-width: 100%; max-height: 100%; object-fit: contain; animation: fadein .5s; }
.preview-stage video { max-width: 100%; max-height: 100%; }
@keyframes fadein { from { opacity: 0; } }
.slate-card {
  text-align: center; color: #d7dde4; animation: fadein .35s;
  border: 1px solid #2a323d; border-radius: 12px; padding: 34px 52px; background: #0e1116;
}
.slate-card .sl-clap {
  font-family: var(--mono); color: var(--accent); font-size: 13px; letter-spacing: 3px;
  border-bottom: 1px dashed #3a434f; padding-bottom: 10px; margin-bottom: 14px;
}
.slate-card .sl-prompt { max-width: 560px; font-size: 14px; line-height: 1.9; color: #aab4bf; }
.preview-bar {
  flex: 0 0 52px; display: flex; align-items: center; gap: 14px; padding: 0 18px;
  background: #0b0d10; border-top: 1px solid var(--line);
}
.preview-bar .pv-no { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.preview-bar .pv-prompt { flex: 1; font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-prog { position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 5; }
.preview-prog i { display: block; height: 100%; background: var(--accent); transition: width .2s linear; }

/* 灯箱 */
.lightbox img, .lightbox video { max-width: 92vw; max-height: 86vh; display: block; border-radius: 8px; }
.lightbox .lb-bar { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }

/* ══════════ 轻提示 ══════════ */
#toasts { position: fixed; top: 60px; right: 16px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--panel3); border: 1px solid var(--line2); border-left: 3px solid var(--dim2);
  border-radius: 9px; padding: 10px 14px; font-size: 12.5px; max-width: 340px;
  box-shadow: 0 10px 34px rgba(0,0,0,.5); animation: slidein .25s; line-height: 1.6;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--accent); }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }

/* 菜单 */
.menu {
  position: fixed; background: var(--panel2); border: 1px solid var(--line2);
  border-radius: 10px; padding: 5px; z-index: 150; min-width: 168px;
  box-shadow: 0 14px 44px rgba(0,0,0,.55);
}
.menu button {
  display: flex; width: 100%; align-items: center; gap: 8px; text-align: left;
  background: none; border: none; color: var(--dim); padding: 7px 11px;
  font-size: 12.5px; border-radius: 7px;
}
.menu button:hover { background: var(--panel3); color: var(--text); }
.menu button.danger { color: var(--danger); }
.menu button.danger:hover { background: rgba(229,96,76,.12); }

/* 确认框 */
.confirm-body { font-size: 13px; line-height: 1.8; color: var(--dim); }
.confirm-body b { color: var(--text); }
.cost-line { font-family: var(--mono); font-size: 12px; color: var(--accent); margin-top: 8px; }

/* ══════════ 节点流视图 ══════════ */
/* 节点流板子默认铺满（2026-11-06）：分镜板区域纵向拉伸填满 #board，画布不再是悬在顶部的小盒子；
   画布本身是外层盒子（只负责铺底和边框），节点与连线放在内层 .node-world 里整体缩放 */
#storyboard[data-view="node"] { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.node-canvas {
  position: relative; margin: 12px 16px 20px;
  flex: 1 1 auto;  /* 纵向拉伸填满板子，内容比板子高时按 min-height 撑开、板子滚动 */
  background:
    radial-gradient(circle, #1c222b 1px, transparent 1.5px) 0 0 / 24px 24px,
    var(--panel);
  border: 1px solid var(--line); border-radius: 12px;
  overflow: auto; cursor: grab;
  scrollbar-width: none; -ms-overflow-style: none;  /* 隐藏滚动条，保留滚轮/触控板平移 */
}
.node-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.node-canvas.panning { cursor: grabbing; }
.node-canvas::-webkit-scrollbar { display: none; }
.node-edges { position: absolute; inset: 0; pointer-events: none; }
.flow-node {
  position: absolute; background: var(--panel2); border: 1px solid var(--line2);
  border-radius: 8px; overflow: hidden; cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
}
.flow-node:hover { border-color: var(--accent-dim); }
.flow-node.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.flow-node.st-generating { border-color: var(--accent); animation: nodePulse 1.4s infinite; }
.flow-node.st-failed { border-color: rgba(229,96,76,.65); }
.flow-node.st-approved { border-color: rgba(87,194,107,.6); }
@keyframes nodePulse { 50% { box-shadow: 0 0 0 5px rgba(232,179,75,.14); } }
.fn-slate {
  display: flex; gap: 6px; align-items: center; padding: 4px 8px;
  font-family: var(--mono); font-size: 10px; color: var(--dim);
  background: var(--panel2);
}
.fn-slate span:first-child { color: var(--accent); font-weight: 700; }
.fn-slate .fn-st { margin-left: auto; }
.fn-thumb {
  height: 88px; background: #0d1014 center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  color: #333c48; font-size: 22px; position: relative; overflow: hidden;
}
.fn-thumb video.fn-video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.fn-thumb .fn-play {
  position: absolute; right: 6px; bottom: 5px; font-style: normal; font-size: 11px;
  color: var(--accent); background: rgba(0,0,0,.65); border-radius: 50%;
  width: 21px; height: 21px; display: flex; align-items: center; justify-content: center;
  pointer-events: none; z-index: 2;
}
/* 节点流失败原因（2026-11-03）：缩略图底部通栏，不改节点固定高度 */
.fn-err-ov {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 3px 6px; font-size: 10px; color: var(--danger); background: rgba(0,0,0,.7);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.fn-prompt {
  padding: 5px 8px 6px; font-size: 10.5px; color: var(--dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fn-acts { position: absolute; top: 26px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: .15s; }
.flow-node:hover .fn-acts { opacity: 1; }
.fn-acts button {
  width: 23px; height: 23px; border-radius: 6px; border: 1px solid var(--line2);
  background: rgba(13,16,20,.88); color: var(--dim); font-size: 11px; line-height: 1;
}
.fn-acts button:hover { color: var(--accent); border-color: var(--accent-dim); }
.fn-acts button:last-child:hover { color: var(--danger); border-color: var(--danger); }
.edge-live { animation: dashmove .9s linear infinite; }
@keyframes dashmove { to { stroke-dashoffset: -24; } }
.sel-input {
  width: 100%; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 11px; font-size: 12.5px;
}
.sel-input:focus { outline: none; border-color: var(--accent-dim); }
.key-masked {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 11px; font-family: var(--mono); font-size: 12.5px;
  color: var(--dim); letter-spacing: 1px; user-select: none;
}

/* 示例提示词库 */
.ex-item {
  display: flex; gap: 10px; align-items: center;
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px;
  margin-bottom: 8px; cursor: pointer; transition: .13s;
}
.ex-item:hover { border-color: var(--accent-dim); background: rgba(232,179,75,.05); }
.ex-thumb {
  width: 84px; height: 60px; border-radius: 7px; flex: 0 0 84px;
  background: #0d1014 center/cover no-repeat; border: 1px solid var(--line2);
}
.ex-main { flex: 1; min-width: 0; }
.ex-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; gap: 8px; }
.ex-head b { font-size: 12.5px; }
.ex-type { font-family: var(--mono); font-size: 10px; color: var(--accent-dim); white-space: nowrap; }
.ex-prompt {
  font-size: 11.5px; color: var(--dim); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* —— 顶栏「更多」菜单（2026-11-04 简约重设计） —— */
.more-wrap { position: relative; }
.more-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 150;
  background: var(--panel2); border: 1px solid var(--line2); border-radius: 10px;
  padding: 5px; min-width: 140px; box-shadow: 0 14px 44px rgba(0,0,0,.55);
  display: flex; flex-direction: column;
}
.more-menu button {
  background: none; border: none; color: var(--dim); padding: 7px 11px;
  font-size: 12.5px; border-radius: 7px; text-align: left;
}
.more-menu button:hover { background: var(--panel3); color: var(--text); }

/* —— 桌面端详情抽屉（2026-11-06 改为固定停靠：与分镜板同处主区同一行，不再悬浮盖住卡片/节点） —— */
@media (min-width: 901px) {
  #inspector {
    width: 340px; flex: 0 0 340px;
    border-left: 1px solid var(--line2);
    box-shadow: -12px 0 40px rgba(0,0,0,.45);
    /* 收起时负右 margin 把面板推出视口外（仍在文档流里，板子自动占满宽、空间被回收）；
       打开时 margin 回 0，板子让出 340px；抽屉与画布始终同一层，互不遮盖 */
    margin-right: -340px; visibility: hidden;
    transition: margin-right .25s ease, visibility 0s linear .25s;
  }
  body.insp-open #inspector {
    margin-right: 0; visibility: visible;
    transition: margin-right .25s ease, visibility 0s;
  }
  /* 桌面端无遮罩：抽屉打开时画布仍可拖动/滚动，关闭靠 ✕ 与 ESC（2026-11-04 节点流拖动修复） */
  .insp-closebar {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 2; padding: 10px 14px;
    background: var(--panel); border-bottom: 1px solid var(--line); font-weight: 700;
  }
  .insp-closebar button {
    background: var(--panel3); border: 1px solid var(--line2); color: var(--text);
    border-radius: 7px; padding: 7px 14px; font-size: 13px;
  }
}

/* —— 时间线默认收起（2026-11-04 简约重设计）：只留播放条，展开后才显示片段与场记板选项 —— */
#timeline.collapsed { flex-basis: auto; }
#timeline.collapsed .tl-strip, #timeline.collapsed .tl-chk { display: none; }
#timeline.collapsed .tl-head { padding: 5px 14px 4px; }

/* ══════════ 移动端适配（2026-11-02：仅 @media 内生效，桌面布局不动） ══════════ */
#inspBackdrop { display: none; }
.insp-closebar { display: none; }

@media (max-width: 900px) {
  html, body { height: 100dvh; }
  body { font-size: 14px; overflow-x: hidden; }
  /* 顶栏：两行，按钮横向滑动，不再挤压 */
  #topbar { height: auto; flex: 0 0 auto; flex-wrap: wrap; padding: 8px 10px; gap: 8px; }
  .tb-left { flex: 1 1 100%; min-width: 0; }
  .tb-sep { display: none; }
  .project-name { flex: 1; min-width: 0; width: auto; font-size: 16px; }
  .tb-right {
    flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start;
    padding-bottom: 2px; scrollbar-width: none;
  }
  .tb-right::-webkit-scrollbar { display: none; }
  .tb-right > * { flex: 0 0 auto; }
  .tbtn { padding: 8px 12px; font-size: 13px; min-height: 36px; }
  .pill { padding: 6px 10px; }
  /* 主区：单栏，场次变顶部横向条 */
  #main { flex-direction: column; }
  #scenes {
    width: auto; flex: 0 0 auto; border-right: none; border-bottom: 1px solid var(--line);
  }
  .side-head { padding: 8px 12px 6px; }
  .scene-list { display: flex; overflow-x: auto; overflow-y: hidden; padding: 0 8px 8px; scrollbar-width: none; }
  .scene-list::-webkit-scrollbar { display: none; }
  .scene-item { flex: 0 0 150px; margin: 0 4px 0 0; }
  .scene-item .sc-desc { display: none; }  /* 横向场次条保持轻薄，概要只在桌面侧栏展示 */
  .side-foot { display: none; }
  #board { flex: 1; min-height: 0; }
  .scene-header { padding: 10px 12px 8px; }
  .sh-row1 { flex-wrap: wrap; }
  .sh-title { font-size: 16px; flex: 1 1 auto; min-width: 0; }
  .sh-actions { margin-left: 0; width: 100%; }
  .bz-seg { display: none; }  /* 手机不缩放板子，触屏走原生手势 */
  .sh-desc { font-size: 13px; }
  .add-bar { padding: 10px 12px 2px; }
  .add-shot { padding: 8px 12px; font-size: 13px; }
  .storyboard { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px 12px 20px; }
  .shot-acts .card-btn { padding: 8px 0; font-size: 12px; min-height: 34px; }
  .shot-prompt { font-size: 12.5px; }
  /* 节点流 / 自由画布：留出可横向滚动的空间，高度跟随视口 */
  .node-canvas { margin: 12px; touch-action: pan-x pan-y; }
  /* 节点流：画布和分镜板原来各是一层滚动容器，手机上拖动会被内层截住、
     板子滑不动、卡片只能露个头。手机上只留板子一层滚动，画布不再自己滚。 */
  #storyboard[data-view="node"] { display: block; overflow: visible; }
  #storyboard[data-view="node"] .node-canvas { overflow: visible; }
  #storyboard[data-view="free"] { display: block; }
  #storyboard { min-height: 120px; }
  #board { overflow: auto; }
  /* 场次头手机上取消吸顶：原来吸顶头占了板子近一半高度，头一滚走画布才有整屏看 */
  .scene-header { position: static; }
  .free-canvas { height: 62dvh; }
  .free-toolbar { padding: 0 12px; }
  /* 时间线：高度自适应，留安全区 */
  #timeline { flex: 0 0 auto; padding-bottom: env(safe-area-inset-bottom); }
  .tl-head { flex-wrap: wrap; gap: 8px; padding: 8px 12px 4px; }
  .tl-info { margin-left: 0; }
  .tl-strip { padding: 2px 12px 10px; }
  .tl-clip { height: 64px; }
  /* 镜头详情：底部抽屉，选中镜头才滑出 */
  #inspector {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 80;
    width: auto; flex: none; height: 86dvh; max-height: none;
    border-left: none; border-top: 1px solid var(--line2);
    border-radius: 16px 16px 0 0; box-shadow: 0 -12px 40px rgba(0,0,0,.55);
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    transform: translateY(105%); transition: transform .25s ease; visibility: hidden;
  }
  body.insp-open #inspector { transform: translateY(0); visibility: visible; }
  #inspBackdrop {
    display: block; position: fixed; inset: 0; z-index: 79; background: rgba(5,7,9,.55);
    opacity: 0; pointer-events: none; transition: opacity .25s;
  }
  body.insp-open #inspBackdrop { opacity: 1; pointer-events: auto; }
  .insp-closebar {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 2; padding: 10px 14px;
    background: var(--panel); border-bottom: 1px solid var(--line); font-weight: 700;
  }
  .insp-closebar button {
    background: var(--panel3); border: 1px solid var(--line2); color: var(--text);
    border-radius: 7px; padding: 7px 14px; font-size: 13px; min-height: 36px;
  }
  /* 输入框 16px：防止 iOS 聚焦时自动放大页面 */
  textarea.prompt, .field input[type=text], .field input[type=password],
  .sel-input, .insp-note { font-size: 16px; }
  .btn { padding: 10px 14px; min-height: 40px; }
  .btn-sm { padding: 8px 12px; min-height: 36px; }
  .type-opt { padding: 10px 4px; }
  .chip { padding: 5px 12px; }
  /* 弹层 / 抽屉 / 提示：贴合小屏 */
  .drawer { left: 8px; right: 8px; width: auto; bottom: 12px; max-height: 62dvh; }
  .modal { width: 94vw; max-height: 88dvh; }
  .modal-body { padding: 14px; }
  .modal-foot { flex-wrap: wrap; }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .draw-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slate-card { padding: 24px 20px; }
  .slate-card .sl-prompt { font-size: 13px; }
  .preview-bar { flex-wrap: wrap; height: auto; min-height: 52px; padding: 8px 12px; }
  .preview-bar .pv-prompt { flex-basis: 100%; white-space: normal; }
  #toasts { left: 12px; right: 12px; top: auto; bottom: 12px; }
  .toast { max-width: none; }
}

@media (max-width: 460px) {
  .storyboard { grid-template-columns: 1fr; }
  .draw-wall { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-name { font-size: 13px; letter-spacing: 1px; }
}

/* 场次头折叠（2026-11-02）：收起后只留标题行，操作区/概要/添加按钮全部隐藏 */
.scene-header.collapsed { padding-bottom: 8px; }
.scene-header.collapsed .sh-actions,
.scene-header.collapsed .sh-desc,
.scene-header.collapsed .add-bar { display: none; }
#btnCollapseHeader { flex: 0 0 auto; }

/* 抽卡墙精简（2026-11-02）：每张只留定稿/重试，点图查看，删除缩成右上角小叉 */
.draw-card { position: relative; }
.draw-x {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--line2); background: rgba(0,0,0,.65);
  color: #fff; font-size: 11px; line-height: 1;
}
.draw-x:hover { color: var(--danger); border-color: var(--danger); }

/* 抽卡组头（2026-11-02）：空草稿父节点带 ≥2 个同提示词子节点时，不再显示为空草稿 */
.st-draw { background: rgba(232,179,75,.18); color: var(--accent); }
.flow-node.draw-head { border-color: rgba(232,179,75,.5); }
.fn-drawcount {
  position: absolute; left: 6px; bottom: 5px; z-index: 2;
  background: rgba(0,0,0,.68); color: var(--accent);
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 4px; border: 1px solid rgba(232,179,75,.5);
}

/* ══════════ 导演台专业工作台视觉层（2026-11-07） ══════════
   保留现有交互与信息架构，只收敛视觉层级：炭黑底、香槟金强调、
   更明确的工作区留白，以及更克制的卡片和状态样式。 */
:root {
  --bg: #0a0d11;
  --panel: #11161b;
  --panel2: #171d24;
  --panel3: #1d252e;
  --line: #252f38;
  --line2: #33414d;
  --text: #eef1f3;
  --dim: #9aa6b2;
  --dim2: #65727e;
  --accent: #d6a85c;
  --accent-dim: #a67f3f;
  --danger: #d77f6f;
  --ok: #7ac29b;
}

body {
  background:
    radial-gradient(circle at 50% -12%, rgba(93, 111, 128, .10), transparent 42%),
    var(--bg);
}

#topbar {
  height: 52px;
  flex-basis: 52px;
  padding: 0 18px;
  background: rgba(17, 22, 27, .96);
  border-bottom-color: rgba(51, 65, 77, .72);
}
.tb-left, .tb-right { gap: 12px; }
.brand { gap: 9px; }
.brand-icon {
  position: relative;
  width: 21px;
  height: 15px;
  flex: 0 0 21px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: rgba(214, 168, 92, .08);
}
.brand-icon::before {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  top: -5px;
  height: 5px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: repeating-linear-gradient(135deg, transparent 0 4px, rgba(214, 168, 92, .78) 4px 6px);
  transform: skewX(-18deg);
}
.brand-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  height: 1px;
  background: rgba(214, 168, 92, .72);
}
.brand-name { font-size: 14px; letter-spacing: 2.4px; }
.project-name {
  width: 250px;
  color: #c9d0d6;
  font-size: 13px;
}
.project-name:focus { background: rgba(23, 29, 36, .72); }
.tbtn {
  min-height: 30px;
  background: rgba(23, 29, 36, .72);
  border-color: rgba(51, 65, 77, .86);
  border-radius: 6px;
  padding: 5px 10px;
}
.tbtn:hover { background: var(--panel3); }
#btnMore::before, #btnSettings::before {
  color: var(--dim2);
  font-size: 13px;
  line-height: 1;
}
#btnMore::before { content: "⋯"; letter-spacing: 1px; }
#btnSettings::before { content: "⚙"; font-size: 12px; }

#scenes {
  width: 224px;
  flex-basis: 224px;
  background: rgba(17, 22, 27, .94);
}
.side-head { padding: 15px 14px 9px; }
.side-title { font-size: 10.5px; letter-spacing: 2.6px; }
.mini-btn { padding: 4px 9px; }
.scene-list { padding: 5px 10px; }
.scene-item {
  border-radius: 9px;
  padding: 10px 11px;
  margin-bottom: 5px;
}
.scene-item.active {
  background: rgba(214, 168, 92, .08);
  border-color: rgba(214, 168, 92, .26);
}
.scene-item.active::before { background: var(--accent); }
.scene-item .sc-title { font-size: 13px; }
.scene-item .sc-no { font-size: 10px; }
.scene-item .sc-desc { margin-top: 4px; font-size: 11.5px; }
.side-foot { padding: 12px 14px; }
.proj-stats { gap: 0; align-items: center; }
.proj-stats .ps-item {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  font-size: 11px;
}
.proj-stats .ps-item + .ps-item::before {
  content: "·";
  color: var(--line2);
  margin: 0 7px;
}

#board { background: rgba(10, 13, 17, .38); }
.scene-header {
  padding: 14px 20px 11px;
  background: rgba(17, 22, 27, .78);
  border-bottom-color: rgba(51, 65, 77, .72);
}
.sh-row1 { gap: 12px; }
.sh-title { font-size: 16px; }
.sh-desc { margin-top: 7px; font-size: 12.5px; }
.add-bar { padding: 14px 22px 2px; }
.add-shot { border-radius: 7px; padding: 7px 12px; }
.storyboard {
  grid-template-columns: repeat(auto-fill, minmax(calc(280px * var(--bz, 1)), 1fr));
  gap: 18px;
  padding: 18px 22px 30px;
}

.shot {
  background: rgba(17, 22, 27, .92);
  border-color: rgba(51, 65, 77, .78);
  border-radius: 11px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .16);
}
.shot:hover {
  border-color: rgba(154, 166, 178, .52);
  transform: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
}
.shot.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(214, 168, 92, .72), 0 8px 24px rgba(0, 0, 0, .28);
}
.shot.approved { border-color: rgba(122, 194, 155, .5); }
.slate {
  height: 26px;
  padding: 0 11px;
  background: rgba(29, 37, 46, .72);
  font-size: 10.5px;
}
.thumb { background-color: #0d1116; }
.shot-foot { padding: 12px 14px 13px; gap: 7px; }
.shot-meta { font-size: 10.5px; }
.shot-prompt { color: #aeb8c2; font-size: 12px; line-height: 1.55; }
.stchip {
  position: relative;
  padding: 2px 0 2px 12px;
  background: transparent;
  border-radius: 0;
  font-size: 10.5px;
}
.stchip::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  transform: translateY(-50%);
}
.st-draft, .st-queued { color: #91a0ad; background: transparent; }
.st-generating { color: var(--accent); background: transparent; }
.st-done { color: var(--ok); background: transparent; }
.st-failed { color: var(--danger); background: transparent; }
.st-approved { color: #8fd2ab; background: transparent; }
.card-btn { border-radius: 6px; padding: 5px 0; }
.card-btn.card-btn-primary {
  background: rgba(214, 168, 92, .12);
  border-color: rgba(214, 168, 92, .42);
  color: var(--accent);
}

#inspector {
  width: 340px;
  flex-basis: 340px;
  background: rgba(17, 22, 27, .97);
}
.insp-sec { padding: 14px 16px; }
.insp-label { margin-bottom: 9px; font-size: 10px; letter-spacing: 2.2px; }
.type-opt { padding: 8px 4px; }
textarea.prompt { min-height: 124px; background: rgba(23, 29, 36, .86); }
.btn-gen { min-height: 40px; border-radius: 7px; background: var(--accent); }
.btn-accent-soft { color: var(--accent); background: rgba(214, 168, 92, .1); border-color: rgba(214, 168, 92, .4); }
.gen-status { background: rgba(23, 29, 36, .8); }

#timeline { background: rgba(17, 22, 27, .96); border-top-color: rgba(51, 65, 77, .72); }
#timeline.collapsed .tl-head { padding: 7px 18px 6px; }
.tl-head { gap: 12px; }
.play-btn { border-color: rgba(214, 168, 92, .64); }

.drawer { background: rgba(17, 22, 27, .98); border-color: var(--line2); }
.modal { background: rgba(17, 22, 27, .98); }

@media (max-width: 900px) {
  #topbar { height: auto; flex-basis: auto; padding: 8px 12px; }
  .project-name { width: auto; }
  #scenes { width: auto; flex-basis: auto; }
  #inspector { width: auto; flex-basis: auto; }
  .tbtn { min-height: 36px; padding: 8px 12px; font-size: 13px; }
  .side-head { padding: 9px 12px 6px; }
  .scene-list { padding: 0 8px 8px; }
  .scene-item { padding: 8px 10px; }
  .scene-header { padding: 11px 13px 9px; }
  .add-bar { padding: 11px 13px 2px; }
  .storyboard { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; padding: 13px 13px 22px; }
  .shot-foot { padding: 10px 11px 11px; }
}

@media (max-width: 460px) {
  .storyboard { grid-template-columns: 1fr; }
}

/* ══════════ 节点流工作台（图1风格） ══════════
   只重排现有节点流的视觉层级：节点仍由派生关系自动布局，
   现有派生、改连线、断开、删除、选中、缩放和平移交互保持不变。 */
#board[data-view="node"] {
  background: #0a0d11;
}
#board[data-view="node"] .scene-header {
  padding: 12px 18px 10px;
  background: rgba(17, 22, 27, .96);
}
#board[data-view="node"] .view-kicker {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding-right: 10px;
  border-right: 1px solid var(--line2);
}
#board[data-view="node"] .sh-title {
  font-size: 15px;
  padding-left: 0;
}
#board[data-view="node"] .sh-desc { display: none; }
#board[data-view="node"] .add-bar {
  padding: 8px 18px 9px;
  border-top: 1px solid rgba(51, 65, 77, .42);
  border-bottom: 1px solid rgba(51, 65, 77, .72);
  background: rgba(10, 13, 17, .54);
}
#board[data-view="node"] .add-shot {
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(23, 29, 36, .86);
  border-color: rgba(51, 65, 77, .82);
  font-size: 11px;
}
#board[data-view="node"] .add-shot:hover {
  background: rgba(214, 168, 92, .10);
  border-color: rgba(214, 168, 92, .52);
}
#storyboard[data-view="node"] {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0;
  background: #0a0d11;
}
#storyboard[data-view="node"].pan-ready,
#storyboard[data-view="node"].pan-ready .node-canvas {
  cursor: grab;
}
#storyboard[data-view="node"] .node-canvas {
  margin: 12px 18px 22px;
  min-height: 480px;
  border-radius: 12px;
  border-color: rgba(51, 65, 77, .86);
  background:
    radial-gradient(circle, rgba(122, 137, 151, .22) 1px, transparent 1.5px) 0 0 / 24px 24px,
    linear-gradient(180deg, rgba(20, 27, 34, .92), rgba(11, 15, 20, .98));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .02), inset 0 24px 60px rgba(0, 0, 0, .15);
  scrollbar-width: thin;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  contain: layout;
  cursor: grab;
}
#storyboard[data-view="node"] .node-canvas.panning { cursor: grabbing; }
#storyboard[data-view="node"] .node-world {
  padding: 0;
  will-change: transform;
}
#storyboard[data-view="node"] .node-edges { overflow: visible; }
#storyboard[data-view="node"] .node-edges path {
  stroke-width: 2.2;
  stroke-opacity: .86;
  transition: stroke-width .18s ease, opacity .18s ease;
}
#storyboard[data-view="node"] .flow-node {
  border-radius: 10px;
  border-color: rgba(51, 65, 77, .92);
  background: rgba(17, 22, 27, .98);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .24);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
  will-change: transform, left, top;
  backface-visibility: hidden;
  user-select: none;
  cursor: grab;
  touch-action: none;
}
#storyboard[data-view="node"] .flow-node:active { cursor: grabbing; }
#storyboard[data-view="node"] .flow-node:active {
  transform: none;
  transition: none;
}
#storyboard[data-view="node"] .flow-node:hover {
  border-color: rgba(154, 166, 178, .64);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .34);
  transform: translate3d(0, -2px, 0);
}
#storyboard[data-view="node"] .flow-node.sel {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(214, 168, 92, .8), 0 12px 28px rgba(0, 0, 0, .42);
}
#storyboard[data-view="node"] .flow-node.st-generating {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(214, 168, 92, .42), 0 0 26px rgba(214, 168, 92, .14);
}
#storyboard[data-view="node"] .flow-node.st-failed {
  border-color: rgba(215, 127, 111, .72);
}
#storyboard[data-view="node"] .flow-node.st-approved {
  border-color: rgba(122, 194, 155, .68);
}
#storyboard[data-view="node"] .fn-slate {
  height: 27px;
  padding: 0 10px;
  background: rgba(29, 37, 46, .82);
  border-bottom-color: rgba(51, 65, 77, .8);
  font-size: 10px;
}
#storyboard[data-view="node"] .fn-slate > span:first-child {
  color: var(--accent);
  font-weight: 700;
}
#storyboard[data-view="node"] .fn-thumb {
  height: 100px;
  background-color: #0d1116;
}
#storyboard[data-view="node"] .fn-prompt {
  padding: 7px 10px 8px;
  color: #aeb8c2;
  font-size: 11px;
  line-height: 1.45;
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
#storyboard[data-view="node"] .fn-acts {
  top: 31px;
  right: 7px;
}
#storyboard[data-view="node"] .fn-acts button {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(10, 13, 17, .86);
  border-color: rgba(51, 65, 77, .92);
}
#storyboard[data-view="node"] .fn-acts button:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
}
#storyboard[data-view="node"] .fn-acts button:last-child:hover {
  color: var(--danger);
  border-color: var(--danger);
}

@media (max-width: 900px) {
  .prompt-selects { grid-template-columns: 1fr; }
  #board[data-view="node"] .scene-header { padding: 10px 12px 8px; }
  #board[data-view="node"] .add-bar { padding: 8px 12px; }
  #storyboard[data-view="node"] {
    display: block;
    overflow: visible;
  }
  #storyboard[data-view="node"] .node-canvas {
    margin: 10px 12px 18px;
    min-height: 460px;
  }
}

/* ══════════ ProcessOn 式画布与固定检查器（桌面端） ══════════
   节点流只保留一个滚动主控：中间 #storyboard；右侧检查器常驻停靠。 */
@media (min-width: 901px) {
  #board[data-view="node"] {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }
  #storyboard[data-view="node"] {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  #storyboard[data-view="node"] .node-canvas {
    flex: 0 0 auto;
    overflow: visible;
    contain: layout;
  }
  #inspector {
    width: 340px;
    flex: 0 0 340px;
    min-width: 340px;
    min-height: 0;
    margin-right: 0 !important;
    visibility: visible !important;
    transition: none !important;
    box-shadow: -12px 0 40px rgba(0, 0, 0, .34);
  }
  body.insp-open #inspector {
    margin-right: 0;
    visibility: visible;
  }
}

/* 生成类型保持信息完整，但压缩为轻量双列选择器。 */
.type-row { gap: 6px; }
.type-opt {
  min-height: 42px;
  padding: 6px 8px;
  line-height: 1.15;
}
.type-opt small {
  margin-top: 2px;
  font-size: 9px;
  line-height: 1.1;
}

/* ══════════ Cinema Graph 影院工作台风格（2026-11-07） ══════════
   参考 Cinema Graph：黑棕底、暖金线、细边界和更克制的层级。
   只调整视觉表现，保留现有节点流、检查器和时间线交互。 */
:root {
  --bg: #0d0c0a;
  --panel: #12110f;
  --panel2: #181612;
  --panel3: #211d17;
  --line: #2c2821;
  --line2: #494237;
  --text: #f3ead8;
  --dim: #aa9e8b;
  --dim2: #756d61;
  --accent: #e8b85e;
  --accent-dim: #aa7d35;
  --danger: #d98470;
  --ok: #82bd91;
}

body {
  background:
    radial-gradient(circle at 50% -25%, rgba(231, 184, 94, .07), transparent 42%),
    var(--bg);
}

/* 检查器顶栏：左“镜头信息”，右生成类型纯文本（2026-11-07：类型写死不给下拉框） */
.insp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 12px 16px 10px; border-bottom: 1px solid var(--line); }
.insp-head-title { font-size: 16px; font-weight: 600; }
.insp-head-no { font-size: 13px; font-weight: 400; color: var(--dim); letter-spacing: 0; margin-left: 8px; }
.insp-head-type { font-size: 13px; color: var(--dim); white-space: nowrap; }

@media (min-width: 901px) {
  .insp-head { padding: 18px 17px 13px; border-bottom-color: #3c3529; }
  .insp-head-title {
    color: #f0d18c;
    font: 600 18px/1.2 Georgia, "Songti SC", serif;
    letter-spacing: 1px;
  }
  #board[data-view="node"] .view-kicker {
    font-family: Georgia, "Songti SC", serif;
    letter-spacing: .2px;
    color: #e8b85e;
  }
  #topbar {
    height: 58px;
    flex-basis: 58px;
    padding: 0 22px;
    background: rgba(18, 17, 15, .98);
    border-bottom-color: #3c3529;
  }
  .brand { gap: 11px; }
  .brand-name {
    font-family: Georgia, "Songti SC", serif;
    font-size: 21px;
    letter-spacing: 1px;
    color: #f0d18c;
  }
  .brand-icon { border-color: #d4a24b; }
  .tb-sep { height: 24px; background: #4a4234; }
  .project-name { font-size: 14px; color: #cbbda7; }
  .tb-right { gap: 10px; }
  .tbtn {
    background: transparent;
    border-color: #4a4234;
    border-radius: 18px;
    color: #b9ad98;
  }
  .tbtn:hover { background: rgba(232, 184, 94, .08); border-color: #9a7233; }

  #scenes {
    width: 205px;
    flex-basis: 205px;
    background: #11100e;
    border-right-color: #3c3529;
  }
  .side-head { padding: 16px 18px 10px; }
  .side-title { font-family: Georgia, "Songti SC", serif; font-size: 17px; letter-spacing: 0; color: #ead8ae; }
  .side-head .mini-btn { border: 0; background: transparent; color: #d4a24b; font-size: 20px; padding: 0 4px; }
  .scene-list { padding: 6px 10px; }
  .scene-item {
    border-radius: 9px;
    padding: 12px 11px;
    margin-bottom: 5px;
    border-color: transparent;
  }
  .scene-item:hover { background: #1c1915; }
  .scene-item.active {
    background: linear-gradient(135deg, rgba(232, 184, 94, .12), rgba(232, 184, 94, .03));
    border-color: rgba(232, 184, 94, .6);
    box-shadow: inset 0 0 0 1px rgba(232, 184, 94, .08);
  }
  .scene-item.active::before { width: 2px; background: #e8b85e; }
  .scene-item .sc-title { font-size: 13px; }
  .scene-item .sc-no { color: #e8b85e; }
  .side-foot { padding: 12px 16px; border-top-color: #3c3529; }

  #board { background: #0d0c0a; }
  .scene-header {
    padding: 13px 18px 10px;
    background: rgba(18, 17, 15, .96);
    border-bottom-color: #3c3529;
  }
  .sh-title { font-family: Georgia, "Songti SC", serif; font-size: 19px; color: #f0dfba; }
  .view-kicker { color: #e8b85e !important; }
  .add-bar { padding: 10px 18px 2px; }
  .add-shot { background: #181612; border-color: #4a4234; color: #b9ad98; }
  .add-shot:hover { background: rgba(232, 184, 94, .1); border-color: #b28743; }

  #storyboard[data-view="node"] { background: #0d0c0a; }
  #storyboard[data-view="node"] .node-canvas {
    margin: 0;
    border: 0;
    border-radius: 0;
    background:
      radial-gradient(circle, rgba(198, 167, 105, .24) 1px, transparent 1.5px) 0 0 / 24px 24px,
      #0d0c0a;
    box-shadow: none;
  }
  #storyboard[data-view="node"] .flow-node {
    background: #171411;
    border-color: #4a4234;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
  }
  #storyboard[data-view="node"] .flow-node:hover { border-color: #a78348; }
  #storyboard[data-view="node"] .flow-node.sel {
    border-color: #e8b85e;
    box-shadow: 0 0 0 1px #e8b85e, 0 10px 28px rgba(0, 0, 0, .46);
  }
  #storyboard[data-view="node"] .fn-slate { background: #201b15; border-bottom-color: #3f372c; }
  #storyboard[data-view="node"] .fn-thumb { background-color: #100f0d; }
  #storyboard[data-view="node"] .node-edges path { stroke: #d9aa50; stroke-opacity: .9; }
  #storyboard[data-view="node"] .node-edge-dot { fill: #e8b85e; }

  #inspector {
    width: 360px;
    flex-basis: 360px;
    background: #11100e;
    border-left-color: #3c3529;
  }
  .insp-sec { padding: 15px 17px; border-bottom-color: #322d24; }
  .insp-label { color: #a99b84; }
  .type-opt, .sel-input, textarea.prompt, .insp-note {
    background: #191713;
    border-color: #4a4234;
  }
  .type-opt.on { background: rgba(232, 184, 94, .12); border-color: #e8b85e; }
  .ref-item, .ref-add { border-color: #514735; }
  .btn-gen { background: linear-gradient(180deg, #f0c66a, #dca84e); color: #21170a; }

  #timeline {
    flex-basis: 108px;
    background: #11100e;
    border-top-color: #3c3529;
  }
  .tl-head { padding: 8px 18px 4px; }
  .play-btn { background: #1c1915; border-color: #a47b36; color: #efc267; }
  .tl-clip { border-color: #4a4234; border-radius: 5px; }
  .tl-clip.on { border-color: #e8b85e; box-shadow: 0 0 0 1px #e8b85e; }
}

/* 参考图中的工作区导航与影院模式标识。 */
.top-nav {
  display: flex;
  align-items: stretch;
  gap: 26px;
  height: 100%;
  margin-left: auto;
  margin-right: 28px;
}
.top-nav-item {
  position: relative;
  border: 0;
  background: transparent;
  color: #8f8578;
  padding: 0 2px;
  font-size: 14px;
  white-space: nowrap;
  transition: color .15s ease;
}
.top-nav-item:hover,
.top-nav-item.active { color: #e8b85e; }
.top-nav-item.active::after {
  content: "";
  position: absolute;
  left: -10px;
  right: -10px;
  bottom: 0;
  height: 2px;
  background: #e8b85e;
  box-shadow: 0 0 12px rgba(232, 184, 94, .42);
}
.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #4a4234;
  border-radius: 18px;
  padding: 6px 11px;
  color: #8f8578;
  font-size: 11px;
  white-space: nowrap;
}
.mode-pill b { color: #e8d4a7; font-weight: 600; }
.mode-pill span:last-child { color: #d3a650; font-size: 14px; line-height: 1; }
.scene-thumb {
  height: 64px;
  margin-top: 9px;
  border-radius: 5px;
  border: 1px solid #3d3529;
  background: #171411 center/cover no-repeat;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, .26);
}
.scene-meta {
  margin-top: 6px;
  color: #8e8373;
  font-size: 10px;
}
@media (min-width: 901px) {
  .scene-item .sc-count { display: none; }
}

@media (max-width: 900px) {
  .top-nav, .mode-pill { display: none; }
}
