:root {
  --bg: #0f1020; --bg2: #171831; --card: #1d1e3a; --line: #2c2d55;
  --text: #e8e9f5; --muted: #8b8db0; --pri: #ff8a1f; --pri2: #ffab52;
  --ok: #34d399; --warn: #fbbf24; --err: #f87171;
}
* { box-sizing: border-box; margin: 0; padding: 0; }

/* 新建资产浮层 */
#assetNew { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none; align-items: center; justify-content: center; z-index: 300; }
#assetNew.show { display: flex; }
#assetNew .an-box { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; width: 390px; }
#assetNew .an-title { font-size: 15px; font-weight: 700; color: var(--text); }
#assetNew .an-types { display: flex; gap: 8px; margin: 12px 0; }
#assetNew .an-types button { flex: 1; padding: 12px 0; font-size: 14px; }
#assetNew .an-types button.active { outline: 2px solid var(--pri); color: var(--pri); font-weight: 600; }
#assetNew label { display: block; margin: 8px 0; font-size: 12px; color: var(--muted); }
#assetNew input, #assetNew select, #assetNew textarea { width: 100%; margin-top: 4px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: 13px; font-family: inherit; }
#assetNew .an-ops { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

/* 标准库模板选择浮层 */
#stdPick { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none; align-items: center; justify-content: center; z-index: 310; }
#stdPick.show { display: flex; }
#stdPick .sp-box { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; width: 520px; max-height: 82vh; display: flex; flex-direction: column; }
#stdPick .sp-title { font-size: 15px; font-weight: 700; }
#stdPick .sp-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
#stdPick .sp-tabs button { padding: 5px 12px; font-size: 12px; }
#stdPick .sp-tabs button.active { background: var(--pri); border-color: var(--pri); color: #fff; }
#stdPick .sp-list { overflow-y: auto; flex: 1; min-height: 200px; }
#stdPick .sp-item { display: block; width: 100%; text-align: left; padding: 8px 10px; margin-bottom: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
#stdPick .sp-item:hover { border-color: var(--pri); }
#stdPick .sp-item.used { opacity: .45; cursor: not-allowed; }
#stdPick .sp-item b { color: var(--pri2); margin-right: 8px; }
#stdPick .sp-item .pos { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

/* 分镜卡内联视频提示词面板 */
.vp-inline { margin: 8px 0 4px 46px; padding: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.vp-inline .vp-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--pri2); margin-bottom: 6px; }
.vp-inline .vp-badge { font-size: 11px; color: #ff9800; border: 1px solid #ff980055; border-radius: 4px; padding: 1px 6px; }
.vp-inline .vp-text { width: 100%; font-size: 12px; line-height: 1.6; resize: vertical; }
body { background: var(--bg); color: var(--text); font-family: "Microsoft YaHei", "Noto Sans SC", sans-serif; font-size: 14px; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

#topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--bg2); border-bottom: 1px solid var(--line); flex: 0 0 auto; }

/* ---------- 项目库首页 ---------- */
#homePage { position: fixed; inset: 0; z-index: 50; overflow: auto;
  background: radial-gradient(1200px 600px at 75% -10%, #2a1f4d 0%, transparent 60%),
              radial-gradient(900px 500px at -10% 110%, #1c2440 0%, transparent 55%), var(--bg); }
.home-inner { max-width: 1100px; margin: 0 auto; padding: 56px 32px 80px; }
.home-brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; margin-bottom: 40px; }
.home-brand img { width: 34px; height: 34px; border-radius: 8px; }
.home-kicker { color: #8f7fd4; letter-spacing: 5px; font-size: 12px; font-weight: 700; }
.home-title { font-size: 34px; font-weight: 800; margin: 8px 0 10px; }
.home-sub { color: var(--muted); max-width: 520px; line-height: 1.6; }
.home-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 36px; }
.home-new { font-size: 15px; padding: 11px 22px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.home-empty { color: var(--muted); padding: 60px 0; text-align: center; font-size: 15px; }
.home-card { border-radius: 14px; overflow: hidden; background: var(--bg2); border: 1px solid var(--line);
  transition: transform .15s, border-color .15s; cursor: pointer; }
.home-card:hover { transform: translateY(-3px); border-color: #6c5ce7; }
.hc-head { position: relative; height: 120px; display: flex; align-items: flex-end; padding: 14px; }
.home-card.g1 .hc-head { background: linear-gradient(135deg, #3b2f63 0%, #1c2440 100%); }
.home-card.g2 .hc-head { background: linear-gradient(135deg, #5a2f4d 0%, #241c33 100%); }
.home-card.g3 .hc-head { background: linear-gradient(135deg, #2f4a5a 0%, #1c2b40 100%); }
.hc-mark { position: absolute; right: 10px; top: -14px; font-size: 92px; font-weight: 900; opacity: .14; color: #fff; pointer-events: none; }
.hc-badge { font-size: 12px; padding: 3px 10px; border-radius: 20px; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.18); }
.hc-badge.ok { color: #7be3a2; border-color: rgba(123,227,162,.4); }
.hc-badge.run { color: #8fb8ff; border-color: rgba(143,184,255,.4); }
.hc-badge.idle { color: #c9b8ff; border-color: rgba(201,184,255,.4); }
.hc-body { padding: 16px; }
.hc-name { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.hc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.hc-chip { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; background: rgba(255,255,255,.02); }
.hc-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.hc-track { flex: 1; height: 7px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.hc-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #6c5ce7, #8f7fd4); transition: width .3s; }
.hc-num { font-size: 12px; color: var(--muted); white-space: nowrap; }
.hc-foot { display: flex; align-items: center; justify-content: space-between; }
.hc-ops { display: flex; gap: 8px; }
.hc-ops .btn { padding: 5px 14px; font-size: 13px; }
.brand { font-size: 18px; font-weight: 700; color: var(--pri); }
.ver { font-size: 11px; color: var(--muted); font-weight: 400; }

#steps { display: flex; gap: 6px; margin-left: 12px; flex: 1; }
.step-btn { background: transparent; border: 1px solid var(--line); color: var(--muted); padding: 7px 16px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.step-btn.active { background: var(--pri); border-color: var(--pri); color: #fff; font-weight: 600; }

.btn { background: #2a2b52; border: 1px solid var(--line); color: var(--text); padding: 7px 14px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--pri); }
.btn.primary { background: var(--pri); border-color: var(--pri); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--pri2); }
.btn.ghost { background: transparent; }
.btn.big { padding: 10px 32px; font-size: 15px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.mini { padding: 3px 9px; font-size: 12px; border-radius: 6px; }

#workspace { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
/* hidden 属性兜底：上面 display:flex 特异性会盖过浏览器默认 [hidden] 规则，导致回项目库时工作台叠在首页上（2026-09-23） */
#workspace[hidden] { display: none !important; }
#main { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 16px 16px; }
.page { display: none; }
.page.active { display: block; padding-top: 16px; }
#page-produce.page.active { padding-top: 0; }

/* 协作进度看板（右上角浮层，点 chip 展开） */
#hubDash { position: fixed; top: 52px; right: 14px; z-index: 400; }
#hubDash .dash-chip { cursor: pointer; font-size: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; color: var(--muted); }
#hubDash .dash-chip:hover { color: var(--text); border-color: var(--pri); }
#hubDash .dash-body { display: none; background: rgba(23, 24, 49, .97); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-top: 6px; width: 340px; max-height: 62vh; overflow: auto; box-shadow: 0 6px 24px rgba(0,0,0,.5); }
#hubDash.open .dash-body { display: block; }
.dash-proj { margin-bottom: 10px; }
.dash-proj:last-child { margin-bottom: 0; }
.dash-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.dash-item { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.dash-label { font-size: 11px; width: 72px; color: var(--muted); flex: 0 0 auto; }
.dash-track { flex: 1; height: 8px; background: #26283f; border-radius: 4px; overflow: hidden; }
.dash-fill { height: 100%; border-radius: 4px; }
.dash-num { font-size: 11px; width: 46px; text-align: right; color: var(--muted); flex: 0 0 auto; }
.dash-eps { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.dash-ep { font-size: 10px; background: #1e2036; border-radius: 4px; padding: 2px 6px; color: #8b8db0; cursor: default; }
.dash-ep.done { background: #1d3a2a; color: #6ee7a0; }

.row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.row.wrap { row-gap: 6px; }
.muted { color: var(--muted); font-size: 12px; }
label { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
label.chk { color: var(--text); cursor: pointer; }
input, select, textarea { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 6px 9px; font-size: 13px; }
textarea { width: 100%; resize: vertical; font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pri); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.card-title { font-weight: 600; margin-bottom: 10px; }

/* 剧本-分集列表 */
.ep-list { display: flex; flex-direction: column; gap: 10px; }
.ep-item { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.ep-item.done { border-left: 3px solid var(--ok); }
.ep-head { display: flex; align-items: center; gap: 10px; }
.ep-title { font-weight: 600; flex: 1; }
.ep-claim { font-size: 12px; color: #e8c46a; background: rgba(232,196,106,.12); border: 1px solid rgba(232,196,106,.35); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.ep-claim.mine { color: #7dd48a; background: rgba(125,212,138,.1); border-color: rgba(125,212,138,.4); }
.ep-body { margin-top: 8px; }
.ep-script { width: 100%; min-height: 140px; }

/* 资产 */
.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tab-btn { background: transparent; border: 1px solid var(--line); color: var(--muted); padding: 6px 18px; border-radius: 20px; cursor: pointer; }
.tab-btn.active { background: var(--card); color: var(--pri); border-color: var(--pri); }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 12px; }
.asset-card { display: flex; flex-direction: column; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; contain: layout style; content-visibility: auto; contain-intrinsic-size: auto 480px; }
/* 资产卡几十张+长提示词文本框：视口外的卡跳过布局/绘制——拖 textarea 大小、滚动列表不再整页重排卡顿。
   contain-intrinsic-size 带 auto=记住上次真实高度，滚回视口时滚动条不跳 */
.asset-card textarea { resize: vertical; }
.asset-card.locked { border-color: var(--ok); }
/* 图片区:两张大图并排(全身|半身),各自候选条贴在图下方,便于左右对比 */
.asset-imgs { display: flex; flex-direction: row; align-items: flex-start; gap: 14px; }
.imgcol { display: flex; flex-direction: column; width: 168px; flex: 0 0 auto; }
.imgcol .asset-img { width: 168px; height: 224px; }
.cand-strip { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.cand { width: 50px; height: 66px; object-fit: cover; border-radius: 4px; cursor: pointer; border: 2px solid transparent; opacity: .85; }
.detail-title { font-size: 12px; color: var(--warn); margin-top: 2px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.detail-grid .asset-field { margin: 0; }
.asset-img { width: 150px; height: 200px; object-fit: cover; border-radius: 8px; background: var(--bg); flex: 0 0 auto; cursor: pointer; }
.asset-img.wide { width: 100%; height: auto; } /* 场景/道具/群演槽：图按原比例完整显示不裁切（16:9 场景图/1:1 道具方图都完整） */
.asset-img.wide.empty { height: 158px; } /* 空槽占位用横版框 */
.imgcol.wide { width: 100%; }
.imgcol.wide .asset-img { width: 100%; height: auto; }
.asset-img.empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
/* 候选图条：卡内图片下方横排缩略图，点击切换主图 */
.cand:hover { opacity: 1; border-color: rgba(255,255,255,.35); }
.cand.cur { border-color: var(--accent); opacity: 1; }

/* ---- 资产多选下载模式（2026-09-25）---- */
.main-img-wrap { position: relative; display: inline-block; width: 168px; }
.imgcol .main-img-wrap .asset-img { width: 168px; height: 224px; }
.main-img-wrap.wide { display: block; width: 100%; }
.imgcol .main-img-wrap.wide .asset-img { width: 100%; height: auto; }
.sel-badge {
  position: absolute; top: 6px; right: 6px; z-index: 5;
  width: 22px; height: 22px; line-height: 20px; text-align: center;
  border-radius: 50%; background: rgba(15,18,28,.72); border: 2px solid rgba(255,255,255,.75);
  color: transparent; font-style: normal; font-size: 13px; font-weight: 700;
  cursor: pointer; user-select: none; transition: all .12s;
}
.cand-wrap > .sel-badge, .variant-head > .vthumb-wrap > .sel-badge { width: 18px; height: 18px; line-height: 16px; font-size: 11px; top: 4px; right: 4px; }
.sel-badge:hover { border-color: #fff; background: rgba(15,18,28,.9); }
.sel-badge.on { background: #3a9d5d; border-color: #6fe39a; color: #fff; }
body.sel-mode .asset-img, body.sel-mode .cand, body.sel-mode .vthumb { cursor: pointer; }
/* 选中图片：外框 + 角标对应 */
img.sel-on { outline: 3px solid #43c17a; outline-offset: -1px; }
.vthumb-wrap { position: relative; display: inline-block; }

/* 底部悬浮操作条 */
.sel-bar {
  display: none; position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  z-index: 1200; align-items: center; gap: 10px;
  width: max-content; max-width: calc(100vw - 24px);
  background: rgba(23,24,39,.97); border: 1px solid #3a3d5c; border-radius: 12px;
  padding: 10px 16px; box-shadow: 0 10px 40px rgba(0,0,0,.55); font-size: 13px;
}
.sel-bar.show { display: flex; }
.sel-bar-title { white-space: nowrap; }
.sel-bar-title b { color: #6fe39a; font-size: 15px; }
.sel-bar .btn { flex: none; }
.sel-bar-hint { font-size: 11px; margin-left: 6px; white-space: nowrap; }
@media (max-width: 820px) { .sel-bar-hint { display: none; } }
/* 选择模式下候选条只留勾选角标，隐藏另存/删除小图标避免误触和拥挤（主资产用 data-act，变体用 data-vact） */
body.sel-mode .cand-wrap > i[data-act],
body.sel-mode .cand-wrap > i[data-vact] { display: none; }
.btn.mini:disabled { opacity: .45; cursor: not-allowed; }
.asset-info { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.asset-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.asset-field label { font-size: 11px; }
.asset-field input, .asset-field textarea { width: 100%; font-size: 12px; }
/* 大图预览遮罩 */
#imgview { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.88); align-items: center; justify-content: center; cursor: zoom-out; }
#imgview.show { display: flex; }
/* 脸部对比器:左全身|右半身,同步缩放平移 */
#cmpview { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.92); flex-direction: column; }
#cmpview.show { display: flex; }
.cmp-panes { flex: 1; display: flex; min-height: 0; }
.cmp-pane { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; border-right: 1px solid rgba(255,255,255,.12); cursor: grab; }
.cmp-pane:last-of-type { border-right: none; }
.cmp-pane:active { cursor: grabbing; }
.cmp-pane img { max-width: 92%; max-height: 88%; object-fit: contain; transition: none; user-select: none; -webkit-user-drag: none; }
.cmp-tag { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.55); color: #fff; font-size: 13px; padding: 4px 14px; border-radius: 14px; pointer-events: none; }
/* 候选条固定在画面区下方,独立于放大中的主图,始终可点 */
.cmp-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 8px 12px 0; border-top: 1px solid rgba(255,255,255,.12); background: rgba(10,10,14,.92); }
.cmp-bar { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cmp-bar > span { flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.cmp-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0; }
.cmp-strip .cand { flex: 0 0 auto; }
.cmp-hint { text-align: center; color: rgba(255,255,255,.65); font-size: 12px; padding: 8px 0 12px; }
#imgview img { max-width: 92vw; max-height: 92vh; object-fit: contain; border-radius: 8px; box-shadow: 0 8px 60px rgba(0,0,0,.6); }
/* 角色档案库:单角色全部形象图(主形象半身/全身+各变体+候选)分组网格 */
#archiveView { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.92); overflow-y: auto; }
#archiveView.show { display: block; }
.arch-head { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 14px 22px; background: rgba(10,10,14,.96); border-bottom: 1px solid rgba(255,255,255,.12); z-index: 1; }
.arch-head b { color: #fff; font-size: 16px; }
.arch-close { cursor: pointer; color: #fff; font-size: 22px; line-height: 1; background: none; border: none; padding: 4px 8px; }
.arch-body { padding: 18px 22px 48px; }
.arch-group { margin-bottom: 24px; }
.arch-label { color: var(--pri); font-size: 13px; font-weight: 600; margin-bottom: 9px; }
.arch-label span { color: var(--muted); font-weight: 400; margin-left: 8px; font-size: 12px; }
.arch-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.arch-img { width: 120px; height: 164px; object-fit: cover; border-radius: 8px; cursor: zoom-in; background: var(--bg); border: 1px solid var(--line); }
.arch-img.cur { border-color: var(--ok); box-shadow: 0 0 0 2px rgba(52,211,153,.35); }
.arch-empty { color: var(--muted); font-size: 12px; padding: 24px 0; }
.asset-ops { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 10px; padding: 1px 7px; border-radius: 8px; background: rgba(52,211,153,.15); color: var(--ok); }

/* 分镜 */
/* 镜号导航条：贴顶工具行下方，一行数字点击秒跳 */
.shot-nav { display: flex; gap: 3px; flex-wrap: wrap; padding: 6px 0; position: sticky; top: 52px; z-index: 40; background: var(--bg); border-bottom: 1px solid var(--line); margin: 0 -16px 8px; padding: 6px 16px; }
.shot-nav a { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; border-radius: 6px; font-size: 12px; text-decoration: none; border: 1px solid var(--line); background: var(--bg2); color: var(--text); cursor: pointer; transition: all .12s; }
.shot-nav a:hover { border-color: var(--pri); color: var(--pri); }
.shot-nav a.has-video { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.3); color: #4ade80; }
.shot-nav a.has-frame { background: rgba(251,191,36,.10); border-color: rgba(251,191,36,.3); color: #fbbf24; }
.shot-nav a.active { background: var(--pri); color: #fff; border-color: var(--pri); }

/* 折叠态：只显示镜号+状态条 */
.shot-card.collapsed { padding: 6px 12px; }
.shot-card.collapsed .shot-main,
.shot-card.collapsed .shot-img { display: none; }
.shot-card.collapsed .shot-collapse-bar { display: flex; align-items: center; gap: 10px; flex: 1; cursor: pointer; }
.shot-card .shot-collapse-bar { display: none; }
.shot-card .shot-toggle { cursor: pointer; font-size: 14px; color: var(--muted); margin-left: auto; padding: 0 4px; }

.shot-list { display: flex; flex-direction: column; gap: 10px; }
.shot-card { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.shot-no { flex: 0 0 auto; width: 34px; text-align: center; font-weight: 700; color: var(--pri); font-size: 16px; }
.shot-main { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.shot-row { display: flex; gap: 8px; align-items: flex-start; }
.shot-row label { flex: 0 0 auto; font-size: 12px; padding-top: 6px; width: 52px; }
.shot-img { width: 108px; height: 192px; object-fit: cover; border-radius: 8px; background: var(--bg); flex: 0 0 auto; cursor: pointer; }
video.shot-img { width: 176px; height: 313px; object-fit: contain; background: #000; cursor: default; }
/* 制作页视频懒加载：未进入视口不请求，遮罩点击即加载播放 */
.video-wrap { position: relative; width: 176px; height: 313px; flex: 0 0 auto; }
.video-wrap video.shot-img { width: 100%; height: 100%; display: block; }
.video-lazy-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #000; border-radius: 8px; color: #cdd6e4; font-size: 30px; cursor: pointer; transition: background .15s; }
.video-lazy-hint:hover { background: #111827; color: #fff; }
/* 网页版有抽帧封面：遮罩透明只留 ▶，hover 轻压暗 */
.video-lazy-hint.has-poster { background: transparent; color: rgba(255,255,255,.92); text-shadow: 0 0 8px rgba(0,0,0,.85), 0 1px 3px rgba(0,0,0,.7); }
.video-lazy-hint.has-poster:hover { background: rgba(0,0,0,.3); color: #fff; }
.shot-card.collapsed .video-wrap { display: none; }
.shot-img.empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; text-align: center; }
.shot-status { font-size: 11px; }
.shot-status.ok { color: var(--ok); } .shot-status.warn { color: var(--warn); }
.dur-ok { color: var(--ok); } .dur-warn { color: var(--warn); } .dur-err { color: var(--err); }

/* 资产自动引用 chips */
.asset-refs { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; align-items: center; min-height: 24px; padding-top: 3px; }
.ref-none { font-size: 11px; color: var(--muted); }
.ref-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; cursor: pointer; border: 1px solid var(--line); background: var(--bg); color: var(--text); transition: border-color .15s, color .15s, transform .15s; }
.ref-chip:hover { border-color: var(--pri); color: var(--pri); transform: translateY(-1px); }
.ref-chip.ref-char { border-color: rgba(96,165,250,.35); background: rgba(96,165,250,.10); }
.ref-chip.ref-scene { border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.10); }
.ref-chip.ref-prop { border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.10); }
.ref-chip.ref-prop-x { border-color: rgba(251,191,36,.6); background: rgba(251,191,36,.16); }
.ref-chip.ref-prop-x:hover { border-color: #f87171; color: #f87171; }
.ref-add-prop { background: var(--bg); border: 1px dashed var(--line); border-radius: 999px; padding: 2px 8px; font-size: 12px; color: var(--muted); cursor: pointer; }
.ref-add-prop:hover { border-color: var(--pri); color: var(--text); }
.asset-card.ref-flash { outline: 2px solid var(--pri); box-shadow: 0 0 14px rgba(99,102,241,.45); }

/* 资产卡 · 反向引用面板（2026-10-05，对齐竞品素材库「引用」折叠面板） */
.asset-refrow { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12px; cursor: pointer; user-select: none; }
.asset-refrow:hover .refpill { border-color: var(--pri2); }
.asset-refrow:hover .refmore { color: var(--pri2); }
.refpill { padding: 1px 7px; border-radius: 4px; background: rgba(99,102,241,.16); color: #a5b4fc; white-space: nowrap; border: 1px solid transparent; }
.refpill b { font-weight: 600; }
.refpill.refout { background: rgba(52,211,153,.14); color: var(--ok); }
.refpill.refstale { background: rgba(251,191,36,.16); color: var(--warn); }
.refpill.refmiss { background: rgba(248,113,113,.16); color: var(--err); }
.refmore { margin-left: auto; color: var(--muted); font-size: 11px; }
.asset-refpanel { margin-top: 6px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; font-size: 12px; line-height: 1.85; color: var(--muted); max-height: 240px; overflow-y: auto; }
.asset-refpanel .refhead { color: var(--text); margin-bottom: 4px; }
.asset-refpanel .refhead b { color: var(--pri2); font-weight: 600; }
.asset-refpanel .refep { word-break: break-all; }
.asset-refpanel .refsn { color: var(--text); font-weight: 500; }
.asset-refpanel .refsn.st { color: var(--warn); }
.asset-refpanel .reflegend { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 11px; line-height: 1.7; }

/* 切章章节标签 */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 3px 10px; font-size: 12px; cursor: pointer; color: var(--muted); }
.chip:hover { border-color: var(--pri); color: var(--text); }
#chapterPreview { display: none; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; max-height: 260px; overflow: auto; white-space: pre-wrap; font-size: 12px; margin-top: 8px; color: var(--text); }

/* 设置 */
.form-grid { display: grid; grid-template-columns: 150px 1fr; gap: 8px 12px; align-items: center; margin-bottom: 10px; }
.form-grid label { justify-content: flex-end; font-size: 12px; }

/* AI 流式面板 */
#aiStream { position: fixed; right: 16px; bottom: 16px; width: 460px; max-height: 50vh; background: var(--bg2); border: 1px solid var(--pri); border-radius: 10px; padding: 12px; z-index: 50; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
#aiStream.hidden { display: none; }
#aiStreamText { flex: 1; overflow-y: auto; white-space: pre-wrap; font-size: 11px; color: var(--muted); max-height: 40vh; }

/* 文本输入弹窗（替代 window.prompt，Electron 不支持原生 prompt） */
#askDlg { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 90; display: flex; align-items: center; justify-content: center; }
#askDlg.hidden { display: none; }
.ask-box { width: 380px; background: var(--bg2); border: 1px solid var(--pri); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.55); }
.ask-box #askTitle { font-size: 14px; color: var(--text); }
.ask-box input { width: 100%; box-sizing: border-box; }

#toast { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 99; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast-item { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--pri); padding: 9px 18px; border-radius: 8px; box-shadow: 0 4px 18px rgba(0,0,0,.4); animation: fadein .2s; }
.toast-item.err { border-left-color: var(--err); }
.toast-item.ok { border-left-color: var(--ok); }
.toast-item.warn { border-left-color: #e6b800; }
@keyframes fadein { from { opacity: 0; transform: translateY(-8px); } }

.loading { opacity: .6; pointer-events: none; }
.hidden { display: none !important; }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--muted); border-top-color: var(--pri); border-radius: 50%; animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- 分集大纲 ---------- */
.outline-box { margin-top: 10px; max-height: 420px; overflow-y: auto; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); border-radius: 8px; padding: 10px 12px; }
.outline-box.hidden { display: none; }
.outline-box .vol-title { font-weight: 700; color: #f0c674; margin-bottom: 8px; }
.outline-box .vol-head { font-weight: 600; color: #7ab8ff; margin: 10px 0 6px; padding-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,.08); }
.outline-box .ol-ep { padding: 4px 0 6px 10px; border-left: 2px solid rgba(122,184,255,.25); margin-bottom: 4px; font-size: 12.5px; line-height: 1.7; }
.outline-box .ol-ep b { color: #f0c674; }
.outline-box .ol-hook { color: #ff9d7a; }

/* AI 识别题材/时代提示条（一行小字，可一键采用/忽略；不写盘，采用后时代仍需「保存时代」） */
.genre-hint { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding: 7px 10px;
  background: var(--bg); border: 1px solid var(--pri); border-left-width: 3px; border-radius: 8px; font-size: 12px; color: var(--muted); }
.genre-hint[hidden] { display: none; }
.genre-hint b { color: var(--text); font-weight: 600; }
.genre-hint .gh-ev { color: var(--muted); opacity: .8; }
.genre-hint .gh-done { color: #4a8; }
.genre-hint .gh-apply { margin-left: auto; }
.genre-hint .gh-dismiss { opacity: .75; }


/* 引用chip：显式引用但资产库无同名卡（虚线灰提示） */
.ref-chip.ref-miss { opacity: .55; border: 1px dashed rgba(255,120,90,.6); }

/* 形象变体区 */
.variant-row { margin: 4px 0; padding: 6px 8px; border: 1px solid rgba(148,163,184,.18); border-radius: 8px; }
.variant-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.variant-head b { font-size: 12px; color: #e2e8f0; }
.vthumb { width: 34px; height: 34px; object-fit: cover; border-radius: 5px; cursor: zoom-in; border: 1px solid rgba(148,163,184,.3); }
.variant-row textarea { width: 100%; font-size: 12px; }

/* 首帧时效提醒：首帧早于引用资产图（资产更新过）时黄标提示重出 */
.stale-warn { background: #33301e; border: 1px solid #8a7a3a; color: #e8d48a; padding: 8px 12px; border-radius: 8px; margin-bottom: 10px; font-size: 12px; line-height: 1.6; }

/* 制作页/分镜页工具行滚动固定（2026-09-21 user-confirmed；2026-09-23 分镜页同款）：上下滑动时第一行贴顶不动。
   #main 顶部 padding 已移除（.page 自带 padding-top），row 从滚动区 0px 起贴顶，物理上无缝可穿 */
#page-produce > .row:first-child, #page-storyboard > .row:first-child { position: sticky; top: 0; z-index: 50; background: var(--bg); padding: 12px 16px 10px; margin: 0 -16px 10px; border-bottom: 1px solid var(--line); }

/* ===== 后端日志台浮层 ===== */
#logPanel { position: fixed; right: 14px; bottom: 14px; width: 620px; height: 46vh; z-index: 500;
  background: #0c0e18; border: 1px solid #2a2d44; border-radius: 10px; display: flex; flex-direction: column;
  box-shadow: 0 8px 30px rgba(0,0,0,.55); }
#logPanel .log-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-bottom: 1px solid #2a2d44; font-size: 12px; color: #aab; }
#logPanel .log-head .chk { font-size: 12px; color: #889; }
#logBody { flex: 1; overflow-y: auto; padding: 8px 10px;
  font: 11px/1.55 Consolas, 'Courier New', monospace; white-space: pre-wrap; word-break: break-all; }
.log-line.log-info { color: #9fb0c0; }
.log-line.log-warn { color: #ffd54f; }
.log-line.log-err, .log-line.log-fatal { color: #ff8a80; }

/* 日志台收起态：右下角小圆钮 */
#logFab { position: fixed; right: 18px; bottom: 18px; z-index: 499; width: 42px; height: 42px;
  border-radius: 50%; border: 1px solid #2a2d44; background: #171a2a; font-size: 17px; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.5); }
#logFab:hover { background: #232741; }

/* hidden属性被 #logPanel{display:flex} 覆盖的修正：显式声明隐藏态（点X后才能真正收起） */
#logPanel[hidden] { display: none; }

/* ---------- 技能库弹层（管理员） ---------- */
#skillsModal { position: fixed; inset: 0; z-index: 600; background: #f4f5f8;
  display: flex; flex-direction: column; }
#skillsModal[hidden] { display: none; }
.sk-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: #1f2937; color: #e5e7eb; }
.sk-title { font-weight: 600; font-size: 15px; white-space: nowrap; }
.sk-search { flex: 1; max-width: 460px; padding: 6px 12px; border-radius: 6px; border: 1px solid #4b5563;
  background: #111827; color: #e5e7eb; font-size: 13px; }
.sk-kind { padding: 6px 8px; border-radius: 6px; background: #111827; color: #e5e7eb;
  border: 1px solid #4b5563; font-size: 13px; }
.sk-stat { padding: 6px 16px; font-size: 12px; color: #6b7280; background: #eef0f4; border-bottom: 1px solid #dde0e7; }
.sk-body { flex: 1; display: flex; min-height: 0; }
.sk-list { width: 320px; flex: none; overflow-y: auto; border-right: 1px solid #dde0e7; background: #fff; }
.sk-item { padding: 10px 14px; border-bottom: 1px solid #eef0f4; cursor: pointer; }
.sk-item:hover { background: #f8f9fc; }
.sk-item.active { background: #e8effc; border-left: 3px solid #2563eb; padding-left: 11px; }
.sk-item-t { font-size: 13.5px; font-weight: 600; color: #1f2937; }
.sk-item-m { font-size: 11px; color: #9ca3af; margin-top: 2px; }
.sk-item-s { font-size: 12px; color: #6b7280; margin-top: 4px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sk-item-hit { font-size: 12px; color: #92400e; margin-top: 4px; line-height: 1.5; background: #fef3c7;
  border-radius: 4px; padding: 3px 6px; }
.sk-empty { padding: 30px 18px; color: #9ca3af; font-size: 13px; text-align: center; }
.sk-view { flex: 1; overflow-y: auto; background: #fff; }
.sk-view-head { padding: 16px 24px 10px; border-bottom: 1px solid #eef0f4; position: sticky; top: 0; background: #fff; z-index: 2; }
.sk-view-title { font-size: 18px; font-weight: 700; color: #111827; }
.sk-view-cat { font-size: 12px; font-weight: 400; color: #fff; background: #2563eb; border-radius: 10px;
  padding: 1px 10px; margin-left: 8px; vertical-align: middle; }
.sk-view-sum { font-size: 13px; color: #4b5563; margin-top: 6px; line-height: 1.6; }
.sk-view-meta { font-size: 11px; color: #9ca3af; margin-top: 6px; }
.sk-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sk-file { font-size: 12px; border: 1px solid #d1d5db; border-radius: 14px; padding: 2px 10px; cursor: pointer;
  color: #374151; background: #f9fafb; }
.sk-file:hover { border-color: #2563eb; color: #2563eb; }
.sk-file.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.sk-doc { padding: 18px 28px 60px; font-size: 14px; line-height: 1.8; color: #1f2937; max-width: 980px; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4 { margin: 1.2em 0 .5em; line-height: 1.4; color: #111827; }
.md-body h1 { font-size: 22px; border-bottom: 2px solid #e5e7eb; padding-bottom: .3em; }
.md-body h2 { font-size: 19px; border-bottom: 1px solid #eef0f4; padding-bottom: .25em; }
.md-body h3 { font-size: 16px; }
.md-body h4 { font-size: 14.5px; }
.md-body p { margin: .55em 0; }
.md-body ul, .md-body ol { margin: .5em 0; padding-left: 1.8em; }
.md-body li { margin: .2em 0; }
.md-body hr { border: none; border-top: 1px solid #e5e7eb; margin: 1.2em 0; }
.md-body blockquote { margin: .6em 0; padding: .4em 1em; border-left: 3px solid #93c5fd;
  background: #eff6ff; color: #475569; border-radius: 0 6px 6px 0; }
.md-body code { background: #f1f5f9; color: #be185d; border-radius: 4px; padding: 1px 5px;
  font: 12.5px/1.6 Consolas, 'Courier New', monospace; }
.md-body pre.sk-code { background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 8px;
  overflow-x: auto; font: 12.5px/1.65 Consolas, 'Courier New', monospace; white-space: pre;
  margin: .8em 0; }
.md-body pre.sk-code code { background: none; color: inherit; padding: 0; }
.md-body table { border-collapse: collapse; margin: .8em 0; width: 100%; font-size: 13px; display: block;
  overflow-x: auto; }
.md-body th, .md-body td { border: 1px solid #d8dee8; padding: 6px 10px; text-align: left; vertical-align: top; }
.md-body th { background: #f1f5f9; font-weight: 600; white-space: nowrap; }
.md-body tr:nth-child(even) td { background: #fafbfd; }
.md-body mark { background: #fde68a; padding: 0 1px; border-radius: 2px; }

/* ---- 候选缩略图角标按钮（另存/删除）：放大可点面积 ---- */
.cand-fab { position: absolute; top: -7px; width: 20px; height: 20px; line-height: 18px; text-align: center;
  font-size: 12px; font-style: normal; border-radius: 50%; color: #fff; cursor: pointer; opacity: .9;
  box-shadow: 0 1px 4px rgba(0,0,0,.5); z-index: 2; transition: transform .12s, opacity .12s; user-select: none; }
.cand-fab:hover { opacity: 1; transform: scale(1.2); }
.cand-fab.save { left: -7px; background: #2f6fdb; font-size: 11px; }
.cand-fab.del { right: -7px; background: #c0392b; }

/* ---- 镜卡 v3 排版（2026-10-06：v2 降噪收敛版）---- */
.shot-card.sdc { display: block; }
.shot-card.sdc.has-video { border-left: 3px solid #2c9e6a; }
.shot-card.sdc.has-frame { border-left: 3px solid #b98a2e; }
.sdc-head { display: flex; align-items: center; gap: 9px; padding: 2px 2px 10px; flex-wrap: wrap; }
.sdc-head .shot-no { width: auto; cursor: pointer; font-size: 14px; font-variant-numeric: tabular-nums; }
.sdc-chip { font-size: 11px; color: #7ec8ff; background: rgba(47,111,219,.10); border: 1px solid #2f6fdb; border-radius: 9px; padding: 1px 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sdc-tc { font-size: 10px; color: #5f6f92; font-family: ui-monospace, Consolas, monospace; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sdc-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.sdc-pill { font-size: 10px; border: 1px solid; border-radius: 9px; padding: 1px 7px; white-space: nowrap; color: #7ddb9a; border-color: #2c5c3a; }
.sdc-body { display: flex; gap: 14px; }
.sdc-side { flex: 0 0 150px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sdc-side .video-wrap, .sdc-side .shot-img { width: 150px; }
.sdc-side .video-wrap, .sdc-side video.shot-img { height: 267px; }
.sdc-side img.shot-img { height: 267px; }
.sdc-refs { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.sdc-rc { margin: 0; position: relative; border: 1px solid #2c3a55; border-radius: 7px; overflow: hidden; background: #101627; cursor: zoom-in; }
.sdc-rcim { display: block; width: 100%; height: 64px; background: #1a2338; }
.sdc-rcim img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sdc-rcok { position: absolute; top: 4px; right: 4px; width: 13px; height: 13px; border-radius: 50%; background: #2c9e6a; color: #fff; font-size: 8px; line-height: 13px; text-align: center; }
.sdc-rccap { display: block; font-size: 10px; color: #9fb0d0; padding: 3px 6px; background: #11162a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sdc-rccap b { color: #7ec8ff; font-weight: 500; }
.sdc-rc.miss { border-style: dashed; border-color: #7a5a2a; cursor: default; }
.sdc-rc.miss .sdc-rcim { background: transparent; display: flex; align-items: center; justify-content: center; color: #ffb74d; font-size: 11px; }
.sdc-tbar { position: absolute; left: 6px; bottom: 6px; background: rgba(5,7,13,.78); padding: 2px 8px; font-size: 10px; color: #cdd6e4; border-radius: 9px; font-variant-numeric: tabular-nums; z-index: 2; pointer-events: none; }
.sdc-main { gap: 9px; }
.sdc-main input, .sdc-main textarea { background: var(--bg2); }
.sdc-mrow { display: flex; gap: 10px; }
.sdc-f { flex: 1; min-width: 0; }
.sdc-fl { font-size: 10px; color: #5f6f92; letter-spacing: .5px; margin-bottom: 3px; }
.sdc-f input { width: 100%; }
.sdc-ta { width: 100%; box-sizing: border-box; resize: vertical; line-height: 1.55; }
.sdc-refrow { display: flex; gap: 6px; align-items: baseline; font-size: 11px; color: #5f6f92; min-height: 14px; }
.sdc-refrow .asset-refs { flex: 1; min-width: 0; }
.sdc-fold { border-top: 1px dashed #2c3654; padding-top: 7px; }
.sdc-fold summary { cursor: pointer; font-size: 11px; color: #8fa3c8; list-style: none; user-select: none; }
.sdc-fold summary::-webkit-details-marker { display: none; }
.sdc-fold summary:hover { color: #c6d4ef; }
.sdc-foldbody { padding-top: 6px; display: flex; flex-direction: column; gap: 6px; }
/* 提示词面板进右列后：去掉原「卡底全宽+左缩进」的旧定位口径；位置固定在台词下方，高度不缩 */
.sdc-main .vp-inline { margin: 6px 0 2px; }
.sdc-main .vp-inline .vp-text { min-height: 320px; font-size: 12.5px; }
/* 卡头常驻删除（2026-10-08）：底部操作条被 320px 提示词面板推到卡片最底且折叠态隐藏 → 卡头右端常驻一份 */
.sdc-hdel-wrap { display: inline-flex; gap: 5px; margin-left: auto; }
.sdc-hdel-wrap .btn.mini { padding: 2px 8px; font-size: 11px; line-height: 1.5; border-color: #4a3550; color: #d8a3b0; }
.sdc-hdel-wrap .btn.mini:hover { border-color: #a8455e; color: #ffb3c2; }
.sdc-ops { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 9px 2px 2px; border-top: 1px solid #232c44; margin-top: 3px; }
.sdc-ops .btn.mini { border-color: #2c3654; }
.sdc-sp { flex: 1; }
.shot-card.collapsed .sdc-body, .shot-card.collapsed .sdc-ops, .shot-card.collapsed .vp-inline { display: none; }
.shot-card.collapsed .sdc-head { padding-bottom: 2px; }

/* ===== 无人值守运行中特效：停止按钮呼吸光圈 + 闪烁圆点 ===== */
@keyframes autoPulseRing {
  0% { box-shadow: 0 0 0 0 rgba(255, 138, 31, .55); }
  70% { box-shadow: 0 0 0 9px rgba(255, 138, 31, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 138, 31, 0); }
}
@keyframes autoBlink { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
#btnAutoPilotStop.auto-pulse {
  border-color: var(--pri);
  background: #3a2b18;
  color: var(--pri2);
  font-weight: 600;
  animation: autoPulseRing 1.8s ease-out infinite;
}
#btnAutoPilotStop.auto-pulse::before {
  content: '\25CF';
  margin-right: 5px;
  font-size: 9px;
  vertical-align: 1px;
  animation: autoBlink 1.8s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  #btnAutoPilotStop.auto-pulse { animation: none; }
  #btnAutoPilotStop.auto-pulse::before { animation: none; }
}

/* ===== 通道状态条（制作页，30s 轮询纯展示） ===== */
.ch-health { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.ch-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 2px 9px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); }
.ch-pill .ch-dot { width: 7px; height: 7px; border-radius: 50%; background: #5a6484; flex: none; }
.ch-pill.ch-run { border-color: rgba(44, 158, 106, .35); }
.ch-pill.ch-run .ch-dot { background: #2c9e6a; }
.ch-pill.ch-stall { border-color: rgba(184, 134, 46, .55); }
.ch-pill.ch-stall .ch-dot { background: #e0a63a; animation: autoBlink 1.8s ease-in-out infinite; }

/* ===== 手动专用通道（no_auto）：不参与无人值守自动派工 ===== */
.ch-pill.ch-manual { border-style: dashed; opacity: .92; }
.ch-pill.ch-manual .ch-dot { background: #7a86a8; }
.ch-autolab { cursor: pointer; user-select: none; opacity: .9; }
.ch-autolab:hover { opacity: 1; }

/* ===== 无人值守面板：头部计数 + 通道行 + 集号行（替代原散乱两行） ===== */
.auto-panel { display: flex; flex-direction: column; gap: 7px; width: 100%; margin: 6px 0 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); }
/* 制作页顶部操作区吸顶容器（2026-10-07 用户要求：按钮排+通道条+集号行整体固定） */
.produce-pin { position: sticky; top: 0; z-index: 60; background: var(--bg); padding: 8px 0 6px; box-shadow: 0 6px 18px rgba(0,0,0,.35); max-height: calc(100vh - 80px); overflow-y: auto; }
.ap-head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--text); }
.ap-badge { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.ap-badge .ch-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.ap-badge.ap-on { color: #2c9e6a; }
.ap-badge.ap-on .ch-dot { background: #2c9e6a; animation: autoBlink 1.8s ease-in-out infinite; }
.ap-badge.ap-off { color: #8a93ad; }
.ap-cnt { opacity: .9; }
.ap-cnt b { font-size: 13px; margin-left: 2px; }
.ap-cnt.ap-warn { color: #e0a63a; cursor: help; }
.ap-extra { color: var(--pri2); font-size: 11px; opacity: .9; }
.ap-chs { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-prog { opacity: .72; font-variant-numeric: tabular-nums; }
.ap-eps { display: flex; flex-wrap: wrap; gap: 4px; }
.ap-ep { min-width: 27px; height: 20px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; border-radius: 5px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-variant-numeric: tabular-nums; cursor: default; }
.ap-ep.ap-queue { opacity: .5; }
.ap-ep.ap-run { background: #2c9e6a; border-color: #2c9e6a; color: #fff; font-weight: 700; }
.ap-ep.ap-done { border-color: rgba(44, 158, 106, .5); color: #58c98f; background: rgba(44, 158, 106, .07); }
.ap-ep.ap-skip { border-color: rgba(225, 29, 72, .65); color: #f26d8d; background: rgba(225, 29, 72, .08); font-weight: 700; }

/* 面板：图例 + 漏掉/跳过明细（直接写出集号与原因） */
.ap-legend { font-size: 11px; color: var(--muted); display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.ap-legend .ap-ep { min-width: 22px; height: 16px; padding: 0 4px; font-size: 10px; font-style: normal; }
.ap-skips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 11px; }
.ap-skips-t { color: #f26d8d; font-weight: 700; }
.ap-skip-item { padding: 2px 8px; border-radius: 6px; border: 1px solid rgba(225, 29, 72, .45); background: rgba(225, 29, 72, .08); color: #f26d8d; cursor: help; }
/* 画面/配音进度圆角框（2026-10-07 用户要求与通道条同款框） */
.stat-chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 10px; font-size: 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat-chip.full { border-color: rgba(44, 158, 106, .5); color: #58c98f; background: rgba(44, 158, 106, .07); font-weight: 600; }
