:root {
  --bg: #f5f5f7; --card: #fff; --fg: #1d1d1f; --muted: #6e6e73; --line: #e3e3e8;
  --brand: #fe2c55; --brand-weak: #ffe8ed; --ok: #1a9b5b; --warn: #c27c0e; --err: #d93025;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111113; --card: #1c1c1f; --fg: #f2f2f4; --muted: #9a9aa2; --line: #2e2e33; --brand-weak: #3a1820; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; font-size: 17px; } .brand small { color: var(--brand); font-weight: 600; margin-left: 4px; }
.bar { display: flex; gap: 8px; align-items: center; padding: 10px 16px; flex-wrap: wrap; }
.bar select { flex: 1; min-width: 120px; }
.tabs { display: flex; gap: 4px; padding: 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 12px; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; color: var(--muted); }
.tabs button.on { color: var(--fg); border-color: var(--brand); font-weight: 600; }
.tabs b { font-weight: 500; font-size: 12px; background: var(--line); border-radius: 10px; padding: 0 6px; }
main { padding: 12px 16px 40px; max-width: 900px; margin: 0 auto; }
.tab { display: none; } .tab.on { display: block; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.card h3 { margin: 0 0 10px; font-size: 15px; }
label { display: block; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
label small { font-size: 12px; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.bar select, .row input { margin-top: 0; }
textarea { resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
button { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.danger { color: var(--err); }
button.ghost { background: none; }
button:disabled { opacity: .45; cursor: default; }
.row { display: flex; align-items: center; } .between { justify-content: space-between; } .wrap { flex-wrap: wrap; } .gap { gap: 8px; } .grow { flex: 1; }
.row.gap + .card, .row.gap { margin-bottom: 10px; }
.chip { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--line); color: var(--muted); white-space: nowrap; }
.chip.ok { background: #e3f5ea; color: var(--ok); } .chip.warn { background: #fff3dc; color: var(--warn); } .chip.err { background: #fde7e6; color: var(--err); } .chip.run { background: var(--brand-weak); color: var(--brand); }
@media (prefers-color-scheme: dark) { .chip.ok { background: #143323; } .chip.warn { background: #3a2c10; } .chip.err { background: #3d1614; } }
.muted { color: var(--muted); } .small { font-size: 13px; } .hint { font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.err { color: var(--err); margin: 8px 0; font-size: 14px; }
.hidden { display: none !important; }
#jobCard .row.wrap { margin-top: 12px; }
.logs { margin: 0; padding-left: 0; list-style: none; max-height: 320px; overflow: auto; font-size: 13px; }
.logs li { padding: 3px 0; border-bottom: 1px dashed var(--line); word-break: break-all; }
.logs time { color: var(--muted); margin-right: 6px; font-variant-numeric: tabular-nums; }
.logs .warn { color: var(--warn); } .logs .error { color: var(--err); }
.item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 8px; }
.item .head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.item .name { font-weight: 600; word-break: break-all; }
.item .name a { color: inherit; text-decoration: none; }
.item .quote { margin: 6px 0; padding: 6px 10px; background: var(--bg); border-radius: 8px; word-break: break-all; }
.item mark { background: var(--brand-weak); color: var(--brand); border-radius: 3px; padding: 0 2px; }
.item .meta { font-size: 12px; color: var(--muted); word-break: break-all; }
.item .meta a { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.jobbar { margin: 0 16px 10px; padding: 10px 14px; }
.small-btn { padding: 4px 12px; font-size: 13px; }
.seg { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 10px; }
.seg button { padding: 5px 12px; border-radius: 16px; font-size: 13px; white-space: nowrap; }
.seg button.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.seg b { font-weight: 500; opacity: .7; margin-left: 2px; }
.check { display: flex; align-items: center; gap: 6px; color: var(--fg); font-size: 14px; margin: 0; }
.check input { width: auto; margin: 0; }
.btn { display: inline-block; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: inherit; text-decoration: none; font-size: 15px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.actions button { padding: 4px 10px; font-size: 13px; }
.actions button.on { border-color: var(--brand); color: var(--brand); }
.reason { font-size: 13px; color: var(--muted); margin-top: 4px; }
.funnel-row { display: grid; grid-template-columns: 72px 1fr 64px; gap: 8px; align-items: center; margin: 8px 0; font-size: 14px; }
.funnel-bar { height: 22px; background: var(--brand); border-radius: 4px; min-width: 2px; }
.funnel-row .rate { color: var(--muted); font-size: 12px; text-align: right; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th, table.t td { text-align: right; padding: 5px 4px; border-bottom: 1px solid var(--line); }
table.t th:first-child, table.t td:first-child { text-align: left; }
.diag { white-space: pre-wrap; word-break: break-all; font-size: 12px; max-height: 400px; overflow: auto; background: var(--bg); padding: 10px; border-radius: 8px; }
.item .text { margin-top: 6px; font-size: 14px; word-break: break-all; }
#leadFilter { flex: 1 1 100%; }
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-in { width: 100%; max-width: 360px; }
.login-in input { margin: 0 0 10px; padding: 11px 12px; }
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand .logo { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 16px; background: var(--brand); color: #fff; font-size: 32px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.login-brand h1 { margin: 0; font-size: 22px; }
.login-brand p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.wide { display: block; width: 100%; margin-bottom: 10px; padding: 11px; }
.center { text-align: center; } .block { display: block; margin-bottom: 8px; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 12px; overflow: auto; }
.modal-in { background: var(--card); border-radius: 12px; padding: 14px; width: 100%; max-width: 900px; }
.screen-wrap { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #000; }
.screen-wrap img { display: block; width: 100%; height: auto; cursor: crosshair; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.top .row.gap { gap: 6px; }
a.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
