:root {
  --bg: #f5f6f8; --card: #fff; --text: #1d2129; --muted: #86909c; --line: #e5e6eb;
  --primary: #3b5bdb; --up: #12a150; --down: #e5484d; --warn: #f59f00;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans Thai", sans-serif; background: var(--bg); color: var(--text); }
.topbar { display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: #1d2129; color: #fff; flex-wrap: wrap; position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; font-size: 16px; }
.tabs { display: flex; gap: 4px; }
.tabs button { background: transparent; color: #c9cdd4; border: 0; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.tabs button.active { background: #3b5bdb; color: #fff; }
.controls { margin-left: auto; display: flex; gap: 8px; align-items: center; }
select, input, button { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); }
button { cursor: pointer; background: var(--primary); color: #fff; border-color: var(--primary); }
button.ghost { background: transparent; color: inherit; border-color: #4e5969; }
.status { padding: 6px 20px; font-size: 12px; color: var(--muted); background: #fff; border-bottom: 1px solid var(--line); }
.status .bad { color: var(--down); font-weight: 600; }
main { padding: 16px 20px 40px; max-width: 1500px; margin: 0 auto; }
.tab { display: none; } .tab.active { display: block; }
.range-note { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--card); border-radius: 10px; padding: 12px 14px; border: 1px solid var(--line); }
.kpi .label { color: var(--muted); font-size: 12px; }
.kpi .value { font-size: 22px; font-weight: 700; margin: 2px 0; font-variant-numeric: tabular-nums; }
.delta { font-size: 12px; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--up); } .delta.down { color: var(--down); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; overflow-x: auto; }
.card h3 { margin: 0 0 10px; font-size: 15px; }
.chart { height: 300px; } .chart.tall { height: 380px; }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; position: sticky; top: 0; background: #fff; }
th:first-child, td:first-child, td.l, th.l { text-align: left; }
tr.click { cursor: pointer; } tr.click:hover { background: #f7f8fa; }
.who { display: flex; align-items: center; gap: 8px; }
.who img { width: 26px; height: 26px; border-radius: 50%; }
.who small { color: var(--muted); display: block; font-size: 11px; }
.bars { display: flex; height: 14px; width: 220px; position: relative; background: #f2f3f5; border-radius: 3px; }
.bars .mid { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: #c9cdd4; }
.bars span { position: absolute; top: 0; bottom: 0; }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); margin: 4px 0 8px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.tag { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 12px; background: #f2f3f5; color: #4e5969; }
.tag.bad { background: #ffece8; color: var(--down); } .tag.warn { background: #fff7e8; color: #d25f00; } .tag.good { background: #e8ffea; color: var(--up); }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); border-radius: 16px; padding: 3px 4px 3px 12px; display: flex; align-items: center; gap: 6px; }
.chip button { padding: 0 8px; background: transparent; color: var(--muted); border: 0; }
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.live-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.live-card .nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0; }
.live-card .nums div { font-size: 11px; color: var(--muted); } .live-card .nums b { display: block; font-size: 16px; color: var(--text); }
.live-card .spark { height: 90px; }
.drawer { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 10; display: flex; justify-content: flex-end; }
.drawer[hidden] { display: none; }
.drawer-body { width: min(900px, 100%); background: #fff; height: 100%; overflow: auto; padding: 20px; position: relative; }
.drawer .close { position: absolute; right: 16px; top: 12px; color: var(--text); font-size: 20px; border: 0; }
.diag { border-left: 3px solid var(--warn); background: #fffaf0; padding: 8px 12px; margin: 8px 0; border-radius: 4px; }
.empty { color: var(--muted); padding: 30px; text-align: center; }
#anchor-search { margin-bottom: 8px; width: 260px; }

.tag.group { background: #edf2ff; color: #3b5bdb; margin-left: 4px; }
.seg { margin-left: 12px; display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; vertical-align: middle; }
.seg button { background: #fff; color: var(--muted); border: 0; border-radius: 0; padding: 2px 10px; font-size: 12px; }
.seg button.on { background: var(--primary); color: #fff; }
.monitor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; margin-bottom: 16px; }
@media (max-width: 500px) { .monitor-grid { grid-template-columns: 1fr; } }
.mon-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; }
.mon-card.comp { border-color: #ffc9c9; }
.mon-card .shot { position: relative; background: #111; aspect-ratio: 16/9; }
.mon-card .shot img { width: 100%; height: 100%; object-fit: contain; display: block; }
.mon-card .shot .badge { position: absolute; left: 8px; top: 8px; }
.mon-card .body { padding: 10px 12px; }
.scores { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.score { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: #f2f3f5; }
.score.low { background: #ffece8; color: var(--down); } .score.high { background: #e8ffea; color: var(--up); }
.tx { font-size: 12px; color: #4e5969; background: #f7f8fa; border-radius: 6px; padding: 6px 8px; max-height: 96px; overflow: hidden; }
.tx div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx b { color: var(--muted); font-weight: 500; margin-right: 4px; }
.rhythm { display: flex; height: 22px; border-radius: 4px; overflow: hidden; margin: 6px 0; }
.rhythm span { font-size: 10px; color: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap; }
.list-plain { margin: 4px 0; padding-left: 18px; } .list-plain li { margin: 2px 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.gallery figure { margin: 0; font-size: 11px; color: var(--muted); } .gallery img { width: 100%; border-radius: 6px; display: block; }
.transcript-full { max-height: 320px; overflow: auto; font-size: 13px; }
.transcript-full div { padding: 3px 0; border-bottom: 1px dashed var(--line); }
.transcript-full div.zh, .tx div.zh { border-bottom: 0; padding: 1px 0 0; color: var(--muted, #667); font-size: 12.5px; }
.zh.pending { opacity: .5; }

.me { color: #c9cdd4; font-size: 13px; }
body.role-operator .admin-only { display: none !important; }
body.not-super .super-only { display: none !important; }
@media (max-width: 700px) {
  .topbar { padding: 8px 16px; gap: 8px; }
  .tabs { overflow-x: auto; max-width: 100%; }
  .tabs button { white-space: nowrap; padding: 6px 8px; }
  .controls { margin-left: 0; flex-wrap: wrap; }
  main { padding: 12px 16px 40px; }
}

.pbar { display: inline-block; width: 110px; height: 8px; background: #f2f3f5; border-radius: 4px; position: relative; vertical-align: middle; margin-right: 6px; }
.pbar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.pbar .fill.good { background: var(--up); } .pbar .fill.warn { background: var(--warn); } .pbar .fill.bad { background: var(--down); }
.pbar .tick { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #1d2129; }
.days { display: flex; gap: 2px; flex-wrap: wrap; } .days span { width: 12px; height: 16px; border-radius: 2px; display: inline-block; }

.logic { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 10px; align-items: stretch; margin-bottom: 16px; }
@media (max-width: 900px) { .logic { grid-template-columns: 1fr; } .logic .arrow { display: none; } }
.logic .stage { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.logic .stage h4 { margin: 0 0 6px; font-size: 13px; } .logic .s1 { border-top: 3px solid #4c6ef5; } .logic .s2 { border-top: 3px solid #15aabf; } .logic .s3 { border-top: 3px solid #f59f00; }
.logic .step { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.logic .step .label { color: var(--muted); font-size: 12px; flex: 1; } .logic .step b { font-variant-numeric: tabular-nums; }
.logic .arrow { align-self: center; font-size: 22px; color: var(--muted); }
table.fn th.g1 { color: #4c6ef5; text-align: center; } table.fn th.g2 { color: #15aabf; text-align: center; } table.fn th.g3 { color: #d97706; text-align: center; }
table.fn td.hi { background: #e8ffea; } table.fn td.lo { background: #ffece8; }
.chform { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.chform input { min-width: 160px; } .chform .tiers { display: flex; gap: 8px; font-size: 13px; }
.cfg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-bottom: 8px; }
.cfg { display: flex; flex-direction: column; gap: 3px; font-size: 13px; } .cfg small { color: var(--muted); font-size: 11px; }

.chform input[type=checkbox] { min-width: 0; }
.chform .tiers label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }


table.dense th, table.dense td { padding: 5px 6px; font-size: 12px; }
td.wrap { white-space: normal; min-width: 160px; max-width: 280px; }
.btn-link { margin-left: auto; font-size: 13px; color: var(--primary); text-decoration: none; border: 1px solid var(--primary); border-radius: 6px; padding: 4px 10px; }
.qa { display: grid; gap: 6px; } .qa > div { background: #f7f8fa; border-radius: 6px; padding: 8px 10px; font-size: 13px; }
.qa b { margin-right: 6px; } .qa .next { background: #edf2ff; }
.persona { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; font-size: 13px; }
.stages { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.warn { background: #fff7e8; color: #d25f00; padding: 12px 14px; border-radius: 6px; }
.proc-log { background: #1d2129; color: #e5e6eb; font-size: 12px; max-height: 360px; overflow: auto; padding: 10px; border-radius: 6px; white-space: pre-wrap; margin-top: 10px; }
.month-card h3 input[type=month] { font-size: 13px; margin-left: 8px; }
.pbar { position: relative; }
.pbar i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #1d2129; }
.list-plain.where li { margin: 4px 0; line-height: 1.5; }
.section-title { margin: 22px 0 8px; font-size: 15px; color: var(--muted); }
input.tgt { width: 90px; text-align: right; }
.cell-bad { background: #ffece8; color: var(--down); } .cell-good { background: #e8ffea; color: var(--up); }
tr.total td { font-weight: 600; border-top: 2px solid var(--line); }
.suggest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; margin-top: 12px; }
.suggest { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.suggest ul { margin: 6px 0 0 18px; padding: 0; } .suggest li { margin: 3px 0; } .suggest li.bad { color: var(--down); font-weight: 600; }
.funnel-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 8px; }
.funnel-steps .step { border: 1px solid var(--line); border-radius: 8px; padding: 8px; text-align: center; }
.funnel-steps .step.weak { border-color: var(--down); background: #fff5f3; }
.funnel-steps .label { color: var(--muted); font-size: 12px; } .funnel-steps .value { font-size: 18px; font-weight: 600; }
.fu { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.fu.overdue { border-left: 4px solid var(--down); }
.fu-head small { color: var(--muted); margin-left: 6px; } .fu-act { float: right; }
.fu-body { white-space: pre-wrap; font-family: inherit; margin: 6px 0; font-size: 13px; }
.fu-reply { background: #f2f3f5; border-radius: 6px; padding: 6px 8px; margin-top: 4px; font-size: 13px; }
.bot-steps { line-height: 1.7; } .bot-steps code { background: #f2f3f5; padding: 0 4px; border-radius: 3px; }
@media (max-width: 760px) { .funnel-steps { grid-template-columns: repeat(2, 1fr); } }
.tx-ev { color: var(--muted); padding-left: 18px; } mark { background: #fff3bf; padding: 0 2px; }
.subnav { display: flex; gap: 4px; padding: 6px 16px; background: #f7f8fa; border-bottom: 1px solid var(--line); overflow-x: auto; }
.subnav[hidden] { display: none; }
.subnav button { background: transparent; border: none; padding: 5px 12px; border-radius: 6px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.subnav button.active { background: #fff; color: var(--fg, #1d2129); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
table.war td { vertical-align: top; } table.war .who img { width: 28px; height: 28px; }
tr.alert-row td:first-child { border-left: 3px solid var(--down); }
.acts { margin: 0; padding-left: 18px; font-size: 13px; } .acts li { margin: 2px 0; }
.spark-svg { display: block; }
.war-shot { width: 100%; border-radius: 6px; }
table.fixes b { color: #1d2129; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
.profile h3 .tag.lang { font-weight: 400; }
.profile .tags { margin-bottom: 8px; } .profile .tags .tag { margin: 2px 2px 2px 0; }
.sbar { display: grid; grid-template-columns: 70px 1fr 42px; align-items: center; gap: 6px; font-size: 13px; margin: 3px 0; }
.sbar i { display: block; height: 8px; border-radius: 4px; background: #3b5bdb; min-width: 2px; } .sbar b { text-align: right; font-weight: 500; }
.hours { display: flex; align-items: flex-end; gap: 2px; height: 38px; } .hours i { flex: 1; background: #f59f00; border-radius: 2px 2px 0 0; }
.hours-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.tag.lang { background: #e8f3ff; color: #165dff; }
tr.comp-row td { background: #fff7f5; }
@media (max-width: 760px) { .profile-grid { grid-template-columns: 1fr; } }
.war-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(520px, 1fr)); gap: 10px; }
.wcard { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; }
.wcard.alert { border-left: 4px solid var(--down); } .wcard.comp { background: #fff7f5; }
.wh { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; } .wh b.click { cursor: pointer; font-size: 15px; }
.wnums { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); align-items: center; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.wnums b { color: #1d2129; font-size: 15px; margin-left: 4px; } .wnums small { margin-left: 2px; } .wnums .delta { margin-left: 4px; }
.wbody { display: grid; grid-template-columns: 170px 1fr; gap: 10px; margin-top: 6px; } .wbody:not(:has(.wpic)) { grid-template-columns: 1fr; }
.wpic .scores { margin-top: 4px; } .wpic .score { font-size: 11px; padding: 1px 4px; }
.wshot { width: 100%; border-radius: 6px; display: block; cursor: pointer; }
.wmain { font-size: 13px; line-height: 1.45; min-width: 0; } .wmain .acts { margin-bottom: 4px; }
.wsay { background: #e8f3ff; border-radius: 6px; padding: 3px 6px; margin: 3px 0; } .wfix { background: #fff7e8; border-radius: 6px; padding: 3px 6px; margin: 3px 0; }
.wline { margin: 3px 0; overflow-wrap: anywhere; }
table.rank tr.sub td { background: #fafbfc; border-top: none; }
.rk-detail { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 14px; font-size: 13px; padding: 4px 0 8px; }
.quote { margin: 4px 0; } .quote small { color: var(--muted); }
.ar-row { padding: 10px 12px; } .ar-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.ar-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .ar-pair img { width: 100%; max-height: 260px; object-fit: contain; background: #000; border-radius: 6px; }
.ar-pair figcaption { font-size: 13px; margin-top: 4px; }
@media (max-width: 760px) { .war-wall { grid-template-columns: 1fr; } .wbody { grid-template-columns: 110px 1fr; } .rk-detail, .ar-pair { grid-template-columns: 1fr; } }
.heat-wrap { overflow-x: auto; } table.heat { border-collapse: separate; border-spacing: 2px; font-size: 11px; }
table.heat td, table.heat th { min-width: 30px; text-align: center; padding: 2px; border: none; }
table.heat td span { display: block; font-weight: 600; } table.heat td small { display: block; opacity: .7; font-size: 10px; }
table.heat td.hm0 { background: #f2f3f5; } table.heat tr.comp td { color: var(--down); font-weight: 600; }
.warn-text { color: #d25f00; }
.today-card .kpis { margin-bottom: 6px; } .td-teams { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.td-teams b { color: #1d2129; margin-left: 4px; } .td-teams small { margin-left: 4px; }
#gteam { max-width: 140px; }
/* Phones: wide tables scroll inside their card instead of stretching the page. */
.card, .tab > div:not(.kpis):not(.toolbar) { overflow-x: auto; }
@media (max-width: 760px) { .topbar .controls { flex-wrap: wrap; } #gteam { max-width: 110px; } table { font-size: 12px; } }
.area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.area { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; } .area.flag { border-left: 4px solid var(--down); }
.area .ah { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; } .area-teams { font-size: 12px; margin: 6px 0; } .area-teams .bad { color: var(--down); }
table.cal { border-collapse: collapse; font-size: 12px; } table.cal th, table.cal td { border: 1px solid var(--line); min-width: 120px; vertical-align: top; padding: 3px; }
table.cal th.today { background: #e8f3ff; } .cal-item { margin: 2px 0; padding: 2px 4px; border-radius: 4px; background: #f2f3f5; }
.cal-item.done { background: #e8ffea; } .cal-item.ready { background: #fff7e8; } .cal-act { float: right; } .cal-act button { padding: 0 4px; font-size: 11px; }
.tr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; } .tr-card { position: relative; } .tr-no { position: absolute; right: 10px; top: 6px; color: var(--muted); font-size: 22px; font-weight: 700; opacity: .3; }
ul.lesson li { margin: 5px 0; line-height: 1.55; } .tr-ex { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; font-size: 13px; }
.tr-ex img { width: 100%; border-radius: 6px; } .quiz { margin: 8px 0; } .quiz label { display: block; margin: 3px 0 3px 12px; } .quiz.ok b { color: var(--up); } .quiz.bad b { color: var(--down); }
.ask-text { white-space: pre-wrap; line-height: 1.6; margin: 6px 0; } .ask-answer { margin-top: 10px; } code.tok { user-select: all; background: #f2f3f5; padding: 2px 6px; }
.bi-zh { display: block; } .bi-th { display: block; color: var(--muted); font-size: .95em; margin-top: 1px; }
.tr-langs { margin-left: 16px; } .tr-langs button.on, [data-ltl].on { background: #e8f3ff; color: #165dff; }
.goal-box { background: #f2f3f5; border-radius: 6px; padding: 8px 12px; } table.scripts { margin: 6px 0 10px; } table.scripts td { vertical-align: top; }
.quiz .explain { font-size: 13px; color: var(--muted); margin: 4px 0 0 12px; }
.wphase { background: #f2f3ff; border-radius: 6px; padding: 4px 8px; margin: 4px 0; font-size: 13px; }
.wchecks { display: block; color: var(--muted); font-size: 12px; } .wchecks span { margin-right: 10px; white-space: nowrap; }
.ros-bar { position: relative; height: 26px; background: #f2f3f5; border-radius: 6px; margin: 6px 0 10px; }
.ros-bar span { position: absolute; top: 0; bottom: 0; border-right: 2px solid #fff; font-size: 12px; padding: 4px 6px; overflow: hidden; white-space: nowrap; background: #c9cdd4; }
.ros-bar span.high { background: #b7eb8f; } .ros-bar span.mid { background: #ffe58f; } .ros-bar span.low { background: #ffccc7; }
.ros-bar i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #1d2129; }
.ros-phase { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 8px 0; }

/* 看播台 */
.wt-chip { cursor: pointer; background: var(--card); padding: 3px 10px; font-size: 13px; }
.wt-chip.on { border-color: #3b5bdb; background: #edf2ff; }
.wt-chip.alert { border-color: #e5484d; }
#wt-chips { margin: 8px 0 10px; }
.wt-stage { display: flex; gap: 12px; align-items: flex-start; }
/* Columns and picture height are set by sizeWall() so the whole wall fits on one screen, side by side. */
.wt-wall { flex: 1; display: grid; gap: 8px; grid-template-columns: repeat(4, 220px); justify-content: center; align-content: start; min-width: 0; --pic-h: 60vh; }
.wt-tile { border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: var(--card); min-width: 0; }
.wt-pic { position: relative; background: #000; height: var(--pic-h); }
.wt-tile.alert { border-color: #e5484d; }
.wt-tile video { width: 100%; height: 100%; object-fit: contain; cursor: pointer; background: #000; display: block; }
.wt-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px 4px; padding: 3px 5px; font-size: 11px; line-height: 1.2; }
.wt-stats span { display: flex; flex-direction: column; min-width: 0; }
.wt-stats small { color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wt-stats b { font-size: 12.5px; white-space: nowrap; }
.wt-wall.nostats .wt-stats { display: none; }
/* 画布 layout: tiles placed absolutely, drag to move, corner to resize */
.wt-wall.canvas { display: block; position: relative; }
.wt-wall.canvas .wt-tile { position: absolute; cursor: move; touch-action: none; }
.wt-resize { position: absolute; right: 0; bottom: 0; width: 14px; height: 14px; cursor: nwse-resize; z-index: 3;
  background: linear-gradient(135deg, transparent 50%, #3b5bdb 50%); }
/* compact tiles (1大N小 smalls, tiny tiles): one-line stats strip */
.wt-tile.compact .wt-stats span:nth-child(n+5) { display: none; }
.wt-tile.compact .wt-ov.bot { display: none; }
.wt-tile.compact .wt-ov { font-size: 11px; }
/* 违规监控 / 政策与目标 */
.gv-sums { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.gv-sum { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; } .gv-sum span { float: right; font-weight: 700; }
.gv-sum.has { border-color: #e5484d; } .gv-sum.has span { color: #e5484d; }
table.gv tr.warn-row td { background: #fff4e0; } .value.bad, td.bad, span.bad { color: #e5484d; } span.good { color: #2f9e44; }
.gv-evbox { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 14px; text-align: left; padding: 6px 0; }
@media (max-width: 900px) { .gv-evbox { grid-template-columns: 1fr; } }
.gv-clip { width: 100%; max-height: 60vh; background: #000; border-radius: 8px; }
.gv-frames { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; } .gv-frames figure { margin: 0; width: 110px; font-size: 11px; color: var(--muted); }
.gv-frames img { width: 110px; border-radius: 6px; display: block; } .gv-chat { max-height: 240px; overflow: auto; }
.gv-bar { display: inline-block; width: 90px; height: 8px; background: var(--line); border-radius: 4px; vertical-align: middle; overflow: hidden; }
.gv-bar i { display: block; height: 100%; background: #3b5bdb; } .gv-bar.ok i { background: #2f9e44; }
.gv-bar.big { width: 100%; height: 14px; border-radius: 7px; }
.po-track { position: relative; padding: 4px 0 22px; } .po-mark, .po-now { position: absolute; top: 20px; transform: translateX(-50%); font-size: 11px; color: var(--muted); }
.po-mark::before, .po-now::before { content: ""; position: absolute; left: 50%; top: -18px; height: 18px; border-left: 1px dashed var(--muted); }
.po-now { color: #e5484d; top: 36px; } .po-now::before { border-left-color: #e5484d; top: -34px; height: 34px; }
.po-track { padding-bottom: 38px; }
.tf-bar { display: inline-block; width: 70px; height: 8px; background: var(--line); border-radius: 4px; vertical-align: middle; overflow: hidden; }
.tf-bar i { display: block; height: 100%; background: #2f9e44; border-radius: 4px; }
table.tf th.sortable { cursor: pointer; user-select: none; }
#tab-traffic .card { margin-bottom: 14px; overflow-x: auto; }
.wt-ov .wt-al { background: #e5484dd9; border-radius: 4px; padding: 1px 5px; margin-top: 2px; font-size: 11px; text-shadow: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wt-wall.focus .wt-ov .wt-al { white-space: normal; }
.wt-ov .wt-evdown { display: inline-block; background: #0009; border-radius: 4px; padding: 1px 5px; margin-top: 2px; font-size: 11px; color: #ffd43b; }
.wt-tr { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.wt-tr-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.wt-tr table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.wt-tr th, .wt-tr td { padding: 2px 4px; text-align: right; border-bottom: 1px dashed var(--line); }
.wt-tr tbody th { text-align: left; font-weight: normal; color: var(--muted); }
.wt-tr td { font-variant-numeric: tabular-nums; } .wt-tr .hint { font-size: 11px; margin-top: 4px; }
.wt-ov { position: absolute; left: 0; right: 0; padding: 6px 8px; color: #fff; font-size: 12.5px; text-shadow: 0 1px 2px #000; pointer-events: none; padding-right: 34px; }
.wt-ov.top { top: 0; background: linear-gradient(#000a, #0000); } .wt-ov.bot { bottom: 0; background: linear-gradient(#0000, #000b); }
.wt-ov small { color: #ddd; } .wt-ov .tag { pointer-events: none; font-size: 11px; }
.wt-btns { position: absolute; right: 6px; top: 34px; display: flex; flex-direction: column; gap: 4px; }
.wt-btns button { background: #0008; color: #fff; border-color: #fff4; padding: 2px 6px; }
.wt-err { position: absolute; inset: 40% 10% auto; color: #fff; text-align: center; font-size: 13px; }
.wt-side { width: 380px; flex: none; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  max-height: calc(100vh - 170px); overflow: auto; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.wt-sh { display: flex; gap: 6px; align-items: center; } .wt-sh button { margin-left: auto; }
.wt-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 8px; }
.wt-nums span { display: flex; flex-direction: column; color: var(--muted); font-size: 11.5px; } .wt-nums b { color: var(--text); font-size: 16px; }
.wt-row .wchecks { display: flex; flex-wrap: wrap; gap: 2px 10px; color: var(--muted); }
.wt-mark { border: 1px dashed var(--line); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.wt-mark-btns { display: flex; gap: 6px; } .wt-mark-btns button { flex: 1; }
.wt-tabs { display: flex; gap: 4px; } .wt-tabs button { flex: 1; background: none; border: 1px solid var(--line); border-radius: 6px; padding: 4px; cursor: pointer; }
.wt-tabs button.on { background: #3b5bdb; color: #fff; border-color: #3b5bdb; }
.wt-feed { min-height: 220px; max-height: 40vh; overflow: auto; }
.wt-feed .fe { padding: 2px 0; border-bottom: 1px dashed var(--line); } .wt-feed .fe.gift { color: #b35c00; } .wt-feed .fe.big { font-weight: 600; background: #fff4e0; }
.wt-feed .fe .zh { color: var(--muted); font-size: 12px; } .tiny { padding: 0 5px; font-size: 11px; }
@media (max-width: 1100px) { .wt-stage { flex-direction: column; } .wt-side { width: auto; max-height: none; } }

/* Ctrl+K */
.palette { position: fixed; inset: 0; background: #0006; z-index: 50; display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.palette-box { width: min(620px, 92vw); background: var(--card); border-radius: 12px; box-shadow: 0 10px 40px #0005; overflow: hidden; }
.palette-box input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 14px 16px; font-size: 16px; outline: none; box-sizing: border-box; }
#palette-list { max-height: 55vh; overflow: auto; }
.pal-item { padding: 8px 16px; cursor: pointer; } .pal-item.on, .pal-item:hover { background: #edf2ff; }
.palette[hidden], .wt-side[hidden] { display: none !important; }
.wt-chip, .wt-tabs button { color: var(--text); }
.wt-tabs button.on { color: #fff; }
.wt-wall.focus { justify-content: end; }
