/* Channel status (passive health) — scoped so the New API shell stays intact. */
#xm-channel-status-root {
  position: fixed;
  z-index: 9999;
  inset: var(--wk-top, 64px) 0 0;
  overflow: auto;
  background: #f3f5f7;
  color: #263748;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}
#xm-channel-status-root.ch-no-site-header { inset: 0; }
html[data-xm-channel-status-route="0"] #xm-channel-status-root { display: none !important; }
/* Hide only the React content shell — never hide header ancestors. */
html[data-xm-channel-status-route="1"] #root > .h-svh,
html[data-xm-channel-status-route="1"] #root .h-svh {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}
html[data-xm-channel-status-route="1"] main:not(.ch-wrap) {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}
html[data-xm-channel-status-route="1"] #xm-channel-status-root {
  z-index: 9999 !important;
  visibility: visible !important;
  opacity: 1 !important;
}
html[data-xm-channel-status-route="1"] #xiongmao-floating-header,
html[data-xm-channel-status-route="1"] header,
html[data-xm-channel-status-route="1"] #xiongmao-site-header {
  z-index: 10000 !important;
  visibility: visible !important;
  opacity: 1 !important;
}
#xm-channel-status-root *, #xm-channel-status-root *::before, #xm-channel-status-root *::after { box-sizing: border-box; }
#xm-channel-status-root button { font: inherit; cursor: pointer; }

.ch-wrap { width: min(1320px, 100%); margin: 0 auto; padding: 22px 20px 32px; }
.ch-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.ch-top-title h1 { margin: 0; font-size: 22px; line-height: 1.25; color: #1a2740; }
.ch-top-title p { margin: 6px 0 0; color: #6b7c95; font-size: 12.5px; line-height: 1.55; }
.ch-top-right { display: flex; align-items: center; gap: 10px; }
.ch-refresh {
  min-height: 32px; padding: 0 12px; border: 1px solid #dfe8f1; border-radius: 7px;
  background: #fff; color: #2d5b8f; font-size: 12px; font-weight: 600;
}
.ch-refresh:hover { background: #eef4fb; }

.ch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.ch-card {
  background: #fff; border: 1px solid #dde6ef; border-radius: 11px;
  padding: 14px 15px 12px; box-shadow: 0 4px 16px rgba(26, 39, 64, .05);
}
.ch-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ch-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.ch-dot-ok { background: #22c55e; }
.ch-dot-warn { background: #f59e0b; }
.ch-dot-bad { background: #ef4444; }
.ch-dot-off { background: #94a3b8; }
.ch-dot-unknown { background: #cbd5e1; }
.ch-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13.5px; font-weight: 650; color: #1e2a3a;
}
.ch-provider {
  flex: 0 0 auto; padding: 2px 7px; border: 1px solid #d7e3ef; border-radius: 5px;
  background: #f4f8fc; color: #3a5b80; font-size: 10.5px; font-weight: 650;
}
.ch-thin {
  flex: 0 0 auto; padding: 2px 6px; border: 1px solid #f0d9a8; border-radius: 5px;
  background: #fdf6e7; color: #946200; font-size: 10px; font-weight: 700;
}

.ch-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ch-metric {
  padding: 9px 10px; border: 1px solid #e6edf4; border-radius: 8px; background: #f8fafc;
}
.ch-metric-label { color: #7a8899; font-size: 10.5px; font-weight: 600; margin-bottom: 3px; }
.ch-metric-value { font-size: 19px; font-weight: 750; color: #1e2a3a; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ch-metric-value.ch-good { color: #15803d; }
.ch-metric-value.ch-bad { color: #b91c1c; }
.ch-muted { color: #94a3b8; font-weight: 500; }

.ch-sub {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 9px 0 8px; color: #8492a6; font-size: 10.5px; line-height: 1.4;
}

.ch-bars {
  display: flex; align-items: flex-end; gap: 2px;
  height: 30px; padding: 3px 2px 2px; border-radius: 6px; background: #f6f8fa;
}
.ch-bar {
  flex: 1 1 0; min-width: 3px; height: 100%; border-radius: 2px;
  background: #e2e8f0;
}
.ch-bar-ok { background: #22c55e; }
.ch-bar-bad { background: #ef4444; }
.ch-bar-empty { background: #e2e8f0; }

.ch-empty {
  padding: 48px 20px; text-align: center; color: #8492a6; font-size: 13px;
  background: #fff; border: 1px solid #dde6ef; border-radius: 11px;
}
.ch-empty.ch-err { color: #b42318; background: #fef3f2; border-color: #fecaca; }

.ch-legend {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 16px; padding: 10px 12px; background: #fff;
  border: 1px solid #dde6ef; border-radius: 9px;
  color: #64748b; font-size: 11px;
}
.ch-legend .ch-bar { display: inline-block; width: 12px; height: 12px; vertical-align: -2px; margin-right: 5px; border-radius: 2px; }
.ch-legend span { display: inline-flex; align-items: center; }

@media (max-width: 640px) {
  .ch-wrap { padding: 14px 12px 22px; }
  .ch-top { align-items: stretch; flex-direction: column; }
  .ch-top-right { justify-content: space-between; }
  .ch-metrics { grid-template-columns: 1fr 1fr; }
}
