/* AI剧制作平台 设计系统：暗色侧栏 + 浅色工作区、单一强调色（樱桃红）、4/8 间距、圆角 10 / 7、系统字体。11-06 重做的部分在文件末尾「界面重做」一节 */
:root {
  /* 11-06 界面重做：暗色「放映间」侧栏 + 浅色工作区，图和视频放在深色底框里像看片；强调色是樱桃红（女性向言情短剧），只给主按钮、当前位置和选中态用 */
  --ink: #211c25;            /* 侧栏底 */
  --ink-2: #2d2732;          /* 侧栏悬停 */
  --ink-3: #3a333f;          /* 侧栏分隔、边框 */
  --ink-text: #efe9f2;
  --ink-text-2: #a9a0b2;
  --mat: #19161c;            /* 图片、视频的底框 */
  --bg: #f3f2f5;
  --surface: #ffffff;
  --surface-2: #f3f1f5;
  --border: #e5e2e9;
  --border-strong: #cfc9d5;
  --text: #1c1821;
  --text-2: #4e4756;
  --text-3: #756e7e;
  --accent: #c2255c;
  --accent-hover: #a31a4b;
  --accent-soft: #fbebf1;
  --accent-line: #f1c4d5;
  --ok: #1b7d45;
  --ok-soft: #e5f4ea;
  --ok-line: #b9e0c7;
  --warn: #a65a00;
  --warn-soft: #fcf1e0;
  --warn-line: #f0d3a6;
  --danger: #c8302b;
  --danger-soft: #fbeae9;
  --danger-line: #f1c0bd;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(33, 28, 37, .05), 0 4px 14px rgba(33, 28, 37, .06);
  --shadow-lg: 0 18px 48px rgba(33, 28, 37, .24);
  --sidebar: 240px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.55 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; line-height: 28px; margin: 0; font-weight: 600; }
h2 { font-size: 16px; line-height: 24px; margin: 0; font-weight: 600; }
h3 { font-size: 14px; line-height: 20px; margin: 0; font-weight: 600; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.row { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: var(--s3); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: var(--s3); }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }

/* ---------- 框架：左侧栏 + 主区 ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.shell.collapsed { --sidebar: 64px; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
.sidebar-head { display: flex; align-items: center; gap: var(--s2); padding: var(--s3); border-bottom: 1px solid var(--border); }
.brand { font-weight: 700; font-size: 15px; white-space: nowrap; color: var(--text); }
.sidebar-body { flex: 1; overflow-y: auto; padding: var(--s2); }
.sidebar-foot { border-top: 1px solid var(--border); padding: var(--s2); }
.nav-section { margin-top: var(--s3); }
.nav-label { font-size: 11px; color: var(--text-3); padding: var(--s1) var(--s2); letter-spacing: .02em; }
.nav-item { display: flex; align-items: center; gap: var(--s2); padding: 6px var(--s2); border-radius: var(--radius-sm); color: var(--text-2); cursor: pointer; white-space: nowrap; text-decoration: none; position: relative; }
.nav-item:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item .ico { width: 18px; text-align: center; flex: none; }
.nav-item .count { margin-left: auto; }
.nav-sub { margin-left: 26px; border-left: 1px solid var(--border); padding-left: var(--s1); }
.nav-sub .nav-item { padding: 4px var(--s2); font-size: 13px; }
.shell.collapsed .label, .shell.collapsed .nav-label, .shell.collapsed .nav-sub, .shell.collapsed .project-switch .label, .shell.collapsed .count { display: none; }
.shell.collapsed .nav-item { justify-content: center; }

.project-switch { position: relative; }
.project-switch-btn { width: 100%; display: flex; align-items: center; gap: var(--s2); padding: var(--s2); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; font: inherit; color: var(--text); text-align: left; }
.project-switch-btn:hover { border-color: var(--border-strong); }
.project-switch-btn .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.menu { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: var(--s2); }
.menu input { margin-bottom: var(--s2); }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; }
.menu-list { max-height: 280px; overflow-y: auto; }
.menu-item { display: block; padding: 6px var(--s2); border-radius: var(--radius-sm); color: var(--text); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-item:hover, .menu-item.active { background: var(--surface-2); text-decoration: none; }
.menu-foot { border-top: 1px solid var(--border); margin-top: var(--s2); padding-top: var(--s2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(243, 242, 245, .9); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); padding: var(--s3) var(--s5); display: flex; align-items: center; gap: var(--s3); min-height: 59px; box-sizing: border-box; }
.crumbs { display: flex; align-items: center; gap: var(--s2); color: var(--text-3); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; }
.crumbs a { color: var(--text-2); }
.crumbs .sep { color: var(--border-strong); }
.crumbs .current { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.content { padding: var(--s5); max-width: 1440px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s4); flex-wrap: wrap; }
.page-head p { margin: var(--s1) 0 0; color: var(--text-3); }

/* ---------- 按钮 ---------- */
.btn { font: inherit; font-size: 13px; line-height: 20px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--border-strong); background: var(--surface-2); text-decoration: none; }
.btn:focus-visible, .nav-item:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-text { border-color: transparent; background: transparent; color: var(--text-2); padding: 6px 8px; }
.btn-text:hover { background: var(--surface-2); border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger-soft); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: 3px 8px; font-size: 12px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn.busy { cursor: progress; }
.spinner { width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { border: none; background: transparent; cursor: pointer; padding: 6px; border-radius: var(--radius-sm); color: var(--text-2); font-size: 16px; line-height: 1; }
.icon-btn:hover { background: var(--surface-2); }
.est { font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* ---------- 表单 ---------- */
input, textarea, select { font: inherit; font-size: 13px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); width: 100%; }
input:hover, textarea:hover, select:hover { border-color: var(--border-strong); }
textarea { min-height: 72px; resize: vertical; line-height: 1.6; }
input[type="checkbox"], input[type="radio"] { width: auto; }
.field { display: flex; flex-direction: column; gap: var(--s1); }
.field > span { font-size: 12px; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.check { display: flex; align-items: center; gap: var(--s2); font-size: 13px; color: var(--text-2); cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s3); }

/* ---------- 卡片、徽标、状态点 ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s4); }
.card.flat { box-shadow: none; }
.card-click { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.card-click:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; line-height: 20px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--border-strong); }
.dot.running { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.dot.done { background: var(--ok); }
.dot.stale { background: var(--danger); }
.dot.todo { background: var(--border-strong); }
.count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--surface); }
.avatars { display: flex; }
.avatars .avatar + .avatar { margin-left: -6px; }

/* ---------- 图片框 ---------- */
.frame { position: relative; background: var(--surface-2); border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.frame img, .frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.frame.cover img { object-fit: cover; }
.frame.r16x9 { aspect-ratio: 16 / 9; }
.frame.r9x16 { aspect-ratio: 9 / 16; }
.frame.r4x3 { aspect-ratio: 4 / 3; }
.frame.r3x4 { aspect-ratio: 3 / 4; }
.frame.r1x1 { aspect-ratio: 1 / 1; }
.frame .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); font-size: 12px; text-align: center; padding: var(--s3); }
.frame.zoom { cursor: zoom-in; }
.frame .overlay { position: absolute; left: var(--s2); top: var(--s2); display: flex; gap: 4px; flex-wrap: wrap; }

/* ---------- 标签页 ---------- */
.tabs { display: flex; gap: var(--s1); border-bottom: 1px solid var(--border); margin-bottom: var(--s4); }
.tab { padding: var(--s2) var(--s3); color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; background: none; border-top: none; border-left: none; border-right: none; font: inherit; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab .n { color: var(--text-3); font-weight: 400; }

/* ---------- 网格 ---------- */
.cards { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.stats { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s3) var(--s4); }
.stat b { display: block; font-size: 22px; line-height: 30px; }
.stat span { color: var(--text-3); font-size: 12px; }

/* ---------- 七步进度 ---------- */
.steps { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--s2); }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s3); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.step .num { font-size: 12px; color: var(--text-3); }
.step b { font-size: 13px; }
.step .info { font-size: 12px; color: var(--text-2); }
.step.done { border-color: var(--ok-line); }
.step.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.step.skipped { opacity: .55; }
.next-box { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--radius); padding: var(--s4); }
.next-box .t { font-weight: 600; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--surface); }
.table th { text-align: left; font-weight: 500; color: var(--text-3); font-size: 12px; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 0; }
.table td { padding: var(--s2) var(--s3); border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: none; }
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; }
.table td[contenteditable="true"] { outline: none; cursor: text; }
.table td[contenteditable="true"]:hover { background: var(--surface-2); }
.table td[contenteditable="true"]:focus { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.table td.locked { color: var(--text-2); background: var(--surface-2); }

/* ---------- 人物分组 ---------- */
.person { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: var(--s4); align-items: start; }
.person-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-top: var(--s2); }
.outfits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
@media (max-width: 1180px) { .outfits { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.outfit .name { font-size: 13px; font-weight: 600; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }

/* ---------- 分段卡片 ---------- */
.segment { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: var(--s3); scroll-margin-top: 72px; }
.segment.target { box-shadow: 0 0 0 2px var(--accent); }
.segment-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); cursor: pointer; }
.segment-head .title { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.segment-body { border-top: 1px solid var(--border); padding: var(--s4); display: grid; grid-template-columns: 1fr; gap: var(--s5); }
.segment-media { display: grid; grid-template-columns: repeat(auto-fill, 280px); gap: var(--s5); align-items: start; }
.table.panels th, .table.panels td { min-width: 96px; }
.table.panels th:first-child, .table.panels td:first-child { min-width: 24px; }
.table.panels td.num, .table.panels th.num { min-width: 56px; }
.chev { transition: transform .15s; color: var(--text-3); }
.segment.open .chev { transform: rotate(90deg); }
.review { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(200px, 1fr) minmax(240px, 1fr); gap: var(--s4); }
.note { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--s2); display: flex; gap: var(--s2); align-items: flex-start; }
.note.resolved { opacity: .55; }
.note.resolved .text { text-decoration: line-through; }

/* ---------- 弹窗、抽屉、看大图、提示条 ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(25, 20, 28, .42); z-index: 50; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { position: fixed; z-index: 51; left: 50%; top: 12vh; transform: translateX(-50%); width: min(520px, calc(100vw - 32px)); background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; max-height: 76vh; }
.modal-head, .drawer-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); }
.modal-body { padding: var(--s5); overflow-y: auto; display: flex; flex-direction: column; gap: var(--s3); }
.modal-foot { padding: var(--s3) var(--s5); border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: var(--s2); }
.drawer { position: fixed; z-index: 51; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: .6; } }
.drawer-body { flex: 1; overflow-y: auto; padding: var(--s5); display: flex; flex-direction: column; gap: var(--s4); }
.drawer-body > *, .modal-body > * { flex-shrink: 0; }
.title-row { display: flex; gap: var(--s2); align-items: center; justify-content: space-between; }
.title-row > :first-child { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-row > .badge { flex-shrink: 0; }
.drawer-foot { padding: var(--s3) var(--s5); border-top: 1px solid var(--border); display: flex; gap: var(--s2); flex-wrap: wrap; }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(18, 14, 20, .92); display: grid; place-items: center; cursor: zoom-out; }
.lightbox img { max-width: 94vw; max-height: 92vh; object-fit: contain; }
.toasts { position: fixed; right: var(--s5); bottom: var(--s5); z-index: 70; display: flex; flex-direction: column; gap: var(--s2); align-items: flex-end; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--radius); box-shadow: var(--shadow-lg); max-width: 420px; display: flex; gap: var(--s2); align-items: flex-start; animation: slide .18s; }
.toast.ok::before { content: "✓"; color: #6ee7a0; }
.toast.err::before { content: "!"; color: #fca5a5; font-weight: 700; }

/* ---------- 骨架屏、空状态 ---------- */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, #e8e5ec 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--radius); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.empty { text-align: center; padding: var(--s6) var(--s4); border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text-2); }
.empty .t { font-weight: 600; color: var(--text); margin-bottom: var(--s1); }
.empty .btn { margin-top: var(--s3); }

/* ---------- 登录 ---------- */
.login { min-height: 100vh; display: grid; place-items: center; }
.login .card { width: 360px; padding: var(--s6); }

@media (max-width: 1180px) {
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .review { grid-template-columns: 1fr 1fr; }
  .person { grid-template-columns: 1fr; }
}
@media (max-width: 1060px) {
  .segment-body { grid-template-columns: 1fr; }
  .content { padding: var(--s4); }
}

/* ---------- 图标、按钮副标题、更多菜单 ---------- */
.i { flex: none; display: block; }
.btn .i { width: 15px; height: 15px; }
.btn-sm .i { width: 13px; height: 13px; }
.btn-sub { font-size: 11px; font-weight: 400; opacity: .7; margin-left: 2px; }
.btn-sub::before { content: "· "; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; }
.nav-item .ico { display: inline-flex; justify-content: center; align-items: center; }
.empty-ico { display: inline-flex; width: 48px; height: 48px; border-radius: 50%; background: var(--surface-2); color: var(--text-3); align-items: center; justify-content: center; margin-bottom: var(--s2); }
.more { position: relative; display: inline-flex; }
.more-menu { position: absolute; top: calc(100% + 4px); left: auto; right: 0; width: max-content; min-width: 200px; z-index: 40; display: flex; flex-direction: column; gap: 2px; }
.more.left .more-menu { left: 0; right: auto; }
.more-menu[hidden] { display: none; }
.more-menu .btn { border: none; background: transparent; justify-content: flex-start; width: 100%; padding: 6px 10px; }
.more-menu .btn:hover { background: var(--surface-2); }
.more-menu .btn-primary { color: var(--text); }
.more-menu .btn-danger:hover { background: var(--danger-soft); }
.more-menu .sep { height: 1px; background: var(--border); margin: 4px 0; }
.chev { display: inline-flex; }
.lightbox video { max-width: 94vw; max-height: 92vh; background: #000; cursor: default; }
.table.panels.compact .extra { display: none; }
.thumbs { display: inline-flex; gap: 6px; margin-left: var(--s2); }
.thumb { position: relative; width: 36px; height: 64px; border-radius: 4px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); cursor: zoom-in; flex: none; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.thumb .play { position: absolute; right: 2px; bottom: 2px; background: rgba(0, 0, 0, .6); color: #fff; border-radius: 3px; padding: 1px; display: inline-flex; }
.thumb:hover { box-shadow: 0 0 0 2px var(--accent); }
.add-card { display: flex; align-items: center; justify-content: center; gap: var(--s2); width: 100%; padding: var(--s4); border: 1px dashed var(--border-strong); border-radius: var(--radius); background: transparent; color: var(--text-2); font: inherit; cursor: pointer; }
.add-card:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------- 右侧任务栏 ---------- */
.shell { grid-template-columns: var(--sidebar) minmax(0, 1fr) 0; }
.shell.tasks-open { grid-template-columns: var(--sidebar) minmax(0, 1fr) 340px; }
.taskbar { display: none; }
.shell.tasks-open .taskbar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; border-left: 1px solid var(--border); background: var(--surface); min-width: 0; }
.taskbar-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s3) var(--s4); min-height: 59px; box-sizing: border-box; border-bottom: 1px solid var(--border); }
.taskbar-body { flex: 1; overflow-y: auto; padding: var(--s3); display: flex; flex-direction: column; gap: var(--s2); }
.task-group { font-size: 12px; color: var(--text-3); margin: var(--s2) 0 0; }
.task-empty { padding: var(--s2); }
.task { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s2) var(--s3); display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.task.running { border-color: var(--warn-line); background: #fffbf4; }
.task.failed { border-color: var(--danger-soft); }
.task-main { color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: 3px; }
.task-main:hover { text-decoration: none; }
.task-main:hover .task-label { color: var(--accent); }
.task-top { display: flex; gap: var(--s2); align-items: flex-start; justify-content: space-between; }
.task-label { font-size: 13px; font-weight: 500; min-width: 0; }
.task-top .badge { flex: none; }
.task-msg { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--text-2); }
.task-err { font-size: 12px; color: var(--danger); }
.task .btn { align-self: flex-start; }
.task-toggle { display: flex; }
.task-toggle .btn.active { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); }
.task-toggle .count { background: var(--accent); color: #fff; border-radius: 999px; font-size: 11px; line-height: 16px; min-width: 16px; padding: 0 5px; text-align: center; }
@media (max-width: 1100px) { .shell.tasks-open { grid-template-columns: var(--sidebar) minmax(0, 1fr) 300px; } }

/* ---------- 版本角标和版本列表 ---------- */
.ver-badge { display: inline-flex; align-items: center; gap: 4px; border: none; border-radius: 999px; padding: 2px 8px; font: inherit; font-size: 11px; line-height: 16px; cursor: pointer; background: rgba(17, 17, 24, .72); color: #fff; white-space: nowrap; }
.ver-badge:hover { background: var(--accent); }
.segment-head .ver-badge { background: var(--accent-soft); color: var(--accent); }
.segment-head .ver-badge:hover { background: var(--accent); color: #fff; }
.version { padding: 8px; }
.version.current { box-shadow: 0 0 0 2px var(--accent); }
.frame .overlay .ver-badge { pointer-events: auto; }
.project-card { position: relative; }
.project-card .card-menu { position: absolute; top: 8px; right: 8px; z-index: 2; }
.project-card .card-menu .btn[data-more] { background: rgba(255, 255, 255, .92); padding: 4px 6px; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); border: 1px solid var(--danger-soft); border-radius: var(--radius); padding: var(--s3); margin-top: var(--s3); }
.project-card > a.card { display: block; height: 100%; }
.direction { background: var(--accent-soft); border-radius: var(--radius); padding: var(--s2) var(--s3); display: flex; flex-direction: column; gap: 2px; }

/* ---------- 剧本原文对照 ---------- */
.seg-split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--s4); align-items: start; }
.seg-split.collapsed { grid-template-columns: 36px minmax(0, 1fr); }
.script-pane { position: sticky; top: 72px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); max-height: calc(100vh - 96px); display: flex; flex-direction: column; min-width: 0; }
.script-pane-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 12px; border-bottom: 1px solid var(--border); }
.script-pane-body { overflow-y: auto; padding: var(--s2) var(--s3); font-size: 13px; line-height: 1.6; }
.script-pane-body p { margin: 0 0 8px; color: var(--text-2); }
.script-pane-body p.dlg { color: var(--text); background: #fff4c2; border-left: 3px solid #e3b400; padding: 2px 6px; border-radius: 4px; }
.script-pane-body p.heading { font-weight: 600; color: var(--text); }
.seg-split.collapsed .script-pane { writing-mode: vertical-rl; }
.seg-split.collapsed .script-pane-body, .seg-split.collapsed .script-pane-head b { display: none; }
.seg-split.collapsed .script-pane-head { border: none; padding: 6px; justify-content: center; }
@media (max-width: 1100px) { .seg-split, .seg-split.collapsed { grid-template-columns: minmax(0, 1fr); } .script-pane { position: static; max-height: 240px; } }

/* ---------- 整集播放器 ---------- */
.ep-player { margin-bottom: var(--s4); padding: var(--s3); }
.ep-player-main { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--s4); align-items: start; }
.ep-player-video video:not(.ep-preload) { background: #000; }
.ep-player-side { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.ep-timeline { display: flex; gap: 4px; }
.ep-tl-item { min-width: 0; border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius-sm); padding: 6px 4px; font: inherit; font-size: 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; color: var(--text-2); }
.ep-tl-item small { color: var(--text-3); }
.ep-tl-item.playing { background: var(--accent); border-color: var(--accent); color: #fff; }
.ep-tl-item.playing small { color: rgba(255, 255, 255, .8); }
.ep-tl-item.missing { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 4px, #fff 4px, #fff 8px); cursor: not-allowed; opacity: .7; }
.ep-tl-item.stale { border-color: #e3b400; }
.segment.playing { box-shadow: 0 0 0 2px #e3b400; }
@media (max-width: 1100px) { .ep-player-main { grid-template-columns: 1fr; } .ep-player-video { max-width: 280px; } }
.ep-player-video { position: relative; width: 240px; aspect-ratio: 9 / 16; background: #000; border-radius: var(--radius-sm); overflow: hidden; }
.ep-player-video video:not(.ep-preload) { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.ep-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 6px; border: none; border-radius: 16px; padding: 14px 18px; background: rgba(0, 0, 0, .55); color: #fff; font: inherit; font-size: 13px; cursor: pointer; }
.ep-play:hover { background: var(--accent); }
.ep-play[hidden] { display: none; }
.ep-time { position: absolute; left: 8px; top: 8px; display: flex; gap: 6px; font-size: 11px; color: #fff; pointer-events: none; }
.ep-time span { background: rgba(0, 0, 0, .55); border-radius: 4px; padding: 2px 6px; }
#playerSlot { padding: var(--s5) var(--s5) 0; max-width: 1440px; }
#playerSlot:empty { display: none; }
#playerSlot .ep-player { margin-bottom: 0; }
.intake { margin-bottom: var(--s4); border-color: #e3b400; background: #fffcf0; }
.intake tr.new td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.intake select { width: auto; max-width: 260px; }
.nav-add { color: var(--accent); }
.director-review { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s2) var(--s3); background: var(--surface-2); }
.director-review ul { margin: 8px 0 0 18px; padding: 0; font-size: 13px; }
.principle.pending { border-color: #e3b400; }
.principle.disabled { opacity: .6; }
.pr-bad { background: var(--danger-soft); border-radius: var(--radius-sm); padding: 6px 8px; }
.pr-good { background: #e8f6ec; border-radius: var(--radius-sm); padding: 6px 8px; }

/* ---------- 引导式流程：顶部步骤条、主按钮、进度面板 ---------- */
#flowBar { padding: var(--s3) var(--s5) 0; max-width: 1440px; width: 100%; }
.flow-bar { display: flex; gap: var(--s4); align-items: flex-start; justify-content: space-between; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.flow-steps { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-width: 0; }
.flow-step { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 3px 8px 3px 4px; font-size: 12px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.flow-step .n { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: #eef0f4; font-size: 11px; color: var(--text-3); }
.flow-step.done { border-color: #b9e2c4; color: var(--ok); }
.flow-step.done .n { background: var(--ok-soft); color: var(--ok); }
.flow-step.running { border-color: var(--accent); color: var(--accent); }
.flow-step.waiting { border-color: #f1c27d; background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.flow-step.waiting .n { background: #fde3b8; color: var(--warn); }
.flow-step.failed { border-color: #f3b4b4; background: var(--danger-soft); color: var(--danger); }
.flow-step.blocked { opacity: .55; }
.flow-step .spinner { width: 10px; height: 10px; }
.flow-auto { font-size: 10px; background: var(--warn-soft); color: var(--warn); border-radius: 4px; padding: 0 4px; }
.flow-sep { font-size: 11px; color: var(--text-3); padding: 0 4px; border-left: 1px solid var(--border); margin-left: 4px; }
.flow-main { flex: none; max-width: 420px; }
.flow-next { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.flow-desc { text-align: right; max-width: 400px; }
.menu-label { font-size: 11px; color: var(--text-3); padding: 6px 10px 2px; }
@media (max-width: 1100px) { .flow-bar { flex-direction: column; } .flow-main, .flow-desc { max-width: none; text-align: left; } .flow-next { align-items: flex-start; } }
.prog-step { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.prog-step .n { flex: none; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; background: #eef0f4; color: var(--text-3); }
.prog-step.done .n { background: var(--ok-soft); color: var(--ok); }
.prog-step.waiting .n { background: var(--warn-soft); color: var(--warn); }
.prog-step.failed .n { background: var(--danger-soft); color: var(--danger); }
.prog-step.running .n { background: var(--accent-soft); color: var(--accent); }
.prog-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.prog-seg { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; }
.prog-bar { height: 6px; background: #eef0f4; border-radius: 3px; overflow: hidden; margin-top: 4px; }
.prog-bar > i { display: block; height: 100%; background: var(--accent); }
.scene-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 18px 0 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.scene-head.waiting { border-color: #f1c27d; background: var(--warn-soft); }
.scene-head .t { font-weight: 600; }
.review-actions { display: flex; gap: 6px; flex-wrap: wrap; }
#flowBar:empty { display: none; }
/* 分段卡片：资产条、镜头列表、页签 */
.asset-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.asset-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 8px; padding: 3px 8px 3px 3px; background: #fff; color: inherit; text-decoration: none; max-width: 260px; position: relative; }
.asset-chip:hover { border-color: var(--accent); }
.asset-chip img, .asset-chip .ph { width: 44px; height: 26px; object-fit: cover; border-radius: 5px; background: #eef0f4; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.asset-chip .t { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.asset-chip .t b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-chip .t small { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-chip.group { background: #f7f7fb; border-style: dashed; padding-left: 8px; }
.asset-chip.missing { border-color: #f3b4b4; }
.asset-chip .flag { font-size: 10px; border-radius: 4px; padding: 0 4px; }
.asset-chip .flag.danger { background: var(--danger-soft); color: var(--danger); }
.asset-chip .flag.warn { background: var(--warn-soft); color: var(--warn); }
.seg-video { max-width: 260px; margin-bottom: 10px; }
.shot-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.shot + .shot { border-top: 1px solid var(--border); }
.shot-line { display: flex; gap: 8px; align-items: baseline; padding: 6px 10px; cursor: pointer; font-size: 13px; }
.shot-line:hover { background: #f7f7fb; }
.shot-line .n { color: var(--text-3); width: 18px; flex: none; }
.shot-line .tc { color: var(--text-3); font-variant-numeric: tabular-nums; flex: none; width: 44px; }
.shot-line .sz { flex: none; width: 110px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shot-line .ac { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shot-line .dl { flex: none; max-width: 32%; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shot-line .du { flex: none; color: var(--text-3); }
.shot.open .shot-line { background: var(--accent-soft); }
.shot-full { padding: 8px 10px 12px 36px; display: grid; gap: 6px; background: #fbfbfd; }
.shot-full .kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px; font-size: 13px; }
.shot-full .kv > span { color: var(--text-3); }
.shot-full [contenteditable] { border: 1px solid transparent; border-radius: 4px; padding: 1px 4px; }
.shot-full [contenteditable]:hover, .shot-full [contenteditable]:focus { border-color: var(--border); background: #fff; outline: none; }
.shot-full .locked { color: var(--text-2); }
.seg-tabs { margin-top: 10px; }
.seg-tabs .tabs { margin-bottom: 0; }
.seg-tab-body { border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); padding: 10px 12px; }
.seg-prompt { white-space: pre-wrap; font-size: 12px; max-height: 420px; overflow: auto; margin: 0; }
.scene-draft { margin-bottom: 12px; border-color: var(--accent); }
.segment-head .chev, .segment-head .title, .segment-head > .badge { cursor: pointer; }
.ep-progress .ep-row { display: grid; grid-template-columns: 44px minmax(90px, 200px) minmax(120px, 240px) 1fr auto; gap: 12px; align-items: center; color: inherit; text-decoration: none; padding: 6px 0; border-top: 1px solid var(--border); }
.ep-progress .ep-row:first-of-type { border-top: 0; }
.ep-progress .bar { height: 8px; border-radius: 4px; background: var(--accent-soft); overflow: hidden; }
.ep-progress .bar i { display: block; height: 100%; background: var(--accent); }
@media (max-width: 700px) { .ep-progress .ep-row { grid-template-columns: 44px 1fr; gap: 4px 10px; } .ep-progress .ep-row > :nth-child(n+3) { grid-column: 2; } }
.flow-impact { cursor: pointer; border: 0; font: inherit; font-size: 12px; }
.asset-chip { font: inherit; text-align: left; cursor: zoom-in; }
.lightbox.overlay { cursor: default; }
.asset-preview .ap-card { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 94vw; }
.asset-preview .ap-media img { max-width: 92vw; max-height: 78vh; object-fit: contain; display: block; border-radius: 6px; }
.asset-preview .ap-text { background: var(--panel, #fff); color: var(--fg, #222); border-radius: 8px; padding: 18px 22px; min-width: 320px; max-width: 560px; line-height: 1.7; }
.asset-preview .ap-foot { display: flex; align-items: center; gap: 14px; color: #fff; }
.asset-preview .ap-title { text-align: center; min-width: 240px; }
.asset-preview .ap-title .muted, .asset-preview .ap-title a { color: rgba(255, 255, 255, .75); }
.asset-preview .icon-btn { color: #fff; background: rgba(255, 255, 255, .12); border-radius: 50%; width: 40px; height: 40px; }
.asset-preview .icon-btn:disabled { opacity: .3; }
.shot-line .src { font-size: 11px; color: var(--muted, #888); white-space: nowrap; margin-left: 6px; }
.shot-line .flag, .scene-head .flag { margin-left: 6px; }
.flag { font-size: 11px; border-radius: 4px; padding: 0 5px; white-space: nowrap; }
.flag.danger { background: var(--danger-soft); color: var(--danger); }
.flag.warn { background: var(--warn-soft); color: var(--warn); }
.fav-star { border: 0; background: rgba(0, 0, 0, .45); color: #fff; border-radius: 50%; width: 30px; height: 30px; font-size: 17px; line-height: 30px; cursor: pointer; padding: 0; }
.fav-star.on { color: #f5b301; }
.version .fav-star, .ep-star .fav-star { background: transparent; color: var(--muted, #888); width: 24px; height: 24px; line-height: 24px; }
.version .fav-star.on, .ep-star .fav-star.on { color: #f5b301; }
.frame.has-star { position: relative; }
.fav-star.on-frame { position: absolute; top: 8px; right: 8px; z-index: 2; }
.task.download .prog-bar { margin: 6px 0 2px; }
.open-asks { padding: 6px 14px 8px; background: var(--warn-soft); border-top: 1px solid var(--border); font-size: 13px; display: grid; gap: 4px; }
.modal.wide, .wide.modal { width: min(1000px, 94vw); max-width: 94vw; }
.import-preview td { vertical-align: top; }

/* 画风选择：封面卡片网格，选中的高亮 */
.drawer.wide { width: min(760px, 100vw); }
.style-picker { display: flex; flex-direction: column; gap: var(--s2); }
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: var(--s2); }
.style-card { display: flex; flex-direction: column; gap: 4px; padding: 6px; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font: inherit; color: inherit; }
.style-card:hover { border-color: var(--accent); }
.style-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); background: var(--accent-soft); }
.style-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.style-cover { display: block; aspect-ratio: 3 / 4; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.style-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.style-cover-text { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 22px; font-weight: 600; color: var(--muted); }
.style-cover-custom { display: flex; align-items: center; justify-content: center; color: var(--accent); font-weight: 600; }
.style-card b { font-size: 13px; }
.style-desc { font-size: 12px; line-height: 1.35; color: var(--text-2); }
.style-custom-text { min-height: 72px; }

/* 侧栏分集：集名右边的下载小菜单 */
.nav-ep { display: flex; align-items: center; gap: 2px; }
.nav-ep > .nav-item { flex: 1; min-width: 0; }
.nav-ep > .more > .btn { border: none; background: transparent; padding: 4px; min-height: 0; color: var(--text-3); }
.nav-ep > .more > .btn:hover { color: var(--text); background: var(--surface-2); }
.shell.collapsed .nav-ep > .more { display: none; }

/* 侧栏分集多选：选中高亮、标题行（已选几集、全选）、底部批量栏、右键菜单 */
.nav-ep.selected > .nav-item { background: var(--accent-soft); color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); }
.nav-ep-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.nav-ep-tools { display: inline-flex; gap: var(--s2); }
.link-btn { border: none; background: none; padding: 0; font: inherit; font-size: 12px; color: var(--accent); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.shell.collapsed .nav-ep-tools { display: none; }
.batch-bar { border-top: 1px solid var(--border); padding: 6px var(--s2); background: var(--accent-soft); display: flex; flex-direction: column; gap: var(--s2); }
.batch-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.batch-actions .btn { justify-content: flex-start; width: 100%; min-width: 0; background: var(--surface); font-size: 12px; padding: 3px 6px; gap: 4px; }
.batch-actions .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-bar .spread .btn { padding: 2px 8px; }
.batch-bar .btn[aria-disabled="true"], .ctx-menu .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.shell.collapsed .batch-bar { display: none; }
.ctx-menu { position: fixed; z-index: 60; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 4px; }
.prog-group { margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.batch-cost td, .batch-cost th { white-space: nowrap; }

/* 停点：两步之间的小标记（看资产、看分镜、审片），不占步骤编号 */
.flow-step.flow-stop { border-style: dashed; padding: 2px 8px 2px 4px; background: transparent; }
.flow-step.flow-stop .n { background: transparent; font-size: 10px; }
.flow-step.flow-stop.waiting { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }

/* 项目文件夹（Bob 11-03） */
.folder-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: var(--s4); }
.chip { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); border-radius: 999px; padding: 2px 10px; font-size: 13px; line-height: 22px; cursor: pointer; }
.chip:hover { border-color: var(--text-3); }
.chip.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip small { opacity: .7; margin-left: 4px; }
.card-check { position: absolute; left: 10px; top: 10px; z-index: 2; background: var(--surface-2); border-radius: 6px; padding: 3px 5px; display: flex; }
.card-check input { width: 16px; height: 16px; margin: 0; }
.project-card.selected .card { outline: 2px solid var(--accent); }
.bulk-bar { position: sticky; bottom: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; margin-top: var(--s4); }

/* 待确认报价单（MCP 里 agent 报的价，任务栏里确认或拒绝） */
.task.quote { border-left: 3px solid var(--warn, #d97706); }
.btn .count.warn { background: var(--warn, #d97706); color: #fff; }

/* =====================================================================
   界面重做（11-06）
   参照：ui-ux-pro-max（GitHub 星数最高的界面设计 skill）的规则表——对比度 ≥4.5、焦点环、
   点击区域 ≥24px、一屏一个主按钮、语义色、间距 4/8、一致的阴影层级；
   Anthropic frontend-design——只在一处用力：暗色「放映间」侧栏 + 深色底的看片框，其余安静。
   ===================================================================== */
body { font-size: 14px; line-height: 1.6; font-variant-numeric: tabular-nums; }
h1 { font-size: 22px; line-height: 30px; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 16px; line-height: 24px; font-weight: 620; }
h3 { font-size: 14px; line-height: 21px; font-weight: 620; }
::selection { background: var(--accent-line); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---- 侧栏：暗色放映间 ---- */
.sidebar { background: var(--ink); border-right: none; color: var(--ink-text); }
.sidebar-head { border-bottom: 1px solid var(--ink-3); min-height: 59px; padding: var(--s3); }
.sidebar .brand { color: #fff; font-size: 15px; letter-spacing: .01em; display: inline-flex; align-items: center; gap: 8px; }
.sidebar .brand::before { content: ""; width: 18px; height: 18px; border-radius: 5px; flex: none;
  background: linear-gradient(135deg, var(--accent) 0 50%, #e2588a 50% 100%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.sidebar .icon-btn { color: var(--ink-text-2); }
.sidebar .icon-btn:hover { background: var(--ink-2); color: #fff; }
.sidebar-foot { border-top: 1px solid var(--ink-3); }
.sidebar .nav-label { color: var(--ink-text-2); font-size: 11.5px; padding: 10px var(--s2) 4px; letter-spacing: .04em; }
.sidebar .nav-item { color: var(--ink-text-2); padding: 7px var(--s2); border-radius: var(--radius-sm); }
.sidebar .nav-item:hover { background: var(--ink-2); color: #fff; }
.sidebar .nav-item.active { background: rgba(255, 255, 255, .09); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.sidebar .nav-item .count { background: var(--accent); }
.sidebar .nav-sub { border-left-color: var(--ink-3); }
.sidebar .nav-add { color: #f39bbb; }
.sidebar .nav-add:hover { color: #fff; }
.sidebar .nav-ep > .more > .btn { color: var(--ink-text-2); }
.sidebar .nav-ep > .more > .btn:hover { color: #fff; background: var(--ink-2); }
.sidebar .nav-ep.selected > .nav-item { background: rgba(194, 37, 92, .22); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.sidebar .dot.todo { background: #5d5563; }
.sidebar .dot.running { box-shadow: 0 0 0 3px rgba(166, 90, 0, .35); }
.sidebar .project-switch-btn { background: var(--ink-2); border-color: var(--ink-3); color: #fff; }
.sidebar .project-switch-btn:hover { border-color: #5a5160; }
.sidebar .project-switch-btn .muted { color: var(--ink-text-2); }
.sidebar .menu { color: var(--text); }
.sidebar .avatar { border-color: var(--ink); }
.sidebar .nav-item .label.grow { color: var(--ink-text); }
.sidebar .batch-bar { background: var(--ink-2); border-top-color: var(--ink-3); color: var(--ink-text); }
.sidebar .batch-bar .muted { color: var(--ink-text-2); }
.sidebar .batch-bar .btn, .sidebar .batch-actions .btn { background: var(--ink); border-color: var(--ink-3); color: var(--ink-text); }
.sidebar .batch-bar .btn:hover, .sidebar .batch-actions .btn:hover { background: var(--ink-3); color: #fff; }
.sidebar .nav-ep-tools a, .sidebar .nav-ep-tools .btn { color: var(--ink-text-2); }
.sidebar *:focus-visible { outline-color: #f39bbb; }
.sidebar-body::-webkit-scrollbar { width: 8px; }
.sidebar-body::-webkit-scrollbar-thumb { background: var(--ink-3); border-radius: 8px; }

/* ---- 顶栏、页头 ---- */
.topbar { padding: var(--s3) var(--s5); }
.content { padding: var(--s5) var(--s6) var(--s6); }
.page-head { margin-bottom: var(--s5); }
.page-head p { max-width: 78ch; line-height: 1.65; font-size: 13.5px; color: var(--text-2); }

/* ---- 按钮：一屏一个实心主按钮，其余白底描边；高度统一 32 / 26 ---- */
.btn { min-height: 32px; padding: 5px 12px; border-radius: var(--radius-sm); font-weight: 500; transition: background-color .12s, border-color .12s, color .12s, box-shadow .12s; }
.btn:active { transform: translateY(1px); }
.btn-primary { box-shadow: 0 1px 0 rgba(0, 0, 0, .08), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-sm { min-height: 26px; padding: 2px 9px; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; color: var(--text); }
.btn-danger:hover { border-color: var(--danger-line); }
.btn:focus-visible, .nav-item:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .tab:focus-visible, .card-click:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-btn { min-width: 28px; min-height: 28px; }

/* ---- 表单 ---- */
input, textarea, select { min-height: 34px; padding: 6px 10px; border-radius: var(--radius-sm); transition: border-color .12s, box-shadow .12s; }
textarea { min-height: 80px; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.field > span { font-weight: 500; color: var(--text-2); }
input[type="checkbox"], input[type="radio"] { min-height: 0; accent-color: var(--accent); }
input[type="file"] { min-height: 0; }

/* ---- 卡片：有边框不加阴影，可点的悬停时边框变色 ---- */
.card-click { transition: border-color .15s, box-shadow .15s; }
.card-click:hover { border-color: var(--accent-line); box-shadow: var(--shadow); }
.badge { font-weight: 500; }
.badge.muted { background: var(--surface-2); color: var(--text-3); }

/* ---- 看片框：图和视频都放在深色底上 ---- */
.frame { background: var(--mat); border-color: transparent; }
.frame .ph { color: #9a91a1; }
.thumb { background: var(--mat); border-color: transparent; }

/* ---- 弹窗、抽屉 ---- */
.modal { border-radius: 14px; }
.drawer.wide { width: min(760px, 100vw); }

/* ---- 空状态 ---- */
.empty { border-radius: 14px; padding: 40px var(--s4); }
.empty-ico { background: var(--accent-soft); color: var(--accent); }

/* ---- 登录页 ---- */
.login { background: radial-gradient(1200px 600px at 20% 0%, #3a2433 0%, var(--ink) 60%); }
.login .card { border: none; box-shadow: var(--shadow-lg); border-radius: 16px; }
.login h1::before { content: ""; display: inline-block; width: 20px; height: 20px; border-radius: 6px; margin-right: 10px; vertical-align: -3px;
  background: linear-gradient(135deg, var(--accent) 0 50%, #e2588a 50% 100%); }

/* ---- 主线进度条（项目页） ---- */
.flow-step { background: var(--surface); }
.flow-step .n { background: var(--surface-2); }
.flow-step.done { border-color: var(--ok-line); }
.flow-step.waiting { border-color: var(--warn-line); }
.flow-step.waiting .n { background: var(--warn-line); }
.flow-step.failed { border-color: var(--danger-line); }
.next-box { border-color: var(--accent-line); }

/* ---- 任务栏（11-06：一张列表 + 状态汇总 + 按状态筛） ---- */
.task-summary { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--s2); }
.task-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.task-filter { font: inherit; font-size: 12px; display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; }
.task-filter .n { color: var(--text-3); }
.task-filter:hover { border-color: var(--border-strong); color: var(--text); }
.task-filter.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.task-filter.active .n { color: var(--ink-text-2); }
.task-filter.f-failed:not(.active) .n { color: var(--danger); }
.task-filter.f-waiting:not(.active) .n { color: var(--warn); }
.task-filter:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.task { border-radius: var(--radius-sm); }
.task.waiting { border-color: var(--warn-line); background: #fffbf4; }
.task.failed { border-color: var(--danger-line); }
.llm-stats { padding: 0; }
.task-main > .muted.small { display: flex; align-items: center; gap: 4px; }

/* ---- 剧本生成器 ---- */
.gen-form { display: flex; flex-direction: column; gap: var(--s4); padding-bottom: 0; }
.gen-section { display: flex; flex-direction: column; gap: var(--s3); padding-bottom: var(--s4); border-bottom: 1px solid var(--border); }
.gen-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.gen-head h2 { display: flex; align-items: center; gap: 10px; }
.gen-step { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; align-items: center; justify-content: center; flex: none; }
.gen-hint { font-size: 12.5px; color: var(--text-3); margin: -4px 0 0 32px; }
.gen-section details > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; }
.gen-section details > summary::-webkit-details-marker { display: none; }
.gen-section details > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(-45deg); transition: transform .15s; margin-left: 4px; }
.gen-section details[open] > summary::after { transform: rotate(45deg); }
.gen-actions { position: sticky; bottom: 0; z-index: 5; display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; padding: var(--s3) var(--s4); margin: 0 calc(-1 * var(--s4)) calc(-1 * var(--s4)); background: rgba(255, 255, 255, .95); backdrop-filter: blur(6px); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.gen-pick { display: flex; gap: 10px; align-items: flex-start; padding: 8px; max-width: 420px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.gen-run { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.gen-run > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px var(--s4); min-height: 46px; }
.gen-run > summary::-webkit-details-marker { display: none; }
.gen-run > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(-45deg); transition: transform .15s; flex: none; }
.gen-run[open] > summary::before { transform: rotate(45deg); }
.gen-run[open] > summary { border-bottom: 1px solid var(--border); }
.gen-run > summary:hover .gen-run-title { color: var(--accent); }
.gen-run-title { font-weight: 600; }
.gen-run-body { padding: var(--s3) var(--s4) var(--s4); }
.gen-scripts { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.gen-script { gap: 8px; padding: var(--s3) var(--s4); }
.gen-script:hover { border-color: var(--accent-line); }
.gen-excerpt { font-size: 12.5px; line-height: 1.65; color: var(--text-2); white-space: pre-line; background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; max-height: 9.9em; overflow: hidden; position: relative; }
.gen-excerpt::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2.4em; background: linear-gradient(transparent, var(--surface-2)); }
.intro-more { font-size: 12.5px; color: var(--text-3); max-width: 78ch; }
.intro-more > summary { cursor: pointer; color: var(--accent); width: max-content; }
.intro-more p { margin: 6px 0 0; }

@media (max-width: 1060px) { .content { padding: var(--s4); } }
.frame:not(:has(img, video)) { background: var(--surface-2); border: 1px dashed var(--border-strong); }
.frame:not(:has(img, video)) .ph { color: var(--text-3); }
.nav-admin > summary { list-style: none; cursor: pointer; }
.nav-admin > summary::-webkit-details-marker { display: none; }
.nav-admin .nav-caret { display: inline-flex; transition: transform .15s; }
.nav-admin[open] .nav-caret { transform: rotate(90deg); }
.nav-admin > .nav-item:not(summary) { padding-left: 30px; }
.shell.collapsed .nav-admin > .nav-item:not(summary) { padding-left: var(--s2); }

/* ---- 手机宽度：侧栏只留图标，表单单列，任务栏盖在页面上 ---- */
@media (max-width: 760px) {
  .shell, .shell.tasks-open { --sidebar: 60px; grid-template-columns: var(--sidebar) minmax(0, 1fr) 0; }
  .sidebar .label, .sidebar .nav-label, .sidebar .nav-sub, .sidebar .count, .sidebar .nav-ep > .more, .sidebar .nav-ep-tools, .sidebar .batch-bar { display: none; }
  .sidebar .nav-item { justify-content: center; }
  .nav-admin > .nav-item:not(summary) { padding-left: var(--s2); }
  .sidebar-head { justify-content: center; padding: var(--s2); }
  .project-switch-btn { justify-content: center; }
  .topbar { padding: var(--s2) var(--s3); }
  .crumbs { display: none; }
  .content { padding: var(--s3); }
  .form-grid { grid-template-columns: 1fr !important; }
  .form-grid > * { grid-column: auto !important; }
  .gen-hint { margin-left: 0; }
  .gen-pick { max-width: none; width: 100%; }
  .gen-scripts, .cards { grid-template-columns: 1fr; }
  .gen-actions { margin: 0 calc(-1 * var(--s4)) calc(-1 * var(--s4)); }
  .page-head p { font-size: 13px; }
  .shell.tasks-open .taskbar { position: fixed; right: 0; top: 0; bottom: 0; width: min(360px, 100vw); z-index: 45; box-shadow: var(--shadow-lg); }
}

/* ---- 视频预览图（项目封面、剧集）：整张竖图放在深色底上，不裁 ---- */
.frame.poster img { object-fit: contain; }
.ep-thumb { width: 44px; aspect-ratio: 9 / 16; border-radius: 6px; overflow: hidden; background: var(--mat); display: grid; place-items: center; }
.ep-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ep-thumb .ph { color: #8f8696; display: inline-flex; }
.ep-progress .ep-row:hover .ep-name b { color: var(--accent); }
.ep-name { display: flex; flex-direction: column; min-width: 0; }
.ep-name .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- 文件夹（11-06：侧栏列出来、文件夹条写明用法、测试副本一行字说明） ---- */
.sidebar .nav-folders { margin: 2px 0 4px 18px; }
.sidebar .nav-folders .nav-item { padding: 5px var(--s2); font-size: 13px; }
.sidebar .nav-n { margin-left: auto; font-size: 11.5px; color: var(--ink-text-2); }
.sidebar .nav-item.active .nav-n { color: #f39bbb; }
.folder-bar { gap: 6px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.folder-bar-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); margin-right: 4px; }
.chip { min-height: 28px; display: inline-flex; align-items: center; gap: 4px; }
.chip.on { background: var(--ink); color: #fff; }
.chip-add { background: transparent; border-style: dashed; color: var(--accent); }
.chip-add:hover { border-color: var(--accent); background: var(--accent-soft); }
.research-note { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin: -8px 0 var(--s4); padding: 6px 10px; border-radius: var(--radius-sm); background: var(--surface-2); }
.research-note .i { flex: none; }

/* ---------- 11-06：侧栏新建项目、画风封面 ---------- */
.sidebar .nav-item.nav-add { color: #f39bbb; }
.sidebar .nav-item.nav-add .ico { color: #f39bbb; }
.sidebar .nav-item.nav-add:hover { color: #fff; }
.style-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--s3, 12px); }
.style-tile { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.style-tile > .style-cover { border-radius: 0; background: var(--mat); }
.style-tile > .style-cover .style-cover-text { color: #8d8495; }
.style-tile-body { padding: 10px 12px 12px; gap: 6px; flex: 1; }
.style-tile-body h3 { font-size: 14px; margin: 0; }
.style-tile-body details { color: var(--text); line-height: 1.5; }
.style-tile-body details summary { cursor: pointer; }
.style-tile-body .row { margin-top: auto; flex-wrap: wrap; gap: 6px; }
.cover-choice { display: flex; gap: 12px; align-items: flex-start; }
.cover-now { flex: none; width: 72px; aspect-ratio: 3 / 4; border-radius: var(--radius-sm); overflow: hidden; background: var(--mat); }
.cover-now img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-tpl { margin-top: 6px; }
.cover-tpl summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.cover-tpl pre { white-space: pre-wrap; font: 12.5px/1.6 var(--font); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; margin: 6px 0; }
.sidebar .nav-folders .nav-item.nav-add-folder { color: #f39bbb; }
.sidebar .nav-folders .nav-item.nav-add-folder:hover { color: #fff; }
/* 剧本生成器：角色锁定的五项、人物设定（11-06） */
.gen-lock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.gen-lock-grid .field input:disabled, .gen-lock-grid .field select:disabled { background: var(--bg); color: var(--text); border-style: dashed; opacity: 1; cursor: not-allowed; }
.gen-lock-grid.open .field input, .gen-lock-grid.open .field select { border-color: var(--accent-line); }
.gen-person { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 10px; }
.gen-person > summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; }

/* 生成器：剧中身份下拉；角色库选择窗选满后没勾的变灰（Bob 11-06） */
.gen-role { display:inline-flex; align-items:center; gap:6px; }
.gen-role select { width:auto; padding:2px 8px; height:28px; font-size:13px; }
label.check.disabled { opacity:.45; cursor:not-allowed; }
