/* 24/7 直播矩阵中控台 · 方案 B（Linear Command Deck 极简浅色规范） */
:root {
  --bg: #ffffff;
  --sidebar-bg: #f8f9fb;
  --surface-soft: #f2f4f6;
  --surface-hover: #f6f7f9;
  --surface-track: #eaedf0;
  --divider: #edeff2;
  --border: #e5e8ec;
  --border-strong: #d1d5db;

  --text: #191c1e;
  --text-secondary: #52565e;
  --text-muted: #7c818c;

  --primary: #111315;
  --primary-hover: #272a2e;
  --primary-fg: #ffffff;

  --live: #007a52;
  --live-dot: #00875a;
  --live-bg: rgba(108, 248, 187, 0.34);
  --live-bg-hover: rgba(108, 248, 187, 0.52);

  --warn-text: #92400e;
  --warn-bg: #fffbeb;
  --warn-border: #fde68a;

  --error-text: #991b1b;
  --error-bg: #fef2f2;
  --error-border: #fecaca;

  --sidebar-w: 220px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-xs: 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow-card: 0 8px 30px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-drawer: -12px 0 36px rgba(15, 23, 42, 0.08);
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.hidden { display: none !important; }
.tabular-nums { font-variant-numeric: tabular-nums; }

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 1px 6px;
  border-radius: 4px;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ==================== 登录页 ==================== */
.login-shell {
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.login-card {
  width: 100%;
  max-width: 396px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: var(--shadow-card);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.login-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.login-sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.sandbox-hint {
  margin-top: 18px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--sidebar-bg);
  border: 1px solid var(--divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ==================== 整体骨架（左侧 220px 边栏 + 纯白工作区） ==================== */
.app-shell {
  min-height: 100vh;
  background: var(--bg);
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 26px 14px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 30;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  color: var(--text);
}

.brand-svg {
  flex-shrink: 0;
  color: var(--text);
}

.sidebar-brand-name {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.sidebar-nav {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  appearance: none;
  border: 0;
  width: 100%;
  background: transparent;
  color: var(--text-secondary);
  padding: 9px 11px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.nav-item svg {
  flex-shrink: 0;
  opacity: 0.78;
}

.nav-item:hover {
  background: rgba(17, 24, 39, 0.04);
  color: var(--text);
}

.nav-item.active {
  background: var(--bg);
  color: var(--text);
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05), 0 0 0 1px rgba(17, 24, 39, 0.04);
}

.nav-item.active svg {
  opacity: 1;
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 2px;
}

.node-card {
  background: var(--bg);
  border: 1px solid var(--divider);
  border-radius: 10px;
  padding: 14px;
  box-shadow: var(--shadow-xs);
}

.node-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 12px;
}

.node-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  flex-shrink: 0;
  display: inline-block;
}

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

.status-dot-warn {
  background: #d97706;
}

.status-dot-error {
  background: #dc2626;
}

.status-dot-muted {
  background: #c5c9d0;
}

.node-metrics {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.node-metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.node-metric-num {
  color: var(--text);
  font-weight: 500;
}

.progress-track {
  width: 100%;
  height: 4px;
  background: var(--surface-track);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}

.progress-live { background: var(--live-dot); }
.progress-dark { background: var(--primary); }

.sidebar-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 8px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.account-meta {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 移动端顶部导航默认隐藏 */
.mobile-header {
  display: none;
}

/* ==================== 纯白主工作区 ==================== */
.workspace {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg);
}

.main-container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 44px 72px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

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

.page-subtitle {
  margin: 5px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.page-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ==================== 按钮体系 ==================== */
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  height: 36px;
  padding: 0 15px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, opacity 0.14s ease;
}

.btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-ghost {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-soft);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-danger-ghost {
  background: transparent;
  border-color: var(--error-border);
  color: var(--error-text);
}
.btn-danger-ghost:hover:not(:disabled) {
  background: var(--error-bg);
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.btn-full {
  width: 100%;
  height: 40px;
}

.btn-row-ghost {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease;
}
.btn-row-ghost:hover:not(:disabled) {
  background: var(--surface-soft);
  color: var(--text);
}
.btn-row-ghost:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-text-muted {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.14s ease;
}
.btn-text-muted:hover:not(:disabled) {
  color: var(--text);
}

.btn-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.14s ease, color 0.14s ease;
}
.icon-btn:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.btn-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* ==================== 无框 4 栏大号数字指标横条 ==================== */
.metrics-strip {
  margin: 34px 0 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.metric-cell {
  flex: 1 1 0;
  padding-right: 12px;
}

.metric-big {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--text);
  white-space: nowrap;
}

.metric-label {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.metric-divider {
  width: 1px;
  height: 40px;
  background: var(--divider);
  flex-shrink: 0;
}

/* ==================== 横向单行频道列表（方案 B 灵魂） ==================== */
.channel-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--divider);
}

.channel-row {
  display: grid;
  grid-template-columns: minmax(250px, 1.9fr) minmax(140px, 1.1fr) 120px 92px auto;
  align-items: center;
  gap: 18px;
  padding: 16px 10px;
  margin: 0 -10px;
  border-bottom: 1px solid var(--divider);
  border-radius: 10px;
  transition: background 0.14s ease;
}

.channel-row:hover {
  background: var(--surface-hover);
}

.ch-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.thumb-wrap {
  position: relative;
  width: 96px;
  height: 54px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.06);
}

.thumb-wrap.thumb-sm {
  width: 72px;
  height: 40px;
  border-radius: 6px;
}

.thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--surface-soft);
}

.ch-title-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

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

.ch-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.soft-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  white-space: nowrap;
}

.soft-tag-warn {
  background: var(--warn-bg);
  color: var(--warn-text);
  box-shadow: inset 0 0 0 1px var(--warn-border);
}

.soft-tag-ok {
  background: #ecfdf5;
  color: var(--live);
}

.soft-tag-err {
  background: var(--error-bg);
  color: var(--error-text);
}

.ch-track {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-bitrate {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}

.ch-bitrate.is-idle {
  color: var(--text-muted);
  font-weight: 400;
}

/* 三根微动态翠绿电平条 */
.eq-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.eq-bars span {
  width: 2px;
  background: var(--live-dot);
  border-radius: 999px;
  animation: eqPulse 0.9s ease-in-out infinite alternate;
}

.eq-bars span:nth-child(1) { height: 55%; animation-delay: 0s; }
.eq-bars span:nth-child(2) { height: 100%; animation-delay: 0.25s; }
.eq-bars span:nth-child(3) { height: 42%; animation-delay: 0.5s; }

@keyframes eqPulse {
  0% { height: 28%; }
  50% { height: 95%; }
  100% { height: 45%; }
}

.ch-uptime {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.ch-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.status-pill-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  margin-right: 4px;
  transition: background 0.14s ease, color 0.14s ease, opacity 0.14s ease;
}

.status-pill-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status-pill-btn.is-live {
  background: var(--live-bg);
  color: var(--live);
}
.status-pill-btn.is-live:hover:not(:disabled) {
  background: var(--live-bg-hover);
}

.status-pill-btn.is-idle {
  background: var(--surface-soft);
  color: var(--text);
}
.status-pill-btn.is-idle:hover:not(:disabled) {
  background: #e5e8ec;
}

.status-pill-btn.is-retrying {
  background: var(--warn-bg);
  color: var(--warn-text);
  box-shadow: inset 0 0 0 1px var(--warn-border);
}

/* ==================== 最近推流事件极简时间线 ==================== */
.events-section {
  margin-top: 44px;
}

.events-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.events-title {
  margin: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.events-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  word-break: break-word;
}

.event-line .status-dot {
  transform: translateY(-1px);
}

.event-time {
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ==================== 视频与曲库 ==================== */
.subtle-panel {
  margin-top: 24px;
  padding: 20px;
  background: var(--sidebar-bg);
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
}

.upload-grid {
  display: grid;
  grid-template-columns: 240px 1fr auto;
  gap: 14px;
  align-items: end;
}

.upload-actions {
  display: flex;
  gap: 8px;
}

.upload-progress {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.filter-bar {
  margin: 28px 0 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pill {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.filter-pill:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.filter-pill.active {
  background: var(--surface-soft);
  color: var(--text);
  border-color: var(--border);
}

.media-list,
.dryrun-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--divider);
}

.media-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.8fr) minmax(130px, 1.1fr) 90px 120px auto;
  align-items: center;
  gap: 16px;
  padding: 14px 10px;
  margin: 0 -10px;
  border-bottom: 1px solid var(--divider);
  border-radius: 8px;
  transition: background 0.14s ease;
}

.media-row:hover {
  background: var(--surface-hover);
}

.media-meta-text {
  font-size: 12.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-thumb {
  width: 72px;
  height: 40px;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ==================== 合成自检记录 ==================== */
.dryrun-list {
  margin-top: 28px;
}

.dryrun-row {
  display: grid;
  grid-template-columns: minmax(200px, 1.2fr) minmax(200px, 2fr) 130px auto;
  align-items: center;
  gap: 16px;
  padding: 15px 10px;
  margin: 0 -10px;
  border-bottom: 1px solid var(--divider);
  border-radius: 8px;
}

.dryrun-row:hover {
  background: var(--surface-hover);
}

.dryrun-summary {
  font-size: 12.5px;
  color: var(--text-secondary);
  word-break: break-word;
}

/* ==================== 企微告警设置 ==================== */
.settings-form {
  margin-top: 30px;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.settings-group {
  padding-bottom: 26px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-group-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
}

.settings-footer {
  display: flex;
  justify-content: flex-start;
}

/* ==================== 表单组件 ==================== */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}

.field input[type="text"],
.field input[type="password"],
.field input[type="url"],
.field input[type="file"],
.field select,
.field textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(17, 19, 21, 0.06);
}

.field input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.field-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.label-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.mix-box {
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--sidebar-bg);
  border: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.check-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 150px;
  overflow-y: auto;
}

.checks-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
}

.switch-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 400 !important;
  color: var(--text-secondary) !important;
  cursor: pointer;
}

.switch-row input[type="checkbox"] {
  margin-top: 2px;
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.info-note {
  padding: 11px 13px;
  border-radius: var(--radius-md);
  background: var(--sidebar-bg);
  border: 1px solid var(--divider);
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ==================== 告警条 / 三态 ==================== */
.alert-banner {
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.alert-error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
}

.alert-warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-text);
  margin: 6px 0 0;
}

.empty-state {
  padding: 56px 20px;
  text-align: center;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
}

.empty-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
}

.empty-desc {
  margin: 6px auto 18px;
  max-width: 380px;
  font-size: 13px;
  color: var(--text-muted);
}

/* 骨架屏加载 */
.skeleton-wrap {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.skeleton-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.skeleton-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.skeleton-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sk-block {
  background: linear-gradient(90deg, #f2f4f6 25%, #e9ecef 50%, #f2f4f6 75%);
  background-size: 200% 100%;
  border-radius: 8px;
  animation: shimmer 1.4s infinite linear;
}

.sk-title { width: 160px; height: 34px; }
.sk-btn { width: 112px; height: 36px; }
.sk-kpi { height: 58px; }
.sk-row { height: 74px; }

.loading-caption {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==================== 右侧白底滑出抽屉 ==================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(2px);
  z-index: 60;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100vw;
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-drawer);
  z-index: 70;
  display: flex;
  flex-direction: column;
}

.drawer-wide {
  width: 560px;
}

.drawer-head {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.drawer-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.drawer-sub {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 28px;
}

.drawer-footer {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.drawer-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.tele-item {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--sidebar-bg);
  border: 1px solid var(--divider);
}

.tele-k {
  font-size: 11px;
  color: var(--text-muted);
}

.tele-v {
  margin-top: 3px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logs-toolbar {
  margin: 16px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.logs-toolbar-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.logs-console {
  margin: 0;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--sidebar-bg);
  border: 1px solid var(--divider);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 55vh;
  overflow-y: auto;
}

/* ==================== 全局轻提示 Toast ==================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
  z-index: 90;
  text-align: center;
}

.toast.is-error {
  background: #b91c1c;
}

/* ==================== 窄屏响应式（严格保障 375px 零横向溢出） ==================== */
@media (max-width: 1060px) {
  .main-container {
    padding: 32px 24px 60px;
  }
  .channel-row {
    grid-template-columns: minmax(210px, 1.7fr) minmax(110px, 1fr) 108px auto;
  }
  .ch-uptime {
    display: none;
  }
}

@media (max-width: 920px) {
  .sidebar {
    display: none;
  }

  .mobile-header {
    display: block;
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--divider);
    padding: 12px 14px 10px;
  }

  .mobile-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
  }

  .mobile-header-top .sidebar-brand {
    padding: 0;
  }

  .mobile-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .mobile-node-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    color: var(--text-secondary);
    background: var(--surface-soft);
    padding: 2px 8px;
    border-radius: 999px;
  }

  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    background: var(--sidebar-bg);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid var(--divider);
  }

  .mobile-tab {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    padding: 6px 4px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-tab.active {
    background: var(--bg);
    color: var(--text);
    box-shadow: var(--shadow-xs);
  }

  .workspace {
    margin-left: 0;
  }

  .main-container {
    padding: 22px 14px 56px;
  }

  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .page-title {
    font-size: 22px;
  }

  .page-head-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .metrics-strip {
    margin: 22px 0 26px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 14px;
  }

  .metric-divider {
    display: none;
  }

  .metric-big {
    font-size: 24px;
  }

  .channel-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px 0;
    margin: 0;
    border-radius: 0;
  }

  .channel-row:hover {
    background: transparent;
  }

  .thumb-wrap {
    width: 80px;
    height: 45px;
  }

  .ch-uptime {
    display: block;
    font-size: 12px;
  }

  .ch-mobile-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
  }

  .ch-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    padding-top: 2px;
  }

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

  .media-row,
  .dryrun-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px 0;
    margin: 0;
  }

  .field-row-2 {
    grid-template-columns: 1fr;
  }

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

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

  .drawer,
  .drawer-wide {
    width: 100vw;
  }

  .drawer-head,
  .drawer-body {
    padding-left: 16px;
    padding-right: 16px;
  }
}
