/* 统计 / 告警 pages and the red alert bar (hub_stats.js, hub_alerts.js) */
:root{
  --viz-surface:#fcfcfb;--viz-grid:#e7e6e2;--viz-axis:#a7a69f;--viz-text2:#52514e;
  --s1:#2a78d6;--s2:#eb6834;--s3:#1baf7a;--s4:#eda100;--s5:#e87ba4;--s6:#008300;--s7:#6250d6;--s8:#e34948;
}
@media (prefers-color-scheme:dark){:root{
  --viz-surface:#1a1a19;--viz-grid:#2c2c2a;--viz-axis:#5d5c58;--viz-text2:#c3c2b7;
  --s1:#3987e5;--s2:#d95926;--s3:#199e70;--s4:#c98500;--s5:#d55181;--s6:#008300;--s7:#9085e9;--s8:#e66767;
}}
.alertbar{background:var(--bad-bg);color:var(--bad);border-bottom:1px solid var(--bad);padding:6px 16px;font-size:13px;font-weight:600}
.alertbar a{color:inherit;text-decoration:underline;margin-left:6px}
.alertbar span{font-weight:400}

.sfbar{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:flex-end}
.sf{display:flex;flex-direction:column;gap:2px;font-size:12px;color:var(--muted)}
.sf select,.sf input{min-width:0;padding:4px 6px}
.sf input[type=date]{width:auto}
@media (max-width:600px){.sf{flex:1 1 42%}.sfbar>button{flex:1 1 100%}}
.empty{border:1px dashed var(--line);border-radius:8px;padding:24px 16px;text-align:center;color:var(--muted);margin-bottom:12px}

.viz{position:relative;background:var(--viz-surface);border-radius:6px;min-width:0}
.viz svg.chart{display:block;max-width:100%;overflow:visible}
.viz .grid{stroke:var(--viz-grid);stroke-width:1}
.viz .axis{stroke:var(--viz-axis);stroke-width:1}
.viz .cross{stroke:var(--viz-axis);stroke-width:1;stroke-dasharray:3 3}
.viz text.tick{fill:var(--viz-text2);font-size:11px}
.viz text.val{font-variant-numeric:tabular-nums}
.viz .barrow:focus{outline:none}
.viz .barrow:focus-visible rect{stroke:var(--focus);stroke-width:2;fill:transparent}
.tip{position:absolute;pointer-events:none;background:var(--card);color:var(--fg);border:1px solid var(--line);border-radius:6px;padding:6px 8px;font-size:12px;box-shadow:0 2px 8px rgba(0,0,0,.18);z-index:2;max-width:260px}
.tip .th{font-weight:600;margin-bottom:3px}
.tip .tr{display:flex;align-items:center;gap:6px;white-space:nowrap}
.tip .tn{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis}
.sw{display:inline-block;width:10px;height:10px;border-radius:2px;background:var(--muted);flex:0 0 10px}
.legend{display:flex;flex-wrap:wrap;gap:4px 8px;margin:4px 0 8px}
.legend .lg{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:2px 10px;font-size:12px}
.legend .lg.off{opacity:.45;text-decoration:line-through}
table.stt td{vertical-align:middle}

.setform .sfield{display:grid;grid-template-columns:170px minmax(0,1fr);gap:4px 12px;margin-bottom:10px;align-items:start}
.setform label{color:var(--fg);font-size:13px;padding-top:6px}
.setform .sctl{display:flex;flex-direction:column;gap:3px;min-width:0}
.setform .sctl input[type=text]{max-width:200px}
.setform .sctl input.wide{max-width:560px;width:100%}
.setform .sctl input[type=checkbox]{width:18px;height:18px;margin:6px 0}
@media (max-width:600px){.setform .sfield{grid-template-columns:1fr}.setform label{padding-top:0}}
.hub p.banner{margin:8px 0 0}

.toolbar .imp-lbl{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--fg);white-space:nowrap}
.toolbar input[type=checkbox]{width:auto}
