/* ==========================================================================
   批量剧工作台 · 设计系统 v2
   深色画布 / 断框 V 标记 / 紫色强调 + 品红渐变主操作
   设计参照：VibeStory 的令牌体系（画布 #0d0f11、面板 #111214、
   字段 #262c36、强调 #7b57e0、确认型操作 #c026d3 → #6d28d9 渐变）
   ========================================================================== */

@font-face {
  font-family: "Audiowide";
  src: url("/fonts/Audiowide-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* 让原生下拉框按深色渲染，否则选项列表是白底灰字，几乎看不清 */
  color-scheme: dark;
  /* 画布与面板 */
  --bg: #0d0f11;
  --bg-soft: #0a0c0e;
  --bg-deep: #07080a;
  --panel: #111214;
  --panel-2: #262c36;
  --panel-3: #2e3a45;
  --raise: #171a1e;
  --line: rgba(87, 103, 118, 0.22);
  --line-soft: rgba(87, 103, 118, 0.12);
  --hairline: rgba(87, 103, 118, 0.18);

  /* 文字 */
  --text: #e3e3e3;
  --text-2: #b8c0cc;
  --muted: rgba(184, 192, 204, 0.72);
  --dim: rgba(184, 192, 204, 0.44);

  /* 强调：实色只用于底与描边，浅色用于强调文字 */
  --accent: #7b57e0;
  --accent-text: #c9b6ff;
  --accent-soft: rgba(123, 87, 224, 0.16);
  --accent-line: rgba(123, 87, 224, 0.45);

  /* 主操作渐变（只给确认型操作） */
  --grad-from: #c026d3;
  --grad-to: #6d28d9;
  --grad-hover-from: #a121cc;
  --grad-hover-to: #5b21b6;
  --grad-glow: 0 4px 30px 0 rgba(192, 38, 211, 0.28);

  /* 状态 */
  --ok: #8fe084;
  --ok-soft: rgba(42, 163, 31, 0.16);
  --warn: #f5c451;
  --danger: #ff9c96;
  --danger-soft: rgba(245, 59, 48, 0.14);
  --teal: #7dd3fc;
  --teal-soft: rgba(125, 211, 252, 0.10);

  /* 形状 */
  --radius: 8px;
  --radius-sm: 6px;
  --radius-panel: 16px;
  --radius-modal: 24px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);

  /* 表格与占位：原先写死成深色，抽成变量才能做白天模式 */
  --row-hover: #1a1d22;
  --row-even: #131518;
  --thead: #14171b;
  --strip-a: #0d1013;
  --strip-b: #12151a;
  --scrim: rgba(6, 8, 10, 0.66);

  /* 字体 */
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  --font-display: "Audiowide", "Bahnschrift", "DIN Alternate", var(--font);
  --mono: "JetBrains Mono", "Cascadia Code", "SF Mono", Consolas, "Microsoft YaHei", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { overflow: hidden; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.22); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.34); }
::-webkit-scrollbar-corner { background: transparent; }
::selection { background: rgba(123, 87, 224, 0.5); color: #fff; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--grad-from); outline-offset: 2px; }

.hidden { display: none !important; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--hairline);
  position: relative;
  z-index: 30;
}

.brand { display: flex; align-items: center; gap: 12px; }

/* 品牌标记随侧栏固定（与设计规范一致：标记 + Audiowide 字标在侧栏顶部） */
.side-brand {
  position: sticky; top: -16px; z-index: 3;
  margin: -16px -14px 18px;
  padding: 18px 14px 15px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--hairline);
}

/* 断开的画框顶边组成 V：白色描边 + 品红→紫 渐变 */
.brand-mark {
  width: 36px; height: 36px; flex: 0 0 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(150deg, rgba(192, 38, 211, 0.16), rgba(109, 40, 217, 0.10));
  border: 1px solid rgba(201, 182, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.brand-mark svg { width: 22px; height: 22px; display: block; }

.brand-text { display: flex; flex-direction: column; gap: 3px; line-height: 1.15; }
.brand-text strong {
  font-size: 14.5px; font-weight: 600; letter-spacing: 0.2px; color: #fff;
}
.brand-text span {
  font-family: var(--font-display);
  font-size: 8.5px; font-weight: 400; letter-spacing: 1.6px;
  color: var(--dim); text-transform: uppercase;
}

.topbar-center { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }

.project-switch, .text-model-switch {
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 6px 0 11px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--raise);
}
.project-switch label, .text-model-switch label {
  font-size: 9.5px; letter-spacing: 1.1px; text-transform: uppercase;
  color: var(--dim); white-space: nowrap;
}
.project-switch select, .text-model-switch select {
  border: none; background: transparent; color: var(--text-2);
  font-size: 12px; height: 26px; outline: none; appearance: none;
  padding-right: 18px; max-width: 200px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23b8c0cc' fill='none' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 2px center;
}
.project-switch select { min-width: 170px; }
.project-switch select:focus, .text-model-switch select:focus { color: var(--text); }
.project-switch .icon-btn { border: none; background: transparent; height: 26px; width: 26px; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.service-badge {
  display: flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 11px;
  font-size: 11px; color: var(--muted);
  border: 1px solid var(--hairline); border-radius: 999px;
  background: transparent;
}
.service-badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--warn); box-shadow: 0 0 8px currentColor;
}
.service-badge.ok .dot { background: var(--ok); }
.service-badge.bad .dot { background: #f53b30; }

/* ---------------- 主布局（侧栏 = 抽屉） ---------------- */
.shell { display: flex; height: calc(100vh - 64px); }

.sidebar {
  position: fixed; top: 64px; bottom: 0; left: 0; width: 300px; z-index: 40;
  border-right: 1px solid var(--hairline);
  background: var(--bg-soft);
  overflow-y: auto;
  padding: 16px 14px 32px;
  transform: translateX(-102%);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  will-change: transform;
}
.sidebar.open {
  transform: none;
  box-shadow: 24px 0 60px rgba(0, 0, 0, 0.55);
}
.sidebar-scrim {
  position: fixed; left: 0; right: 0; top: 64px; bottom: 0; z-index: 38;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.sidebar-scrim.show { opacity: 1; pointer-events: auto; }
.topbar-left { display: flex; align-items: center; gap: 8px; }
#btnSidebar { font-size: 15px; line-height: 1; }

/* 底部状态栏：继续未完成的工作 */
.resume-bar {
  position: fixed; left: 16px; bottom: 14px; z-index: 26;
  max-width: min(620px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; font-size: 11.5px; color: var(--text-2);
  background: var(--raise); border: 1px solid var(--accent-line);
  border-radius: 12px; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}
.resume-bar.hidden { display: none; }
.resume-bar .rb-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto;
  background: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
.resume-bar .rb-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resume-bar .spacer { flex: 1; }
@media (max-width: 900px) {
  .resume-bar { left: 8px; right: 8px; max-width: none; bottom: 8px; font-size: 11px; }
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------------- 侧栏 ---------------- */
.project-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-panel);
  padding: 14px 15px 13px;
  margin-bottom: 20px;
  overflow: hidden;
}
.project-card::before {
  content: "";
  position: absolute; inset: -40% 30% auto -10%; height: 120px;
  background: radial-gradient(closest-side, rgba(123, 87, 224, 0.18), transparent);
  pointer-events: none;
}
.project-card h2 {
  position: relative;
  margin: 0 0 4px; font-size: 15px; font-weight: 600; letter-spacing: 0.1px; color: #fff;
}
.project-card .pc-meta {
  position: relative;
  color: var(--dim); font-size: 10.5px; letter-spacing: 0.3px;
}
.pc-stats { display: flex; gap: 6px; margin-top: 13px; position: relative; }
.pc-stat {
  flex: 1; background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 7px 9px;
}
.pc-stat b {
  display: block; font-size: 16px; font-weight: 600; line-height: 1.15;
  color: #fff; font-family: var(--mono); letter-spacing: -0.4px;
}
.pc-stat span { font-size: 9px; color: var(--dim); letter-spacing: 0.4px; }
.pc-actions {
  display: flex; gap: 14px; margin-top: 11px; padding-top: 10px;
  border-top: 1px solid var(--line-soft); position: relative;
}
.pc-actions .mini-link { color: var(--dim); font-size: 10.5px; }
.pc-actions .mini-link:hover { color: var(--accent-text); background: transparent; }

.side-section { margin-bottom: 22px; }
.side-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2px 9px;
  color: var(--dim); font-size: 9.5px; font-weight: 600;
  letter-spacing: 1.3px; text-transform: uppercase;
}
.mini-link {
  background: none; border: none; color: var(--accent-text);
  font-size: 10.5px; padding: 3px 5px; border-radius: 5px;
  font-weight: 500; letter-spacing: 0; transition: background 0.15s;
}
.mini-link:hover { background: var(--accent-soft); }

.episode-list { display: flex; flex-direction: column; gap: 4px; }
.episode-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius);
  border: 1px solid transparent; background: transparent;
  text-align: left; width: 100%; color: var(--text-2);
  transition: background 0.15s, border-color 0.15s;
}
.episode-item:hover { background: rgba(255, 255, 255, 0.035); }
.episode-item.active {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}
.episode-item.active::before {
  content: "";
  position: absolute; left: -1px; top: 20%; bottom: 20%; width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--grad-from), var(--grad-to));
}
.episode-item .ep-idx {
  width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center;
  border-radius: 6px; background: rgba(255, 255, 255, 0.05);
  color: var(--dim); font-size: 10px; font-weight: 600; font-family: var(--mono);
}
.episode-item.active .ep-idx { background: var(--accent); color: #fff; }
.episode-item .ep-body { flex: 1; min-width: 0; }
.episode-item .ep-title {
  font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text); font-weight: 500;
}
.episode-item .ep-sub { font-size: 9.5px; color: var(--dim); margin-top: 2px; }
.episode-item .ep-del {
  opacity: 0; color: var(--dim); background: none; border: none; padding: 2px;
  transition: opacity 0.15s;
}
.episode-item:hover .ep-del { opacity: 1; }
.episode-item .ep-del:hover { color: var(--danger); }

.asset-tabs {
  display: flex; gap: 2px; margin-bottom: 9px;
  background: rgba(255, 255, 255, 0.03);
  padding: 3px; border-radius: var(--radius);
  border: 1px solid var(--line-soft);
}
.asset-tabs button {
  flex: 1; border: none; background: transparent; color: var(--dim);
  font-size: 10.5px; padding: 5px 2px; border-radius: 5px; font-weight: 500;
  transition: 0.15s;
}
.asset-tabs button:hover { color: var(--text-2); }
.asset-tabs button.active { background: var(--panel-3); color: #fff; }

.asset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.asset-card {
  position: relative; border: 1px solid var(--hairline); border-radius: var(--radius);
  overflow: hidden; background: var(--panel); cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.asset-card:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.asset-thumb {
  aspect-ratio: 4 / 3; background: var(--bg-deep) center/cover no-repeat;
  display: grid; place-items: center; color: var(--dim); font-size: 17px;
}
.asset-thumb img, .asset-thumb video {
  width: 100%; height: 100%; object-fit: contain; display: block; background: var(--bg-deep);
}
.asset-name {
  padding: 6px 7px; font-size: 10.5px; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-top: 1px solid var(--line-soft);
}
.asset-del {
  position: absolute; top: 5px; right: 5px; width: 18px; height: 18px;
  border: none; border-radius: 50%; background: rgba(0, 0, 0, 0.7); color: #fff;
  font-size: 10px; display: grid; place-items: center; opacity: 0;
  transition: opacity 0.15s;
}
.asset-card:hover .asset-del { opacity: 1; }
.asset-add {
  border: 1px dashed var(--line); border-radius: var(--radius);
  background: transparent; color: var(--dim);
  min-height: 76px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; font-size: 10.5px;
  transition: 0.15s;
}
.asset-add:hover { border-color: var(--accent-line); color: var(--accent-text); }
.empty-mini { color: var(--dim); font-size: 11.5px; padding: 8px 2px; line-height: 1.7; }

/* ---------------- 步骤导航（侧栏竖向，参照 VibeStory 的左侧导航） ---------------- */
.side-nav-head {
  padding: 0 2px 8px;
  color: var(--dim); font-size: 9.5px; font-weight: 600;
  letter-spacing: 1.3px; text-transform: uppercase;
}

.step-nav {
  display: flex; flex-direction: column; gap: 2px;
  padding: 0 0 16px; margin-bottom: 16px;
  border-bottom: 1px solid var(--hairline);
  background: transparent; overflow: visible;
}

.step-nav button {
  position: relative;
  display: grid; grid-template-columns: 26px minmax(0, 1fr); grid-template-rows: auto auto;
  column-gap: 10px; align-items: center;
  width: 100%; padding: 9px 10px;
  border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--muted);
  text-align: left; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.step-nav button i {
  grid-row: 1 / span 2;
  font-style: normal; font-family: var(--mono);
  font-size: 12px; font-weight: 600; letter-spacing: -0.3px;
  color: var(--dim); text-align: center;
}
.step-nav button span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.step-nav button small { font-size: 9px; color: var(--dim); letter-spacing: 0.2px; margin-top: 1px; }
.step-nav button:hover { background: rgba(255, 255, 255, 0.035); }
.step-nav button.active {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}
.step-nav button.active::after {
  content: "";
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 2px; height: 16px; border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, var(--grad-from), var(--grad-to));
}
.step-nav button.active i { color: var(--accent-text); }
.step-nav button.active span { color: #fff; }

.side-search { margin: 0 0 8px; }
.side-search .input { height: 28px; font-size: 11px; }

/* ---------------- 视图 ---------------- */
.views { flex: 1; min-height: 0; position: relative; }
.view {
  position: absolute; inset: 0; overflow-y: auto;
  padding: 20px 24px 48px; display: none;
}
.view.active { display: block; }
.view-inner { max-width: 1560px; margin: 0 auto; }

.section-title { display: flex; align-items: flex-end; gap: 12px; margin: 0 0 18px; padding-bottom: 15px; border-bottom: 1px solid var(--hairline); }
.section-title h1 { font-size: 22px; margin: 0; font-weight: 600; letter-spacing: -0.2px; color: #fff; }
.section-title .sub { color: var(--dim); font-size: 11px; margin-top: 4px; max-width: 760px; line-height: 1.6; }
.section-title .spacer { flex: 1; }

.panel {
  background: var(--panel); border: 1px solid var(--hairline);
  border-radius: var(--radius-panel); overflow: hidden;
}
.panel + .panel { margin-top: 14px; }
.panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--hairline);
  background: transparent;
}
.panel-head h3 { margin: 0; font-size: 12.5px; font-weight: 600; letter-spacing: 0.2px; color: var(--text); }
.panel-head .spacer { flex: 1; }
.panel-body { padding: 16px; }
.panel-body.tight { padding: 0; }

/* ---------------- 按钮 / 表单 ---------------- */
.btn {
  height: 32px; padding: 0 14px; border-radius: var(--radius);
  border: 1px solid var(--hairline); background: rgba(255, 255, 255, 0.02);
  color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.2s;
}
.btn:hover { border-color: rgba(87, 103, 118, 0.4); color: #fff; background: rgba(255, 255, 255, 0.055); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; box-shadow: none; }
.btn:disabled:hover { background: rgba(255, 255, 255, 0.02); border-color: var(--hairline); color: var(--text-2); }

/* 确认型主操作用渐变，其余一律描边 */
.btn-primary {
  background-image: linear-gradient(135deg, var(--grad-from), var(--grad-to));
  border-color: transparent; color: #fff; font-weight: 600;
  box-shadow: 0 2px 12px rgba(192, 38, 211, 0.18);
}
.btn-primary:hover {
  background-image: linear-gradient(135deg, var(--grad-hover-from), var(--grad-hover-to));
  color: #fff; box-shadow: var(--grad-glow);
}
.btn-teal {
  background: var(--accent-soft); border-color: var(--accent-line);
  color: var(--accent-text); font-weight: 600;
}
.btn-teal:hover { background: rgba(123, 87, 224, 0.26); border-color: var(--accent); color: #fff; }
.btn-danger { color: var(--danger); border-color: rgba(245, 59, 48, 0.32); background: var(--danger-soft); }
.btn-danger:hover { background: rgba(245, 59, 48, 0.2); border-color: rgba(245, 59, 48, 0.5); color: #ffd0cd; }
.btn-sm { height: 27px; padding: 0 10px; font-size: 11px; border-radius: 6px; }
.btn-lg { height: 40px; padding: 0 20px; font-size: 13px; border-radius: 10px; }
.btn-ghost { background: transparent; }

/* 列表 / 卡片里的行级操作降级为描边，渐变只留给页面与弹窗的主确认操作 */
.pr-table .btn-primary,
.sb-table .btn-primary,
.aw-actions .btn-primary,
.skill-actions .btn-primary,
.pr-actions .btn-primary {
  background-image: none;
  background-color: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-text);
  box-shadow: none;
}
.pr-table .btn-primary:hover,
.sb-table .btn-primary:hover,
.aw-actions .btn-primary:hover,
.skill-actions .btn-primary:hover,
.pr-actions .btn-primary:hover {
  background-color: rgba(123, 87, 224, 0.28);
  border-color: var(--accent);
  color: #fff;
  box-shadow: none;
}

.icon-btn {
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: var(--radius-sm); border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.02); color: var(--muted); font-size: 15px;
  transition: 0.15s;
}
.icon-btn:hover { color: #fff; border-color: var(--line); background: rgba(255, 255, 255, 0.06); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label {
  color: var(--dim); font-size: 9.5px; letter-spacing: 1px;
  font-weight: 600; text-transform: uppercase;
}
.input, .select, .textarea {
  background: var(--panel-2); border: 1px solid transparent; border-radius: var(--radius);
  color: var(--text); padding: 8px 11px; outline: none; width: 100%;
  transition: border-color 0.16s, box-shadow 0.16s;
}
.input::placeholder, .textarea::placeholder { color: rgba(184, 192, 204, 0.4); }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(87, 103, 118, 0.45); }
.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(123, 87, 224, 0.7);
  box-shadow: 0 0 0 3px rgba(123, 87, 224, 0.22);
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23b8c0cc' fill='none' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 28px;
}
.textarea { resize: vertical; line-height: 1.7; }
.input-sm { height: 27px; padding: 3px 8px; font-size: 11px; border-radius: 6px; }

.checkbox { display: flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 11.5px; cursor: pointer; }
.checkbox input { accent-color: var(--accent); width: 13px; height: 13px; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.toolbar .btn:not(.btn-primary):not(.btn-danger) { color: var(--muted); }
.hint { color: var(--dim); font-size: 10.5px; line-height: 1.65; }

/* ---------------- 剧本视图 ---------------- */
/* 指标条：一行小胶囊，不再占半屏 */
.script-summary {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px;
}
.metric {
  flex: 0 0 auto;
  display: flex; align-items: baseline; gap: 8px;
  padding: 6px 11px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--hairline);
  border-radius: 999px;
}
.metric b {
  font-size: 13px; font-weight: 600; color: #fff;
  font-family: var(--mono); letter-spacing: -0.2px; line-height: 1.3;
}
.metric span { font-size: 9.5px; color: var(--dim); letter-spacing: 0.3px; }
.metric.accent b { color: var(--accent-text); }

.dropzone {
  border: 1px dashed rgba(87, 103, 118, 0.45); border-radius: var(--radius-panel);
  background:
    radial-gradient(600px 140px at 50% 0%, rgba(123, 87, 224, 0.10), transparent 70%),
    var(--panel);
  padding: 30px; text-align: center; transition: 0.18s; cursor: pointer;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--accent-line);
  background-color: var(--raise);
}
.dropzone .dz-icon { font-size: 26px; margin-bottom: 8px; opacity: 0.7; color: var(--accent-text); }
.dropzone strong { display: block; font-size: 13.5px; margin-bottom: 5px; color: var(--text); }
.dropzone p { margin: 0; color: var(--dim); font-size: 11px; line-height: 1.7; }
.dropzone .dz-formats { margin-top: 11px; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.dz-formats span {
  border: 1px solid var(--line-soft); background: rgba(255, 255, 255, 0.03);
  padding: 2px 9px; border-radius: 999px; font-size: 9.5px; color: var(--muted);
  font-family: var(--mono);
}

.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.script-textarea {
  width: 100%; min-height: 440px; background: transparent; border: none;
  color: #d5dae3; padding: 18px 20px; line-height: 1.9; font-size: 13px;
  font-family: var(--font); resize: vertical; outline: none;
}
.script-textarea::placeholder { color: rgba(184, 192, 204, 0.32); }
.editor-foot {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  border-top: 1px solid var(--hairline); background: transparent;
  font-size: 10.5px; color: var(--dim);
}
.editor-foot .spacer { flex: 1; }

.analysis-list { display: flex; flex-direction: column; gap: 11px; }
.analysis-item { border-left: 2px solid var(--line-soft); padding-left: 11px; }
.analysis-item b {
  display: block; font-size: 9.5px; color: var(--dim); font-weight: 600;
  letter-spacing: 0.8px; margin-bottom: 3px; text-transform: uppercase;
}
.analysis-item span { font-size: 11.5px; color: var(--text-2); line-height: 1.65; }
.analysis-item.hot { border-left-color: var(--accent); }

.workflow-tip {
  display: flex; gap: 10px; padding: 12px 14px;
  border: 1px solid var(--hairline); border-left: 2px solid var(--accent);
  border-radius: var(--radius); background: rgba(123, 87, 224, 0.07);
  color: #cfc7f0; font-size: 11.5px; line-height: 1.7; margin-top: 14px;
}
.workflow-tip b { color: var(--accent-text); }

/* ---------------- 分镜表 ---------------- */
.sb-wrap {
  overflow: auto; max-height: calc(100vh - 300px);
  border-radius: 0 0 var(--radius-panel) var(--radius-panel);
}
table.sb-table {
  border-collapse: separate; border-spacing: 0;
  width: max-content; min-width: 100%; font-size: 11px;
}
.sb-table th {
  position: sticky; top: 0; z-index: 5;
  background: var(--thead); color: var(--dim);
  font-size: 9.5px; font-weight: 600; letter-spacing: 0.6px;
  padding: 9px 7px; border-bottom: 1px solid var(--hairline);
  border-right: 1px solid var(--line-soft);
  white-space: nowrap; text-align: left; text-transform: uppercase;
}
.sb-table th .en {
  display: block; color: rgba(184, 192, 204, 0.3); font-size: 8px;
  font-weight: 500; letter-spacing: 0.4px; margin-top: 2px;
}
.sb-table td {
  border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft);
  padding: 0; vertical-align: top; background: var(--panel);
}
.sb-table tr:nth-child(even) td { background: var(--row-even); }
.sb-table tr:hover td { background: var(--row-hover); }
.sb-table td.c-idx { background: #0f1113 !important; position: sticky; left: 0; z-index: 4; }
.sb-table th.c-idx { position: sticky; left: 0; z-index: 7; background: var(--thead); }
.sb-table .cell-idx {
  font-family: var(--mono); color: var(--accent-text); font-size: 11px; font-weight: 600;
  padding: 8px 9px; display: flex; align-items: center; gap: 5px;
}
.sb-table .cell-input {
  border: none; background: transparent; color: var(--text-2);
  width: 100%; padding: 8px 7px; outline: none; line-height: 1.6;
  font-size: 11px; font-family: inherit; min-height: 32px; resize: none;
}
.sb-table .cell-input:focus {
  background: rgba(123, 87, 224, 0.12); color: #fff;
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.sb-table .cell-input.num { font-family: var(--mono); text-align: center; color: var(--accent-text); }
.sb-table td.c-frame { min-width: 290px; }
.sb-table td.c-dialogue { min-width: 230px; }
.sb-table td.c-line { min-width: 150px; }
.sb-table td.c-dur { width: 62px; }
.sb-table td.c-energy { width: 54px; }
.sb-table td.c-idx { width: 54px; }
.sb-table .row-del {
  color: var(--dim); background: none; border: none; font-size: 11px;
  padding: 2px; opacity: 0; transition: opacity 0.15s;
}
.sb-table tr:hover .row-del { opacity: 1; }
.sb-table .row-del:hover { color: var(--danger); }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 999px; font-size: 10px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line-soft);
  color: var(--text-2); white-space: nowrap;
}
.chip .swatch { width: 6px; height: 6px; border-radius: 2px; background: var(--accent); }
.chip.character .swatch { background: var(--accent-text); }
.chip.scene .swatch { background: var(--teal); }
.chip.prop .swatch { background: #f0abfc; }
.chip.audio .swatch { background: #fda4af; }
.chip button { border: none; background: none; color: var(--dim); padding: 0; font-size: 11px; line-height: 1; }
.chip button:hover { color: var(--danger); }

/* ---------------- 提示词视图 ---------------- */
.prompt-list { display: flex; flex-direction: column; gap: 9px; }
.prompt-card {
  background: var(--panel); border: 1px solid var(--hairline);
  border-radius: var(--radius-panel); overflow: hidden;
  transition: border-color 0.15s;
}
.prompt-card:hover { border-color: rgba(87, 103, 118, 0.38); }
.prompt-card.expanded { border-color: var(--accent-line); }
.prompt-head {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  cursor: pointer; user-select: none;
}
.pc-group {
  font-family: var(--mono); font-size: 11.5px; font-weight: 700; color: var(--accent-text);
  background: var(--accent-soft); border: 1px solid rgba(123, 87, 224, 0.28);
  padding: 3px 9px; border-radius: 6px; flex: 0 0 auto;
}
.pc-title {
  min-width: 120px; max-width: 280px; font-size: 12px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pc-shots { color: var(--dim); font-size: 9.5px; font-family: var(--mono); flex: 0 0 auto; }
.pc-param { color: var(--muted); font-size: 9.5px; font-family: var(--mono); flex: 0 0 auto; }
.prompt-head .spacer { flex: 1; }
.pc-refs { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; max-width: 330px; }
.pc-thumb {
  width: 42px; height: 32px; border-radius: 5px;
  background: var(--bg-deep) center/cover;
  border: 1px solid var(--line-soft); flex: 0 0 auto;
}
.pc-video {
  width: 60px; height: 40px; border-radius: 5px; border: 1px solid var(--line-soft);
  background: var(--bg-deep) center/cover; position: relative; flex: 0 0 auto;
}
.pc-video::after {
  content: "▶"; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 10px; color: #fff; opacity: 0.65;
}
.pc-video.empty {
  background: repeating-linear-gradient(45deg, var(--strip-a), var(--strip-a) 4px, var(--strip-b) 4px, var(--strip-b) 8px);
}
.pc-video.empty::after { content: ""; }
.pc-arrow { color: var(--dim); font-size: 10px; transition: transform 0.2s; }
.prompt-card.expanded .pc-arrow { transform: rotate(180deg); }
.prompt-body { border-top: 1px solid var(--hairline); padding: 14px; display: none; }
.prompt-card.expanded .prompt-body { display: block; }

.prompt-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.prompt-text {
  width: 100%; min-height: 320px; background: var(--bg-deep);
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  color: #cfd6e2; padding: 13px; line-height: 1.8;
  font-family: var(--mono); font-size: 11px; resize: vertical; outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}
.prompt-text:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px rgba(123, 87, 224, 0.16); }

.inspector { display: flex; flex-direction: column; gap: 10px; }
.inspector .box {
  background: rgba(255, 255, 255, 0.025); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 11px;
}
.inspector .box h4 {
  margin: 0 0 9px; font-size: 9.5px; color: var(--dim);
  letter-spacing: 1px; text-transform: uppercase; font-weight: 600;
}
.param-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.param-row:last-child { margin-bottom: 0; }
.param-row label { flex: 0 0 52px; color: var(--muted); font-size: 10.5px; }
.param-row .select, .param-row .input { height: 27px; padding: 3px 8px; font-size: 11px; }
.ref-list { padding: 4px; display: flex; flex-direction: column; gap: 5px; }
.ref-item {
  display: flex; align-items: center; gap: 8px; padding: 4px;
  border-radius: 6px; background: rgba(255, 255, 255, 0.03);
}
.ref-item img, .ref-item .ph {
  width: 72px; height: 72px; border-radius: 6px; object-fit: cover; cursor: zoom-in;
  background: var(--panel-3); flex: 0 0 72px;
}
.ref-item .rn {
  flex: 1; font-size: 10.5px; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ref-item .rt { font-size: 9px; color: var(--dim); }
.ref-item button { border: none; background: none; color: var(--dim); font-size: 11px; padding: 2px; }
.ref-item button:hover { color: var(--danger); }
.ref-empty { color: var(--dim); font-size: 10.5px; line-height: 1.7; }
.add-ref { width: 100%; justify-content: center; }

.video-box {
  margin-top: 10px; border: 1px solid var(--line-soft);
  border-radius: var(--radius); overflow: hidden; background: var(--bg-deep);
}
.video-box video { width: 100%; max-height: 340px; display: block; background: #000; }
.video-box .vb-foot {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03); font-size: 10px; color: var(--dim);
}
.video-box .vb-foot .spacer { flex: 1; }

.status-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  border-radius: 999px; font-size: 9.5px; font-weight: 500;
  border: 1px solid transparent; white-space: nowrap;
}
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-pill.idle { color: var(--dim); background: rgba(255, 255, 255, 0.04); border-color: var(--line-soft); }
.status-pill.running { color: var(--accent-text); background: var(--accent-soft); border-color: rgba(123, 87, 224, 0.3); }
.status-pill.running::before { animation: pulse 1s infinite; }
.status-pill.done { color: var(--ok); background: var(--ok-soft); border-color: rgba(143, 224, 132, 0.28); }
.status-pill.error { color: var(--danger); background: var(--danger-soft); border-color: rgba(245, 59, 48, 0.3); }
@keyframes pulse { 50% { opacity: 0.3; } }

/* ---------------- 提示词表格 ---------------- */
.pr-panel { margin-bottom: 12px; }
.pr-table-wrap { overflow: auto; max-height: calc(100vh - 290px); }
table.pr-table {
  width: 100%; min-width: 1260px; border-collapse: separate; border-spacing: 0;
  table-layout: fixed; font-size: 11px;
}
.pr-table th {
  position: sticky; top: 0; z-index: 5; text-align: left;
  background: var(--thead); color: var(--dim); font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.6px; padding: 10px 9px;
  border-bottom: 1px solid var(--hairline); border-right: 1px solid var(--line-soft);
  white-space: nowrap; text-transform: uppercase;
}
.pr-table td {
  padding: 9px; border-bottom: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
  background: var(--panel); vertical-align: middle;
}
.pr-table tr:last-child td { border-bottom: none; }
.pr-main { cursor: pointer; }
.pr-main:hover td { background: var(--row-hover); }
.pr-main.expanded td { background: rgba(123, 87, 224, 0.07); }
.pr-group-cell { display: flex; align-items: center; gap: 7px; }
.pr-group-cell .pr-check { accent-color: var(--accent); }
.pr-shots {
  color: var(--dim); font-size: 9px; margin-top: 4px;
  padding-left: 20px; font-family: var(--mono);
}
.pr-scene { font-size: 10.5px; color: var(--text-2); line-height: 1.5; max-height: 32px; overflow: hidden; }
.pr-prompt-preview {
  font-family: var(--mono); font-size: 10px; color: #a9b3c2; line-height: 1.55;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pr-engine { font-size: 9px; color: var(--dim); margin-top: 4px; }
.pr-refs { display: flex; flex-wrap: wrap; gap: 3px; max-height: 54px; overflow: hidden; }
.pr-refs .chip { max-width: 100%; }
.chip-add {
  width: 20px; height: 18px; border-radius: 999px;
  border: 1px dashed var(--line); background: transparent;
  color: var(--dim); font-size: 11px; line-height: 1; padding: 0;
}
.chip-add:hover { color: var(--accent-text); border-color: var(--accent-line); }
.pr-table .input-sm { height: 26px; padding: 2px 6px; font-size: 10.5px; }
.pr-video-btn {
  width: 42px; height: 32px; border-radius: 5px; border: 1px solid var(--line-soft);
  background: repeating-linear-gradient(45deg, var(--strip-a), var(--strip-a) 4px, var(--strip-b) 4px, var(--strip-b) 8px);
  color: var(--dim); font-size: 10px;
}
.pr-video-btn.has {
  background: linear-gradient(150deg, #2b2440, #171226);
  color: var(--accent-text); border-color: var(--accent-line);
}
.pr-actions { display: flex; flex-direction: column; gap: 4px; }
.pr-actions .btn { width: 100%; justify-content: center; padding: 0 5px; }
.pr-detail { display: none; }
.pr-detail.open { display: table-row; }
.pr-detail > td {
  background: var(--bg-deep) !important; padding: 14px !important;
  border-bottom: 1px solid var(--hairline) !important;
}
.pr-detail .prompt-grid { grid-template-columns: minmax(0, 1fr) 310px; }
.pr-detail .prompt-text { min-height: 300px; }

/* ---------------- Skills ---------------- */
.skill-picker, .model-picker {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 5px 3px 10px; border: 1px solid var(--hairline);
  border-radius: var(--radius); background: var(--raise);
}
.model-picker-label, .skill-picker-label {
  font-size: 8.5px; color: var(--dim); letter-spacing: 1.2px; text-transform: uppercase;
}
.model-picker .select, .skill-picker .skill-select {
  border: none; background: transparent; height: 24px;
  max-width: 240px; padding: 0 20px 0 2px; font-size: 11px; color: var(--text-2);
}
.model-picker .btn, .skill-picker .btn {
  border: none; background: transparent; color: var(--accent-text);
}
.model-price { color: var(--accent-text); font-size: 9.5px; font-family: var(--mono); white-space: nowrap; }

.video-config-panel { padding: 13px 15px; margin-bottom: 12px; }
.vc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.vc-head b { font-size: 12px; letter-spacing: 0.3px; }
.vc-price { color: var(--accent-text); font-size: 9.5px; font-family: var(--mono); text-align: right; }
.vc-row { display: flex; align-items: flex-end; gap: 9px; flex-wrap: wrap; }
.vc-row label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 8.5px; color: var(--dim); letter-spacing: 0.6px; text-transform: uppercase;
}
.vc-row label.checkbox {
  flex-direction: row; align-items: center; gap: 5px;
  padding-bottom: 7px; text-transform: none; letter-spacing: 0; font-size: 11px;
}
.vc-row .input, .vc-row .select { min-width: 74px; }
.vc-row #vcModel { min-width: 190px; }
.vc-row #vcDuration { width: 64px; min-width: 64px; }
.vc-row #vcSeed { width: 76px; min-width: 76px; }
.pr-model { font-size: 10.5px; font-family: var(--mono); color: var(--text-2); }
.pr-model-tag { font-size: 9px; color: var(--dim); margin-top: 2px; }
.pr-ro { font-size: 10.5px; font-family: var(--mono); color: var(--text-2); }

.side-count {
  min-width: 22px; height: 18px; padding: 0 6px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-text);
  font: 10px/18px var(--mono); text-align: center;
}
.history-entry {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 8px;
  padding: 11px; border: 1px solid var(--hairline); border-radius: var(--radius);
  background: var(--panel); color: var(--text-2); text-align: left; cursor: pointer;
  transition: 0.15s;
}
.history-entry:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.history-entry-icon { color: var(--accent-text); font-size: 15px; }
.history-entry b { display: block; font-size: 11px; font-weight: 500; }
.history-entry small { display: block; margin-top: 2px; color: var(--dim); font-size: 9.5px; }
.history-entry-arrow { margin-left: auto; color: var(--dim); }

.history-tabs { display: flex; gap: 6px; margin-bottom: 13px; }
.history-tabs button {
  padding: 5px 11px; border: 1px solid var(--hairline); border-radius: 999px;
  background: transparent; color: var(--dim); font-size: 10px; cursor: pointer;
  transition: 0.15s;
}
.history-tabs button:hover { color: var(--text-2); }
.history-tabs button.active { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-text); }
.history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 11px; }
.history-card {
  display: block; border: 1px solid var(--hairline); border-radius: 12px;
  overflow: hidden; background: var(--panel); color: inherit; text-decoration: none;
  transition: border-color 0.15s;
}
.history-card:hover { border-color: var(--accent-line); text-decoration: none; }
.history-thumb {
  position: relative; aspect-ratio: 16 / 10; background: var(--bg-deep);
  display: grid; place-items: center; overflow: hidden;
}
.history-thumb img, .history-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.history-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; font-size: 22px; background: rgba(0, 0, 0, 0.2);
}
.history-meta { padding: 9px 10px; }
.history-name { font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-sub { margin-top: 3px; color: var(--dim); font-size: 9px; }
.modal-sub { color: var(--dim); font-size: 10px; font-weight: 400; margin-left: 6px; }

.skill-summary { display: flex; flex-direction: column; gap: 6px; }
.skill-summary-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--hairline);
  border-radius: var(--radius); background: rgba(255, 255, 255, 0.025);
}
.skill-summary-stage { width: 56px; color: var(--dim); font-size: 9.5px; letter-spacing: 0.8px; text-transform: uppercase; }
.skill-summary-name { flex: 1; font-size: 12px; color: var(--text-2); }

.skill-group { margin-bottom: 20px; }
.skill-group-head {
  display: flex; align-items: center; justify-content: space-between;
  color: var(--dim); font-size: 9.5px; font-weight: 600; letter-spacing: 1px;
  padding: 0 2px 8px; border-bottom: 1px solid var(--hairline);
  margin-bottom: 9px; text-transform: uppercase;
}
.skill-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 12px; border: 1px solid var(--hairline);
  border-radius: 12px; background: var(--panel); margin-bottom: 7px;
}
.skill-row.active { border-color: var(--accent-line); background: rgba(123, 87, 224, 0.08); }
.skill-ico {
  width: 28px; height: 28px; flex: 0 0 28px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text); font-size: 14px;
}
.skill-main { flex: 1; min-width: 0; }
.skill-title { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.skill-sub { font-size: 9.5px; color: var(--dim); margin-top: 3px; }
.skill-desc { font-size: 10.5px; color: var(--muted); margin-top: 6px; line-height: 1.65; }
.skill-actions {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
  justify-content: flex-end; max-width: 260px;
}

/* ---------------- 资产工作台 ---------------- */
.asset-group { margin-bottom: 20px; }
.asset-group-head {
  display: flex; align-items: center; gap: 10px;
  font-size: 10px; font-weight: 600; color: var(--dim);
  letter-spacing: 1.1px; text-transform: uppercase;
  padding: 0 2px 9px; border-bottom: 1px solid var(--hairline); margin-bottom: 11px;
}
.asset-work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 11px; }
.asset-work-card {
  display: flex; flex-direction: column; background: var(--panel);
  border: 1px solid var(--hairline); border-radius: 14px;
  overflow: hidden; transition: border-color 0.15s, transform 0.15s;
}
.asset-work-card:hover { border-color: rgba(87, 103, 118, 0.42); transform: translateY(-1px); }
.asset-work-card.has-image { border-color: rgba(123, 87, 224, 0.32); }
.aw-thumb { aspect-ratio: 4 / 3; background: var(--bg-deep); display: grid; place-items: center; overflow: hidden; }
.aw-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.aw-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: rgba(184, 192, 204, 0.28); font-size: 30px;
}
.aw-placeholder span { font-size: 9.5px; letter-spacing: 0.6px; }
.aw-body { padding: 11px; display: flex; flex-direction: column; gap: 6px; }
.aw-title { display: flex; align-items: center; gap: 7px; justify-content: space-between; }
.aw-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aw-desc {
  font-size: 10.5px; color: var(--muted); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 32px;
}
.aw-meta { font-size: 9px; color: var(--dim); font-family: var(--mono); }
.aw-actions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.aw-actions .btn { padding: 0 8px; }

/* ---------------- 分镜卡片（20 字段不再摊在表格里） ---------------- */
.sb-cards { display: flex; flex-direction: column; gap: 10px; padding: 14px; }

.shot-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--hairline); border-radius: 14px; overflow: hidden;
  transition: border-color 0.16s;
}
.shot-card:hover { border-color: rgba(87, 103, 118, 0.4); }
.shot-card:focus-within { border-color: var(--accent-line); }

.shot-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.022);
}
.shot-no {
  font-family: var(--mono); font-size: 11.5px; font-weight: 600;
  color: var(--accent-text); background: var(--accent-soft);
  border: 1px solid var(--accent-line); border-radius: 6px; padding: 2px 8px;
}
.sf { display: flex; align-items: center; gap: 6px; font-size: 9.5px; color: var(--dim); }
.sf > span { white-space: nowrap; letter-spacing: 0.4px; }
.sf .cell-input {
  border: 1px solid var(--line-soft); border-radius: 6px;
  background: var(--panel-2); padding: 4px 7px;
  min-height: 24px; width: auto; min-width: 64px;
  font-size: 11px; color: var(--text-2); outline: none;
}
.sf .cell-input:focus { border-color: var(--accent-line); color: #fff; }
.sf-scene .cell-input { min-width: 130px; }
.sf-dur .cell-input {
  width: 62px; min-width: 62px; text-align: center;
  color: var(--accent-text); font-family: var(--mono);
}

.shot-main {
  display: grid; grid-template-columns: 1.4fr 1fr 0.8fr; gap: 10px; padding: 11px 12px;
}
.sf-block { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sf-block > span {
  font-size: 9px; color: var(--dim); letter-spacing: 0.8px; text-transform: uppercase;
}
.sf-big {
  border: 1px solid var(--line-soft); border-radius: 8px;
  background: var(--bg-deep); padding: 8px 10px;
  min-height: 58px; width: 100%; resize: vertical; outline: none;
  font-size: 11.5px; line-height: 1.7; color: var(--text-2);
}
.sf-big:focus {
  border-color: var(--accent-line); color: #fff;
  box-shadow: 0 0 0 2px rgba(123, 87, 224, 0.18);
}

.shot-more { border-top: 1px solid var(--line-soft); }
.shot-more > summary {
  cursor: pointer; padding: 8px 12px;
  font-size: 9.5px; color: var(--dim); letter-spacing: 0.6px; list-style: none;
}
.shot-more > summary::-webkit-details-marker { display: none; }
.shot-more[open] > summary { color: var(--accent-text); }
.shot-fields {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px; padding: 0 12px 12px;
}
.shot-fields .sf { flex-direction: column; align-items: stretch; gap: 3px; }
.shot-fields .cell-input {
  width: 100%; min-height: 26px; border: 1px solid var(--line-soft);
  border-radius: 6px; background: var(--panel-2); padding: 5px 7px;
  font-size: 11px; color: var(--text-2); outline: none;
}
.shot-fields .cell-input:focus { border-color: var(--accent-line); color: #fff; }

.pc-sel {
  height: 26px; padding: 2px 20px 2px 8px; font-size: 10.5px;
  max-width: 160px; font-family: var(--mono); color: var(--text-2);
}

.awc-vars { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.awc-var {
  width: 38px; height: 38px; border-radius: 8px; overflow: hidden; padding: 0;
  border: 1px solid var(--line-soft); background: var(--bg-deep);
  display: grid; place-items: center; cursor: pointer; transition: 0.15s;
}
.awc-var:hover { border-color: var(--accent); transform: translateY(-1px); }
.awc-var img { width: 100%; height: 100%; object-fit: cover; display: block; }
.awc-var span { font-size: 8px; color: var(--dim); padding: 2px; text-align: center; line-height: 1.2; }

/* ---------------- 提示词卡片 ---------------- */
.pr-cards { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.pr-card {
  position: relative; background: var(--panel);
  border: 1px solid var(--hairline); border-radius: 14px; overflow: hidden;
  transition: border-color 0.16s;
}
.pr-card:hover { border-color: rgba(87, 103, 118, 0.4); }
.pr-card.expanded { border-color: var(--accent-line); }
.pc-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px;
}
.pc-head .spacer { flex: 1; }
.pc-chip {
  font-size: 9.5px; color: var(--dim);
  border: 1px solid var(--line-soft); border-radius: 999px;
  padding: 2px 8px; font-family: var(--mono); white-space: nowrap;
}
.pc-body { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.pc-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pc-dur { display: inline-flex; align-items: center; gap: 6px; font-size: 9.5px; color: var(--dim); }
.pc-dur .input {
  width: 68px; height: 26px; padding: 2px 7px;
  font-size: 11px; text-align: center; font-family: var(--mono);
  color: var(--accent-text);
}
.pr-card .pr-detail { display: none; border-top: 1px solid var(--line-soft); padding: 12px; }
.pr-card .pr-detail.open { display: block; }
.pr-card .pr-prompt-preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 1360px) {
  .shot-main { grid-template-columns: 1fr; }
}

/* ---------------- 资产卡片（图优先，悬停出操作） ---------------- */
.awc-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px;
}
.awc {
  position: relative; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--hairline);
  border-radius: 14px; overflow: hidden;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.awc:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5);
}
.awc-media {
  position: relative; height: 190px; background: var(--bg-deep); overflow: hidden;
  display: grid; place-items: center;
}
/* 用 contain 而不是 cover：竖图横图都完整显示，不再把 16:9 的英雄图裁成竖条 */
.awc-media img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.awc-empty {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: rgba(184, 192, 204, 0.26); font-size: 30px;
}
.awc-empty span { font-size: 9.5px; letter-spacing: 0.5px; }
.awc-media-audio {
  aspect-ratio: 16 / 9; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, #1d1838, #12141a 75%);
}
.awc-media-audio span { font-size: 30px; color: var(--accent-text); }
.awc-badge {
  position: absolute; top: 8px; left: 8px;
  font-size: 9px; padding: 2px 7px; border-radius: 999px;
  background: rgba(8, 9, 11, 0.66); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08); color: var(--muted);
}
.awc-badge.ok { color: var(--ok); }
.awc-badge.run { color: var(--accent-text); }
.awc-badge.bad { color: var(--danger); }
.awc-host {
  position: absolute; top: 8px; right: 8px;
  font-size: 9px; padding: 2px 7px; border-radius: 999px;
  background: rgba(42, 163, 31, 0.18); color: var(--ok);
  border: 1px solid rgba(143, 224, 132, 0.32);
}
.awc-actions {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: center; gap: 4px; padding: 8px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.78), transparent);
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.18s, transform 0.18s;
}
.awc:hover .awc-actions, .awc:focus-within .awc-actions { opacity: 1; transform: none; }
.awc-act {
  width: 26px; height: 26px; border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(18, 19, 22, 0.85); color: #fff; font-size: 12px;
  display: grid; place-items: center; transition: 0.15s;
}
.awc-act:hover { background: var(--accent); border-color: var(--accent); }
.awc-body { padding: 9px 10px 10px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.awc-name {
  font-size: 11.5px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.awc-sub { font-size: 9px; color: var(--dim); display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
/* 每张图自己的生成参数：紧贴图片下方，不跟项目全局走 */
.awc-params { display: flex; gap: 4px; margin-bottom: 5px; }
.awc-params .select {
  flex: 1 1 0; min-width: 0; height: 22px; padding: 0 4px;
  font-size: 10px; line-height: 22px; border-radius: 5px;
}
.awc-model { font-family: var(--mono); }
.awc-dot { opacity: 0.5; }
.awc-audio-el { width: 100%; height: 30px; margin-top: 5px; }
.awc-err { font-size: 9px; color: var(--danger); line-height: 1.45; margin-top: 2px; }

/* ---------------- 成片时间线 ---------------- */
.edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.preview-panel {
  background: var(--panel); border: 1px solid var(--hairline);
  border-radius: var(--radius-panel); overflow: hidden;
}
.preview-stage {
  background: radial-gradient(circle at 50% 42%, #15161b, var(--bg-deep) 72%);
  aspect-ratio: 16 / 9; max-height: 52vh; display: grid; place-items: center;
  position: relative; overflow: hidden;
}
.preview-stage video { max-width: 100%; max-height: 52vh; display: block; }
.preview-stage .stage-empty { color: var(--dim); text-align: center; font-size: 11.5px; line-height: 1.9; }
.preview-stage .stage-empty b { display: block; color: var(--muted); font-size: 13px; margin-bottom: 5px; }
.preview-controls {
  display: flex; align-items: center; gap: 10px; padding: 10px 13px;
  border-top: 1px solid var(--hairline); background: transparent;
}
.preview-controls .timecode { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.preview-controls .spacer { flex: 1; }
.play-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--accent-line); background: var(--accent-soft);
  color: var(--accent-text); font-size: 12px; display: grid; place-items: center;
  transition: 0.15s;
}
.play-btn:hover { background: rgba(123, 87, 224, 0.26); color: #fff; }
.scrub {
  flex: 1; height: 4px; background: rgba(255, 255, 255, 0.09);
  border-radius: 3px; position: relative; cursor: pointer; min-width: 80px;
}
.scrub .fill {
  position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px;
  background: linear-gradient(90deg, var(--grad-from), var(--grad-to));
}
.scrub .knob {
  position: absolute; top: 50%; width: 10px; height: 10px; border-radius: 50%;
  background: #fff; transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px rgba(123, 87, 224, 0.3);
}

.timeline-panel {
  background: var(--panel); border: 1px solid var(--hairline);
  border-radius: var(--radius-panel); overflow: hidden; margin-top: 12px;
}
.timeline-head {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-bottom: 1px solid var(--hairline); font-size: 11px; color: var(--muted);
}
.timeline-scroll { overflow-x: auto; overflow-y: hidden; padding: 0 0 8px; }
.timeline-inner { min-width: 100%; position: relative; }
.ruler { height: 22px; position: relative; border-bottom: 1px solid var(--line-soft); margin-left: 66px; }
.ruler .tick {
  position: absolute; top: 0; bottom: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 8px; color: var(--dim); padding-left: 3px;
  line-height: 22px; font-family: var(--mono);
}
.ruler .tick.major { border-left-color: rgba(255, 255, 255, 0.14); }
.track-row { display: flex; align-items: stretch; }
.track-label {
  width: 66px; flex: 0 0 66px; display: flex; align-items: center; gap: 5px;
  padding: 0 8px; color: var(--dim); font-size: 9px;
  border-right: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.02);
  letter-spacing: 0.6px; text-transform: uppercase;
}
.track-label .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.track {
  position: relative; height: 64px; flex: 1; min-width: 100px;
  background: repeating-linear-gradient(90deg, transparent, transparent 79px, rgba(255, 255, 255, 0.045) 79px, rgba(255, 255, 255, 0.045) 80px);
  border-bottom: 1px solid var(--line-soft);
}
.clip {
  position: absolute; top: 7px; height: 50px; border-radius: var(--radius);
  background: linear-gradient(155deg, #2a2440, #1a1726);
  border: 1px solid rgba(123, 87, 224, 0.32);
  overflow: hidden; cursor: grab;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.32); user-select: none;
  transition: box-shadow 0.12s, border-color 0.12s;
}
.clip:hover { border-color: rgba(201, 182, 255, 0.55); }
.clip.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 8px 22px rgba(0, 0, 0, 0.42); }
.clip.dragging { opacity: 0.35; }
.clip.drop-target { border-color: var(--teal); }
.clip .clip-thumb {
  position: absolute; inset: 0; background: var(--bg-deep) center/cover no-repeat;
  opacity: 0.4;
}
.clip .clip-info { position: relative; padding: 6px 8px; z-index: 1; }
.clip .clip-g {
  font-family: var(--mono); font-size: 9px; color: var(--accent-text);
  font-weight: 700; letter-spacing: 0.4px;
}
.clip .clip-name {
  font-size: 9.5px; color: #e6e3f2; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.clip .clip-dur { font-family: var(--mono); font-size: 8.5px; color: rgba(230, 227, 242, 0.6); margin-top: 3px; }
.clip .trim {
  position: absolute; top: 0; bottom: 0; width: 7px; z-index: 3;
  cursor: ew-resize; background: rgba(192, 38, 211, 0); transition: background 0.12s;
}
.clip .trim:hover, .clip .trim.active { background: rgba(192, 38, 211, 0.6); }
.clip .trim.left { left: 0; border-radius: var(--radius) 0 0 var(--radius); }
.clip .trim.right { right: 0; border-radius: 0 var(--radius) var(--radius) 0; }

.timeline-empty {
  padding: 34px; text-align: center; color: var(--dim);
  font-size: 11.5px; line-height: 1.8;
}

.export-box { position: sticky; top: 12px; }
.export-box .panel-body { display: flex; flex-direction: column; gap: 11px; }
.export-row { display: flex; gap: 8px; }
.export-row .field { flex: 1; }
.export-actions { display: flex; flex-direction: column; gap: 8px; }
.export-history { display: flex; flex-direction: column; gap: 7px; max-height: 260px; overflow-y: auto; }
.export-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 9px;
  border-radius: var(--radius); background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line-soft);
}
.export-item .ei-icon {
  width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  background: var(--accent-soft); font-size: 11px; color: var(--accent-text); flex: 0 0 26px;
}
.export-item .ei-body { flex: 1; min-width: 0; }
.export-item .ei-name { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.export-item .ei-sub { font-size: 9.5px; color: var(--dim); margin-top: 2px; }
.export-item a { font-size: 10px; }

/* ---------------- 弹窗 / 提示 ---------------- */
.modal-root {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 6, 8, 0.74); backdrop-filter: blur(8px);
  display: grid; place-items: center; padding: 24px;
}
.modal {
  width: min(760px, 100%); max-height: 88vh; overflow: hidden;
  background: var(--row-even); border: 1px solid var(--line);
  border-radius: var(--radius-modal);
  box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.modal.wide { width: min(980px, 100%); }
.modal-head {
  display: flex; align-items: center; gap: 10px; padding: 17px 20px;
  border-bottom: 1px solid var(--hairline);
}
.modal-head h2 { margin: 0; font-size: 15px; font-weight: 600; color: #fff; }
.modal-head .spacer { flex: 1; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot {
  display: flex; align-items: center; gap: 8px; padding: 14px 20px;
  border-top: 1px solid var(--hairline); background: rgba(255, 255, 255, 0.02);
}
.modal-foot .spacer { flex: 1; }

.tabs {
  display: flex; gap: 4px; padding: 0 20px;
  border-bottom: 1px solid var(--hairline); background: transparent;
}
.tabs button {
  border: none; background: transparent; color: var(--dim);
  padding: 12px 12px; font-size: 12px; font-weight: 500;
  border-bottom: 2px solid transparent; transition: color 0.15s;
}
.tabs button:hover { color: var(--text-2); }
.tabs button.active { color: #fff; border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.form-sep { grid-column: 1 / -1; height: 1px; background: var(--line-soft); margin: 4px 0; }
.form-note { color: var(--dim); font-size: 10.5px; line-height: 1.7; grid-column: 1 / -1; }

.toast-root {
  position: fixed; top: 76px; right: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  min-width: 240px; max-width: 420px; padding: 11px 14px; border-radius: 12px;
  background: var(--row-hover); border: 1px solid var(--line); color: var(--text-2);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); font-size: 11.5px; line-height: 1.6;
  animation: toast-in 0.22s ease-out; pointer-events: auto;
}
.toast.ok { border-left: 3px solid var(--ok); }
.toast.err { border-left: 3px solid #f53b30; }
.toast.info { border-left: 3px solid var(--accent); }
@keyframes toast-in { from { transform: translateY(-6px); opacity: 0; } }

.job-dock {
  position: fixed; right: 20px; bottom: 20px; z-index: 150;
  width: 380px; background: var(--row-even); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow); overflow: hidden;
}
.job-head {
  display: flex; align-items: center; gap: 8px; padding: 11px 13px;
  border-bottom: 1px solid var(--hairline);
}
.job-head .jh-title { font-size: 11.5px; font-weight: 600; }
.job-head .jh-state { font-size: 10px; color: var(--accent-text); margin-left: auto; font-family: var(--mono); }
.job-progress { height: 2px; background: rgba(255, 255, 255, 0.07); }
.job-progress .bar {
  height: 100%; transition: width 0.3s;
  background: linear-gradient(90deg, var(--grad-from), var(--grad-to));
}
.job-msg {
  padding: 9px 13px; font-size: 10.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.job-logs {
  max-height: 150px; overflow-y: auto; padding: 0 13px 10px;
  font-family: var(--mono); font-size: 9.5px; line-height: 1.75; color: var(--dim);
  display: none;
}
.job-logs.open { display: block; }
.job-logs .err { color: var(--danger); }
.job-logs .warn { color: var(--warn); }
.job-logs .success { color: var(--ok); }
.job-foot { display: flex; gap: 6px; padding: 8px 13px 11px; }
.job-foot button { font-size: 10px; }

/* ---------------- 空状态 ---------------- */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 54px 20px; color: var(--dim); gap: 10px;
}
.empty-state .es-icon { font-size: 34px; opacity: 0.42; }
.empty-state b { color: var(--text-2); font-size: 14px; font-weight: 600; }
.empty-state p { margin: 0; font-size: 11.5px; line-height: 1.8; max-width: 380px; }
.empty-state .toolbar { margin-top: 8px; justify-content: center; }

/* 批量流水线回执（JS 动态插入） */
.batch-ep { font-size: 10.5px; color: var(--text-2); line-height: 1.7; }
.batch-ep .status { font-family: var(--mono); font-size: 9.5px; color: var(--accent-text); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1360px) {
  .sidebar { width: 282px; }
  .prompt-grid { grid-template-columns: 1fr; }
  .edit-grid { grid-template-columns: 1fr; }
  .export-box { position: static; }
  .editor-grid { grid-template-columns: 1fr; }
  .script-summary { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1080px) {
  .sidebar { width: min(86vw, 320px); }
  .brand { min-width: auto; }
  .brand-text span { display: none; }
  .topbar-center { justify-content: flex-end; }
  .step-nav { padding: 10px 14px; }
  .view { padding: 16px 14px 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* 界面构建版本：用来确认浏览器拿到的到底是哪一版 */
.build-tag {
  font-family: var(--mono); font-size: 9.5px; color: var(--dim);
  border: 1px solid var(--hairline); border-radius: 999px;
  padding: 2px 8px; letter-spacing: 0.2px; white-space: nowrap;
}

/* 原生 select 的选项列表由系统绘制，只能这样兜住 */
select, .select { color-scheme: dark; }
select option, .select option,
select optgroup, .select optgroup {
  background: var(--row-hover);
  color: #e3e3e3;
}
select option:disabled { color: rgba(184, 192, 204, 0.35); }

/* 提示词卡片：来源链（场次 / 镜号 / 参考资产数） */
.pc-source {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--line-soft);
  font-size: 10.5px; color: var(--dim);
}
.pc-source .ps-label {
  padding: 1px 6px; border-radius: 4px; background: rgba(255,255,255,0.06);
  color: var(--text-2); font-size: 10px; letter-spacing: .5px;
}
.pc-source .ps-scene { color: var(--text-2); }
.pc-source .ps-sep { opacity: .5; }

/* 04 卡片头部：紧凑的选择器 + 高亮主操作 */
.pc-sel-model { width: 108px; }
.pc-sel-ratio { width: 66px; }
.pc-sel-res { width: 74px; }
.pc-dur-inline {
  display: inline-flex; align-items: center; gap: 3px;
  color: var(--dim); font-size: 10.5px; white-space: nowrap;
}
.pc-dur-inline input { width: 46px; text-align: center; }
.pc-sel { padding-top: 3px; padding-bottom: 3px; font-size: 11px; }
.btn-generate {
  background: rgba(122, 92, 255, 0.16) !important;
  border-color: rgba(122, 92, 255, 0.5) !important;
  color: #cfc4ff !important;
}
.btn-generate:hover { background: rgba(122, 92, 255, 0.28) !important; }
.btn-accent {
  background: linear-gradient(135deg, #6f5bff, #8a6bff) !important;
  border-color: transparent !important; color: #fff !important;
  box-shadow: 0 0 0 1px rgba(140, 110, 255, .35), 0 4px 14px -6px rgba(120, 90, 255, .8);
}
.btn-accent:hover { filter: brightness(1.08); }

/* 角色卡片：锚定 + 状态入口 */
.awc-lock { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 7px; }
.awc-lock-tag {
  font-size: 10px; padding: 1px 6px; border-radius: 4px;
  background: rgba(255,255,255,.06); color: var(--dim);
}
.awc-lock-tag.ok { background: rgba(90, 200, 160, .16); color: #7fe0bf; }

/* 资产组末尾的「＋ 添加」卡 */
.awc-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 168px; border: 1px dashed var(--line-soft); border-radius: var(--radius);
  background: rgba(255,255,255,.015); color: var(--dim); font-size: 11px; cursor: pointer;
}
.awc-add:hover { border-color: rgba(140,110,255,.6); color: #cfc4ff; background: rgba(120,90,255,.06); }
.awc-add-icon { font-size: 20px; line-height: 1; }

/* 项目资产库弹窗 */
.al-row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.al-row:hover { background: rgba(255,255,255,.03); }
.al-thumbs { display: flex; gap: 4px; flex: none; }
.al-thumb { width: 34px; height: 44px; border-radius: 6px; overflow: hidden; display: grid; place-items: center;
  background: rgba(255,255,255,.05); color: var(--dim); font-size: 11px; }
.al-thumb img { width: 100%; height: 100%; object-fit: cover; }
.al-thumb.ok { outline: 1px solid rgba(90,200,160,.35); }
.al-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.al-name { font-size: 12px; color: var(--text); }
.al-sub { font-size: 10.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.awc-lock-tag.bad { background: rgba(230, 90, 90, .16); color: #ff9a9a; }

.awc-var-wrap { position: relative; display: inline-block; }
.awc-var-del {
  position: absolute; top: -5px; right: -5px; width: 16px; height: 16px; line-height: 14px;
  border-radius: 50%; border: 1px solid var(--line-soft); background: #2a2a33; color: #cfcfd6;
  font-size: 11px; cursor: pointer; padding: 0;
}
.awc-var-del:hover { background: #a33; color: #fff; }
.awc-var-stale {
  position: absolute; left: -4px; bottom: -4px; font-size: 9px; padding: 0 4px; border-radius: 3px;
  background: rgba(230,90,90,.2); color: #ff9a9a;
}
.mini-link-danger { color: #ff9a9a; }

/* ==========================================================================
   白天模式（浅色主题）
   —— 只覆盖变量 + 少数写死 #fff 的文字与 hover 填充，深色主题一行不动。
   —— 切换入口在顶栏 ☀/☾，偏好存 localStorage['bds-theme']。
   ========================================================================== */
html[data-theme="light"] {
  color-scheme: light;

  /* 画布与面板 */
  --bg: #f4f5f7;
  --bg-soft: #eceef2;
  --bg-deep: #e3e6ec;
  --panel: #ffffff;
  --panel-2: #eef1f6;
  --panel-3: #dfe4ec;
  --raise: #fafbfc;

  --line: rgba(15, 23, 42, 0.14);
  --line-soft: rgba(15, 23, 42, 0.08);
  --hairline: rgba(15, 23, 42, 0.10);

  /* 文字 */
  --text: #17191f;
  --text-2: #454d5c;
  --muted: rgba(69, 77, 92, 0.78);
  --dim: rgba(69, 77, 92, 0.52);

  /* 强调 */
  --accent: #6d3fd4;
  --accent-text: #5a2fc2;
  --accent-soft: rgba(109, 63, 212, 0.10);
  --accent-line: rgba(109, 63, 212, 0.38);

  /* 状态 */
  --ok: #1f8a3a;
  --ok-soft: rgba(31, 138, 58, 0.12);
  --warn: #a9741a;
  --danger: #c0392b;
  --danger-soft: rgba(192, 57, 43, 0.10);
  --teal: #0e7490;
  --teal-soft: rgba(14, 116, 144, 0.10);

  /* 形状与阴影：浅色下靠投影淡、靠描边分层 */
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
  --grad-glow: 0 4px 24px 0 rgba(192, 38, 211, 0.18);

  /* 表格与占位 */
  --row-hover: #eef1f6;
  --row-even: #f7f8fa;
  --thead: #eef1f6;
  --strip-a: #e9ecf1;
  --strip-b: #f3f5f8;
  --scrim: rgba(15, 23, 42, 0.38);
}

/* 原本靠深色底才看得见的白字，浅色下必须换成主文字色，否则直接消失 */
html[data-theme="light"] .brand-text strong,
html[data-theme="light"] .project-card h2,
html[data-theme="light"] .pc-stat b,
html[data-theme="light"] .section-title h1,
html[data-theme="light"] .metric b,
html[data-theme="light"] .awc-name,
html[data-theme="light"] .modal-head h2,
html[data-theme="light"] .step-nav button.active span,
html[data-theme="light"] .tabs button.active,
html[data-theme="light"] .asset-tabs button.active {
  color: var(--text);
}

/* 深色下用白色微透明做的 hover 填充，浅色下要反过来 */
html[data-theme="light"] .btn:hover,
html[data-theme="light"] .icon-btn:hover,
html[data-theme="light"] .play-btn:hover {
  color: var(--text);
  background: rgba(15, 23, 42, 0.05);
}

html[data-theme="light"] .sb-table .cell-input:focus,
html[data-theme="light"] .sf .cell-input:focus,
html[data-theme="light"] .sf-big:focus,
html[data-theme="light"] .shot-fields .cell-input:focus {
  color: var(--text);
}

/* 滚动条 */
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(15, 23, 42, 0.18); }
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(15, 23, 42, 0.30); }

/* 面板在浅色下用极淡投影 + 描边，而不是靠亮度差 */
html[data-theme="light"] .awc,
html[data-theme="light"] .project-card,
html[data-theme="light"] .side-section {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

/* 顶栏主题按钮 */
.theme-toggle { font-size: 13px; line-height: 1; padding: 0 9px; }

/* ==========================================================================
   影调视图
   ========================================================================== */
.look-base {
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--panel);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.look-base-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.look-base-head b { font-size: 14px; color: var(--text); }
.look-base-text {
  margin: 0; font-size: 12.5px; line-height: 1.75; color: var(--text-2);
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--bg-soft); border: 1px solid var(--line-soft);
}
.look-edit-wrap textarea { font-size: 12.5px; line-height: 1.7; resize: vertical; }

.look-states-head { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 12px; }
.look-states-head b { font-size: 13.5px; color: var(--text); }

.look-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.look-state {
  border: 1px solid var(--line); border-radius: var(--radius-panel);
  background: var(--panel); padding: 12px 14px 14px;
}
.look-state-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.look-state-head b { font-size: 12.5px; color: var(--text); }
.look-covers { font-size: 10px; color: var(--dim); font-family: var(--mono); }
.look-prompt {
  margin: 0 0 10px; font-size: 11.5px; line-height: 1.7; color: var(--text-2);
  padding: 8px 10px; border-radius: var(--radius-sm); background: var(--bg-soft);
  border: 1px solid var(--line-soft);
}
.look-palette { display: flex; flex-direction: column; gap: 6px; }
.look-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.look-row-label { font-size: 9.5px; color: var(--dim); width: 26px; flex: none; }
.look-swatch {
  width: 34px; height: 30px; border-radius: 6px; position: relative;
  border: 1px solid var(--line-soft); display: block; overflow: hidden;
}
.look-swatch i {
  position: absolute; left: 0; right: 0; bottom: 0; font-style: normal;
  font-size: 7.5px; line-height: 1.2; text-align: center; padding: 1px 2px;
  background: rgba(0, 0, 0, 0.42); color: #fff; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.look-swatch em { display: none; }
html[data-theme="light"] .look-swatch { border-color: rgba(15, 23, 42, 0.18); }
.look-palette-img {
  display: block; width: 100%; max-width: 900px; height: auto;
  border-radius: var(--radius-panel); border: 1px solid var(--line);
  margin: 0 0 20px; background: var(--bg-soft);
}

/* 分镜卡里的首帧图 */
.shot-kf {
  display: flex; gap: 12px; align-items: flex-start;
  margin: 0 0 10px; padding: 10px; border-radius: var(--radius-sm);
  background: var(--bg-soft); border: 1px solid var(--line-soft);
}
.shot-kf-img { flex: none; display: block; width: 108px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.shot-kf-img img { display: block; width: 100%; height: auto; }
.shot-kf-meta { display: flex; flex-direction: column; gap: 4px; font-size: 10.5px; color: var(--dim); }
.shot-kf-meta b { font-size: 11.5px; color: var(--text-2); }
/* 上游改动后，产物需要重建的标记 */
.awc-stale {
  color: #ffb96b; font-size: 9px; padding: 0 5px; border-radius: 4px;
  background: rgba(255, 150, 60, 0.14); white-space: nowrap;
}
/* 时代校验改过什么 */
.awc-era {
  color: #ffb0b0; font-size: 9px; padding: 0 5px; border-radius: 4px;
  background: rgba(230, 90, 90, 0.14); white-space: nowrap;
}

/* 视频段生成中进度条（不确定进度，来回滚动） */
.pr-progress {
  height: 3px; background: rgba(255,255,255,0.06); overflow: hidden; border-radius: 0 0 4px 4px;
}
.pr-progress-bar {
  width: 35%; height: 100%;
  background: linear-gradient(90deg, transparent, #6ea8ff, transparent);
  animation: prProgMove 1.4s linear infinite;
}
@keyframes prProgMove {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(320%); }
}

/* 参考图大图预览 */
.img-zoom-mask {
  position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center;
  background: rgba(0,0,0,0.86); cursor: zoom-out; padding: 24px;
}
.img-zoom-mask img {
  max-width: 92vw; max-height: 92vh; border-radius: 6px;
  box-shadow: 0 12px 60px rgba(0,0,0,0.6);
}

/* 折叠态视频占位：不加载视频，点开才播 */
.video-hold {
  display: grid; place-items: center; height: 84px; border-radius: 8px;
  background: linear-gradient(150deg, #1a1726, #12101b);
  border: 1px dashed rgba(160, 150, 200, 0.28); color: var(--dim);
  font-size: 11px; cursor: pointer;
}
.video-hold:hover { border-color: rgba(201, 182, 255, 0.5); color: var(--text-2); }

.vb-head { display: flex; justify-content: flex-end; margin-bottom: 4px; }


/* 参考图编号 chip（提示词卡片） */
.ref-chip { display:inline-flex; align-items:center; gap:6px; padding:2px 8px 2px 2px;
  border:1px solid var(--line); border-radius:8px; background:var(--bg-2); max-width:170px; }
.ref-chip img { width:26px; height:26px; object-fit:cover; border-radius:5px; display:block; }
.ref-chip .swatch { width:14px; height:14px; border-radius:3px; background:var(--accent); }
.ref-chip .rc-no { font-size:10px; color:var(--accent); font-weight:700; }
.ref-chip .rc-name { font-size:11px; color:var(--text-2); overflow:hidden;
  text-overflow:ellipsis; white-space:nowrap; }
.ref-item { position:relative; }
.ref-item .ref-no { position:absolute; top:2px; left:2px; z-index:1; font-size:9px;
  padding:1px 4px; border-radius:4px; background:rgba(0,0,0,.7); color:#fff; }


/* 提示词内联参考图（小尺寸，嵌在正文里） */
.prompt-inline { margin-top: 8px; max-height: 220px; overflow: auto; padding: 8px 10px;
  border: 1px dashed var(--line); border-radius: 8px; background: var(--bg-2);
  font-size: 12px; line-height: 1.95; color: var(--text-2); white-space: normal; }
.inline-ref { display: inline-flex; align-items: center; gap: 3px; vertical-align: -3px;
  margin: 0 2px; padding: 0 4px 0 1px; border-radius: 5px; background: rgba(120,140,255,.12); }
.inline-ref img { width: 16px; height: 16px; object-fit: cover; border-radius: 3px; display: block;
  cursor: zoom-in; }
.inline-ref .swatch { width: 10px; height: 10px; border-radius: 2px; background: var(--accent); }
.inline-ref b { font-weight: 600; color: var(--text); font-size: 11px; }
.prompt-inline .hint { color: var(--dim); }


/* 参考资产标题栏右侧操作 */
.ref-head-ops { float:right; display:inline-flex; align-items:center; gap:6px; font-weight:400; }
.ref-head-ops .btn { padding: 2px 8px; font-size: 11px; }


/* 状态栏里的参考操作按钮（紧凑） */
.pc-meta .pr-refs { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.pc-meta .pr-refs .btn { padding: 1px 7px; font-size: 11px; line-height: 1.6; }
.pc-meta .pr-refs .hint { font-size: 11px; }


/* 展开区右列：视频 + 本段参数（和左边提示词同一水平面） */
.col-right { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.col-right .video-box { margin: 0; }
.col-right .video-box video { max-height: 300px; }
.col-right .inspector .box { margin: 0; }

@media (max-width: 1100px) {
  .prompt-grid { grid-template-columns: minmax(0, 1fr); }
}


/* 状态栏参考缩略图（小图 + 编号） */
.pr-refs .sb-ref { position: relative; display: inline-block; line-height: 0; }
.pr-refs .sb-ref img { width: 26px; height: 26px; object-fit: cover; border-radius: 5px;
  display: block; cursor: zoom-in; border: 1px solid var(--line); }
.pr-refs .sb-ref .swatch { display: block; width: 26px; height: 26px; border-radius: 5px;
  background: var(--accent); }
.pr-refs .sb-ref b { position: absolute; right: -2px; bottom: -2px; font-size: 9px;
  padding: 0 3px; border-radius: 4px; background: rgba(0,0,0,.78); color: #fff; line-height: 1.3; }


/* 参考/提示词变更后的旧视频提示 */
.chip-stale { font-size: 10px; padding: 1px 6px; border-radius: 999px;
  background: rgba(255,150,60,.16); color: #ffb96b; border: 1px solid rgba(255,150,60,.35); }


/* ==========================================================================
   07 自由画布（从零出图 / 出片）
   ========================================================================== */
#view-canvas { overflow: hidden; padding: 14px 16px 12px; }
#view-canvas .view-inner { max-width: none; height: 100%; }

.cv-shell { display: flex; flex-direction: column; height: 100%; min-height: 0; gap: 10px; }
.cv-toolbar { display: flex; align-items: flex-end; gap: 12px; flex: 0 0 auto; }
.cv-title h1 { font-size: 18px; margin: 0; font-weight: 600; color: #fff; letter-spacing: -0.2px; }
.cv-title .sub { font-size: 11px; color: var(--dim); margin-top: 3px; }
.cv-sep { width: 1px; height: 18px; background: var(--hairline); display: inline-block; margin: 0 2px; }

.cv-body { flex: 1; min-height: 0; display: flex; gap: 10px; }

.cv-stage {
  position: relative; flex: 1; min-width: 0; overflow: hidden; cursor: grab;
  border: 1px solid var(--hairline); border-radius: var(--radius-panel);
  background:
    radial-gradient(circle at 1px 1px, rgba(120, 140, 160, 0.16) 1px, transparent 0) 0 0 / 22px 22px,
    var(--bg-deep);
}
.cv-stage.panning { cursor: grabbing; }
.cv-world { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; }
.cv-edges, .cv-live { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.cv-edges { z-index: 1; }
.cv-live { z-index: 2; }
.cedge-g { color: var(--accent-line); }
.cedge { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round;
  transition: stroke 0.15s, stroke-width 0.15s; }
.cedge-hit { fill: none; stroke: transparent; stroke-width: 16; pointer-events: stroke; cursor: pointer; }
.cedge-g:hover .cedge { stroke: var(--accent-text); stroke-width: 2.6; }
.cedge-g.sel .cedge { stroke: var(--accent-text); stroke-width: 3; }
.cedge-label { fill: var(--teal); font-size: 10px; text-anchor: middle; pointer-events: none;
  paint-order: stroke; stroke: var(--bg-deep); stroke-width: 3px; }
.cv-live-path { fill: none; stroke: var(--accent-text); stroke-width: 2;
  stroke-dasharray: 6 5; opacity: 0.9; }

.cnode {
  position: absolute; z-index: 3; display: flex; flex-direction: column; overflow: visible;
  background: var(--panel); border: 1px solid var(--hairline); border-radius: 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.cnode:hover { border-color: rgba(123, 87, 224, 0.35); }
.cnode.sel { border-color: var(--accent-line);
  box-shadow: 0 0 0 1px var(--accent-line), 0 16px 36px rgba(0, 0, 0, 0.55); }
.cnode.link-target { border-color: var(--ok);
  box-shadow: 0 0 0 2px var(--ok-soft), 0 16px 36px rgba(0, 0, 0, 0.5); }

/* 端口：左进右出，按住右侧拖出连线 */
.cn-port { position: absolute; top: 19px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg-soft); border: 2px solid var(--dim); z-index: 4;
  transition: transform 0.12s, border-color 0.12s, background 0.12s; }
.cn-port.in { left: -7px; }
.cn-port.out { right: -7px; cursor: crosshair; }
.cnode:hover .cn-port { border-color: var(--accent-text); }
.cn-port:hover { transform: scale(1.35); background: var(--accent); border-color: #fff; }
.cv-stage.linking { cursor: crosshair; }

.cn-head { display: flex; align-items: center; gap: 7px; padding: 8px 10px; cursor: move;
  border-bottom: 1px solid var(--line-soft); border-radius: 14px 14px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01)); }
.cn-type-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto;
  background: var(--accent); box-shadow: 0 0 0 3px rgba(123, 87, 224, 0.16); }
.cnode.t-image .cn-type-dot { background: var(--teal); box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.16); }
.cnode.t-video .cn-type-dot { background: var(--grad-from); box-shadow: 0 0 0 3px rgba(192, 38, 211, 0.18); }
.cnode.t-text .cn-type-dot { background: var(--warn); box-shadow: 0 0 0 3px rgba(245, 196, 81, 0.16); }
.cn-title { flex: 1; min-width: 0; font-size: 11.5px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-mini { width: 20px; height: 20px; border-radius: 6px; border: 1px solid transparent;
  background: transparent; color: var(--dim); cursor: pointer; font-size: 12px; line-height: 1;
  padding: 0; opacity: 0; transition: opacity 0.12s, color 0.12s, border-color 0.12s; }
.cnode:hover .cn-mini, .cnode.sel .cn-mini { opacity: 1; }
.cn-mini:hover { color: var(--accent-text); border-color: var(--accent-line); background: var(--accent-soft); }
.cn-frame { flex: 0 0 auto; padding: 1px 5px; border-radius: 999px; font-size: 9px;
  color: var(--teal); background: var(--teal-soft); border: 1px solid rgba(125, 211, 252, 0.35); }
.cn-model { flex: 0 1 auto; min-width: 0; max-width: 92px; padding: 1px 6px; border-radius: 999px;
  font-size: 9.5px; color: var(--accent-text); background: var(--accent-soft);
  border: 1px solid var(--accent-line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cn-body { flex: 1; min-height: 0; position: relative; display: flex; align-items: center;
  justify-content: center; background: var(--bg-deep); overflow: hidden; }
.cn-media { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.cnode.t-video .cn-media { object-fit: contain; }
.cn-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px;
  text-align: center; }
.cn-empty-icon { font-size: 22px; color: var(--dim); opacity: 0.75; }
.cn-empty-text { font-size: 11px; color: var(--muted); line-height: 1.6; max-height: 3.2em;
  overflow: hidden; }
.cn-empty-hint { font-size: 9.5px; color: var(--dim); }
.cn-text { height: 100%; width: 100%; padding: 12px; font-size: 11.5px; color: var(--text-2);
  line-height: 1.75; white-space: pre-wrap; overflow: auto; }
.cn-error { position: absolute; left: 8px; right: 8px; bottom: 8px; padding: 4px 7px;
  font-size: 10px; color: #ffe3e0; background: rgba(190, 32, 26, 0.9); border-radius: 7px; }

.cn-foot { display: flex; align-items: center; gap: 6px; padding: 7px 9px;
  border-top: 1px solid var(--line-soft); background: rgba(0, 0, 0, 0.14);
  border-radius: 0 0 14px 14px; }
.cn-foot .spacer { flex: 1; }
.cn-status { display: inline-flex; align-items: center; gap: 4px; max-width: 120px;
  font-size: 10px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cnode.s-running .cn-status { color: var(--warn); }
.cnode.s-done .cn-status { color: var(--ok); }
.cnode.s-error .cn-status { color: var(--danger); }
.cn-spin { width: 8px; height: 8px; border-radius: 50%; display: inline-block;
  border: 1.5px solid var(--warn); border-top-color: transparent; animation: cvspin 0.8s linear infinite; }
@keyframes cvspin { to { transform: rotate(360deg); } }

.cn-resize { position: absolute; right: -1px; bottom: -1px; width: 15px; height: 15px;
  cursor: nwse-resize; opacity: 0; border-right: 2px solid var(--accent-text);
  border-bottom: 2px solid var(--accent-text); border-radius: 0 0 12px 0;
  transition: opacity 0.12s; }
.cnode:hover .cn-resize, .cnode.sel .cn-resize { opacity: 0.75; }

/* 框选 / 右键菜单 / 平移态 */
.cv-marquee { position: absolute; z-index: 5; border: 1px dashed var(--accent-text);
  background: rgba(123, 87, 224, 0.12); border-radius: 4px; pointer-events: none; }
.cv-marquee.hidden, .cv-menu.hidden { display: none; }
.cv-menu { position: absolute; z-index: 9; min-width: 178px; padding: 6px;
  background: var(--raise); border: 1px solid var(--hairline); border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6); }
.cv-menu-item { display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 7px 9px; border: 0; background: transparent; border-radius: 7px; color: var(--text-2);
  font-family: inherit; font-size: 11.5px; text-align: left; cursor: pointer; }
.cv-menu-item:hover { background: var(--accent-soft); color: #fff; }
.cv-menu-key { margin-left: 12px; font-size: 9.5px; color: var(--dim); }
.cv-menu-sep { height: 1px; margin: 4px 6px; background: var(--line-soft); }
.cv-stage.spacing { cursor: grab; }
/* 参考条：音频 / 缺图 / 告警 */
.sb-ref.audio { background: rgba(109, 40, 217, 0.18); border-color: var(--accent-line); font-size: 10px; padding: 2px 6px; }
.sb-ref.audio b { margin-left: 3px; font-family: inherit; }
.sb-ref.missing { border-color: #ffb96b; }
.sb-ref .sb-warn { position: absolute; top: -6px; left: -6px; font-size: 9px; font-style: normal;
  background: #ffb96b; color: #241a00; border-radius: 4px; padding: 0 3px; }
.sb-refwarn { font-size: 10px; color: #ffb96b; margin-left: 6px; }

.cv-stage.drop-target { border-color: var(--accent-line); box-shadow: inset 0 0 0 2px var(--accent-soft); }

/* 提示词 @ 引用下拉 */
.cv-mention {
  position: fixed; z-index: 70; max-height: 220px; overflow-y: auto; padding: 5px;
  background: var(--raise); border: 1px solid var(--accent-line); border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}
.cv-mention.hidden { display: none; }
.cv-mention-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px;
  border: 0; background: transparent; border-radius: 7px; cursor: pointer;
  font-family: inherit; font-size: 11.5px; color: var(--text-2); text-align: left;
}
.cv-mention-item:hover { background: var(--accent-soft); color: #fff; }
.cv-mention-item b { flex: 0 0 auto; font-family: var(--mono); font-size: 10.5px;
  color: var(--accent-text); }
.cv-mention-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-mention-empty { padding: 8px; font-size: 11px; color: var(--dim); }
.cv-stage.drop-target::after {
  content: "松开即上传图片";
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--accent-text); background: rgba(13, 15, 17, 0.55);
  pointer-events: none; z-index: 8;
}

.cv-inspector {
  flex: 0 0 300px; width: 300px; display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--radius-panel);
}
.cv-ins-empty { padding: 16px; font-size: 11.5px; line-height: 1.8; color: var(--dim); }
.cv-ins-empty b { display: block; margin-bottom: 6px; font-size: 12px; color: var(--text-2); }
.cv-ins-head { display: flex; align-items: center; gap: 6px; padding: 10px 12px;
  font-size: 12px; border-bottom: 1px solid var(--hairline); }
.cv-ins-head .spacer { flex: 1; }
.cv-ins-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.cv-ins-body .field { display: flex; flex-direction: column; gap: 5px; }
.cv-ins-body .field label { font-size: 11px; color: var(--muted); }
.cv-prompt { min-height: 120px; font-size: 12px; line-height: 1.7; resize: vertical; }
.cv-preview { width: 100%; max-height: 200px; object-fit: contain;
  background: #000; border: 1px solid var(--line-soft); border-radius: 8px; }
.cv-preview.empty { display: flex; align-items: center; justify-content: center;
  height: 110px; font-size: 11px; color: var(--dim); background: var(--bg-soft); }
.cv-ins-actions { display: flex; gap: 8px; padding-top: 4px; }
.cv-ins-error { padding: 8px; font-size: 11px; line-height: 1.6; color: #ffd0cd;
  background: var(--danger-soft); border: 1px solid rgba(245, 59, 48, 0.3); border-radius: 8px; }

.cv-dock { flex: 0 0 auto; display: flex; align-items: center; gap: 14px;
  padding: 0 2px; font-size: 11px; color: var(--dim); }
.cv-dock b { color: var(--text-2); font-weight: 600; }
.cv-dock .spacer { flex: 1; }
.cv-running { color: var(--warn); }
.cv-save.s-saving { color: var(--warn); }
.cv-save.s-saved { color: var(--ok); }
.cv-save.s-error { color: var(--danger); }

.cv-hint { position: absolute; left: 50%; top: 20px; transform: translateX(-50%);
  padding: 6px 14px; font-size: 11.5px; color: var(--dim); pointer-events: none;
  background: rgba(0, 0, 0, 0.55); border: 1px solid var(--hairline); border-radius: 999px; }
.cv-hint.hidden { display: none; }
.cv-zoom { position: absolute; right: 10px; bottom: 8px; padding: 2px 6px;
  font-family: var(--mono); font-size: 10px; color: var(--dim);
  background: rgba(0, 0, 0, 0.4); border-radius: 6px; pointer-events: none; }

/* 窄屏不再隐藏检视器：隐藏了就没法选模型、改提示词。
   中间档收窄，再窄就改成「上画布 / 下检视器」上下叠。 */
@media (max-width: 1280px) {
  .cv-inspector { flex: 0 0 264px; width: 264px; }
}
@media (max-width: 1040px) {
  .cv-body { flex-direction: column; }
  .cv-stage { min-height: 300px; }
  .cv-inspector {
    flex: 0 0 auto; width: auto; max-height: 46vh;
    border-top: 1px solid var(--hairline);
  }
}

/* 资产文件丢失占位：只提示，不显示任何替身图 */
.awc-missing {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 4px;
  text-align: center; font-size: 11px; color: #ffb96b;
  background: repeating-linear-gradient(45deg, rgba(255,185,107,.06) 0 8px, transparent 8px 16px);
  border: 1px dashed rgba(255,185,107,.5); border-radius: 10px;
}
.awc-missing small { font-size: 9px; opacity: .7; }

/* 参考条上的移除小按钮 */
.sb-ref { position: relative; }
.sb-ref-x {
  position: absolute; top: -6px; right: -6px; width: 14px; height: 14px; line-height: 12px;
  text-align: center; font-size: 11px; font-style: normal; cursor: pointer;
  background: rgba(0,0,0,.75); color: #fff; border: 1px solid rgba(255,255,255,.35);
  border-radius: 50%; opacity: 0; transition: opacity .12s;
}
.sb-ref:hover .sb-ref-x { opacity: 1; }
.sb-ref-x:hover { background: #d33; border-color: #d33; }

/* 近似匹配标记 */
.sb-fuzzy { font-size: 9px; font-style: normal; color: #7cd8ff; margin-left: 2px; }
.sb-ref.fuzzy { border-color: #7cd8ff; }
