/* SVBP — 短视频批量生产系统 · 浅色工具风 */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #e4e7eb;
  --border-strong: #d2d7de;
  --text: #1f2329;
  --muted: #6b7280;
  --faint: #9aa1ab;
  --accent: #2563eb;
  --accent-soft: #eaf1ff;
  --accent2: #0ea5a4;
  --ok: #16a34a;
  --ok-soft: #e9f7ee;
  --info: #2563eb;
  --info-soft: #eaf1ff;
  --warn: #d97706;
  --warn-soft: #fdf3e3;
  --err: #dc2626;
  --err-soft: #fdeaea;
  --gold: #b45309;
  --gold-soft: #fbf1dd;
  --mut: #6b7280;
  --mut-soft: #eef0f3;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --f-body: -apple-system, "Segoe UI", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex: none; background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side-logo { padding: 18px 18px 14px; border-bottom: 1px solid var(--border); }
.side-logo .lg1 { font-weight: 700; font-size: 15px; letter-spacing: .3px; }
.side-logo .lg2 { font-size: 11px; color: var(--faint); margin-top: 2px; }
.nav-sec { font-size: 11px; color: var(--faint); padding: 14px 18px 6px; letter-spacing: .5px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 18px;
  color: var(--muted); cursor: pointer; font-size: 13.5px; border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.on { background: var(--accent-soft); color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.nav-item .ic { width: 18px; text-align: center; opacity: .8; }
.nav-item .badge { margin-left: auto; }
.side-foot { margin-top: auto; padding: 12px 18px; border-top: 1px solid var(--border); font-size: 11px; color: var(--faint); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 22px; position: sticky; top: 0; z-index: 20;
}
.topbar .title { font-size: 16px; font-weight: 700; }
.topbar .search {
  margin-left: 8px; flex: 1; max-width: 360px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 12px; color: var(--muted); font-size: 13px;
}
.topbar .spacer { margin-left: auto; }
.content { padding: 22px; }
.section { display: none; }
.section.on { display: block; }
.page-sub { color: var(--muted); max-width: 820px; margin: -6px 0 18px; font-size: 13px; }

/* ---------- 卡片 / KPI ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px;
}
.card + .card { margin-top: 14px; }
.card-h { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-h .t { font-weight: 600; font-size: 14px; }
.card-h .sub { color: var(--faint); font-size: 12px; margin-left: 6px; }
.card-h .act { margin-left: auto; }
.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.row { display: flex; gap: 14px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.mt6 { margin-top: 6px; } .mt10 { margin-top: 10px; } .mt12 { margin-top: 12px; }

.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 16px; box-shadow: var(--shadow); }
.kpi .l { color: var(--muted); font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
.kpi .l span { color: var(--faint); font-size: 11px; }
.kpi .n { font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: -.5px; }
.kpi .n small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.kpi .d { font-size: 11.5px; margin-top: 4px; color: var(--muted); }
.kpi .d.up { color: var(--ok); } .kpi .d.flat { color: var(--faint); } .kpi .d.down { color: var(--err); }

/* ---------- 徽章 / 按钮 / 芯片 ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.7; white-space: nowrap; }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-info { background: var(--info-soft); color: var(--info); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-err { background: var(--err-soft); color: var(--err); }
.b-gold { background: var(--gold-soft); color: var(--gold); }
.b-mut { background: var(--mut-soft); color: var(--mut); }
.b-dark { background: #eef0f3; color: #525a64; }
.b-line { border: 1px solid var(--border-strong); color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 13px; border-radius: 8px; font-size: 13px; cursor: pointer; border: 1px solid transparent;
  background: var(--mut-soft); color: var(--text); user-select: none; white-space: nowrap;
}
.btn:hover { filter: brightness(.98); }
.btn.bs { padding: 5px 10px; font-size: 12px; }
.btn.bp { background: var(--accent); color: #fff; }
.btn.bp:hover { background: #1d4fd8; }
.btn.bg2 { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.btn.bg2:hover { background: #f0f1f3; }
.btn.bd { background: #fff; border-color: var(--err); color: var(--err); }
.btn.grow { flex: 1; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; font-size: 12px; background: var(--info-soft); color: var(--info); }
.chip.c-mut { background: var(--mut-soft); color: var(--mut); }
.chip.c-gold { background: var(--gold-soft); color: var(--gold); }
.chip .x { cursor: pointer; opacity: .6; font-style: normal; }
.chip .x:hover { opacity: 1; }

/* ---------- 进度 / 环 ---------- */
.prog { height: 8px; background: #eef0f3; border-radius: 999px; overflow: hidden; flex: 1; }
.prog > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.prog.ok > i { background: var(--ok); }
.prog.err > i { background: var(--err); }

/* ---------- 表格 ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 9px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
table.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--border); }
table.tbl tr:hover td { background: var(--surface-2); }
.mono { font-family: var(--mono); font-size: 12px; }
.mono.b { font-weight: 600; }

/* ---------- 镜头网格 ---------- */
.shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.shot { border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: var(--surface); cursor: pointer; transition: border-color .12s; }
.shot:hover { border-color: var(--accent); }
.shot .thumb { aspect-ratio: 9/16; display: flex; align-items: flex-end; justify-content: space-between; padding: 7px; color: #fff; font-size: 11px; }
.shot .thumb .corner { position: absolute; }
.shot .meta { padding: 7px 9px; }
.shot .meta .id { font-family: var(--mono); font-size: 11px; font-weight: 600; }
.shot .meta .asr { font-size: 11px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > label { font-size: 12px; color: var(--muted); }
.field .req { color: var(--err); }
.inp, .sel { border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 10px; font-size: 13px; background: #fff; color: var(--text); width: 100%; }
.inp:focus, .sel:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.inp.ro { background: var(--surface-2); color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.seg > span { padding: 6px 11px; font-size: 12px; cursor: pointer; color: var(--muted); }
.seg > span.on { background: var(--accent); color: #fff; }

/* ---------- 槽位 / 三栏 ---------- */
.slot { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 7px; background: #fff; }
.slot.on { border-color: var(--accent); background: var(--accent-soft); }
.slot .sid { font-family: var(--mono); font-size: 12px; font-weight: 600; }
.slot .sdu { margin-left: auto; color: var(--faint); font-size: 11px; }
.editor-cols { display: grid; grid-template-columns: 220px 1fr 250px; gap: 14px; align-items: start; }
.mbar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; font-size: 10px; color: #fff; }
.mbar > i { display: flex; align-items: center; justify-content: center; overflow: hidden; }

/* ---------- 手机预览 ---------- */
.phone { width: 150px; aspect-ratio: 9/16; background: #11151f; border-radius: 16px; margin: 0 auto; position: relative; display: flex; align-items: center; justify-content: center; }
.phone .cap { position: absolute; top: 6px; left: 0; right: 0; text-align: center; font-size: 9px; color: #7a8290; }
.phone .sub { color: #fff; font-size: 13px; text-align: center; padding: 0 10px; }
.phone .sub .hl { color: #ffd23f; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(20,24,32,.42); display: none; align-items: center; justify-content: center; z-index: 60; }
.modal-mask.on { display: flex; }
.modal { background: #fff; border-radius: 12px; width: 480px; max-width: 92vw; padding: 20px; box-shadow: 0 12px 40px rgba(0,0,0,.2); }
.modal h3 { margin: 0 0 14px; font-size: 16px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- 告警 / 队列项 ---------- */
.qcli { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 12.5px; }
.qcli:last-child { border-bottom: none; }
.qcli .qv { margin-left: auto; text-align: right; }
.kvlist .qcli .qv { font-family: var(--mono); }

/* ---------- 治理管线 ---------- */
.pipe { display: flex; flex-direction: column; gap: 8px; }
.pst { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; }
.pst .pd { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.pst.run .pd { background: var(--accent); } .pst.wait .pd { background: var(--faint); } .pst.done .pd { background: var(--ok); }
.pst .pn { font-weight: 600; } .pst .pi { margin-left: auto; color: var(--muted); font-size: 11.5px; }

/* ---------- 柱状 / 趋势 ---------- */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 130px; padding: 6px 2px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 4px; }
.bar .stk { width: 60%; display: flex; flex-direction: column-reverse; border-radius: 4px 4px 0 0; overflow: hidden; }
.bar .stk > i { display: block; }
.bar .bl { font-size: 10px; color: var(--faint); }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 10px; background: var(--surface-2); }
.empty .hint { font-size: 12px; color: var(--faint); margin-top: 6px; }

.hbar { display: flex; align-items: center; gap: 10px; font-size: 12.5px; margin-bottom: 8px; }
.hbar .hl1 { width: 120px; color: var(--muted); } .hbar .hl2 { flex: 1; height: 9px; background: #eef0f3; border-radius: 999px; overflow: hidden; }
.hbar .hl2 > i { display: block; height: 100%; } .hbar .hl3 { width: 42px; text-align: right; font-family: var(--mono); }

.tip { font-size: 11.5px; color: var(--faint); margin-top: 8px; }
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: sp .7s linear infinite; vertical-align: -2px; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (max-width: 1080px) { .g4 { grid-template-columns: repeat(2,1fr); } .editor-cols { grid-template-columns: 1fr; } }

/* 上传文件清单 */
.filelist { margin-top: 12px; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.fl-empty { font-size: 12px; color: var(--faint); }
.fi { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 12px; }
.fi .fn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi .sz { color: var(--muted); flex: none; }
.fi .x { cursor: pointer; color: var(--err); font-weight: 700; flex: none; }
.fi .x:hover { opacity: .7; }
.upload.drag { border-color: var(--accent) !important; background: var(--accent-soft); }
.btn.loading { opacity: .7; pointer-events: none; }
.btn.loading::after { content: " ·"; animation: dots 1s steps(4,end) infinite; }
@keyframes dots { 0%{content:"";} 25%{content:"·";} 50%{content:"··";} 75%{content:"···";} 100%{content:"";} }
