/* 商单制作 — the EQUAI / 导演工作台 dark studio look (same tokens), on this app's own class names. */
:root {
  color-scheme: dark;
  --bg: #0a0c12; --bg2: #11141d; --bg3: #171b27;
  --panel: rgba(21, 25, 37, .72); --panel-solid: #151926; --raise: rgba(255, 255, 255, .04);
  --line: rgba(255, 255, 255, .075); --line-strong: rgba(255, 255, 255, .14);
  --text: #e9ebf3; --muted: #9aa1b6; --faint: #646b82;
  --brand: #8f7dff; --brand-2: #3cd4ff; --brand-soft: rgba(143, 125, 255, .14);
  --grad: linear-gradient(135deg, #8f7dff 0%, #6a8bff 45%, #3cd4ff 100%);
  --ok: #3ddc97; --ok-soft: rgba(61, 220, 151, .12);
  --warn: #f6b94e; --warn-soft: rgba(246, 185, 78, .12);
  --bad: #ff5f76; --bad-soft: rgba(255, 95, 118, .12);
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35), 0 1px 0 rgba(255, 255, 255, .03) inset;
  --ease: cubic-bezier(.2, .8, .2, 1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--text); font-size: 14px; line-height: 1.55; min-height: 100vh; background:
  radial-gradient(1200px 600px at 8% -10%, rgba(143, 125, 255, .16), transparent 60%),
  radial-gradient(900px 500px at 100% 0%, rgba(60, 212, 255, .10), transparent 55%),
  radial-gradient(800px 600px at 50% 120%, rgba(143, 125, 255, .08), transparent 60%), var(--bg);
  background-attachment: fixed; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%); }
#app, .top { position: relative; z-index: 1; }
a { color: #b9b0ff; text-decoration: none; }
a:hover { color: #fff; }
[hidden] { display: none !important; }
::selection { background: rgba(143, 125, 255, .35); }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.14) transparent; }
h1, h2, h3, h4 { letter-spacing: -.01em; }

/* buttons */
button, input, select, textarea { font: inherit; color: inherit; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 15px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--raise); cursor: pointer; white-space: nowrap; font-size: 13px; font-weight: 500;
  position: relative; overflow: hidden; transition: border-color .2s, background .2s, transform .15s var(--ease), box-shadow .25s, color .2s; }
button:hover:not(:disabled) { border-color: rgba(143,125,255,.55); background: rgba(143,125,255,.10); color: #fff; }
button:active:not(:disabled) { transform: scale(.97); }
button:disabled { opacity: .4; cursor: not-allowed; }
button.primary { border-color: transparent; color: #fff; background: var(--grad); background-size: 160% 160%;
  box-shadow: 0 6px 18px rgba(106, 139, 255, .32), 0 1px 0 rgba(255,255,255,.25) inset; }
button.primary::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); transition: left .6s var(--ease); }
button.primary:hover:not(:disabled) { background: var(--grad); background-size: 160% 160%; background-position: 100% 0;
  box-shadow: 0 10px 28px rgba(106, 139, 255, .5), 0 1px 0 rgba(255,255,255,.3) inset; }
button.primary:hover::after { left: 130%; }
button.danger { color: var(--muted); }
button.danger:hover:not(:disabled) { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }
button.small, a.small { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; gap: 5px; }
a.small { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); background: var(--raise); color: var(--text); }
a.small:hover { border-color: rgba(143,125,255,.55); background: rgba(143,125,255,.10); }

/* form controls */
input, select, textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 11px; background: rgba(0,0,0,.25); outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s; }
input:hover, textarea:hover, select:hover { border-color: rgba(255,255,255,.22); }
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft), 0 0 22px rgba(143,125,255,.18); background: rgba(0,0,0,.35); }
select option { background: var(--panel-solid); color: var(--text); }
textarea { resize: vertical; min-height: 64px; line-height: 1.6; }
label { display: block; color: var(--muted); font-size: 12px; margin: 10px 0 5px; letter-spacing: .02em; }

/* top bar: equai | 商单制作 */
.top { height: 56px; display: flex; justify-content: space-between; align-items: center; padding: 0 22px; position: sticky; top: 0; z-index: 20;
  background: rgba(10, 12, 18, .65); backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--line); }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; opacity: .5;
  background: linear-gradient(90deg, transparent, var(--brand), var(--brand-2), transparent); }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 15px; letter-spacing: .02em; }
.brand img { height: 22px; display: block; }
.brand .sep { width: 1px; height: 16px; background: var(--line-strong); }
.brand .tag { color: var(--faint); font-size: 12px; font-weight: 400; margin-left: 4px; }
.account { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 13px; }
.account b { color: var(--text); font-weight: 600; }
.account .points { padding: 4px 12px; border-radius: 99px; background: var(--brand-soft); border: 1px solid rgba(143,125,255,.3); color: #d9d3ff; }

/* layout */
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 56px); }
.side { border-right: 1px solid var(--line); padding: 16px 12px; background: rgba(10, 12, 18, .45); }
.side .item { padding: 8px 10px; border-radius: 10px; cursor: pointer; margin-bottom: 4px; display: flex; gap: 10px; align-items: center;
  border: 1px solid transparent; transition: background .2s, border-color .2s; }
.side .item:hover { background: var(--raise); }
.side .item.on { background: var(--brand-soft); border-color: rgba(143,125,255,.3); }
.side .item img { width: 32px; height: 32px; object-fit: cover; border-radius: 8px; flex: none; }
.side .item small { color: var(--faint); display: block; font-size: 11px; }
.side .new { width: 100%; margin-bottom: 14px; }
.main { padding: 22px 28px 80px; max-width: 1320px; }
.main h2 { font-size: 20px; }

.steps { display: inline-flex; gap: 4px; margin-bottom: 18px; padding: 4px; border-radius: 12px; background: rgba(0,0,0,.25); border: 1px solid var(--line); }
.steps button { border: 0; background: transparent; height: 32px; color: var(--muted); border-radius: 9px; }
.steps button:hover:not(:disabled) { background: var(--raise); color: var(--text); }
.steps button.on { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(106, 139, 255, .35); }
.steps button .n { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,.12); font-size: 11px; margin-right: 2px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.card h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card h3 .hint { color: var(--faint); font-size: 12px; font-weight: 400; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.muted { color: var(--muted); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.ok { color: var(--ok); }
.card.bad { border-color: rgba(255,95,118,.3); background: var(--bad-soft); }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 500;
  background: var(--raise); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: rgba(61,220,151,.25); }
.pill.run { background: var(--brand-soft); color: #c3baff; border-color: rgba(143,125,255,.3); }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: rgba(255,95,118,.25); }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(246,185,78,.25); }

/* product pictures */
.thumbs { display: flex; gap: 12px; flex-wrap: wrap; }
.thumb { position: relative; width: 124px; height: 124px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-strong); background: rgba(0,0,0,.35); }
.thumb img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.thumb button { position: absolute; top: 6px; right: 6px; background: rgba(10,12,18,.75); }
.drop { width: 124px; height: 124px; border: 1px dashed var(--line-strong); border-radius: 12px; display: flex; align-items: center; justify-content: center;
  color: var(--muted); cursor: pointer; text-align: center; font-size: 12px; transition: border-color .2s, color .2s, background .2s; }
.drop:hover { border-color: var(--brand); color: #fff; background: var(--brand-soft); }

/* people and places */
.assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.asset { background: rgba(0,0,0,.2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; transition: border-color .2s; }
.asset:hover { border-color: var(--line-strong); }
.asset .pic { height: 230px; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; color: var(--faint); }
.asset .pic img { max-width: 100%; max-height: 100%; cursor: zoom-in; }
.asset .body { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.asset .history { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.asset .history img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line-strong); cursor: pointer; }
.asset .history img:hover { border-color: var(--brand); }

/* videos */
.films { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.film { background: rgba(0,0,0,.2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; transition: border-color .2s; }
.film:hover { border-color: var(--line-strong); }
.film .vid { background: #000; aspect-ratio: 9 / 16; max-height: 420px; margin: 0 auto; display: flex; align-items: center; justify-content: center; color: var(--faint); }
.film.wide .vid { aspect-ratio: 16 / 9; }
.film video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.film .body { padding: 12px; }
.film .body .t { font-weight: 600; }
.final video { max-height: 560px; max-width: 100%; background: #000; border-radius: 12px; display: block; }

/* login: the director's split hero over a picture */
.login-page { position: relative; z-index: 1; min-height: calc(100vh - 56px); display: grid; grid-template-columns: 1.1fr 420px; gap: 60px; align-items: center;
  padding: 0 max(40px, 10vw); overflow: hidden; }
.login-page .bg { position: absolute; inset: 0; z-index: -1; background: center / cover no-repeat url("login-bg.jpg"); }
.login-page .bg::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(10,12,18,.55), rgba(10,12,18,.15) 50%, rgba(10,12,18,.45)), linear-gradient(0deg, rgba(10,12,18,.85), transparent 45%); }
.hero .mark { display: flex; align-items: center; gap: 12px; color: #e9ebf3; font-size: 17px; }
.hero .mark img { height: 28px; }
.hero .mark .sep { width: 1px; height: 18px; background: rgba(255,255,255,.35); }
.hero h1 { font-size: 44px; margin: 18px 0 26px; line-height: 1.2; text-shadow: 0 4px 30px rgba(0,0,0,.5); }
.hero .step { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.hero .step .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(10,12,18,.7); border: 1px solid var(--line-strong); font-size: 13px; flex: none; }
.hero .step b { display: block; font-size: 15px; }
.hero .step span { color: #c4c9d8; font-size: 13px; }
.login { background: rgba(21, 25, 37, .62); border: 1px solid var(--line-strong); border-radius: 18px; padding: 28px; box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); }
.login h3 { font-size: 22px; margin: 0 0 6px; }
.login p { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.login button.primary { width: 100%; height: 44px; font-size: 15px; margin-top: 18px; }
.login .foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 14px; }

/* overlays */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: rgba(21,25,37,.92); border: 1px solid var(--line-strong);
  padding: 10px 18px; border-radius: 12px; z-index: 40; max-width: 80vw; box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.toast.bad { border-color: rgba(255,95,118,.5); }
.modal { position: fixed; inset: 0; background: rgba(5,6,10,.72); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 30; }
.modal .box { background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: 16px; padding: 20px; max-width: 920px; width: 92vw; max-height: 86vh;
  overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.modal pre { white-space: pre-wrap; background: rgba(0,0,0,.35); border: 1px solid var(--line); padding: 14px; border-radius: 10px; font-size: 13px; line-height: 1.65; }
.modal img.big { max-width: 100%; max-height: 78vh; display: block; margin: 0 auto; border-radius: 10px; }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--brand); border-right-color: transparent; border-radius: 50%; animation: s .8s linear infinite; vertical-align: -1px; }
@keyframes s { to { transform: rotate(360deg); } }
.empty { color: var(--muted); padding: 34px; text-align: center; }

/* ---------------------------------------------------------------- single page: head, inputs, progress, results */
.faint { color: var(--faint); font-size: 12px; }
.small { font-size: 12px; }
.proj-head { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.proj-head input.name { width: auto; min-width: 260px; font-size: 20px; font-weight: 600; background: transparent; border-color: transparent; padding: 4px 8px; }
.proj-head input.name:hover { border-color: var(--line-strong); }
.proj-head select.mini { width: auto; height: 32px; padding: 0 10px; font-size: 13px; }
.num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--grad); color: #fff; font-size: 12px; font-weight: 700; }
.inputs { display: grid; grid-template-columns: minmax(300px, 1fr) 1.4fr; gap: 26px; }
.inputs .thumb button { width: 24px; height: 24px; padding: 0; border-radius: 50%; }
.script-box { min-height: 150px; max-height: 260px; font-size: 13px; }
.style-in { margin-top: 8px; font-size: 13px; }
button.big { height: 42px; padding: 0 26px; font-size: 15px; border-radius: 12px; }

.action { border-color: rgba(143,125,255,.22); }
.action.busy { border-color: rgba(143,125,255,.45); box-shadow: var(--shadow), 0 0 40px rgba(106,139,255,.12); }
.stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; position: relative; }
.stage { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(0,0,0,.22); border: 1px solid var(--line); }
.stage .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 13px; font-weight: 700;
  border: 1px solid var(--line-strong); color: var(--faint); }
.stage b { display: block; font-size: 13px; font-weight: 600; }
.stage span { font-size: 12px; color: var(--muted); }
.stage.done .dot { background: var(--ok-soft); color: var(--ok); border-color: rgba(61,220,151,.35); }
.stage.running { border-color: rgba(143,125,255,.45); background: var(--brand-soft); }
.stage.running .dot { border-color: rgba(143,125,255,.6); }
.stage.failed .dot { background: var(--bad-soft); color: var(--bad); border-color: rgba(255,95,118,.4); }
.stage.waiting { opacity: .65; }
.bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.06); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--grad); transition: width .8s var(--ease); }
.bar.live i { background-size: 200% 100%; animation: flow 2.4s linear infinite;
  background-image: linear-gradient(90deg, #8f7dff, #6a8bff, #3cd4ff, #6a8bff, #8f7dff); }
@keyframes flow { to { background-position: -200% 0; } }
.pct { min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.now { margin-top: 8px; font-size: 13px; color: #d9d3ff; min-height: 20px; }
.actions { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.summary b { font-size: 15px; }

.final video { margin-top: 4px; }
a.primary-link { background: var(--grad); border-color: transparent; color: #fff; }

.film .ph, .tile .ph { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 14px; text-align: center; width: 100%; }
.film .pbar { width: 70%; }
.film.live, .tile.live { border-color: rgba(143,125,255,.45); }
.film .desc { font-size: 12px; color: var(--muted); margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tile { background: rgba(0,0,0,.2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.tile .pic { height: 170px; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; }
.tile .pic img { max-width: 100%; max-height: 100%; cursor: zoom-in; }
.tile .body { padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.tile .history { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.tile .history img { width: 30px; height: 30px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line-strong); cursor: pointer; }

.card.empty p { color: var(--muted); }

/* ---- 片段编辑（2026-11-16）：参考图（删、传、@ 已有的图）和提示词 ---- */
.film .desc { font-size: 13px; color: var(--muted); margin: 6px 0; }
.film .desc.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ref-strip { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.ref-strip figure { margin: 0; width: 64px; cursor: zoom-in; position: relative; }
.ref-strip img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line-strong); display: block; }
.ref-strip figcaption { font-size: 11px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ref-strip.edit { gap: 10px; }
.ref-strip.edit figure, .ref-strip.edit .drop { width: 96px; }
.ref-strip.edit img { width: 96px; height: 96px; }
.ref-strip.edit .ref-x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; padding: 0; border-radius: 50%; background: rgba(10,12,18,.8); }
.ref-strip.edit .drop { height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.modal .box.wide { max-width: 980px; }
.seg-edit h3 { margin-top: 16px; }
.seg-edit textarea.code { font-size: 13px; line-height: 1.7; min-height: 260px; }
.mention-wrap { position: relative; }
.mention { position: absolute; z-index: 40; left: 12px; bottom: 100%; min-width: 260px; max-height: 280px; overflow: auto; background: var(--panel-solid);
  border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; }
.mention-item { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.mention-item img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; }
.mention-item.active, .mention-item:hover { background: var(--brand-soft); }
