/* ==========================================================================
   云枢视界 · 流媒体调度控制台
   设计方向：广播控台的暖石墨底色、骨白文字与 On-Air 红，强调信息密度与
   可扫描性；不使用阴影堆叠和发光渐变，用发丝分隔线组织界面。
   ========================================================================== */

:root {
  --bg: #101110;
  --bg-deep: #0c0e0c;
  --sidebar: #131513;
  --panel: #171917;
  --panel-head: #1a1c19;
  --panel-deep: #141613;
  --line: #2a2d28;
  --line-strong: #3a3d36;
  --line-soft: #232620;
  --text: #ece7dd;
  --text-2: #c3bfb5;
  --muted: #9b9e96;
  --faint: #82857d;
  --live: #e15a50;
  --live-soft: rgba(225, 90, 80, 0.11);
  --good: #71b78f;
  --good-track: rgba(113, 183, 143, 0.12);
  --warn: #d8a34b;
  --warn-track: rgba(216, 163, 75, 0.12);
  --crit: #d96a5f;
  --crit-track: rgba(217, 106, 95, 0.12);
  --maint: #7d8996;
  --blue: #3987e5;
  --orange: #d95926;
  --chart-surface: #181a17;
  --radius: 2px;
  --sidebar-w: 216px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, "Liberation Mono",
    monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.no-scroll {
  overflow: hidden;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-mark svg {
  fill: currentColor;
  stroke: none;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(57, 135, 229, 0.32);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* 细滚动条，避免打断深色面板的连续性 */
* {
  scrollbar-width: thin;
  scrollbar-color: #3f423b transparent;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #3a3d37;
  border: 2px solid var(--panel);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #4c4f47;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* --------------------------------------------------------------------------
   框架与侧边栏
   -------------------------------------------------------------------------- */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  flex: 0 0 56px;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line-soft);
}

.brand-mark {
  display: inline-flex;
  flex: 0 0 29px;
  align-items: center;
  justify-content: center;
  width: 29px;
  height: 29px;
  color: var(--text);
  border: 1px solid #3a3b34;
  border-radius: 2px;
  background: #191b17;
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.brand-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.055em;
  white-space: nowrap;
}

.brand-copy span {
  margin-top: 3px;
  color: var(--faint);
  font-size: 9px;
  letter-spacing: 0.075em;
  white-space: nowrap;
}

.env-line {
  display: flex;
  flex: 0 0 33px;
  align-items: center;
  gap: 7px;
  height: 33px;
  padding: 0 14px;
  color: var(--muted);
  font-size: 10.5px;
  border-bottom: 1px solid var(--line-soft);
}

.env-code {
  margin-left: auto;
  padding: 1px 4px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.03em;
  border: 1px solid var(--line);
  border-radius: 2px;
}

.nav {
  flex: 1;
  min-height: 0;
  padding: 13px 8px 8px;
  overflow-y: auto;
}

.nav-group {
  margin-bottom: 15px;
}

.nav-heading {
  padding: 0 8px 6px;
  color: var(--faint);
  font-size: 9.5px;
  letter-spacing: 0.13em;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 32px;
  margin-bottom: 1px;
  padding: 6px 8px;
  color: var(--text-2);
  font-size: 12px;
  text-align: left;
  border-radius: 2px;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.nav-item:hover {
  color: var(--text);
  background: #1a1c18;
}

.nav-item.is-active {
  color: var(--text);
  background: #1c1e1a;
  box-shadow: inset 2px 0 0 var(--live);
}

.nav-item.is-active .nav-icon {
  color: var(--text);
}

.nav-icon {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.nav-meta {
  margin-left: auto;
  color: var(--faint);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}

.nav-badge {
  min-width: 16px;
  margin-left: auto;
  padding: 0 4px;
  color: #e8a29b;
  font-size: 9px;
  font-weight: 600;
  line-height: 15px;
  text-align: center;
  border: 1px solid rgba(225, 90, 80, 0.28);
  border-radius: 2px;
  background: var(--live-soft);
  font-variant-numeric: tabular-nums;
}

.nav-item.is-restricted {
  color: var(--faint);
}

.nav-item.is-restricted:hover {
  color: var(--text-2);
}

.nav-item.is-restricted .nav-icon {
  opacity: 0.72;
}

.nav-lock {
  width: 11px;
  height: 11px;
  margin-left: auto;
  color: var(--faint);
  opacity: 0.65;
}

.sidebar-foot {
  flex: 0 0 auto;
  padding: 11px 14px 13px;
  color: var(--faint);
  font-size: 9.5px;
  border-top: 1px solid var(--line-soft);
}

.side-service {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--muted);
}

.side-line {
  line-height: 1.65;
}

.side-version {
  margin-top: 5px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8.5px;
}

.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(5, 6, 5, 0.66);
  backdrop-filter: blur(2px);
}

/* --------------------------------------------------------------------------
   顶部栏
   -------------------------------------------------------------------------- */

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  flex: 0 0 56px;
  align-items: center;
  gap: 14px;
  height: 56px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 17, 16, 0.94);
  backdrop-filter: blur(10px);
}

.menu-btn {
  display: none;
}

.crumbs {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  color: var(--faint);
  font-size: 10.5px;
  white-space: nowrap;
}

.crumbs .current {
  overflow: hidden;
  color: var(--text-2);
  text-overflow: ellipsis;
}

.crumb-sep {
  color: #5f625b;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 262px;
  height: 30px;
  padding: 0 7px 0 9px;
  color: var(--faint);
  font-size: 10.5px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #141613;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.search-trigger:hover {
  color: var(--muted);
  border-color: var(--line-strong);
  background: #171916;
}

.search-icon {
  flex: 0 0 13px;
  width: 13px;
  height: 13px;
  color: var(--muted);
}

.search-placeholder {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-trigger kbd,
.search-input-row kbd {
  padding: 1px 4px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.4;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #101210;
}

.link-health {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
}

.link-health .mono {
  color: var(--faint);
  font-size: 9px;
}

.pulse-dot {
  display: inline-block;
  flex: 0 0 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--good);
  animation: softPulse 2.6s ease-out infinite;
}

.top-divider {
  width: 1px;
  height: 17px;
  background: var(--line);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 2px;
  transition: color 0.14s ease, background-color 0.14s ease,
    border-color 0.14s ease;
}

.icon-btn svg {
  width: 15px;
  height: 15px;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--line);
  background: #1a1c18;
}

.bell-wrap {
  position: relative;
}

.bell-btn {
  position: relative;
}

.bell-badge {
  position: absolute;
  top: 3px;
  right: 2px;
  min-width: 13px;
  height: 13px;
  padding: 0 3px;
  color: #17130f;
  font-size: 8px;
  font-weight: 700;
  line-height: 13px;
  text-align: center;
  border-radius: 7px;
  background: var(--live);
  font-variant-numeric: tabular-nums;
}

.operator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 2px;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  color: var(--text-2);
  font-size: 10.5px;
  border: 1px solid #41433b;
  border-radius: 50%;
  background: #22241f;
}

.operator-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.operator-copy strong {
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 500;
}

.operator-copy small {
  margin-top: 1px;
  color: var(--faint);
  font-size: 8.5px;
}

.popover {
  position: absolute;
  top: 37px;
  right: -4px;
  z-index: 70;
  width: 338px;
  max-width: calc(100vw - 24px);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: #1a1c18;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

.popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  padding: 0 12px;
  color: var(--text-2);
  font-size: 10.5px;
  border-bottom: 1px solid var(--line-soft);
}

.popover-list {
  max-height: 288px;
  overflow-y: auto;
}

.pop-alert {
  display: flex;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
}

.pop-alert:hover {
  background: #20221d;
}

.pop-sev {
  flex: 0 0 5px;
  width: 5px;
  height: 5px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--warn);
}

.pop-sev.critical {
  background: var(--crit);
}

.pop-sev.info {
  background: var(--maint);
}

.pop-main {
  min-width: 0;
  flex: 1;
}

.pop-title {
  display: block;
  overflow: hidden;
  color: var(--text-2);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pop-meta {
  display: flex;
  gap: 7px;
  margin-top: 2px;
  color: var(--faint);
  font-size: 9px;
}

.pop-empty {
  padding: 24px 12px;
  color: var(--faint);
  font-size: 10.5px;
  text-align: center;
}

.popover-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 34px;
  padding: 0 12px;
  border-top: 1px solid var(--line-soft);
  background: #181a16;
}

/* --------------------------------------------------------------------------
   主内容与页头
   -------------------------------------------------------------------------- */

.main {
  flex: 1;
  width: 100%;
  max-width: 1720px;
  margin: 0 auto;
  padding: 20px 22px 24px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.page-title-row {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-wrap: wrap;
}

.page-title-row h1 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.015em;
  line-height: 1.25;
}

.page-sub {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 7px;
  color: #e7a39c;
  font-size: 9.5px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border: 1px solid rgba(225, 90, 80, 0.3);
  border-radius: 2px;
  background: var(--live-soft);
}

.live-badge b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.live-badge.small {
  height: 18px;
  font-size: 9px;
}

.live-dot {
  display: inline-block;
  flex: 0 0 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--live);
  animation: livePulse 2.4s ease-out infinite;
}

.page-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.segmented {
  display: inline-flex;
  align-items: stretch;
  height: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #141613;
}

.seg-btn {
  position: relative;
  height: 100%;
  padding: 0 10px;
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
  border-right: 1px solid var(--line-soft);
  transition: color 0.14s ease, background-color 0.14s ease;
}

.seg-btn:last-child {
  border-right: 0;
}

.seg-btn:hover {
  color: var(--text-2);
  background: #191b17;
}

.seg-btn.is-active {
  color: var(--text);
  background: #262822;
  box-shadow: inset 0 -2px 0 var(--text);
}

.seg-btn span {
  margin-left: 2px;
  color: var(--faint);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.seg-btn.is-active span {
  color: var(--muted);
}

.segmented.compact {
  height: 26px;
}

.segmented.compact .seg-btn {
  padding: 0 8px;
  font-size: 10px;
}

.switch-field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10.5px;
  cursor: pointer;
  user-select: none;
}

.switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 28px;
  width: 28px;
  height: 16px;
}

.switch input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch-track {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #191b17;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.switch input:checked + .switch-track {
  border-color: var(--text);
  background: var(--text);
}

.switch input:checked + .switch-track .switch-thumb {
  background: #171917;
  transform: translateX(12px);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  color: var(--text-2);
  font-size: 10.5px;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #171916;
  transition: color 0.14s ease, border-color 0.14s ease,
    background-color 0.14s ease;
}

.btn svg {
  width: 13px;
  height: 13px;
  color: var(--muted);
}

.btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: #1d1f1b;
}

.btn:hover svg {
  color: var(--text-2);
}

.btn-icon {
  width: 28px;
  padding: 0;
}

.btn.is-spinning svg {
  animation: spin 0.55s ease;
}

.btn-primary {
  color: #151714;
  font-weight: 600;
  border-color: var(--text);
  background: var(--text);
}

.btn-primary:hover {
  color: #0f1110;
  border-color: #fffaf0;
  background: #fffaf0;
}

.btn-danger {
  color: #e7a39c;
  border-color: rgba(225, 90, 80, 0.36);
  background: rgba(225, 90, 80, 0.06);
}

.btn-danger:hover {
  color: #f3b7b1;
  border-color: rgba(225, 90, 80, 0.6);
  background: rgba(225, 90, 80, 0.1);
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
  transition: color 0.14s ease;
}

.text-btn svg {
  width: 11px;
  height: 11px;
}

.text-btn:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-btn:disabled,
.text-btn[aria-disabled="true"] {
  color: #5f625b;
  cursor: default;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   面板基础
   -------------------------------------------------------------------------- */

.panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel-head);
}

.panel-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.panel-title {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.012em;
}

.panel-note {
  color: var(--faint);
  font-size: 9.5px;
  white-space: nowrap;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sync-state {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}

.sync-state.is-paused .pulse-dot {
  background: var(--maint);
  box-shadow: none;
  animation: none;
}

/* --------------------------------------------------------------------------
   实时概览指标带
   -------------------------------------------------------------------------- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
}

.kpi {
  min-width: 0;
  padding: 11px 14px 12px;
  background: var(--panel);
}

.kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.delta {
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.delta.good {
  color: var(--good);
}

.delta.bad {
  color: var(--crit);
}

.delta.flat {
  color: var(--faint);
}

.kpi-value-row {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-height: 31px;
  margin-top: 4px;
}

.kpi-value {
  color: var(--text);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.08;
  white-space: nowrap;
}

.kpi-unit {
  padding-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.sparkline {
  flex: 0 0 46px;
  align-self: center;
  width: 46px;
  height: 21px;
  margin-left: auto;
  opacity: 0.9;
}

.kpi-foot {
  margin-top: 3px;
  overflow: hidden;
  color: var(--faint);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-alert-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-left: auto;
  color: var(--crit);
  border: 1px solid rgba(217, 106, 95, 0.28);
  border-radius: 2px;
  background: var(--crit-track);
}

.kpi-alert-flag svg {
  width: 14px;
  height: 14px;
}

#kpiAlertsDelta.is-clear {
  color: var(--good);
}

/* --------------------------------------------------------------------------
   链路与流量 / 集群健康
   -------------------------------------------------------------------------- */

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
  align-items: stretch;
}

.tabs {
  display: flex;
  align-self: stretch;
  gap: 16px;
}

.tab {
  position: relative;
  padding: 0;
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
  transition: color 0.14s ease;
}

.tab:hover {
  color: var(--text-2);
}

.tab.is-active {
  color: var(--text);
}

.tab.is-active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--text);
  content: "";
}

.signal-strip {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel-deep);
  scrollbar-width: none;
}

.signal-strip::-webkit-scrollbar {
  display: none;
}

.signal-stage {
  flex: 1;
  min-width: 105px;
  white-space: nowrap;
}

.stage-label {
  display: block;
  color: var(--faint);
  font-size: 8.5px;
  letter-spacing: 0.04em;
}

.stage-main {
  display: block;
  margin-top: 1px;
  color: var(--text-2);
  font-size: 9.5px;
}

.stage-main b {
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stage-sub {
  display: block;
  margin-top: 1px;
  color: var(--faint);
  font-size: 8.5px;
  font-variant-numeric: tabular-nums;
}

.stage-sub b {
  color: var(--text-2);
  font-weight: 500;
}

.signal-connector {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  margin: 0 3px;
  color: #50534c;
}

.chart-block {
  padding: 9px 14px 10px;
}

.chart-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 20px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--muted);
  font-size: 9.5px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.key {
  display: inline-block;
  width: 14px;
  height: 0;
  flex: 0 0 14px;
}

.key-solid {
  border-top: 2px solid var(--blue);
}

.key-dashed {
  border-top: 1.5px dashed var(--orange);
}

.chart-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
  color: var(--faint);
  font-size: 9px;
  white-space: nowrap;
}

.chart-summary b {
  color: var(--text-2);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.vsep {
  display: inline-block;
  width: 1px;
  height: 9px;
  background: var(--line);
}

.chart-table-toggle {
  margin-left: 3px;
}

.chart-wrap {
  position: relative;
  height: clamp(208px, 14.5vw, 248px);
  margin-top: 3px;
}

#mainChart {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: pan-y;
}

#mainChart:focus-visible {
  outline: 1px solid var(--line-strong);
  outline-offset: 2px;
}

.chart-tooltip {
  position: absolute;
  z-index: 8;
  min-width: 152px;
  padding: 7px 9px;
  color: var(--text-2);
  font-size: 9.5px;
  pointer-events: none;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: #0e100e;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
}

.tooltip-time {
  padding-bottom: 4px;
  margin-bottom: 4px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 9px;
  border-bottom: 1px solid var(--line-soft);
}

.tooltip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.8;
}

.tooltip-row .key {
  width: 10px;
  flex-basis: 10px;
}

.tooltip-row .tooltip-label {
  flex: 1;
  color: var(--faint);
}

.tooltip-row b {
  color: var(--text-2);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.chart-table-wrap {
  max-height: clamp(208px, 14.5vw, 248px);
  margin-top: 5px;
  overflow: auto;
  border-top: 1px solid var(--line-soft);
}

.chart-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9.5px;
}

.chart-table caption {
  padding: 6px 0 3px;
  color: var(--faint);
  font-size: 9px;
  text-align: left;
}

.chart-table th {
  position: sticky;
  top: 0;
  padding: 5px 8px;
  color: var(--faint);
  font-size: 8.5px;
  font-weight: 500;
  text-align: right;
  background: var(--panel-head);
  border-bottom: 1px solid var(--line);
}

.chart-table th:first-child,
.chart-table td:first-child {
  text-align: left;
}

.chart-table td {
  padding: 4px 8px;
  color: var(--text-2);
  text-align: right;
  border-bottom: 1px solid var(--line-soft);
  font-variant-numeric: tabular-nums;
}

.chart-table tbody tr:last-child td {
  border-bottom: 0;
}

/* 集群健康 */

.health-panel {
  display: flex;
  flex-direction: column;
}

.health-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 11px 14px 0;
}

.availability-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line-soft);
}

.avail-line {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.avail-num {
  color: var(--text);
  font-size: 29px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

.avail-total {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.avail-cap {
  margin-left: 3px;
  color: var(--muted);
  font-size: 9.5px;
}

.avail-note {
  margin-top: 4px;
  color: var(--faint);
  font-size: 9px;
}

.avail-note span {
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.avail-rate {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.45;
}

.avail-rate b {
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.matrix-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  color: var(--faint);
  font-size: 8.5px;
}

.matrix-head .mono {
  font-size: 8px;
  color: var(--faint);
}

.node-matrix {
  display: flex;
  gap: 3px;
  height: 16px;
  margin-top: 6px;
}

.node-cell {
  flex: 1;
  min-width: 0;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 1px;
  background: var(--good);
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.node-cell:hover {
  opacity: 0.82;
  transform: translateY(-1px);
}

.node-cell.status-busy {
  background: var(--warn);
}

.node-cell.status-maint,
.node-cell.status-maintenance {
  background: repeating-linear-gradient(
    135deg,
    #707c88 0,
    #707c88 3px,
    #373c3f 3px,
    #373c3f 6px
  );
}

.node-cell.status-offline {
  background: var(--crit);
}

.node-cell.group-start {
  margin-left: 4px;
}

.status-counts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 11px;
  margin-top: 7px;
  color: var(--faint);
  font-size: 8.5px;
}

.status-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.status-count b {
  color: var(--text-2);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.status-dot {
  display: inline-block;
  flex: 0 0 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
}

.status-dot.ok {
  background: var(--good);
}

.status-dot.busy {
  background: var(--warn);
}

.status-dot.maint {
  background: var(--maint);
}

.status-dot.offline {
  background: var(--crit);
}

.region-block {
  margin-top: 9px;
}

.subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  color: var(--faint);
  font-size: 8.5px;
}

.subhead > span:last-child {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.region-list {
  display: flex;
  flex-direction: column;
}

.region-row {
  display: grid;
  grid-template-columns: 40px 43px minmax(28px, 1fr) 31px;
  align-items: center;
  gap: 7px;
  height: 24px;
  font-size: 9px;
}

.region-name {
  color: var(--text-2);
}

.region-count {
  color: var(--faint);
  font-size: 8.5px;
  font-variant-numeric: tabular-nums;
}

.region-meter {
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(57, 135, 229, 0.13);
}

.region-meter > i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--blue);
  transition: width 0.35s ease;
}

.region-meter.is-warn {
  background: var(--warn-track);
}

.region-meter.is-warn > i {
  background: var(--warn);
}

.region-meter.is-crit {
  background: var(--crit-track);
}

.region-meter.is-crit > i {
  background: var(--crit);
}

.region-pct {
  color: var(--muted);
  font-size: 8.5px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.health-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding: 8px 0 9px;
  color: var(--faint);
  font-size: 8.5px;
  border-top: 1px solid var(--line-soft);
}

.health-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.health-foot .mono {
  color: var(--faint);
  font-size: 8px;
}

/* --------------------------------------------------------------------------
   数据表通用
   -------------------------------------------------------------------------- */

.table-panel {
  margin-top: 14px;
}

.table-panel-head {
  min-height: 46px;
}

.table-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 176px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #141613;
  transition: border-color 0.14s ease;
}

.search-box:focus-within {
  border-color: var(--line-strong);
}

.search-box svg {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  color: var(--faint);
}

.search-box input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--text-2);
  font-size: 10px;
  border: 0;
  outline: 0;
  background: transparent;
}

.search-box input::placeholder {
  color: var(--faint);
}

.search-box input::-webkit-search-cancel-button {
  display: none;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table thead th {
  height: 31px;
  padding: 0 10px;
  color: var(--faint);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.045em;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
  background: var(--panel-head);
}

.data-table thead th:first-child {
  padding-left: 14px;
}

.data-table thead th:last-child {
  padding-right: 14px;
}

.data-table tbody td {
  padding: 7px 10px;
  color: var(--text-2);
  font-size: 10px;
  vertical-align: middle;
  border-bottom: 1px solid var(--line-soft);
}

.data-table tbody td:first-child {
  padding-left: 14px;
}

.data-table tbody td:last-child {
  padding-right: 14px;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr {
  transition: background-color 0.12s ease;
}

.nodes-table {
  min-width: 1010px;
}

.nodes-table tbody tr {
  height: 46px;
  cursor: pointer;
}

.nodes-table tbody tr:hover {
  background: #1a1c18;
}

.nodes-table tbody tr.is-busy {
  background: rgba(216, 163, 75, 0.022);
}

.nodes-table tbody tr.is-offline {
  background: rgba(217, 106, 95, 0.028);
}

.th-unit {
  margin-left: 2px;
  color: var(--faint);
  font-size: 7.5px;
  font-weight: 400;
  letter-spacing: 0;
}

.node-name-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 120px;
}

.node-name {
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.012em;
}

.node-ip {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-variant-numeric: tabular-nums;
}

.region-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 120px;
}

.region-cell .r1 {
  color: var(--text-2);
  font-size: 9.5px;
}

.region-cell .r2 {
  color: var(--faint);
  font-size: 8.5px;
}

.role-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-2);
  font-size: 9px;
  white-space: nowrap;
}

.role-mark {
  display: inline-block;
  width: 2px;
  height: 9px;
  border-radius: 1px;
  background: var(--maint);
}

.role-source .role-mark {
  background: #7e9fbe;
}

.role-edge .role-mark {
  background: #737d76;
}

.role-transcode .role-mark {
  background: #a08bbd;
}

.stream-count {
  color: var(--text-2);
  font-size: 9.5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.stream-count .sc-type {
  margin-left: 2px;
  color: var(--faint);
  font-size: 8px;
}

.metric-cell {
  min-width: 66px;
}

.metric-num {
  color: var(--text-2);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}

.meter {
  width: 48px;
  height: 3px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(57, 135, 229, 0.13);
}

.meter > i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--blue);
  transition: width 0.35s ease;
}

.meter.is-warn {
  background: var(--warn-track);
}

.meter.is-warn > i {
  background: var(--warn);
}

.meter.is-crit {
  background: var(--crit-track);
}

.meter.is-crit > i {
  background: var(--crit);
}

.bw-cell {
  color: var(--text-2);
  font-size: 9.5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.bw-cell .sep {
  margin: 0 3px;
  color: #666a62;
}

.load-cell {
  min-width: 64px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-2);
  font-size: 9px;
  white-space: nowrap;
}

.status .status-dot {
  width: 5px;
  height: 5px;
}

.status-offline {
  color: var(--muted);
}

.row-action {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 0;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.row-action svg {
  width: 10px;
  height: 10px;
}

.row-action:hover {
  color: var(--text);
}

.col-action {
  text-align: right;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 37px;
  padding: 7px 14px;
  color: var(--faint);
  font-size: 9px;
  border-top: 1px solid var(--line-soft);
}

.pager {
  display: flex;
  align-items: center;
  gap: 3px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 23px;
  height: 23px;
  padding: 0 5px;
  color: var(--muted);
  font-size: 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  font-variant-numeric: tabular-nums;
  transition: color 0.12s ease, background-color 0.12s ease,
    border-color 0.12s ease;
}

.page-btn svg {
  width: 11px;
  height: 11px;
}

.page-btn:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--line-strong);
  background: #1c1e1a;
}

.page-btn.is-active {
  color: #151714;
  font-weight: 600;
  border-color: var(--text);
  background: var(--text);
}

.page-btn:disabled {
  cursor: default;
  opacity: 0.32;
}

.empty-state {
  height: 170px;
  color: var(--faint) !important;
  font-size: 10.5px !important;
  text-align: center !important;
}

/* --------------------------------------------------------------------------
   重点保障流 / 告警
   -------------------------------------------------------------------------- */

.bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.58fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
  align-items: stretch;
}

.streams-panel,
.alerts-panel {
  display: flex;
  min-height: 396px;
  flex-direction: column;
}

.check-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9.5px;
  cursor: pointer;
  user-select: none;
}

.check-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.check-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  color: #151714;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: #141613;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.check-box svg {
  width: 9px;
  height: 9px;
  opacity: 0;
}

.check-field input:checked + .check-box {
  border-color: var(--text);
  background: var(--text);
}

.check-field input:checked + .check-box svg {
  opacity: 1;
}

.check-field input:focus-visible + .check-box {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.streams-panel .panel-actions .text-btn svg {
  width: 11px;
  height: 11px;
}

.streams-scroll {
  flex: 1;
}

.streams-table {
  min-width: 650px;
}

.streams-table thead th {
  height: 30px;
}

.streams-table tbody tr {
  height: 44px;
  cursor: pointer;
}

.streams-table tbody tr:hover {
  background: #1a1c18;
}

.streams-table tbody td {
  padding-top: 6px;
  padding-bottom: 6px;
}

.stream-cell {
  min-width: 154px;
}

.stream-name {
  overflow: hidden;
  color: var(--text);
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stream-id {
  margin-top: 1px;
  overflow: hidden;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-main {
  color: var(--text-2);
  font-size: 9.5px;
  white-space: nowrap;
}

.cell-sub {
  margin-top: 1px;
  color: var(--faint);
  font-size: 8.5px;
  white-space: nowrap;
}

.node-ref {
  padding: 0;
  color: var(--text-2);
  font-size: 9.5px;
  white-space: nowrap;
  border-bottom: 1px dotted #4a4d45;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.node-ref:hover {
  color: var(--text);
  border-color: var(--text-2);
}

.quality-main {
  color: var(--text-2);
  font-size: 9.5px;
  white-space: nowrap;
}

.quality-sub {
  margin-top: 1px;
  color: var(--faint);
  font-size: 8.5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.viewer-count {
  color: var(--text-2);
  font-size: 9.5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.duration {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8.5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.status-live .status-dot {
  background: var(--good);
}

.status-unstable .status-dot {
  background: var(--warn);
}

.status-reconnecting .status-dot {
  background: var(--maint);
}

.streams-footer {
  margin-top: auto;
}

.alert-count {
  min-width: 16px;
  margin-left: 1px;
  padding: 0 4px;
  color: #e7a39c;
  font-size: 8.5px;
  font-weight: 500;
  line-height: 15px;
  text-align: center;
  border: 1px solid rgba(225, 90, 80, 0.28);
  border-radius: 2px;
  background: var(--live-soft);
  font-variant-numeric: tabular-nums;
}

.alert-count.is-clear {
  color: var(--faint);
  border-color: var(--line);
  background: #1b1d19;
}

.alert-tabs {
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 32px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line-soft);
}

.alert-tab {
  position: relative;
  height: 32px;
  color: var(--faint);
  font-size: 9px;
  white-space: nowrap;
}

.alert-tab:hover {
  color: var(--text-2);
}

.alert-tab.is-active {
  color: var(--text);
}

.alert-tab.is-active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--text);
  content: "";
}

.alert-tab span {
  margin-left: 2px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.alert-list {
  flex: 1;
  max-height: 352px;
  min-height: 100px;
  overflow-y: auto;
}

.alert-item {
  padding: 8px 14px 9px;
  border-left: 2px solid transparent;
  border-bottom: 1px solid var(--line-soft);
  transition: background-color 0.12s ease;
}

.alert-item:hover {
  background: #191b17;
}

.alert-item.level-critical {
  border-left-color: var(--crit);
}

.alert-item.level-warning {
  border-left-color: var(--warn);
}

.alert-item.level-info {
  border-left-color: var(--maint);
}

.alert-item.is-acked {
  border-left-color: var(--line-strong);
}

.alert-item.is-acked .alert-title {
  color: var(--muted);
}

.alert-item.is-acked .alert-desc {
  color: var(--faint);
}

.alert-top {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.severity {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 0.02em;
}

.severity i {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--maint);
}

.severity.critical {
  color: #d98b83;
}

.severity.critical i {
  background: var(--crit);
}

.severity.warning {
  color: #c7a466;
}

.severity.warning i {
  background: var(--warn);
}

.alert-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--text-2);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-time {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.alert-desc {
  margin: 2px 0 4px 11px;
  overflow: hidden;
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 18px;
  margin-left: 11px;
  color: var(--faint);
  font-size: 8.5px;
}

.alert-meta .node-ref {
  font-size: 8.5px;
}

.ack-btn {
  margin-left: auto;
  padding: 2px 7px;
  color: var(--text-2);
  font-size: 8.5px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #1a1c18;
  transition: color 0.12s ease, border-color 0.12s ease,
    background-color 0.12s ease;
}

.ack-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: #20221d;
}

.acked {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  color: var(--faint);
  font-size: 8.5px;
}

.acked svg {
  width: 10px;
  height: 10px;
}

.alert-empty {
  padding: 34px 14px;
  color: var(--faint);
  font-size: 10px;
  text-align: center;
}

.alerts-footer {
  margin-top: auto;
}

/* --------------------------------------------------------------------------
   固定状态条
   -------------------------------------------------------------------------- */

.statusbar {
  position: static;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 31px;
  padding: 0 14px;
  overflow: hidden;
  color: var(--faint);
  font-size: 8.5px;
  white-space: nowrap;
  border-top: 1px solid var(--line);
  background: #0d0f0d;
}

.status-left,
.status-center,
.status-right {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.status-center {
  color: var(--faint);
}

.status-right {
  justify-content: flex-end;
}

.status-left .status-dot {
  width: 4px;
  height: 4px;
}

.status-sep {
  width: 1px;
  height: 9px;
  background: var(--line);
}

.statusbar .mono {
  font-size: 8px;
  color: #858980;
}

.copyright {
  color: var(--faint);
}

/* --------------------------------------------------------------------------
   抽屉 / 弹窗 / 搜索浮层
   -------------------------------------------------------------------------- */

.layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
}

.layer--drawer {
  justify-content: flex-end;
}

.layer--center {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.layer--search {
  align-items: flex-start;
  justify-content: center;
  padding: 11vh 20px 20px;
  z-index: 110;
}

.scrim {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: rgba(6, 7, 6, 0.64);
  backdrop-filter: blur(3px);
  transition: opacity 0.18s ease;
}

.layer.is-open .scrim {
  opacity: 1;
}

.drawer {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 474px;
  max-width: 100vw;
  height: 100%;
  opacity: 0;
  outline: none;
  border-left: 1px solid var(--line-strong);
  background: #151714;
  box-shadow: -24px 0 64px rgba(0, 0, 0, 0.36);
  transform: translateX(24px);
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.layer.is-open .drawer {
  opacity: 1;
  transform: translateX(0);
}

.drawer-head {
  position: relative;
  flex: 0 0 auto;
  padding: 15px 16px 13px;
  border-bottom: 1px solid var(--line);
  background: #181a16;
}

.drawer-eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--faint);
  font-size: 8.5px;
  letter-spacing: 0.055em;
}

.drawer-close,
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.drawer-close:focus-visible,
.modal-close:focus-visible {
  outline: 1px solid rgba(236, 231, 221, 0.58);
  outline-offset: 2px;
}

.drawer-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  padding-right: 34px;
}

.drawer-title-row h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  color: var(--text-2);
  font-size: 8.5px;
  line-height: 16px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #1d1f1a;
}

.state-pill .status-dot {
  width: 4px;
  height: 4px;
}

.drawer-meta {
  margin-top: 4px;
  color: var(--faint);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.drawer-meta .mono {
  font-size: 8.5px;
}

.drawer-body {
  flex: 1;
  min-height: 0;
  padding: 14px 16px 18px;
  overflow-y: auto;
}

.section-block {
  margin-top: 14px;
}

.section-block:first-child {
  margin-top: 0;
}

.section-block h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 7px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.045em;
}

.section-block h3 span {
  color: var(--faint);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0;
}

.drawer-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background: var(--line-soft);
}

.drawer-metric {
  padding: 8px 10px 9px;
  background: #191b17;
}

.drawer-metric-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--faint);
  font-size: 8.5px;
}

.drawer-metric-value {
  margin-top: 1px;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.drawer-metric-value small {
  margin-left: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 400;
}

.drawer-metric .meter {
  width: 100%;
  margin-top: 6px;
}

.core-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 54px;
  padding-bottom: 1px;
  border-bottom: 1px solid var(--line);
  background-image: linear-gradient(
    to bottom,
    transparent 49%,
    rgba(255, 255, 255, 0.045) 50%,
    transparent 51%
  );
}

.core-bar {
  flex: 1;
  min-width: 2px;
  min-height: 3px;
  border-radius: 1px 1px 0 0;
  background: rgba(57, 135, 229, 0.62);
}

.core-bar.is-hot {
  background: rgba(216, 163, 75, 0.8);
}

.core-caption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  color: var(--faint);
  font-size: 8px;
}

.net-row {
  display: grid;
  grid-template-columns: 64px minmax(40px, 1fr) 99px;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  font-size: 9px;
}

.net-row .net-label {
  color: var(--muted);
}

.net-row .net-value {
  color: var(--text-2);
  font-size: 8.5px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.net-meter {
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(57, 135, 229, 0.13);
}

.net-meter > i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--blue);
}

.mini-stream-list {
  display: flex;
  flex-direction: column;
}

.mini-stream {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  border-bottom: 1px solid var(--line-soft);
}

.mini-stream:last-child {
  border-bottom: 0;
}

.mini-stream-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--text-2);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-stream-meta {
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 8.5px;
  font-variant-numeric: tabular-nums;
}

.detail-empty {
  padding: 12px 0;
  color: var(--faint);
  font-size: 9px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin: 0;
}

.info-pair {
  min-width: 0;
}

.info-pair dt {
  color: var(--faint);
  font-size: 8px;
}

.info-pair dd {
  margin: 1px 0 0;
  overflow: hidden;
  color: var(--text-2);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.event-list {
  display: flex;
  flex-direction: column;
}

.event-row {
  display: flex;
  gap: 9px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 9px;
}

.event-row:last-child {
  border-bottom: 0;
}

.event-time {
  flex: 0 0 46px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.event-text {
  color: var(--muted);
  line-height: 1.5;
}

.drawer-foot,
.modal-foot {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: #181a16;
}

.drawer-foot .text-btn {
  margin-right: auto;
}

/* 直播流详情 */

.modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(704px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  opacity: 0;
  outline: none;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: #171915;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.56);
  transform: translateY(12px) scale(0.996);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.layer.is-open .modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal-head {
  position: relative;
  flex: 0 0 auto;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--line);
  background: #181a16;
}

.modal-head h2 {
  margin: 6px 34px 0 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
}

.modal-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 4px;
  color: var(--faint);
  font-size: 8.5px;
}

.modal-meta .mono {
  font-size: 8px;
}

.modal-body {
  flex: 1;
  min-height: 0;
  padding: 14px 18px 16px;
  overflow-y: auto;
}

.modal-foot .modal-foot-info {
  margin-right: auto;
  color: var(--faint);
  font-size: 8.5px;
}

.stream-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--line-soft);
  background: var(--line-soft);
}

.stream-stat {
  padding: 8px 10px;
  background: #191b17;
}

.stream-stat-label {
  color: var(--faint);
  font-size: 8.5px;
}

.stream-stat-value {
  margin-top: 1px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stream-stat-value small {
  margin-left: 2px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 400;
}

.stream-subhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 13px 0 7px;
  color: var(--faint);
  font-size: 9px;
}

.stream-subhead:first-child {
  margin-top: 0;
}

.stream-subhead span {
  color: var(--faint);
  font-size: 8.5px;
}

.chain {
  display: flex;
  align-items: center;
  padding: 9px 10px;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  background: #141613;
}

.chain-step {
  flex: 1;
  min-width: 105px;
  white-space: nowrap;
}

.chain-label {
  color: var(--faint);
  font-size: 8px;
}

.chain-value {
  margin-top: 1px;
  color: var(--text-2);
  font-size: 9.5px;
}

.chain-sub {
  margin-top: 1px;
  color: var(--faint);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.chain-arrow {
  flex: 0 0 13px;
  width: 13px;
  height: 13px;
  margin: 0 5px;
  color: #50534c;
}

.bitrate-chart-wrap {
  position: relative;
  height: 96px;
  padding: 0 1px;
}

#streamBitrateChart {
  display: block;
  width: 100%;
  height: 100%;
}

.url-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid var(--line-soft);
  background: #121411;
}

.url-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-btn {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  color: var(--text-2);
  font-size: 8.5px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #1a1c18;
}

.mini-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.mini-btn svg {
  width: 10px;
  height: 10px;
}

.quality-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9px;
}

.quality-table th {
  padding: 6px 8px;
  color: var(--faint);
  font-size: 8px;
  font-weight: 500;
  text-align: left;
  border-bottom: 1px solid var(--line);
  background: #1a1c19;
}

.quality-table td {
  padding: 6px 8px;
  color: var(--text-2);
  border-bottom: 1px solid var(--line-soft);
  font-variant-numeric: tabular-nums;
}

.quality-table tr:last-child td {
  border-bottom: 0;
}

.quality-ok {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--good);
}

.quality-ok .status-dot {
  width: 4px;
  height: 4px;
}

.region-dist {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.dist-row {
  display: grid;
  grid-template-columns: 46px minmax(30px, 1fr) 42px;
  align-items: center;
  gap: 8px;
  height: 23px;
  font-size: 8.5px;
}

.dist-label {
  color: var(--text-2);
  white-space: nowrap;
}

.dist-bar {
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(57, 135, 229, 0.13);
}

.dist-bar > i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--blue);
}

.dist-value {
  color: var(--faint);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* 全局搜索 */

.search-modal {
  position: relative;
  width: min(580px, 100%);
  overflow: hidden;
  opacity: 0;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: #181a16;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.62);
  transform: translateY(-8px);
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.layer.is-open .search-modal {
  opacity: 1;
  transform: translateY(0);
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}

.search-input-row > svg {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.search-input-row input {
  flex: 1;
  min-width: 0;
  padding: 0;
  color: var(--text);
  font-size: 12.5px;
  border: 0;
  outline: 0;
  background: transparent;
}

.search-input-row input::placeholder {
  color: var(--faint);
}

.search-results {
  max-height: min(54vh, 430px);
  padding: 5px 0;
  overflow-y: auto;
}

.search-group-title {
  padding: 7px 14px 4px;
  color: var(--faint);
  font-size: 8.5px;
  letter-spacing: 0.07em;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 14px;
  color: var(--text-2);
  text-align: left;
  border-left: 2px solid transparent;
}

.search-item:hover,
.search-item.is-active {
  background: #232520;
}

.search-item.is-active {
  border-left-color: var(--text);
}

.search-item-icon {
  display: inline-flex;
  flex: 0 0 25px;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #1a1c18;
}

.search-item-icon svg {
  width: 13px;
  height: 13px;
}

.search-item-main {
  flex: 1;
  min-width: 0;
}

.search-item-title {
  overflow: hidden;
  color: var(--text-2);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-item-meta {
  margin-top: 1px;
  overflow: hidden;
  color: #8b8e86;
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-item-tail {
  flex: 0 0 auto;
  color: #8b8e86;
  font-size: 8.5px;
}

.search-group + .search-group {
  margin-top: 2px;
  padding-top: 2px;
  border-top: 1px solid var(--line-soft);
}

.search-empty {
  padding: 42px 16px;
  color: var(--faint);
  font-size: 10.5px;
  text-align: center;
}

.search-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 34px;
  padding: 0 14px;
  color: var(--faint);
  font-size: 8.5px;
  border-top: 1px solid var(--line-soft);
  background: #161814;
}

.search-foot b {
  color: var(--muted);
  font-weight: 500;
}

.search-foot-brand {
  margin-left: auto;
  color: var(--faint);
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 130;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: min(340px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 9px;
  color: var(--text-2);
  font-size: 10px;
  pointer-events: auto;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: #1d1f1a;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.42);
  animation: toastIn 0.18s ease;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.toast-icon {
  display: inline-flex;
  flex: 0 0 16px;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.toast-icon svg {
  width: 13px;
  height: 13px;
}

.toast-success .toast-icon {
  color: var(--good);
}

.toast-warning .toast-icon {
  color: var(--warn);
}

.toast-danger .toast-icon {
  color: var(--crit);
}

.toast-message {
  flex: 1;
  line-height: 1.5;
}

.toast-close {
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.5;
}

.toast-close:hover {
  color: var(--text);
}

/* --------------------------------------------------------------------------
   可读性校准
   监控台的数据密度较高，统一将表格正文、注解和元信息提升一档，保证在
   1440 与 1920 视口下都能直接扫读。
   -------------------------------------------------------------------------- */

.page-title-row h1 {
  font-size: 24px;
}

.nav-item {
  font-size: 12.5px;
}

.nav-heading {
  font-size: 10px;
}

.env-line {
  font-size: 11px;
}

.sidebar-foot {
  font-size: 10px;
}

.crumbs {
  font-size: 11px;
}

.search-trigger {
  font-size: 11px;
}

.link-health {
  font-size: 10px;
}

.operator-copy strong {
  font-size: 11px;
}

.operator-copy small {
  font-size: 9px;
}

.page-sub {
  font-size: 11px;
}

.seg-btn {
  font-size: 11px;
}

.switch-field {
  font-size: 11px;
}

.btn {
  font-size: 11px;
}

.text-btn {
  font-size: 10px;
}

.panel-title {
  font-size: 13px;
}

.panel-note {
  font-size: 10px;
}

.sync-state {
  font-size: 10px;
}

.kpi-head {
  font-size: 11px;
}

.kpi-unit {
  font-size: 10.5px;
}

.delta {
  font-size: 10px;
}

.kpi-foot {
  font-size: 10px;
}

.tab {
  font-size: 11px;
}

.stage-label {
  font-size: 9px;
}

.stage-main {
  font-size: 10px;
}

.stage-main b {
  font-size: 12px;
}

.stage-sub {
  font-size: 9.5px;
}

.chart-legend {
  font-size: 10px;
}

.chart-summary {
  font-size: 9.5px;
}

.chart-tooltip {
  font-size: 10px;
}

.tooltip-time {
  font-size: 9.5px;
}

.chart-table {
  font-size: 10px;
}

.chart-table th {
  font-size: 9px;
}

.chart-table caption {
  font-size: 9.5px;
}

.avail-cap {
  font-size: 10px;
}

.avail-note {
  font-size: 9.5px;
}

.avail-rate {
  font-size: 9px;
}

.avail-rate b {
  font-size: 14px;
}

.matrix-head {
  font-size: 9px;
}

.matrix-head .mono {
  font-size: 8.5px;
}

.status-counts {
  font-size: 9px;
}

.subhead {
  font-size: 9px;
}

.region-row {
  font-size: 10px;
}

.region-count,
.region-pct {
  font-size: 9px;
}

.health-foot {
  font-size: 9px;
}

.health-foot .mono {
  font-size: 8.5px;
}

.data-table thead th {
  font-size: 9.5px;
}

.data-table tbody td {
  font-size: 11px;
}

.nodes-table tbody tr {
  height: 48px;
}

.streams-table tbody tr {
  height: 46px;
}

.node-name {
  font-size: 12px;
}

.node-ip {
  font-size: 9.5px;
}

.region-cell .r1 {
  font-size: 10.5px;
}

.region-cell .r2 {
  font-size: 9.5px;
}

.role-tag {
  font-size: 10px;
}

.stream-count {
  font-size: 10.5px;
}

.stream-count .sc-type {
  font-size: 9px;
}

.metric-num {
  font-size: 10.5px;
}

.bw-cell {
  font-size: 10.5px;
}

.status {
  font-size: 10px;
}

.row-action {
  font-size: 10px;
}

.table-footer {
  font-size: 9.5px;
}

.page-btn {
  font-size: 9.5px;
}

.th-unit {
  font-size: 8px;
}

.stream-name {
  font-size: 11.5px;
}

.stream-id {
  font-size: 9px;
}

.cell-main {
  font-size: 10.5px;
}

.cell-sub {
  font-size: 9.5px;
}

.node-ref {
  font-size: 10.5px;
}

.quality-main {
  font-size: 10.5px;
}

.quality-sub {
  font-size: 9.5px;
}

.viewer-count {
  font-size: 10.5px;
}

.duration {
  font-size: 9.5px;
}

.alert-count {
  font-size: 9px;
}

.alert-tab {
  font-size: 10px;
}

.alert-title {
  font-size: 11px;
}

.severity {
  font-size: 9px;
}

.alert-time {
  font-size: 9px;
}

.alert-desc {
  font-size: 9.5px;
}

.alert-meta {
  font-size: 9px;
}

.alert-meta .node-ref {
  font-size: 9px;
}

.ack-btn {
  font-size: 9px;
}

.acked {
  font-size: 9px;
}

.alert-empty {
  font-size: 10.5px;
}

.popover-head {
  font-size: 11px;
}

.pop-title {
  font-size: 11px;
}

.pop-meta {
  font-size: 9.5px;
}

.pop-empty {
  font-size: 10.5px;
}

.search-group-title {
  font-size: 9px;
}

.search-item-title {
  font-size: 11px;
}

.search-item-meta {
  font-size: 9px;
}

.search-item-tail {
  font-size: 9px;
}

.search-foot {
  font-size: 9px;
}

.drawer-meta {
  font-size: 9.5px;
}

.drawer-eyebrow {
  font-size: 9px;
}

.section-block h3 {
  font-size: 9.5px;
}

.drawer-metric-label {
  font-size: 9px;
}

.drawer-metric-value {
  font-size: 19px;
}

.core-caption {
  font-size: 8.5px;
}

.net-row {
  font-size: 9.5px;
}

.net-row .net-value {
  font-size: 9px;
}

.mini-stream-name {
  font-size: 10px;
}

.mini-stream-meta {
  font-size: 9px;
}

.info-pair dt {
  font-size: 8.5px;
}

.info-pair dd {
  font-size: 9.5px;
}

.event-row {
  font-size: 9.5px;
}

.event-time {
  font-size: 8.5px;
}

.detail-empty {
  font-size: 9.5px;
}

.modal-meta {
  font-size: 9px;
}

.stream-stat-label {
  font-size: 9px;
}

.stream-stat-value {
  font-size: 16px;
}

.stream-subhead {
  font-size: 9.5px;
}

.chain-label {
  font-size: 8.5px;
}

.chain-value {
  font-size: 10px;
}

.chain-sub {
  font-size: 8.5px;
}

.quality-table {
  font-size: 9.5px;
}

.quality-table th {
  font-size: 8.5px;
}

.dist-row {
  font-size: 9px;
}

.url-text {
  font-size: 9px;
}

.mini-btn {
  font-size: 9px;
}

.statusbar {
  font-size: 9px;
}

/* --------------------------------------------------------------------------
   动画
   -------------------------------------------------------------------------- */

@keyframes softPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(113, 183, 143, 0.26);
  }
  65%,
  100% {
    box-shadow: 0 0 0 4px rgba(113, 183, 143, 0);
  }
}

@keyframes livePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(225, 90, 80, 0.3);
  }
  70%,
  100% {
    box-shadow: 0 0 0 4px rgba(225, 90, 80, 0);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */

@media (max-width: 1440px) {
  .main {
    padding-right: 18px;
    padding-left: 18px;
  }

  .topbar {
    padding-right: 18px;
    padding-left: 18px;
  }

  .search-trigger {
    width: 238px;
  }
}

@media (max-width: 1320px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sparkline {
    display: none;
  }

  .link-health {
    display: none;
  }

  .status-center {
    display: none;
  }
}

@media (max-width: 1160px) {
  .split-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .health-panel {
    min-height: 340px;
  }

  .region-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 26px;
  }

  .region-row:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .bottom-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .alerts-panel {
    min-height: 0;
  }

  .alert-list {
    max-height: 360px;
  }
}

@media (max-width: 980px) {
  :root {
    --sidebar-w: 0px;
  }

  .shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    width: 232px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .menu-btn {
    display: inline-flex;
    flex: 0 0 30px;
  }

  .topbar {
    padding: 0 14px;
  }

  .main {
    padding: 16px 14px 24px;
  }

  .statusbar {
    left: 0;
  }

  .operator-copy {
    display: none;
  }

  .top-actions {
    gap: 8px;
  }

  .search-trigger {
    width: 30px;
    padding: 0;
    justify-content: center;
    background: transparent;
    border-color: transparent;
  }

  .search-trigger:hover {
    background: #1a1c18;
    border-color: var(--line);
  }

  .search-placeholder,
  .search-trigger kbd {
    display: none;
  }

  .crumbs {
    max-width: 46vw;
  }
}

@media (max-width: 760px) {
  .page-title-row h1 {
    font-size: 20px;
  }

  .page-controls {
    width: 100%;
    gap: 7px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi {
    padding: 10px 12px 11px;
  }

  .kpi-value {
    font-size: 24px;
  }

  .panel-head {
    flex-wrap: wrap;
    min-height: 40px;
    padding: 8px 12px;
    row-gap: 6px;
  }

  .chart-panel .panel-head {
    min-height: 44px;
  }

  .tabs {
    gap: 12px;
  }

  .tab {
    font-size: 10px;
  }

  .signal-strip {
    padding: 9px 12px;
  }

  .signal-stage {
    min-width: 96px;
  }

  .signal-connector {
    margin: 0 1px;
  }

  .chart-block {
    padding: 8px 12px 9px;
  }

  .chart-summary {
    gap: 6px;
    font-size: 8.5px;
  }

  .chart-wrap {
    height: 194px;
  }

  .data-table thead th {
    font-size: 10px;
  }

  .data-table tbody td {
    font-size: 12px;
  }

  .node-name {
    font-size: 12.5px;
  }

  .node-ip,
  .region-cell .r2 {
    font-size: 10px;
  }

  .table-panel-head {
    align-items: flex-start;
  }

  .table-tools {
    width: 100%;
  }

  .table-tools .segmented {
    flex: 1 1 auto;
  }

  .table-tools .seg-btn {
    flex: 1;
  }

  .search-box {
    flex: 1 1 160px;
    width: auto;
  }

  .table-footer {
    flex-wrap: wrap;
    gap: 6px;
  }

  .status-counts {
    gap: 5px 9px;
  }

  .statusbar {
    padding: 0 10px;
  }

  .copyright,
  .copyright-sep {
    display: none;
  }

  .status-center {
    display: none;
  }

  .modal-body {
    padding: 12px 14px 14px;
  }

  .modal-head {
    padding: 12px 14px 10px;
  }

  .modal-foot {
    padding: 9px 14px;
    flex-wrap: wrap;
  }

  .modal-foot .modal-foot-info {
    flex: 1 1 100%;
    margin-right: 0;
  }

  .layer--center {
    padding: 12px;
  }

  .modal {
    max-height: calc(100vh - 24px);
  }

  .layer--search {
    padding: 8vh 12px 12px;
  }

  .search-foot {
    gap: 10px;
    padding: 0 12px;
  }

  .search-foot-brand {
    display: none;
  }

  .popover {
    position: fixed;
    top: 52px;
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
  }
}

@media (max-width: 560px) {
  .main {
    padding: 14px 11px 20px;
  }

  .page-head {
    gap: 12px;
    margin-bottom: 13px;
  }

  .page-sub {
    font-size: 10px;
  }

  .page-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }

  .page-controls .segmented {
    flex: 1 1 100%;
    min-width: 0;
  }

  .page-controls .seg-btn {
    flex: 1;
    padding: 0 6px;
  }

  .switch-field {
    margin-right: auto;
    font-size: 10px;
  }

  .kpi-value {
    font-size: 23px;
  }

  .kpi-head {
    font-size: 9.5px;
  }

  .kpi-foot {
    font-size: 9px;
  }

  .avail-num {
    font-size: 26px;
  }

  .region-list {
    grid-template-columns: 1fr;
  }

  .region-row:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .chart-summary {
    display: none;
  }

  .chart-panel .panel-head {
    display: block;
    padding: 8px 12px 0;
  }

  .chart-panel .panel-head .panel-title-group {
    min-height: 23px;
    padding-bottom: 4px;
  }

  .chart-panel .tabs {
    display: flex;
    gap: 0;
    width: 100%;
    height: 31px;
    border-top: 1px solid var(--line-soft);
  }

  .chart-panel .tab {
    flex: 1;
    text-align: center;
  }

  .chart-toolbar {
    gap: 8px;
  }

  .chart-table-toggle {
    margin-left: auto;
  }

  .signal-strip {
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .signal-stage {
    scroll-snap-align: start;
  }

  .stream-stats {
    grid-template-columns: 1fr 1fr;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .chain-step {
    min-width: 96px;
  }

  .drawer {
    width: 100%;
  }

  .drawer-title-row h2 {
    font-size: 17px;
  }

  .toast-stack {
    right: 10px;
    bottom: 16px;
    width: calc(100vw - 20px);
  }

  .status-right .status-sep,
  .status-right > span:nth-child(2),
  .status-right > span:nth-child(3) {
    display: none;
  }
}

@media (max-width: 430px) {
  .kpi {
    padding: 9px 12px 10px;
  }

  .kpi-value-row {
    min-height: 28px;
  }

  .crumbs .crumb-sep,
  .crumbs > span:nth-child(1) {
    display: none;
  }

  .operator {
    display: none;
  }

  .live-badge {
    height: 18px;
    font-size: 8.5px;
  }

  .panel-title {
    font-size: 11.5px;
  }

  .chart-legend {
    gap: 10px;
    font-size: 9px;
  }

  .alert-meta {
    margin-left: 0;
  }

  .alert-desc {
    margin-left: 0;
  }

  .table-tools .seg-btn {
    padding: 0 6px;
    font-size: 9px;
  }

  .table-tools .seg-btn span {
    display: none;
  }

  .statusbar {
    font-size: 8px;
  }

  .statusbar .status-left > span:nth-child(2),
  .statusbar .status-sep {
    display: none;
  }
}

@media (max-width: 360px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
