/* 内网后台。克制的深色配色，长时间盯着不累。 */

/* 🔴 **HTML 的 hidden 属性必须显式兜住**。
   它等价于 display:none，但优先级**低于任何 CSS 的 display 声明**——
   只要某条规则给元素设了 display:flex（本文件里有十几条），
   hidden 就被静默盖掉，元素照样显示。

   2026-08-10 撞到：动物跳舞的两个模式面板一起显示出来，
   我一度以为是 JS 没加载、查了半天缓存和静态文件，
   真因只是 `[data-mode-panel]{display:flex}` 盖住了 hidden。

   放在最前面、用 !important：这是浏览器语义的兜底，
   不是某个组件的样式，任何后写的 display 都不该赢过它。 */
[hidden] { display: none !important; }

/* ══════════════════════════════════════════════════════════════════
   配色（2026-08-12 重定）

   原来是深蓝底 + #4d7cfe 蓝按钮 + 8px 圆角——那套是每个后台的样子，
   谁做都长这样。这一版按"控制室的值班台"来调：更沉的中性底，
   一个琥珀色专门表达「即将发生」。

   🔴 **--accent 和 --live 是两个角色，不要混用**：

       --accent  交互色。链接、焦点框、主按钮、hover 边框——
                 它说的是「这里能点」。到处都是，所以必须克制。

       --live    状态色。**只给排班用**：下一班的时刻、当前时刻线、
                 「就要发了」。它说的是「这件事就要发生」。

   混用的话满页都是琥珀，那就不是强调而是噪音——值班表上要
   一眼看出"哪条赛道下一个播"，靠的就是它在别处不出现。
   ══════════════════════════════════════════════════════════════════ */
:root {
  --bg: #0b0d10;          /* 比原来的 #0f1117 更沉、更中性，少一点蓝 */
  --panel: #151920;
  --panel-2: #1c212b;
  --border: #232935;
  --text: #dde3ec;        /* 偏冷的粉笔白 */
  --muted: #6e7787;
  --accent: #5d8ab0;      /* 交互色。青灰蓝，退到背景里去 */
  --live: #e8b23a;        /* 🔴 排班专用。航班牌、调度台、待命灯的颜色 */
  --ok: #4f9d63;
  --warn: #c8912f;
  --err: #c2564a;
  --radius: 8px;

  /* 字体。**全是系统自带**，不下载不构建——这台机器在国内，
     引一个 web font 就是引一条会超时的外部依赖。

     Bahnschrift 是 Windows 自带的 DIN 变体（站台牌、仪表盘那种字），
     压缩方正，用在赛道名和时刻上。没有它时退到各平台的等价窄体。 */
  --display: "Bahnschrift", "DIN Alternate", "Oswald", "PingFang SC", sans-serif;
  --body: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  --data: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 var(--body);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--data); font-size: .92em; }

/* ---------- 布局 ---------- */

.layout { display: flex; min-height: 100vh; }

.sidebar {
  /* 200 → 220（2026-10-30）：加了「微短剧插入广告自动生成」那一栏。
     实测（headless Chromium + 本机字体）：200px 下**不折行**，但那行字 154px、
     内容宽 158px，只剩 4px 余量；换一套字体（Mac 的 PingFang、或字重略宽）
     就会折成两行，而侧栏一栏折行看着就乱了。加宽 20px 把它变成 24px 余量。
     ⚠️ 再长的栏名别继续加宽侧栏（每一栏都在挤内容区），改短文字。 */
  width: 220px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 20px 0;
}

.brand {
  display: flex; align-items: center; gap: 8px;
  padding: 0 20px 20px;
  font-weight: 600; font-size: 15px;
}
.brand-mark { color: var(--accent); }

.sidebar nav { display: flex; flex-direction: column; }
.sidebar nav a {
  padding: 10px 20px;
  color: var(--muted);
  border-left: 2px solid transparent;
}
.sidebar nav a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.sidebar nav a.on {
  color: var(--text);
  border-left-color: var(--accent);
  background: var(--panel-2);
}

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

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
}
.topbar h1 { margin: 0; font-size: 18px; font-weight: 600; }

.user-box { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.user-box form { margin: 0; }

.content { padding: 24px 28px; }

/* ---------- 卡片 ---------- */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.card.warn { border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.card-label { color: var(--muted); font-size: 12px; }
.card-value { font-size: 28px; font-weight: 600; margin: 6px 0 2px; }
.card-sub { color: var(--muted); font-size: 12px; }

/* 今日失败按类型拆开（用户 2026-08-31：「失败信息要分开」）。
   ⚠️ 塞在卡片里，所以要紧凑——五六行不能把卡片撑变形。 */
.fail-split {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 3px;
}
.fail-row {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12px; color: var(--muted);
  text-decoration: none;
  padding: 1px 0;
}
.fail-row:hover { color: var(--text); }
.fail-name { flex: 1; }
.fail-num {
  font-variant-numeric: tabular-nums;   /* 数字对齐，扫一眼就看出大小 */
  color: color-mix(in srgb, var(--err) 70%, var(--text));
  font-weight: 600;
}
.fail-pct {
  font-variant-numeric: tabular-nums;
  min-width: 34px; text-align: right;
  opacity: .75;
}
/* 产量卡也按类型拆（用户 2026-08-31：「不然我分不清成功了什么」）。
   ⚠️ 复用 .fail-row 那套布局，只把数字换成成功色——两张卡并排时
      行高和列宽要**完全对齐**，不然扫一眼对不上号。 */
.ok-num {
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--ok) 70%, var(--text));
  font-weight: 600;
}

/* ---------- 面板 ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 18px;
}
.panel h2 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.panel-head { display: flex; align-items: center; justify-content: space-between; }
.panel-actions { display: flex; align-items: center; gap: 16px; margin-top: 18px; }
.panel-actions form { margin: 0; }

.placeholder .lead { color: var(--text); margin-top: 0; }
.placeholder blockquote {
  margin: 18px 0 0;
  padding: 12px 16px;
  background: var(--panel-2);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted);
}

/* ---------- 表格 ---------- */

table { width: 100%; border-collapse: collapse; }

.grid th, .grid td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.grid th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.grid tbody tr:hover { background: var(--panel-2); }
.grid .actions form { margin: 0; display: inline; }

.plain td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.plain tr:last-child td { border-bottom: none; }
.plain .k { color: var(--muted); width: 100px; }
.plain .tag {
  width: 44px; color: var(--accent);
  font-family: var(--data); font-size: 12px;
}

.muted { color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 32px 0; }
.pager { display: flex; align-items: center; gap: 14px; justify-content: center; padding-top: 14px; }

/* ---------- 状态徽章 ---------- */

.badge {
  display: inline-block; padding: 2px 9px;
  border-radius: 11px; font-size: 12px;
  border: 1px solid transparent;
}
.badge.pending   { color: var(--muted); border-color: var(--border); background: var(--panel-2); }
.badge.running   { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.badge.succeeded { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.badge.failed    { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, transparent); background: color-mix(in srgb, var(--err) 10%, transparent); }
.badge.canceled  { color: var(--muted); border-color: var(--border); background: transparent; }

/* ---------- 表单 ---------- */

input, select, button, textarea { font: inherit; }

input[type=text], input[type=password], input[type=number], select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 7px 10px;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }

.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.stack-form { display: flex; flex-direction: column; gap: 12px; max-width: 320px; }
.stack-form label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 13px; }
.stack-form input { color: var(--text); }

button.primary, .primary.as-link {
  background: var(--accent);
  border: none; border-radius: 6px;
  color: #fff; padding: 8px 16px;
  cursor: pointer;
  display: inline-block; text-align: center;
}
button.primary:hover, .primary.as-link:hover {
  background: color-mix(in srgb, var(--accent) 82%, #fff); text-decoration: none;
}

.link-btn {
  background: none; border: none; padding: 0;
  color: var(--accent); cursor: pointer; font-size: 13px;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--err); }

/* ---------- 提示 ---------- */

/* 🔴 **裸 .alert 也要有样式**。三个 publish 页面用的都是 `class="alert"`
   （没带 .ok），而原来只给 .error 和 .ok 配了颜色——成功提示渲染成
   一行光秃秃的小字，混在页面顶部完全看不见。

   2026-08-10 用户反馈"导入代理没有任何 UI 提示然后就突然出现了"：
   提示其实在，只是长得不像提示。 */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.7;
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent);
  color: color-mix(in srgb, var(--ok) 70%, var(--text));
}
.alert.error { background: color-mix(in srgb, var(--err) 14%, transparent); border: 1px solid color-mix(in srgb, var(--err) 40%, transparent); color: color-mix(in srgb, var(--err) 70%, var(--text)); }
.alert.ok    { background: color-mix(in srgb, var(--ok) 14%, transparent); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); color: color-mix(in srgb, var(--ok) 70%, var(--text)); }

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 5px 0 5px 24px; position: relative; }
.checklist li::before { position: absolute; left: 0; }
.checklist .done::before { content: "✓"; color: var(--ok); }
.checklist .todo::before { content: "○"; color: var(--muted); }
.checklist .todo { color: var(--muted); }

.code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: var(--data);
  font-size: 12px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.code.error-text { color: color-mix(in srgb, var(--err) 70%, var(--text)); }

/* ---------- 登录 / 错误页 ---------- */

.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
}
.login-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: 320px;
  display: flex; flex-direction: column; gap: 14px;
}
.login-brand {
  display: flex; align-items: center; gap: 8px;
  justify-content: center;
  font-size: 16px; font-weight: 600;
  margin-bottom: 6px;
}
.login-card label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 13px; }
.login-card input { color: var(--text); }
.hint { color: var(--muted); font-size: 12px; text-align: center; margin: 4px 0 0; }

.error-card { text-align: center; }
.error-code { font-size: 44px; font-weight: 600; color: var(--muted); }

/* ---------------------------------------------------------------------------
   赛道 / 批次 / 待审
   --------------------------------------------------------------------------- */

.crumb { color: var(--muted); font-weight: 500; }
.crumb:hover { color: var(--text); }

.pill {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  background: var(--accent); color: #fff; border-radius: 10px;
  font-size: 11px; font-weight: 600; line-height: 1.5;
}

.btn {
  display: inline-block; padding: 7px 14px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
}
.btn.primary, a.primary.btn { background: var(--accent); color: #fff; }
.btn.primary:hover { text-decoration: none; opacity: .9; }

/* 赛道卡片 */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.track-card {
  display: block; padding: 16px; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: var(--radius); color: var(--text);
}
.track-card:hover { border-color: var(--accent); text-decoration: none; }
.track-card h3 { margin: 0 0 6px; font-size: 15px; }
.track-card p { margin: 0 0 12px; font-size: 13px; line-height: 1.6; }
.track-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); }

/* 「正在出片 3/10」——赛道卡片上回到批次页的入口 */
.track-running {
  display: flex; align-items: center; gap: 8px; margin: 12px 0 0;
  padding: 8px 10px; border-radius: var(--radius); font-size: 12px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--text);
}
.track-running:hover { text-decoration: none; border-color: var(--accent); }
.track-running .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  flex: none; animation: pulse 1.6s ease-in-out infinite;
}
/* 呼吸灯：静态圆点看着像已完成，动起来才是"还在跑" */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.track-running .progress-bar.mini { flex: 1; margin: 0; height: 4px; }
@media (prefers-reduced-motion: reduce) { .track-running .dot { animation: none; } }

/* 两栏布局 */
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }

.stack-form { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.stack-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; width: 100%; max-width: 340px; }
.stack-form input[type="number"] { max-width: 120px; }

.scene-picker { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; width: 100%; }
.scene-picker legend { color: var(--muted); font-size: 12px; padding: 0 6px; }
.chk { flex-direction: row !important; align-items: center; gap: 7px !important; width: auto !important; }
.chk input { margin: 0; }

.scene-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.9; }
.scene-list code { color: var(--muted); font-size: 11px; }

.doc { white-space: pre-wrap; font-size: 12px; line-height: 1.7; color: var(--muted); max-height: 480px; overflow: auto; }

/* 微短剧植入:正文里换进去的拍、商品缩略图、植入清单的三种状态 */
.doc .placed { color: var(--warn); }
.doc .placed.tr { opacity: .75; }
.product-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.product-thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.product-form { margin-top: 16px; }
.place-row td:nth-child(2), .place-row td:nth-child(3) { white-space: nowrap; }
.place-row.manual td:last-child { color: var(--err); }
.place-row.stale td:last-child { color: var(--warn); }

/* 出剧:形象 / 场景 / 物品卡片、成片、镜头表 */
/* 🔴 出剧改(总审页面 M-8):`.asset-card` 这几条原来都是全局规则(今天没有别的模板用这个类,但这一块里
   别的规则都特意限定了 `#drama` / `.drama-assets` / `.drama-shots`)。按下面那条已经写下的意图一并收进来。 */
.drama-assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; }
.drama-assets .asset-card { margin: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--panel-2); }
.drama-assets .asset-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #000; }
.drama-assets .asset-card figcaption { padding: 6px 8px; font-size: 13px; }
.drama-assets .asset-card.failed figcaption { color: var(--err); }
/* 🔴 必须限定在 .drama-assets 里:素材库/仪表盘那条全局 `.asset-empty` 是 9:16(见下面 .asset 那段),
   同名同权重、它排在后面,不限定的话这里写的 16/9 一条都不生效 —— 卡片会被撑成 9:16 */
.drama-assets .asset-empty { aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.drama-assets .asset-card .placed, .drama-shots .placed { color: var(--warn); font-size: 11px; }
.drama-finals { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.drama-finals video { width: 180px; aspect-ratio: 9 / 16; background: #000; border-radius: 6px; }
.drama-shots video { width: 90px; aspect-ratio: 9 / 16; background: #000; border-radius: 4px; }
.drama-shots .estab-thumb { width: 120px; aspect-ratio: 16 / 9; object-fit: contain; background: #000; border-radius: 4px; }
.drama-shots tr.failed td:nth-child(8) { color: var(--err); }
.drama-shots .prompt-text { white-space: pre-wrap; max-width: 420px; }
.drama-shots td:last-child button { display: block; margin-bottom: 4px; white-space: nowrap; }
/* 「先只出到镜头表」只管同一个容器里的「再出一版」,而「继续出」在容器外面(它一律补齐到成片) */
.drama-new { display: inline-flex; align-items: center; gap: 8px; }
/* 标题层级:默认 h3 比 .panel h2(15px)还大 */
#drama h3 { margin: 18px 0 8px; font-size: 14px; font-weight: 600; }
/* 🔴 限定在 #drama:`.warn-text` 原来没定义,而手机那几页也在用 —— 别顺手给它们上色 */
#drama .warn-text { color: var(--warn); }
/* 出剧这一节的头部要塞提示(停止成功那句 49 个字):不换行的话它在 900px 上把标题、「出片中…」、
   「停止」一起挤成竖排。只放开这一节 —— 全局 `.panel-actions` 别的页面也在用,别在那边动。
   🔴 两处都要放:只放 `.panel-actions` 时,它自己又粗到 555px 宽,`.panel-head` 里那个 h2 被挤成
      27px(两个字竖排,实测 900px)。头部先换行、提示才排得下去 */
#drama .panel-head { flex-wrap: wrap; }
#drama .panel-actions { flex-wrap: wrap; }

/* 进度 */
.progress-bar { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; margin: 4px 0 14px; }
.progress-bar span { display: block; height: 100%; background: var(--accent); transition: width .4s ease; }
.stat-row td { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* 缩略图网格 */
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.thumb { margin: 0; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.thumb img { display: block; width: 100%; aspect-ratio: 9/16; object-fit: cover; }
.thumb-empty {
  display: flex; align-items: center; justify-content: center; aspect-ratio: 9/16;
  color: var(--muted); font-size: 12px;
}
.thumb figcaption { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 11px; }
.thumb .err { margin: 0; padding: 0 10px 10px; color: var(--err); font-size: 11px; line-height: 1.5; }
.thumb.failed { border-color: color-mix(in srgb, var(--err) 40%, transparent); }

/* 失败原因：中文结论一行，上游原话一行。
   🔴 原话要**限高**——上游报文能有几百字（带 request_id 和整段信封），
      不截的话一张失败卡片能撑到别的卡片两倍高，整排错位。
      鼠标停上去有 title，要看全在那儿看。 */
.err strong { display: block; margin-bottom: 2px; }
.err-raw {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; opacity: .75; word-break: break-all;
}

/* 待审。日产千条时这是最高频页面，一切为翻得快服务。 */
.keys { font-size: 12px; margin: 0; }
.keys kbd {
  display: inline-block; padding: 1px 6px; margin: 0 2px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 4px; font-size: 11px; font-family: inherit;
}

.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.review-card {
  margin: 0; background: var(--panel-2); border: 2px solid var(--border);
  border-radius: var(--radius); overflow: hidden; outline: none;
}
.review-card:focus { border-color: var(--accent); }
.review-card img { display: block; width: 100%; aspect-ratio: 9/16; object-fit: cover; cursor: zoom-in; }
.review-card figcaption { padding: 7px 10px; font-size: 11px; }
.review-actions { display: flex; border-top: 1px solid var(--border); }
.review-actions button {
  flex: 1; padding: 9px 0; border: none; background: none; cursor: pointer;
  color: var(--muted); font-size: 12px; font-family: inherit;
}
.review-actions button:hover { background: var(--panel); }
.review-actions .ok:hover { color: var(--ok); }
.review-actions .no:hover { color: var(--err); }
.review-actions .ok { border-right: 1px solid var(--border); }

#lightbox { border: none; background: none; padding: 0; max-width: 92vw; max-height: 92vh; }
#lightbox::backdrop { background: rgba(0, 0, 0, .82); }
#lightbox img { max-width: 92vw; max-height: 92vh; border-radius: var(--radius); }

.alert.error ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.7; }

/* 对标复刻的分析结果 */
.analysis { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.analysis + .analysis { margin-top: 12px; }
.analysis .panel-head { margin-bottom: 10px; gap: 10px; justify-content: flex-start; }
.analysis-text { max-height: none; color: var(--text); font-size: 13px; }
.text-preview {
  display: block; aspect-ratio: 9/16; overflow: hidden; padding: 12px;
  color: var(--muted); font-size: 11px; line-height: 1.65; white-space: pre-wrap;
}
.text-preview:hover { color: var(--text); text-decoration: none; }

/* 整片的分步进度。一条片跑十几分钟，得让人看见跑到哪了。 */
.steps { padding: 0 10px 10px; }
.steps .progress-bar { margin: 0 0 5px; height: 4px; }
.steps .muted { font-size: 11px; }
.thumb video { display: block; width: 100%; aspect-ratio: 9/16; object-fit: cover; background: #000; }

/* 管理区导航 */
.nav-group {
  padding: 16px 18px 6px; color: var(--muted);
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
}
.sidebar nav a.sub { padding-left: 30px; font-size: 13px; }

/* 一次性密码。要显眼——它只出现这一次 */
.password-once { border-color: var(--accent); }
.password-once .password {
  display: inline-block; margin: 6px 0; padding: 6px 12px;
  background: var(--panel-2); border: 1px solid var(--accent); border-radius: var(--radius);
  font-size: 18px; letter-spacing: .12em; user-select: all;
}

/* 出片。主路径要一眼看到：一个数字、一个按钮。 */
.produce-form { display: flex; flex-direction: column; gap: 12px; }
.produce-row { display: flex; align-items: flex-end; gap: 16px; }
.produce-row label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.produce-row input[type="number"] { width: 90px; font-size: 16px; padding: 8px 10px; }
button.primary.big { padding: 10px 26px; font-size: 15px; font-weight: 600; }
.flow code { font-size: 12px; line-height: 1.9; }

/* 次要选项收进折叠——它们平时不用看 */
.more { margin-top: 4px; }
.more summary {
  cursor: pointer; color: var(--muted); font-size: 12px;
  padding: 4px 0; user-select: none;
}
.more summary:hover { color: var(--text); }
.more > *:not(summary) { margin-top: 12px; }
.more label:not(.chk) { display: flex; flex-direction: column; gap: 5px; font-size: 13px; max-width: 340px; }

/* 生成中的卡片：把当前步骤摆到正中，别让人盯着"排队中"猜 */
.running-steps { flex-direction: column; gap: 6px; }
.step-now { color: var(--text); font-size: 14px; }
.step-count { color: var(--muted); font-size: 12px; }
.err-mark { color: var(--err); font-size: 13px; }
.steps .progress-bar { margin: 0; border-radius: 0; height: 3px; }

/* ── 资产库 ─────────────────────────────────────────────────────
   出好的片按北京时间日期分组。一天要看好几次「今天出了多少」，
   所以日期是主结构，赛道是筛选。 */

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; font-size: 13px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
}
.chip:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-n { font-size: 11px; opacity: .75; }

.day { margin-bottom: 26px; }
.day-head {
  display: flex; align-items: baseline; gap: 10px;
  padding-bottom: 8px; margin-bottom: 12px; border-bottom: 1px solid var(--border);
}
.day-head h2 { margin: 0; font-size: 15px; }
.day-head .muted { font-size: 12px; }

/* 竖屏片：卡片按 9:16 排，不然缩略图会被裁得认不出 */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.asset {
  margin: 0; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.asset video, .asset img {
  display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: #000;
}
.asset-empty {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 9 / 16; font-size: 12px;
}
.asset figcaption {
  padding: 8px 10px; font-size: 12px; border-top: 1px solid var(--border);
}
/* 两行：上行「时间 · 谁生成的 · 下载」，下行场景名。
   挤一行的话，用户名长一点就把下载按钮顶出去了。 */
.asset-line { display: flex; align-items: center; gap: 8px; }
.asset-time { color: var(--text); flex-shrink: 0; }
.asset-by {
  flex: 1; min-width: 0; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.asset-scene {
  margin-top: 3px; font-size: 11px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.asset-dl { color: var(--muted); flex-shrink: 0; }
.asset-dl:hover { color: var(--accent); }

.empty-state { text-align: center; padding: 48px 24px; }
.empty-state h2 { margin: 0 0 10px; }
.empty-state p { margin: 0; line-height: 1.9; }

.foot-note { margin-top: 20px; font-size: 12px; }
.lead-note { margin: 0 0 16px; font-size: 13px; }

/* 赛道卡片上直接开跑——主路径不该逼人先进详情页再找按钮 */
.track-title { display: block; color: var(--text); }
.track-title:hover { text-decoration: none; }
.track-title:hover h3 { color: var(--accent); }
.track-run {
  display: flex; align-items: flex-end; gap: 10px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
}
.track-run label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.track-run input[type="number"] { width: 78px; }
.track-run button { flex: 1; }

/* ── 资产库文件夹 ─────────────────────────────────────────────
   一级页列文件夹（赛道 × 日期），点进去看内容。
   片上千条时首页才不会变成无限滚动。 */

.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.folder {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.folder:hover { border-color: var(--accent); }
.folder-open { display: block; color: var(--text); }
.folder-open:hover { text-decoration: none; }

.folder-cover { position: relative; background: #000; }
.folder-cover video, .folder-cover img {
  display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
}
.folder-blank {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 16 / 10; font-size: 12px;
}
/* 数量压在封面右下角——不占额外一行，扫一眼就知道有多少 */
.folder-count {
  position: absolute; right: 8px; bottom: 8px;
  padding: 2px 8px; font-size: 11px; border-radius: 999px;
  background: rgba(0, 0, 0, .72); color: #fff;
}

.folder-meta { padding: 10px 12px 8px; }
.folder-meta strong { display: block; font-size: 14px; margin-bottom: 3px; }
.folder-meta .muted { font-size: 12px; }

.folder-actions {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; font-size: 12px; border-top: 1px solid var(--border);
}

/* 文件夹详情页顶部 */
.folder-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 18px;
}
.folder-head strong { font-size: 15px; margin-right: 8px; }
.folder-head .muted { font-size: 13px; }

/* 画面念词相似度。低于阈值标红——不重出，但要看得见哪条片模型偷了工。 */
.speech { margin-left: 6px; color: var(--ok); }
.speech.bad { color: var(--warn); }

/* ── 发布 ────────────────────────────────────────────────────────────── */

/* 队列 / 账号 / 代理 三个页面之间的切换。 */
.subnav { display: flex; gap: 4px; margin-bottom: 16px; }
.subnav a {
  padding: 6px 14px; border-radius: 6px; font-size: 14px;
  color: var(--muted); text-decoration: none;
}
.subnav a:hover { background: var(--panel-hover, rgba(255,255,255,.04)); }
.subnav a.on { background: var(--accent); color: #fff; }

/* 资产库里每个片下面的发布表单。
   默认折叠：一个片的表单要装下「选哪些号 + 文案 + 定时」三样东西，
   全摊开会把资产网格挤没。 */
.asset-publish { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 6px; }
.asset-publish > summary {
  cursor: pointer; font-size: 13px; color: var(--muted); list-style: none;
}
.asset-publish > summary::-webkit-details-marker { display: none; }
.asset-publish > summary::before { content: "▸ "; }
.asset-publish[open] > summary::before { content: "▾ "; }
.asset-publish > summary:hover { color: var(--text); }
.asset-publish form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.asset-publish textarea { width: 100%; resize: vertical; font: inherit; }
.asset-publish input[type="datetime-local"] { width: 100%; }

/* 账号多选。号多了要能滚，不然表单撑到屏幕外。 */
.publish-accounts {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 140px; overflow-y: auto; font-size: 13px;
}

/* ── 拖拽上传区（动物跳舞赛道的出片表单） ─────────────────────────
   每次出片当场传一条参考视频，用完就是这一条——不走素材库，
   那样要先传再选，多一步。 */
/* 🔴 **带模式切换的表单一律竖排**（2026-08-13 修）。
 *
 *    `.track-run` 默认横排（出几条 + 按钮并列，一行放得下）。而带页签的
 *    表单有上传口、缩略图、说明文字——横排会把每一列压成一条竖窄条，
 *    连按钮上的字都变成竖着一个个排下来。
 *
 *    ⚠️ 判据用 `[data-mode-field]` 而不是再加一个类名：加类名就得记着
 *       每处 include 都带上它，漏一处就是这次这个样子。属性本来就是
 *       模式切换的标志，两者天然同步。
 */
.clip-run,
.track-run[data-mode-field] { flex-direction: column; align-items: stretch; gap: 10px; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 18px 12px; cursor: pointer; text-align: center;
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 60%, transparent);
  transition: border-color .15s, background .15s;
}
.dropzone:hover { border-color: var(--accent); }
/* 拖进来时给明确反馈——没有的话用户不知道松手会不会生效 */
.dropzone.dragging {
  border-color: var(--accent); border-style: solid;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.dropzone.has-file { border-style: solid; border-color: var(--ok); }
.dropzone-hint { font-size: 12px; color: var(--muted); }
.dropzone-name { font-size: 12px; color: var(--text); word-break: break-all; }
.dropzone.has-file .dropzone-hint { display: none; }

/* ── 模式切换（动物跳舞：自动换动物 / 用我的形象） ───────────────── */
.mode-tabs { display: flex; gap: 6px; margin-bottom: 4px; }
.mode-tab {
  flex: 1; padding: 6px 10px; text-align: center; cursor: pointer;
  font-size: 12px; color: var(--muted); border-radius: var(--radius);
  border: 1px solid var(--border); background: transparent;
  transition: color .15s, border-color .15s, background .15s;
}
.mode-tab:hover { color: var(--text); }
.mode-tab.on {
  color: var(--text); border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
/* 面板里的控件间距跟表单一致 */
[data-mode-panel] { display: flex; flex-direction: column; gap: 10px; }
/* 复选框那行：勾在文字左边，不要撑成两行 */
.check-row {
  flex-direction: row !important; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted);
}
.check-row input { width: auto; margin: 0; }

/* 形象模式的两步标签——两个上传口长得一样，不编号会分不清先后 */
.step-label {
  font-size: 11px; color: var(--muted); font-weight: 600;
  letter-spacing: .3px; margin-top: 2px;
}
.dropzone-icon { font-size: 18px; line-height: 1; opacity: .55; }

/* 带货视频那一页（用户 2026-09-08 独立出来的）。
 *
 * 🔴 **两栏**：左边传图、右边写补充说明。原来挤在赛道卡片里是单栏，
 *    那个卡片只有 300 多像素宽——一段说明文字被压成竖条，实测没法看。
 *
 * ⚠️ 窄屏自动堆成一栏（手机上传商品图是常见场景）。 */
.goods-row {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-bottom: 16px;
}
.goods-col { display: flex; flex-direction: column; gap: 8px; }
.goods-form textarea {
  width: 100%; min-height: 150px; resize: vertical;
  padding: 10px 12px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  font: inherit; line-height: 1.6;
}
.goods-form textarea:focus {
  outline: none; border-color: var(--accent);
}
.goods-form textarea::placeholder {
  color: var(--muted); opacity: .7; line-height: 1.7;
}

/* 资产库顶部的两个页签。复用 .mode-tab 的样子，但这里是 <a> 不是
 * <label>——切换要换页（数据在服务端筛），不是前端显隐。 */
.lib-tabs { max-width: 320px; margin: 0 0 14px; }
.lib-tabs .mode-tab { text-decoration: none; }

/* 人脸多选（美女生活的「固定这张脸」）。
 *
 * 🔴 **卡片上只放两个按钮**，缩略图在弹窗里铺。
 *    2026-08-13 实测：卡片上直接铺缩略图的话，一屏五六个赛道
 *    整页没法看——那张卡被压成一条竖窄条，连按钮上的字都
 *    竖着一个个排下来。
 */
.face-actions { display: flex; gap: 8px; }
.face-actions .btn { flex: 1; text-align: center; cursor: pointer; }
/* 🔴 「传新的」是个 `<label class="btn">`，不是 `<button>`——
 *    而 `.btn` 只管内边距和圆角，**边框和背景来自 button 的浏览器默认样式**。
 *    不补这一段的话它渲出来是一行灰字，看着根本不像能点（实测确认）。 */
[data-face-upload] {
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--panel-2);
  color: var(--text);
}
[data-face-upload]:hover { border-color: var(--accent); }

/* 选中的脸：卡片上留一小排，不然关掉弹窗就不知道选了谁 */
.face-chosen { display: flex; gap: 4px; flex-wrap: wrap; }
.face-chosen img {
  width: 34px; height: 34px; object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
}

/* 传新的时候逐张起名字——出好的视频按它命名 */
.face-names { display: flex; flex-direction: column; gap: 6px; }
.face-name-row {
  display: flex !important; flex-direction: row !important;
  align-items: center; gap: 6px;
}
.face-name-row span { flex: 0 0 auto; white-space: nowrap; }
.face-name-row input { flex: 1; min-width: 0; }

/* ── 选脸弹窗 ──
 * 原生 <dialog>：自带 ESC 关闭、焦点管理、背景遮罩，不用引库。 */
.face-dialog {
  width: min(560px, 92vw); padding: 0; color: var(--text);
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.face-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.face-dialog-head,
.face-dialog-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 12px 14px;
}
.face-dialog-head { border-bottom: 1px solid var(--border); }
.face-dialog-foot { border-top: 1px solid var(--border); }
.face-dialog > p { padding: 18px 14px; margin: 0; }

.face-grid {
  display: grid; gap: 8px; padding: 14px;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  max-height: min(420px, 55vh); overflow-y: auto;
}
.face-option {
  cursor: pointer; text-align: center;
  border: 2px solid transparent; border-radius: var(--radius);
  padding: 3px; transition: border-color .15s;
}
.face-option:hover { border-color: var(--border); }
/* 选中态：JS 加 .on。**不靠 :has**——那个 2023 年才普及，
   而这台机器上的浏览器版本我们说了不算。 */
.face-option.on {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.face-option img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: calc(var(--radius) - 2px); display: block;
}
.face-name {
  display: block; font-size: 11px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dropzone.has-file .dropzone-icon { opacity: 1; }
.muted.tiny { font-size: 11px; line-height: 1.5; margin: 0; }

/* ── 批量导入表单 ─────────────────────────────────────────────────
   2026-08-10 加：代理和账号都改成整批粘贴（格式交给 luna 整理）。

   ⚠️ 不能复用 .stack-form —— 它 max-width: 320px，textarea 会被压成
      一条缝，而这里要能一眼看到十几行。 */
.bulk-form { display: flex; flex-direction: column; gap: 12px; }
.bulk-form textarea {
  width: 100%;
  min-height: 150px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  /* 等宽字体：一行一条的东西对齐了才看得出哪行有问题 */
  font-family: var(--data);
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}
.bulk-form .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.bulk-form .row input[type="text"] { flex: 1; min-width: 220px; }

/* 批量换 IP 那一块（用户 2026-09-02）。嵌在代理列表上方，
   要跟外层 panel 区分开——不然一眼看不出"这几行是一组操作"。 */
.replace-box {
  display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.replace-box .grow { flex: 1; min-width: 320px; }
.replace-box .side { min-width: 210px; }
.replace-box textarea {
  width: 100%;
  min-height: 84px;      /* 四行左右：一次换几条是常见量 */
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--data);
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}

/* 命令行示例。给批量登录那条命令用 */
pre.cmd {
  margin: 8px 0;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--data);
  font-size: 13px;
  color: var(--text);
  overflow-x: auto;
}

/* 表格里的次要信息：代理绑了哪些号、账号绑的出口 IP */
.small { font-size: 12px; line-height: 1.5; margin-top: 3px; }

/* 批量操作条。账号页的「选中 → 分赛道」用 */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.bulk-bar .pick-all { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.bulk-bar select { min-width: 140px; }

/* 远程浏览器窗口。账号页嵌的那个 noVNC。
   2026-08-10 加：用户不想每次开新标签页 + 输密码 secret。 */
details.panel > summary {
  cursor: pointer;
  font-size: 15px;
  padding: 2px 0;
  list-style: revert;          /* 保留三角标记，让人知道能点开 */
}
details.panel > summary:hover { color: var(--accent); }
.vnc-frame {
  width: 100%;
  /* 远程屏幕是 1920×1080，按 16:9 给高度，缩放交给 noVNC 的 resize=scale */
  aspect-ratio: 16 / 9;
  min-height: 420px;
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #000;
}

/* 「该你了」提示条。登录撞上验证码时轮询把它点亮。
   ⚠️ 颜色要够扎眼——人可能正在页面别处，错过就是 5 分钟后超时重来。 */
.alert-wait {
  margin: 12px 0;
  padding: 10px 14px;
  border-radius: 8px;
  /* 🔴 用 --live：它的语义就是「这件事就要发生、需要你」。
     原来是浅底深字（#fff6e5），在深色后台里是一块白斑——
     扎眼是对的，刺眼不是。 */
  border: 1px solid var(--live);
  background: color-mix(in srgb, var(--live) 16%, transparent);
  color: var(--live);
  font-size: 14px;
}

/* 实时估价。形象 × 舞是全排列，3+3 就是 9 条——
   提交前必须让人看见会花多少钱。 */
.cost-hint {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; padding: 8px 10px; border-radius: var(--radius);
  font-size: 12px; line-height: 1.5;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
/* 超过 20 条转成警示色——那已经是 ¥40 上下了 */
.cost-hint.warn {
  background: color-mix(in srgb, var(--warn) 14%, transparent);
  border-color: color-mix(in srgb, var(--warn) 45%, transparent);
}
.cost-money { color: var(--muted); white-space: nowrap; }
.cost-hint.warn .cost-money { color: var(--warn); }

/* 账号页的「全部 / 未登录 / 已登录」筛选。纯前端显隐，见模板里的注释。 */
.filter-btn {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  padding: 5px 12px;
  cursor: pointer;
}
.filter-btn:hover { color: var(--text); }
.filter-btn.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* 远程窗口的关闭按钮。🔴 **必须一眼看得见**。
   原来藏在一行小字里，人滚下去看画面时完全找不到
   （用户 2026-08-12 反馈"完全看不到关闭按钮"）。 */
/* ═══ 登录进度条 ═══
   航班牌那套语言：走过的暗下去、正在的亮着、没到的灰着。
   ⚠️ 没有进度时整块由 JS 隐藏——空条子会被读成"卡在 0%"。 */
.progress {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-2);
}
.progress-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 9px;
}
.progress-head strong {
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: .3px;
  color: var(--live);          /* 同 alert-wait：正在发生的事 */
}
.progress-count {
  margin-left: auto;
  font-family: var(--data);
  font-size: 12px;
}
.progress-track {
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--live);
  /* 慢一点：一格一格跳会显得像动画，而它是真事。 */
  transition: width .45s ease;
}
.progress-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--muted);
}
.progress-steps li::before {
  content: "○ ";
  font-family: var(--data);
}
.progress-steps li.done { color: var(--ok); }
.progress-steps li.done::before { content: "✓ "; }
.progress-steps li.now {
  color: var(--live);
  font-weight: 600;
}
.progress-steps li.now::before { content: "▸ "; }

/* 🔴 「过验证」不是"在跑"而是**要你动手**——扫一眼就该看出区别。
   ⚠️ 它平时**根本不在列表里**（大多数号不撞验证码），
      撞上了才由后端插进来。见 web.publish._progress_of。 */
.progress-steps li.now.wait {
  color: var(--err);
  animation: wait-pulse 1.4s ease-in-out infinite;
}
.progress-steps li.now.wait::before { content: "✋ "; }
@keyframes wait-pulse { 50% { opacity: .45; } }

/* ═══ 人物形象（一号一人） ═══
   整块就是个上传按钮：点缩略图直接换一张（onchange 自动提交）。
   ⚠️ 没定形象的要**显眼**——那个号出的片是随机路人。 */
.persona-cell { width: 68px; }
.persona-pick {
  display: block;
  width: 56px;
  height: 74px;                /* 9:16 的比例，跟出片一致 */
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--panel-2);
}
.persona-pick:hover { border-color: var(--accent); }
.persona-pick img {
  width: 100%;
  height: 100%;
  object-fit: cover;           /* 裁成竖图，不拉伸 */
  display: block;
}
.persona-pick input[type=file] { display: none; }

/* 有照片时：图是「看大图」，底下一行小字才是「换一张」。
   ⚠️ 原来点图直接弹文件框——**想看清反而没办法**，还容易误触换掉。 */
.persona-thumb {
  display: block;
  width: 56px;
  height: 74px;                /* 9:16，跟出片一致 */
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: zoom-in;
}
.persona-thumb:hover { border-color: var(--accent); }
.persona-swap {
  display: block;
  width: 56px;
  margin-top: 3px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}
.persona-swap:hover { color: var(--accent); text-decoration: underline; }
.persona-swap input[type=file] { display: none; }
.persona-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--warn);          /* 🔴 警示色：没形象 = 出片是随机路人 */
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
}

/* ═══ 大图弹层 ═══
   人物照 56px 看不清脸，而它决定这个号所有片的长相。 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(0, 0, 0, .82);
}
.lightbox[hidden] { display: none; }   /* ⚠️ flex 会盖掉 hidden，必须显式写 */
.lightbox-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-height: 100%;
}
.lightbox img {
  max-width: min(92vw, 560px);
  max-height: calc(100vh - 120px);   /* 留出底下那条 */
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, .6);
}
.lightbox-bar {
  display: flex;
  align-items: center;
  gap: 14px;
}
.lightbox-bar button {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.lightbox-bar button:hover { border-color: var(--accent); }

.vnc-wrap { position: relative; }
.vnc-close {
  position: sticky;          /* 跟着画面滚，滚到哪都在 */
  top: 12px;
  float: right;
  z-index: 10;
  margin: 12px 12px 0 0;
  padding: 9px 16px;
  border: none;
  border-radius: 8px;
  background: var(--err);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,.5);
}
.vnc-close:hover { background: color-mix(in srgb, var(--err) 80%, #fff); }

/* ══════════════════════════════════════════════════════════════════
   值班表：赛道排班（2026-08-12）

   这不是账号列表，是**控制室的值班台**——核心信息是时间不是账号。
   所以时刻用 --display（Bahnschrift，站台牌那种字）设得比正文大，
   排在最左边，让整块读起来像一张时刻表而不是一张数据表。

   🔴 **--live 只在这一块出现**。别处用了，值班表上"哪条赛道
      下一个播"就不再一眼可见——那是这个页面唯一要回答的问题。
   ══════════════════════════════════════════════════════════════════ */

/* ---------- 「要看一眼」：昨晚没发出去的置顶 ---------- */

/* 用户 2026-08-12 选的：早上过来最想先看到这个。
   全自动模式下正常的班不用看，只有异常需要人。 */
.attention {
  border-color: color-mix(in srgb, var(--err) 45%, transparent);
  background: color-mix(in srgb, var(--err) 7%, var(--panel));
}
.attention h2 { color: color-mix(in srgb, var(--err) 65%, var(--text)); }

.miss {
  display: flex; align-items: baseline; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.miss:last-child { border-bottom: none; }
.miss-when {
  font-family: var(--display);
  font-size: 20px; letter-spacing: .04em;
  color: var(--muted); white-space: nowrap;
}
.miss-who { font-weight: 600; }
.miss-why { color: var(--muted); font-size: 13px; }

/* 按赛道分组，默认全部收起（用户 2026-08-31）。
   ⚠️ 几十条平铺时要滚三屏，而真正要回答的只有两个问题：
      **哪条赛道在出事**、**出的是哪几种事**。 */
.miss-lane {
  border-bottom: 1px solid var(--border);
}
.miss-lane:last-of-type { border-bottom: none; }
.miss-lane > summary {
  cursor: pointer;
  list-style: none;
  display: flex; align-items: baseline; gap: 10px;
  padding: 10px 0;
}
.miss-lane > summary::-webkit-details-marker { display: none; }
.miss-lane > summary::before { content: "▸"; color: var(--muted); }
.miss-lane[open] > summary::before { content: "▾"; }
.lane-name { font-weight: 600; }
.lane-count {
  font-size: 12px; padding: 1px 7px; border-radius: 999px;
  background: color-mix(in srgb, var(--err) 18%, transparent);
  color: color-mix(in srgb, var(--err) 70%, var(--text));
  white-space: nowrap;
}
/* 不展开也看得出大概是什么问题 */
.lane-hint {
  color: var(--muted); font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
/* 展开后每条缩进一点，跟赛道标题分开 */
.miss-lane .miss { padding-left: 18px; }

/* 今日失败按原因拆开（用户 2026-08-31：「失败要信息要分开」）。
   复用 .miss-lane 的折叠外壳，里面换成「条数 + 原因 + 怎么办」三段。 */
.why-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  padding: 7px 0 7px 18px;
  border-top: 1px solid var(--border);
  align-items: baseline;
}
.why-n {
  font-variant-numeric: tabular-nums;   /* 数字对齐，一眼看出大小 */
  text-align: right;
  font-weight: 600;
  color: color-mix(in srgb, var(--err) 70%, var(--text));
}
.why-name { font-weight: 500; text-decoration: none; color: var(--text); }
.why-name:hover { text-decoration: underline; }
/* 「怎么办」才是这一行的价值——光说"代理断了"没用 */
.why-do { font-size: 12px; margin-top: 2px; line-height: 1.5; }
/* 🔴 会自动重来的那些**压暗**：它们不用人管，混在里面会让人以为坏了 */
.why-fake .why-n { color: var(--muted); font-weight: 400; }
.why-fake .why-name { color: var(--muted); font-weight: 400; }
/* 折叠标题上那颗「要管的 N」——减掉自动重来之后的真实数字 */
.lane-real {
  font-size: 12px;
  color: color-mix(in srgb, var(--err) 70%, var(--text));
  background: color-mix(in srgb, var(--err) 12%, transparent);
  border-radius: 999px;
  padding: 1px 8px;
}

/* 长报错折起来（用户 2026-08-31）。
   ⚠️ 收起时**只占一行**——原来十几条长报错堆在一起把整页顶开，
      反而看不出"今天到底出了几种问题"。 */
details.miss-why > summary {
  cursor: pointer;
  list-style: none;                 /* 去掉默认三角，换自己的 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
details.miss-why > summary::-webkit-details-marker { display: none; }
details.miss-why > summary::before {
  content: "▸ ";
  color: var(--muted);
}
details.miss-why[open] > summary::before { content: "▾ "; }
details.miss-why[open] > summary {
  white-space: normal;              /* 展开后不再截断 */
  color: var(--text);
}
.miss-full {
  margin-top: 6px;
  padding: 8px 10px;
  border-left: 2px solid var(--border);
  color: var(--muted);
  /* 报错里有截图路径和 URL，长得不换行会把版面撑破 */
  word-break: break-word;
  white-space: pre-wrap;
}

/* ---------- 卡片墙：一条赛道一张卡 ---------- */

/* 用户 2026-08-12 定的形式。第一张永远是「还没排班」，
   在那张卡上直接分配——分完立刻出现在对应赛道的卡里，同一屏看得到结果。 */

.board-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 22px 0 12px;
}
.board-head h2 { margin: 0; font-size: 15px; font-weight: 600; }

.cardwall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  align-items: start;      /* 卡各自按内容高，不互相拉齐 */
}

.lanecard {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 13px;
}
.lanecard:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }

/* 整张卡可点。覆盖层从赛道名那个链接**拉伸**出来——
   点卡上任何地方都等于点那个链接，不用写 JS，也不会变成嵌套 <a>。 */
.lanecard.is-clickable { position: relative; }
.lanecard.is-clickable .lanecard-name::after {
  content: "";
  position: absolute;
  inset: 0;              /* 铺满整张卡 */
}
.lanecard.is-clickable:hover { cursor: pointer; }
.lanecard.is-clickable:hover .lanecard-name { color: var(--accent); }

/* 卡里其他能点的东西要浮在覆盖层之上，否则会被它吃掉 */
.lanecard.is-clickable .lanecard-cta { position: relative; z-index: 1; }

/* 闲置的卡压暗一档——**卡还在但不抢眼**。
   人每天看的是"今天几点谁发"，还没安排的不该跟在跑的一样醒目。 */
.lanecard.is-idle { background: color-mix(in srgb, var(--panel) 70%, var(--bg)); }
.lanecard.is-idle .lanecard-name { color: var(--muted); }

/* 赛道文件没了但还有号挂着——那些号发不出去，必须扎眼 */
.lanecard.is-offline { border-color: color-mix(in srgb, var(--err) 45%, transparent); }

.lanecard-top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 9px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}

/* 赛道名用 display 字体、拉开字距——这是卡的标题，也是进详情页的入口 */
.lanecard-name {
  font-family: var(--display);
  font-size: 18px; font-weight: 600; letter-spacing: .06em;
  color: var(--text);
  margin: 0;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
a.lanecard-name:hover { color: var(--accent); text-decoration: none; }

/* 🔴 排班时刻。**琥珀色只在这儿和当前时刻线上出现**——
   值班表要一眼看出"哪条赛道下一个播"，靠的正是它在别处不出现。 */
.lanecard-at {
  font-family: var(--data);
  font-size: 13px; color: var(--live);
  white-space: nowrap;
}
.lanecard-meta { display: flex; align-items: baseline; gap: 9px; white-space: nowrap; }
.lanecard-off, .lanecard-count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.lanecard-count { font-family: var(--data); font-variant-numeric: tabular-nums; }

.lanecard-empty {
  color: var(--muted); font-size: 13px; line-height: 1.7;
  margin: 6px 0 2px;
}
.lanecard-empty.warn { color: color-mix(in srgb, var(--err) 70%, var(--text)); }

.lanecard-note { color: var(--muted); font-size: 12px; margin: 9px 0 0; }

.lanecard-cta {
  display: inline-block; margin-top: 9px;
  font-size: 13px; color: var(--accent);
}

/* ---------- 「还没排班」那张卡的分配表单 ---------- */

.idle-card { border-style: dashed; }

.pick-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 11px; }

.pick {
  display: flex; align-items: baseline; gap: 7px;
  padding: 4px 6px; border-radius: 5px;
  cursor: pointer; font-size: 13px;
}
.pick:hover { background: var(--panel-2); }
.pick input { margin: 0; }
.pick .handle { font-family: var(--data); font-size: 12px; color: var(--muted); }

.assign-row { display: flex; gap: 8px; }
.assign-row select { flex: 1; min-width: 0; }

/* ---------- 时刻轴 ---------- */

.slots { display: flex; flex-direction: column; }

.slot {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  align-items: baseline;
  gap: 9px;
  padding: 4px 0;
  font-size: 13px;
}
/* 时刻列。等宽数字对齐——这一列要能竖着扫下来。 */
.slot-at {
  font-family: var(--data);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.slot-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-who .handle { font-family: var(--data); font-size: 12px; color: var(--muted); }
.slot-note { font-size: 12px; color: var(--muted); white-space: nowrap; }

.slot.is-done .slot-at { color: var(--ok); }
.slot.is-miss .slot-at, .slot.is-miss .slot-note { color: var(--err); }

/* 🔴 当前时刻线。整个设计的签名元素。

   ⚠️ **只在已经过点时画**（2026-08-12 真跑一遍才发现）：没到点时
      每张卡的线都在同一个位置，不传达任何信息。画出来时它有确切
      含义——这一班已经走过去了，上面那几行是今天的结果。 */
.now-line {
  display: flex; align-items: center; gap: 7px;
  margin: 4px 0 1px;
  color: var(--live);
  font-family: var(--data);
  font-size: 11px; letter-spacing: .04em;
}
.now-line::before,
.now-line::after { content: ""; height: 1px; background: var(--live); opacity: .5; }
.now-line::before { width: 44px; flex: none; }
.now-line::after { flex: 1; }

/* ---------- 双时钟 ---------- */

/* ⚠️ 排班是**美东**，而全站别处显示的是北京时间（templating.DISPLAY_TZ）。
   两个时区在同一个页面上，不并排写清楚的话人一定会看错——
   「20:00」到底是哪个 20:00 是这个界面最容易出的误解。 */
.clocks {
  display: flex; align-items: baseline; gap: 16px;
  font-family: var(--data); font-size: 13px;
}
.clock-et { color: var(--live); }
.clock-cn { color: var(--muted); }
.clocks .zone { font-size: 11px; opacity: .75; }


/* ---------- 设置表单：左标签右控件 ---------- */

/* 赛道详情页那种「一行一个设置项 + 一句解释」的排法。
   ⚠️ 解释文字**必须在控件旁边**不是集中在底下——
   人填「错开几分钟」时要当场知道这个数是什么意思。 */
.setting-form { display: flex; flex-direction: column; gap: 13px; margin: 16px 0 0; }

.setting {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: baseline;
  gap: 12px;
}
.setting > label:first-child { color: var(--muted); font-size: 13px; }
.setting > div { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }

.setting-hint { color: var(--muted); font-size: 12px; }

.inline-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.inline-check input { margin: 0; }

/* 养号的三个概率并排。⚠️ 三个是**独立**的（各掷各的骰子），
   所以并排而不是叠在一起——叠着看像"三选一"。 */
.pct-row { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.pct-row span { color: var(--muted); font-size: 13px; }
.pct-row input { margin: 0 2px; }

input[type=number] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 7px 10px;
  width: 5.5em;
}
input[type=number]:focus { outline: none; border-color: var(--accent); }

/* ---------- 涨跌 ---------- */

/* ⚠️ **涨跌只在有对比数据时才画**（模板里判 None）。
   "还没有对比数据"要显示成「—」，不能显示 +0——那是两回事。 */
.delta {
  font-family: var(--data);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  padding: 1px 4px;
  border-radius: 4px;
  white-space: nowrap;
}
.delta.up { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.delta.down { color: var(--err); background: color-mix(in srgb, var(--err) 12%, transparent); }


/* 今天的结果。**只在真有动静时才出现**——全部"还没到点"是默认状态，
   写出来是噪音；粉丝数也不在这儿显示（新号都是 0，满屏「0 粉」
   既没信息又占地方），点进详情页看。 */
.lanecard-today { font-size: 12px; display: flex; gap: 8px; padding: 3px 0 1px; }
.lanecard-today .ok { color: var(--ok); }
.lanecard-today .bad { color: var(--err); }

/* ---------- 养号：「还没排班」卡上的号名 ---------- */

/* 🔴 **只是名字，不是可点的东西**。归属在「自动发布作品」那一页改，
   这里做成链接会让人以为点了能分配（见 nurture.py 的头注）。 */
.nurture-names {
  display: flex; flex-wrap: wrap; gap: 4px 8px;
  margin-top: 8px; font-size: 12px;
}
.nurture-name { color: var(--muted); font-family: var(--data); }
/* 没登录的划掉——养号要开浏览器，这些号一步都走不了 */
.nurture-name.is-out { text-decoration: line-through; opacity: .55; }


/* ── 上传缩略图（带货视频页）────────────────────────────────
   传完能看见、能删、能点开放大（用户 2026-09-08 要的）。

   🔴 画廊在 <label class="dropzone"> **外面**——放里面点图会再弹
      文件框。DOM 结构由模板保证，这里只管样子。 */
.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.thumb {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel-2);
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;      /* 详情长图很窄，cover 才不至于压扁 */
  display: block;
  cursor: zoom-in;
}
.thumb-x {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  padding: 0;
  line-height: 18px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(11, 13, 16, .82);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}
.thumb-x:hover { background: var(--err); border-color: var(--err); }
.thumb-n {
  position: absolute;
  left: 3px;
  bottom: 3px;
  min-width: 16px;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(11, 13, 16, .82);
  color: var(--muted);
  font: 11px/16px var(--data);
  text-align: center;
}

/* 点开放大。点哪都关，Esc 也关。 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, .86);
  cursor: zoom-out;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;    /* ⚠️ 放大要看全，跟缩略图的 cover 相反 */
  border-radius: var(--radius);
}


/* ── 资产库「按人看」筛选条（只有管理员看得见）────────────── */
.who-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
}
.who-label {
  color: var(--muted);
  font-size: 12px;
  margin-right: 2px;
}
.who-chip {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}
.who-chip:hover { border-color: var(--accent); color: var(--text); }
.who-chip.on {
  background: var(--panel-2);
  border-color: var(--accent);
  color: var(--text);
}
.who-chip b {
  color: var(--muted);
  font-weight: 600;
  font-family: var(--data);
}
.who-chip.on b { color: var(--accent); }


/* ── 带货页的勾选项 ───────────────────────────────── */
.switch-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 4px 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-2);
  cursor: pointer;
}
.switch-row input { margin-top: 3px; flex: none; }
.switch-row .muted { font-size: 12px; line-height: 1.6; display: block; }


/* ── 带货页的模特选择 ───────────────────────────────── */
.picker-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 4px 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-2);
}
.picker-row label {
  display: flex;
  align-items: center;
  gap: 7px;
}
.picker-label { color: var(--muted); font-size: 12px; }
.picker-row select {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.picker-note { flex: 1 1 260px; line-height: 1.6; }
/* 按结构出片那组（2026-11-02）：开头那句的输入框占满一行，价格框跟下拉框一样大小 */
.picker-row label.wide { flex: 1 1 360px; }
.picker-row label.wide input { flex: 1; min-width: 0; }
.picker-row input[type=text] { padding: 4px 8px; font-size: 13px; }


/* ── 带货页的元素选择（拍摄视角 / 声音方式 / 内容元素） ───────────
   用户 2026-10-12 加。三组各自成块，跟上面的模特选择同一套底色，
   一眼能看出"这几个是一组的、那几组是另一回事"。 */
.element-group { margin: 0 0 4px; }
.element-group .step-label { margin-bottom: 6px; }

.tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
  margin: 4px 0 10px;
}
.tag-item {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-2);
  cursor: pointer;
}
.tag-item input { margin-top: 3px; flex: none; }
.tag-item .muted { font-size: 12px; line-height: 1.6; display: block; }
/* 判罚提醒：标黄，但不做成错误色——它只是提醒，不是拦着不让选 */
.tag-warn { display: block; font-size: 12px; line-height: 1.6; color: var(--warn, #b8860b); }

/* ══════════════════════════════════════════════════════════════════════
   苹果手机那四页（2026-11-01 简化）

   用户原话：「UI 也要改掉简单点，这个能给别人更好的使用」「写 md 使用的人
   都是傻子，操作越简单越好，ui 越简洁越好」。

   这一块只做一件事：让一个不懂技术的人一眼看懂每台手机怎么了。
   配色意义固定，五种颜色各自只有一种含义（而且**颜色之外一定有字**，
   色盲也读得出来）：

       tone-ok    绿   可以用了
       tone-info  蓝   正在准备 / 正在发（还在自己走，不用管）
       tone-warn  黄   等人做一件事（手机上点信任 / 装 TikTok）
       tone-bad   红   出错了
       tone-off   灰   没插着

   ⚠️ 全部挂在 `.phones-ui` 底下（那四页的外层 div）。不挂的话 `button.big`
      这种规则会漏到别的页面去（出片页的「开始出片」就是 `primary big`）。
      只有子导航那两条例外：电脑 / 苹果账号两页也引这个导航，而它们外面没有
      `.phones-ui`。
   ══════════════════════════════════════════════════════════════════════ */

/* 子导航末尾那个小小的「管理」：只在管理员眼里出现，别抢主栏的位置 */
.subnav .subnav-admin { margin-left: auto; font-size: 12px; opacity: .55; }
.subnav .subnav-admin:hover, .subnav .subnav-admin.on { opacity: 1; }
.subnav.subnav-sub { margin-top: -8px; }
.subnav.subnav-sub a { font-size: 13px; padding: 4px 12px; }

.phones-ui { --tone: var(--muted); }
.phones-ui .tone-ok   { --tone: var(--ok); }
.phones-ui .tone-info { --tone: var(--accent); }
.phones-ui .tone-warn { --tone: var(--warn); }
.phones-ui .tone-bad  { --tone: var(--err); }
.phones-ui .tone-off  { --tone: var(--muted); }

/* 这几页原来一条样式都没有：小字、红字、灰掉 全是浏览器默认样子 */
.phones-ui .tiny { font-size: 12px; }
.phones-ui .err-text { color: var(--err); }
.phones-ui .warn-text { color: var(--warn); }
.phones-ui .dim { opacity: .55; }
.phones-ui .dot {
  display: inline-block; width: 8px; height: 8px; margin-right: 6px;
  border-radius: 50%; background: var(--muted); vertical-align: middle;
}
.phones-ui .dot.on { background: var(--ok); }
.phones-ui .phone-no { font-weight: 600; }

/* 没带 class 的按钮（画面下面那排、高级里的命令）：跟深色底配套 */
.phones-ui button:not(.primary):not(.link-btn) {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 7px 14px; cursor: pointer;
}
.phones-ui button:not(.primary):not(.link-btn):hover { border-color: var(--accent); }
.phones-ui button.danger:not(.link-btn) { color: var(--err); }
.phones-ui button:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 列表：卡片网格 ---------- */

.phones-ui .phone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.phones-ui .phone-card {
  display: flex; flex-direction: column; gap: 6px;
  min-height: 150px;
  padding: 16px 16px 12px;
  background: color-mix(in srgb, var(--tone) 7%, var(--panel));
  border: 1px solid var(--border);
  border-left: 3px solid var(--tone);
  border-radius: var(--radius);
}
/* 底色只染很淡一层，颜色主体是左边那道竖条 + 圆点 + 文字 ——
   整块涂满的话十台手机摆一起像一排红绿灯，反而看不出哪台有问题 */
.phones-ui .phone-card.tone-off { background: var(--panel); }
.phones-ui .phone-card.picked { border-color: var(--accent); border-left-color: var(--accent); }

.phones-ui .phone-card-top {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  color: var(--text);
}
.phones-ui .phone-card-top:hover { text-decoration: none; }
.phones-ui .phone-card-top:hover .phone-card-no { color: var(--accent); }
.phones-ui .phone-card-no {
  font-family: var(--display);
  font-size: 26px; font-weight: 600; line-height: 1.1; letter-spacing: .02em;
}
.phones-ui .phone-card-handle { font-size: 12px; color: var(--muted); }

/* 机型 + 系统（iPhone 8 · iOS 16.7）。比编号小、比状态淡——
   它是"认得是哪台"的第二线索，不参与扫视 */
.phones-ui .phone-card-device {
  font-size: 12px; color: var(--muted); line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.phones-ui .phone-card-batt { font-size: 12px; color: var(--muted); }
.phones-ui .phone-card-batt.low { color: var(--warn); }

.phones-ui .phone-card-status { display: flex; align-items: flex-start; gap: 7px; margin-top: 2px; }
.phones-ui .phone-card-title { font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--tone); }
.phones-ui .phone-card-detail { font-size: 12px; color: var(--muted); line-height: 1.55; }

/* 状态圆点。标题本身就写着状态，这个点只是"扫一眼"用的 */
.phones-ui .state-dot {
  flex: none; width: 9px; height: 9px; margin-top: 5px;
  border-radius: 50%; background: var(--tone);
}
.phones-ui .tone-info .state-dot { animation: pulse 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .phones-ui .tone-info .state-dot { animation: none; } }

/* 准备到第几步：一条细进度（鼠标悬停看「第 n/4 步」） */
.phones-ui .phone-card-progress {
  height: 3px; border-radius: 2px; overflow: hidden;
  background: color-mix(in srgb, var(--tone) 18%, transparent);
}
.phones-ui .phone-card-progress > span {
  display: block; height: 100%; background: var(--tone);
  transition: width .4s ease;
}

.phones-ui .phone-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: auto; padding-top: 10px;
}
.phones-ui .phone-pick { display: flex; align-items: center; gap: 6px; margin-left: auto; font-size: 13px; cursor: pointer; }
.phones-ui .phone-pick input { width: 18px; height: 18px; margin: 0; cursor: pointer; }
.phones-ui .retry-btn { padding: 4px 14px; font-size: 13px; }

/* 没手机时那三步。**整段就是这一页**，要像说明书一样好读：大号圆圈编号 */
.phones-ui .phone-guide { max-width: 640px; padding: 22px 26px; }
.phones-ui .phone-guide h2 { font-size: 17px; margin-bottom: 18px; }
.phones-ui .guide-steps { margin: 0 0 16px; padding: 0; list-style: none; counter-reset: guide; }
.phones-ui .guide-steps li {
  position: relative; counter-increment: guide;
  min-height: 34px; margin-bottom: 14px; padding: 4px 0 0 48px;
  font-size: 15px; line-height: 1.6;
}
.phones-ui .guide-steps li::before {
  content: counter(guide);
  position: absolute; left: 0; top: 0;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 15px;
}
.phones-ui .guide-steps li span { display: block; color: var(--muted); font-size: 12px; line-height: 1.6; }

/* 底部固定条。列表会很长，勾完不用滚回去找按钮。
   用 sticky 不用 fixed：fixed 要知道侧栏多宽，侧栏一改宽度它就歪了 */
.phones-ui .phone-bulkbar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin: 18px -28px -24px;   /* 顶到内容区的边上，看着像一条工具条 */
  padding: 12px 28px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--border);
}

/* ---------- 详情：顶部大状态 ---------- */

.phones-ui .phone-state {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
  margin: 0 0 18px; padding: 16px 20px;
  background: color-mix(in srgb, var(--tone) 8%, var(--panel));
  border: 1px solid var(--border);
  border-left: 4px solid var(--tone);
  border-radius: var(--radius);
}
.phones-ui .phone-state.tone-off { background: var(--panel); }
.phones-ui .phone-state-main { display: flex; align-items: flex-start; gap: 10px; }
.phones-ui .phone-state-main .state-dot { width: 12px; height: 12px; margin-top: 7px; }
.phones-ui .phone-state-title { margin: 0; font-size: 19px; line-height: 1.35; color: var(--tone); }
.phones-ui .phone-state-detail { margin: 4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.6; }

/* ---------- 详情：两栏（画面 / 基本信息） ---------- */

.phones-ui .phone-detail {
  display: grid; gap: 18px;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
}
@media (max-width: 1100px) { .phones-ui .phone-detail { grid-template-columns: 1fr; } }
.phones-ui .phone-detail > .panel, .phones-ui .detail-side > .panel:first-child { margin-top: 0; }
.phones-ui .detail-side { min-width: 0; }

/* 实时画面。点画面 = 点手机，所以要看得见整个屏幕、不能被裁。
   宽度在模板里按屏幕高度封了顶（`min(100%, 72vh × 宽/高)`） */
.phones-ui .screen-box {
  position: relative; margin: 0 auto;
  background: #000; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.phones-ui .screen-box img { display: block; width: 100%; height: 100%; object-fit: contain; cursor: crosshair; }
.phones-ui .screen-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; gap: 4px;   /* column：里面那个 <br> 在横排 flex 里不换行 */
  align-items: center; justify-content: center; text-align: center;
  color: var(--muted); font-size: 13px; line-height: 1.8; padding: 20px;
}
.phones-ui .tap-dot {
  position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border: 2px solid var(--accent); border-radius: 50%;
  pointer-events: none; animation: phone-tap .7s ease-out forwards;
}
@keyframes phone-tap { from { opacity: .9; transform: scale(.5); } to { opacity: 0; transform: scale(1.4); } }

.phones-ui .screen-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }
.phones-ui .screen-actions button { padding: 6px 12px; font-size: 13px; }
.phones-ui .type-form input[type=text] { flex: 1; min-width: 0; }

.phones-ui .toast {
  margin-top: 10px; padding: 8px 12px; border-radius: 6px; font-size: 13px;
  background: color-mix(in srgb, var(--ok) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent);
}
.phones-ui .toast.bad {
  background: color-mix(in srgb, var(--err) 12%, transparent);
  border-color: color-mix(in srgb, var(--err) 40%, transparent);
}

/* 基本信息：四个输入框 + 保存 */
.phones-ui .edit-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.phones-ui .edit-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.phones-ui .edit-grid label input { color: var(--text); }
.phones-ui .edit-grid .full { grid-column: 1 / -1; }

/* ---------- 高级（默认折叠，里面一个都没删） ---------- */

.phones-ui .phone-advanced > summary { font-size: 14px; color: var(--muted); }
.phones-ui .adv-block { margin-top: 22px; }
.phones-ui .adv-block h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.phones-ui .adv-block .panel-actions { flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.phones-ui .adv-block > input[type=text] { width: 100%; max-width: 320px; }
.phones-ui .checklist .bad::before { content: "✗"; color: var(--err); }
.phones-ui .checklist .hint { text-align: left; margin: 2px 0 4px; }

/* ---------- 发片页 ---------- */

.phones-ui .phone-group { border: 0; margin: 0 0 10px; padding: 0; }
.phones-ui .phone-group legend {
  display: flex; align-items: center; gap: 8px;
  padding: 0 0 6px; font-size: 13px; color: var(--muted);
}
.phones-ui .phone-skip { margin: 10px 0; font-size: 13px; }
.phones-ui .phone-skip > summary { cursor: pointer; color: var(--muted); }
.phones-ui .phone-skip ul { margin: 8px 0 0; padding-left: 18px; line-height: 1.9; }

.phones-ui .phone-post select.wide,
.phones-ui .phone-post textarea.wide,
.phones-ui .phone-post .wide-input { width: 100%; }
.phones-ui .phone-post .inline-form .wide-input { flex: 1; width: auto; min-width: 200px; }
.phones-ui .phone-post textarea {
  padding: 10px 12px; resize: vertical; font: inherit; line-height: 1.6;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
}
.phones-ui .phone-post textarea:focus { outline: none; border-color: var(--accent); }
.phones-ui .phone-post video { display: block; width: 100%; max-height: 360px; margin-top: 10px; background: #000; border-radius: 6px; }

.phones-ui .submit-panel .muted.tiny { font-size: 13px; line-height: 1.8; }
.phones-ui .big-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.phones-ui .big-actions button { flex: 1 1 220px; }
.phones-ui button.big { padding: 12px 26px; font-size: 15px; font-weight: 600; border-radius: 8px; }
/* 「先试一遍」空心、「发出去」实心 —— 两个一样重的话人会随手点右边那个 */
.phones-ui button.ghost { background: transparent; }

/* 发片页：没准备好的手机照样列出来，但灰掉、不能勾，写着为什么 */
.phones-ui .tag-item.is-off { opacity: .55; cursor: not-allowed; }
.phones-ui .tag-item.is-off input { cursor: not-allowed; }
.phones-ui .tag-why { display: block; font-size: 12px; line-height: 1.6; color: var(--muted); }

/* 发片记录：空跑的那条用中性色 —— 绿色会被扫一眼读成「发出去了」 */
.phones-ui .badge.dry { color: var(--muted); border-color: var(--border); background: transparent; }

/* 传文件那格：浏览器默认是浅色的，摆在深色表单里很扎眼 */
.phones-ui input[type=file] {
  width: 100%;
  padding: 8px 10px;
  color: var(--muted);
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 6px;
  cursor: pointer;
}
.phones-ui input[type=file]:hover { border-color: var(--accent); }
.phones-ui input[type=file]::file-selector-button {
  margin-right: 10px; padding: 6px 12px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; font: inherit;
}
/* ⚠️ 那个按钮在 Chromium 上忽略 `input[type=file]` 的 background（它自带一层
   白色控件底），而 `!important` 压不过它——只能给按钮自己上色。
   Firefox 认上面那条，Chrome 认这条，两套都留着。 */
.phones-ui input[type=file]::-webkit-file-upload-button {
  margin-right: 10px; padding: 6px 12px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; font: inherit;
}
