/* ============================================================
   短剧改编工作台 · 视觉样式（左侧导航 · 简约现代 · 浅色）
   ============================================================ */

:root {
  --bg:        #f4f5f9;
  --surface:   #ffffff;
  --surface-2: #fafbfc;
  --border:    #e7e9ef;
  --border-2:  #d7dbe4;
  --text:      #14161c;
  --text-2:    #454a55;
  --muted:     #737a88;
  --accent:    #4f46e5;
  --accent-2:  #4338ca;
  --accent-soft:#eef0ff;
  --ok:        #0f7a63;
  --ok-soft:   #e6f6f1;
  --warn:      #b45309;
  --danger:    #d92d20;
  --danger-soft:#fdecea;
  --sidebar-w: 224px;
  --radius:    14px;
  --radius-sm: 10px;
  --shadow:    0 1px 2px rgba(20,22,28,.04), 0 8px 24px -12px rgba(20,22,28,.14);
  --shadow-pop:0 12px 32px -8px rgba(20,22,28,.22);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Consolas, "Microsoft YaHei", monospace;
}

* { box-sizing: border-box; }
html { height: 100%; }
/* body 不锁 100% 高：内容撑开 body，sticky 侧栏/顶栏才能在 body 高度内吸附 */

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 顶栏公告 + 主布局（侧栏 + 内容区） */
.app-main { display: flex; flex: 1 1 auto; min-width: 0; }

/* ================= 顶部公告栏 ================= */
body.has-notice { --notice-h: 38px; }

.notice-bar {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  height: 38px; padding: 0 18px;
  background: var(--accent-soft);
  color: var(--accent-2);
  border-bottom: 1px solid #dfe2fb;
  font-size: 13px;
  position: sticky; top: 0; z-index: 50;
}
.notice-bar[hidden] { display: none !important; }
.notice-ico { flex: 0 0 auto; font-size: 14px; }
.notice-text { flex: 0 1 auto; min-width: 0; max-width: calc(100% - 110px); overflow: hidden; white-space: nowrap; }
.notice-text:not(.marquee) { text-align: center; }
.notice-text.marquee { display: flex; }
.notice-text.marquee .notice-run { animation: notice-scroll var(--dur, 18s) linear infinite; padding-right: 90px; }
.notice-text:not(.marquee) .notice-run.dup { display: none; }
.notice-text.marquee:hover .notice-run { animation-play-state: paused; }
@keyframes notice-scroll { from { transform: translateX(0); } to { transform: translateX(-100%); } }
.notice-close {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  border: none; background: transparent; color: inherit;
  font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; opacity: .7;
}
.notice-close:hover { opacity: 1; }

/* 公告栏存在时，侧栏 / 顶栏的吸附位置下移，避免被公告盖住
   （仅桌面：窄屏侧栏转为顶部横条，是 static 布局，不能被这里的高度覆盖） */
body.has-notice .topbar { top: var(--notice-h); }
@media (min-width: 861px) {
  body.has-notice .sidebar { top: var(--notice-h); height: calc(100vh - var(--notice-h)); }
}

/* ================= 侧边栏 ================= */
.sidebar {
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  position: sticky; top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; }
.logo {
  width: 36px; height: 36px; border-radius: 11px; flex: 0 0 auto;
  background: linear-gradient(135deg, #6366f1, #4f46e5 55%, #7c3aed);
  color: #fff; font-size: 16px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px -4px rgba(79,70,229,.6);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.brand h1 { font-size: 14.5px; font-weight: 650; margin: 0; letter-spacing: .01em; }
.tag { font-size: 11px; color: var(--muted); white-space: nowrap; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  border: none; background: transparent; color: var(--text-2);
  padding: 10px 12px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13.5px; font-family: inherit; text-align: left;
  transition: background .15s ease, color .15s ease;
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 auto; opacity: .8; }
.nav-item:hover { background: #f2f3f8; color: var(--text); }
.nav-item.active {
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
}
.nav-item.active svg { opacity: 1; }

.sidebar-foot {
  margin-top: auto; padding: 14px 8px 0;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
  border-top: 1px solid var(--border);
}
.foot-note { font-size: 11px; color: var(--muted); }

/* ================= 顶栏 + 主区 ================= */
.shell { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 32px 14px;
  background: rgba(244,245,249,.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.page-head { display: flex; align-items: baseline; gap: 12px; min-width: 0; flex-wrap: wrap; }
.page-head h1 { font-size: 19px; font-weight: 700; margin: 0; letter-spacing: .01em; }
.page-sub { font-size: 12.5px; color: var(--muted); }
.top-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
/* 右上角按钮统一尺寸（2026-10-24-o：购买订阅/交流群/使用教程/历史任务 高度一致） */
.top-right .btn {
  padding: 7px 14px; font-size: 13px; border-radius: 8px; line-height: 1.4;
  min-height: 34px; display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box;
}

.badge {
  font-size: 12px; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--border-2); background: var(--surface-2);
  color: var(--muted); font-family: inherit; cursor: default;
}
button.badge { cursor: pointer; }
.badge-off { color: var(--muted); background: #f1f2f6; }
.badge-on  { color: var(--ok); background: var(--ok-soft); border-color: #a9dfd0; }

.workspace {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 22px 20px 64px;
  max-width: 1720px;   /* 全局放宽主体（2026-10-16-c）：所有页签统一，不再两侧大留白 */
  width: 100%;
  margin: 0 auto;
}
.content { min-width: 0; }

/* ================= 面板 / 卡片 ================= */
.panel { display: none; }
.panel.active { display: block; animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px);} to { opacity: 1; transform: none; } }

.card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; margin-bottom: 18px; background: var(--surface);
  box-shadow: var(--shadow);
}
.card:last-child { margin-bottom: 0; }
.card .muted { margin-top: 0; }
.card > p.muted { margin-bottom: 14px; }

.step-title {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  font-size: 15px; font-weight: 650; margin: 0 0 12px;
}
.step-no {
  font-style: normal; font-size: 12px; font-weight: 700;
  width: 20px; height: 20px; border-radius: 7px; flex: 0 0 auto;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ================= 表单 ================= */
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row .field { flex: 1 1 180px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.block { margin-top: 18px; }
.field > span { font-size: 13px; color: var(--text-2); font-weight: 500; }
.hint-inline { font-style: normal; font-weight: 400; font-size: 12px; color: var(--muted); }

.field select, .field input, .field textarea, .search-input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font-size: 14px; font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { resize: vertical; line-height: 1.75; min-height: 64px; }
.field select { appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 7.5 10 12.5 15 7.5' fill='none' stroke='%23737a88' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
  padding-right: 32px;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: #c3c8d4; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input::placeholder, .field textarea::placeholder { color: #a6acb9; }

/* 主输入区：默认固定大尺寸，无需手动拖拽 */
.area-lg { height: 260px !important; min-height: 260px !important; }
.area-xl { height: 320px !important; min-height: 320px !important; }
textarea.area-lg, textarea.area-xl { resize: vertical; width: 100%; display: block; }

.hint { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.pill {
  font-size: 11.5px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border-radius: 999px; padding: 1px 9px;
}
code { font-family: var(--mono); background: #f1f2f6; padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }

.input-row { display: flex; gap: 8px; align-items: stretch; }
.input-row .btn { white-space: nowrap; }

/* ================= 自定义下拉（模型名） ================= */
.combo { position: relative; flex: 1 1 auto; min-width: 0; display: flex; }
.combo > input { padding-right: 38px; }
.combo-toggle {
  position: absolute; right: 1px; top: 1px; bottom: 1px; width: 36px;
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.combo-toggle:hover { color: var(--text); background: #f5f6f9; }
.combo.open .combo-toggle svg { transform: rotate(180deg); }
.combo-toggle svg { transition: transform .16s ease; }
.combo-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop); max-height: 280px; overflow: auto; padding: 5px;
}
.combo-menu .combo-item {
  padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13.5px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-family: var(--mono); color: var(--text-2);
}
.combo-menu .combo-item:hover, .combo-menu .combo-item.active { background: var(--accent-soft); color: var(--accent); }
.combo-menu .combo-empty { padding: 10px; color: var(--muted); font-size: 13px; text-align: center; }

/* ================= 按钮 ================= */
.btn {
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text);
  padding: 10px 18px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 14px; font-family: inherit; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
}
.btn:hover { background: #f5f6f9; border-color: #c3c8d4; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-mini { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 2px 8px -3px rgba(79,70,229,.6);
}
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-primary.btn-secondary { background: #fff; color: var(--accent); border-color: #c3c7f5; box-shadow: none; }
.btn-primary.btn-secondary:hover { background: var(--accent-soft); }
.btn-ghost { border-color: #d9dde8; background: #fff; color: var(--text-2); }
.btn-ghost:hover { border-color: var(--accent); background: #f7f6ff; color: var(--accent); }
.btn-ghost.danger { color: var(--danger); }
.btn-ghost.danger:hover { border-color: var(--danger); background: #fff5f5; color: var(--danger); }

.actions { display: flex; align-items: center; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.actions-end { justify-content: flex-end; }
.status { font-size: 13px; color: var(--muted); margin-right: auto; }
.actions-end .status { margin-right: auto; }
.status.err { color: var(--danger); }

/* ================= 结果区 ================= */
.result { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.result-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.result-title { font-size: 13px; font-weight: 600; color: var(--text-2); }
.result-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.output {
  margin: 0; padding: 18px; white-space: pre-wrap; word-break: break-word;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.85;
  min-height: 180px; max-height: 640px; overflow: auto; color: var(--text);
}

/* ================= 审稿报告（图表化） ================= */
.review-report { display: flex; flex-direction: column; gap: 14px; }
.review-report[hidden] { display: none; }

.rr-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 18px; background: var(--surface-2);
}
.rr-banner.ok { border-color: #a9dfd0; background: var(--ok-soft); }
.rr-banner.bad { border-color: #f3c2bd; background: var(--danger-soft); }
.rr-banner-left { display: flex; align-items: center; gap: 10px; }
.rr-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.rr-banner.ok .rr-dot { background: var(--ok); }
.rr-banner.bad .rr-dot { background: var(--danger); }
.rr-verdict { font-size: 15px; font-weight: 650; }
.rr-banner-sub { font-size: 12.5px; color: var(--muted); }
.rr-rate { text-align: right; }
.rr-rate-num { font-size: 24px; font-weight: 650; line-height: 1.2; font-variant-numeric: tabular-nums; }
.rr-rate-num small { font-size: 13px; font-weight: 400; color: var(--muted); }
.rr-rate-label { font-size: 12px; color: var(--muted); }

.rr-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rr-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
}
.rr-card .num { font-size: 22px; font-weight: 650; line-height: 1.25; font-variant-numeric: tabular-nums; }
.rr-card .lbl { font-size: 12px; color: var(--muted); }
.rr-card.pass .num { color: var(--ok); }
.rr-card.fail .num { color: var(--danger); }
.rr-card.warn .num { color: var(--warn); }

.rr-cats {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; background: var(--surface);
}
.rr-cats-title, .rr-fails-title { font-size: 13.5px; font-weight: 650; margin: 0 0 10px; }
.rr-cat { display: grid; grid-template-columns: 108px 1fr 88px; align-items: center; gap: 10px; margin-bottom: 9px; }
.rr-cat:last-child { margin-bottom: 0; }
.rr-cat-label { font-size: 12.5px; color: var(--text-2); }
.rr-cat-bar { height: 8px; border-radius: 999px; background: #edeff5; overflow: hidden; display: flex; }
.rr-cat-bar .seg-pass { background: #34a884; height: 100%; }
.rr-cat-bar .seg-warn { background: #e5a54b; height: 100%; }
.rr-cat-bar .seg-fail { background: #e05a4e; height: 100%; }
.rr-cat-count { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

.rr-fails { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--surface); }
.rr-item {
  border: 1px solid var(--border); border-left: 3px solid var(--danger);
  border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 9px; background: var(--surface-2);
}
.rr-item:last-child { margin-bottom: 0; }
.rr-item.warn-item { border-left-color: var(--warn); }
.rr-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rr-badge {
  font-size: 11.5px; font-weight: 600; border-radius: 5px; padding: 1px 8px; flex: 0 0 auto;
}
.rr-badge.fail { color: var(--danger); background: var(--danger-soft); }
.rr-badge.warn { color: var(--warn); background: #faf3e2; }
.rr-item-title { font-size: 13px; font-weight: 600; }
.rr-item-note { margin: 6px 0 0; font-size: 12.5px; color: var(--text-2); line-height: 1.7; word-break: break-word; }
.rr-all-ok { text-align: center; color: var(--ok); font-size: 13px; padding: 8px 0 2px; }

/* ===== 审稿报告：不通过卡标红 + 逐条手动修改（2026-10-29-be） ===== */
.rr-item.fail-item { background: #fffafa; border-color: #f2cbc7; }
.rr-kv { display: flex; gap: 8px; margin-top: 5px; font-size: 12.5px; line-height: 1.7; color: var(--text-2); }
.rr-kv > b { flex: 0 0 auto; width: 4.6em; color: var(--muted); font-weight: 600; }
.rr-kv > span { flex: 1 1 auto; min-width: 0; word-break: break-word; }
.rr-kv.fix > b { color: var(--ok); }
.rr-kv.fix > span { color: var(--text); }
.rr-loc {
  font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px;
  background: var(--danger-soft); color: var(--danger);
}
button.rr-loc { border: 0; cursor: pointer; font-family: inherit; }
button.rr-loc:hover { background: #fbdcd7; }
.rr-loc.multi { background: #faf3e2; color: var(--warn); }
.rr-loc.bad { background: var(--surface-2); color: var(--muted); }
.rr-manual { margin-top: 9px; display: flex; flex-direction: column; gap: 6px; }
.rr-manual-input {
  width: 100%; box-sizing: border-box; border: 1px solid var(--border-2); border-radius: 8px;
  padding: 7px 9px; font: inherit; font-size: 12.5px; line-height: 1.6;
  color: var(--text); background: var(--surface); resize: vertical;
}
.rr-manual-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.rr-manual-acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.rr-manual-target {
  width: 100%; box-sizing: border-box; border: 1px solid var(--border-2); border-radius: 8px;
  padding: 6px 8px; font: inherit; font-size: 12.5px; background: var(--surface); color: var(--text);
}
.rr-locbox {
  margin-top: 12px; border: 1px dashed var(--border-2); border-radius: var(--radius-sm);
  padding: 10px 12px; background: var(--surface-2);
}
.rr-locbox-title { font-size: 12.5px; font-weight: 650; margin: 0 0 8px; }
.rr-loc-row { display: flex; align-items: baseline; gap: 8px; padding: 3px 0; font-size: 12.5px; }
.rr-loc-no { flex: 0 0 auto; color: var(--danger); font-weight: 600; font-variant-numeric: tabular-nums; }
.rr-loc-link {
  text-align: left; background: none; border: 0; padding: 0; font: inherit; font-size: 12.5px;
  cursor: pointer; color: var(--text-2); text-decoration: underline dotted var(--danger);
  text-underline-offset: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rr-loc-link:hover { color: var(--danger); }
.rr-loc-why { flex: 0 0 auto; margin-left: auto; color: var(--muted); font-size: 11.5px; }
.rr-loc-row.bad .rr-loc-no { color: var(--muted); }
.rr-loc-miss { color: var(--muted); }
.rf-old { color: var(--text-2); margin: 6px 0 0; }
.rf-new { color: var(--ok); font-weight: 600; margin: 4px 0 0; }

/* ================= 历史任务（浮动抽屉，不占版面列） ================= */
.history-panel {
  position: fixed; top: 70px; right: 18px; width: 302px; z-index: 70;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: 0 10px 36px rgba(24, 28, 80, .16);
  padding: 14px; max-height: calc(100vh - 100px);
  display: flex; flex-direction: column;
}
.history-panel[hidden] { display: none; }
.history-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.history-head-ops { display: inline-flex; gap: 4px; }
.history-title { font-size: 13.5px; font-weight: 650; }
.history-tip { font-size: 11.5px; color: var(--muted); margin: 6px 0 10px; line-height: 1.5; }
.history-list { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.hist-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 11px; cursor: pointer; background: var(--surface-2);
  transition: border-color .15s ease, background .15s ease;
  position: relative;
}
.hist-item:hover { border-color: #c3c7f5; background: var(--accent-soft); }
.hist-top { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.hist-type {
  font-size: 11px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border-radius: 5px; padding: 1px 7px;
}
.hist-item:hover .hist-type { background: #fff; }
.hist-time { font-size: 11px; color: var(--muted); margin-left: auto; }
.hist-title {
  font-size: 12.5px; color: var(--text-2); line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding-right: 18px;
}
.hist-del {
  position: absolute; right: 7px; bottom: 7px;
  border: none; background: transparent; color: #b9bec9; cursor: pointer;
  font-size: 13px; line-height: 1; padding: 3px; border-radius: 5px; font-family: inherit;
}
.hist-del:hover { color: var(--danger); background: #fff; }
.hist-empty { text-align: center; color: var(--muted); font-size: 12.5px; padding: 26px 10px; }
.hist-empty .hist-empty-icon { font-size: 22px; display: block; margin-bottom: 6px; opacity: .55; }

/* ================= 订阅 / 表格 ================= */
.sub-info {
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--accent-soft); border: 1px solid #dcdffb;
  margin: 12px 0; color: var(--text-2); font-size: 13.5px;
}
.plan-table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.plan-table td { padding: 11px 6px; border-bottom: 1px solid var(--border); }
.plan-table .price { text-align: right; font-weight: 600; color: var(--accent); }
.plan-table tr:last-child td { border-bottom: none; }

/* ================= 资产库 ================= */
.asset-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 12px; margin-top: 14px; }
.asset-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; background: var(--surface-2); }
.asset-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.asset-sel { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; flex: 0 0 auto; margin: 0; }
.am-style-tag { font-size: 10.5px; font-weight: 700; border-radius: 5px; padding: 1px 7px; background: var(--accent-soft); color: var(--accent); flex: 0 0 auto; }
.am-style-tag.is-pencil { background: #ffe9cc; color: #d9640d; }
#assetMultiBtn.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
/* 原图 / 彩铅 分段切换 */
.style-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--surface); }
.seg-btn { border: none; background: transparent; font-size: 12px; font-family: inherit; padding: 4px 12px; cursor: pointer; color: var(--muted); }
.seg-btn + .seg-btn { border-left: 1px solid var(--border); }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--accent); color: #fff; font-weight: 600; }
.asset-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.asset-card-head input { flex: 1; font-weight: 600; padding: 6px 9px; font-size: 13.5px;
  border: 1px solid transparent; background: transparent; border-radius: 7px; color: var(--text); }
.asset-card-head input:hover { border-color: var(--border); background: var(--surface); }
.asset-card-head input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.asset-field { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; }
.asset-field > span { font-size: 11.5px; color: var(--muted); }
.asset-field textarea, .asset-field input {
  width: 100%; padding: 7px 9px; font-size: 13px; font-family: inherit; line-height: 1.6;
  border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); resize: vertical;
}
.asset-field textarea:focus, .asset-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.asset-del { flex: 0 0 auto; }

/* 场景/道具卡描述分区：分隔线 + 标签 + 统一高度编辑框（此前挤在图片下参差不齐） */
.asset-desc { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 10px; }
.asset-desc .ad-label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.asset-desc textarea {
  width: 100%; min-height: 104px; padding: 8px 10px; font-size: 13px; font-family: inherit; line-height: 1.65;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); resize: vertical;
}
.asset-desc textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* 卡片分区：短字段常显两列；长字段与出图提示词收进折叠区 */
.asset-base { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-top: 10px; }
.asset-base .asset-field { margin-top: 0; }
.asset-fold { border-top: 1px dashed var(--border); margin-top: 12px; }
.asset-fold > summary {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; cursor: pointer;
  padding: 9px 0 4px; font-size: 12.5px; color: var(--text); list-style: none; user-select: none;
}
.asset-fold > summary::-webkit-details-marker { display: none; }
.asset-fold > summary::before { content: '▸'; color: var(--muted); font-size: 11px; flex: 0 0 auto; transition: transform 0.15s; }
.asset-fold[open] > summary::before { transform: rotate(90deg); }
.asset-fold > summary:hover { color: var(--accent); }
.af-hint { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.af-badge { font-size: 11px; border-radius: 5px; padding: 1px 7px; background: var(--accent-soft); color: var(--accent); font-weight: 400; }
.af-note { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.asset-fold .af-body .asset-field { margin-top: 8px; }

/* 角色卡「出图提示词（可改）」——可直接编辑后再生成 */
.asset-prompt textarea { min-height: 92px; font-size: 12.5px; line-height: 1.65; }

/* 角色卡「造型（换装）」——同一人物多套造型，每套可单独出图/上传（对标参考站妆造区的显眼程度） */
.asset-looks { border-top: 1px dashed #c3c7f5; }
.asset-looks > summary { padding: 10px 0 6px; }
.asset-looks > summary:hover .looks-add { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.looks-title { font-weight: 700; font-size: 13px; }
.looks-add { margin-left: auto; font-weight: 600; }
.asset-looks .af-body { display: flex; flex-direction: column; gap: 10px; }
.look-row {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid #c3c7f5; border-radius: var(--radius-sm);
  padding: 10px 11px; background: var(--accent-soft);
}
.look-row.is-main { background: var(--surface-2); border-color: var(--border-2); }
.look-row-head { display: flex; align-items: center; gap: 8px; }
.look-tag {
  flex: 0 0 auto; display: inline-block; padding: 2px 9px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
}
.look-row.is-main .look-tag { background: var(--accent-soft); color: var(--accent); border: 1px solid #c3c7f5; }
.look-row-head input { flex: 1 1 auto; font-weight: 600; }
.look-fields { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.look-fields input, .look-fields textarea { width: 100%; }
.look-fields textarea { font-size: 12.5px; line-height: 1.6; }
.look-note { font-size: 11px; color: var(--muted); }
.look-note code { font-size: 10.5px; }
.look-media { flex: 0 0 178px; display: flex; flex-direction: column; gap: 6px; }
.look-media-box { aspect-ratio: 16 / 9; max-height: none; }
.look-ops { display: flex; flex-wrap: wrap; gap: 4px; }
.look-ops .btn { padding: 3px 8px; font-size: 11.5px; }
.look-del { flex: 0 0 auto; margin-left: auto; color: var(--muted); }
.look-del:hover { color: var(--danger); border-color: var(--danger); }
@media (max-width: 960px) {
  .look-row { flex-wrap: wrap; }
  .look-media { flex: 1 1 100%; }
}

/* 顶部「＋ 新增」：对标参考站右上角大按钮 */
.asset-add-btn { padding: 7px 18px; font-size: 13.5px; font-weight: 600; }

/* 资产设计图（参考站式：待生成 → 预览 → 自动投喂分镜） */
.asset-media { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.asset-media-label { font-size: 11.5px; color: var(--muted); }
.asset-media-box {
  position: relative; width: 100%; aspect-ratio: 9 / 14; max-height: 300px;
  border: 1px dashed var(--border-2); border-radius: 9px; overflow: hidden;
  background: repeating-linear-gradient(45deg, #fafbfc, #fafbfc 10px, #f4f5f9 10px, #f4f5f9 20px);
  display: flex; align-items: center; justify-content: center;
}
.asset-media-box.has { border-style: solid; border-color: var(--border); background: #fff; }
.asset-media-box img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }

/* 点击缩略图放大查看原图（灯箱） */
#imgLightbox {
  position: fixed; inset: 0; z-index: 999; display: none;
  align-items: center; justify-content: center; padding: 32px;
  background: rgba(15, 18, 25, .78); cursor: zoom-out;
}
#imgLightbox.open { display: flex; }
#imgLightbox img {
  max-width: min(1600px, 96vw); max-height: 92vh;
  border-radius: 10px; box-shadow: 0 24px 80px rgba(0, 0, 0, .5);
  background: #fff;
}
.asset-media-box .am-empty, .asset-media-box .am-miss { font-size: 12.5px; color: var(--muted); }
.asset-media-box .am-miss { color: var(--warn); }

/* 上传入口：空图框可点击/可拖拽；占位文案两行引导 */
.asset-media-box.am-pickable:not(.has) { cursor: pointer; }
.asset-media-box.am-pickable:not(.has):hover { border-color: var(--accent); background: var(--accent-soft); }
.asset-media-box.am-dragover { border-color: var(--accent); border-style: solid; background: var(--accent-soft); }
.am-empty-up { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 0 12px; }
.am-empty-up small { font-size: 11.5px; color: var(--muted); }
.am-busy { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--accent); }
.asset-media-ops { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ================= 分镜 Unit（参考站暖色线条配色） ================= */
.unit-list { display: flex; flex-direction: column; gap: 16px; margin-top: 14px; }
.unit {
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: var(--surface); box-shadow: 0 1px 3px rgba(20, 22, 28, .05);
}
.unit.selected {
  border-color: #f0e2cd; background: #fff9f0; box-shadow: 0 1px 3px rgba(120, 84, 30, .06);
}
.unit-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.unit.selected .unit-head { background: #fffdf9; border-bottom-color: #f0e2cd; }
.unit-badge {
  font-weight: 800; font-size: 14px; letter-spacing: .5px; color: #f56d0a;
  font-family: var(--mono);
}
.unit-dur {
  font-size: 12px; font-weight: 700; color: #d9640d;
  background: #fff; border: 1px solid #f7a04b; border-radius: 999px; padding: 1px 10px;
}
.unit-scene {
  font-size: 12px; color: #d9640d; background: #ffedd6;
  border-radius: 999px; padding: 2px 10px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.unit-meta { font-size: 12px; color: #b08968; }
.unit-head .unit-tools { margin-left: auto; display: flex; gap: 6px; }

/* 引用资产行：彩色胶囊（角色蓝 / 场景橙，与 video_prompt 高亮同套） */
.unit-refs-bar {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  padding: 8px 16px; border-bottom: 1px dashed var(--border); background: var(--surface-2);
}
.unit.selected .unit-refs-bar { border-bottom-color: #f0e2cd; background: #fffdf9; }
.urb-label { font-size: 11.5px; color: #b08968; flex: 0 0 auto; }
.urb-note { font-size: 11.5px; color: var(--ok); margin-left: auto; }
.ref-chip {
  font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 10px;
  font-family: var(--mono); border: 1px solid transparent;
}
.ref-chip.ref-char { color: #3b5bfd; background: #e6ecff; border-color: #c6d3ff; }
.ref-chip.ref-scene { color: #d9640d; background: #ffedd6; border-color: #f7c896; }
.ref-chip.ref-prop { color: #7a3fd1; background: #f1e8ff; border-color: #dcc8ff; }
/* 未知引用 chip（2026-10-30-bq）：虚线灰＋可点补建，与正文里的 vp-m-unknown 同一视觉语言 */
.ref-chip.ref-chip-unknown { color: #8a8f99; background: #f3f4f6; border: 1.5px dashed #b9bec7; cursor: pointer; }
.ref-chip.ref-chip-unknown:hover { color: #565c66; background: #eceef1; border-color: #9aa0aa; }

.unit-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }

/* 左侧：暖白「文稿」面板浮在奶油卡底上（参考站式层次） */
.unit-edit {
  flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 6px 16px;
  box-shadow: 0 1px 2px rgba(20, 22, 28, .03);
}
.unit.selected .unit-edit { background: #fffdf9; border-color: #f0e2cd; box-shadow: 0 1px 2px rgba(120, 84, 30, .04); }
.unit-block { padding: 10px 12px 11px; border: 1px solid var(--border); border-radius: 10px; background: #fbfcfe; margin: 0 0 9px; }
.unit.selected .unit-block { border-color: #ecdcc3; background: #fffdf8; }
.unit-block:last-child { margin-bottom: 0; }
.unit-block > label { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: #d9640d; margin-bottom: 4px; }
.unit-block > label::before { content: ''; width: 3px; height: 11px; border-radius: 2px; background: #f56d0a; opacity: .75; }
.unit-block > label code { font-weight: 600; }
.unit-block textarea {
  width: 100%; padding: 5px 8px; font-size: 13px; font-family: inherit; line-height: 1.7;
  border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text); resize: vertical;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.unit-block textarea:hover:not(.unit-vp) { background: #eef0f5; }
.unit.selected .unit-block textarea:hover:not(.unit-vp) { background: #f8efdd; }
.unit-block textarea:focus { outline: none; background: #fff; border-color: #f5a54c; box-shadow: 0 0 0 3px rgba(245, 140, 30, .14); }

/* 分镜单卡「表演标注」折叠区（情绪/画面/节奏）：与资产卡折叠同款交互，常显只剩台词 + video_prompt */
.unit-fold { border-top: 1px dashed var(--border); margin-top: 2px; }
.unit-fold > summary {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; cursor: pointer;
  padding: 8px 2px; font-size: 12.5px; color: var(--text); list-style: none; user-select: none;
}
.unit-fold > summary::-webkit-details-marker { display: none; }
.unit-fold > summary::before { content: '▸'; color: var(--muted); font-size: 11px; flex: 0 0 auto; transition: transform .15s; }
.unit-fold[open] > summary::before { transform: rotate(90deg); }
.unit-fold .uf-hint { font-size: 11.5px; color: var(--muted); }
.unit-fold .uf-body .unit-block { margin-top: 8px; }

.uv-taskid { display: flex; gap: 6px; margin-top: 8px; }
.uv-taskid input {
  flex: 1 1 auto; min-width: 0; padding: 7px 9px; font-size: 12.5px; font-family: var(--mono);
  border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text);
}
.uv-taskid input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.uv-taskid button { flex: 0 0 auto; }

/* video_prompt 编辑块撑满左栏剩余高度：右侧视频面板有多高，编辑框就跟着多高（两侧底边对齐） */
.unit-block.vp-block { flex: 1 1 auto; display: flex; flex-direction: column; }
.unit-block.vp-block > label { flex: 0 0 auto; }
.unit-block.vp-block .vp-editor { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 180px; }
.unit-block.vp-block .vp-editor .unit-vp { flex: 1 1 auto; height: auto; resize: none; }

/* 台词行：上（说话人 + 声音标注）下（台词），无框浅底，像剧本排版 */
.unit-lines { display: flex; flex-direction: column; gap: 2px; }
.unit-line {
  display: flex; flex-direction: column; gap: 3px;
  background: transparent; border: 1px solid transparent; border-radius: 9px; padding: 7px 8px;
}
.unit-line:hover { background: #f2f3f7; }
.unit.selected .unit-line:hover { background: #fdf4e8; }
.ul-meta { display: flex; gap: 6px; align-items: baseline; }
.ul-meta input {
  padding: 2px 6px; font-size: 12px; font-family: inherit; line-height: 1.5;
  border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--text);
  transition: background .15s, border-color .15s;
}
.ul-meta input:hover { background: #eef0f4; }
.unit.selected .ul-meta input:hover { background: #fbeed9; }
.ul-meta input:focus { outline: none; background: #fff; border-color: #f5a54c; box-shadow: 0 0 0 3px rgba(245, 140, 30, .14); }
.ul-meta .ul-speaker { flex: 0 0 auto; max-width: 120px; font-weight: 700; color: var(--accent); }
.ul-meta .ul-sound { flex: 1 1 auto; min-width: 0; font-size: 11.5px; color: #a1876a; }
.unit-line .line-text { width: 100%; padding: 2px 6px; font-size: 13.5px; font-family: inherit; line-height: 1.6;
  border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--text); resize: vertical; }
.unit-line .line-text:hover { background: #eef0f4; }
.unit.selected .unit-line .line-text:hover { background: #fbeed9; }
.unit-line .line-text:focus { outline: none; background: #fff; border-color: #f5a54c; box-shadow: 0 0 0 3px rgba(245, 140, 30, .14); }

/* video_prompt 高亮编辑器：底层 pre 按 @角色/#场景/&道具 分色，上层 textarea 透明文字叠加 */
.vp-editor { position: relative; margin-top: 5px; border: 1px dashed var(--border-2); border-radius: 8px; background: var(--surface); }
.unit.selected .vp-editor { border-color: #ecd3b4; background: #fff8ec; }
.vp-editor:focus-within { border-color: #f5a54c; box-shadow: 0 0 0 3px rgba(245, 140, 30, .14); }
.vp-hl, .vp-editor .unit-vp {
  margin: 0; padding: 7px 9px; font-size: 13px; font-family: inherit; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word; overflow-wrap: break-word; border-radius: 8px;
}
.vp-hl { position: absolute; inset: 0; overflow: hidden; pointer-events: none; color: var(--text); }
.vp-editor .unit-vp {
  position: relative; display: block; width: 100%;
  background: transparent; border: none; color: transparent; caret-color: #d9640d; resize: vertical;
}
.vp-editor .unit-vp:hover { background: transparent; }
.vp-editor .unit-vp:focus { outline: none; background: transparent; box-shadow: none; }
.vp-editor .unit-vp::selection { background: #f5a54c; color: #fff; }
.vp-m { border-radius: 5px; padding: 0 3px; font-weight: 600; }
.vp-m.vp-char { color: #3b5bfd; background: #e6ecff; }
.vp-m.vp-scene { color: #d9640d; background: #ffe9cc; }
.vp-m.vp-prop { color: #0d9488; background: #d3f4ee; }
/* 未匹配到资产卡的引用（2026-10-30-bl）：虚线灰——模型把动作短语套进 @[] 时不误导为有效引用 */
.vp-m.vp-m-unknown { color: var(--muted); background: transparent; border: 1px dashed var(--border); font-weight: 500; opacity: 0.75; }
.vp-legend { font-style: normal; font-weight: 500; color: #a1876a; }
.vp-legend .lg { font-style: normal; border-radius: 4px; padding: 0 4px; margin-left: 4px; font-size: 10.5px; font-weight: 600; }
.lg-c { color: #3b5bfd; background: #e6ecff; }
.lg-s { color: #d9640d; background: #ffe9cc; }
.lg-p { color: #0d9488; background: #d3f4ee; }

/* 描述词内联引用 hover 缩略图（2026-10-26-o） */
.vp-mirror { visibility: hidden; z-index: -1; }
.vp-thumbtip {
  position: fixed; z-index: 9999; display: none; flex-direction: column; gap: 6px; align-items: flex-start;
  background: #fff; border: 1px solid var(--border-2); border-radius: 10px; padding: 8px 10px;
  box-shadow: 0 8px 24px rgba(20, 24, 40, .18); max-width: 220px; pointer-events: none;
}
.vp-thumbtip b { font-size: 12px; border-radius: 5px; padding: 1px 6px; font-weight: 600; }
.vp-thumbtip.tt-char b { color: #3b5bfd; background: #e6ecff; }
.vp-thumbtip.tt-scene b { color: #d9640d; background: #ffe9cc; }
.vp-thumbtip.tt-prop b { color: #0d9488; background: #d3f4ee; }
.vp-thumbtip .tt-body { font-size: 11.5px; color: var(--text-2); }
.vp-thumbtip .tt-body img { display: block; width: 180px; height: auto; border-radius: 8px; border: 1px solid var(--border); }

/* 修4（2026-10-25-k）：video_prompt 上方「分镜图片绑定」缩略 chips（蝶站式） */
.vp-imgs { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 7px; }
.vp-imgchip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; font-family: var(--mono);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px 2px 3px;
  background: #fff; line-height: 1.5;
}
.vp-imgchip img { width: 22px; height: 22px; object-fit: cover; border-radius: 50%; display: block; background: #f3ede4; }
.vp-imgchip .vpi-none {
  font-style: normal; font-size: 10px; font-weight: 700; width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; background: #f3ede4; color: #b08968;
}
.vp-imgchip.ref-char { color: #3b5bfd; border-color: #c6d3ff; }
.vp-imgchip.ref-scene { color: #d9640d; border-color: #f7c896; }
.vp-imgchip.ref-prop { color: #0d9488; border-color: #b5e3db; }
.vp-imgchip b { font-weight: 600; }

/* 单元：左编辑 / 右视频 双栏（空间不足时视频面板自动换行到下方） */
.unit-body { flex-direction: row; flex-wrap: wrap; align-items: stretch; gap: 16px; }
.unit-edit { flex: 1 1 320px; min-width: 260px; }
.unit-video-panel {
  flex: 0 1 300px; min-width: 260px; max-width: 320px; border: 1px solid #f0e2cd; border-radius: 10px;
  background: #fffdf9; padding: 12px; display: flex; flex-direction: column; gap: 9px;
  align-self: stretch;
}
.unit-video, .unit-video-placeholder { flex: 1 1 auto; min-height: 132px; }
.uv-head { display: flex; align-items: center; justify-content: space-between; }
.uv-model { margin: 0; font-size: 11px; color: var(--muted); line-height: 1.4; }
.uv-title { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.uv-state { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: #eceef3; color: var(--muted); }
.uv-state.done { background: var(--ok-soft); color: var(--ok); }
.uv-state.running { background: var(--accent-soft); color: var(--accent); }
.uv-state.failed { background: var(--danger-soft); color: var(--danger); }
.unit-video { width: 100%; border-radius: 8px; background: #000; display: block; }
.unit-video-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  min-height: 158px; border: 1px dashed var(--border-2); border-radius: 8px;
  font-size: 12.5px; color: var(--muted); background: var(--surface); text-align: center; padding: 0 10px;
}
.unit-video-placeholder .uvp-ico { font-size: 22px; opacity: .55; }
.unit-video-placeholder small { font-size: 11px; color: var(--muted); opacity: .85; }
.spin {
  width: 13px; height: 13px; border-radius: 50%; display: inline-block;
  border: 2px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.unit-video-err { margin: 0; font-size: 12px; color: var(--danger); line-height: 1.5; }
.unit-lastref { margin: 4px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.unit-lastref.warn { color: #c47a12; }
.unit-lastref.none { color: var(--muted); }
/* 生成中／失败态显示的中转任务ID标签（点击复制） */
.uv-uptask { display: inline-block; margin: 8px 0 2px; padding: 2px 10px; border: 1px dashed var(--border-2); border-radius: 999px; font-size: 12px; color: var(--accent); cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uv-uptask:hover { border-color: var(--accent); background: var(--accent-soft); }
/* 重新生成进行中角标：有旧视频的单元也醒目显示"生成中"（2026-11-01-ce） */
.uv-regen-badge { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; padding: 7px 12px; border: 1px solid var(--accent-soft); border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 600; }
.uv-adv { font-size: 12px; }
.uv-adv summary { cursor: pointer; color: var(--muted); user-select: none; }
.uv-adv summary:hover { color: var(--accent); }
.uv-adv textarea {
  margin-top: 6px; width: 100%; padding: 7px 9px; font-size: 12px; font-family: inherit; line-height: 1.5;
  border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); resize: vertical;
}
.uv-adv textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.uv-ops { display: flex; gap: 7px; }
.uv-ops .btn { flex: 1 1 0; text-align: center; }
.uv-gen { font-weight: 700; background: linear-gradient(135deg, #ff9a3d, #f56d0a) !important; border-color: #f56d0a !important; color: #fff !important; }
.uv-gen:hover { filter: brightness(1.05); }
.uv-upload { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.uv-hint { margin: 0; font-size: 11px; color: var(--muted); line-height: 1.5; }
.unit-video-hist { font-size: 12px; }
.unit-video-hist summary { cursor: pointer; color: var(--muted); }
.uvh-row { padding: 3px 0; }
.check-inline { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.check-inline input { margin: 0; }

/* ================= 资产与分镜：工作区（顶栏 + 左分类导航 + 主视图） ================= */
.ws { padding: 0; overflow: hidden; }
.ws-top {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 13px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.ws-project { display: flex; align-items: center; gap: 8px; flex: 0 1 360px; min-width: 220px; }
.ws-project > span { font-size: 13px; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.ws-project select {
  flex: 1; min-width: 0; padding: 8px 30px 8px 11px; font-size: 13.5px; font-family: inherit;
  border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface); color: var(--text);
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 7.5 10 12.5 15 7.5' fill='none' stroke='%23737a88' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 15px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ws-project select:hover { border-color: #c3c8d4; }
.ws-project select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ws-project-ops { display: flex; gap: 4px; }
.ws-top .status { margin-left: auto; }

.ws-body { display: grid; grid-template-columns: 192px minmax(0, 1fr); min-height: 540px; }
.ws-rail {
  border-right: 1px solid var(--border); background: var(--surface-2);
  padding: 12px 10px; display: flex; flex-direction: column; gap: 4px;
}
.ws-rail-item {
  display: flex; align-items: center; gap: 8px;
  border: none; background: transparent; color: var(--text-2);
  padding: 9px 11px; border-radius: 9px; cursor: pointer; font-size: 13.5px; font-family: inherit; text-align: left;
  transition: background .15s ease, color .15s ease;
}
.ws-rail-item:hover { background: #f0f1f7; color: var(--text); }
.ws-rail-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.ws-rail-ico { font-size: 14px; flex: 0 0 auto; }
.ws-count {
  margin-left: auto; font-style: normal; font-weight: 600; font-size: 11.5px;
  min-width: 22px; text-align: center; padding: 1px 7px; border-radius: 999px;
  background: #e8eaf1; color: var(--muted); font-variant-numeric: tabular-nums;
}
.ws-rail-item.active .ws-count { background: #dcdffb; color: var(--accent); }
.ws-rail-tip {
  font-size: 11px; color: var(--muted); line-height: 1.7;
  margin: 12px 4px 0; padding-top: 12px; border-top: 1px dashed var(--border-2);
}

.ws-main { padding: 18px 22px 24px; min-width: 0; }
.ws-view { display: none; }
.ws-view.active { display: block; animation: fade .18s ease; }
.ws-view-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ws-view-title { font-size: 15px; font-weight: 650; }
.ws-view-tools { margin-left: auto; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

/* 参考站式大空态：图标 + 标题 + 引导按钮 */
.asset-empty {
  border: 1px dashed var(--border-2); border-radius: var(--radius);
  background: var(--surface-2); padding: 46px 20px 42px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
}
.asset-empty-ico { font-size: 30px; opacity: .6; }
.asset-empty-title { font-size: 14.5px; font-weight: 650; color: var(--text-2); }
.asset-empty .btn { margin-top: 8px; }

/* 项目概览（源文件视图底部） */
.project-overview { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.po-item { font-size: 12.5px; color: var(--text-2); }
.po-item b { color: var(--accent); }
.po-item .po-ok { color: var(--ok); }
.po-item .po-bad { color: var(--danger); }

@media (max-width: 960px) {
  .ws-body { grid-template-columns: 1fr; min-height: 0; }
  .ws-rail {
    flex-direction: row; align-items: center; overflow-x: auto;
    border-right: none; border-bottom: 1px solid var(--border); padding: 8px 10px;
  }
  .ws-rail-item { white-space: nowrap; }
  .ws-rail-tip { display: none; }
}

@media (max-width: 1100px) {
  .unit-body { flex-direction: column; }
  .unit-video-panel { flex: 1 1 auto; width: 100%; }
}

/* ================= 筛选 / 统计 ================= */
.filter-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 0 4px; }
.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.chip {
  border: 1px solid var(--border-2); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 5px 13px; font-size: 12.5px; cursor: pointer; font-family: inherit;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.chip:hover { background: #f5f6f9; color: var(--text); }
.chip.active { background: var(--accent-soft); border-color: #c3c7f5; color: var(--accent); font-weight: 600; }
.search-input { flex: 1 1 200px; min-width: 160px; padding: 8px 11px; font-size: 13px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ================= 运营后台（沿用） ================= */
.admin-cards { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.admin-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 13px 15px; background: var(--surface-2); }
.admin-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-card-head strong { font-weight: 600; font-family: var(--mono); font-size: 13px; }
.admin-card-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.admin-card-actions .danger { color: var(--danger); }
.dev-list { list-style: none; margin: 10px 0 0; padding: 0; }
.dev-list li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); font-size: 13px; }
.dev-list li:first-child { border-top: none; }
.dev-list li .small { margin-left: auto; }
.card-detail { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 10px; }
.detail-list { display: flex; flex-wrap: wrap; gap: 6px 26px; margin: 0; }
.detail-list > div { display: flex; gap: 8px; font-size: 13px; min-width: 200px; }
.detail-list dt { color: var(--muted); margin: 0; }
.detail-list dd { margin: 0; }
.gen-result { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }

/* ================= 响应式 ================= */
@media (max-width: 1080px) {
  .workspace { grid-template-columns: 1fr; }
  .history-panel { position: static; max-height: none; order: -1; }
}
@media (max-width: 860px) {
  body { flex-direction: column; }
  .sidebar {
    width: 100%; flex: 0 0 auto; height: auto; position: static;
    flex-direction: row; align-items: center; gap: 10px;
    padding: 10px 14px; border-right: none; border-bottom: 1px solid var(--border);
    overflow-x: auto;
  }
  .brand { padding: 0 6px 0 0; border-right: 1px solid var(--border); }
  .brand-text .tag, .sidebar-foot .foot-note { display: none; }
  .nav { flex-direction: row; gap: 2px; }
  .nav-item { padding: 8px 11px; white-space: nowrap; }
  .nav-item span { font-size: 13px; }
  .sidebar-foot { margin: 0 0 0 auto; padding: 0; border-top: none; flex-direction: row; align-items: center; }
  .topbar { padding: 12px 16px; }
  .workspace { padding: 14px 16px 48px; }
  .card { padding: 16px; }
  .unit-line { grid-template-columns: 1fr; }
  .asset-list { grid-template-columns: 1fr; }
}

/* ============================================================
   提取文案（ASR）：拖拽上传 / 识别队列 / 分段时间戳
   ============================================================ */

.asr-drop {
  border: 1.5px dashed var(--border-2); border-radius: var(--radius);
  background: var(--surface-2); padding: 26px 18px; text-align: center;
  transition: border-color .15s, background .15s;
}
.asr-drop.drag { border-color: var(--accent); background: var(--accent-soft); }
.asr-drop-ico { font-size: 26px; line-height: 1; margin-bottom: 8px; }
.asr-drop-main { font-size: 14px; color: var(--text-2); display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.asr-drop-sub { margin-top: 8px; font-size: 12px; color: var(--muted); }

.asr-queue { display: flex; flex-direction: column; gap: 10px; }
.asr-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; background: var(--surface);
}
.asr-item.error { border-color: #f3c9c4; background: #fffafa; }
.asr-item-main { display: flex; align-items: baseline; gap: 8px; }
.asr-item-name { font-weight: 600; font-size: 13px; word-break: break-all; }
.asr-item-meta { font-size: 11.5px; color: var(--muted); flex: 0 0 auto; }
.asr-bar { margin: 7px 0 5px; height: 4px; border-radius: 999px; background: #eef0f4; overflow: hidden; }
.asr-bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.asr-item.done .asr-bar > i { background: var(--ok); }
.asr-item.error .asr-bar > i { background: var(--danger); }
.asr-item-state { font-size: 11.5px; color: var(--muted); }
.asr-item-state.err { color: var(--danger); }

.asr-segments { display: flex; flex-direction: column; gap: 6px; max-height: 480px; overflow: auto; padding-right: 4px; }
.asr-seg { display: grid; grid-template-columns: 52px 78px 1fr; gap: 8px; align-items: start; font-size: 13.5px; line-height: 1.7; }
.asr-time { font-family: var(--mono); font-size: 11.5px; color: var(--muted); padding-top: 3px; }
.asr-spk {
  font-size: 11.5px; font-weight: 700; text-align: center; padding: 1px 0; border-radius: 999px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.asr-spk.sp0 { color: #3b5bfd; background: #e6ecff; }
.asr-spk.sp1 { color: #d9640d; background: #ffe9cc; }
.asr-spk.sp2 { color: #0d9488; background: #d3f4ee; }
.asr-spk.sp3 { color: #9333ea; background: #f3e8ff; }
.asr-spk.sp4 { color: #b45309; background: #fef3c7; }
.asr-spk.sp5 { color: #0369a1; background: #e0f2fe; }
.asr-txt { color: var(--text); word-break: break-word; }
.asr-plain { margin: 0; white-space: pre-wrap; font-family: var(--font); font-size: 13.5px; line-height: 1.8; }

/* 画面解析勾选行 + 画面+台词脚本展示 */
.check-line { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 13.5px; cursor: pointer; user-select: none; }
.check-line input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent, #4f6ef7); flex: none; cursor: pointer; }
.asr-script { max-height: 480px; overflow: auto; padding: 12px 14px; background: var(--panel-2, rgba(0,0,0,.03)); border: 1px solid var(--line, rgba(0,0,0,.08)); border-radius: 10px; }

.asr-hist { display: flex; flex-direction: column; gap: 8px; }
.asr-hist-item {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 12px; background: var(--surface);
}
.asr-hist-item:hover { border-color: var(--border-2); background: var(--surface-2); }
.asr-hist-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.asr-hist-name { font-weight: 600; font-size: 13px; word-break: break-all; }
.asr-hist-meta { font-size: 11.5px; color: var(--muted); }
.asr-hist-tools { display: flex; gap: 6px; flex: 0 0 auto; }

@media (max-width: 860px) {
  .asr-seg { grid-template-columns: 46px 1fr; }
  .asr-spk { display: none; }
  .asr-hist-item { flex-direction: column; align-items: flex-start; }
}

/* 防御：hidden 属性永远生效，不被 .panel.active 等类规则压掉 */
.panel[hidden] { display: none !important; }

/* ---------------- 统一模态弹窗（替代原生 confirm/prompt） ---------------- */
.sj-modal-mask {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(23, 26, 43, .45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: sjFade .15s ease;
}
.sj-modal {
  background: #fff; border-radius: 16px; width: min(460px, 100%);
  max-height: min(76vh, 640px); display: flex; flex-direction: column;
  padding: 20px 22px 16px; box-shadow: 0 24px 64px rgba(23, 26, 43, .28), 0 2px 8px rgba(23, 26, 43, .12);
  animation: sjPop .18s cubic-bezier(.2, .9, .3, 1.15);
}
.sj-modal-title {
  font-size: 16px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 9px; margin-bottom: 10px; flex: 0 0 auto;
}
.sj-modal-title::before { content: ''; flex: 0 0 auto; width: 4px; height: 16px; border-radius: 2px; background: var(--accent); }
.sj-modal.danger .sj-modal-title::before { background: var(--danger); }
.sj-modal-body {
  font-size: 14px; line-height: 1.75; color: var(--text); overflow-y: auto;
  min-height: 0; flex: 1 1 auto; word-break: break-word;
}
.sj-modal-body .dim { color: var(--muted); }
.sj-modal-input {
  flex: 0 0 auto; margin-top: 12px; width: 100%; box-sizing: border-box;
  padding: 10px 12px; font-size: 14px; color: var(--text);
  border: 1px solid #d9dde8; border-radius: 10px; background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.sj-modal-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(109, 74, 255, .14); }
.sj-modal-foot { flex: 0 0 auto; display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.sj-modal-foot .btn { min-width: 84px; }

/* 智能分镜弹窗：分镜模式／镜头时长选择（2026-10-21-g，对标参考站） */
.plan-opt-group { margin: 0 0 14px; text-align: left; }
.plan-opt-group:last-child { margin-bottom: 2px; }
.plan-opt-label { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 7px; }
.plan-opt-seg { display: flex; gap: 8px; }
.plan-opt-btn {
  flex: 1; padding: 9px 0; font-size: 13px; font-family: inherit; cursor: pointer;
  border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface-2); color: var(--text-2);
  transition: border-color .15s, color .15s, background .15s;
}
.plan-opt-btn:hover { border-color: var(--accent); color: var(--accent); }
.plan-opt-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.plan-opt-hint { margin: 7px 0 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.plan-opt-hint b { color: var(--text-2); }
.sj-modal-ok.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.sj-modal-ok.danger:hover { background: #e5484d; border-color: #e5484d; }
@keyframes sjFade { from { opacity: 0; } }
@keyframes sjPop { from { opacity: 0; transform: scale(.94) translateY(10px); } }

/* ---------------- 分镜全局默认行 + 单元级覆盖 ---------------- */

.unit-global-bar {
  display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap;
  margin: 10px 0 4px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
}
.unit-global-bar .ugb-item { display: flex; flex-direction: column; gap: 4px; min-width: 200px; flex: 1; }
.unit-global-bar .ugb-item > span { font-size: 12px; color: var(--muted); }
.unit-global-bar select {
  width: 100%; padding: 8px 30px 8px 11px; font-size: 13.5px; height: 38px;
  border: 1px solid var(--border-2); border-radius: 8px;
  background-color: var(--surface); color: var(--text);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 7.5 10 12.5 15 7.5' fill='none' stroke='%23737a88' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 15px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.unit-global-bar select:hover { border-color: #c3c8d4; }
.unit-global-bar select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.uv-override { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.uv-override label { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.uv-override label > span { font-size: 11.5px; color: var(--muted); }
.uv-override select {
  width: 100%; font-size: 12.5px; padding: 6px 26px 6px 8px; height: 32px;
  border: 1px solid var(--border-2); border-radius: 7px;
  background-color: var(--surface); color: var(--text);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 7.5 10 12.5 15 7.5' fill='none' stroke='%23737a88' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.uv-override select:hover { border-color: #c3c8d4; }
.uv-override select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.uv-model { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }

/* ================= 分镜页固定框架（2026-10-16-a）=================
   资产与分镜页：左侧项目栏目、顶部项目条与「Unit 与视频」头固定，
   仅分镜列表（及其他 ws 视图的内容区）内部滚动；左右留白放宽。 */
.workspace:has(#tab-assets.active) {
  height: calc(100vh - 58px);          /* 顶栏高度 */
  overflow: hidden;
  padding: 16px 20px 16px;
}
body.has-notice .workspace:has(#tab-assets.active) { height: calc(100vh - var(--notice-h) - 58px); }
.workspace:has(#tab-assets.active) .content { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.workspace:has(#tab-assets.active) #tab-assets.active { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.workspace:has(#tab-assets.active) .card.ws { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; margin-bottom: 0; }
.workspace:has(#tab-assets.active) .ws-body { flex: 1 1 auto; min-height: 0; }
.workspace:has(#tab-assets.active) .ws-main { display: flex; flex-direction: column; overflow: hidden; }
.workspace:has(#tab-assets.active) .ws-view.active { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 4px; }
/* 分镜视图：标题条（工具行）固定；全局默认条 2026-10-28-aw 起改为随内容滚动（不再跟随挡卡）——
   它与单元列表一起装进 #unitScrollWrap 滚动容器，向下浏览时自然滚走，下一个分镜卡不再被挡半截 */
#view-units.active { display: flex; flex-direction: column; }
#view-units.active .ws-view-head { flex: 0 0 auto; }
#view-units.active .unit-scroll-wrap { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
#view-units.active .unit-list { flex: 0 0 auto; overflow: visible; padding: 14px 8px 14px 2px; }
#view-units.active .unit-list > .unit { flex: 0 0 auto; }   /* 关键：禁 flex-shrink，否则固定高度下卡片被压扁而非滚动 */
/* 列表内滚动条细化 */
#view-units.active .unit-scroll-wrap::-webkit-scrollbar,
.workspace:has(#tab-assets.active) .ws-view.active::-webkit-scrollbar { width: 8px; }
#view-units.active .unit-list::-webkit-scrollbar-thumb,
.workspace:has(#tab-assets.active) .ws-view.active::-webkit-scrollbar-thumb { background: #d4d8e2; border-radius: 999px; }
/* 窄屏回归整页滚动 */
@media (max-width: 960px) {
  .workspace:has(#tab-assets.active) { height: auto; overflow: visible; padding: 18px 16px 48px; }
  .workspace:has(#tab-assets.active) .content,
  .workspace:has(#tab-assets.active) #tab-assets.active,
  .workspace:has(#tab-assets.active) .card.ws,
  .workspace:has(#tab-assets.active) .ws-main { display: block; height: auto; overflow: visible; }
  .workspace:has(#tab-assets.active) .ws-view.active { overflow: visible; }
  #view-units.active { display: block; }
  #view-units.active .unit-scroll-wrap { overflow: visible; }
  #view-units.active .unit-list { overflow: visible; padding: 14px 0; }
}

/* 一键修改工作台（审稿页） */
.fix-changes { border: 1px dashed var(--border-2); border-radius: 9px; background: var(--surface-2); padding: 10px 14px; margin-bottom: 12px; }
.fix-changes .fix-title { margin: 2px 0 8px; font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.fix-changes .fix-row { display: flex; gap: 10px; align-items: baseline; padding: 4px 0; font-size: 13px; color: var(--text-2); }
.fix-changes .fix-row + .fix-row { border-top: 1px dashed var(--border-2); }
.fix-changes .fix-row b { flex: 0 0 auto; color: var(--accent); font-variant-numeric: tabular-nums; }

/* ============ 2026-10-29-bg：限位改台词开关＋逐句对照表 ============ */
#fixDlgToggleWrap { display: inline-flex; align-items: flex-start; gap: 7px; margin: 4px 0 12px; font-size: 12.5px; color: var(--text-2); cursor: pointer; line-height: 1.5; }
#fixDlgToggleWrap input[type="checkbox"] { margin-top: 2px; accent-color: var(--accent); cursor: pointer; }
.fix-dlg-diff { border: 1px dashed #e5b8b3; border-radius: 9px; background: var(--danger-soft); padding: 10px 14px; margin-bottom: 12px; }
.fix-dlg-diff .fd-title { margin: 2px 0 8px; font-size: 12.5px; font-weight: 650; color: var(--text); }
.fix-dlg-diff .fd-row { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-size: 12.5px; }
.fix-dlg-diff .fd-row + .fd-row { border-top: 1px dashed #e8c4bf; }
.fix-dlg-diff .fd-no { flex: 0 0 auto; font-weight: 650; color: var(--danger); font-variant-numeric: tabular-nums; min-width: 52px; }
.fix-dlg-diff .fd-delta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fix-dlg-diff .fd-old { color: var(--danger); text-decoration: line-through; word-break: break-all; }
.fix-dlg-diff .fd-new { color: var(--ok); font-weight: 600; word-break: break-all; }

/* ============ 2026-10-16-k：改编页「目标成片时长」步进器 ＋ 分镜质检黄标 ============ */
/* k2 重设计：一行式 · 胶囊步进器（圆形按钮＋主色数值框） */
.dur-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 14px 0 16px; padding: 12px 16px; border: 1px solid var(--border-2); border-radius: 12px; background: var(--surface); }
.dur-label { font-size: 13.5px; font-weight: 650; color: var(--text); flex: 0 0 auto; }
.stepper { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.stepper-btn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font-size: 16px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: border-color .15s, color .15s, background .15s; }
.stepper-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.stepper-btn:disabled { opacity: .35; cursor: not-allowed; }
.stepper-val { display: inline-flex; align-items: baseline; gap: 4px; min-width: 74px; justify-content: center; padding: 5px 12px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--accent); }
.stepper-val b { font-size: 18px; font-weight: 750; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1; }
.stepper-val i { font-style: normal; font-size: 12px; color: var(--text-2); }
.dur-hint { font-style: normal; font-size: 12px; line-height: 1.6; color: var(--muted); flex: 1 1 260px; min-width: 220px; }

.unit-warnbadge { flex: 0 0 auto; background: #fdf1df; color: var(--warn); border: 1px solid #f0cfa0; border-radius: 999px; padding: 1px 9px; font-size: 11.5px; font-weight: 650; cursor: help; }
.unit-warns { margin-top: 8px; border: 1px solid #f0cfa0; background: #fdf6ea; border-radius: 9px; padding: 7px 12px; }
.unit-warns p { margin: 3px 0; font-size: 12.5px; line-height: 1.55; color: var(--warn); }

/* ============ 模型资费页（独立页签 · 仅展示，2026-10-22-d：对齐参考站表格版式） ============ */
/* 每个服务商一张四列表格：模型/ID｜计费单价｜时长/分辨率｜画幅；带价排前、无价（—）排后 */
.pricing-list { margin: 14px 0 4px; display: flex; flex-direction: column; gap: 18px; }
/* 模型资费 · 卡片版式（2026-10-30-bk，参考蝶站模型广场并本地化：chips 筛选 + 排序下拉 + 规格标签卡） */
.pm-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pm-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.pm-chip { border: 1px solid var(--border-2); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; }
.pm-chip i { font-style: normal; color: var(--muted); font-size: 11px; margin-left: 2px; }
.pm-chip:hover { border-color: var(--accent); color: var(--accent); }
.pm-chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.pm-chip.active i { color: var(--accent); }
.pm-sort { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.pm-sort select { font-size: 12.5px; padding: 4px 8px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface); color: var(--text); }
.pm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.pm-card { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; transition: box-shadow .15s, border-color .15s; }
.pm-card:hover { border-color: var(--border-2); box-shadow: var(--shadow); }
.pm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.pm-name { font-weight: 650; color: var(--text); font-size: 13.5px; line-height: 1.4; word-break: break-all; }
.pm-billing { flex: none; font-size: 11px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; }
.pm-price { color: var(--accent); font-weight: 800; font-size: 21px; font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.pm-price.is-free { color: var(--muted); font-weight: 600; font-size: 15px; }
.pm-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.pm-tags i { font-style: normal; font-size: 11px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; }
.pm-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 11.5px; color: var(--muted); }
.pm-id { font-family: var(--mono); font-size: 10.5px; word-break: break-all; text-align: right; }
.pd-empty { margin: 4px 0; font-size: 12.5px; color: var(--muted); }
.pd-note { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.6; border-top: 1px solid var(--border); padding-top: 10px; }

/* 全局轻提示（2026-10-23-g）：右下角浮出，任何页签都可见——刷新续接等跨页签提示用 */
.sj-toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 4000;
  max-width: 420px; padding: 11px 15px; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-2); box-shadow: var(--shadow), 0 10px 30px -10px rgba(20,22,28,.22);
  font-size: 13px; line-height: 1.65; cursor: pointer;
  animation: sjToastIn .22s ease-out;
}
.sj-toast.err { border-color: var(--danger); color: var(--danger); }
.sj-toast.out { opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; }
@keyframes sjToastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------- 批量导入分镜 / 采集分镜（2026-10-25-a） ---------------- */
.sbi-mask { position: fixed; inset: 0; z-index: 9000; background: rgba(10,12,20,.5); display: flex; align-items: center; justify-content: center; padding: 24px; }
.sbi-panel { background: var(--surface); color: var(--text); border-radius: var(--radius); box-shadow: var(--shadow-pop); width: min(900px, 100%); max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; }
.sbi-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.sbi-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.sbi-close { border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--muted); padding: 2px 8px; }
.sbi-body { padding: 16px 18px; overflow: auto; font-size: 13px; line-height: 1.6; }
.sbi-tabs { display: flex; gap: 8px; padding: 10px 18px 0; border-bottom: 1px solid var(--border); }
.sbi-tab { border: 1px solid var(--border); border-bottom: 0; background: var(--surface-2); color: var(--text-2); padding: 7px 14px; border-radius: 8px 8px 0 0; cursor: pointer; font-size: 13px; }
.sbi-tab.active { background: var(--surface); color: var(--text); font-weight: 600; border-color: var(--border-2); }
.sbi-hint { color: var(--muted); font-size: 12px; margin: 6px 0 10px; }
.sbi-drop { border: 1.5px dashed var(--border-2); border-radius: var(--radius-sm); padding: 18px; text-align: center; color: var(--muted); background: var(--surface-2); }
.sbi-drop.sbi-dragover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.sbi-ta { width: 100%; min-height: 110px; resize: vertical; border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 8px 10px; font: 12px var(--mono); color: var(--text); background: var(--surface); }
.sbi-btnrow { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.sbi-tbl { width: 100%; border-collapse: collapse; font-size: 12px; margin: 8px 0; }
.sbi-tbl th, .sbi-tbl td { border: 1px solid var(--border); padding: 4px 8px; text-align: left; }
.sbi-tbl th { background: var(--surface-2); font-weight: 600; }
.sbi-badge { display: inline-block; padding: 0 6px; border-radius: 6px; font-size: 11px; }
.sbi-badge.ok { background: var(--ok-soft); color: var(--ok); }
.sbi-badge.noimg { background: #fdf3e0; color: var(--warn); }
.sbi-badge.dup { background: var(--accent-soft); color: var(--accent); }
.sbi-stat { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0; color: var(--text-2); }
.sbi-bm { border: 1px dashed var(--border-2); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface-2); margin: 8px 0; }
.sbi-bm a { color: var(--accent); font-weight: 600; text-decoration: none; }
.sbi-err { background: var(--danger-soft); color: var(--danger); border-radius: var(--radius-sm); padding: 8px 12px; margin: 8px 0; white-space: pre-wrap; }
.sbi-vp { white-space: pre-wrap; max-height: 150px; overflow: auto; font-size: 12px; line-height: 1.55; min-width: 260px; }
.sbi-units { max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); margin: 8px 0; }
.sbi-units .sbi-tbl { margin: 0; }
.sbi-units summary { cursor: pointer; padding: 6px 2px; color: var(--text-2); }
