:root {
  --bg: #0c0e12;
  --panel: #161b24;
  --line: #2a3140;
  --text: #e7ebf3;
  --muted: #8b94a7;
  --accent: #3b82f6;
  --ok: #3dcc74;
  --warn: #e2a93b;
  --bad: #ef5d5d;
  --inset: #0e1117;
}
* { box-sizing: border-box; }
html { overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-variant-numeric: tabular-nums;
}
header {
  position: sticky; top: 0; z-index: 20;
  width: 100%;
  border-bottom: 1px solid var(--line);
  background: rgba(18, 22, 30, .94);
  backdrop-filter: blur(12px);
}
.shell {
  width: min(1480px, 100%);
  margin-inline: auto;
  padding-inline: clamp(12px, 2.2vw, 28px);
  min-width: 0;
}
header .shell { padding-top: 14px; }
.brand {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-bottom: 10px; min-width: 0; width: 100%;
}
.account {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
  flex-wrap: wrap; min-width: 0;
  padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--inset);
}
.account-user {
  color: var(--muted); font-size: 12px; max-width: 16em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account[data-state="in"] .account-user { color: var(--text); }
.account[data-state="in"] .account-user::before { content: "已登录 · "; color: var(--ok); }
.account[data-state="out"] .account-user::before { content: "未登录 · "; color: var(--warn); }
.account[data-state="off"] .account-user::before { content: ""; }
.auth-modal { width: min(420px, 100%); }
.auth-form { display: grid; gap: 12px; }
.auth-form label { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.auth-form input {
  width: 100%; padding: 9px 11px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--inset); color: var(--text);
}
h1 { font-size: 16px; margin: 0; font-weight: 620; letter-spacing: .01em; min-width: 0; }
h1 .mark { color: var(--text); }
h1 .product { color: var(--muted); font-weight: 500; margin-left: 6px; }
#version {
  color: var(--muted); font-weight: 500; font-size: 11px; letter-spacing: .04em;
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px;
  background: var(--inset);
}
h2 { font-size: 14px; margin: 0 0 12px; font-weight: 620; }
h2 .muted { font-weight: 400; }
button.help-tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin: 0 0 0 6px; padding: 0;
  border-radius: 50%; border: 1px solid var(--line); background: transparent;
  color: var(--muted); font-size: 11px; font-weight: 650; line-height: 1;
  cursor: help; vertical-align: 1px; flex: none;
}
button.help-tip:hover, button.help-tip:focus {
  color: var(--text); border-color: var(--muted); filter: none;
  background: rgba(255, 255, 255, .05); outline: none;
}
.help-tip .help-pop {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.help-float {
  position: fixed; z-index: 80;
  max-width: min(360px, calc(100vw - 24px));
  padding: 10px 12px; background: #1b2230; color: var(--text);
  border: 1px solid #3a4458; border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
  font-size: 12px; font-weight: 400; line-height: 1.55; text-align: left;
}
h3 { font-size: 13px; margin: 0 0 10px; font-weight: 620; }
nav {
  display: flex; align-items: center; gap: 2px;
  width: 100%; max-width: 100%; min-width: 0;
  overflow-x: auto; overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
nav a {
  position: relative; flex: none;
  padding: 8px 12px 12px; color: var(--muted); text-decoration: none;
  font-size: 13px; white-space: nowrap; border-radius: 6px 6px 0 0;
}
nav a:hover { color: var(--text); }
nav a.active { color: var(--text); }
nav a.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 0;
  height: 2px; background: var(--accent); border-radius: 2px 2px 0 0;
}
.nav-gap { width: 1px; height: 14px; margin: 0 8px 10px; background: var(--line); flex: none; }
main.shell { padding-top: 20px; padding-bottom: 72px; }
main > section { background: transparent; border: none; padding: 0; margin: 0; }
section { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 14px; max-width: 100%; min-width: 0; overflow-x: auto; }
.muted { color: var(--muted); }
.mono, code, textarea.raw { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
code { background: var(--inset); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
pre { background: var(--inset); padding: 12px; border-radius: 8px; overflow: auto; font-size: 12px; border: 1px solid var(--line); }
#api-timing { margin-top: 12px; }
#api-timing-log div { padding: 2px 0; font-size: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.templates { white-space: nowrap; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 12px; white-space: nowrap; }
tbody tr:hover td { background: rgba(255, 255, 255, .025); }
tr.sel td { background: #1c2740; }
td.path { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
input, select, textarea, button {
  font: inherit; color: var(--text); background: var(--inset);
  border: 1px solid #343c4e; border-radius: 7px; padding: 7px 10px;
  max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(59, 130, 246, .45); outline-offset: 1px; border-color: var(--accent); }
button {
  background: var(--accent); border-color: transparent; color: #fff; cursor: pointer;
  padding: 7px 14px; font-weight: 560;
}
button:hover { filter: brightness(1.08); }
/* A disabled button has to *look* disabled: without this the accent background
   from the rule above wins and "上传视频并转码" (disabled until a template is
   picked) looks clickable. */
button:disabled, button:disabled:hover {
  opacity: .45; filter: grayscale(.4); cursor: not-allowed;
}
button.ghost { background: transparent; color: var(--text); border-color: var(--line); }
button.ghost:hover { background: rgba(255, 255, 255, .04); filter: none; }
button.danger { background: transparent; color: var(--bad); border-color: #5a3030; }
button.danger:hover { background: rgba(239, 93, 93, .08); filter: none; }
button.mini { padding: 3px 8px; font-size: 12px; font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; gap: 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0; max-width: 100%; }
.row > input:not([type="checkbox"]):not([type="radio"]) { flex: 1 1 12em; min-width: 0; width: min(100%, 28em); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px 14px; }
.grid .span-2 { grid-column: 1 / -1; }
[hidden] { display: none !important; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
label.inline { flex-direction: row; align-items: center; gap: 6px; color: var(--text); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 10px; margin-bottom: 14px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; min-height: 78px;
}
.card b { display: block; font-size: 26px; font-weight: 620; letter-spacing: -.03em; line-height: 1.15; }
.card span { color: var(--muted); font-size: 12px; }
.dash { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.dash > section { margin-bottom: 0; }
.dash-wide { grid-column: 1 / -1; }
.dash h2 { display: flex; align-items: baseline; gap: 8px; }
.gauge-row { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; }
.gauge { position: relative; width: 112px; height: 112px; flex: none; }
.gauge svg { width: 100%; height: 100%; display: block; }
.gauge-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; pointer-events: none;
}
.gauge-center b { font-size: 22px; line-height: 1.05; font-weight: 620; }
.gauge-center span { color: var(--muted); font-size: 11px; max-width: 72px; }
.gauge-side { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.stat-line { display: flex; align-items: baseline; gap: 12px; font-size: 13px; }
.stat-line span { min-width: 4.5em; }
.stat-line b { font-size: 18px; font-weight: 620; }
.core-row { display: flex; align-items: flex-end; gap: 3px; height: 32px; }
.core-row i { display: block; width: 7px; min-height: 2px; border-radius: 2px 2px 0 0; background: var(--accent); }
.core-row i.warn { background: var(--warn); }
.core-row i.hot { background: var(--bad); }
.spark { width: 100%; height: 32px; display: block; }
.split-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.split-charts.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.media-panel h3 { margin-bottom: 8px; }
.mix { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.mix .legend { list-style: none; margin: 0; padding: 0; flex: 0 1 auto; min-width: 0; }
.mix .legend li { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 0; }
.mix .legend i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.mix-stats { display: flex; flex-direction: row; gap: 18px; min-width: 72px; }
.mix-stats b { display: block; font-size: 18px; line-height: 1.1; }
.mix-stats span { color: var(--muted); font-size: 11px; }
.chart-note { margin: 8px 0 0; font-size: 12px; }
.hour-chart { display: flex; align-items: flex-end; gap: 4px; height: 128px; max-width: 100%; overflow-x: auto; }
.hour-chart .col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; }
.hour-chart .stack { flex: 1; width: 100%; max-width: 22px; display: flex; flex-direction: column; justify-content: flex-end; }
.hour-chart .stack i { display: block; width: 100%; }
.hour-chart .stack i.ok { background: var(--ok); }
.hour-chart .stack i.bad { background: var(--bad); }
.hour-chart .stack i.off { background: #5c6578; }
.hour-chart .tick { margin-top: 4px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.chart-legend { display: flex; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.chart-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.node-bars {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 260px; overflow-y: auto; overscroll-behavior: contain;
  padding-right: 4px;
}
.node-bars::-webkit-scrollbar { width: 8px; }
.node-bars::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
.node-bar { display: grid; grid-template-columns: minmax(72px, 140px) minmax(0, 1fr) 3em auto; gap: 8px; align-items: center; font-size: 12px; }
.node-bar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-bar .meta { color: var(--muted); white-space: nowrap; }
.bar i.warn { background: var(--warn); }
.bar i.hot { background: var(--bad); }
table.kv td:first-child { color: var(--muted); width: 160px; }
.warnbox { border: 1px solid #5b4520; background: #2a2214; color: var(--warn); border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-top: 10px; }
.empty { color: var(--muted); padding: 16px 2px; font-size: 13px; }
.msg {
  position: sticky; top: 86px; z-index: 15;
  border-radius: 8px; padding: 8px 12px; margin: 0 0 12px; font-size: 13px;
}
.msg.ok { background: #14301f; border: 1px solid #245c37; color: #8ee8b0; }
.msg.err { background: #331a1a; border: 1px solid #6b2f2f; color: #ffb0b0; }
.chip {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px;
  border: 1px solid var(--line); line-height: 1.6; white-space: nowrap;
}
.chip.running { color: #9ec1ff; border-color: #2c4d86; background: rgba(59, 130, 246, .14); }
.chip.succeeded, .chip.alive { color: #8ee8b0; border-color: #245c37; background: rgba(61, 204, 116, .12); }
.chip.failed, .chip.dead { color: #ffb0b0; border-color: #6b2f2f; background: rgba(239, 93, 93, .12); }
.chip.queued, .chip.canceled, .chip.unknown { color: var(--muted); background: rgba(255, 255, 255, .03); }
.chip.priority-high { color: #ffd59a; border-color: #6b5424; background: rgba(245, 166, 35, .16); }
.chip.priority-medium { color: #d7deea; border-color: #3a4458; background: rgba(255, 255, 255, .04); }
.chip.priority-low { color: var(--muted); border-color: var(--line); background: transparent; }
.job-state { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.chip.self { color: #d7deea; border-color: #3a4458; background: rgba(255, 255, 255, .05); }
.meter { display: flex; align-items: center; gap: 8px; min-width: 108px; }
.meter .pct { min-width: 2.6em; font-size: 12px; color: var(--muted); }
.bar { height: 6px; background: #0c0e13; border-radius: 99px; overflow: hidden; flex: 1; min-width: 64px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
textarea.raw { width: 100%; background: var(--inset); color: var(--text); padding: 10px; }
ul.files { list-style: none; padding: 0; margin: 6px 0; }
ul.files li { padding: 3px 0; border-bottom: 1px dashed var(--line); }
video { width: 100%; max-width: 640px; background: #000; border-radius: 8px; }
.right { float: right; }
.events { max-height: 240px; overflow: auto; font-size: 12px; }
.events div { padding: 2px 0; border-bottom: 1px dashed var(--line); }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 8px 0 0; }
fieldset[disabled] { opacity: .55; }
legend { color: var(--muted); font-size: 12px; padding: 0 4px; }
details.fold > summary { cursor: pointer; font-size: 14px; font-weight: 620; }
details.fold > summary::marker { color: var(--muted); }
details.fold[open] > summary { margin-bottom: 10px; }
details.help { margin: 0 0 12px; }
details.help > summary { cursor: pointer; color: var(--muted); font-size: 12px; }
details.help > summary:hover { color: var(--text); }
details.help p { margin: 8px 0 0; }
details.stream { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin: 8px 0; background: var(--inset); }
details.stream > summary { cursor: pointer; font-size: 12px; color: var(--text); }
details.stream > summary::marker { color: var(--muted); }
table.fields td:first-child { width: 260px; }
table.fields td { padding: 3px 8px; font-size: 12px; }
.faint { color: var(--muted); }
.settings-group { margin: 4px 0 18px; }
.setting-bool { display: flex; align-items: center; min-height: 32px; }
label > span { display: inline-flex; align-items: center; gap: 0; }
.settings-group h3 { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.settings-group-note { margin: 8px 0 10px; }
.settings-group[data-group="efficiency"] select { min-width: 10em; }
.segmented {
  display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; margin: 0; max-width: 100%;
  background: var(--inset); border: 1px solid var(--line); border-radius: 9px;
}
.segmented label {
  padding: 5px 12px; border-radius: 6px; cursor: pointer; color: var(--muted);
}
.segmented label:has(input:checked) { background: #243044; color: var(--text); }
.segmented input { position: absolute; opacity: 0; width: 0; height: 0; }
.page-note { margin: -4px 0 12px; font-size: 13px; }

/* Jobs: the form, the list and the detail share one column rhythm. */
#tab-jobs { display: flex; flex-direction: column; gap: 14px; overflow: visible; }
#tab-jobs > section, #tab-jobs .job-workspace > section { margin-bottom: 0; }
.job-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 14px;
  margin: 0 0 12px;
}
.job-fields.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.job-fields .span-2 { grid-column: span 2; }
.job-fields label input, .job-fields label select { width: 100%; }
.upload-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 12px;
}
#upload-template { min-width: 0; width: min(100%, 320px); flex: 1 1 180px; }
.upload-bar progress { width: 160px; }
.job-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 2px;
}
.job-actions-main { display: flex; align-items: center; gap: 8px; }
#form-msg { margin: 8px 0 0; min-height: 1.2em; }
.job-workspace {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start;
}
.job-workspace.has-detail { grid-template-columns: minmax(0, 1fr) minmax(320px, 380px); }
.job-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.job-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.job-head h2 { margin: 0; flex: none; }
a.job-api-link {
  background: var(--accent); color: #fff; text-decoration: none;
  border-radius: 7px; padding: 7px 14px; font-weight: 560; white-space: nowrap;
}
a.job-api-link:hover { filter: brightness(1.08); }
.job-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.job-tools select { min-width: 5.5em; }
#job-query { width: 11em; }
.job-table-wrap { overflow-x: auto; max-width: 100%; }
table.jobs { table-layout: fixed; min-width: 720px; width: 100%; }
table.jobs .c-pick { width: 2.5em; }
table.jobs .th-pick,
table.templates .th-pick,
#tab-templates .th-pick {
  text-align: center;
  color: var(--muted);
  font-weight: 500;
  width: 2.2em;
}
#tab-templates .th-pick input { vertical-align: middle; }
table.jobs .job-pick { text-align: center; vertical-align: middle; }
table.jobs .job-pick input { margin: 0; cursor: pointer; }
.jobs-compare-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  margin: 0 0 10px; padding: 8px 10px;
  border: 1px solid var(--line, #2a3140); border-radius: 8px;
  background: color-mix(in srgb, var(--accent, #3b82f6) 8%, transparent);
}
.jobs-compare-bar[hidden] { display: none !important; }
.jobs-compare-bar #jobs-compare-hint { flex: 1 1 auto; min-width: 12em; }
table.jobs .c-state { width: 14%; }
.compare-modal-multi { width: min(1280px, 100%); }
.compare-multi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.compare-multi-pane {
  min-width: 0;
  border: 1px solid var(--line, #2a3140);
  border-radius: 8px;
  padding: 10px;
  background: rgba(0,0,0,0.12);
}
.compare-multi-pane h3 {
  margin: 0 0 8px; font-size: 13px; line-height: 1.35;
  word-break: break-word;
}
.compare-multi-pane .compare-multi-stats {
  margin: 8px 0 0; font-size: 12px; color: var(--muted);
  line-height: 1.45;
}
.compare-multi-pane .compare-multi-stats b { color: var(--text); font-weight: 560; }
table.jobs .c-ratio { width: 11%; }
table.jobs .c-quality { width: 14%; }
table.jobs .c-time { width: 12%; }
table.jobs .c-tpl { width: 18%; }
table.jobs .c-dl { width: 12%; }
table.jobs .c-act { width: 19%; }
table.jobs th, table.jobs td { vertical-align: middle; }
table.jobs tbody td { padding-top: 10px; padding-bottom: 10px; }
.job-q { line-height: 1.25; min-width: 0; }
.job-q .q-main {
  font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.job-q .q-unit { font-size: 11px; font-weight: 500; margin-left: 4px; opacity: .85; }
.job-q .q-sub {
  margin-top: 2px; font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.job-q .q-good, .job-ratio .q-good { color: #8ee8b0; }
.job-q .q-ok, .job-ratio .q-ok { color: #9ec1ff; }
.job-q .q-low, .job-ratio .q-low { color: #ffd59a; }
.job-q .q-bad, .job-ratio .q-bad { color: #ffb0b0; }
.job-state-cell { min-width: 0; }
.job-state {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.job-sub {
  margin-top: 3px; font-size: 12px; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.job-ratio .q-main {
  font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.job-ratio .q-sub {
  margin-top: 2px; font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.job-time {
  font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.job-tpl {
  font-size: 12px; line-height: 1.35; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.job-tpl .tpl-main { font-weight: 560; }
.job-tpl .tpl-sub { color: var(--muted); margin-top: 2px; }
.job-dl {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
}
.job-dl button { padding-left: 8px; padding-right: 8px; }
.job-dl-icon {
  display: inline-block; vertical-align: -1px; flex-shrink: 0;
}
.th-dl {
  white-space: nowrap;
}
.th-dl .job-dl-icon {
  margin-right: 4px; color: var(--accent, #3b82f6);
}
.job-dl-btn {
  display: inline-flex; align-items: center; gap: 4px;
}
.job-dl-btn:not(:disabled) .job-dl-icon {
  color: var(--accent, #3b82f6);
}
.job-dl-btn.job-dl-dest:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent, #3b82f6) 45%, #2a3140);
  color: var(--text);
}
.job-dl-btn:disabled .job-dl-icon {
  opacity: 0.45;
}
table.jobs .actions {
  display: flex; flex-wrap: wrap; gap: 4px;
}
table.jobs .actions button { padding-left: 8px; padding-right: 8px; }
.list-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 12px; min-height: 32px;
}
.pager { display: flex; align-items: center; gap: 4px; }
.pager button.on { background: #243044; border-color: var(--accent); color: var(--text); }
.pager-gap { color: var(--muted); padding: 0 2px; }
#jobs-empty { text-align: center; padding: 28px 8px; }
#detail {
  position: sticky; top: 92px; max-height: calc(100vh - 112px); overflow: auto;
}
.detail-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 12px; position: sticky; top: 0;
  background: var(--panel); padding-bottom: 8px; z-index: 1;
}
.detail-head h2 {
  margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#detail table.kv td:first-child { width: 6.5em; white-space: nowrap; vertical-align: top; }
#detail table.kv td:last-child { overflow-wrap: anywhere; }
#detail .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#detail .card b { font-size: 20px; }
@media (max-width: 1100px) {
  .dash, .split-charts, .split-charts.three { grid-template-columns: 1fr; }
  .node-bar { grid-template-columns: minmax(64px, 1fr) minmax(0, 1.4fr) 3em; }
  .node-bar .meta { grid-column: 1 / -1; }
  .job-fields, .job-fields.cols-3 { grid-template-columns: 1fr 1fr; }
  .job-fields .span-2 { grid-column: span 2; }
  .job-workspace.has-detail { grid-template-columns: minmax(0, 1fr); }
  .job-head { align-items: flex-start; flex-direction: column; }
  .job-tools { justify-content: flex-start; }
  #detail { position: static; max-height: none; }
}
.docs section { scroll-margin-top: 96px; }
.docs h2 { margin-top: 28px; scroll-margin-top: 96px; }
.docs h3 { margin: 16px 0 6px; font-size: 15px; }
.docs p, .docs li { line-height: 1.55; }
.docs .toc { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 4px; }
.docs .toc a { color: var(--accent); text-decoration: none; }
.docs table td:nth-child(2) { white-space: nowrap; }
.docs table code { white-space: nowrap; }
@media (max-width: 760px) {
  header .shell { padding-top: 10px; }
  main.shell { padding-top: 14px; padding-bottom: 48px; }
  nav a { padding: 8px 10px 10px; }
  .nav-gap { margin-inline: 4px; }
  section { padding: 12px; }
  .card b { font-size: 22px; }
  .gauge { width: 96px; height: 96px; }
  table.kv td:first-child, table.fields td:first-child { width: auto; }
  .docs table td:nth-child(2), .docs table code { white-space: normal; }
  #job-query { width: min(100%, 16em); }
  .list-foot { align-items: flex-start; flex-direction: column; }
  .pager { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .job-fields, .job-fields.cols-3, .job-fields .span-2 { grid-template-columns: 1fr; grid-column: auto; }
  .job-actions { align-items: flex-start; flex-direction: column; }
  .node-bar { grid-template-columns: minmax(0, 1fr) auto; }
  .node-bar .bar { grid-column: 1 / -1; }
  #detail .cards, .compare-metrics .cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }
}
@media (max-width: 420px) {
  h1 .product { display: block; margin-left: 0; }
  .cards { grid-template-columns: 1fr 1fr; }
}
@media (pointer: coarse) {
  nav a { padding-top: 10px; padding-bottom: 14px; }
}

/* --------------------------------------------------------- 对比弹窗 */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 16px 24px; background: rgba(5, 7, 11, .68);
  backdrop-filter: blur(3px);
}
.modal-backdrop[hidden] { display: none !important; }
.modal {
  width: min(920px, 100%);
  max-height: calc(100vh - 72px);
  overflow: auto;
  background: var(--panel); border: 1px solid #343c4e; border-radius: 12px;
  padding: 18px 20px; box-shadow: 0 24px 72px rgba(0, 0, 0, .55);
}
.compare-modal { width: min(1120px, 100%); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 14px; position: sticky; top: -18px;
  background: var(--panel); padding: 6px 0 8px; z-index: 1;
}
.modal-head h2 { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compare-preview { margin-bottom: 16px; }
.compare-media-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.compare-media {
  background: var(--inset); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; min-width: 0;
}
.compare-media h3 { margin: 0 0 8px; font-size: 14px; }
.compare-preview-hint { margin: 10px 0 0; font-size: 13px; }
.compare-media-frame {
  display: flex; align-items: center; justify-content: center;
  min-height: 220px; max-height: min(56vh, 560px);
  background: #0b0e14; border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden;
}
.compare-media-frame img,
.compare-media-frame video {
  display: block; max-width: 100%; max-height: min(56vh, 560px);
  width: auto; height: auto; background: #000;
}
.compare-media-frame img.compare-img-zoomable {
  cursor: zoom-in;
}
.compare-media-frame[data-compare-loading="1"] {
  min-height: 180px;
}
.compare-lightbox {
  position: fixed; inset: 0; z-index: 80;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; padding: 48px 24px 24px;
  background: rgba(5, 7, 11, .88);
  backdrop-filter: blur(4px);
}
.compare-lightbox[hidden] { display: none !important; }
.compare-lightbox-close {
  position: absolute; top: 16px; right: 16px;
}
.compare-lightbox img {
  display: block; max-width: min(96vw, 1600px);
  max-height: calc(100vh - 96px);
  width: auto; height: auto;
  object-fit: contain; background: #000;
  border: 1px solid var(--line); border-radius: 8px;
  cursor: zoom-out; box-shadow: 0 24px 72px rgba(0, 0, 0, .55);
}
.compare-lightbox #compare-lightbox-caption {
  margin: 0; max-width: 90vw; text-align: center;
}
.compare-media-fallback {
  margin: 0; padding: 20px 12px; text-align: center; color: var(--muted);
}
.compare-media-meta {
  margin: 8px 0 0; font-size: 12px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.compare-sync {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding: 10px 12px;
  background: var(--inset); border: 1px solid var(--line); border-radius: 10px;
}
.compare-sync #compare-scrub {
  flex: 1 1 12em; min-width: 8em; accent-color: var(--accent, #5b8def);
}
.compare-sync #compare-time { min-width: 7.5em; white-space: nowrap; }
.compare-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px;
}
.compare-file {
  background: var(--inset); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; min-width: 0;
}
.compare-file h3 { margin-top: 0; }
.compare-file table.kv td { padding: 5px 8px; }
.compare-file table.kv td:first-child { width: 5.5em; white-space: nowrap; color: var(--muted); }
.compare-file table.kv td:last-child { overflow-wrap: anywhere; }
.compare-file .path {
  font-size: 12px; word-break: break-all;
}
.compare-metrics .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.compare-metrics .card b { font-size: 20px; }
@media (max-width: 640px) {
  .compare-grid,
  .compare-media-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding-top: 20px; }
}

/* 素材管理：导入方式用标签切换，再看列表 */
.media-source-panel .segmented { margin: 0 0 12px; }
.media-source-pane .row > input { flex: 1 1 18em; }
.media-source-pane .grid { margin-top: 2px; }
.media-source-pane textarea {
  width: 100%;
  min-height: 5.5rem;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
}

.media-list-panel .media-job-form { margin: 0 0 8px; }
.media-advanced {
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--inset, transparent);
}
.media-advanced > summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
.media-advanced > summary::-webkit-details-marker { display: none; }
.media-advanced > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  transition: transform .15s ease;
}
.media-advanced[open] > summary::before { transform: rotate(90deg); }
.media-advanced-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 11.5em), 1fr));
  gap: 10px 12px;
  margin-top: 10px;
  align-items: end;
}
.media-advanced-fields label select { width: 100%; }
.media-advanced-hint { margin: 8px 0 2px; }
.media-table .th-sort {
  background: none; border: 0; padding: 0; margin: 0;
  color: inherit; font: inherit; cursor: pointer;
}
.media-table .th-sort:hover { color: var(--accent, #3b82f6); }
.media-job-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 11.5em), 1fr));
  gap: 10px 12px;
  align-items: end;
}
.media-job-fields .media-query-field { grid-column: span 2; min-width: 0; }
.media-job-fields .media-query-field input { width: 100%; }
.media-job-fields label select,
.media-job-fields label input { width: 100%; }
.media-job-actions {
  display: flex; align-items: end; min-height: 100%;
}
.media-job-actions button { width: 100%; white-space: nowrap; }
.media-table-wrap {
  margin-top: 4px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--inset);
}
.media-table { margin: 0; border: 0; width: 100%; border-collapse: collapse; }
.media-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.media-table th, .media-table td {
  padding: 8px 10px; vertical-align: middle; border-bottom: 1px solid var(--line);
}
.media-table tbody tr:last-child td { border-bottom: 0; }
.media-table tbody tr:hover td { background: rgba(255, 255, 255, .03); }
.media-table .col-check { width: 2.4em; text-align: center; }
.media-table .col-kind { width: 5.5em; white-space: nowrap; }
.media-table .col-size { width: 5.5em; white-space: nowrap; text-align: right; }
.media-table .col-time { width: 10em; white-space: nowrap; }
.media-table .col-actions { width: 4.5em; white-space: nowrap; text-align: right; }
.media-table .col-file { min-width: 12em; max-width: 28em; }
.media-table .col-file .mono,
.media-table td.col-file {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 720px) {
  .media-job-fields .media-query-field { grid-column: span 1; }
}
.media-browse-modal { width: min(560px, 100%); }
.media-preview-modal { width: min(960px, 100%); }
.media-preview-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 200px; max-height: min(70vh, 720px);
  background: #0b0e14; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; margin-bottom: 10px;
}
.media-preview-body img,
.media-preview-body video {
  display: block; max-width: 100%; max-height: min(70vh, 720px);
  width: auto; height: auto; background: #000;
}
.media-preview-body audio {
  width: min(100%, 480px); margin: 24px;
}
.media-preview-body .media-preview-fallback {
  margin: 0; padding: 24px; text-align: center; color: var(--muted);
}
#media-preview-meta {
  margin: 0; font-size: 12px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.media-browse-bar { margin: 0 0 10px; align-items: stretch; }
.media-browse-path {
  flex: 1 1 12em; min-width: 0; display: block;
  padding: 7px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--inset); border: 1px solid var(--line); border-radius: 7px;
  font-size: 12px;
}
.media-browse-list {
  max-height: min(360px, 50vh); overflow: auto;
  border: 1px solid var(--line); border-radius: 8px; background: var(--inset);
}
.media-browse-list button {
  display: block; width: 100%; text-align: left;
  background: transparent; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; color: var(--text); padding: 8px 12px; font-weight: 500;
}
.media-browse-list button:last-child { border-bottom: 0; }
.media-browse-list button:hover { background: rgba(255, 255, 255, .04); filter: none; }
.media-browse-list .empty-row {
  padding: 16px 12px; color: var(--muted); font-size: 13px;
}
.media-browse-actions { margin-top: 12px; margin-bottom: 0; }

/* 资源池管理：筛选（顶）→ 统计 → 节点列表 */
#tab-pool > .pool-toolbar {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
#tab-pool > #pool-stats { margin-bottom: 12px; }
#tab-pool > #pool-stats > .cards { margin: 0; }
#tab-pool .pool-stats-scope { margin: 0 0 8px; }
#tab-pool > .warnbox { margin-bottom: 12px; }
.pool-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 4px;
}
.pool-head h2 { margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.pool-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pool-toolbar label { min-width: 9em; }
.pool-assign-cell {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  max-width: 22em;
}
.pool-assign-cell select.pool-target {
  min-width: 6.5em; max-width: 9em; padding: 3px 8px; font-size: 12px;
}
.pool-assign-cell input.pool-custom {
  width: 6.5em; flex: 0 1 auto; padding: 3px 8px; font-size: 12px;
}
.pool-addr { min-width: 10em; }
.pool-addr .mono { font-size: 12px; line-height: 1.35; }
.pool-addr .muted { margin-top: 2px; }
.peer-add-modal { width: min(560px, 100%); }
.peer-add-modal #peer-form { margin-top: 4px; }
.peer-add-modal textarea {
  width: 100%; min-height: 7.5em; resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.45;
}
.pool-add-actions { margin: 0; }
.core-picker { display: flex; flex-direction: column; gap: 4px; min-width: 9em; max-width: 22em; }
.core-chips { display: flex; flex-wrap: wrap; gap: 3px; }
.core-chip {
  appearance: none; margin: 0; padding: 0;
  width: 1.55em; height: 1.55em; border-radius: 3px;
  border: 1px solid var(--line); background: transparent;
  color: var(--muted); font-size: 11px; line-height: 1; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.core-chip:hover { border-color: var(--accent); color: var(--text); }
.core-chip.on {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  border-color: var(--accent); color: var(--text); font-weight: 620;
}
.core-chip.on.warn {
  background: color-mix(in srgb, var(--warn) 32%, transparent);
  border-color: var(--warn);
}
.core-chip.on.hot {
  background: color-mix(in srgb, var(--bad) 32%, transparent);
  border-color: var(--bad);
}
.core-picker-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 11px;
}
@media (max-width: 900px) {
  .pool-assign-cell { max-width: none; }
  .core-picker { max-width: none; }
}
