:root {
  /* 对齐会议室预约系统：蓝白科技风 / Corporate Modern */
  --bg: #f5f8fc;
  --bg-elevated: #f3f3fe;
  --bg-card: #ffffff;
  --bg-hover: #e7e7f3;
  --border: #c3c6d7;
  --border-subtle: #e2e8f0;
  --border-accent: rgba(37, 99, 235, 0.35);
  --text: #191b23;
  --text-secondary: #434655;
  --text-muted: #737686;
  --accent: #2563eb;
  --accent-2: #004ac6;
  --accent-glow: rgba(37, 99, 235, 0.1);
  --on-accent: #eeefff;
  --warning: #92400e;
  --warning-bg: #fef3c7;
  --danger: #991b1b;
  --danger-bg: #fee2e2;
  --success: #065f46;
  --success-bg: #d1fae5;
  --info: #004c69;
  --info-bg: #c4e7ff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --font-mono: "SFMono-Regular", ui-monospace, Consolas, monospace;
}

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

/* .btn 等会设置 display，必须强制 hidden 生效，否则已登录仍露出「登录」按钮 */
[hidden] { display: none !important; }

.mode-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: transparent;
  white-space: nowrap;
  font-family: var(--font-mono);
}
.mode-chip.demo {
  color: var(--warning);
  border-color: transparent;
  background: var(--warning-bg);
}
.mode-chip.live {
  color: var(--success);
  border-color: transparent;
  background: var(--success-bg);
}
.mode-chip.error {
  color: var(--danger);
  border-color: transparent;
  background: var(--danger-bg);
}
.nav-section-label .mode-chip {
  margin-left: 6px;
  vertical-align: middle;
}
.sys-banner {
  margin: 0 24px 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--warning-bg);
  color: var(--warning);
  font-size: 13px;
  line-height: 1.5;
}
.sys-banner.error {
  background: var(--danger-bg);
  color: var(--danger);
}
.sys-banner.info {
  background: #dbe1ff;
  color: var(--accent-2);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before { content: none; }

.app {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
  z-index: 1;
}

.app.auth-locked {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  background: rgba(25, 27, 35, 0.45);
  backdrop-filter: blur(8px);
  padding: 24px;
}
.auth-gate[hidden] { display: none !important; }

/* 校验 / 跳转 / 退出回流：只挡页面，不展示登录卡片 */
.auth-gate[data-auth-state="pending"],
.auth-gate[data-auth-state="redirecting"],
.auth-gate[data-auth-state="logged-out"] {
  background: var(--bg);
  backdrop-filter: none;
}
.auth-gate[data-auth-state="pending"] .auth-gate-card,
.auth-gate[data-auth-state="redirecting"] .auth-gate-card,
.auth-gate[data-auth-state="logged-out"] .auth-gate-card {
  display: none !important;
}

.auth-gate-card {
  width: min(420px, 100%);
  padding: 28px 24px;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.auth-gate-brand {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
}
.auth-gate-card p {
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.6;
  margin-bottom: 18px;
}
.auth-gate-hint {
  margin: 14px 0 0 !important;
  font-size: 12px !important;
}
.auth-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 12px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.auth-user-name {
  font-size: 12.5px;
  color: var(--text);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ── Sidebar ── */
.sidebar {
  width: 256px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 14px;
  position: fixed;
  height: 100vh;
  z-index: 100;
  overflow: hidden;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 4px 6px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.logo-full {
  display: block;
  width: 100%;
  height: auto;
  max-height: 44px;
  object-fit: contain;
  object-position: left center;
}

.logo-mark {
  display: none;
  width: 40px;
  height: auto;
  object-fit: contain;
}

.logo-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #ffffff;
  box-shadow: var(--shadow);
}

.logo > div:last-child {
  min-width: 0;
  flex: 1;
}

.logo h1 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.15px;
  line-height: 1.25;
  white-space: nowrap;
}
.logo p { font-size: 10px; color: var(--text-muted); margin-top: 2px; letter-spacing: 0.5px; text-transform: uppercase; }

.nav-section-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  padding: 0 12px;
  margin-bottom: 6px;
}

.nav { display: flex; flex-direction: column; gap: 4px; margin-bottom: 18px; }

.nav-ext {
  margin: 0 8px 16px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 6px 8px 8px;
  background: rgba(148, 163, 184, 0.06);
}
.nav-ext > summary {
  cursor: pointer;
  list-style: none;
  font-size: 11px;
  color: var(--text-muted);
  padding: 6px 8px;
  user-select: none;
}
.nav-ext > summary::-webkit-details-marker { display: none; }
.nav-ext > summary::before { content: "▸ "; color: var(--text-muted); }
.nav-ext[open] > summary::before { content: "▾ "; }
.nav-ext-list { margin-bottom: 0; }
.nav-ext-list .nav-item { opacity: 0.9; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border: none; background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 13px; font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: left;
}

.nav-svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }

.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item:hover .nav-svg { opacity: 1; }

.nav-item.active {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  box-shadow: none;
}
.nav-item.active .nav-svg { opacity: 1; stroke: currentColor; }

.sidebar-footer {
  margin-top: auto;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: #e1e2ed;
  border-radius: 12px;
  border-top: none;
  font-size: 12px;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.online {
  background: #10b981;
  box-shadow: none;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
  text-decoration: none;
}

/* ── Main ── */
.main {
  flex: 1;
  margin-left: 256px;
  width: calc(100% - 256px);
  max-width: none;
  min-width: 0;
  padding: 24px clamp(20px, 2.4vw, 40px) 40px;
  box-sizing: border-box;
}

.header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 28px;
}

.header h2 { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }
.header p { color: var(--text-muted); font-size: 13.5px; margin-top: 4px; }

.header-actions { display: flex; align-items: center; gap: 12px; }

.page { display: none; animation: fadeIn 0.3s ease; }
.page.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: none;
}
.btn-primary:hover { background: var(--accent-2); }

.btn-ghost {
  background: var(--bg-card);
  color: var(--accent);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); border-color: var(--accent); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid #fecaca;
  padding: 5px 12px; font-size: 12px;
}
.btn-danger:hover { background: var(--danger-bg); }

.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ── Toolbar ── */
.toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px; flex-wrap: wrap;
}

.pill-group {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.pill {
  padding: 7px 16px;
  border: none; background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 13px; font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.pill.active { background: var(--accent); color: var(--on-accent); font-weight: 600; box-shadow: none; }
.pill:hover:not(.active) { color: var(--text); background: var(--bg-hover); }

.select {
  padding: 9px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
  outline: none;
}
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-box {
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex: 1; min-width: 200px; max-width: 320px;
}
.search-box svg { color: var(--text-muted); flex-shrink: 0; }
.search-box input {
  flex: 1; border: none; background: transparent;
  color: var(--text); font-family: var(--font); font-size: 13px;
  padding: 9px 0; outline: none;
}
.search-box input::placeholder { color: var(--text-muted); }

.view-toggle {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}
.view-btn {
  width: 34px; height: 34px;
  border: none; background: transparent;
  color: var(--text-muted);
  border-radius: 7px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.view-btn.active { background: var(--accent-glow); color: var(--accent); }

/* ── KPI Cards ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.kpi-grid.compact { grid-template-columns: repeat(5, 1fr); }

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.kpi-card:hover { border-color: var(--border); box-shadow: var(--shadow-lg); }
.kpi-card::after { content: none; }

.kpi-label { font-size: 12px; color: var(--text-muted); font-weight: 400; margin-bottom: 8px; }
.kpi-value { font-size: 26px; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; font-family: var(--font-mono); line-height: 1; }
.kpi-unit { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.kpi-delta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 500;
  margin-top: 8px;
  padding: 0;
  border-radius: 0;
  background: transparent;
}
.kpi-delta.up { color: var(--danger); background: transparent; }
.kpi-delta.down { color: var(--accent); background: transparent; }
.kpi-delta.neutral { color: var(--text-muted); background: transparent; }

.kpi-icon {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.5;
}

/* ── Insight bar ── */
.insight-bar {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.insight-bar strong { color: var(--text); font-weight: 500; }

/* ── Panels ── */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.panel-head h3 { font-size: 14px; font-weight: 600; }
.panel-tag { font-size: 11px; color: var(--text-muted); background: transparent; padding: 0; border-radius: 0; font-family: var(--font-mono); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }

.section-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
}
.metering-section .panel-head { align-items: flex-start; }
.metering-section-desc {
  margin: -4px 0 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.metering-demo-head {
  margin: 8px 0 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}
.metering-demo-head p:last-child {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.metering-foot-hint,
.metering-empty {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.metering-empty { padding: 12px 0; }
.data-table td.table-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 20px;
}
.kpi-card small {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 2px;
}

.chart-panel { min-height: 0; }
.chart-wrap { position: relative; height: 260px; }
.chart-wrap.sm { height: 200px; }

.live-dot {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 500; color: var(--text-muted);
  letter-spacing: 0;
  font-family: var(--font-mono);
  text-transform: none;
}
.pulse {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: none;
}
@keyframes pulse { from, to { opacity: 1; } }

/* Peak stats */
.peak-stats { display: flex; gap: 12px; margin-bottom: 12px; }
.peak-stat {
  flex: 1;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  text-align: center;
}
.peak-stat .val { font-size: 20px; font-weight: 700; color: var(--accent); }
.peak-stat .lbl { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Ranking */
.ranking-list { display: flex; flex-direction: column; gap: 8px; }

.rank-item {
  display: grid;
  grid-template-columns: 32px 1fr 120px 80px;
  align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.rank-item:hover { background: #f1f5f9; }

.rank-num {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: var(--bg-card);
  color: var(--text-muted);
}
.rank-item:nth-child(1) .rank-num { background: linear-gradient(135deg, #ffd700, #ffaa00); color: #060a12; }
.rank-item:nth-child(2) .rank-num { background: linear-gradient(135deg, #c0c0c0, #a0a0a0); color: #060a12; }
.rank-item:nth-child(3) .rank-num { background: linear-gradient(135deg, #cd7f32, #a0522d); color: #fff; }

.rank-info .name { font-size: 13.5px; font-weight: 600; }
.rank-info .meta { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

.rank-bar-wrap { height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.rank-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 3px; transition: width 0.6s ease; }

.rank-kwh { text-align: right; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }

/* ── Device / Meter Cards ── */
.device-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin: 0 0 16px;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.device-legend strong { color: var(--text); font-weight: 600; margin-right: 4px; }
.device-legend em {
  font-style: normal;
  font-weight: 600;
  color: var(--accent-2);
}

.device-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: auto;
  max-height: calc(100vh - 280px);
}
.device-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
}
.device-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.device-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  vertical-align: middle;
}
.device-table tbody tr:hover td {
  background: rgba(59, 99, 232, 0.04);
}
.device-table td.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.device-table td.num .unit {
  color: var(--text-muted);
  font-size: 11px;
  margin-left: 2px;
}
.device-name-link {
  border: none;
  background: none;
  padding: 0;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.device-name-link:hover { color: var(--accent); }
.device-row-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
}
.device-row-actions {
  white-space: nowrap;
  text-align: right;
}
.device-row.offline { opacity: 0.75; }

.device-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.device-empty {
  grid-column: 1 / -1;
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.meter-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 18px 18px 14px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.meter-card:hover {
  border-color: #b4c5ff;
  box-shadow: var(--shadow-lg);
}
.meter-card.offline { opacity: 0.78; }
.meter-card.warning { border-color: #fcd34d; }

.meter-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.meter-card__title-wrap { min-width: 0; flex: 1; }
.meter-card__title {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  color: var(--text);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meter-card__meta {
  margin: 6px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.meter-card__sn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.01em;
}

.meter-card__hero {
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8faff 0%, #eef2ff 100%);
  border: 1px solid #dbe1ff;
}
.meter-card__hero-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.meter-card__hero-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.meter-card__hero-value .num {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--accent-2);
  line-height: 1.1;
}
.meter-card__hero-value .unit {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.meter-card__hero-note {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.meter-card__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.meter-stat {
  padding: 12px 12px 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  min-width: 0;
}
.meter-stat__label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.meter-stat__value {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.15;
}
.meter-stat__unit {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.meter-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid #eef2f7;
}
.meter-card__type {
  font-size: 12px;
  color: var(--text-muted);
}
.meter-card__actions-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.meter-card__menu {
  position: relative;
  flex-shrink: 0;
}
.meter-card__gear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.meter-card__gear:hover,
.meter-card__menu.is-open .meter-card__gear {
  color: var(--primary, #2563eb);
  border-color: #bfdbfe;
  background: #eff6ff;
}
/* 表计监视器弹窗：一屏 HUD，禁止滚动 */
.meter-monitor-overlay {
  background: rgba(8, 16, 28, 0.72);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.meter-monitor {
  width: min(980px, 96vw);
  max-height: min(92vh, 680px);
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.45));
}
.meter-monitor__bezel {
  border-radius: 18px;
  padding: 10px;
  background:
    linear-gradient(160deg, #2a3548 0%, #151c28 42%, #0d131c 100%);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -2px 8px rgba(0, 0, 0, 0.35);
}
.meter-monitor__chrome {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 6px 8px;
  color: #94a3b8;
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 650;
}
.meter-monitor__led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 10px #34d399;
  animation: mm-pulse 1.6s ease-in-out infinite;
}
.meter-monitor__brand { flex: 1; }
.meter-monitor__clock {
  font-variant-numeric: tabular-nums;
  color: #7dd3fc;
}
.meter-monitor__close {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.meter-monitor__close:hover {
  border-color: #38bdf8;
  color: #7dd3fc;
}
.meter-monitor__screen {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) 118px auto;
  gap: 8px;
  height: min(88vh, 640px);
  padding: 12px 12px 10px;
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 10% 0%, rgba(56, 189, 248, 0.12), transparent 55%),
    radial-gradient(90% 70% at 100% 100%, rgba(37, 99, 235, 0.16), transparent 50%),
    linear-gradient(180deg, #0b1624 0%, #071018 100%);
  border: 1px solid rgba(56, 189, 248, 0.22);
  color: #e2e8f0;
}
.meter-monitor__main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) 1.18fr;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}
.meter-monitor__stage {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.28);
  background:
    radial-gradient(circle at 50% 30%, rgba(14, 165, 233, 0.16), transparent 55%),
    #050b14;
}
.meter-3d-host {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  height: 100%;
  padding: 10px 8px 4px;
}
.meter-3d-host--dd862 {
  background:
    radial-gradient(circle at 50% 40%, rgba(56, 189, 248, 0.14), transparent 55%),
    linear-gradient(180deg, #0a1524 0%, #050b14 100%);
}

/* DD862 机电式电表示意（静止壳体，字轮/铝盘动） */
.dd862 {
  position: relative;
  width: min(100%, 248px);
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45));
}
.dd862__ear {
  width: 42%;
  height: 12px;
  margin: 0 auto;
  background: linear-gradient(180deg, #2a2a2a, #111);
  border: 1px solid #0a0a0a;
}
.dd862__ear--top {
  border-radius: 6px 6px 0 0;
  border-bottom: 0;
}
.dd862__ear--bottom {
  border-radius: 0 0 6px 6px;
  border-top: 0;
}
.dd862__body {
  position: relative;
  padding: 10px 10px 12px;
  border-radius: 10px;
  background:
    linear-gradient(160deg, #3a3a3a 0%, #1a1a1a 40%, #0d0d0d 100%);
  border: 1px solid #050505;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.dd862__glass {
  padding: 7px;
  border-radius: 6px;
  background: linear-gradient(180deg, #1f2933, #0b1220);
  border: 1px solid #4b5563;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.dd862__face {
  padding: 8px 8px 7px;
  border-radius: 3px;
  background: linear-gradient(180deg, #f7f7f2 0%, #e8e6dc 100%);
  color: #111;
  text-align: center;
}
.dd862__unit {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.dd862__scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: 2px;
  font-size: 8px;
  color: #444;
}
.dd862__wheels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  margin-top: 2px;
  padding: 3px;
  background: #111;
  border-radius: 2px;
}
.dd862__wheel {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  background: #0a0a0a;
  color: #f8fafc;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border-radius: 1px;
}
.dd862__wheel--dec {
  background: #b91c1c;
  color: #fff;
}
.dd862__meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding: 0 2px;
  font-size: 10px;
  color: #333;
}
.dd862__meta-row strong {
  color: #1d4ed8;
  letter-spacing: 0.02em;
}
.dd862__disc-slot {
  position: relative;
  height: 16px;
  margin: 7px 14px 4px;
  border-radius: 2px;
  background: #111;
  overflow: hidden;
  border: 1px solid #333;
}
/* 窗缝里只看铝盘边缘：银底 + 黑标水平匀速掠过（不要整圆旋转，避免射线感） */
.dd862__disc-band {
  position: absolute;
  inset: 2px 18px;
  border-radius: 1px;
  background-color: #b7b7b7;
  background-image: linear-gradient(
    90deg,
    #b7b7b7 0 78px,
    #1a1a1a 78px 92px,
    #b7b7b7 92px 170px
  );
  background-size: 170px 100%;
  background-repeat: repeat-x;
  background-position: 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.dd862__disc-band.is-spin {
  animation: dd862-band-scroll var(--disc-dur, 3s) linear infinite;
}
.dd862__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 8px;
  color: #2563eb;
  font-weight: 700;
  z-index: 1;
  pointer-events: none;
}
.dd862__arrow--l { left: 4px; }
.dd862__arrow--r { right: 4px; }
.dd862__spec {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 650;
  color: #222;
}
.dd862__ratings {
  margin-top: 2px;
  font-size: 9px;
  color: #444;
  letter-spacing: 0.01em;
}
.dd862__live {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 6px;
  padding: 4px 5px;
  border-radius: 3px;
  background: #0f172a;
  color: #e2e8f0;
}
.dd862__live div {
  display: flex;
  align-items: baseline;
  gap: 3px;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.dd862__live em {
  font-style: normal;
  font-size: 9px;
  color: #38bdf8;
}
.dd862__live b {
  font-size: 12px;
  font-weight: 700;
  color: #7dd3fc;
}
.dd862__live i {
  font-style: normal;
  font-size: 8px;
  color: #64748b;
}
.dd862__sn {
  margin-top: 5px;
  font-size: 9px;
  color: #334155;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dd862__seal {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fbbf24, #b45309 70%);
  box-shadow: 0 0 0 1px #78350f;
}
.dd862__seal--tl { top: 14px; left: 14px; }
.dd862__seal--br { right: 14px; bottom: 14px; }
@keyframes dd862-band-scroll {
  from { background-position: 0 0; }
  to { background-position: -170px 0; }
}

.meter-stage-caption {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 5px 8px;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #64748b;
  background: rgba(2, 8, 18, 0.72);
  border-top: 1px solid rgba(56, 189, 248, 0.15);
}
.meter-monitor__fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.meter-monitor__scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.03) 0 1px,
    transparent 1px 3px
  );
  opacity: 0.35;
  mix-blend-mode: soft-light;
}
.meter-monitor__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, #000 35%, transparent 85%);
}
.meter-monitor__chart-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 4px;
  min-height: 0;
  padding: 6px 8px 4px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  background: rgba(8, 18, 32, 0.72);
}
.meter-monitor__chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #cbd5e1;
}
.meter-monitor__chart-head small {
  font-weight: 500;
  color: #64748b;
}
.meter-monitor__chart-wrap {
  position: relative;
  min-height: 0;
  height: 100%;
}
.meter-monitor__chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}
.meter-monitor__chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-size: 12px;
  color: #64748b;
}
.meter-monitor__head,
.meter-monitor__body,
.meter-monitor__foot {
  position: relative;
  z-index: 1;
}
.meter-monitor__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.18);
}
.meter-monitor__eyebrow {
  margin: 0 0 2px;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: #38bdf8;
  font-weight: 700;
}
.meter-monitor__title-block h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.02em;
}
.meter-monitor__sub {
  margin: 4px 0 0;
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 52vw;
}
.meter-monitor__head-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.meter-monitor__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(6, 78, 59, 0.45);
  color: #6ee7b7;
}
.meter-monitor__pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.meter-monitor__pill--offline,
.meter-monitor__pill--warning {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(120, 53, 15, 0.4);
  color: #fcd34d;
}
.meter-monitor__stream {
  display: inline-flex;
  gap: 4px;
}
.meter-monitor__stream i {
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: #38bdf8;
  opacity: 0.25;
  animation: mm-stream 1s ease-in-out infinite;
}
.meter-monitor__stream i:nth-child(2) { animation-delay: 0.12s; height: 16px; }
.meter-monitor__stream i:nth-child(3) { animation-delay: 0.24s; height: 10px; }
.meter-monitor__stream i:nth-child(4) { animation-delay: 0.36s; height: 14px; }

.meter-monitor__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}
.mm-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  padding: 8px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.14);
}
.mm-panel--live {
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: inset 0 0 24px rgba(56, 189, 248, 0.08);
}
.mm-panel__tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #cbd5e1;
}
.mm-panel__tag span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 16px;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  font-size: 10px;
}
.mm-panel__grid {
  display: grid;
  gap: 5px;
  flex: 1;
  min-height: 0;
}
.mm-panel__grid--3 { grid-template-columns: repeat(3, 1fr); }
.mm-panel__grid--4 { grid-template-columns: repeat(2, 1fr); }
.mm-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 5px 7px;
  border-radius: 7px;
  background: rgba(2, 8, 18, 0.45);
  border: 1px solid rgba(71, 85, 105, 0.35);
}
.mm-cell--accent {
  border-color: rgba(56, 189, 248, 0.4);
  background: linear-gradient(180deg, rgba(14, 116, 144, 0.22), rgba(2, 8, 18, 0.5));
}
.mm-cell em {
  font-style: normal;
  font-size: 10px;
  color: #64748b;
  letter-spacing: 0.02em;
}
.mm-cell b {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mm-cell--accent b { color: #7dd3fc; }
.mm-cell i {
  font-style: normal;
  font-size: 10px;
  color: #64748b;
}
.meter-monitor__foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid rgba(56, 189, 248, 0.14);
  font-size: 10px;
  color: #64748b;
}
.meter-monitor__foot #meter-detail-path {
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meter-monitor__hint { color: #38bdf8; letter-spacing: 0.04em; }

@keyframes mm-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
@keyframes mm-stream {
  0%, 100% { opacity: 0.2; transform: scaleY(0.7); }
  50% { opacity: 1; transform: scaleY(1); }
}

@media (max-width: 860px) {
  .meter-monitor__main {
    grid-template-columns: 0.9fr 1.1fr;
  }
  .mm-panel__grid--3 { grid-template-columns: repeat(2, 1fr); }
  .meter-monitor__sub { max-width: 48vw; }
}
@media (max-width: 640px) {
  .meter-monitor__main {
    grid-template-columns: 1fr;
    grid-template-rows: 0.9fr 1.2fr;
  }
  .meter-monitor__body {
    grid-template-columns: 1fr 1fr;
  }
  .meter-monitor__screen { height: min(90vh, 700px); }
  .meter-lcd { top: 10%; width: min(70%, 200px); }
}
.meter-card__popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 20;
  min-width: 112px;
  padding: 4px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}
.meter-card__popover-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #0f172a;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.meter-card__popover-item:hover { background: #f1f5f9; }
.meter-card__popover-danger { color: var(--danger, #dc2626); }
.meter-card__popover-danger:hover { background: var(--danger-bg, #fef2f2); }
.meter-card__danger { color: var(--danger) !important; border-color: #fecaca !important; }
.meter-card__danger:hover { background: var(--danger-bg) !important; }

.kpi-value.accent { color: var(--accent-2); }

.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
}
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.status-badge.online { background: var(--success-bg); color: var(--success); }
.status-badge.online::before { background: #10b981; }
.status-badge.idle { background: #eef2ff; color: var(--accent-2); }
.status-badge.idle::before { background: #6366f1; }
.status-badge.warning { background: var(--warning-bg); color: var(--warning); }
.status-badge.warning::before { background: #f59e0b; }
.status-badge.offline { background: var(--danger-bg); color: var(--danger); }
.status-badge.offline::before { background: #ef4444; }

/* legacy hooks kept for other pages */
.device-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.device-type-tag { font-size: 10.5px; font-weight: 600; padding: 3px 9px; border-radius: 6px; background: var(--accent-glow); color: var(--accent); }
.device-card-actions { display: flex; gap: 8px; }

/* ── Table ── */
.table-panel { overflow-x: auto; }
.hidden { display: none !important; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 10px 14px;
  font-size: 11px; color: var(--text-muted);
  font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border);
}
.data-table td { padding: 13px 14px; font-size: 13.5px; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: var(--bg-hover); }

.load-bar-inline {
  display: flex; align-items: center; gap: 8px;
}
.load-bar-inline .bar { flex: 1; height: 5px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.load-bar-inline .bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 3px; }
.load-bar-inline .pct { font-size: 12px; font-weight: 600; min-width: 36px; text-align: right; }

/* ── Realtime cards（浅色面板，轻动效，不做成孪生深色块） ── */
.realtime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: 10px;
}

.rt-card {
  --rt-accent: #147A66;
  --rt-accent-soft: #E6F6F1;
  --rt-delay: 0ms;
  position: relative;
  padding: 12px 12px 11px;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  opacity: 0;
  transform: translateY(6px);
  animation: rt-enter 0.45s ease-out var(--rt-delay) forwards;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.rt-card::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--rt-accent);
  opacity: 0.85;
}
.rt-card:hover {
  border-color: #C7DDD5;
  box-shadow: 0 6px 18px rgba(20, 122, 102, 0.08);
}
.rt-card.water {
  --rt-accent: #0284C7;
  --rt-accent-soft: #E0F2FE;
}
.rt-card__top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding-left: 4px;
}
.rt-card__kind {
  font-size: 10px;
  font-weight: 700;
  color: var(--rt-accent);
  background: var(--rt-accent-soft);
  border-radius: 999px;
  padding: 2px 8px;
}
.rt-card__role {
  font-size: 10px;
  color: #64748B;
  background: #F1F5F9;
  border-radius: 999px;
  padding: 2px 7px;
}
.rt-card__signal {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  color: #147A66;
}
.rt-card__signal i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
}
.rt-card__signal.is-on i {
  animation: rt-pulse 1.8s ease-out infinite;
}
.rt-card__signal.is-off {
  color: #94A3B8;
}
.rt-card__signal.is-off i {
  background: #94A3B8;
  animation: none;
}
@keyframes rt-pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
@keyframes rt-enter {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes rt-bar {
  from { width: 0; }
  to { width: calc(var(--rt-pct, 0) * 1%); }
}
@keyframes rt-sheen {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.9; }
}
.rt-card__name,
.rt-card .name {
  margin: 0 0 10px;
  padding-left: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #191B23;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}
.rt-card .type {
  font-size: 11px;
  color: #64748B;
  margin-bottom: 4px;
}
.rt-card__readout {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  padding-left: 4px;
}
.rt-card__label {
  font-size: 11px;
  color: #737686;
}
.rt-card__value {
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.rt-card__value .num,
.rt-card .power {
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--rt-accent);
  line-height: 1;
}
.rt-card.is-live .rt-card__value .num {
  animation: rt-sheen 2.8s ease-in-out infinite;
}
.rt-card__value .unit,
.rt-card .power small {
  font-size: 11px;
  font-weight: 600;
  color: #94A3B8;
}
.rt-card__meter {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding-left: 4px;
}
.rt-card__meter-track {
  height: 5px;
  border-radius: 999px;
  background: #EEF2F7;
  overflow: hidden;
}
.rt-card__meter-track i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--rt-accent) 35%, white), var(--rt-accent));
  animation: rt-bar 0.7s ease-out calc(var(--rt-delay) + 120ms) forwards;
}
.rt-card__meter > span {
  font-size: 10px;
  color: #94A3B8;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rt-card.is-offline {
  opacity: 0.72;
  background: #F8FAFC;
}
.rt-card.is-offline .rt-card__value .num {
  color: #94A3B8;
  animation: none;
}
.rt-empty {
  grid-column: 1 / -1;
  padding: 28px 12px;
  text-align: center;
  color: #94A3B8;
  font-size: 13px;
  background: #F8FAFC;
  border: 1px dashed #E2E8F0;
  border-radius: 10px;
}
@media (prefers-reduced-motion: reduce) {
  .rt-card,
  .rt-card__meter-track i,
  .rt-card.is-live .rt-card__value .num,
  .rt-card__signal.is-on i {
    animation: none !important;
  }
  .rt-card {
    opacity: 1;
    transform: none;
  }
  .rt-card__meter-track i {
    width: calc(var(--rt-pct, 0) * 1%);
  }
}

/* ── Alerts compact ── */
.alerts-compact { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; }

.alert-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
}
.alert-row.high { border-left-color: var(--danger); }
.alert-row.medium { border-left-color: var(--warning); }
.alert-row.low { border-left-color: var(--info); }

.alert-row .msg { flex: 1; font-size: 13px; color: var(--text-secondary); }
.alert-row .time { font-size: 11px; color: var(--text-muted); white-space: nowrap; font-family: var(--font-mono); }

.badge-inline {
  background: transparent;
  color: var(--text-muted);
  font-size: 11px; font-weight: 500;
  padding: 0;
  border-radius: 0;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ── Modal ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(25, 27, 35, 0.4);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 28px 30px;
  width: 520px; max-width: 92vw;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { opacity:0; transform: scale(0.96) translateY(8px); } }

.modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 22px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; color: var(--text-muted); font-weight: 500; margin-bottom: 6px; }
.form-group input, .form-group select {
  width: 100%; padding: 10px 14px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font); font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  outline: none;
}

.status-picker { display: flex; gap: 10px; }
.status-option {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.status-option input { display: none; }
.status-option:has(input:checked) { border-color: var(--border-accent); background: var(--accent-glow); }
.status-option .dot { width: 8px; height: 8px; border-radius: 50%; }
.status-option .dot.online { background: var(--accent); }
.status-option .dot.warning { background: var(--warning); }
.status-option .dot.offline { background: var(--danger); }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ── Space analytics layout ── */
.analytics-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  align-items: start;
}

.analytics-toolbar { margin-bottom: 14px; }
.analytics-trend { margin-bottom: 16px; }
.analytics-split .ranking-list { max-height: 320px; overflow-y: auto; }
.analytics-hint,
.analytics-empty {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}
.analytics-balance.is-empty {
  padding: 12px 16px;
  background: transparent;
  box-shadow: none;
  border-style: dashed;
}
.analytics-balance-empty {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.analytics-balance-empty .muted {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}
.kpi-card--hero .kpi-value { color: var(--accent-2, #004ac6); }

.space-panel { position: sticky; top: 20px; }
.space-tree { display: flex; flex-direction: column; gap: 2px; max-height: 70vh; overflow-y: auto; }

.space-node {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  background: transparent;
  font-family: var(--font);
  text-align: left;
  width: 100%;
}
.space-node:hover { background: var(--bg-hover); color: var(--text); }
.space-node.active { background: var(--accent-glow); color: var(--accent); font-weight: 600; box-shadow: inset 0 0 0 1px var(--border-accent); }
.space-node .indent { flex-shrink: 0; color: var(--border); font-size: 10px; }
.space-node .level-tag {
  font-size: 9px; padding: 1px 5px; border-radius: 4px;
  background: var(--bg-hover); color: var(--text-muted); margin-left: auto;
}

.breadcrumb {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: 16px; font-size: 13px;
}
.breadcrumb-item {
  color: var(--text-muted); cursor: pointer; transition: color 0.15s;
}
.breadcrumb-item:hover { color: var(--accent); }
.breadcrumb-item.active { color: var(--text); font-weight: 600; cursor: default; }
.breadcrumb-sep { color: var(--text-muted); opacity: 0.4; }

.meter-tag {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 5px;
  letter-spacing: 0.3px;
}
.meter-tag.master { background: #dbe1ff; color: var(--accent-2); }
.meter-tag.sub { background: #f1f5f9; color: var(--text-secondary); }

.balance-list { display: flex; flex-direction: column; gap: 12px; }
.balance-card {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.balance-card.warning { border-color: rgba(245,166,35,0.35); }
.balance-card.attention { border-color: rgba(77,159,255,0.25); }

.balance-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.balance-head .title { font-size: 14px; font-weight: 600; }
.balance-status {
  font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px;
}
.balance-status.normal { background: var(--accent-glow); color: var(--accent); }
.balance-status.attention { background: rgba(77,159,255,0.12); color: var(--info); }
.balance-status.warning { background: rgba(245,166,35,0.12); color: var(--warning); }

.balance-bars { display: flex; flex-direction: column; gap: 8px; }
.balance-row { display: grid; grid-template-columns: 80px 1fr 100px; align-items: center; gap: 10px; font-size: 12.5px; }
.balance-row .label { color: var(--text-muted); }
.balance-row .val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.balance-bar { height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.balance-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.balance-bar-fill.master { background: linear-gradient(90deg, var(--info), #6eb5ff); }
.balance-bar-fill.sub { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.balance-diff {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-muted);
}
.balance-diff strong { color: var(--warning); }

.balance-subs {
  margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px;
}
.balance-sub-chip {
  font-size: 11px; padding: 3px 8px; border-radius: 6px;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-muted);
}


/* ── 3.2 计量架构（空间关系 + 状态） ── */
.arch-toolbar {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 16px;
  align-items: flex-end; margin-bottom: 14px;
}
.arch-toolbar-left { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.arch-toolbar-right { display: flex; gap: 10px; align-items: center; color: var(--text-muted); font-size: 12px; }
.arch-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); }
.arch-field select {
  min-width: 200px; height: 36px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-card); color: var(--text); font-family: var(--font);
}
.arch-sync { font-variant-numeric: tabular-nums; }
.arch-mode-badge {
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--warning-bg); color: var(--warning);
}
#page-metering.is-demo .arch-main { outline: 2px dashed rgba(146, 64, 14, 0.35); outline-offset: 4px; border-radius: var(--radius); }

.arch-kpi {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px;
}
.arch-kpi-card {
  display: flex; align-items: flex-start; gap: 12px; text-align: left; cursor: pointer;
  min-height: 96px;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
  font-family: var(--font); color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.arch-kpi-card:hover { border-color: var(--border-accent); box-shadow: var(--shadow-lg); }
.arch-kpi-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.arch-kpi-icon {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: #eff4ff; color: var(--accent); font-size: 12px; flex: 0 0 auto;
}
.arch-kpi-icon.is-online { background: var(--success-bg, #ecfdf5); color: var(--success); }
.arch-kpi-icon.is-offline { background: var(--danger-bg, #fef2f2); color: var(--danger); }
.arch-kpi-icon.is-pending { background: #fff7ed; color: #c2410c; }
.arch-kpi-card.is-online .kpi-value { color: var(--success); }
.arch-kpi-card.is-offline .kpi-value { color: var(--danger); }
.arch-kpi-card.is-pending .kpi-value { color: #c2410c; }
.arch-kpi-card .kpi-unit { line-height: 1.35; }

.arch-main {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px; margin-bottom: 16px; align-items: stretch;
}
.arch-graph-panel,
.arch-detail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: auto;
  min-width: 0;
}
.arch-detail {
  min-height: 420px;
  max-height: min(72vh, 760px);
  background:
    linear-gradient(180deg, #f8fbff 0%, #ffffff 56px);
}
.arch-graph-panel > .panel-head,
.arch-detail > .panel-head,
.arch-graph-note,
.arch-hint { flex: 0 0 auto; }
.arch-graph-tools { display: flex; gap: 8px; }
.arch-search {
  width: min(220px, 40vw); height: 34px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-card); font-family: var(--font); font-size: 13px;
}
.arch-graph-note, .arch-hint {
  margin: 0 0 12px; font-size: 12px; color: var(--text-muted); line-height: 1.5;
}
.arch-graph {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(72vh, 760px);
  background:
    linear-gradient(rgba(37,99,235,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,0.045) 1px, transparent 1px),
    #f3f6fb;
  background-size: 24px 24px, 24px 24px, auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  overflow: auto;
}
.arch-graph.is-compact { min-height: 0; }
.arch-relation {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 36px;
  min-width: 0;
  padding: 6px 2px;
}
.arch-relation.is-single {
  justify-content: center;
  min-height: 0;
  gap: 40px;
}
.arch-connector-svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; overflow: visible; z-index: 0;
}
.arch-connector-svg path {
  fill: none; stroke: #93c5fd; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.arch-connector-svg path.is-candidate-line {
  stroke: #fdba74; stroke-dasharray: 5 4;
}
.arch-trunk, .arch-branches { position: relative; z-index: 1; }
.arch-trunk { flex: 0 0 auto; display: flex; align-items: center; }
.arch-trunk-card {
  width: 168px; padding: 12px 12px 10px;
  background: linear-gradient(160deg, #1d4ed8 0%, #2563eb 55%, #3b82f6 100%);
  color: #fff; border: none; border-radius: 12px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.24);
  cursor: pointer; text-align: left;
}
.arch-trunk-card:focus-visible { outline: 3px solid rgba(255,255,255,0.9); outline-offset: 3px; }
.arch-trunk-card.is-selected { outline: 3px solid rgba(255,255,255,0.85); outline-offset: 3px; }
.arch-trunk-top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.arch-trunk-icon {
  width: 28px; height: 28px; border-radius: 8px; flex: 0 0 auto;
  background: rgba(255,255,255,0.18);
  position: relative;
}
.arch-trunk-icon::before,
.arch-trunk-icon::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  background: rgba(255,255,255,0.92); border-radius: 1px;
}
.arch-trunk-icon::before { top: 7px; width: 14px; height: 12px; }
.arch-trunk-icon::after { bottom: 6px; width: 8px; height: 5px; }
.arch-trunk-kicker { margin: 0 0 2px; font-size: 11px; opacity: 0.8; }
.arch-trunk-card strong {
  display: block; font-size: 14px; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 112px;
}
.arch-trunk-count { font-size: 12px; margin-bottom: 6px; opacity: 0.95; }
.arch-trunk-count b { font-size: 18px; font-variant-numeric: tabular-nums; margin-right: 4px; }
.arch-trunk-stats {
  display: flex; flex-wrap: wrap; gap: 8px 12px; font-size: 12px; opacity: 0.95;
}
.arch-trunk-stats .ok { color: #bbf7d0; }
.arch-trunk-stats .bad { color: #fecaca; }
.arch-trunk-stats .muted { color: rgba(255,255,255,0.82); }
.arch-branches {
  flex: 0 1 auto;
  width: min(248px, 100%);
  max-width: 248px;
  display: flex; flex-direction: column; gap: 10px; justify-content: center;
}
.arch-branch { display: flex; flex-direction: column; gap: 8px; }
.arch-branch-card {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; max-width: 248px;
  padding: 10px 11px;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 10px; box-shadow: var(--shadow); cursor: pointer;
}
.arch-branch-card:hover { border-color: var(--border); }
.arch-branch-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.arch-branch-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.arch-branch-card.is-candidate,
.arch-branch-card.is-unassigned {
  border-style: dashed; border-color: #fdba74; background: #fff7ed;
}
.arch-candidate-section {
  display: flex; flex-direction: column; gap: 12px;
}
.arch-candidate-section-label {
  margin: 2px 0 0; font-size: 11px; line-height: 1.4;
  color: #c2410c; letter-spacing: 0.02em;
}
.arch-candidates-more {
  align-self: stretch;
  margin-top: 2px;
  padding: 8px 12px;
  border: 1px dashed #fdba74;
  border-radius: 10px;
  background: #fffbeb;
  color: #c2410c;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.arch-candidates-more:hover { background: #fff7ed; }
.arch-candidates-more:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.arch-candidate-badge {
  display: inline-block; align-self: flex-start;
  margin-top: 2px; padding: 1px 6px; border-radius: 999px;
  background: #ffedd5; color: #9a3412; font-size: 11px; line-height: 1.4;
}
.arch-branch-head { display: flex; align-items: flex-start; gap: 8px; min-width: 0; flex: 1; }
.arch-branch-icon {
  width: 22px; height: 22px; flex: 0 0 22px; color: var(--text-muted);
  font-size: 12px; line-height: 22px; text-align: center;
}
.arch-text-action {
  flex: 0 0 auto; border: none; background: transparent; cursor: pointer;
  color: var(--accent); font-size: 12px; font-weight: 600; padding: 4px 2px;
  font-family: var(--font); white-space: nowrap;
}
.arch-text-action:hover { text-decoration: underline; }
.arch-text-action:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.arch-branch-children {
  margin-left: 18px; padding-left: 12px;
  border-left: 2px solid #dbe4f5;
  display: flex; flex-direction: column; gap: 8px;
}
.arch-node-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.arch-node-main strong {
  font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.arch-node-meta { font-size: 12px; color: var(--text-muted); }
.arch-node-meta b { color: var(--text); font-variant-numeric: tabular-nums; }
.arch-toggle, .arch-toggle-spacer {
  width: 22px; height: 22px; flex: 0 0 22px; border: none; background: transparent;
  color: var(--text-muted); cursor: pointer; font-size: 14px; line-height: 22px; padding: 0;
}
.arch-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.arch-empty { color: var(--text-muted); font-size: 13px; padding: 24px 8px; text-align: center; }

.arch-detail { position: static; }
.arch-detail > .panel-head {
  margin-bottom: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.arch-detail #arch-detail-title {
  font-size: 17px;
  line-height: 1.35;
  max-width: 100%;
}
.arch-detail-empty {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--text-muted); font-size: 13px; padding: 36px 16px; text-align: center;
  background:
    radial-gradient(circle at 50% 40%, rgba(37,99,235,0.06), transparent 55%);
  border-radius: 12px;
}
.arch-detail-empty::before {
  content: "▢";
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: #eff6ff; color: #2563eb; font-size: 16px;
}
#arch-detail-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.arch-detail-path {
  font-size: 12px; color: var(--text-muted); margin: 8px 0 12px;
  padding: 6px 10px; border-radius: 8px; background: #f1f5f9;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.arch-detail-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px; margin-bottom: 14px;
}
.arch-stat-chip {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px; border-radius: 10px;
  background: #f8fafc; border: 1px solid #e2e8f0;
  min-width: 0;
}
.arch-stat-chip em {
  font-style: normal; font-size: 11px; color: var(--text-muted);
}
.arch-stat-chip b {
  font-size: 18px; font-variant-numeric: tabular-nums; color: var(--text);
  line-height: 1.2;
}
.arch-stat-chip.is-online { background: #f0fdf4; border-color: #bbf7d0; }
.arch-stat-chip.is-online b { color: #15803d; }
.arch-stat-chip.is-offline { background: #fef2f2; border-color: #fecaca; }
.arch-stat-chip.is-offline b { color: #b91c1c; }
.arch-stat-chip.is-warn { background: #fff7ed; border-color: #fed7aa; }
.arch-stat-chip.is-warn b { color: #c2410c; }
.arch-detail-list-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 10px; font-size: 13px; flex: 0 0 auto;
}
.arch-detail-list-head strong {
  font-size: 13px; color: var(--text);
}
.arch-detail-list-head span { color: var(--text-muted); font-size: 12px; }
.arch-detail-list {
  display: flex; flex-direction: column; gap: 8px;
  flex: 1 1 auto; min-height: 0; max-height: none;
  overflow: auto; margin-bottom: 12px;
  padding-right: 2px;
}
.arch-detail-actions {
  display: flex; flex-wrap: wrap; gap: 8px; flex: 0 0 auto; margin-top: auto;
  padding-top: 10px; border-top: 1px solid var(--border-subtle);
}
.arch-meter-row {
  position: relative;
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center;
  padding: 12px 12px 12px 14px;
  border: 1px solid #e8eef6;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.arch-meter-row::before {
  content: "";
  position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px;
  border-radius: 0 3px 3px 0;
  background: #94a3b8;
}
.arch-meter-row.is-online::before { background: #22c55e; }
.arch-meter-row.is-offline::before { background: #ef4444; }
.arch-meter-row.is-warning::before { background: #f59e0b; }
.arch-meter-row:hover {
  border-color: #cbd5e1;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}
.arch-meter-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.arch-meter-row strong {
  display: block; font-size: 13.5px; font-weight: 600; color: #0f172a;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.arch-meter-meta {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.arch-meter-meta > span {
  font-size: 11px; color: #64748b;
  padding: 1px 7px; border-radius: 999px; background: #f1f5f9;
}
.arch-meter-row .status-badge {
  justify-self: end;
}
.arch-meter-view {
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1d4ed8;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.arch-meter-view:hover { background: #dbeafe; }
.arch-meter-view:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.arch-id-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.arch-issue-grid { margin-top: 4px; }
.arch-issue-bar {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
}
.arch-issue-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}
.arch-issue-item.is-alert { background: #fef2f2; border-color: #fecaca; }
.arch-issue-item.is-warn { background: #fff7ed; border-color: #fed7aa; }
.arch-issue-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.arch-issue-value { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.arch-issue-item p { font-size: 11px; color: var(--text-secondary); line-height: 1.4; margin: 4px 0 0; max-width: 220px; }
.arch-issue-drawer { margin-top: 12px; }
.arch-assign-panel { margin-top: 12px; }

.arch-topo-panel { margin: 12px 0 16px; }
.arch-topo-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.arch-field-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.arch-field-inline span {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.arch-field-inline select,
.arch-field-inline input {
  min-height: 32px;
}
.arch-topo-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.2fr);
  gap: 14px;
  align-items: start;
}
@media (max-width: 1100px) {
  .arch-topo-layout { grid-template-columns: 1fr; }
}
.arch-meter-tree {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: #f8fafc;
  padding: 12px;
  max-height: 520px;
  overflow: auto;
}
.arch-mt-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--text-muted);
}
.arch-mt-roots,
.arch-mt-children {
  list-style: none;
  margin: 0;
  padding: 0;
}
.arch-mt-children {
  margin-left: 14px;
  padding-left: 10px;
  border-left: 1px dashed #cbd5e1;
}
.arch-mt-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 6px 4px;
}
.arch-mt-name {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.arch-mt-name:hover { color: var(--accent); }
.arch-mt-meta {
  font-size: 11px;
  color: var(--text-muted);
}
.arch-mt-orphans {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.arch-mt-orphans > p {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.arch-topo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.arch-import-panel { margin-top: 12px; }
.arch-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.arch-import-text {
  width: 100%;
  min-height: 180px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
  background: #fff;
  color: var(--text);
}
.arch-topo-card {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}
.arch-topo-card.is-warning { border-color: #fca5a5; background: #fff7f7; }
.arch-topo-card.is-attention { border-color: #fcd34d; background: #fffbeb; }
.arch-topo-card.is-normal { border-color: #86efac; }
.arch-topo-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.arch-topo-card header strong {
  display: block;
  font-size: 14px;
}
.arch-topo-card header p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}
.arch-topo-badge {
  flex-shrink: 0;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-hover);
  color: var(--text-muted);
}
.arch-topo-card.is-warning .arch-topo-badge { background: #fee2e2; color: #b91c1c; }
.arch-topo-card.is-attention .arch-topo-badge { background: #fef3c7; color: #b45309; }
.arch-topo-card.is-normal .arch-topo-badge { background: #dcfce7; color: #15803d; }
.arch-topo-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.arch-topo-metrics div {
  background: #f8fafc;
  border-radius: 8px;
  padding: 8px 10px;
}
.arch-topo-metrics em {
  display: block;
  font-style: normal;
  font-size: 11px;
  color: var(--text-muted);
}
.arch-topo-metrics b {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.arch-topo-metrics i {
  font-style: normal;
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 4px;
}
.arch-topo-note {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}
.arch-topo-subs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.arch-topo-subs li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  padding: 4px 0;
  border-top: 1px dashed var(--border-subtle);
}
.arch-topo-subs li.muted { color: var(--text-muted); justify-content: flex-start; }

.arch-relation-panel { margin-top: 12px; }
.arch-relation-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  margin: 12px 0;
}
.arch-relation-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) minmax(120px, 0.7fr) minmax(180px, 1fr);
  gap: 10px;
  align-items: end;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: #fff;
}
.arch-relation-main strong { font-size: 13px; }
@media (max-width: 900px) {
  .arch-relation-row { grid-template-columns: 1fr; }
}
.arch-assign-filters,
.arch-issue-drawer .arch-assign-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(110px, 0.7fr) minmax(130px, 0.8fr);
  gap: 8px;
  margin-bottom: 10px;
}
.arch-filter-input,
.arch-assign-filters select,
.arch-issue-drawer .arch-assign-filters select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
}
.arch-filter-input:focus,
.arch-assign-filters select:focus {
  outline: 2px solid var(--accent-glow);
  border-color: var(--accent);
}
.arch-issue-filter-meta {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.arch-assign-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.arch-assign-list {
  display: flex; flex-direction: column; gap: 8px; max-height: min(42vh, 360px); overflow: auto;
  margin-bottom: 14px; padding: 4px;
}
.arch-hint-tag.is-muted {
  background: #f1f5f9;
  color: #64748b;
}
.arch-assign-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  background: var(--bg-elevated); cursor: pointer;
}
.arch-assign-row strong { display: block; font-size: 13px; }
.arch-assign-row small { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.arch-hint-tag {
  display: inline-block; margin-top: 4px; padding: 1px 6px; border-radius: 999px;
  background: #fff7ed; color: #c2410c; font-size: 11px;
}
.arch-assign-form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end;
}
.arch-assign-form .arch-field input {
  height: 36px; padding: 0 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-family: var(--font);
}
.arch-assign-actions {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end;
}
.status-badge.unknown { background: var(--bg-hover); color: var(--text-muted); }
.status-badge.warning { background: #fff7ed; color: #c2410c; }

@media (max-width: 1100px) {
  .arch-main { grid-template-columns: 1fr; }
  .arch-graph-panel,
  .arch-detail { min-height: 0; height: auto; max-height: none; }
  .arch-graph { min-height: 0; max-height: 480px; }
  .arch-detail-list { max-height: 320px; }
  .arch-detail-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .arch-assign-filters,
  .arch-issue-drawer .arch-assign-filters { grid-template-columns: 1fr; }
  .arch-kpi { grid-template-columns: repeat(2, 1fr); }
  .arch-relation,
  .arch-relation.is-single {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 14px;
    min-height: 0;
  }
  .arch-connector-svg { display: none; }
  .arch-trunk-card,
  .arch-branches,
  .arch-branch-card { width: 100%; max-width: none; }
  .arch-issue-bar { grid-template-columns: 1fr; }
  .arch-assign-form { grid-template-columns: 1fr; }
}

/* ── 3.2b 计量其它 ── */
.data-table-wrap { overflow-x: auto; }
.data-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.data-table th {
  text-align: left; padding: 10px 14px; color: var(--text-muted);
  font-weight: 600; font-size: 12px; letter-spacing: 0;
  text-transform: none;
  border-bottom: 1px solid var(--border-subtle);
}
.data-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--border-subtle);
  font-variant-numeric: tabular-nums;
}
.data-table tbody tr:hover { background: var(--bg-elevated); }
.data-table .actions { display: flex; gap: 6px; }

.metering-floor-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px;
}
.floor-meter-card {
  display: flex; flex-direction: column; gap: 6px;
  min-height: 92px; padding: 14px;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.floor-meter-card.covered { border-color: var(--border-accent); }
.floor-meter-card.missing {
  background: var(--bg-elevated);
  border-style: dashed;
  box-shadow: none;
}
.floor-meter-card .floor-name { font-size: 14px; font-weight: 600; color: var(--text); }
.floor-meter-card .meter-status { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

.metering-household-list { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.hh-meter-row {
  display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center;
  padding: 12px 14px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-size: 13px;
  box-shadow: var(--shadow);
}
.hh-meter-row .hh-info { font-weight: 600; color: var(--text); }
.hh-meter-row .hh-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.hh-chip {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--bg-elevated); border: none; color: var(--text-secondary);
}
.hh-chip.ac { background: var(--info-bg); color: var(--info); }
.hh-chip.light { background: var(--warning-bg); color: var(--warning); }
.scope-tag {
  font-size: 11px; padding: 3px 10px; border-radius: 999px;
  background: var(--accent-glow); color: var(--accent-2); font-weight: 500;
}

.alert-page-intro {
  margin: 0 0 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--info) 8%, var(--bg-card));
  border: 1px solid color-mix(in srgb, var(--info) 22%, var(--border));
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}
.alert-page-intro strong { color: var(--text); font-weight: 600; }
.alert-guide-panel .panel-head { align-items: flex-start; }
.alert-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 4px 0 14px;
}
.alert-compare-card {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-hover);
}
.alert-compare-card.is-this {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  background: color-mix(in srgb, var(--accent) 7%, var(--bg-card));
}
.alert-compare-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text);
}
.alert-compare-card p {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.alert-compare-card p:last-child { margin-bottom: 0; }
.alert-compare-card em { font-style: normal; color: var(--text); font-weight: 600; }
.alert-compare-card .muted { color: var(--text-muted); font-size: 12px; }
.alert-howto {
  margin: 0 0 14px;
  padding: 12px 16px 12px 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated, var(--bg-hover));
  border: 1px dashed var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.65;
}
.alert-howto li + li { margin-top: 4px; }
.alert-howto b { color: var(--text); }
.alert-guide-status {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  border-left: 3px solid var(--accent);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.alert-guide-status b { color: var(--text); }
.alert-guide-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px 16px;
  align-items: end;
  margin-bottom: 10px;
}
.alert-guide-form .arch-field span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.alert-guide-form .arch-field input {
  width: 100%;
  max-width: 160px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
}
.alert-guide-form .arch-field em {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.alert-guide-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 2px;
}
@media (max-width: 960px) {
  .alert-compare { grid-template-columns: 1fr; }
  .alert-guide-form { grid-template-columns: 1fr; }
  .alert-guide-form .arch-field input { max-width: none; }
}

.threshold-list { display: flex; flex-direction: column; gap: 10px; }
.threshold-card {
  background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.threshold-card.exceeded { border-color: rgba(255,92,92,0.4); }
.threshold-card.warning { border-color: rgba(245,166,35,0.35); }
.threshold-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.threshold-head .name { font-weight: 600; font-size: 14px; }
.threshold-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.threshold-bar { height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
.threshold-bar-fill { height: 100%; border-radius: 3px; transition: width 0.4s; }
.threshold-bar-fill.normal { background: var(--accent); }
.threshold-bar-fill.warning { background: var(--warning); }
.threshold-bar-fill.exceeded { background: var(--danger); }
.threshold-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); }

.alert-full-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.alert-full-row {
  padding: 12px 14px; background: var(--bg-hover); border-radius: var(--radius-sm);
  border-left: 3px solid var(--border); font-size: 13px;
}
.alert-full-row.high { border-left-color: var(--danger); }
.alert-full-row.medium { border-left-color: var(--warning); }
.alert-full-row.low { border-left-color: var(--info); }
.alert-full-row .alert-actions { margin-top: 8px; display: flex; gap: 6px; }

.pricing-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.pricing-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; position: relative;
}
.pricing-card.disabled { opacity: 0.55; }
.pricing-card .price {
  font-size: 28px; font-weight: 700; color: var(--accent); margin: 8px 0;
  font-variant-numeric: tabular-nums;
}
.pricing-card .price small { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.pricing-card .meta { font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.pricing-card .card-actions { margin-top: 12px; display: flex; gap: 6px; }

.status-pill {
  font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 20px;
  letter-spacing: 0.3px; text-transform: uppercase;
}
.status-pill.normal { background: var(--accent-glow); color: var(--accent); }
.status-pill.warning { background: rgba(245,166,35,0.12); color: var(--warning); }
.status-pill.exceeded { background: var(--danger-bg); color: var(--danger); }
.status-pill.generated { background: rgba(77,159,255,0.12); color: var(--info); }
.status-pill.synced { background: var(--accent-glow); color: var(--accent); }
.status-pill.draft { background: var(--bg-hover); color: var(--text-muted); }

.load-tag { font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.load-tag.ac { background: rgba(77,159,255,0.15); color: var(--info); }
.load-tag.lighting { background: rgba(245,166,35,0.15); color: var(--warning); }
.load-tag.socket { background: rgba(52,211,153,0.15); color: #059669; }
.load-tag.muted { background: var(--bg-hover); color: var(--text-muted); }
.load-tag.total { background: var(--bg-hover); color: var(--text-muted); }

/* ── Responsive ── */
@media (min-width: 1600px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
  .kpi-grid.compact { grid-template-columns: repeat(5, 1fr); }
  .realtime-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

@media (min-width: 1920px) {
  .main { padding: 32px clamp(28px, 3vw, 56px) 48px; }
  .realtime-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
}

@media (max-width: 1200px) {
  .analytics-layout { grid-template-columns: 1fr; }
  .space-panel { position: static; }
  .space-tree { max-height: 200px; flex-direction: row; flex-wrap: wrap; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid.compact { grid-template-columns: repeat(3, 1fr); }
  .grid-2, .grid-2-1, .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { width: 64px; padding: 16px 8px; }
  .sidebar .logo-full, .nav-section-label, .nav-item span:not(.nav-svg),
  .system-switch-text, .system-switch-caret,
  .myems-toolbar-hint, .myems-url { display: none; }
  .sidebar .logo-mark { display: block; margin: 0 auto; }
  .nav-item { justify-content: center; padding: 12px; }
  .system-switch-btn { justify-content: center; padding: 10px; }
  .main {
    margin-left: 64px;
    width: calc(100% - 64px);
    padding: 16px;
  }
  .kpi-grid, .kpi-grid.compact { grid-template-columns: 1fr; }
  .rank-item { grid-template-columns: 28px 1fr 60px; }
  .rank-bar-wrap { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .realtime-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* 产品入口：/energy · /carbon · / 门户（同一套前端） */
.product-portal {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(37, 99, 235, 0.12), transparent 55%),
    radial-gradient(900px 500px at 90% 110%, rgba(20, 122, 102, 0.12), transparent 50%),
    var(--bg);
}
.product-portal__card {
  width: min(560px, 100%);
  padding: 36px 32px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.product-portal__kicker {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.product-portal__card h1 {
  margin: 0 0 10px;
  font-size: 26px;
  color: var(--text);
  letter-spacing: -0.02em;
}
.product-portal__desc {
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.product-portal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.product-portal__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 650;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.product-portal__btn img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex: 0 0 auto;
}
.product-portal__btn.is-energy {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}
.product-portal__btn.is-carbon {
  background: #147A66;
  color: #fff;
  box-shadow: 0 8px 20px rgba(20, 122, 102, 0.25);
}
.product-portal__btn:hover { transform: translateY(-1px); }
.product-portal__foot {
  margin: 18px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}
.product-portal__foot code {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-elevated);
}
@media (max-width: 560px) {
  .product-portal__actions { grid-template-columns: 1fr; }
}
body.product-carbon .sidebar {
  border-right-color: #C5D9D0;
}
