/* 混剪流水线控制台。自用工具,但给人看的东西该有个样子。
   深浅色跟随系统;所有间距走 4px 栅格;类名沿用旧的,老模板不用改也能变好看。 */

:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #94a3b8;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --good: #15803d;
  --good-soft: #dcfce7;
  --bad: #be123c;
  --bad-soft: #ffe4e6;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px -12px rgba(15, 23, 42, .18);
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --surface: #141a2e;
    --surface-2: #1b2340;
    --text: #e8ecf6;
    --text-2: #a9b4cc;
    --muted: #7c8aa8;
    --line: #253052;
    --line-2: #33406b;
    --accent: #818cf8;
    --accent-soft: #1e2547;
    --good: #4ade80;
    --good-soft: #14321f;
    --bad: #fb7185;
    --bad-soft: #3a1622;
    --warn: #fbbf24;
    --warn-soft: #3a2c10;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -14px rgba(0, 0, 0, .7);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Microsoft YaHei", "Noto Sans Thai", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------------ 顶栏 */

header.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 12px 20px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}

.brand {
  font-weight: 650; font-size: 15px; letter-spacing: .01em;
  color: var(--text); text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.brand::before {
  content: ""; width: 20px; height: 20px; border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), #22d3ee);
}

.nav { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: var(--text-2); text-decoration: none; font-size: 14px;
  padding: 6px 12px; border-radius: 8px; transition: background .12s, color .12s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.crumb { color: var(--muted); font-size: 14px; }

main { max-width: 1080px; margin: 0 auto; padding: 28px 20px 64px; }

/* ------------------------------------------------------------------ 排版 */

h1 { font-size: 26px; line-height: 1.25; margin: 0 0 6px; letter-spacing: -.02em; }
h2 { font-size: 16px; margin: 0 0 10px; letter-spacing: -.01em; }
p { margin: 0 0 12px; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
small { font-weight: normal; }
code {
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 5px; font-size: .9em;
}
.muted { color: var(--muted); }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }

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

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.grid, .videos {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.grid .card, .videos .card { margin: 0; }

.note {
  padding: 12px 16px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line);
}

.kv { list-style: none; padding: 0; margin: 10px 0 0; }
.kv > li {
  padding: 7px 0; border-top: 1px solid var(--line);
  display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline;
}
.kv > li:first-child { border-top: 0; }

/* ------------------------------------------------------------------ 徽标 */

.tag, .pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 550; line-height: 1.7;
  padding: 0 9px; border-radius: 999px; white-space: nowrap;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line);
}
.tag.good, .pill.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.tag.bad, .pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.tag.warn, .pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.live { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill.live::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* ------------------------------------------------------------------ 阶段进度 */

.steps { display: flex; gap: 0; margin: 4px 0 0; flex-wrap: wrap; }
.step {
  flex: 1 1 0; min-width: 84px; position: relative;
  padding: 10px 8px 8px; text-align: center;
  border-top: 3px solid var(--line); color: var(--muted); font-size: 13px;
}
.step b { display: block; font-size: 13px; font-weight: 600; color: inherit; }
.step small { display: block; font-size: 11px; opacity: .85; }
.step.done { border-top-color: var(--good); color: var(--good); }
.step.live { border-top-color: var(--accent); color: var(--accent); }
.step.live b::after { content: " ●"; animation: pulse 1.4s ease-in-out infinite; }
.step.blocked { border-top-color: var(--warn); color: var(--warn); }

/* ------------------------------------------------------------------ 按钮 */

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  padding: 9px 16px; border-radius: 9px; text-decoration: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 550;
  transition: transform .06s, box-shadow .12s, background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--accent); border-color: transparent; color: #fff;
  box-shadow: 0 1px 2px rgba(79, 70, 229, .3), 0 6px 18px -8px rgba(79, 70, 229, .6);
}
.btn.primary:hover { filter: brightness(1.06); background: var(--accent); }
.btn.good { background: var(--good); border-color: transparent; color: #fff; }
.btn.bad { background: var(--bad); border-color: transparent; color: #fff; }
.btn[disabled] { opacity: .45; pointer-events: none; }

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

.field { display: block; margin: 14px 0; font-weight: 600; font-size: 14px; }
textarea, input, select {
  width: 100%; font: inherit; padding: 10px 12px;
  border: 1px solid var(--line-2); border-radius: 9px;
  background: var(--surface); color: var(--text); margin-top: 6px;
  transition: border-color .12s, box-shadow .12s;
}
textarea:focus, input:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
input[type="checkbox"] { width: auto; margin: 0 8px 0 0; accent-color: var(--accent); }
label.check {
  display: flex; align-items: flex-start; gap: 2px; font-weight: 500;
  padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--surface-2); cursor: pointer;
}
.row { display: flex; gap: 10px; align-items: flex-end; }
.row.wrap { flex-wrap: wrap; }
.row .grow { flex: 1; margin: 0; }
.row.wrap input, .row.wrap select { flex: 1 1 150px; width: auto; margin: 0; }

/* ------------------------------------------------------------------ 图与视频 */

.thumbs {
  display: grid; gap: 12px; margin-bottom: 14px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.thumb { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.thumb img, .shots img {
  width: 100%; aspect-ratio: 1; object-fit: contain;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
}
.shots { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
video {
  width: 100%; max-height: 70vh; background: #000;
  border-radius: 10px; aspect-ratio: 9 / 16;
}
.issues { padding-left: 20px; color: var(--bad); font-size: 14px; }

/* ------------------------------------------------------------------ 数字与日志 */

.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { padding: 2px 0; }
.stat .n { font-size: 24px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
.stat .t { font-size: 12.5px; color: var(--muted); }

pre.log {
  background: #0c1020; color: #c9d4e8; border: 1px solid var(--line);
  padding: 14px 16px; border-radius: 10px; margin: 0;
  overflow: auto; font-size: 12.5px; line-height: 1.6; max-height: 24em;
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

/* ------------------------------------------------------------------ 空状态 */

.empty {
  text-align: center; padding: 48px 20px; color: var(--muted);
  border: 1px dashed var(--line-2); border-radius: var(--radius);
}

@media (max-width: 640px) {
  header.top { padding: 10px 14px; gap: 10px; }
  main { padding: 18px 14px 48px; }
  h1 { font-size: 22px; }
  .row { flex-direction: column; align-items: stretch; }
  .step { min-width: 64px; font-size: 12px; }
}

/* ------------------------------------------------------------------ 任务画廊 */
.quota { margin-left: auto; display: inline-flex; gap: 6px; flex-wrap: wrap; }
.shots { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.task { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.task video, .task .ph {
  width: 100%; aspect-ratio: 9 / 16; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line); object-fit: cover;
}
.task .ph {
  display: grid; place-items: center; color: var(--muted); font-size: 13px;
}
.task.running .ph, .task.submitted .ph {
  background: linear-gradient(110deg, var(--surface-2) 30%, var(--accent-soft) 50%, var(--surface-2) 70%);
  background-size: 220% 100%; animation: sweep 1.8s linear infinite;
}
@keyframes sweep { to { background-position: -220% 0; } }
.task.failed .ph { background: var(--bad-soft); color: var(--bad); }
.task figcaption {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px;
}
.task figcaption b { font-weight: 600; font-size: 12.5px; }
