/* =====================================================================
   漫剧生产工作台 · 视觉系统 v2
   设计语言：深空电影感 · 玻璃拟态 · 金蓝双强调色 · 细腻微动效
   ===================================================================== */

:root {
  /* 色板 */
  --bg: #07090f;
  --bg-2: #0b0e17;
  --panel: rgba(18, 22, 33, 0.72);
  --panel-solid: #121722;
  --panel2: rgba(24, 30, 44, 0.66);
  --panel2-solid: #181e2c;
  --border: rgba(120, 140, 180, 0.14);
  --border-strong: rgba(120, 140, 180, 0.24);
  --text: #eaeef7;
  --text-dim: #c3c9d8;
  --muted: #8490a8;
  --muted-2: #5f6b83;

  /* 强调色 */
  --accent: #5b8cff;
  --accent-2: #3d6ef0;
  --accent-soft: rgba(91, 140, 255, 0.14);
  --accent2: #34d399;
  --accent2-soft: rgba(52, 211, 153, 0.13);
  --gold: #d8b25c;
  --gold-soft: rgba(216, 178, 92, 0.14);
  --warn: #f0a020;
  --warn-soft: rgba(240, 160, 32, 0.13);
  --danger: #f0526e;
  --danger-soft: rgba(240, 82, 110, 0.13);

  /* 渐变 */
  --grad-primary: linear-gradient(135deg, #5b8cff 0%, #7a5bff 100%);
  --grad-success: linear-gradient(135deg, #34d399 0%, #2bb6c9 100%);
  --grad-gold: linear-gradient(135deg, #e6c370 0%, #c9963a 100%);

  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 18px 56px rgba(0, 0, 0, 0.5);
  --shadow-accent: 0 6px 22px rgba(91, 140, 255, 0.28);
  --shadow-gold: 0 6px 22px rgba(216, 178, 92, 0.24);

  /* 圆角 */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --font: "Inter", -apple-system, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  background:
    radial-gradient(1100px 700px at 82% -10%, rgba(91, 140, 255, 0.13), transparent 60%),
    radial-gradient(900px 650px at -8% 108%, rgba(216, 178, 92, 0.08), transparent 55%),
    radial-gradient(720px 520px at 50% 118%, rgba(122, 91, 255, 0.10), transparent 60%),
    var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------------- 顶栏 ---------------- */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; height: 60px;
  background: rgba(14, 18, 28, 0.82);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  position: relative; z-index: 20;
}
header::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(91,140,255,.4), rgba(216,178,92,.3), transparent);
  pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 20px;
  background: var(--grad-primary); box-shadow: var(--shadow-accent);
}
.brand-text { font-size: 16px; font-weight: 700; letter-spacing: .2px; display: flex; flex-direction: column; line-height: 1.12; }
.brand-text em {
  font-style: normal; font-size: 9.5px; font-weight: 600; letter-spacing: 2.4px;
  color: var(--muted-2); text-transform: uppercase; margin-top: 2px;
}
.header-right { display: flex; align-items: center; gap: 8px; }
.me-name { font-size: 13px; color: var(--accent); font-weight: 600; margin-right: 4px; }
.ready-dots { font-size: 11.5px; color: var(--muted); letter-spacing: .3px; }

.layout { display: flex; height: calc(100vh - 60px); }

/* ---------------- 侧栏 ---------------- */
#sidebar {
  width: 332px; min-width: 332px;
  background: rgba(13, 17, 26, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border);
  padding: 16px 14px; overflow-y: auto;
}
.card {
  background: var(--panel2); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 14px; margin-bottom: 14px;
  backdrop-filter: blur(8px);
}
.card-title {
  font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 1px;
  text-transform: uppercase; margin: 8px 0 10px;
}
.card-title::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 2px; background: var(--grad-gold); margin-right: 7px; vertical-align: 1px; }

.new-project textarea, .new-project input {
  width: 100%; background: rgba(8, 11, 18, 0.6); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 9px 11px; font-size: 13px; margin-bottom: 8px;
  transition: border-color .18s, box-shadow .18s;
}
.new-project textarea { height: 120px; resize: vertical; line-height: 1.55; }
.new-project textarea:focus, .new-project input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.new-project textarea::placeholder, .new-project input::placeholder { color: var(--muted-2); }

/* ---------------- 按钮 ---------------- */
.btn {
  background: rgba(120, 140, 180, 0.10); color: var(--text-dim);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  padding: 8px 15px; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all .18s ease; line-height: 1.4; letter-spacing: .2px;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--text); background: rgba(91,140,255,.08); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn.primary {
  background: var(--grad-primary); border-color: transparent; color: #fff;
  box-shadow: var(--shadow-accent); font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.1); color: #fff; box-shadow: 0 9px 28px rgba(91,140,255,.4); }
.btn.success { background: var(--grad-success); border-color: transparent; color: #fff; box-shadow: 0 6px 20px rgba(52,211,153,.25); font-weight: 600; }
.btn.success:hover { filter: brightness(1.08); color: #fff; }
.btn.danger { background: transparent; border-color: rgba(240,82,110,.5); color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }

.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: rgba(120,140,180,.08); color: var(--text); border-color: transparent; }
.btn.outline { background: transparent; border-color: var(--border-strong); color: var(--text-dim); }
.btn.outline:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }

.btn.small { padding: 5px 11px; font-size: 12px; }
.btn.tiny { padding: 3px 9px; font-size: 11px; line-height: 1.3; }
.btn.block { width: 100%; margin-top: 8px; padding: 12px; font-size: 15px; }

/* ---------------- 项目列表 ---------------- */
.project-list { list-style: none; }
.project-list li {
  padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer; margin-bottom: 5px;
  border: 1px solid transparent; display: flex; justify-content: space-between; align-items: center;
  transition: all .16s;
}
.project-list li:hover { background: var(--panel2); transform: translateX(2px); }
.project-list li.active { background: var(--accent-soft); border-color: rgba(91,140,255,.35); }
.project-list .p-name { font-size: 13.5px; font-weight: 500; }
.project-list .p-status { font-size: 11px; color: var(--muted); }

/* ---------------- 工作区 ---------------- */
#workspace { flex: 1; padding: 22px 26px; overflow-y: auto; }
.empty {
  color: var(--muted); text-align: center; margin-top: 120px; font-size: 14px;
  letter-spacing: .5px; opacity: .7;
}

/* ---------------- 空状态提示 ---------------- */
.empty-hero {
  position: relative; min-height: 62vh; border-radius: var(--r-lg); overflow: hidden;
  background: radial-gradient(120% 100% at 50% 100%, #10182e 0%, #06080f 55%, #03040a 100%);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.empty-hero .hero-copy {
  position: relative; z-index: 2; text-align: center; pointer-events: none;
  text-shadow: 0 4px 30px rgba(0,0,0,.8);
}
.empty-hero .hero-title {
  font-size: 34px; font-weight: 800; letter-spacing: 6px; color: #fff;
  background: linear-gradient(180deg, #ffffff 20%, #a8c6ff 60%, #6ea8ff 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: heroFloat 4s ease-in-out infinite;
}
.empty-hero .hero-sub {
  margin-top: 14px; font-size: 14px; letter-spacing: 1px; color: rgba(200,215,255,.72);
}
@keyframes heroFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

.section {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 20px 22px; margin-bottom: 18px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}
.section h2 { font-size: 16px; margin-bottom: 14px; font-weight: 700; letter-spacing: .3px; display: flex; align-items: center; gap: 8px; }
.section h2::before { content: ''; width: 4px; height: 16px; border-radius: 2px; background: var(--grad-primary); display: inline-block; }
.section h3 { font-size: 14px; margin: 16px 0 9px; color: var(--accent); font-weight: 600; }

/* ---------------- 阶段进度条 ---------------- */
.steps { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.step {
  flex: 1; min-width: 96px; text-align: center; padding: 12px 6px; border-radius: var(--r-md);
  font-size: 12px; font-weight: 600; background: var(--panel2-solid);
  border: 1px solid var(--border); color: var(--muted);
  transition: all .22s ease; position: relative;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.step .spin { width: 12px; height: 12px; border-width: 2px; flex: 0 0 auto; }
.step.running { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); animation: pulse 1.3s infinite; }
.step.done { border-color: rgba(52,211,153,.5); color: var(--accent2); background: var(--accent2-soft); }
.step.error { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.step.warn { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .58; } }

.progress-bar { height: 8px; background: rgba(120,140,180,.12); border-radius: 99px; overflow: hidden; margin: 10px 0; }
.progress-bar .fill { height: 100%; background: var(--grad-primary); transition: width .35s ease; border-radius: 99px; }
.task-msg { font-size: 12px; color: var(--muted); margin: 6px 0; }

/* ---------------- 闸口 ---------------- */
.gate { border: 1px solid rgba(240,160,32,.35); border-radius: var(--r-md); padding: 15px; margin: 13px 0; background: var(--warn-soft); }
.gate .gate-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 11px; }
.gate .gate-title { font-weight: 700; font-size: 14px; color: var(--warn); }
.gate-btns { display: flex; gap: 8px; }

/* ---------------- 资产表格 ---------------- */
table.assets { width: 100%; border-collapse: collapse; font-size: 13px; }
table.assets th, table.assets td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
table.assets th { background: var(--panel2-solid); color: var(--muted); font-weight: 600; font-size: 12px; }
table.assets input, table.assets textarea { width: 100%; background: rgba(8,11,18,.6); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 7px; font-size: 12px; }

/* ---------------- 图片网格 ---------------- */
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.img-cell { text-align: center; }
.img-cell img { width: 100%; border-radius: var(--r-sm); border: 1px solid var(--border); background: #000; }
.img-cell .cap { font-size: 12px; color: var(--muted); margin-top: 5px; }

/* ---------------- 分镜（旧列表） ---------------- */
.shot { border: 1px solid var(--border); border-radius: var(--r-md); padding: 11px; margin-bottom: 8px; background: var(--panel2); }
.shot .shot-head { display: flex; gap: 8px; align-items: center; margin-bottom: 7px; flex-wrap: wrap; }
.tag { font-size: 11px; padding: 2px 9px; border-radius: 6px; background: rgba(8,11,18,.6); border: 1px solid var(--border); color: var(--text-dim); }
.tag.action { border-color: rgba(240,160,32,.5); color: var(--warn); }
.shot .standing { font-size: 12px; color: var(--accent); margin: 5px 0; }
.shot .endstate { font-size: 12px; color: var(--muted); margin: 5px 0; }
.shot .vp { font-size: 12px; color: var(--text-dim); background: rgba(8,11,18,.55); padding: 9px; border-radius: 7px; white-space: pre-wrap; line-height: 1.55; }
.shot textarea { width: 100%; background: rgba(8,11,18,.6); color: var(--text); border: 1px solid var(--border); border-radius: 7px; padding: 9px; font-size: 12px; min-height: 60px; }

video.final { width: 100%; border-radius: var(--r-md); background: #000; }
.qc-report { font-size: 13px; }
.qc-report .pass { color: var(--accent2); }
.qc-report .fail { color: var(--danger); }

/* ---------------- 弹窗 ---------------- */
.modal { position: fixed; inset: 0; background: rgba(4, 6, 11, 0.72); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal.hidden { display: none; }
.modal-body {
  width: 700px; max-height: 86vh; overflow-y: auto;
  background: linear-gradient(180deg, rgba(26,32,47,.96), rgba(18,22,33,.98));
  border: 1px solid var(--border-strong); border-radius: var(--r-xl);
  padding: 26px 28px; box-shadow: var(--shadow-lg);
  animation: modalIn .24s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.modal-head h2 { font-size: 18px; font-weight: 700; letter-spacing: .3px; }
.hint { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; line-height: 1.6; }
.cfg-group { margin-bottom: 18px; }
.cfg-group .g-title { font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 9px; }
.cfg-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cfg-row label { width: 132px; font-size: 12.5px; color: var(--muted); flex-shrink: 0; }
.cfg-row input, .cfg-row select { flex: 1; background: rgba(8,11,18,.6); color: var(--text); border: 1px solid var(--border); border-radius: 7px; padding: 9px 10px; font-size: 13px; }
.cfg-row input:disabled { background: rgba(120,130,150,.13); color: var(--muted); cursor: not-allowed; }
.cfg-row input.filled { border-color: var(--accent2); }
.cfg-row input:focus, .cfg-row select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,140,255,.15); }
.modal-foot { margin-top: 18px; display: flex; justify-content: flex-end; gap: 8px; }

/* ---------------- 登录页 ---------------- */
.login-screen {
  position: fixed; inset: 0; z-index: 200; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1000px 720px at 72% 18%, rgba(91,140,255,.16), transparent 58%),
    radial-gradient(860px 640px at 22% 88%, rgba(216,178,92,.13), transparent 55%),
    radial-gradient(760px 600px at 50% 50%, rgba(122,91,255,.10), transparent 60%),
    var(--bg);
}
.login-screen.hidden { display: none; }
#login-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 1; display: block;
}
.login-aura {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; pointer-events: none;
  animation: auraFloat 9s ease-in-out infinite;
}
.aura-a { width: 520px; height: 520px; background: radial-gradient(circle, rgba(91,140,255,.35), transparent 70%); top: -140px; right: -80px; }
.aura-b { width: 460px; height: 460px; background: radial-gradient(circle, rgba(216,178,92,.3), transparent 70%); bottom: -140px; left: -60px; animation-delay: -4.5s; }
@keyframes auraFloat { 0%,100% { transform: translate(0,0); } 50% { transform: translate(22px,-20px); } }

.login-box {
  position: relative; width: 390px; padding: 42px 40px 38px;
  background: linear-gradient(180deg, rgba(26,32,47,.88), rgba(16,20,30,.92));
  border: 1px solid var(--border-strong); border-radius: 24px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(22px) saturate(1.3);
  z-index: 2;
}
.login-logo {
  width: 58px; height: 58px; margin: 0 auto 18px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  background: var(--grad-primary); box-shadow: var(--shadow-accent);
}
.brand-lg { font-size: 24px; font-weight: 800; text-align: center; letter-spacing: 1px; }
.brand-en { font-size: 10px; font-weight: 600; text-align: center; letter-spacing: 3.5px; color: var(--muted-2); margin-top: 6px; text-transform: uppercase; }
.login-sub { font-size: 12.5px; color: var(--muted); text-align: center; margin: 20px 0 26px; letter-spacing: .5px; }
.login-box input {
  width: 100%; background: rgba(8,11,18,.6); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
  font-size: 14px; margin-bottom: 12px; transition: border-color .18s, box-shadow .18s;
}
.login-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-box input::placeholder { color: var(--muted-2); }
.login-err { color: var(--danger); font-size: 12px; margin-top: 10px; min-height: 16px; text-align: center; }

/* ---------------- 模型选择 ---------------- */
.model-select { margin-bottom: 8px; }
.model-select label { display: block; font-size: 11px; color: var(--muted); margin: 7px 0 3px; font-weight: 500; }
.model-select select {
  width: 100%; background: rgba(8,11,18,.6); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px; font-size: 13px;
  transition: border-color .18s;
}
.model-select select:focus { outline: none; border-color: var(--accent); }

/* ---------------- 模型列表 ---------------- */
.models-list { display: flex; flex-direction: column; gap: 9px; margin-bottom: 13px; }
.model-item { border: 1px solid var(--border); border-radius: var(--r-md); padding: 11px 13px; background: var(--panel2); transition: border-color .16s; }
.model-item:hover { border-color: var(--border-strong); }
.model-item .mi-head { display: flex; justify-content: space-between; align-items: center; }
.model-item .mi-name { font-weight: 700; font-size: 14px; }
.model-item .mi-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.model-item .mi-tag { font-size: 11px; padding: 2px 9px; border-radius: 6px; background: rgba(8,11,18,.6); border: 1px solid var(--border); color: var(--muted); }
.model-edit { border: 1px solid rgba(91,140,255,.4); border-radius: var(--r-md); padding: 15px; margin-top: 13px; background: var(--accent-soft); }
.model-edit input, .model-edit select { width: 100%; background: rgba(8,11,18,.6); color: var(--text); border: 1px solid var(--border); border-radius: 7px; padding: 8px; font-size: 13px; margin-bottom: 8px; }
.model-edit label { display: block; font-size: 11px; color: var(--muted); margin: 7px 0 3px; }

/* ---------------- 积分面板 ---------------- */
.modal-body.wide { width: 880px; }
.credits-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.credits-tabs .tab {
  background: var(--panel2-solid); border: 1px solid var(--border); color: var(--muted);
  border-radius: var(--r-sm); padding: 8px 15px; font-size: 13px; cursor: pointer; transition: all .16s;
}
.credits-tabs .tab:hover { border-color: var(--accent); color: var(--text); }
.credits-tabs .tab.active { background: var(--grad-primary); border-color: transparent; color: #fff; font-weight: 600; box-shadow: var(--shadow-accent); }
.credit-stat { display: flex; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.credit-card { flex: 1; min-width: 140px; background: var(--panel2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px; }
.credit-card .cc-num { font-size: 26px; font-weight: 800; color: var(--accent); letter-spacing: .5px; }
.credit-card .cc-label { font-size: 12px; color: var(--muted); margin-top: 5px; }
table.credits { width: 100%; border-collapse: collapse; font-size: 12px; }
table.credits th, table.credits td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
table.credits th { background: var(--panel2-solid); color: var(--muted); font-weight: 600; }
.credits-tabs .tab.admin-only.hidden { display: none; }
.amount-neg { color: var(--danger); }
.amount-pos { color: var(--accent2); }

/* ---------------- 通用表单 ---------------- */
.form-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.form-row input, .form-row select { background: rgba(8,11,18,.6); color: var(--text); border: 1px solid var(--border); border-radius: 7px; padding: 8px; font-size: 13px; }
.form-row input[type=text], .form-row input[type=password] { flex: 1; }
.member-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--r-sm); margin-bottom: 6px; background: var(--panel2); }
.member-row .mr-name { font-size: 13px; }
.member-row .mr-role { font-size: 11px; color: var(--muted); }

/* ---------------- 成片版本对比 ---------------- */
.ver-list { display: flex; flex-direction: column; gap: 6px; }
.ver-item { display: flex; align-items: center; gap: 12px; padding: 8px 11px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--panel2); font-size: 13px; }
.ver-item .ver-no { font-weight: 700; color: var(--accent); min-width: 38px; }
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.cmp-grid video { width: 100%; border-radius: var(--r-sm); background: #000; }
.cmp-label { font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.ver-compare { margin-top: 8px; }

/* ---------------- 运行日志 ---------------- */
.logs { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-height: 420px; overflow-y: auto; }
.log-item { border: 1px solid var(--border); border-left: 3px solid var(--muted); border-radius: var(--r-sm); padding: 9px 11px; background: var(--panel2); font-size: 12px; }
.log-item.log-warn { border-left-color: #e0a800; }
.log-item.log-error { border-left-color: var(--danger); background: var(--danger-soft); }
.log-head { display: flex; gap: 10px; align-items: center; margin-bottom: 3px; }
.log-time { color: var(--muted); font-size: 11px; }
.log-stage { color: var(--accent); font-weight: 600; }
.log-level { font-size: 10px; padding: 1px 7px; border-radius: 5px; background: rgba(8,11,18,.6); color: var(--muted); }
.log-item.log-error .log-level { background: var(--danger); color: #fff; }
.log-item.log-warn .log-level { background: #e0a800; color: #fff; }
.log-msg { word-break: break-all; }
.log-detail { margin-top: 6px; padding: 9px; background: rgba(8,11,18,.55); border-radius: 7px; white-space: pre-wrap; word-break: break-all; font-size: 11px; max-height: 200px; overflow-y: auto; }

/* ---------------- 镜头视频即显列表 ---------------- */
.shot-video-list { display: flex; flex-direction: column; gap: 11px; }
.shot-video-row { display: flex; gap: 13px; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--r-md); padding: 11px; background: var(--panel2); transition: border-color .16s; }
.shot-video-row.fail { border-color: rgba(240,82,110,.5); background: var(--danger-soft); }
.shot-video-row.retrying { border-color: var(--accent); background: var(--accent-soft); }
.shot-video-row.pending { opacity: .72; }
.shot-video-row .svr-no { min-width: 56px; background: var(--grad-primary); color: #fff; border-radius: 7px; padding: 4px 9px; font-size: 13px; font-weight: 700; text-align: center; white-space: nowrap; }
.shot-video-row.fail .svr-no { background: var(--danger); }
.shot-video-row .svr-body { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.shot-video-row .svr-body video { width: 100%; max-width: 420px; border-radius: var(--r-sm); background: #000; aspect-ratio: 16/9; object-fit: contain; }
.shot-video-row .svr-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.shot-video-row .svr-tools .svr-ver {
  background: rgba(8,11,18,.6); color: var(--text); border: 1px solid var(--border);
  border-radius: 7px; padding: 6px 8px; font-size: 12px; max-width: 200px;
}
.shot-video-row .svr-err { font-size: 12px; color: var(--danger); word-break: break-all; }
.shot-video-row .svr-err.pending { color: var(--muted); }
.shot-video-row .svr-err.retrying { color: var(--accent); display: flex; align-items: center; gap: 8px; font-weight: 600; }
.shot-video-row .retrying-tag { font-size: 12px; color: var(--accent); font-weight: 600; white-space: nowrap; }
.shot-video-row .svr-meta { max-width: 300px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.shot-video-row .svr-action { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ---------------- 转圈 ---------------- */
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(91,140,255,.25); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.25); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; margin-right: 6px; }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.92);
  max-width: 72vw; padding: 15px 24px; border-radius: 12px; font-size: 14px; line-height: 1.6;
  background: var(--panel2-solid); color: var(--text); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg); z-index: 9999; opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease; text-align: center; word-break: break-word;
  backdrop-filter: blur(14px);
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.toast-success { border-color: var(--accent2); box-shadow: 0 12px 44px rgba(52,211,153,.3); }
.toast-error { border-color: var(--danger); box-shadow: 0 12px 44px rgba(240,82,110,.3); }

/* ---------------- 资产编辑器 ---------------- */
.assets .row-del { color: var(--danger); cursor: pointer; background: none; border: none; font-size: 13px; padding: 2px 7px; border-radius: 5px; }
.assets .row-del:hover { background: var(--danger-soft); }
.asset-add-btn { font-size: 12px; margin-top: 7px; }
.dup-banner {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  border: 1px solid rgba(240,160,32,.4); background: var(--warn-soft); color: var(--text);
  border-radius: var(--r-sm); padding: 9px 13px; margin: 7px 0; font-size: 13px;
}
.dup-banner b { color: var(--warn); }

/* ---------------- 项目列表：文件夹分组 ---------------- */
.project-list .folder { margin-bottom: 3px; }
.project-list .folder-head {
  display: flex; align-items: center; gap: 7px; padding: 9px 11px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--panel2);
  font-size: 13px; transition: all .16s;
}
.project-list .folder-head:hover { border-color: var(--accent); transform: translateX(2px); }
.project-list .folder-caret { transition: transform .15s; color: var(--muted); font-size: 11px; }
.project-list .folder.open .folder-caret { transform: rotate(90deg); }
.project-list .folder-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-list .folder.active .folder-head { border-color: var(--accent); background: var(--accent-soft); }
.project-list .folder-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); flex-shrink: 0; box-shadow: 0 0 8px rgba(240,160,32,.5); }
.project-list .folder-dot.done { background: var(--accent2); box-shadow: 0 0 8px rgba(52,211,153,.5); }
.project-list .folder-count { font-size: 11px; color: var(--muted); }
.project-list .folder-sub { display: none; margin: 3px 0 7px 11px; border-left: 2px solid var(--border-strong); padding-left: 7px; }
.project-list .folder-sub.open { display: block; }
.project-list .ep-item { display: flex; justify-content: space-between; gap: 8px; padding: 7px 9px; cursor: pointer; border-radius: 7px; font-size: 12px; transition: background .14s; }
.project-list .ep-item:hover { background: var(--panel2); }
.project-list .ep-item.active { background: var(--accent-soft); border: 1px solid rgba(91,140,255,.35); }
.project-list .ep-item .ep-no {
  min-width: 22px; height: 22px; border-radius: 50%; background: rgba(8,11,18,.6);
  border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--muted); font-weight: 700; flex-shrink: 0;
}
.project-list .ep-item.active .ep-no { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------------- 通用隐藏 ---------------- */
.hidden { display: none !important; }

/* ---------------- 全集导航 ---------------- */
.ep-nav-wrap { margin: 12px 0 14px; padding: 10px 13px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel2); }
.ep-nav-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.ep-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.ep-nav-item {
  padding: 4px 11px; border-radius: 7px; border: 1px solid var(--border); cursor: pointer;
  font-size: 12px; color: var(--text-dim); white-space: nowrap; transition: all .14s;
}
.ep-nav-item:hover { border-color: var(--accent); color: var(--text); }
.ep-nav-item.active { background: var(--grad-primary); color: #fff; border-color: transparent; box-shadow: var(--shadow-accent); }
.ep-nav-item.done::after { content: ' ✓'; color: var(--accent2); font-weight: 700; }
.ep-nav-item.active.done::after { color: #fff; }

/* ---------------- 步骤导航可点击 ---------------- */
.steps .step { cursor: pointer; }
.steps .step:hover { border-color: var(--accent); opacity: .92; }
.steps .step.active { background: var(--grad-primary); border-color: transparent; color: #fff; font-weight: 700; box-shadow: var(--shadow-accent); }
.steps .step.active.done { color: #fff; }
.tag.done { background: var(--accent2-soft); color: var(--accent2); border-color: rgba(52,211,153,.4); }

/* ---------------- 资产分类 tab ---------------- */
.asset-tabs-row { display: flex; align-items: center; gap: 12px; margin: 5px 0 14px; flex-wrap: wrap; }
.asset-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.asset-tab {
  background: var(--panel2-solid); border: 1px solid var(--border); color: var(--muted);
  border-radius: var(--r-sm); padding: 8px 17px; font-size: 13px; cursor: pointer; transition: all .16s;
}
.asset-tab:hover { border-color: var(--accent); color: var(--text); }
.asset-tab.active { background: var(--grad-primary); border-color: transparent; color: #fff; font-weight: 600; box-shadow: var(--shadow-accent); }

/* ---------------- 资产卡片 ---------------- */
.asset-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.asset-card {
  background: var(--panel2); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.asset-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }

.asset-card-views { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; padding: 10px; background: rgba(8,11,18,.5); border-bottom: 1px solid var(--border); }
.av-main {
  position: relative; flex: 1 1 100%; aspect-ratio: 1/1; border-radius: 10px; overflow: hidden;
  background: #000; cursor: zoom-in; border: 1px solid var(--border);
}
.av-main:hover { border-color: var(--accent); }
.av-main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.av-main.empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; background: var(--panel2-solid); cursor: default; }
.av-dl { position: absolute; right: 8px; bottom: 8px; z-index: 3; opacity: .88; background: rgba(0,0,0,.6); color: #fff; border-color: rgba(255,255,255,.2); }
.av-dl:hover { opacity: 1; }
.av-zoom { position: absolute; left: 8px; bottom: 8px; z-index: 3; opacity: .88; background: rgba(0,0,0,.6); color: #fff; border-color: rgba(255,255,255,.2); }
.av-zoom:hover { opacity: 1; }

.av-variant {
  position: relative; aspect-ratio: 1/1; border-radius: 8px; overflow: hidden;
  background: #000; cursor: zoom-in; border: 1px solid var(--border); width: 60px; flex-shrink: 0;
}
.av-variant img { width: 100%; height: 100%; object-fit: cover; }
.av-variant:hover { border-color: var(--accent); }
.av-variant span {
  position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-size: 9px;
  color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.88)); padding: 12px 2px 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.asset-card-body { padding: 16px; display: flex; flex-direction: column; flex: 1; }
.asset-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.asset-card-head .asset-name {
  flex: 1; background: rgba(8,11,18,.6); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 10px 13px; font-size: 15px; font-weight: 600;
}
.asset-card-tags { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.tag.used { background: var(--accent2-soft); color: var(--accent2); border-color: rgba(52,211,153,.4); font-weight: 600; }
.tag.eps { background: var(--accent-soft); color: #7fa6ff; border-color: rgba(91,140,255,.4); }
.asset-card label { display: block; font-size: 12px; color: var(--muted); margin: 9px 0 4px; font-weight: 600; }
.asset-card textarea, .asset-card input {
  width: 100%; background: rgba(8,11,18,.6); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 10px; font-size: 13px;
}
.asset-card textarea { resize: vertical; min-height: 54px; }
.asset-card-actions { margin-top: auto; padding-top: 13px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.asset-card-actions .asset-gen-btn { flex: 1; }
.asset-card-actions .asset-ver {
  background: rgba(8,11,18,.6); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 8px 9px; font-size: 12px; max-width: 180px;
}

.asset-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; flex-wrap: wrap; }
.asset-toolbar .toolbar-lbl { font-size: 12px; color: var(--muted); }
.asset-toolbar select { background: rgba(8,11,18,.6); color: var(--text); border: 1px solid var(--border); border-radius: 7px; padding: 6px 9px; font-size: 12px; }

/* ---------------- 大图预览 ---------------- */
.lightbox { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.lightbox.hidden { display: none; }
.lightbox-mask { position: absolute; inset: 0; background: rgba(3,5,9,.86); backdrop-filter: blur(6px); }
.lightbox-body { position: relative; z-index: 2; max-width: 92vw; max-height: 92vh; display: flex; flex-direction: column; align-items: center; gap: 11px; }
.lightbox-body img { max-width: 90vw; max-height: 78vh; border-radius: 12px; box-shadow: var(--shadow-lg); background: #000; }
.lightbox-body video { max-width: 92vw; max-height: 82vh; border-radius: 12px; box-shadow: var(--shadow-lg); background: #000; }
.video-lightbox-body video { width: min(92vw, 1400px); aspect-ratio: 16/9; }
.lightbox-cap { color: #fff; font-size: 13px; }
.lightbox-close { background: rgba(255,255,255,.14); color: #fff; }

/* ---------------- 分镜卡片 ---------------- */
.sb-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.sb-toolbar-spacer { flex: 1; }
.shot-card { border: 1px solid var(--border); border-radius: var(--r-md); padding: 13px; margin-bottom: 10px; background: var(--panel2); transition: border-color .16s; }
.shot-card:hover { border-color: var(--border-strong); }
.shot-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; flex-wrap: wrap; }
.shot-card-head .shot-check { width: 18px; height: 18px; cursor: pointer; accent-color: var(--accent); flex: 0 0 auto; }
.shot-card-head .shot-no {
  background: var(--grad-primary); color: #fff; border-radius: 7px; padding: 3px 11px;
  font-size: 13px; font-weight: 700; white-space: nowrap;
}
.shot-card-head .shot-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.shot-card-head .shot-camera { margin-left: auto; font-size: 12px; color: var(--muted); }
.shot-action {
  font-size: 13px; color: var(--text-dim); background: rgba(8,11,18,.55); border-left: 3px solid var(--accent);
  padding: 9px 11px; border-radius: 7px; margin-bottom: 9px; line-height: 1.55;
}
.shot-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 9px; }
.sg-item {
  background: rgba(8,11,18,.5); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px;
  display: flex; flex-direction: column; gap: 4px; min-height: 54px;
}
.sg-item .sg-k { font-size: 11px; color: var(--accent); font-weight: 600; }
.sg-item .sg-v { font-size: 12px; color: var(--text-dim); line-height: 1.55; word-break: break-word; }
.shot-dialogue {
  font-size: 12px; color: var(--warn); background: var(--warn-soft);
  border: 1px solid rgba(240,160,32,.28); border-radius: 7px; padding: 7px 11px; margin-bottom: 9px;
}
.shot-controls { display: flex; gap: 8px; align-items: center; margin: 7px 0 9px; font-size: 12px; flex-wrap: wrap; }
.shot-controls label { color: var(--muted); }
.shot-controls select, .shot-controls input[type=number] {
  background: rgba(8,11,18,.6); color: var(--text); border: 1px solid var(--border);
  border-radius: 7px; padding: 7px 9px; font-size: 12px;
}
.vp-label { font-size: 11px; color: var(--muted); margin: 5px 0 5px; }
.shot-card textarea {
  width: 100%; background: rgba(8,11,18,.6); color: var(--text); border: 1px solid var(--border);
  border-radius: 7px; padding: 9px; font-size: 12px; min-height: 120px; resize: vertical; line-height: 1.6;
}

/* ---------------- 资产高级生成弹窗 ---------------- */
#asset-gen-modal textarea {
  width: 100%; background: rgba(8,11,18,.6); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 11px; font-size: 13px; resize: vertical; min-height: 96px;
}
#asset-gen-modal label { display: block; font-size: 12px; color: var(--muted); margin: 9px 0 4px; }

/* ---------------- 深色滚动条 ---------------- */
* { scrollbar-width: thin; scrollbar-color: rgba(120,140,180,.35) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(120,140,180,.3); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(120,140,180,.5); background-clip: padding-box; }
*::-webkit-scrollbar-corner { background: transparent; }

/* ---------------- 响应式微调 ---------------- */
@media (max-width: 1180px) {
  .shot-grid { grid-template-columns: 1fr 1fr; }
  .asset-cards { grid-template-columns: 1fr; }
}

/* ---------------- 项目列表右键菜单 ---------------- */
.ctx-menu {
  position: fixed; z-index: 9999; min-width: 140px; padding: 5px;
  background: var(--panel2); border: 1px solid var(--border-strong, var(--border));
  border-radius: 9px; box-shadow: 0 14px 44px rgba(0,0,0,.5);
}
.ctx-item {
  padding: 9px 12px; font-size: 13px; cursor: pointer; border-radius: 6px; color: var(--text);
}
.ctx-item:hover { background: var(--accent-soft); }

/* ---------------- 统一下拉框外观 ---------------- */
select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238a93a8' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
  padding-right: 30px; cursor: pointer;
}
select:focus, input:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,140,255,.14);
}
input[type=checkbox] { cursor: pointer; }
