:root {
  --bg: #f3f5f8;
  --panel: #fff;
  --line: #e3e7ee;
  --text: #1b2333;
  --muted: #6b7486;
  --navy: #0f1e36;
  --accent: #1f6fd1;
  --accent-soft: #e8f1fd;
  --ok: #1f9d68;
  --run: #2f7cf6;
  --fail: #e0484e;
  --pause: #e9a21b;
  --pending: #d4d9e1;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", sans-serif;
  color: var(--text);
  font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }

/* ---------- 顶栏 ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 28px; padding: 0 24px; height: 56px; background: var(--navy); color: #fff; }
.brand { display: flex; align-items: baseline; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: .3px; }
.brand small { font-weight: 400; font-size: 12px; color: #9fb0c8; letter-spacing: 1px; }
.nav { display: flex; gap: 4px; }
.nav a { color: #c5d2e4; padding: 7px 14px; border-radius: 7px; }
.nav a.on, .nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.top .health { margin-left: auto; font-size: 12.5px; color: #c5d2e4; display: flex; align-items: center; gap: 7px; cursor: pointer; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pending); display: inline-block; flex: none; }
.dot.ok { background: #3ad38f; } .dot.bad { background: var(--fail); } .dot.warn { background: var(--pause); }

main { max-width: 1320px; margin: 0 auto; padding: 24px; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 960px) { .grid2 { grid-template-columns: 1fr; } }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 16px; }
.grid2 > .panel { margin-top: 0; }

/* ---------- 按钮/表单 ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; padding: 7px 14px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #c6cdd8; background: #fafbfc; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #1a60b8; }
.btn.danger { color: var(--fail); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input[type=text], input[type=number], input[type=password], input[type=email], input:not([type]), select, textarea {
  border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; background: #fff; width: 100%; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; line-height: 1.55; }
label.f { display: block; }
input[type=range] { width: 100%; accent-color: var(--accent); }
label.f > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 12px; background: #eef1f5; color: #4a5468; white-space: nowrap; }
.chip.ok { background: #e5f6ee; color: #137a4f; } .chip.run { background: #e7f0ff; color: #1d5fd0; }
.chip.fail { background: #fdecec; color: #b42d33; } .chip.pause { background: #fdf3df; color: #9a6400; }
.chip.lock { background: #2b2f3a; color: #fff; }

/* ---------- 阶段条 ---------- */
.stagebar { display: flex; gap: 3px; }
.stagebar i { flex: 1; height: 6px; border-radius: 3px; background: var(--pending); position: relative; overflow: hidden; }
.stagebar i.done { background: var(--ok); } .stagebar i.failed { background: var(--fail); } .stagebar i.paused { background: var(--pause); }
.stagebar i.running { background: #c9dcfd; }
.stagebar i.running::after { content: ""; position: absolute; inset: 0; width: var(--p, 30%); background: var(--run); transition: width .4s; }

/* ---------- 看板 ---------- */
.batch { margin-bottom: 28px; }
.batch-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); cursor: pointer; transition: transform .12s, box-shadow .12s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(16,24,40,.09); }
.card .thumb { aspect-ratio: 6 / 7; background: linear-gradient(160deg, #20406b, #0e1d33); position: relative; display: flex; align-items: flex-end; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.card .thumb .ph { color: rgba(255,255,255,.75); font-family: "Futura", "Avenir Next Condensed", sans-serif; font-weight: 800; font-size: 26px; letter-spacing: 2px; padding: 16px; position: relative; }
.card .thumb .st { position: absolute; top: 10px; left: 10px; }
.card .body { padding: 12px 14px 14px; }
.card .title { font-weight: 650; font-size: 15px; display: flex; gap: 6px; align-items: center; }
.card .sub { font-size: 12px; color: var(--muted); margin: 3px 0 10px; min-height: 16px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty .big { font-size: 40px; margin-bottom: 8px; }

/* ---------- 新建批次 ---------- */
.drop { border: 2px dashed #c8d0dc; border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); background: #fbfcfd; cursor: pointer; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.shots-mini { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.shots-mini img { height: 90px; border-radius: 6px; border: 1px solid var(--line); }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 6px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 6px; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
table.t td input, table.t td select { padding: 5px 7px; font-size: 13px; }
.tablewrap { overflow-x: auto; }

/* ---------- 任务页 ---------- */
.jobhead { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 18px; }
.jobhead .cov { width: 96px; flex: none; border-radius: 8px; overflow: hidden; background: #20406b; aspect-ratio: 6/7; }
.jobhead .cov img { width: 100%; height: 100%; object-fit: cover; }
.steps { display: grid; grid-template-columns: repeat(11, 1fr); gap: 6px; margin-bottom: 18px; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; cursor: pointer; position: relative; min-width: 0; }
.step:hover { border-color: #c6cdd8; }
.step .n { font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.step .s { font-size: 11.5px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step.done { border-color: #bfe6d3; } .step.done .dot { background: var(--ok); }
.step.running { border-color: #b7cffb; background: #f7faff; } .step.running .dot { background: var(--run); animation: pulse 1s infinite; }
.step.failed { border-color: #f4c2c4; background: #fff8f8; } .step.failed .dot { background: var(--fail); }
.step.paused { border-color: #f3dca9; background: #fffbf2; } .step.paused .dot { background: var(--pause); }
.step .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--run); border-radius: 0 0 0 8px; }
@keyframes pulse { 50% { opacity: .35; } }
@media (max-width: 1100px) { .steps { grid-template-columns: repeat(5, 1fr); } }

.alert { border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px; }
.alert.fail { background: #fdecec; color: #8f2328; border: 1px solid #f6c7c9; }
.alert.pause { background: #fdf5e3; color: #7d5300; border: 1px solid #f2dfb0; }
.alert.info { background: var(--accent-soft); color: #1a4f94; border: 1px solid #cfe0f8; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 9px 16px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tabs a .cnt { font-size: 11px; color: var(--muted); margin-left: 3px; }

/* 选片 */
.cands { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cand { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; position: relative; }
.cand.picked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.cand .im { aspect-ratio: 16/9; background: #dfe4ea; position: relative; }
.cand .im img { width: 100%; height: 100%; object-fit: cover; }
.cand .im .dur { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.75); color: #fff; font-size: 11.5px; padding: 1px 6px; border-radius: 4px; }
.cand .im .score { position: absolute; left: 6px; top: 6px; background: rgba(15,30,54,.85); color: #fff; font-size: 12px; padding: 2px 7px; border-radius: 5px; font-weight: 600; }
.cand .tx { padding: 9px 11px 11px; }
.cand .tx .tt { font-size: 13px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cand .tx .rs { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.45; }

/* 镜头墙 */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.shot { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; position: relative; cursor: pointer; }
.shot .im { aspect-ratio: 16/9; background: #dfe4ea; position: relative; }
.shot .im img { width: 100%; height: 100%; object-fit: cover; }
.shot .im .no { position: absolute; left: 5px; top: 5px; background: rgba(0,0,0,.72); color: #ffd54a; font-weight: 700; font-size: 11.5px; padding: 1px 6px; border-radius: 4px; }
.shot .im .tm { position: absolute; right: 5px; bottom: 5px; background: rgba(0,0,0,.72); color: #fff; font-size: 11px; padding: 1px 5px; border-radius: 4px; }
.shot .tx { padding: 6px 8px 8px; font-size: 11.5px; line-height: 1.45; }
.shot .tx .k { font-weight: 600; font-size: 12px; }
.shot.used { border-color: #8fd1b1; box-shadow: 0 0 0 2px #dff3e9; }
.shot.freeze { border-color: #9cc0f7; box-shadow: 0 0 0 2px #e3edfd; }
.shot.forbidden { border-color: #f0a2a6; }
.shot.forbidden .im::after { content: "禁词"; position: absolute; inset: auto 5px 5px auto; }
.shot.excluded .im img, .shot.banned .im img { opacity: .35; filter: grayscale(1); }
.shot .flag { position: absolute; right: 5px; top: 5px; font-size: 11px; padding: 1px 6px; border-radius: 4px; color: #fff; }
.shot .flag.red { background: var(--fail); } .shot .flag.gray { background: #59606e; } .shot .flag.green { background: var(--ok); } .shot .flag.blue { background: var(--run); }
.ocr { color: #b42d33; }

/* 资料 */
.srcs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 12px; }
.src { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; display: flex; flex-direction: column; gap: 3px; font-size: 13px; min-width: 0; }
.src span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src.ok { border-left: 3px solid var(--ok); } .src.off { border-left: 3px solid #c3cad5; color: var(--muted); }
table.spec td { vertical-align: top; font-size: 13px; }
table.spec tr.conflict td { background: #fff6f6; }
ul.hl { margin: 6px 0 0; padding-left: 18px; columns: 2; font-size: 13px; }
.stills { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 12px; }
.still { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; cursor: pointer; }
.still .im { aspect-ratio: 16/10; background: #1b2533; position: relative; }
.still .im img { width: 100%; height: 100%; object-fit: contain; }
.still .im .no { position: absolute; left: 5px; top: 5px; background: rgba(0,0,0,.72); color: #ffd54a; font-weight: 700; font-size: 11.5px; padding: 1px 6px; border-radius: 4px; }
.still .im .flag { position: absolute; right: 5px; top: 5px; font-size: 11px; padding: 1px 6px; border-radius: 4px; color: #fff; background: var(--ok); }
.still .tx { padding: 6px 8px 8px; font-size: 12px; line-height: 1.45; }
.still .tx .k { font-weight: 600; }
.still.used { border-color: #8fd1b1; box-shadow: 0 0 0 2px #dff3e9; }
.still.off .im img { opacity: .4; }
.ok-t { color: var(--ok); }
.covs { display: flex; flex-wrap: wrap; gap: 6px; }
.lines .ln textarea.rows { grid-column: 2 / 4; min-height: 70px; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }

/* 剪辑 */
.tl { position: relative; height: 54px; background: #eef1f5; border-radius: 8px; overflow: hidden; margin: 6px 0 14px; }
.tl .seg { position: absolute; top: 6px; height: 26px; border-radius: 5px; background: #2d5f9a; color: #fff; font-size: 11px; padding: 4px 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-right: 2px solid #eef1f5; }
.tl .seg.fz { background: #6a7f9e; }
.tl .vo { position: absolute; bottom: 5px; height: 12px; background: #f0a93a; border-radius: 3px; opacity: .9; }
.tl .card { position: absolute; bottom: 5px; height: 12px; background: #23a26d; border-radius: 3px; opacity: .85; cursor: default; box-shadow: none; transform: none !important; }
.lines .ln { display: grid; grid-template-columns: 70px 1fr 1fr 34px; gap: 8px; align-items: start; padding: 8px 0; border-bottom: 1px solid #f0f2f5; }
.lines .ln textarea { min-height: 54px; font-size: 13px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }

/* 成片/封面 */
video { width: 100%; border-radius: 9px; background: #000; }
.checks li { margin: 4px 0; }
.issue { border-left: 3px solid var(--line); padding: 6px 10px; margin: 6px 0; background: #fafbfc; border-radius: 0 6px 6px 0; font-size: 13px; }
.issue.blocker { border-color: var(--fail); } .issue.major { border-color: var(--pause); } .issue.minor { border-color: #b8c0cc; }
.coverwrap { display: grid; grid-template-columns: 380px 1fr; gap: 22px; align-items: start; }
.coverwrap .cv { border-radius: 10px; overflow: hidden; box-shadow: 0 8px 30px rgba(16,24,40,.18); background: #000; }
@media (max-width: 960px) { .coverwrap { grid-template-columns: 1fr; } }
.candrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.candrow img { border-radius: 6px; border: 2px solid transparent; cursor: pointer; aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.candrow img.on { border-color: var(--accent); }
.seg3 { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg3 button { border: 0; background: #fff; padding: 6px 12px; cursor: pointer; border-right: 1px solid var(--line); }
.seg3 button:last-child { border-right: 0; }
.seg3 button.on { background: var(--accent); color: #fff; }

/* 日志 */
.log { background: #0e1726; color: #c8d6ea; border-radius: 9px; padding: 12px 14px; height: 420px; overflow: auto; font-family: ui-monospace, Menlo, monospace; font-size: 12px; line-height: 1.6; white-space: pre-wrap; }
.log .e { color: #ff9a9e; } .log .w { color: #ffd27a; } .log .d { color: #7ee2b0; }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; display: flex; flex-direction: column; gap: 8px; }
.toast div { background: #1b2333; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.2); font-size: 13.5px; max-width: 420px; animation: tin .2s; }
.toast div.err { background: #b42d33; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: rot .7s linear infinite; vertical-align: -2px; }
@keyframes rot { to { transform: rotate(360deg); } }
details summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 13px; }
.kv b { color: var(--muted); font-weight: 500; }

/* 顶栏 */
.nbadge:not(:empty) { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 5px; border-radius: 9px; background: #3b82f6; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.nbadge.warn:not(:empty) { background: #f0a93a; }
.me { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #c5d2e4; white-space: nowrap; }
.me a { color: #9fc0ff; }
.top .health { margin-left: auto; }
/* 登录 / 弹窗 */
#login { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.loginbox { width: 340px; }
.modal { position: fixed; inset: 0; z-index: 70; background: rgba(15,25,40,.55); display: flex; align-items: center; justify-content: center; }
/* 今日 */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 16px 0 10px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; color: var(--text); box-shadow: var(--shadow); }
a.kpi[href]:hover { border-color: #9cc0f7; }
.kpi b { font-size: 30px; font-weight: 700; line-height: 1.1; }
.kpi span { color: var(--muted); font-size: 13px; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
/* 待筛选 */
.toolbar { position: sticky; top: 56px; z-index: 10; display: flex; align-items: center; gap: 10px; background: var(--bg); padding: 10px 0; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.vcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.vcard.sel { border-color: #3b82f6; box-shadow: 0 0 0 2px #dbe8fe; }
.vcard .im { position: relative; aspect-ratio: 16/9; background: #1b2533; cursor: pointer; }
.vcard .im img { width: 100%; height: 100%; object-fit: cover; }
.vcard .im .dur { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.75); color: #fff; font-size: 11.5px; padding: 1px 6px; border-radius: 4px; }
.vcard .im .play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; color: rgba(255,255,255,.0); transition: color .15s; }
.vcard .im:hover .play { color: rgba(255,255,255,.9); background: rgba(0,0,0,.18); }
.vcard .tx { padding: 9px 11px 11px; font-size: 13px; }
.vcard .tags { display: flex; flex-wrap: wrap; gap: 4px; }
.vcard .tt { font-weight: 600; margin-top: 6px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vcard .rs { margin-top: 6px; font-size: 12px; color: #4a5568; background: #f5f7fa; border-radius: 6px; padding: 5px 7px; }
