/* ============================================================================
   JLflow · 剧流 —— 视觉系统
   ----------------------------------------------------------------------------
   设计取自调色间（grading suite）的视觉语法：

   · 色温轴      钨丝灯 3200K 的暖底，配日光 5600K 的冷蓝强调色。
                 这是摄影指导每天在用的那根轴，也是这套界面唯一的色彩主张。
                 暖底冷点，正好和常见的"冷底暖点"反过来。
   · 语义独立    好/警告/严重走自己的绿-琥珀-砖红，不占强调色的位。
   · 胶片齿孔    侧栏那道孔位不是装饰：它标出流水线是有方向的序列。
   · 时间码      时长、镜号、延迟一律等宽 + tabular-nums，扫一眼能对齐比较。

   字体不外链：本地应用断网也得好看。Windows 自带的 Segoe UI Variable /
   Cascadia Mono 本身就够体面，微软雅黑接中文。
   ========================================================================== */

:root {
  color-scheme: dark;

  /* ── 钨丝暖底：不是中性灰，偏了一点点红黄，和冷强调色互为对照 ── */
  --ground:      #16130F;
  --surface:     #1D1913;
  --surface-2:   #262019;
  --surface-3:   #302921;
  --line:        #352D23;
  --line-soft:   #262019;

  --ink:         #EFE8DC;
  --ink-dim:     #A99B86;
  --ink-faint:   #6F6455;

  /* ── 日光冷蓝：全站唯一强调色 ── */
  --beam:        #6BA8DC;
  --beam-deep:   #3E7CB1;
  --beam-wash:   rgba(107, 168, 220, 0.12);

  /* ── 语义色：与强调色分开的三档 ── */
  --good:        #7BB369;
  --good-wash:   rgba(123, 179, 105, 0.13);
  --caution:     #D9A441;
  --caution-wash:rgba(217, 164, 65, 0.13);
  --alarm:       #D4553F;
  --alarm-wash:  rgba(212, 85, 63, 0.13);

  --slate:       #E8DFD0;   /* 场记板白 */

  --display: "Segoe UI Variable Display", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", system-ui, sans-serif;
  --body:    "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", system-ui, sans-serif;
  --code:    "Cascadia Mono", "Cascadia Code", Consolas, "SF Mono", "JetBrains Mono", ui-monospace, monospace;

  --r-sm: 5px;
  --r:    8px;
  --r-lg: 12px;
}

/* 白天在办公室看分镜的第二套：分镜纸 / 新闻纸 */
:root[data-theme="light"] {
  color-scheme: light;
  --ground:      #F5F1E8;
  --surface:     #FFFCF6;
  --surface-2:   #EFE9DC;
  --surface-3:   #E5DDCC;
  --line:        #D8CFBB;
  --line-soft:   #E7E0D0;

  --ink:         #211C15;
  --ink-dim:     #6A5F4E;
  --ink-faint:   #9A8E7B;

  --beam:        #2E6E9E;
  --beam-deep:   #1F5580;
  --beam-wash:   rgba(46, 110, 158, 0.10);

  --good:        #4A8B3D;
  --good-wash:   rgba(74, 139, 61, 0.11);
  --caution:     #9C6F13;
  --caution-wash:rgba(156, 111, 19, 0.12);
  --alarm:       #B03A24;
  --alarm-wash:  rgba(176, 58, 36, 0.11);

  --slate:       #2A241B;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ground);
  color: var(--ink);
  font: 13.5px/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
}

body { background: var(--ground); }

::selection { background: var(--beam-wash); }

/* 数字要对齐 —— 延迟、评分、时长都是拿来比大小的 */
.num, .mono, code, pre, td.mono, th.mono, input[type=number] {
  font-family: var(--code);
  font-variant-numeric: tabular-nums;
}

/* 微标签：调色间的仪表盘腔调 */
.eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

#app { display: flex; height: 100vh; }

/* ══════════════════════ 侧栏 ══════════════════════ */

.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* 胶片齿孔：标出这条边是"片基"，流水线沿着它走 */
.sidebar::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: 7px;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0 9px,
    var(--line-soft) 9px 15px,
    transparent 15px 24px
  );
  opacity: .9;
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid var(--line-soft);
}

/* 场记板：斜纹取自 clapperboard 的黑白条 */
.brand-slate {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background:
    repeating-linear-gradient(115deg,
      var(--slate) 0 6px,
      var(--ground) 6px 12px);
  border: 1px solid var(--line);
  flex: 0 0 auto;
}
.brand-name {
  font-family: var(--display);
  font-size: 16px; font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.2;
}
.brand-sub { font-size: 10.5px; color: var(--ink-faint); letter-spacing: .06em; }

.nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 1px; flex: 1; }

.nav-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border: 0;
  border-radius: var(--r);
  background: transparent;
  color: var(--ink-dim);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.nav-item.active .nav-num { color: var(--beam); }
.nav-item:focus-visible { outline: 2px solid var(--beam); outline-offset: -2px; }

.nav-num {
  font-family: var(--code);
  font-size: 10px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* ── 菜单里的流水线 ──
   挂在「创作台」下面，缩进一格并靠一条竖线连起来，表明它们从属于那一页，
   而不是七个平级的新页面。 */
.nav-sub {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 2px 0 8px 20px;
  padding-left: 10px;
  border-left: 1px solid var(--line-soft);
}
.nav-sub-empty { font-size: 11px; color: var(--ink-faint); padding: 6px 10px; line-height: 1.5; }

.nav-step {
  display: grid;
  grid-template-columns: 18px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border: 0;
  border-radius: var(--r);
  background: transparent;
  color: var(--ink-dim);
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.nav-step:hover { background: var(--surface-2); color: var(--ink); }
.nav-step.active { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.nav-step.active .nav-step-num { color: var(--beam); }
.nav-step:focus-visible { outline: 2px solid var(--beam); outline-offset: -2px; }

.nav-step-num {
  font-family: var(--code);
  font-size: 9.5px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.nav-step-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-step-count {
  font-family: var(--code);
  font-size: 10px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
/* 对勾这一列宽度固定，免得有勾没勾的两行文字左右跳 */
.nav-step-mark { width: 12px; text-align: center; font-size: 12px; color: var(--ink-faint); }
.nav-step.done .nav-step-mark { color: var(--good); }
.nav-step.partial .nav-step-mark { color: var(--caution); }
.nav-step.done .nav-step-count { color: var(--good); }

/* ── 右下角运行状态 ──
   只有它随进度重画，页面其余部分一动不动 —— 生成期间正是拿来改后面几镜文案的。 */
.job-hud {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  width: 292px;
  max-width: calc(100vw - 36px);
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-1);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .34);
  font-size: 12px;
  color: var(--ink-dim);
}
.job-hud[hidden] { display: none; }
/* 结果提示：成了描一道绿边，败了描一道红边。扫一眼就知道要不要去看 */
.job-hud.good { border-color: color-mix(in srgb, var(--good) 55%, var(--line)); }
.job-hud.bad { border-color: color-mix(in srgb, var(--alarm) 60%, var(--line)); }
.job-hud.good .job-hud-head { color: var(--good); }
.job-hud.bad .job-hud-head { color: var(--alarm); }
.job-hud-head { display: flex; align-items: center; gap: 7px; color: var(--ink); font-size: 12.5px; }
.job-hud-x {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--ink-faint);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.job-hud-x:hover { color: var(--ink); }
.job-hud-line {
  margin-top: 7px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-dim);
  max-height: 64px;
  overflow: hidden;
}
.job-hud-foot {
  margin-top: 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.sidebar-foot {
  padding: 13px 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 11px;
  display: flex; flex-direction: column; gap: 4px;
}
.stat-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stat-row > span { color: var(--ink-faint); font-size: 10.5px; letter-spacing: .04em; }
.stat-row code {
  font-size: 10px; color: var(--ink-dim);
  max-width: 118px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ══════════════════════ 主区 ══════════════════════ */

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 54px; flex: 0 0 54px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.topbar h1 {
  font-family: var(--display);
  font-size: 15px; font-weight: 650; margin: 0;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.topbar-right { display: flex; align-items: center; gap: 9px; min-width: 0; }

/* 信号链：chat → vision → image → video，像调音台的通道条 */
.chain {
  display: flex; align-items: center; gap: 0;
  font-family: var(--code); font-size: 10.5px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--ground);
  /* 横向可滚而不是截断：最后一段被切掉的话，等于少了一条排错线索 */
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
}
.chain::-webkit-scrollbar { display: none; }
.chain-seg {
  padding: 4px 10px;
  color: var(--ink-dim);
  white-space: nowrap;
  border-right: 1px solid var(--line-soft);
}
.chain-seg:last-child { border-right: 0; }
.chain-seg b { color: var(--ink); font-weight: 600; }
.chain-seg.off { color: var(--ink-faint); }

.view { flex: 1; overflow: auto; padding: 22px; }
.view-inner { max-width: 1280px; }

/* ══════════════════════ 控件 ══════════════════════ */

.btn {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  padding: 7px 15px;
  border-radius: var(--r);
  font: inherit; font-size: 12.5px; font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover:not(:disabled) { background: var(--surface-3); border-color: var(--ink-faint); }
.btn:focus-visible { outline: 2px solid var(--beam); outline-offset: 2px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: var(--beam-deep); border-color: var(--beam-deep); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--beam); border-color: var(--beam); }
.btn.ghost { background: transparent; }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn.danger { color: var(--alarm); border-color: var(--line); }
.btn.danger:hover:not(:disabled) { background: var(--alarm-wash); border-color: var(--alarm); }
.btn.sm { padding: 4px 10px; font-size: 11.5px; }

input[type=text], input[type=password], input[type=number], select, textarea {
  background: var(--ground);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: var(--r);
  padding: 8px 11px;
  font: inherit; font-size: 12.5px;
  width: 100%;
}
select { cursor: pointer; }
textarea { font-family: var(--code); font-size: 12px; line-height: 1.6; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--beam); box-shadow: 0 0 0 3px var(--beam-wash); }
input::placeholder, textarea::placeholder { color: var(--ink-faint); }

label {
  display: block;
  font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 6px;
}

.field { margin-bottom: 13px; }
.field-hint { font-size: 11.5px; color: var(--ink-faint); margin-top: 5px; line-height: 1.5; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 17px 18px;
  margin-bottom: 16px;
}
.panel-title {
  font-family: var(--display);
  font-size: 13.5px; font-weight: 650; margin: 0 0 5px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.panel-hint { font-size: 12px; color: var(--ink-faint); margin: 0 0 14px; line-height: 1.55; max-width: 68ch; }

.row { display: flex; gap: 10px; align-items: flex-end; }
.row > * { flex: 1; min-width: 0; }
.row > .shrink { flex: 0 0 auto; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 13px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 13px; }
/* 能力路由每格里塞了两个下拉，比普通两列需要更多宽度，否则服务商名字会被截断 */
.route-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 13px 18px; }
.stack { display: flex; flex-direction: column; gap: 13px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--code); font-size: 10.5px; font-variant-numeric: tabular-nums;
  padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-dim);
  white-space: nowrap;
}
.badge.ok    { color: var(--good);    border-color: color-mix(in srgb, var(--good) 35%, transparent);    background: var(--good-wash); }
.badge.warn  { color: var(--caution); border-color: color-mix(in srgb, var(--caution) 35%, transparent); background: var(--caution-wash); }
.badge.err   { color: var(--alarm);   border-color: color-mix(in srgb, var(--alarm) 35%, transparent);   background: var(--alarm-wash); }
.badge.beam  { color: var(--beam);    border-color: color-mix(in srgb, var(--beam) 35%, transparent);    background: var(--beam-wash); }

.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; background: var(--ink-faint); flex: 0 0 auto; }
.dot.ok { background: var(--good); }
.dot.err { background: var(--alarm); }
.dot.warn { background: var(--caution); }

.empty {
  color: var(--ink-faint); font-size: 13px;
  padding: 44px 20px; text-align: center;
  border: 1px dashed var(--line); border-radius: var(--r-lg);
}
.empty b { color: var(--ink-dim); display: block; margin-bottom: 6px; font-weight: 600; }

/* ══════════════════════ 流水线阶段轨 ══════════════════════ */

/* 编号是真序列：设定集必须在分镜之前，分镜必须在出图之前。 */
.stage-track {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.stage-chip {
  display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r);
  padding: 9px 13px;
  cursor: pointer;
  font: inherit; font-size: 12.5px;
  color: var(--ink-dim);
  position: relative;
  transition: border-color .12s, color .12s;
}
.stage-chip:hover:not(:disabled) { border-color: var(--ink-faint); color: var(--ink); }
.stage-chip:focus-visible { outline: 2px solid var(--beam); outline-offset: 2px; }
.stage-chip:disabled { opacity: .45; cursor: not-allowed; }
.stage-chip .stage-num {
  font-family: var(--code); font-size: 10px;
  color: var(--ink-faint); font-variant-numeric: tabular-nums;
}
.stage-chip.done { color: var(--ink); border-color: color-mix(in srgb, var(--good) 32%, var(--line)); }
.stage-chip.done .stage-num { color: var(--good); }
.stage-chip.partial { border-color: color-mix(in srgb, var(--caution) 32%, var(--line)); }
.stage-chip.partial .stage-num { color: var(--caution); }
.stage-chip.running { border-color: var(--beam); color: var(--ink); }
.stage-chip.running .stage-num { color: var(--beam); }

/* ══════════════════════ 分镜卡 ══════════════════════ */

.shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 14px; }

.shot-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
}
/* 待复核的镜头挂一道琥珀色警示条 —— 不用读文字就知道哪张要看 */
.shot-card.flagged { border-color: color-mix(in srgb, var(--caution) 40%, var(--line)); }
.shot-card.flagged .shot-thumb { box-shadow: inset 0 3px 0 var(--caution); }
.shot-card.failed { border-color: color-mix(in srgb, var(--alarm) 40%, var(--line)); }
.shot-card.failed .shot-thumb { box-shadow: inset 0 3px 0 var(--alarm); }

.shot-thumb {
  aspect-ratio: 16 / 9;
  background: var(--ground);
  display: grid; place-items: center;
  color: var(--ink-faint); font-size: 11.5px;
  position: relative;
}
.shot-thumb img, .shot-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }

.shot-body { padding: 11px 13px 12px; display: flex; flex-direction: column; gap: 7px; }
.shot-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.shot-no {
  font-family: var(--code); font-size: 10.5px; letter-spacing: .06em;
  color: var(--ink-faint); font-variant-numeric: tabular-nums;
}
.shot-desc {
  color: var(--ink-dim); font-size: 12px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.shot-meta { display: flex; gap: 5px; flex-wrap: wrap; }

/* 描述可点即改：自动拆的分镜写偏一句，后面每次重出都是在错的基础上重来 */
.shot-desc.editable { cursor: text; border-radius: 4px; margin: -2px -4px; padding: 2px 4px; }
.shot-desc.editable:hover { background: var(--ground); color: var(--ink); }
.shot-edit-btn {
  border: 1px solid var(--line); background: transparent; color: var(--ink-faint);
  border-radius: 4px; padding: 1px 6px; font: inherit; font-size: 10.5px;
  cursor: pointer; flex: none;
}
.shot-edit-btn:hover { border-color: var(--beam); color: var(--ink); }
.shot-edit { display: flex; flex-direction: column; gap: 5px; }
.shot-edit label { margin-bottom: 0; font-size: 10.5px; }
.shot-edit textarea, .shot-edit input { font-size: 11.5px; padding: 5px 7px; }
.shot-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 8px; }
.shot-edit-tip { font-size: 10px; color: var(--ink-faint); line-height: 1.45; }

/* ══════════════════════ 设定集卡 ══════════════════════ */

.sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: 14px; }
.sheet-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden;
}
.sheet-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--ground); }
.sheet-card .ph {
  width: 100%; aspect-ratio: 1; background: var(--ground);
  display: grid; place-items: center; color: var(--ink-faint); font-size: 11.5px;
}
.sheet-body { padding: 11px 13px; }
.sheet-name {
  font-size: 13px; font-weight: 650; font-family: var(--display);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.sheet-role { font-size: 10.5px; color: var(--beam); font-family: var(--code); margin-top: 1px; }
.sheet-desc {
  font-size: 11.5px; color: var(--ink-faint); margin-top: 7px;
  line-height: 1.55; max-height: 84px; overflow: auto;
}
.sheet-seed { font-family: var(--code); font-size: 10px; color: var(--ink-faint); margin-top: 7px; }

/* ══════════════════════ 联调台 ══════════════════════ */

.debug-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 1080px) { .debug-layout { grid-template-columns: 1fr; } }

.kv-list { display: flex; flex-direction: column; gap: 6px; }
.kv-row { display: grid; grid-template-columns: minmax(0, 210px) minmax(0, 1fr) 32px; gap: 6px; }
.kv-row input { font-family: var(--code); font-size: 11.5px; }
.kv-row .btn { padding: 4px 0; }

.resp-meta { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }

pre.out {
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 13px;
  margin: 0;
  font-family: var(--code); font-size: 11.5px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
  max-height: 44vh; overflow: auto;
  color: var(--ink-dim);
}
pre.out .k { color: var(--beam); }
pre.out .s { color: var(--good); }
pre.out .n { color: var(--caution); }
pre.out .b { color: var(--alarm); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 13px; }
.tab {
  border: 0; background: transparent; color: var(--ink-faint);
  padding: 7px 13px; font: inherit; font-size: 12px; font-weight: 500;
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink-dim); }
.tab.active { color: var(--ink); border-bottom-color: var(--beam); }
.tab:focus-visible { outline: 2px solid var(--beam); outline-offset: -2px; }

.stream-log {
  font-family: var(--code); font-size: 11px; line-height: 1.65;
  background: var(--ground); border: 1px solid var(--line); border-radius: var(--r);
  padding: 11px; max-height: 190px; overflow: auto;
  color: var(--ink-faint);
}
.stream-log div { padding: 0; }
.stream-log .ev-error { color: var(--alarm); }
.stream-log .ev-note  { color: var(--beam); }
.stream-log .ev-poll  { color: var(--caution); }
.stream-log .ev-verify{ color: var(--good); }

/* ══════════════════════ 表格 ══════════════════════ */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { text-align: left; padding: 9px 13px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
th {
  color: var(--ink-faint); font-weight: 600; font-size: 10px;
  letter-spacing: .12em; text-transform: uppercase;
  background: var(--surface-2); position: sticky; top: 0; z-index: 1;
}
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td.wrap { white-space: normal; max-width: 380px; }

/* ══════════════════════ 服务商卡 ══════════════════════ */

.provider-card {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); padding: 15px 16px;
  display: flex; flex-direction: column; gap: 11px;
}
.provider-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.provider-name { font-family: var(--display); font-size: 13.5px; font-weight: 650; }
.provider-base { font-family: var(--code); font-size: 10.5px; color: var(--ink-faint); margin-top: 2px; word-break: break-all; }
.cap-list { display: flex; gap: 4px; flex-wrap: wrap; }
.cap {
  font-size: 10px; font-family: var(--code);
  padding: 1px 6px; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--ink-faint); border: 1px solid var(--line-soft);
}

/* 自检结果留在卡片上：失败原因带服务端原话，是多行长文本，toast 装不下 */
.probe-reason {
  font-size: 12px; line-height: 1.6;
  padding: 10px 12px; border-radius: var(--r);
  background: var(--surface-2); color: var(--ink-dim);
  border: 1px solid var(--line);
  white-space: pre-wrap; word-break: break-word;
  max-height: 220px; overflow: auto;
}
.probe-reason.ok  { color: var(--good);  border-color: color-mix(in srgb, var(--good) 30%, transparent);  background: var(--good-wash); }
.probe-reason.err { color: var(--ink);   border-color: color-mix(in srgb, var(--alarm) 34%, transparent); background: var(--alarm-wash); }
.probe-model {
  font-family: var(--code); font-size: 11px;
  color: var(--ink-faint); margin-bottom: 6px;
}

/* 接口地址：默认收起来，改过的自动展开 */
.endpoint-editor {
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--ground); padding: 8px 12px; margin-top: 10px;
}
.endpoint-editor > summary {
  cursor: pointer; font-size: 11.5px; color: var(--ink-dim);
  list-style: none; user-select: none;
}
.endpoint-editor > summary::before { content: "▸ "; }
.endpoint-editor[open] > summary::before { content: "▾ "; }
.endpoint-editor .field { margin-top: 8px; }
.endpoint-editor input { font-size: 11.5px; }

/* ══════════════════════ 看图 ══════════════════════ */

/* 缩略图两百来像素，判断"这张脸对不对""手指有没有崩"根本不够看 */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(8, 6, 4, .93);
  display: flex; flex-direction: column;
  backdrop-filter: blur(3px);
}
.lb-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.lb-counter, .lb-zoom {
  font-family: var(--code); font-size: 11.5px; color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}
.lb-actions { display: flex; align-items: center; gap: 6px; }
.lb-btn {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  border-radius: var(--r-sm); padding: 4px 10px;
  font: inherit; font-size: 12px; line-height: 1.6; cursor: pointer; text-decoration: none;
}
.lb-btn:hover { background: var(--surface-3); }
.lb-btn.close:hover { border-color: var(--alarm); color: var(--alarm); }

.lb-stage {
  flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.lb-img {
  max-width: 94%; max-height: 100%;
  transform-origin: center center;
  cursor: zoom-in;
  user-select: none; -webkit-user-drag: none;
  /* 棋盘格：透明背景的图不至于和黑底糊在一起 */
  background:
    repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 50% / 18px 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
}
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 74px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font-size: 26px; line-height: 1; cursor: pointer;
  border-radius: var(--r);
}
.lb-nav:hover { background: var(--surface-2); }
.lb-nav.prev { left: 14px; }
.lb-nav.next { right: 14px; }
.lb-caption {
  padding: 10px 18px 14px; text-align: center;
  display: flex; flex-direction: column; gap: 3px;
  font-size: 12.5px; color: var(--ink-dim);
  background: var(--surface); border-top: 1px solid var(--line);
}
.lb-caption b { color: var(--ink); font-family: var(--display); font-size: 13.5px; }

/* 能点开看的缩略图给个提示，不然没人知道可以点 */
.zoomable { cursor: zoom-in; }

/* ══════════════════════ 失败汇总 ══════════════════════ */

/* 服务端原话原样摊开。轮询日志刷得飞快，而"为什么失败"必须留在眼前 */
.fail-box {
  border: 1px solid color-mix(in srgb, var(--alarm) 40%, var(--line));
  background: color-mix(in srgb, var(--alarm) 7%, var(--surface));
  border-radius: var(--r); padding: 12px 14px; margin-top: 12px;
}
.fail-head {
  font-size: 11px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--alarm); margin-bottom: 8px;
}
.fail-row {
  display: flex; gap: 10px; align-items: baseline;
  padding: 5px 0; border-top: 1px solid var(--line);
  font-size: 12px; line-height: 1.5;
}
.fail-row:first-of-type { border-top: 0; }
.fail-who { font-family: var(--code); font-size: 11px; color: var(--ink-dim); white-space: nowrap; }
.fail-msg { color: var(--ink); word-break: break-word; }
.fail-tip { font-size: 11px; color: var(--ink-faint); line-height: 1.6; margin-top: 8px; }

/* ══════════════════════ 项目 ══════════════════════ */

/* 创作台顶上的一行：只回答"我现在在做哪一部、什么画风"，其余交给项目页 */
.project-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); padding: 10px 14px;
}
.project-bar-main { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; flex: 1; min-width: 0; }
.project-bar-main b { font-family: var(--display); font-size: 15px; color: var(--ink); }

.project-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px;
}
.project-card {
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); overflow: hidden;
  display: flex; flex-direction: column;
}
.project-card.current { border-color: var(--beam); box-shadow: 0 0 0 2px var(--beam-wash); }
.project-card .style-swatch { aspect-ratio: 16 / 6; }
.project-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 7px; }
.project-head { display: flex; align-items: center; gap: 8px; }
.project-head b { font-family: var(--display); font-size: 14.5px; color: var(--ink); }
.project-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.project-progress { font-family: var(--code); font-size: 11px; color: var(--ink-dim); }
.project-time { font-size: 11px; color: var(--ink-faint); }
.project-style-edit { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }

/* ══════════════════════ 画风选择 ══════════════════════ */

/* 缩略图用配色 + 纹理现画，不外链图片：离线可用，也不拿别人的作品当示例 */
.style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.style-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r);
  padding: 0 0 9px;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  font: inherit;
  color: var(--ink-dim);
  transition: border-color .12s, transform .12s;
}
.style-card:hover { border-color: var(--ink-faint); transform: translateY(-1px); }
.style-card:focus-visible { outline: 2px solid var(--beam); outline-offset: 2px; }
.style-card.active {
  border-color: var(--beam);
  box-shadow: 0 0 0 2px var(--beam-wash);
  color: var(--ink);
}
.style-swatch { width: 100%; aspect-ratio: 8 / 5; display: block; overflow: hidden; background: var(--ground); }
.style-swatch svg,
.style-swatch img { width: 100%; height: 100%; display: block; object-fit: cover; }
.style-name { font-size: 12.5px; font-weight: 600; padding: 8px 10px 1px; font-family: var(--display); }
.style-hint { font-size: 10.5px; color: var(--ink-faint); padding: 0 10px; line-height: 1.4; }

/* ══════════════════════ 影片比例 ══════════════════════ */

/* 小方块按真实比例变形。五个长得一样的下拉选项没人分得清，一个形状就够了 */
.ratio-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.ratio-card {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  min-width: 92px; padding: 10px 10px 8px;
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--r);
  cursor: pointer; font: inherit; color: var(--ink-dim);
  transition: border-color .12s, transform .12s;
}
.ratio-card:hover { border-color: var(--ink-faint); transform: translateY(-1px); }
.ratio-card:focus-visible { outline: 2px solid var(--beam); outline-offset: 2px; }
.ratio-card.active { border-color: var(--beam); box-shadow: 0 0 0 2px var(--beam-wash); color: var(--ink); }
/* 外壳定高，形状在里面居中 —— 不然 21:9 那张矮，底下的文字会比别人高一截，一排看着像坏了 */
.ratio-slot { height: 36px; display: grid; place-items: center; }
.ratio-shape {
  display: block; border-radius: 3px;
  background: linear-gradient(140deg, var(--beam-wash), var(--ground));
  border: 1px solid var(--ink-faint);
}
.ratio-card.active .ratio-shape { border-color: var(--beam); }
/* 「跟随设置」画成虚线：它没自己的形状，形状是别处定的 */
.ratio-shape.inherit { border-style: dashed; background: var(--ground); }
.ratio-label { font-size: 11.5px; font-weight: 600; font-family: var(--display); }
.ratio-hint { font-size: 10px; color: var(--ink-faint); line-height: 1.35; text-align: center; }

/* ══════════════════════ 时长 ══════════════════════ */

/* 三个数分开摆。混成一个数，就会出现"界面说 32 秒、成片 40 秒"这种谁也说不清的情况 */
.duration-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px;
}
.duration-cell {
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--ground); padding: 11px 13px;
}
.duration-cell.ok   { border-color: color-mix(in srgb, var(--good) 32%, var(--line)); }
.duration-cell.warn { border-color: color-mix(in srgb, var(--caution) 38%, var(--line)); }
.duration-k {
  font-size: 10px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-faint);
}
.duration-v {
  font-family: var(--code); font-size: 21px; font-variant-numeric: tabular-nums;
  color: var(--ink); margin: 3px 0 2px; line-height: 1.15;
}
.duration-cell.warn .duration-v { color: var(--caution); }
.duration-note { font-size: 10.5px; color: var(--ink-faint); line-height: 1.4; }

.note-line {
  margin-top: 11px; padding: 9px 12px; border-radius: var(--r);
  font-size: 12px; line-height: 1.55;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-dim);
}
.note-line.warn {
  color: var(--caution); background: var(--caution-wash);
  border-color: color-mix(in srgb, var(--caution) 30%, transparent);
}

/* 窄屏上那条"去手机版"。压在最上面一行，别盖住内容 */
.mobile-hint {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; font-size: 12px; line-height: 1.45;
  background: var(--caution-wash); color: var(--ink);
  border-bottom: 1px solid color-mix(in srgb, var(--caution) 30%, var(--line));
}
.mobile-hint span { flex: 1; min-width: 0; }
.mobile-hint .btn { flex: none; }

/* 画风和设定集对不上时的那条提示：要能一眼看清"现在是什么、要换成什么" */
.notice {
  margin: 10px 0 14px; padding: 12px 14px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface-2);
}
.notice.warn {
  border-color: color-mix(in srgb, var(--caution) 34%, var(--line));
  background: var(--caution-wash);
}
.notice b { display: block; font-size: 13px; margin-bottom: 5px; }
.notice p { margin: 0 0 10px; font-size: 12px; line-height: 1.6; color: var(--ink-dim); }
.diff-pair { display: grid; gap: 8px; margin-bottom: 11px; }
@media (min-width: 860px) { .diff-pair { grid-template-columns: 1fr 1fr; } }
.diff-pair label { display: block; font-size: 11px; color: var(--ink-dim); margin-bottom: 3px; }
.diff-pair code {
  display: block; padding: 8px 10px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line);
  font-size: 12px; line-height: 1.6; color: var(--ink); white-space: pre-wrap;
}

/* ══════════════════════ 章节 ══════════════════════ */

.chapter-preview { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chapter-list { display: flex; flex-direction: column; gap: 7px; }
.chapter-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 11px 14px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--ground);
}
.chapter-row.done { border-color: color-mix(in srgb, var(--good) 30%, var(--line)); }
.chapter-main { flex: 1; min-width: 180px; }
.chapter-title { font-size: 13.5px; font-weight: 600; font-family: var(--display); }
.chapter-meta { font-family: var(--code); font-size: 10.5px; color: var(--ink-faint); margin-top: 2px; }

/* ══════════════════════ 阶段详情与进度 ══════════════════════ */

.stage-chip.selected { border-color: var(--beam); box-shadow: 0 0 0 2px var(--beam-wash); }
.stage-count {
  font-family: var(--code); font-size: 10px; font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
  border-left: 1px solid var(--line); padding-left: 7px;
}

.stage-detail {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--ground);
  padding: 15px 17px;
  margin-bottom: 14px;
  display: flex; flex-direction: column; gap: 12px;
}
.stage-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.stage-detail-title { font-family: var(--display); font-size: 15px; font-weight: 650; }
.stage-detail-hint { font-size: 12px; color: var(--ink-faint); margin-top: 3px; max-width: 60ch; line-height: 1.55; }

.progress-bar {
  height: 6px; border-radius: 3px;
  background: var(--surface-2); overflow: hidden;
  border: 1px solid var(--line);
}
.progress-fill {
  height: 100%; background: var(--beam);
  transition: width .3s ease;
}
.progress-text {
  font-family: var(--code); font-size: 11px; font-variant-numeric: tabular-nums;
  color: var(--ink-faint); margin-top: 6px;
}

.stage-missing { border-top: 1px solid var(--line-soft); padding-top: 11px; }

/* 缩略图上覆一层实时状态：出视频一镜好几分钟，不显示就像卡死了 */
.shot-live {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 6px 9px;
  font-family: var(--code); font-size: 10.5px; line-height: 1.4;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  border-top: 1px solid var(--line);
  color: var(--ink-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shot-live.running { color: var(--beam); border-top-color: var(--beam); }
.shot-live.done    { color: var(--good); border-top-color: color-mix(in srgb, var(--good) 40%, transparent); }
.shot-live.failed  { color: var(--alarm); border-top-color: color-mix(in srgb, var(--alarm) 40%, transparent); }

.shot-prompt { margin-top: 6px; }
.shot-prompt summary {
  font-size: 10.5px; color: var(--ink-faint); cursor: pointer; list-style: none;
}
.shot-prompt summary::-webkit-details-marker { display: none; }
.shot-prompt summary::before { content: '▸ '; }
.shot-prompt[open] summary::before { content: '▾ '; }
.shot-prompt-body {
  font-size: 11px; line-height: 1.55; color: var(--ink-dim);
  background: var(--ground); border: 1px solid var(--line-soft);
  border-radius: var(--r-sm); padding: 7px 9px; margin-top: 5px;
  white-space: pre-wrap; word-break: break-word;
}

/* ══════════════════════ 单镜重出 ══════════════════════ */

select.mini {
  font-size: 11px; padding: 4px 6px; border-radius: var(--r-sm);
  background: var(--ground); border: 1px solid var(--line); color: var(--ink);
  width: 100%; min-width: 0;
}

.shot-redo { margin-top: 4px; border-top: 1px solid var(--line-soft); padding-top: 7px; }
.shot-redo summary {
  font-size: 11.5px; color: var(--ink-faint); cursor: pointer; list-style: none;
  padding: 2px 0;
}
.shot-redo summary::-webkit-details-marker { display: none; }
.shot-redo summary::before { content: '⟳ '; }
.shot-redo summary:hover { color: var(--beam); }
.shot-redo[open] summary { color: var(--ink-dim); }
.shot-redo-body { display: flex; flex-direction: column; gap: 5px; padding-top: 6px; }
.shot-redo-body label { margin-bottom: 0; }
.shot-model-row { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.shot-used { font-family: var(--code); font-size: 10px; color: var(--ink-faint); margin-top: 4px; }

.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 7px; }

/* ══════════════════════ 上线前体检 ══════════════════════ */

.preflight-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.preflight-opt {
  display: inline-flex; align-items: center; gap: 7px;
  margin: 0; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--ground);
  font-size: 12.5px; font-weight: 400; letter-spacing: 0; text-transform: none;
  color: var(--ink-dim); cursor: pointer;
}
.preflight-opt:hover { border-color: var(--ink-faint); }
.preflight-cost {
  font-family: var(--code); font-size: 10px;
  color: var(--ink-faint);
  border-left: 1px solid var(--line); padding-left: 7px;
}

.preflight-list { display: flex; flex-direction: column; gap: 8px; }

.preflight-row {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 11px 13px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--ground);
}
.preflight-row.ok      { border-color: color-mix(in srgb, var(--good) 32%, var(--line)); }
.preflight-row.warn    { border-color: color-mix(in srgb, var(--caution) 36%, var(--line)); }
.preflight-row.fail    { border-color: color-mix(in srgb, var(--alarm) 38%, var(--line)); }
.preflight-row.running { border-color: var(--beam); }

.preflight-dot {
  font-family: var(--code); font-size: 13px; line-height: 1.5;
  width: 18px; text-align: center; flex: 0 0 auto;
  color: var(--ink-faint);
}
.preflight-row.ok      .preflight-dot { color: var(--good); }
.preflight-row.warn    .preflight-dot { color: var(--caution); }
.preflight-row.fail    .preflight-dot { color: var(--alarm); }
.preflight-row.running .preflight-dot { color: var(--beam); animation: spin 1.1s linear infinite; }

.preflight-body { min-width: 0; flex: 1; }
.preflight-head { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; font-size: 13px; }
.preflight-route {
  font-family: var(--code); font-size: 10.5px; color: var(--ink-faint);
  word-break: break-all;
}
.preflight-ms { font-family: var(--code); font-size: 10.5px; color: var(--ink-faint); margin-left: auto; }
.preflight-detail { font-size: 12px; color: var(--ink-dim); margin-top: 4px; }
.preflight-msg {
  font-size: 12px; color: var(--ink); margin-top: 5px;
  white-space: pre-wrap; word-break: break-word;
}
.preflight-hint { font-size: 12px; color: var(--beam); margin-top: 5px; }

.preflight-verdict {
  margin-top: 4px; padding: 11px 14px;
  border-radius: var(--r); font-size: 13px; font-weight: 500;
  border: 1px solid var(--line);
}
.preflight-verdict.good { color: var(--good);   background: var(--good-wash);    border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.preflight-verdict.warn { color: var(--caution); background: var(--caution-wash); border-color: color-mix(in srgb, var(--caution) 30%, transparent); }
.preflight-verdict.bad  { color: var(--alarm);  background: var(--alarm-wash);   border-color: color-mix(in srgb, var(--alarm) 30%, transparent); }

/* ══════════════════════ Toast ══════════════════════ */

.toast-stack {
  position: fixed; right: 20px; bottom: 20px;
  display: flex; flex-direction: column; gap: 9px; z-index: 99;
}
.toast {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--beam);
  padding: 11px 15px; border-radius: var(--r);
  font-size: 12.5px; line-height: 1.55;
  max-width: 440px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  animation: rise .2s ease-out;
}
.toast.err { border-left-color: var(--alarm); }
.toast.ok  { border-left-color: var(--good); }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; border: 3px solid var(--ground); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }

/* ══════════════════════ 技法库 ══════════════════════ */

/* 互斥组做成单选：不能同时仰拍又俯拍，那就不该让人点得下去 */
.skill-picker { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.skill-group-head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-bottom: 3px; }
.skill-group-name { font-size: 11px; font-weight: 650; font-family: var(--display); color: var(--ink-dim); }
.skill-group-tag {
  font-size: 9px; padding: 0 4px; border-radius: 3px;
  border: 1px solid var(--line); color: var(--ink-faint);
}
.skill-group-hint { font-size: 9.5px; color: var(--ink-faint); }
.skill-row { display: flex; flex-wrap: wrap; gap: 4px; }
.skill-chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-dim);
  border-radius: 999px; padding: 2px 9px; font: inherit; font-size: 11px;
  cursor: pointer; transition: border-color .12s, background .12s, color .12s;
}
.skill-chip:hover { border-color: var(--ink-faint); color: var(--ink); }
.skill-chip.on { border-color: var(--beam); background: var(--beam-wash); color: var(--ink); font-weight: 600; }
/* 自定义卡标一下，和内置的分得开 */
.skill-chip.custom { border-style: dashed; }

/* ══════════════════════ 开机自检横幅 ══════════════════════ */

/* toast 会自己消失，而"密钥没配"是个持续状态 —— 不该在你去泡茶的功夫里悄悄划过去 */
.route-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 22px;
  background: var(--alarm-wash);
  border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--ink-dim);
}
.route-banner b { color: var(--alarm); font-family: var(--display); }
.route-banner > span { flex: 1; min-width: 220px; }

/* 信号链上直接标出通没通：下手之前就该看得见 */
.chain-seg.good b { color: var(--good); }
.chain-seg.bad { background: var(--alarm-wash); }
.chain-seg.bad b { color: var(--alarm); }

/* ══════════════════════ 设定集变体 ══════════════════════ */

/* 同一个人的不同穿搭 / 同一个地方的不同时段。共用身份锚和种子，所以还是同一个 */
.variant-list { display: flex; flex-direction: column; gap: 6px; }
.variant-row {
  display: flex; align-items: center; gap: 7px;
  padding: 5px; border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  background: var(--ground);
}
.variant-row.new { border-style: dashed; }
.variant-thumb {
  width: 38px; height: 38px; flex: none; border-radius: 4px;
  object-fit: cover; background: var(--surface-2); cursor: zoom-in;
}
.variant-thumb.ph {
  display: grid; place-items: center; cursor: default;
  font-size: 9px; color: var(--ink-faint); text-align: center; line-height: 1.1;
}
.variant-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.variant-main input { font-size: 11px; padding: 3px 6px; }
.variant-acts { display: flex; gap: 4px; flex: none; }

/* 画风描述框：自定义时这就是全部风格，写不写差别很大，所以给它一点存在感 */
.style-free { width: 100%; min-height: 58px; resize: vertical; }
.style-free.required {
  border-color: color-mix(in srgb, var(--caution) 45%, var(--line));
  background: var(--caution-wash);
}
