/* 视频生成 — matches the coding-ui dark theme (same tokens as web/src/style.css) */
:root {
  --bg: #0f1115;
  --panel: #161922;
  --panel-2: #1c2030;
  --border: #2a2f40;
  --text: #e6e8ee;
  --muted: #8a90a2;
  --accent: #6aa9ff;
  --accent-2: #4f8ef7;
  --ok: #5ec27a;
  --warn: #e0b34a;
  --err: #e06c6c;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
/* Author display:flex/grid rules below would otherwise override the UA's
   [hidden] { display:none } — every `el.hidden = true` in app.js would silently
   do nothing (auth mask never lifting, confirm field shown on login tab...).
   Guard the attribute itself. */
[hidden] { display: none !important; }
/* Form controls default to the OS font (Arial), not the page stack — make
   buttons/inputs/selects match surrounding text. */
button, input, select, textarea { font-family: inherit; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; }

.app { height: 100vh; display: grid; grid-template-rows: auto 1fr; grid-template-columns: 360px 1fr; overflow: hidden; }

/* ---------- top bar ---------- */
.topbar {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.brand-logo { color: var(--accent); font-size: 15px; }
.spacer { flex: 1; }
.model-pick {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 3px 6px;
}
.model-pick select {
  background: transparent; border: none; color: var(--text);
  font-family: inherit; font-size: 12px; outline: none; cursor: pointer;
}
.model-pick select option { background: var(--panel); }
.who { font-size: 12px; color: var(--muted); }
.who b { color: var(--text); font-weight: 600; }

/* ---------- auth gate ---------- */
.auth-mask {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 12, 16, .82); backdrop-filter: blur(4px);
}
.auth-card {
  width: min(360px, calc(100vw - 40px)); background: var(--panel);
  border: 1px solid var(--border); border-radius: 12px; padding: 22px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, .5);
}
.auth-brand { justify-content: center; margin-bottom: 0; }
.auth-sub {
  margin: 0 0 12px; text-align: center; font-size: 12px; color: var(--muted);
}
.auth-tabs { display: flex; gap: 6px; }
.auth-tab {
  flex: 1; padding: 7px 0; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 6px; color: var(--muted); cursor: pointer; font-size: 13px;
  transition: color .15s, border-color .15s, background .15s;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.active { color: var(--text); border-color: var(--accent); background: rgba(106, 169, 255, .12); }

/* Inline error banner inside the card — must stay visible above the gate. */
.auth-error {
  margin: 0; padding: 7px 10px; border-radius: 6px; font-size: 12px; line-height: 1.4;
  background: rgba(224, 108, 108, .1); border: 1px solid rgba(224, 108, 108, .45); color: var(--err);
}
.field-note {
  font-style: normal; font-size: 11px; color: var(--muted); line-height: 1.4;
  min-height: 11px; /* reserve height so notes appearing/disappearing don't jump the layout */
}
.field-note.bad { color: var(--err); }
.field-note.good { color: var(--ok); }

.pass-wrap { position: relative; display: block; }
.pass-wrap input { padding-right: 52px; }
.pass-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  padding: 3px 8px; font-size: 11px; border-radius: 4px; cursor: pointer;
  background: none; border: none; color: var(--muted); font-family: inherit;
}
.pass-eye:hover { color: var(--text); }

.pass-meter { display: flex; align-items: center; gap: 4px; }
.pass-meter i {
  flex: 1; height: 3px; border-radius: 2px; background: var(--border);
  transition: background .2s;
}
.pass-meter.s1 i:nth-child(1),
.pass-meter.s2 i:nth-child(-n+2) { background: var(--warn); }
.pass-meter.s3 i, .pass-meter.s4 i { background: var(--ok); }
.pass-meter span { font-size: 10px; color: var(--muted); white-space: nowrap; margin-left: 4px; }
/* register perks — the "why" answer before asking anything. */
.auth-perks {
  margin: 2px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px;
}
.auth-perks li {
  font-size: 11px; color: var(--muted); display: flex; align-items: baseline; gap: 6px;
}
.auth-perks li::before { content: "✓"; color: var(--ok); font-size: 10px; }

.auth-go { width: 100%; }
.auth-go:disabled { opacity: .5; cursor: wait; }
.auth-go.busy::after {
  content: "…"; margin-left: 2px;
}
.auth-card .field input:focus { border-color: var(--accent); }

/* ---------- form panel ---------- */
.form-panel {
  background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; min-height: 0; overflow: auto;
}
.tabs { display: flex; gap: 4px; padding: 12px 12px 0; }
.tab {
  flex: 1; padding: 7px 0; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 6px 6px 0 0; color: var(--muted); cursor: pointer; font-size: 13px;
}
.tab.active { color: var(--text); border-bottom-color: var(--panel); background: var(--panel); }
.form-body { padding: 12px; display: flex; flex-direction: column; gap: 12px; }

.drop-zone {
  position: relative; border: 1px dashed var(--border); border-radius: 8px;
  padding: 14px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.drop-zone:hover, .drop-zone.over { border-color: var(--accent); background: rgba(106, 169, 255, .06); }
.drop-icon { font-size: 22px; }
.drop-text { font-size: 13px; margin-top: 4px; }
.drop-hint { font-size: 11px; color: var(--muted); margin-top: 2px; }
.img-preview { width: 100%; max-height: 140px; object-fit: contain; border-radius: 6px; margin-top: 8px; }
.img-clear {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; padding: 0;
  border-radius: 50%; background: rgba(15, 17, 21, .8); color: var(--muted); font-size: 12px;
}
.img-clear:hover { color: #fff; background: var(--err); }

.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: baseline; }
.field-label em { font-style: normal; font-size: 11px; opacity: .7; }
.field input, .field textarea, .field select {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); padding: 8px 10px; font-size: 13px; outline: none; width: 100%;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seed-row { display: flex; gap: 6px; }
.seed-dice { padding: 0 10px; }
.seed-dice:hover { border-color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips-label { font-size: 11px; color: var(--muted); margin-right: 2px; }
.chip {
  padding: 3px 10px; border-radius: 999px; font-size: 12px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active {
  color: var(--text); border-color: var(--accent); background: rgba(106, 169, 255, .12);
}

/* ---------- AI prompt engineering ---------- */
.ai-tools { display: flex; gap: 6px; }
.ai-btn {
  padding: 2px 9px; font-size: 11px; border-radius: 999px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
}
.ai-btn:hover { color: var(--text); border-color: var(--accent); }
.ai-btn:disabled { opacity: .45; cursor: wait; }
.field textarea.flash { border-color: var(--ok); box-shadow: 0 0 0 2px rgba(94, 194, 122, .18); transition: box-shadow .3s, border-color .3s; }

/* ---------- user scenarios ---------- */
.scenarios { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.scenario-fields {
  border: 1px solid rgba(106, 169, 255, .35); border-radius: 8px;
  background: rgba(106, 169, 255, .05); padding: 10px;
  display: flex; flex-direction: column; gap: 10px;
}
.scenario-head { display: flex; align-items: baseline; gap: 8px; }
.scenario-head b { font-size: 13px; }
.scenario-head span { font-size: 11px; color: var(--muted); }
.scenario-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.scenario-grid .field.wide { grid-column: 1 / -1; }
.scenario-foot {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; color: var(--muted);
}
.scenario-foot .rebuild {
  padding: 3px 10px; font-size: 11px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--accent); color: var(--accent); cursor: pointer;
}
.scenario-foot .rebuild:hover { background: var(--accent); color: #fff; }

.form-foot {
  margin-top: auto; padding: 12px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; background: var(--panel);
  position: sticky; bottom: 0;
}
.estimate { font-size: 11px; color: var(--muted); flex: 1; }
.generate-btn {
  padding: 9px 18px; border-radius: 6px; border: 1px solid var(--accent-2);
  background: var(--accent-2); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.generate-btn:hover { background: var(--accent); }
.generate-btn:disabled { opacity: .5; cursor: not-allowed; }
/* Real mode: amber — every token spent is real money. Impossible to confuse
   with the blue sim button once the page reloads with a persisted mode. */
.generate-btn.real {
  background: var(--warn); border-color: var(--warn); color: #1a1500;
}
.generate-btn.real:hover { filter: brightness(1.1); }

/* ---------- drama (连续短剧) ---------- */
.drama-panel { display: flex; flex-direction: column; gap: 12px; }
.drama-script-btn { width: 100%; padding: 8px 0; text-align: center; }
.drama-script-btn:disabled { opacity: .5; cursor: wait; }
.drama-shots { display: flex; flex-direction: column; gap: 8px; }
.shot {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
  background: var(--panel-2); display: flex; gap: 10px; align-items: flex-start;
}
.shot .no {
  font-family: var(--mono); font-size: 12px; color: var(--accent);
  min-width: 44px; padding-top: 2px;
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
}
/* beat/mood/seconds stack under the index — a wide one-line badge steals
   textarea width on 360px cards. First child is the "N/M" index. */
.shot .no b { font-weight: 600; }
.shot .no i {
  font-style: normal; font-size: 10px; color: var(--muted); line-height: 1.35;
}
.shot .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.shot textarea {
  background: transparent; border: 1px solid transparent; border-radius: 4px;
  color: var(--text); font-size: 12px; line-height: 1.5; padding: 2px 4px;
  outline: none; resize: vertical; min-height: 54px; width: 100%;
}
.shot textarea:hover { border-color: var(--border); }
.shot textarea:focus { border-color: var(--accent); background: var(--bg); }
.shot .line { font-size: 11px; color: var(--warn); }
.shot .endline {
  font-size: 11px; color: var(--muted); line-height: 1.45;
  border: 1px dashed transparent; border-radius: 4px; padding: 1px 4px;
  outline: none; min-height: 15px; white-space: pre-wrap;
}
.shot .endline:hover { border-color: var(--border); }
.shot .endline:focus { border-color: var(--accent); background: var(--bg); }
.shot .endline:empty::before { content: "＋ 结束画面（可编辑，下一镜由此承接）"; color: var(--border); }
.shot .no i.brk { color: var(--warn); }
.shot .no i.lk { color: var(--accent); }
.shot .shot-foot { display: flex; align-items: center; gap: 8px; }
.shot .state { font-size: 11px; font-family: var(--mono); color: var(--muted); flex: 1; }
.shot .state.ok { color: var(--ok); }
.shot .state.err { color: var(--err); }
.shot-redo {
  padding: 2px 10px; font-size: 11px; border-radius: 999px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
}
.shot-redo:hover { color: var(--text); border-color: var(--accent); }
/* 分镜级模型：卡片上的选卡器 + 「本条成片」徽章。360px 面板下这一行会挤，
   所以 select 允许收缩（min-width:0）而徽章省略号截断。 */
.shot .shot-model {
  max-width: 132px; min-width: 0; padding: 2px 4px; font-size: 11px;
  border-radius: 6px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
}
.shot .shot-model:hover, .shot .shot-model:focus { color: var(--text); border-color: var(--accent); }
.shot .shot-take {
  font-size: 10px; color: var(--accent); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 110px;
}
.drama-mixed-note {
  font-size: 11px; line-height: 1.5; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px;
}
.drama-shape {
  font-size: 11px; line-height: 1.5; color: var(--warn);
  background: var(--panel-2); border: 1px solid var(--warn);
  border-radius: 8px; padding: 6px 10px;
}
.shot.run { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(106, 169, 255, .12); }
/* G·定妆 — cast/scene identity locks, generated as stills before shooting.
   Row-style list: a small thumb, the text column beside it, and the action
   on the right — the 360px panel can't give 3 columns room to breathe. */
.drama-looks { display: flex; flex-direction: column; gap: 8px; }
.drama-looks-head { display: flex; align-items: center; gap: 8px; }
.drama-looks-title { font-size: 12px; font-weight: 600; color: var(--text); flex: 1; }
.drama-looks-count { font-size: 11px; color: var(--muted); }
.drama-looks-tip { font-size: 11px; color: var(--muted); line-height: 1.45; margin: 0; }
.drama-look-cards { display: flex; flex-direction: column; gap: 6px; }
.look-card {
  border: 1px solid var(--border); border-radius: 8px; padding: 6px;
  background: var(--panel-2); display: flex; align-items: center; gap: 8px;
}
.look-card img {
  width: 44px; height: 58px; border-radius: 4px; object-fit: cover;
  display: block; background: var(--bg); flex: none;
}
.look-card img.none {
  opacity: .35;
  /* an empty thumb still shows its 🎭 silhouette via the alt text */
}
.look-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.look-kind {
  align-self: flex-start; font-size: 10px; font-weight: 600; line-height: 1;
  padding: 2px 6px; border-radius: 3px; color: var(--bg); background: var(--muted);
}
.look-kind.person { background: var(--accent); }
.look-kind.scene { background: var(--ok); }
.look-name { font-size: 12px; color: var(--text); font-weight: 600; }
.look-descr {
  font-size: 11px; color: var(--muted); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.look-err { font-size: 11px; color: var(--err); line-height: 1.35; }
.look-btn {
  padding: 5px 10px; font-size: 11px; border-radius: 5px; flex: none;
  cursor: pointer; border: 1px solid var(--border); color: var(--text);
  background: transparent; white-space: nowrap;
}
.look-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.look-btn:disabled { opacity: .55; cursor: default; }
.look-card.ok { border-color: var(--ok); }
.look-card.ok .look-btn { color: var(--ok); border-color: transparent; opacity: .8; }
.look-card.err { border-color: var(--err); }
.look-card.err .look-btn { color: var(--err); border-color: var(--err); }
.look-card.busy { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(106, 169, 255, .12); }
/* The estimate is a caption for the button row, not a peer flex item: as
   `flex: 1` it was squeezed into the 60-odd px the four buttons leave over and
   wrapped to six lines, dragging the whole row (and the panel) to 90px tall.
   Full-width basis + wrap puts it on its own line above the buttons. */
.drama-go-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.drama-estimate { font-size: 11px; color: var(--muted); flex: 1 0 100%; line-height: 1.4; }

/* ---------- P0·分镜工作台 (the stage in the results area) ----------
   In the drama tab the queue is idle by definition — nothing single-clip is
   running from this view — so the storyboard takes the whole canvas: wide
   shot cards in adaptive columns instead of a 360px column of cramped text.
   The stage is a flex sibling of the grid/player; visibility is DOM-gated
   (syncStage), so no CSS display juggling is needed. */
.drama-stage { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 12px 16px; min-width: 0; }
.stage-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.stage-head b { font-size: 14px; }
.stage-sub { font-size: 11px; color: var(--muted); }
/* Multi-column on the wide canvas; the column floor (340px) keeps the prompt
   textarea readable, and 1fr lets a lone 4th shot stretch wide. */
.drama-stage .drama-shots {
  flex: 1; align-content: flex-start;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 10px;
}
/* Wide cards have room for a taller textarea — the storyboard LLM writes
   dense prompts, and hand-editing needs line count, not a scrollbox. */
.drama-stage .shot textarea { min-height: 96px; }

/* drama player: full results area, plays clips back-to-back */
.drama-player { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 12px 16px; min-width: 0; }
.dp-head { display: flex; align-items: center; gap: 10px; }
.dp-head b { font-size: 14px; }
.dp-sub { font-size: 11px; color: var(--muted); }
.dp-stage { position: relative; flex: 1; min-height: 0; background: #000; border-radius: 10px; overflow: hidden; }
.dp-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
/* clip change → brief fade-up: masks the src swap so beats feel continuous */
.dp-stage video.enter { animation: dpEnter .28s ease-out; }
@keyframes dpEnter { from { opacity: 0; } }
.dp-subs {
  position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%);
  max-width: 84%; padding: 6px 14px; border-radius: 8px;
  white-space: normal; overflow-wrap: break-word;
  background: rgba(10, 12, 16, .72); color: #fff; font-size: 17px; line-height: 1.5; text-align: center;
}
.dp-wait {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 12, 16, .55); z-index: 2;
}
.dp-wait-inner { font-size: 13px; color: var(--muted); animation: dpPulse 1.4s ease-in-out infinite; }
@keyframes dpPulse { 50% { opacity: .55; } }
.dp-progress { display: flex; gap: 6px; position: absolute; left: 12px; right: 12px; bottom: 10px; }
.dp-progress i {
  flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .18);
  transition: background .3s;
}
.dp-progress i.on { background: var(--accent); }
.dp-progress i.now { background: var(--warn); }
.dp-foot { display: flex; align-items: center; gap: 10px; }
.results { overflow: auto; display: flex; flex-direction: column; min-width: 0; }
/* player open → the queue grid is simply not rendered (see render()) */
.results-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.results-head h2 { font-size: 14px; margin: 0; }
.stats { font-size: 12px; color: var(--muted); }
.ghost-btn {
  background: none; border: 1px solid var(--border); color: var(--muted);
  padding: 5px 10px; border-radius: 6px; font-size: 12px; cursor: pointer;
}
.ghost-btn:hover { color: var(--err); border-color: var(--err); }

.toast {
  position: fixed; top: 54px; right: 16px; z-index: 80; max-width: 320px;
  margin: 0; padding: 9px 13px; border-radius: 8px; font-size: 13px; line-height: 1.4;
  background: var(--panel-2); border: 1px solid var(--err); color: var(--err); cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}

.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); }
.empty-icon { font-size: 40px; opacity: .5; }
.empty p { margin: 6px 0 0; }
.empty-hint { font-size: 12px; }

.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px; padding: 4px 16px 20px;
}
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; display: flex; flex-direction: column;
}
.card.err { border-color: var(--err); }
.thumb { position: relative; aspect-ratio: 16/9; background: var(--panel-2); overflow: hidden; }
.thumb video, .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .badge {
  position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; background: rgba(15, 17, 21, .75); border: 1px solid var(--border); color: var(--muted);
}
.card .meta { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.card .desc {
  font-size: 12px; color: var(--text); line-height: 1.4; max-height: 52px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.card .sub { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.card .row { display: flex; gap: 6px; margin-top: 2px; }
.card .row button {
  flex: 1; font-size: 12px; padding: 4px 8px; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 6px; color: var(--text); cursor: pointer;
}
.card .row button:hover { border-color: var(--accent); }

/* ---------- generating placeholder ---------- */
.gen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.gen .shimmer {
  width: 100%; height: 100%; position: absolute; inset: 0;
  background: linear-gradient(100deg, var(--panel-2) 30%, #232a3f 50%, var(--panel-2) 70%);
  background-size: 200% 100%; animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.gen .inner { position: relative; text-align: center; font-size: 12px; color: var(--muted); }
.gen .pct { font-family: var(--mono); font-size: 16px; color: var(--accent); }
.gen .bar { width: 140px; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin: 6px auto 0; }
.gen .bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.gen .cancel {
  position: relative; margin-top: 8px; padding: 3px 10px; font-size: 11px;
  background: none; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); cursor: pointer;
}
.gen .cancel:hover { color: var(--err); border-color: var(--err); }

/* ---------- phone ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
  .form-panel { border-right: none; border-bottom: 1px solid var(--border); max-height: 46vh; }
  .grid { grid-template-columns: 1fr; }
  .drama-stage .drama-shots { grid-template-columns: 1fr; }
  .form-foot { position: static; }
}
/* ---------- 定妆照 lightbox ---------- */
/* Click a look thumb (44×58 is too small to judge a face) → the full still
   floats above everything, dimming the app behind it. Any click closes. */
.look-lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(4, 6, 10, .82);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; cursor: pointer; padding: 24px;
}
.look-lightbox img {
  max-width: min(92vw, 720px); max-height: 74vh;
  border-radius: 8px; box-shadow: 0 8px 40px rgba(0, 0, 0, .5);
  object-fit: contain; background: var(--bg);
}
.look-lightbox-meta { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; cursor: auto; }
.look-lightbox-meta b { color: var(--text); font-size: 15px; }
.look-lightbox-meta span { color: var(--muted); font-size: 12px; max-width: 60vw; }
.look-lightbox-close {
  cursor: auto; padding: 5px 14px; font-size: 12px; border-radius: 999px;
  background: none; border: 1px solid var(--border); color: var(--muted);
}
.look-lightbox-close:hover { color: var(--text); border-color: var(--text); }
/* 换照片: the upload button sits beside the gen button — smaller, quieter. */
.look-upload {
  flex: none; padding: 4px 10px; font-size: 11px; border-radius: 4px;
  background: none; border: 1px solid var(--border); color: var(--muted); cursor: pointer;
}
.look-upload:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.look-upload:disabled { opacity: .5; cursor: default; }
