/* AMesh 云平台 Web — Crystal Neumo · Desktop SaaS (login-aligned) */
:root {
  --bg: #e8ecf4;
  --bg-warm: #fff8f0;
  --surface: #f0f4fa;
  --card: linear-gradient(180deg, #e8f0fc, #ffffff);
  --hero-tint: linear-gradient(145deg, #ff9a5c22, #2563eb11);
  --text: #1e293b;
  --muted: #64748b;
  --label: #475569;
  --section: #94a3b8;
  --primary: #2563eb;
  --primary-grad: linear-gradient(145deg, #4a90d9, #2563eb);
  --primary-glow: #2563eb44;
  --brand: #ff6a00;
  --brand-glow: #ff6b3544;
  --ok: #059669;
  --err: #dc2626;
  --shadow-out: 8px 8px 18px #c5cdd8, -6px -6px 16px #ffffff;
  --shadow-out-lg: 14px 14px 32px #c5cdd899, -10px -10px 28px #ffffff;
  --shadow-in: inset 4px 4px 10px #c5cdd8, inset -3px -3px 8px #ffffff;
  --shadow-shell: 20px 20px 60px #c5cdd8, -12px -12px 40px #ffffff;
  --glass-edge: inset -1px 0 0 #ffffff88;
  --radius-card: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --sidebar-w: 248px;
  --topbar-h: 68px;
}

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

body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── SaaS shell (same ambient canvas as login) ── */
.saas-body {
  overflow: hidden;
  background: radial-gradient(ellipse at 28% 12%, #fff8f0 0%, var(--bg) 48%, #e2e8f2 100%);
}

.saas-app {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  background:
    var(--hero-tint),
    linear-gradient(180deg, #f2f6fc 0%, #e8edf5 55%, #e2e8f0 100%);
  box-shadow: 8px 0 32px #c5cdd855, var(--glass-edge);
  z-index: 20;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid #d8e0ec;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(145deg, #ff9a5c, #ff6b35);
  box-shadow: 4px 4px 12px #ff6b3544;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--ds-fs-body);
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.04em;
}

.brand-title {
  font-size: var(--ds-fs-h3);
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.04em;
}

.brand-sub {
  font-size: var(--ds-fs-body);
  color: var(--muted);
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px;
  scrollbar-width: thin;
  scrollbar-color: #c5cdd8 transparent;
}

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

.nav-group-label {
  font-size: var(--ds-fs-body);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--section);
  padding: 4px 10px 8px;
}

/* 每个菜单项 = 白净底，选中蓝紫底 */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: none;
  font: inherit;
  font-size: var(--ds-fs-body);
  color: var(--label);
  padding: 8px 10px 8px 8px;
  border-radius: 14px;
  cursor: pointer;
  margin-bottom: 7px;
  background: #ffffff;
  box-shadow: 0 1px 3px #c5cdd844;
  transition:
    transform 0.14s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    color 0.14s ease;
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 0;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #6366f1, #4f46e5);
  transform: translateY(-50%);
  transition: height 0.16s ease;
  pointer-events: none;
}

.nav-ico {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 11px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--ds-fs-title);
  line-height: 1;
  transition: transform 0.14s ease, background 0.16s ease;
}
.nav-ico svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary, #475569);
  flex-shrink: 0;
}
.nav-item.active .nav-ico svg {
  color: #fff;
}
.nav-item:hover .nav-ico svg {
  color: #fff;
}

/* ── SVG 面性图标统一样式 ── */
.stat-ico svg,
.bk-guard-ico svg,
.sensor-card-icon svg,
.sensor-tab-icon svg,
.gov-tab-icon svg,
.grp-legend-item svg,
.ico-emoji svg,
.bs-kpi-icon svg,
.ds-empty-icon svg,
.gov-freeze-empty-ico svg,
.gov-showcase-hero-ico svg,
.gov-freeze-time svg,
.spc-tree-ico svg,
.spc-detail-empty-ico svg,
.sensor-empty-icon svg,
.scene-pkg-icon svg,
.pw-ico svg,
.grp-gw-card-ico svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
  flex-shrink: 0;
}

.stat-ico svg { font-size: 16px; color: var(--text-secondary, #475569); }
.stat-card.brand .stat-ico svg { color: #fff; }
.stat-card.ok .stat-ico svg { color: #fff; }
.stat-card.warn .stat-ico svg { color: #fff; }

.bk-guard-ico svg { font-size: 20px; color: var(--primary, #4f46e5); }

.sensor-card-icon svg { font-size: 24px; color: var(--primary, #4f46e5); }
.sensor-tab-icon svg { font-size: 18px; color: var(--text-secondary, #475569); }
.sensor-tab.active .sensor-tab-icon svg { color: var(--primary, #4f46e5); }

.gov-tab-icon svg { font-size: 18px; color: var(--text-secondary, #475569); }

.grp-legend-item svg { font-size: var(--ds-fs-body); color: var(--text-secondary, #475569); }
.ico-emoji svg { font-size: inherit; }

.bs-kpi-icon svg { font-size: 28px; color: #fff; }
.ds-empty-icon svg { font-size: 32px; color: var(--text-secondary, #94a3b8); }
.gov-freeze-empty-ico svg { font-size: 32px; color: var(--text-secondary, #94a3b8); }
.gov-showcase-hero-ico svg { font-size: 48px; color: var(--primary, #4f46e5); }

.spc-tree-ico svg { font-size: var(--ds-fs-body); color: var(--text-secondary, #475569); }
.spc-detail-empty-ico svg { font-size: 48px; color: var(--text-secondary, #94a3b8); }
.sensor-empty-icon svg { font-size: 32px; color: var(--text-secondary, #94a3b8); }
.scene-pkg-icon svg { font-size: 16px; color: var(--primary, #4f46e5); }
.pw-ico svg { font-size: 16px; color: #f59e0b; }
.grp-gw-card-ico svg { font-size: 28px; color: var(--primary, #4f46e5); }

.nav-label {
  flex: 1;
  line-height: 1.35;
  font-weight: 600;
}

/* 悬浮：蓝紫底 + 白字 + 白图标 */
.nav-item:hover {
  transform: translateX(4px) translateY(-1px);
  color: #fff;
  background: linear-gradient(145deg, #6366f1, #4f46e5);
  box-shadow: 0 4px 14px #4f46e544;
}

.nav-item:hover .nav-ico {
  transform: scale(1.08);
  background: transparent;
}

/* 点击：按下凹陷 */
.nav-item:active {
  transform: translateX(2px) scale(0.985);
  box-shadow: var(--shadow-in);
  transition-duration: 0.05s;
}

.nav-item:active .nav-ico {
  transform: scale(0.94);
}

/* 选中：蓝紫底 + 白字 + 白图标 */
.nav-item.active {
  background: linear-gradient(145deg, #6366f1, #4f46e5);
  box-shadow: 0 4px 14px #4f46e544;
  color: #fff;
}

.nav-item.active::before {
  height: 58%;
  background: linear-gradient(180deg, #fff, #ffffffaa);
}

.nav-item.active .nav-label {
  font-weight: 700;
}

.nav-item.active .nav-ico {
  background: transparent;
}

.nav-item.active:hover {
  color: #fff;
}

.nav-item.active:hover .nav-ico {
  background: transparent;
}

/* 未完成项：略灰，悬浮仍有反馈 */
.nav-item.nav-todo .nav-label {
  color: #7c8db0;
}

.nav-item.nav-todo .nav-ico {
  opacity: 0.82;
  filter: grayscale(0.25);
}

.nav-item.nav-todo:hover .nav-label {
  color: #5b6f94;
}

.nav-item.nav-todo.active {
  background: linear-gradient(145deg, #94a3b8, #64748b);
  color: #fff;
}

.nav-item.nav-todo.active::before {
  background: linear-gradient(180deg, #fff, #ffffffaa);
}

.nav-item.nav-todo.active .nav-ico {
  background: transparent;
}

.nav-item:focus-visible {
  outline: 2px solid #2563eb66;
  outline-offset: 2px;
}

.sidebar-foot {
  padding: 12px 16px 16px;
  border-top: 1px solid #d8e0ec;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.version-tag {
  font-size: var(--ds-fs-body);
  color: var(--muted);
}

/* ── Main area ── */
.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.topbar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  margin: 12px 16px 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: none;
  border: 1px solid #e2e8f0;
}

.page-title {
  font-size: var(--ds-fs-title);
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.page-title::after {
  display: none;
}

.page-desc {
  display: none;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--ds-fs-body);
  color: var(--muted);
}

.topbar-field select {
  min-width: 200px;
  padding: 8px 12px;
  border: none;
  border-radius: 12px;
  background: var(--bg);
  box-shadow: var(--shadow-in);
  font-size: var(--ds-fs-body);
  font-family: inherit;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--ds-fs-body);
  color: var(--label);
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  box-shadow: none;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--ds-fs-body);
  font-weight: 800;
  color: #fff;
  background: #5b4dbe;
  box-shadow: none;
}

.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 32px;
  scrollbar-width: thin;
  scrollbar-color: #c5cdd8 transparent;
}

.page-content::-webkit-scrollbar { width: 8px; }
.page-content::-webkit-scrollbar-thumb {
  background: #c5cdd8;
  border-radius: 999px;
}

/* ── Pages ── */
.page-panel { display: none; }
.page-panel.active {
  display: block;
  animation: pageIn 0.28s ease;
}

#page-ai-assistant.active {
  height: calc(100vh - 148px);
}

#page-ai-assistant.active .card {
  padding: 16px 18px;
}

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

/* ── Cards ── */
.card {
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-out);
  padding: 22px 24px;
  margin-bottom: 20px;
  border: 1px solid #ffffff99;
  position: relative;
  isolation: isolate;
  overflow: visible;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--hero-tint);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.card > * { position: relative; z-index: 1; }

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

.card-head h2 {
  font-size: var(--ds-fs-title);
  font-weight: 700;
  color: var(--text);
}

.split-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.split-2 > .card { margin-bottom: 0; }

@media (max-width: 1100px) {
  .split-2 { grid-template-columns: 1fr; }
}

/* ── Stats ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow-out);
  padding: 18px 20px 18px 56px;
  border: 1px solid #ffffff99;
  position: relative;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 12px 12px 24px #c5cdd877, -8px -8px 18px #ffffff;
}

.stat-ico {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--ds-fs-title);
  background: linear-gradient(145deg, #f5f8fc, #dfe6f0);
  box-shadow: 3px 3px 9px #c5cdd877, -2px -2px 7px #ffffff;
}

.stat-card.brand .stat-ico {
  background: linear-gradient(145deg, #ff9a5c, #ff6b35);
  box-shadow: 3px 3px 10px var(--brand-glow);
}

.stat-card.ok .stat-ico {
  background: linear-gradient(145deg, #34d399, #059669);
  box-shadow: 3px 3px 10px #05966944;
}

.stat-card .label {
  font-size: var(--ds-fs-body);
  color: var(--muted);
  margin-bottom: 6px;
}

.stat-card .value {
  font-size: var(--ds-fs-display-lg);
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}

.stat-card.brand .value { color: var(--brand); }
.stat-card.ok .value { color: var(--ok); }

@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── 楼-层-房间 三级导航 ── */
.site-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: var(--ds-fs-body);
}

.site-crumb {
  border: none;
  background: linear-gradient(145deg, #f8fafd, #e6ebf3);
  box-shadow: 4px 4px 10px #c5cdd866, -3px -3px 8px #ffffff;
  border-radius: 10px;
  padding: 6px 12px;
  font: inherit;
  font-size: var(--ds-fs-body);
  color: var(--label);
  cursor: pointer;
  transition: transform 0.12s, color 0.12s;
}

.site-crumb:hover { color: var(--primary); transform: translateY(-1px); }
.site-crumb.on { color: var(--primary); font-weight: 700; box-shadow: var(--shadow-in); }
.site-crumb-sep { color: var(--section); user-select: none; }

.site-level-desc {
  font-size: var(--ds-fs-body);
  color: var(--muted);
  margin-bottom: 16px;
}

.site-drill-body { min-height: 120px; }

.site-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.site-node-card {
  border: none;
  text-align: left;
  font: inherit;
  background: linear-gradient(145deg, #f8fafd, #e6ebf3);
  border-radius: 16px;
  box-shadow: 6px 6px 14px #c5cdd877, -4px -4px 12px #ffffff;
  padding: 16px 18px;
  cursor: pointer;
  transition: transform 0.14s, box-shadow 0.14s;
}

.site-node-card:hover {
  transform: translateY(-2px);
  box-shadow: 8px 8px 18px #b8c4d488, -5px -5px 14px #ffffff;
}

.site-node-card:active {
  transform: scale(0.985);
  box-shadow: var(--shadow-in);
}

.site-node-card h3 {
  font-size: var(--ds-fs-h3);
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}

.site-node-card .mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  font-size: var(--ds-fs-body);
  color: var(--muted);
}

.site-node-card .mini-stats b {
  display: block;
  font-size: var(--ds-fs-title);
  color: var(--primary);
  margin-top: 2px;
}

.site-node-card .mini-stats b.energy { color: var(--brand); }

/* ── 控制台（项目级概览）── 设计系统风格：白底 + 1px 边框 + 无阴影 + 无渐变 */
.dash-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--ds-sp-4);
}
.dash-topbar-left {
  display: flex;
  align-items: center;
  gap: var(--ds-sp-2);
}
.dash-topbar-label {
  font-size: var(--ds-fs-body);
  font-weight: 500;
  color: var(--ds-text);
}
.dash-project-select {
  padding: 6px 10px;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-r-md);
  background: var(--ds-surface);
  font-size: var(--ds-fs-body);
  font-weight: 500;
  color: var(--ds-text);
  min-width: 180px;
  cursor: pointer;
}
.dash-project-select:focus {
  outline: none;
  border-color: var(--ds-primary);
}

.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--ds-sp-3);
  margin-bottom: var(--ds-sp-4);
}
.dash-kpi-card {
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-r-lg);
  overflow: hidden;
  background: var(--ds-surface);
}

/* ── 色彩主题：明亮系 ── */
.kpi-indigo .kpi-head { background: #eef2ff; }
.kpi-indigo .kpi-icon { background: #e0e7ff; }
.kpi-indigo .kpi-icon svg { color: #6366f1; }
.kpi-indigo .kpi-value { color: #4f46e5; }

.kpi-teal .kpi-head { background: #ecfdf5; }
.kpi-teal .kpi-icon { background: #d1fae5; }
.kpi-teal .kpi-icon svg { color: #10b981; }
.kpi-teal .kpi-value { color: #059669; }

.kpi-amber .kpi-head { background: #fffbeb; }
.kpi-amber .kpi-icon { background: #fef3c7; }
.kpi-amber .kpi-icon svg { color: #f59e0b; }
.kpi-amber .kpi-value { color: #d97706; }

.kpi-sky .kpi-head { background: #eff6ff; }
.kpi-sky .kpi-icon { background: #dbeafe; }
.kpi-sky .kpi-icon svg { color: #3b82f6; }
.kpi-sky .kpi-value { color: #2563eb; }

.kpi-violet .kpi-head { background: #f5f3ff; }
.kpi-violet .kpi-icon { background: #ede9fe; }
.kpi-violet .kpi-icon svg { color: #8b5cf6; }
.kpi-violet .kpi-value { color: #7c3aed; }

.kpi-green .kpi-head { background: #f0fdf4; }
.kpi-green .kpi-icon { background: #dcfce7; }
.kpi-green .kpi-icon svg { color: #22c55e; }
.kpi-green .kpi-value { color: #16a34a; }

.kpi-red .kpi-head { background: #fef2f2; }
.kpi-red .kpi-icon { background: #fee2e2; }
.kpi-red .kpi-icon svg { color: #ef4444; }
.kpi-red .kpi-value { color: #dc2626; }

.kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--ds-sp-3);
}
.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--ds-r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.kpi-value {
  font-size: var(--ds-fs-display-lg);
  font-weight: 800;
  line-height: 1;
}
.kpi-value-suffix {
  font-size: var(--ds-fs-body);
  font-weight: 500;
  color: var(--ds-text-light);
}
.kpi-body {
  padding: var(--ds-sp-2) var(--ds-sp-3) var(--ds-sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--ds-sp-2);
}
.kpi-label {
  font-size: var(--ds-fs-body);
  color: var(--ds-text-mut);
  font-weight: 500;
}
.kpi-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-sp-1);
  min-height: 22px;
}
.kpi-hint {
  font-size: var(--ds-fs-body);
  color: var(--ds-text-light);
  padding-top: var(--ds-sp-1);
  border-top: 1px solid var(--ds-border);
}

.dash-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--ds-sp-4);
  margin-bottom: var(--ds-sp-4);
}
.dash-section {
  padding: 0;
  margin-bottom: var(--ds-sp-4);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-r-lg);
  overflow: hidden;
  background: var(--ds-surface);
}
.dash-section-head {
  padding: var(--ds-sp-3) var(--ds-sp-4);
  border-bottom: 1px solid var(--ds-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dash-section-title {
  margin: 0;
  font-size: var(--ds-fs-body);
  font-weight: 500;
  color: var(--ds-text);
}
.dash-section-body {
  padding: var(--ds-sp-4);
}

.dash-empty {
  text-align: center;
  padding: var(--ds-sp-6) 0;
  color: var(--ds-text-light);
  font-size: var(--ds-fs-body);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--ds-sp-2);
}
.dash-empty svg { color: var(--ds-text-light); font-size: 24px; opacity: 0.5; }
.dash-empty small { font-size: var(--ds-fs-body); color: var(--ds-text-light); }
.dash-empty-sm { padding: var(--ds-sp-4) 0; }
.dash-empty-sm svg { font-size: 18px; }

/* Building overview */
.dash-bld-list {
  display: flex;
  flex-direction: column;
  gap: var(--ds-sp-2);
  max-height: 248px;
  overflow-y: auto;
}
.dash-bld-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--ds-sp-3) var(--ds-sp-4);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-r-md);
  background: var(--ds-muted-bg);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  text-align: left;
  font: inherit;
}
.dash-bld-card:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}
.dash-bld-left {
  display: flex;
  align-items: center;
  gap: var(--ds-sp-3);
}
.dash-bld-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--ds-r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--ds-fs-body);
  background: var(--ds-primary-bg);
}
.dash-bld-icon svg { color: var(--ds-primary); }
.dash-bld-name { font-size: var(--ds-fs-body); font-weight: 500; color: var(--ds-text); }
.dash-bld-meta { font-size: var(--ds-fs-body); color: var(--ds-text-mut); margin-top: 1px; }
.dash-bld-stats {
  display: flex;
  gap: var(--ds-sp-4);
}
.dash-bld-stat { text-align: center; }
.dash-bld-stat-val { font-size: var(--ds-fs-title); font-weight: 700; color: var(--ds-text); }
.dash-bld-stat-label { font-size: var(--ds-fs-body); color: var(--ds-text-mut); }

/* Energy overview */
.dash-energy-list {
  display: flex;
  flex-direction: column;
  gap: var(--ds-sp-2);
  max-height: 248px;
  overflow-y: auto;
}
.dash-energy-row {
  display: flex;
  align-items: center;
  gap: var(--ds-sp-3);
  min-height: 62px;
  padding: var(--ds-sp-3) var(--ds-sp-4);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-r-md);
  background: var(--ds-muted-bg);
  flex-shrink: 0;
}
.dash-energy-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dash-energy-label {
  width: 50px;
  font-size: var(--ds-fs-body);
  font-weight: 500;
  color: var(--ds-text);
  flex-shrink: 0;
}
.dash-energy-bar-bg {
  flex: 1;
  height: 24px;
  background: var(--ds-muted-bg);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-r-sm);
  overflow: hidden;
}
.dash-energy-bar-fill {
  height: 100%;
  border-radius: var(--ds-r-sm);
}
.dash-energy-val {
  width: 50px;
  font-size: var(--ds-fs-title);
  font-weight: 700;
  text-align: right;
  flex-shrink: 0;
  color: var(--ds-text);
}

/* Gateway status */
.dash-gw-list { display: flex; flex-direction: column; }
.dash-gw-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--ds-border);
}
.dash-gw-row:last-child { border-bottom: none; }
.dash-gw-left {
  display: flex;
  align-items: center;
  gap: var(--ds-sp-2);
}
.dash-gw-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dash-gw-dot-online { background: var(--ds-success); }
.dash-gw-dot-offline { background: var(--ds-danger); }
.dash-gw-name { font-size: var(--ds-fs-body); font-weight: 500; color: var(--ds-text); }
.dash-gw-uid { font-size: var(--ds-fs-body); color: var(--ds-text-mut); font-family: monospace; }
.dash-gw-status { font-size: var(--ds-fs-body); font-weight: 500; }
.dash-gw-status-online { color: var(--ds-success); }
.dash-gw-status-offline { color: var(--ds-danger); }

/* Config reminders */
.dash-config-group { margin-bottom: var(--ds-sp-3); }
.dash-config-title {
  font-size: var(--ds-fs-body);
  font-weight: 600;
  color: var(--ds-text);
  margin-bottom: var(--ds-sp-2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.dash-config-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ds-warning);
  display: inline-block;
}
.dash-config-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-sp-2);
  padding-left: var(--ds-sp-3);
}
.dash-config-tag {
  padding: 2px 8px;
  background: var(--ds-warning-bg);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-r-sm);
  font-size: var(--ds-fs-body);
  color: var(--ds-warning);
}

@media (max-width: 1200px) {
  .dash-kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .dash-row { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-bld-stats { gap: var(--ds-sp-2); }
}

.site-room-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  font-size: var(--ds-fs-body);
}

@media (max-width: 800px) {
  .site-room-detail { grid-template-columns: 1fr; }
}

.room-light-ratio {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: var(--card, #fafafa);
}
.room-light-ratio-title {
  margin: 0 0 10px;
  font-size: var(--ds-fs-h3);
  font-weight: 600;
}
.room-light-ratio-body p {
  margin: 0 0 10px;
  line-height: 1.5;
}
.room-light-ratio-body .muted {
  color: var(--muted, #6b7280);
  font-size: var(--ds-fs-body);
  margin-left: 6px;
}
.lr-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: #e5e7eb;
  margin-top: 6px;
  max-width: 420px;
}
.lr-bar .lr-nat { background: #38bdf8; }
.lr-bar .lr-lamp { background: #fbbf24; }

/* ── Control grid (desktop) ── */
.control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 20px;
}

.gw-control-card {
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-out);
  padding: 20px 22px;
  border: 1px solid #ffffff99;
  position: relative;
  isolation: isolate;
  overflow: visible;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.gw-control-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--hero-tint);
  opacity: 0.28;
  pointer-events: none;
  z-index: 0;
}

.gw-control-card > * { position: relative; z-index: 1; }

.gw-control-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-out-lg);
}

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

.gw-control-card h3,
.gw-control-card h2 {
  font-size: var(--ds-fs-h3);
  font-weight: 700;
  margin: 0;
}

.gw-control-card h2 { font-size: 16px; }

/* ═══ 日常控灯页面 ═══ */
.ctl-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--ds-sp-4); }
.ctl-topbar-left { display: flex; align-items: center; gap: var(--ds-sp-2); }
.ctl-topbar-label { font-size: var(--ds-fs-body); font-weight: 500; color: var(--ds-text); }
.ctl-select { padding: 6px 10px; border: 1px solid var(--ds-border); border-radius: var(--ds-r-md); background: var(--ds-surface); font-size: var(--ds-fs-body); min-width: 140px; color: var(--ds-text); }
.ctl-btn { padding: 6px 16px; border: 1px solid var(--ds-border); border-radius: var(--ds-r-md); background: var(--ds-surface); cursor: pointer; font-size: var(--ds-fs-body); color: var(--ds-text); }
.ctl-btn:hover { border-color: var(--ds-primary); }

/* KPI cards */
.ctl-kpi-bar { display: flex; gap: var(--ds-sp-3); margin-bottom: var(--ds-sp-4); }
.ctl-kpi-item { flex: 1; padding: var(--ds-sp-4) var(--ds-sp-5); border: 1px solid var(--ds-border); border-radius: var(--ds-r-lg); background: var(--ds-surface); position: relative; overflow: hidden; }
.ctl-kpi-item::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.ctl-kpi-item.kpi-online::before { background: #34c759; }
.ctl-kpi-item.kpi-offline::before { background: #ff3b30; }
.ctl-kpi-item.kpi-light::before { background: #f59e0b; }
.ctl-kpi-item.kpi-gateway::before { background: var(--ds-primary); }
.ctl-kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ctl-kpi-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: var(--ds-r-md); }
.ctl-kpi-icon svg { width: 20px; height: 20px; }
.ctl-kpi-icon.kpi-online { background: #e8f9ed; }
.ctl-kpi-icon.kpi-online svg { fill: #34c759; }
.ctl-kpi-icon.kpi-offline { background: #fdeae9; }
.ctl-kpi-icon.kpi-offline svg { fill: #ff3b30; }
.ctl-kpi-icon.kpi-light { background: #fef5e7; }
.ctl-kpi-icon.kpi-light svg { fill: #f59e0b; }
.ctl-kpi-icon.kpi-gateway { background: var(--ds-primary-bg); }
.ctl-kpi-icon.kpi-gateway svg { fill: var(--ds-primary); }
.ctl-kpi-label { font-size: var(--ds-fs-body); color: var(--ds-text-mut); }
.ctl-kpi-num { font-size: var(--ds-fs-display); font-weight: 700; line-height: 1.2; color: var(--ds-text); }
.ctl-kpi-sub { font-size: var(--ds-fs-body); color: var(--ds-text-mut); margin-top: 2px; }
.ctl-kpi-progress { height: 4px; background: var(--ds-gray-bg); border-radius: 2px; margin-top: var(--ds-sp-2); overflow: hidden; }
.ctl-kpi-progress-fill { height: 100%; border-radius: 2px; }
.ctl-kpi-tag { display: inline-block; padding: 1px var(--ds-sp-2); border-radius: var(--ds-r-sm); font-size: var(--ds-fs-body); font-weight: 500; }
.ctl-kpi-tag.ok { background: #e8f9ed; color: #2ea048; }
.ctl-kpi-tag.warn { background: #fdeae9; color: #d63a30; }

/* Batch operation bar */
.ctl-batch-bar { display: flex; align-items: center; gap: var(--ds-sp-5); padding: var(--ds-sp-3) var(--ds-sp-5); margin-bottom: var(--ds-sp-4); border: 1px solid var(--ds-border); border-radius: var(--ds-r-lg); background: var(--ds-surface); flex-wrap: wrap; }
.ctl-batch-count { font-size: var(--ds-fs-body); font-weight: 600; color: var(--ds-primary); flex-shrink: 0; }
.ctl-batch-divider { width: 1px; height: 28px; background: var(--ds-border); flex-shrink: 0; }
.ctl-batch-group { display: flex; align-items: center; gap: var(--ds-sp-2); flex-shrink: 0; }
.ctl-batch-group-label { font-size: var(--ds-fs-body); color: var(--ds-text-mut); font-weight: 500; white-space: nowrap; }
.ctl-batch-btn { padding: 6px 14px; border: 1px solid var(--ds-border); border-radius: var(--ds-r-md); font-size: var(--ds-fs-body); cursor: pointer; background: var(--ds-surface); color: var(--ds-text); }
.ctl-batch-btn.primary { background: var(--ds-primary); color: #fff; border-color: var(--ds-primary); }
.ctl-batch-btn.danger { background: var(--ds-surface); color: var(--ds-text); border-color: var(--ds-border); }
.ctl-batch-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ctl-batch-scenes { display: flex; gap: 6px; flex-wrap: wrap; }
.ctl-batch-sc { padding: 6px var(--ds-sp-3); text-align: center; border: 1px solid var(--ds-border); border-radius: var(--ds-r-md); font-size: var(--ds-fs-body); cursor: pointer; background: var(--ds-surface); color: var(--ds-text); }
.ctl-batch-sc:disabled { opacity: 0.4; cursor: not-allowed; }
.ctl-batch-slider-row { display: flex; align-items: center; gap: 6px; }
.ctl-slider-label { font-size: var(--ds-fs-body); color: var(--ds-text-mut); width: 30px; flex-shrink: 0; }
.ctl-slider-bar { flex: 1; height: 6px; background: var(--ds-gray-bg); border-radius: 3px; position: relative; min-width: 80px; }
.ctl-slider-fill { height: 100%; border-radius: 3px; background: var(--ds-primary); }
.ctl-slider-fill.warm { background: #f59e0b; }
.ctl-slider-val { font-size: var(--ds-fs-body); width: 24px; text-align: right; flex-shrink: 0; color: var(--ds-text); }

/* Room cards grid */
.ctl-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--ds-sp-3); margin-bottom: var(--ds-sp-4); }
.ctl-card-grid .gw-control-card { width: 100%; min-width: 0; }
.ctl-room-card { border: 1px solid var(--ds-border); border-radius: var(--ds-r-lg); background: var(--ds-surface); overflow: hidden; }
.ctl-room-head { padding: 10px var(--ds-sp-4); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--ds-gray-bg); background: var(--ds-muted-bg); }
.ctl-room-name { font-size: var(--ds-fs-body); font-weight: 600; color: var(--ds-text); }
.ctl-room-meta { font-size: var(--ds-fs-body); color: var(--ds-text-mut); margin-top: 1px; }
.ctl-room-status { display: flex; align-items: center; gap: 4px; font-size: var(--ds-fs-body); color: var(--ds-text); }
.ctl-room-status .ctl-status-dot { width: 8px; height: 8px; border-radius: 50%; }
.ctl-status-online { background: #34c759; }
.ctl-status-offline { background: #ff3b30; }
.ctl-room-body { padding: var(--ds-sp-3) var(--ds-sp-4); }
.ctl-room-stats { display: flex; gap: var(--ds-sp-4); margin-bottom: 10px; }
.ctl-room-stat { font-size: var(--ds-fs-body); color: var(--ds-text-mut); }
.ctl-room-stat b { font-size: var(--ds-fs-title); font-weight: 700; color: var(--ds-text); }
.ctl-room-check { width: 16px; height: 16px; cursor: pointer; accent-color: var(--ds-primary); }

/* Scene buttons */
.ctl-scenes { display: flex; gap: 4px; margin-bottom: 10px; }
.ctl-sc-btn { flex: 1; padding: 6px 0; text-align: center; border: 1px solid var(--ds-border); border-radius: var(--ds-r-md); font-size: var(--ds-fs-body); cursor: pointer; background: var(--ds-surface); color: var(--ds-text); }
.ctl-sc-btn.active { background: var(--ds-primary); color: #fff; border-color: var(--ds-primary); }
.ctl-sc-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* On/Off + sliders in room cards */
.ctl-controls { display: flex; align-items: center; gap: var(--ds-sp-2); }
.ctl-onoff { display: flex; gap: 4px; }
.ctl-on-btn, .ctl-off-btn { padding: 6px var(--ds-sp-3); border: 1px solid var(--ds-border); border-radius: var(--ds-r-md); font-size: var(--ds-fs-body); cursor: pointer; }
.ctl-on-btn { background: var(--ds-primary); color: #fff; border-color: var(--ds-primary); }
.ctl-off-btn { background: var(--ds-surface); color: var(--ds-text); border-color: var(--ds-border); }
.ctl-on-btn:disabled, .ctl-off-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ctl-slider-group { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.ctl-slider-row { display: flex; align-items: center; gap: 6px; }

/* Disabled room card */
.ctl-room-card.disabled { opacity: 0.5; }
.ctl-room-card.disabled .ctl-room-body { pointer-events: none; }
.ctl-disabled-tag { display: inline-block; padding: 2px var(--ds-sp-2); background: var(--ds-gray-bg); border-radius: var(--ds-r-sm); font-size: var(--ds-fs-body); color: var(--ds-text-mut); }

/* Control logs */
.ctl-logs { border: 1px solid var(--ds-border); border-radius: var(--ds-r-lg); background: var(--ds-surface); overflow: hidden; }
.ctl-logs-head { padding: var(--ds-sp-3) var(--ds-sp-4); border-bottom: 1px solid var(--ds-gray-bg); display: flex; align-items: center; justify-content: space-between; }
.ctl-logs-title { font-size: var(--ds-fs-body); font-weight: 600; color: var(--ds-text); }
.ctl-logs-body { padding: 0; }
.ctl-log-row { display: grid; grid-template-columns: 140px 90px 1fr 100px 80px; padding: var(--ds-sp-2) var(--ds-sp-4); border-bottom: 1px solid var(--ds-gray-bg); font-size: var(--ds-fs-body); align-items: center; color: var(--ds-text); }
.ctl-log-row:last-child { border-bottom: none; }
.ctl-log-time { color: var(--ds-text-mut); font-size: var(--ds-fs-body); }
.ctl-log-action { font-weight: 500; }
.ctl-log-room { color: var(--ds-text-mut); }
.ctl-log-user { font-size: var(--ds-fs-body); color: var(--ds-text-mut); }
.ctl-log-status { font-size: var(--ds-fs-body); }
.ctl-log-ok { color: #34c759; }
.ctl-log-fail { color: #ff3b30; }
.ctl-logs-empty { padding: var(--ds-sp-6) var(--ds-sp-4); text-align: center; color: var(--ds-text-mut); font-size: var(--ds-fs-body); }

/* Pagination */
.ctl-pagination { display: flex; align-items: center; justify-content: space-between; padding: 10px var(--ds-sp-4); border-top: 1px solid var(--ds-gray-bg); }
.ctl-pagination-info { font-size: var(--ds-fs-body); color: var(--ds-text-mut); }
.ctl-pagination-controls { display: flex; align-items: center; gap: 4px; }
.ctl-page-btn { min-width: 28px; height: 28px; padding: 0 var(--ds-sp-2); border: 1px solid var(--ds-border); border-radius: var(--ds-r-md); background: var(--ds-surface); font-size: var(--ds-fs-body); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--ds-text); }
.ctl-page-btn:hover:not(.disabled) { border-color: var(--ds-primary); }
.ctl-page-btn.active { background: var(--ds-primary); color: #fff; border-color: var(--ds-primary); }
.ctl-page-btn.disabled { opacity: 0.4; cursor: not-allowed; }
.ctl-page-ellipsis { padding: 0 4px; font-size: var(--ds-fs-body); color: var(--ds-text-mut); }

@media (max-width: 1200px) {
  .ctl-card-grid { grid-template-columns: repeat(2, 1fr); }
  .ctl-kpi-bar { flex-wrap: wrap; }
  .ctl-kpi-item { min-width: calc(50% - 6px); }
}
@media (max-width: 768px) {
  .ctl-card-grid { grid-template-columns: 1fr; }
  .ctl-kpi-item { min-width: 100%; }
  .ctl-batch-bar { gap: 12px; }
}

/* ── Todo placeholder ── */
.todo-page {
  max-width: 640px;
  margin: 40px auto;
  text-align: center;
  padding: 48px 32px;
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-out-lg);
  border: 1px solid #ffffff99;
  position: relative;
  isolation: isolate;
  overflow: visible;
}

.todo-page::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--hero-tint);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

.todo-page > * { position: relative; z-index: 1; }

.todo-page .todo-badge {
  display: inline-block;
  font-size: var(--ds-fs-body);
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #94a3b8, #64748b);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.todo-page h2 {
  font-size: var(--ds-fs-display);
  margin-bottom: 12px;
  color: var(--text);
}

.todo-page p {
  font-size: var(--ds-fs-body);
  color: var(--muted);
  line-height: 1.7;
}

.todo-page ul {
  text-align: left;
  margin: 20px auto 0;
  max-width: 400px;
  font-size: var(--ds-fs-body);
  color: var(--label);
  line-height: 1.8;
}

/* ── Forms ── */
.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: var(--ds-fs-body);
  font-weight: 600;
  color: var(--label);
  margin-bottom: 6px;
}

.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 12px;
  background: var(--bg);
  box-shadow: var(--shadow-in);
  font-size: var(--ds-fs-body);
  color: var(--text);
  outline: none;
  font-family: inherit;
  transition: box-shadow 0.15s ease;
}

.field input:focus, .field select:focus {
  box-shadow: var(--shadow-in), 0 0 0 2px #2563eb33;
}

.form-grid { display: grid; gap: 12px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid .span-2 { grid-column: 1 / -1; }

@media (max-width: 700px) {
  .form-grid-2 { grid-template-columns: 1fr; }
}

.btn {
  border: none;
  border-radius: 14px;
  padding: 10px 18px;
  font-size: var(--ds-fs-body);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
  font-family: inherit;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

.btn-sm { padding: 6px 12px; font-size: var(--ds-fs-body); }

.btn-primary {
  background: var(--primary-grad);
  color: #fff;
  box-shadow: 4px 4px 14px #2563eb55, inset 0 1px 0 #ffffff44;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 6px 6px 18px #2563eb55, inset 0 1px 0 #ffffff55;
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.btn-ghost {
  background: #fff;
  color: #5b4dbe;
  box-shadow: none;
}

.btn-ghost:hover:not(:disabled) {
  color: #4c3fa6;
}

.btn-ghost:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
  box-shadow: var(--shadow-in);
}

.btn-danger {
  background: linear-gradient(145deg, #fecaca, #fee2e2);
  color: var(--err);
}

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* ── Power / scenes / sliders ── */
.power {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.pw-left { display: flex; align-items: center; gap: 14px; }

.pw-ico {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(145deg, #ff9a5c, #ff6b35);
  box-shadow: 6px 6px 16px #ff6b3544;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--ds-fs-display);
}

.pw-left h2 { font-size: var(--ds-fs-title); font-weight: 700; }
.pw-left span { font-size: var(--ds-fs-body); color: var(--muted); }

.badge {
  font-size: var(--ds-fs-body);
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: 3px 3px 8px #c5cdd844, inset 0 1px 0 #ffffff88;
}

.badge.on {
  background: linear-gradient(145deg, #dcfce7, #bbf7d0);
  color: var(--ok);
}

.badge.off {
  background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
  color: var(--muted);
}

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

.sc {
  border-radius: 18px;
  padding: 16px 10px;
  min-height: 92px;
  text-align: center;
  background: linear-gradient(145deg, #f5f8fc, #dfe6f0);
  box-shadow: 6px 6px 14px #c5cdd8, -4px -4px 12px #ffffff;
  cursor: pointer;
  border: none;
  font: inherit;
  transition: box-shadow 0.06s ease, transform 0.06s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.sc:hover:not(:disabled):not(.pressed):not(.pending) {
  transform: translateY(-2px);
  box-shadow: 8px 8px 18px #b8c4d488, -5px -5px 14px #ffffff;
}

.sc.pressed,
.sc:active:not(:disabled) {
  box-shadow: var(--shadow-in);
  transform: scale(0.96) translateY(1px);
}

.scenes.busy .sc:not(.pending) {
  opacity: 0.55;
  pointer-events: none;
}

.sc.pending {
  box-shadow: var(--shadow-in);
  transform: scale(0.96) translateY(1px);
  opacity: 1;
  pointer-events: none;
}

.sc:disabled:not(.sc) {
  opacity: 0.6;
  cursor: wait;
}

.sc.active:not(.pressed):not(.pending) {
  background: linear-gradient(145deg, #e8f1ff, #d9e6fc);
  box-shadow: var(--shadow-in), inset 0 0 0 1px #2563eb22;
  color: var(--primary);
}

.sc.active b { color: var(--primary); }

.sc .i { font-size: 28px; margin-bottom: 6px; line-height: 1; }
.sc b { display: block; font-size: var(--ds-fs-h3); font-weight: 700; line-height: 1.25; }
.sc small { display: block; font-size: var(--ds-fs-body); color: var(--muted); margin-top: 2px; }

@media (min-width: 900px) {
  .scenes:not(.gw-control-card .scenes) { grid-template-columns: repeat(6, 1fr); }
  .sc:not(.gw-control-card .sc) { min-height: 84px; padding: 14px 12px; }
}

.gw-control-card .scenes { grid-template-columns: repeat(3, 1fr); }
.gw-control-card .sc { min-height: 72px; padding: 12px 8px; }
.gw-control-card .sc .i { font-size: 22px; margin-bottom: 4px; }
.gw-control-card .sc b { font-size: 13px; }
.gw-control-card .sc small { font-size: 11px; }
.gw-control-card .btn { padding: 8px 14px; font-size: 14px; }
.gw-control-card .slider-block { padding: 10px 0; }
.gw-control-card .lc-slider-head { font-size: 13px; }

.slider-block { margin-bottom: 12px; }
.row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.row label { font-size: var(--ds-fs-body); font-weight: 600; color: var(--label); }
.row .v { font-size: var(--ds-fs-display); font-weight: 700; color: var(--primary); }

input[type="range"]:not(.lc-range) {
  width: 100%;
  margin: 6px 0 2px;
  accent-color: var(--primary);
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(145deg, #dfe6f0, #eef2f8);
  box-shadow: var(--shadow-in);
}

/* LC 滑条 — 对齐 AFPMesh-Studio seekbar_control_* / bg_slider_* / seekbar_control_thumb_neu */
.lc-slider { margin-bottom: 14px; }

.lc-slider-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.lc-slider-head label,
.lc-slider-head > span:first-child {
  font-size: var(--ds-fs-body);
  font-weight: 600;
  color: var(--label);
}

.lc-val-l,
.lc-slider-head .lc-val-l {
  font-size: var(--ds-fs-display-md);
  font-weight: 700;
  color: #ff6a00;
}

.lc-val-c,
.lc-slider-head .lc-val-c {
  font-size: var(--ds-fs-display-md);
  font-weight: 700;
  line-height: 1.2;
}

.lc-ct-warm { color: #f9a825; }
.lc-ct-sep { color: #94a3b8; margin: 0 1px; }
.lc-ct-cool { color: #1d1d1f; }

.lc-slider-track-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 4px;
  border-radius: 12px;
  background: #c5cedb;
  box-shadow: inset 0 2px 4px #8fa0b866, inset 0 1px 0 #ffffff55;
}

.lc-slider-track-wrap::before {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 12px;
  border-radius: 6px;
  transform: translateY(-50%);
  pointer-events: none;
}

.lc-slider-track-wrap--l::before {
  background: linear-gradient(90deg, #3d2314 0%, #7a5a28 50%, #ffd54f 100%);
}

.lc-slider-track-wrap--c::before {
  background: linear-gradient(90deg, #ffb300 0%, #fff3c4 50%, #b3e5fc 100%);
}

.lc-range {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  z-index: 1;
  width: 100%;
  height: 44px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.lc-range:focus { outline: none; }

.lc-range::-webkit-slider-runnable-track {
  height: 12px;
  background: transparent;
  border: none;
}

.lc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -6px;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 2px 4px #33000000,
    0 0 0 5px #ffffff55;
}

.lc-range::-moz-range-track {
  height: 12px;
  background: transparent;
  border: none;
}

.lc-range::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.2),
    0 0 0 5px rgba(255, 255, 255, 0.33);
}

.lc-slider-feet {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: var(--ds-fs-body);
  font-weight: 700;
}

.lc-slider-feet--l .lc-foot-dim { color: #5d4037; }
.lc-slider-feet--l .lc-foot-bright { color: #f9a825; }
.lc-slider-feet--c .lc-foot-warm { color: #d97706; }
.lc-slider-feet--c .lc-foot-cool { color: #039be5; }

.site-room-detail p {
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f044;
}

.site-room-detail p:last-child { border-bottom: none; }

.about-lines p {
  padding: 8px 0;
  font-size: var(--ds-fs-body);
}

.about-lines strong { color: var(--primary); }

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, #eef2f8, #e4eaf2);
  box-shadow: var(--shadow-in);
  padding: 4px;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--ds-fs-body);
  background: linear-gradient(145deg, #f8fafd, #eef2f8);
  border-radius: calc(var(--radius-md) - 4px);
  overflow: hidden;
}

.data-table th, .data-table td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid #e2e8f066;
}

.data-table th {
  color: var(--section);
  font-weight: 700;
  font-size: var(--ds-fs-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  background: linear-gradient(180deg, #f5f8fc, #eef2f8);
}

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

.data-table tbody tr:hover {
  background: linear-gradient(90deg, #ffffff88, #e8f1ff66);
}

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

.status-pill {
  display: inline-block;
  font-size: var(--ds-fs-body);
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 3px 3px 8px #c5cdd844, inset 0 1px 0 #ffffff88;
}

.status-pill.yes {
  background: linear-gradient(145deg, #dcfce7, #bbf7d0);
  color: var(--ok);
}

.status-pill.no {
  background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
  color: var(--muted);
}

.group-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}
.grp-chip {
  font-size: var(--ds-fs-body);
  padding: 6px 10px;
  border-radius: 999px;
  background: linear-gradient(145deg, #f5f8fc, #dfe6f0);
  box-shadow: var(--shadow-out);
}
.grp-chip.muted { color: var(--muted); }

/* ── 设备分组 · Studio 拖拽式 ── */
/* ═══════ 设备分组页面 v2 ═══════ */

/* ── 顶部筛选栏 ── */
.grp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--ds-sp-4);
  gap: var(--ds-sp-3);
  flex-wrap: wrap;
}
.grp-topbar-left {
  display: flex;
  align-items: center;
  gap: var(--ds-sp-2);
  flex-wrap: wrap;
}
.grp-topbar-label {
  font-size: var(--ds-fs-body);
  font-weight: 500;
  color: var(--ds-text);
}
.grp-select {
  padding: 6px 10px;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-r-md);
  background: var(--ds-surface);
  font-size: var(--ds-fs-body);
  min-width: 130px;
  color: var(--ds-text);
}
.grp-select:focus {
  outline: none;
  border-color: var(--ds-primary);
}

/* ── KPI 卡片栏 ── */
.grp-kpi-bar {
  display: flex;
  gap: var(--ds-sp-3);
  margin-bottom: var(--ds-sp-4);
  flex-wrap: wrap;
}
.grp-kpi-item {
  flex: 1;
  min-width: 180px;
  padding: var(--ds-sp-3) var(--ds-sp-4);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-r-lg);
  background: var(--ds-surface);
  position: relative;
  overflow: hidden;
}
.grp-kpi-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}
.grp-kpi-item.kpi-devices::before { background: var(--ds-warning); }
.grp-kpi-item.kpi-online::before { background: var(--ds-success); }
.grp-kpi-item.kpi-unassigned::before { background: #ff9500; }
.grp-kpi-item.kpi-gateway::before { background: var(--ds-primary); }

.grp-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--ds-sp-2);
}
.grp-kpi-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--ds-r-md);
}
.grp-kpi-icon svg { width: 18px; height: 18px; }
.grp-kpi-icon.kpi-devices { background: var(--ds-warning-bg); }
.grp-kpi-icon.kpi-devices svg { fill: var(--ds-warning); }
.grp-kpi-icon.kpi-online { background: var(--ds-success-bg); }
.grp-kpi-icon.kpi-online svg { fill: var(--ds-success); }
.grp-kpi-icon.kpi-unassigned { background: #fff3e0; }
.grp-kpi-icon.kpi-unassigned svg { fill: #ff9500; }
.grp-kpi-icon.kpi-gateway { background: var(--ds-primary-bg); }
.grp-kpi-icon.kpi-gateway svg { fill: var(--ds-primary); }

.grp-kpi-num {
  font-size: var(--ds-fs-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ds-text);
}
.grp-kpi-num small {
  font-size: var(--ds-fs-body);
  font-weight: 500;
  color: var(--ds-text-mut);
}
.grp-kpi-sub {
  font-size: var(--ds-fs-body);
  color: var(--ds-text-light);
  margin-top: 3px;
}
.grp-kpi-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: var(--ds-r-sm);
  font-size: var(--ds-fs-body);
  font-weight: 500;
}
.grp-kpi-tag.ok { background: var(--ds-success-bg); color: var(--ds-success); }
.grp-kpi-tag.warn { background: var(--ds-warning-bg); color: var(--ds-warning); }

/* ── 网关信息条 ── */
.grp-gw-bar {
  display: flex;
  align-items: center;
  gap: var(--ds-sp-5);
  padding: var(--ds-sp-2) var(--ds-sp-4);
  margin-bottom: var(--ds-sp-4);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-r-lg);
  background: var(--ds-surface);
  flex-wrap: wrap;
}
.grp-gw-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--ds-fs-body);
  color: var(--ds-text-mut);
}
.grp-gw-item svg { width: 15px; height: 15px; fill: var(--ds-text-light); }
.grp-gw-item b { font-weight: 600; color: var(--ds-text); }
.grp-gw-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ds-success);
}
.grp-gw-dot.off { background: var(--ds-danger); }
.grp-gw-divider {
  width: 1px;
  height: 22px;
  background: var(--ds-border);
}
.grp-gw-bar--empty {
  justify-content: center;
  color: var(--ds-text-light);
  font-size: var(--ds-fs-body);
}

/* ── 图例 ── */
.grp-legend {
  display: flex;
  align-items: center;
  gap: var(--ds-sp-4);
  padding: var(--ds-sp-2) var(--ds-sp-4);
  margin-bottom: var(--ds-sp-3);
  font-size: var(--ds-fs-body);
  color: var(--ds-text-mut);
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-r-lg);
  flex-wrap: wrap;
}
.grp-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.grp-legend-svg {
  width: 14px;
  height: 14px;
  fill: var(--ds-text-light);
}
.grp-legend-tip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding: 3px 10px;
  font-size: var(--ds-fs-body);
  color: var(--ds-primary);
  background: var(--ds-primary-bg);
  border-radius: var(--ds-r-pill);
  white-space: nowrap;
}
.grp-legend-tip svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
  flex-shrink: 0;
}
.dev-state {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}
.dev-state-on { background: #f5c518; }
.dev-state-off { background: #d8d8dc; }
.dev-state-offline { background: var(--ds-surface); border: 1.5px solid var(--ds-danger); }

/* ── 总控区 ── */
.grp-master {
  display: flex;
  align-items: center;
  gap: var(--ds-sp-3);
  padding: var(--ds-sp-3) var(--ds-sp-4);
  margin-bottom: var(--ds-sp-3);
  border: 1px dashed var(--ds-primary);
  border-radius: var(--ds-r-lg);
  background: var(--ds-primary-bg);
}
.grp-master-title {
  font-size: var(--ds-fs-body);
  font-weight: 600;
  color: var(--ds-primary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.grp-master-title svg { width: 16px; height: 16px; fill: var(--ds-primary); }
.grp-master-body {
  display: flex;
  gap: var(--ds-sp-2);
  flex-wrap: wrap;
  align-items: center;
  flex: 1;
  min-height: 52px;
}
.grp-master-stats {
  font-size: var(--ds-fs-body);
  color: var(--ds-text-mut);
  flex-shrink: 0;
}
.grp-master-hint {
  font-size: var(--ds-fs-body);
  color: var(--ds-text-light);
}
.grp-master-placeholder {
  font-size: var(--ds-fs-body);
  color: var(--ds-text-light);
  line-height: 1.6;
  margin: 0;
}

/* ── 分组卡片网格 ── */
.grp-zone-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--ds-sp-3);
  margin-bottom: var(--ds-sp-3);
}
@media (max-width: 900px) {
  .grp-zone-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grp-zone-grid { grid-template-columns: 1fr; }
}

.grp-zone {
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-r-lg);
  background: var(--ds-surface);
  overflow: hidden;
}
.grp-zone-head {
  padding: var(--ds-sp-2) var(--ds-sp-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ds-border);
  background: var(--ds-muted-bg);
}
.grp-zone-name {
  font-size: var(--ds-fs-body);
  font-weight: 600;
  color: var(--ds-text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.grp-zone-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--ds-r-sm);
  background: var(--ds-primary-bg);
  color: var(--ds-primary);
  font-size: var(--ds-fs-body);
  font-weight: 700;
}
.grp-zone-edit {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--ds-r-sm);
  cursor: pointer;
  border: none;
  background: transparent;
}
.grp-zone-edit svg { width: 13px; height: 13px; fill: var(--ds-text-light); }
.grp-zone-edit:hover { background: var(--ds-gray-bg); }
.grp-zone-stats {
  font-size: var(--ds-fs-body);
  color: var(--ds-text-light);
  margin-top: 2px;
}
.grp-zone-body {
  padding: var(--ds-sp-3) var(--ds-sp-3);
  min-height: 92px;
  display: flex;
  gap: var(--ds-sp-2);
  flex-wrap: wrap;
  align-content: flex-start;
}
.grp-zone-empty {
  font-size: var(--ds-fs-body);
  color: var(--ds-text-light);
  align-self: center;
}
.grp-zone-body.drag-over {
  background: var(--ds-primary-bg);
  border-radius: var(--ds-r-md);
}

/* ── 未分组 ── */
.grp-none {
  display: flex;
  align-items: center;
  gap: var(--ds-sp-3);
  padding: var(--ds-sp-3) var(--ds-sp-4);
  margin-bottom: var(--ds-sp-4);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-r-lg);
  background: var(--ds-surface);
}
.grp-none-title {
  font-size: var(--ds-fs-body);
  font-weight: 600;
  color: var(--ds-warning);
  flex-shrink: 0;
}
.grp-none-body {
  display: flex;
  gap: var(--ds-sp-2);
  flex-wrap: wrap;
  flex: 1;
  align-items: center;
  min-height: 52px;
}
.grp-none-stats {
  font-size: var(--ds-fs-body);
  color: var(--ds-text-mut);
  flex-shrink: 0;
}
.grp-none-body.drag-over {
  background: var(--ds-warning-bg);
  border-radius: var(--ds-r-md);
}

/* ── 设备磁贴 ── */
.dev-tile {
  width: 52px;
  height: 56px;
  border-radius: var(--ds-r-md);
  border: 1px solid var(--ds-border);
  background: var(--ds-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: grab;
  user-select: none;
  touch-action: none;
  position: relative;
  transition: opacity 0.1s ease;
}
.dev-tile:active { cursor: grabbing; }
.dev-tile svg { width: 18px; height: 18px; }
.dev-tile span { font-size: var(--ds-fs-body); color: var(--ds-text-light); }

/* ── 设备信息卡片样式 ── */
.dev-tile--info {
  width: 140px;
  height: auto;
  min-height: 130px;
  padding: 10px 12px;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  cursor: grab;
}
.dev-tile--info .dev-tile-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.dev-tile--info .dev-tile-lid {
  font-size: 11px;
  font-weight: 600;
  color: var(--ds-text-mut);
  background: var(--ds-muted-bg);
  padding: 1px 5px;
  border-radius: 4px;
}
.dev-tile--info .dev-tile-icon {
  display: flex;
  align-items: center;
}
.dev-tile--info .dev-tile-icon svg {
  width: 16px;
  height: 16px;
}
.dev-tile--info .dev-tile-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ds-text);
}
.dev-tile--info .dev-tile-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dev-tile--info .dev-tile-bright-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dev-tile--info .dev-tile-bright {
  flex: 1;
  height: 8px;
  background: var(--ds-gray-bg);
  border-radius: 4px;
  overflow: hidden;
}
.dev-tile--info .dev-tile-bright-bar {
  height: 100%;
  background: linear-gradient(90deg, #f5a623, #f8c547);
  border-radius: 4px;
  transition: width 0.3s ease;
}
.dev-tile--info .dev-tile-bright-val {
  font-size: 11px;
  font-weight: 600;
  color: var(--ds-text);
  min-width: 32px;
  text-align: right;
}
.dev-tile--info .dev-tile-off {
  font-size: 11px;
  color: var(--ds-text-mut);
  font-style: italic;
}
.dev-tile--info .dev-tile-lux {
  font-size: 11px;
  color: var(--ds-text-light);
}
.dev-tile--info .dev-tile-rssi {
  font-size: 11px;
  color: var(--ds-text-mut);
  display: flex;
  align-items: center;
  gap: 3px;
}
.dev-tile--info .dev-tile-rssi-icon {
  font-size: 10px;
}
.dev-tile--info .dev-tile-ct-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dev-tile--info .dev-tile-ct-bar {
  flex: 1;
  height: 8px;
  background: linear-gradient(90deg, #ff6b35, #fff4e0, #b8d4ff);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.dev-tile--info .dev-tile-ct-bar-fill {
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  transition: width 0.3s ease;
}
.dev-tile--info .dev-tile-ct-val {
  font-size: 11px;
  font-weight: 600;
  color: var(--ds-text);
  min-width: 36px;
  text-align: right;
}

.dev-tile.on svg { fill: #f5a623; }
.dev-tile.off svg { fill: #c7c7cc; }
.dev-tile.offline svg { fill: #d8d8dc; }
.dev-tile.offline::after {
  content: '';
  position: absolute;
  inset: -1px;
  border: 1.5px solid var(--ds-danger);
  border-radius: var(--ds-r-md);
  opacity: .55;
}
.dev-tile.dragging { opacity: 0.45; transform: scale(0.94); }
.dev-tile.selected {
  border-color: var(--ds-primary);
  box-shadow: 0 0 0 1.5px var(--ds-primary);
}
.dev-tile.pending { animation: grp-join-blink 0.7s ease-in-out infinite; }

@keyframes grp-join-blink {
  0%, 100% { opacity: 1; filter: brightness(1); }
  50% { opacity: 0.35; filter: brightness(1.35); }
}

/* ── 拖拽指引：拖起设备时高亮所有可放置区域 ── */
.grp-dragging .grp-drop {
  border: 1.5px dashed var(--ds-primary);
  border-radius: var(--ds-r-md);
  background: var(--ds-primary-bg);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.grp-dragging .grp-zone-empty {
  color: var(--ds-primary);
}
.grp-dragging .dev-tile:not(.dragging) {
  opacity: 0.65;
}
.grp-dragging .grp-drop.drag-over {
  border-style: solid;
  border-color: var(--ds-primary);
  background: var(--ds-primary-bg);
}

/* ── 设备档案弹窗 ── */

.grp-dev-dialog { width: 560px; }
.grp-dev-head-main {
  display: flex;
  align-items: center;
  gap: var(--ds-sp-3);
  min-width: 0;
}
.grp-dev-head-main h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.grp-dev-section + .grp-dev-section { margin-top: var(--ds-sp-5); }
.grp-dev-section-title {
  font-size: var(--ds-fs-body);
  font-weight: 600;
  color: var(--ds-text-mut);
  margin-bottom: var(--ds-sp-2);
}
.grp-dev-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--ds-sp-2);
}
.grp-dev-cell {
  background: var(--ds-muted-bg);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-r-md);
  padding: var(--ds-sp-2) var(--ds-sp-3);
  min-width: 0;
}
.grp-dev-cell-label {
  font-size: var(--ds-fs-body);
  color: var(--ds-text-light);
  margin-bottom: 2px;
}
.grp-dev-cell-value {
  font-size: var(--ds-fs-body);
  font-weight: 600;
  color: var(--ds-text);
  overflow-wrap: break-word;
}
.grp-dev-cell-value--mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  font-size: var(--ds-fs-body);
  font-weight: 500;
  word-break: break-all;
}
.grp-dev-hint {
  margin: var(--ds-sp-2) 0 0;
  font-size: var(--ds-fs-body);
  color: var(--ds-text-light);
}
.grp-dev-move-controls {
  display: flex;
  gap: var(--ds-sp-2);
}
.grp-dev-move-select { flex: 1; }

/* 滑块扁平化（仅作用设备档案弹窗，遵循设计系统：无阴影/无渐变） */
.grp-dev-lc .lc-slider { margin-bottom: var(--ds-sp-3); }
.grp-dev-lc .lc-slider:last-of-type { margin-bottom: var(--ds-sp-2); }
.grp-dev-lc .lc-slider-head { margin-bottom: var(--ds-sp-1); }
.grp-dev-lc .lc-slider-head label {
  font-size: var(--ds-fs-body);
  font-weight: 500;
  color: var(--ds-text-mut);
}
.grp-dev-lc .lc-val-l,
.grp-dev-lc .lc-slider-head .lc-val-l {
  font-size: var(--ds-fs-title);
  font-weight: 700;
  color: #f59e0b;
}
.grp-dev-lc .lc-val-c,
.grp-dev-lc .lc-slider-head .lc-val-c {
  font-size: var(--ds-fs-title);
  font-weight: 700;
  line-height: 1.2;
}
.grp-dev-lc .lc-slider-track-wrap {
  height: 28px;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border-radius: var(--ds-r-pill);
}
.grp-dev-lc .lc-slider-track-wrap::before {
  left: 0;
  right: 0;
  height: 8px;
  border-radius: var(--ds-r-pill);
  background: var(--ds-border);
}
.grp-dev-lc .lc-slider-track-wrap::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  height: 8px;
  width: var(--fill, 50%);
  border-radius: var(--ds-r-pill);
  background: #f59e0b;
  transform: translateY(-50%);
  pointer-events: none;
}
.grp-dev-lc .lc-slider-track-wrap--c::after { background: var(--ds-primary); }
.grp-dev-lc .lc-range { height: 28px; }
.grp-dev-lc .lc-range::-webkit-slider-runnable-track { height: 8px; }
.grp-dev-lc .lc-range::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -5px;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  background: var(--ds-surface);
  box-shadow: none;
}
.grp-dev-lc .lc-range::-moz-range-track { height: 8px; }
.grp-dev-lc .lc-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  background: var(--ds-surface);
  box-shadow: none;
}
.grp-dev-lc .lc-slider-feet {
  margin-top: 2px;
  font-size: var(--ds-fs-body);
  font-weight: 500;
}
.grp-dev-lc .lc-slider-feet--l .lc-foot-dim,
.grp-dev-lc .lc-slider-feet--l .lc-foot-bright,
.grp-dev-lc .lc-slider-feet--c .lc-foot-warm,
.grp-dev-lc .lc-slider-feet--c .lc-foot-cool {
  color: var(--ds-text-light);
}
.grp-dev-lc-actions {
  display: flex;
  justify-content: flex-end;
}
.grp-dev-foot { justify-content: space-between; }
.grp-dev-foot-right {
  display: flex;
  gap: var(--ds-sp-2);
}

.phase-tag {
  display: inline-block;
  font-size: var(--ds-fs-body);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
  white-space: nowrap;
}

.phase-tag--inline {
  font-size: var(--ds-fs-body);
  vertical-align: middle;
}

.phase-tag--muted {
  background: #f1f5f9;
  color: #64748b;
  border-color: #e2e8f0;
}

.grp-zone-head .phase-tag {
  flex-shrink: 0;
}

/* —— 路线图预览页（# 未开发） —— */
.roadmap-page {
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.roadmap-head h2 {
  margin: 8px 0 6px;
  font-size: var(--ds-fs-display);
}

.roadmap-lead {
  margin: 0;
  color: var(--muted);
  font-size: var(--ds-fs-body);
  line-height: 1.5;
}

.roadmap-doc {
  margin: 8px 0 0;
  font-size: var(--ds-fs-body);
}

.roadmap-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.roadmap-tab {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: var(--ds-fs-body);
  cursor: pointer;
  color: var(--text);
}

.roadmap-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.roadmap-panels { position: relative; }

.roadmap-panel {
  display: none;
}

.roadmap-panel.active {
  display: block;
}

.roadmap-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (max-width: 768px) {
  .roadmap-grid-2 { grid-template-columns: 1fr; }
}

.roadmap-card h3 {
  margin: 0 0 10px;
  font-size: var(--ds-fs-h3);
}

.roadmap-list {
  margin: 0;
  padding-left: 18px;
  font-size: var(--ds-fs-body);
  line-height: 1.65;
  color: var(--text);
}

.roadmap-table { font-size: var(--ds-fs-body); }

.roadmap-card--locked {
  opacity: 0.92;
  cursor: not-allowed;
  position: relative;
}

.roadmap-card--locked .phase-tag {
  position: absolute;
  top: 10px;
  right: 10px;
}

.roadmap-phase-list {
  margin: 0;
  padding-left: 18px;
  font-size: var(--ds-fs-body);
  line-height: 1.7;
}

.ai-page {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 16px;
  height: calc(100vh - 148px);
  min-height: 480px;
}

.ai-suggest-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.ai-suggest-title {
  margin: 0 0 12px;
  font-size: var(--ds-fs-body);
  font-weight: 700;
  color: var(--text);
}

.ai-suggest-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
}

.ai-suggest-btn {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: var(--text);
  font-size: var(--ds-fs-body);
  line-height: 1.45;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.ai-suggest-btn:hover:not(:disabled) {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.ai-suggest-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ai-chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.ai-chat-mock {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 320px;
}

.ai-chat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 2px 12px;
}

.ai-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.ai-status-badge {
  display: inline-block;
  font-size: var(--ds-fs-body);
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.ai-status-badge--ok {
  background: #dcfce7;
  color: #166534;
}

.ai-status-badge--off {
  background: #fef3c7;
  color: #92400e;
}

.ai-bubble--pending {
  opacity: 0.75;
  font-style: italic;
}

.ai-bubble--err {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.ai-chat-head {
  font-size: var(--ds-fs-body);
  font-weight: 700;
  color: var(--muted);
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.ai-bubble {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: var(--ds-fs-body);
  line-height: 1.55;
  max-width: 95%;
}

.ai-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 12px 4px;
  max-width: 92%;
}

.ai-action-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #fff;
  color: #1d4ed8;
  font-size: var(--ds-fs-body);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}

.ai-action-btn:hover:not(:disabled) {
  background: #eff6ff;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.15);
}

.ai-action-btn--primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.ai-action-btn--primary:hover:not(:disabled) {
  background: #1d4ed8;
}

.ai-action-btn--clarify {
  border-color: #c4b5fd;
  color: #5b21b6;
  background: #faf5ff;
}

.ai-action-btn--clarify:hover:not(:disabled) {
  background: #f3e8ff;
}

.ai-action-btn--clarify.ai-action-btn--primary {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
}

.ai-action-btn--clarify.ai-action-btn--primary:hover:not(:disabled) {
  background: #6d28d9;
}

.ai-action-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.ai-bubble--user {
  align-self: flex-end;
  background: #dbeafe;
  color: #1e3a5f;
}

.ai-bubble--bot {
  align-self: flex-start;
  background: #f1f5f9;
  color: var(--text);
}

.ai-chat-input-mock {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.ai-chat-input-mock input {
  flex: 1;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
  font-size: var(--ds-fs-body);
}

.grp-zone-body {
  flex: 1;
  min-height: 96px;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transition: background 0.12s ease, box-shadow 0.12s ease;
}

.grp-zone-body.drag-over {
  background: linear-gradient(145deg, #e8f1ff, #dbeafe);
  box-shadow: var(--shadow-in);
}

/* ── 旧的分组面板样式已迁移至上方 v2 区块 ── */

.grp-edit {
  margin-right: 8px;
  font: inherit;
  font-size: var(--ds-fs-body);
  padding: 7px 10px;
  border: none;
  border-radius: 10px;
  background: var(--bg);
  box-shadow: var(--shadow-in);
  color: var(--text);
  min-width: 96px;
}
.mono { font-family: Consolas, monospace; font-size: var(--ds-fs-body); }

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.filter-row select {
  min-width: 140px;
  padding: 8px 10px;
  border: none;
  border-radius: 12px;
  background: var(--bg);
  box-shadow: var(--shadow-in);
  font-size: var(--ds-fs-body);
  font-family: inherit;
}

.gw-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, #f8fafd, #e6ebf3);
  box-shadow: 5px 5px 14px #c5cdd866, -4px -4px 12px #ffffff;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.gw-list-item:hover {
  transform: translateY(-1px);
  box-shadow: 7px 7px 18px #b8c4d466, -5px -5px 14px #ffffff;
}

.gw-list-item:last-child { margin-bottom: 0; }

/* ── Toast / signal ── */
.signal {
  position: fixed;
  bottom: 28px;
  right: 28px;
  max-width: 420px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, #f8fafd, #e6ebf3);
  box-shadow: var(--shadow-out-lg);
  border: 1px solid #ffffff88;
  font-size: var(--ds-fs-body);
  color: #475569;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  transform: translateY(8px);
}

.signal.show {
  opacity: 1;
  transform: translateY(0);
}
.signal b { color: #059669; }
.signal.err { color: #b91c1c; }
.signal.err b { color: #b91c1c; }

.toast {
  position: fixed;
  top: 80px;
  right: 28px;
  max-width: 380px;
  background: #1e293b;
  color: #fff;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: var(--ds-fs-body);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 100;
}

.toast.show { opacity: 1; }
.toast.err { background: #7f1d1d; }

.hint { font-size: var(--ds-fs-body); color: var(--muted); }
.hidden { display: none !important; }

/* ── Login (desktop) ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: radial-gradient(ellipse at 30% 20%, #fff8f0 0%, var(--bg) 50%);
}

.login-shell {
  display: flex;
  width: 100%;
  max-width: 920px;
  min-height: 480px;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow-shell);
  border: 1px solid #ffffffaa;
}

.login-hero {
  flex: 1;
  background: var(--hero-tint);
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-hero h1 {
  font-size: var(--ds-fs-display-xl);
  color: var(--brand);
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.login-hero p {
  font-size: var(--ds-fs-h3);
  color: var(--muted);
  line-height: 1.7;
}

.login-card {
  width: 380px;
  min-width: 380px;
  padding: 48px 40px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid #ffffff88;
}

.login-card .btn-primary {
  width: 100%;
  padding: 12px 18px;
}

.login-card h2 {
  font-size: var(--ds-fs-display-md);
  margin-bottom: 24px;
  color: var(--text);
}

@media (max-width: 768px) {
  .login-shell { flex-direction: column; max-width: 400px; }
  .login-hero { padding: 32px 28px; }
  .login-card { width: 100%; min-width: 0; }
}

/* ── Responsive sidebar collapse ── */
@media (max-width: 900px) {
  .sidebar {
    width: 76px;
    min-width: 76px;
  }
  .sidebar-brand > div,
  .brand-sub,
  .nav-group-label,
  .sidebar-foot .hint,
  .nav-label { display: none; }
  .nav-item {
    justify-content: center;
    padding: 10px 8px;
  }
  .nav-item:hover { transform: translateY(-2px); }
  .brand-title { display: none; }
  .sidebar-foot .version-tag { font-size: 0; }
}

/* ── Analytics charts ── */
.analytics-filters select { min-width: 160px; }
.analytics-chart-wrap { margin-top: 20px; }
.analytics-chart-title {
  font-size: var(--ds-fs-body);
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text);
}
.analytics-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}
.chart-bar-row {
  display: grid;
  grid-template-columns: 52px 1fr 72px;
  gap: 10px;
  align-items: center;
  font-size: var(--ds-fs-body);
}
.chart-bar-label { color: var(--muted); text-align: right; }
.chart-bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
}
.chart-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), #6ea8ff);
  min-width: 2px;
}
.chart-bar-val {
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  font-weight: 600;
}

.analytics-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 8px 0 12px;
}

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}

.view-toggle-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  font-size: var(--ds-fs-body);
  cursor: pointer;
  color: var(--muted);
}

.view-toggle-btn.active {
  background: var(--brand);
  color: #fff;
}

.analytics-viz-wrap,
.analytics-breakdown-wrap {
  margin-top: 18px;
}

.analytics-viz {
  min-height: 220px;
}

.col-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 220px;
  padding: 8px 4px 0;
  overflow-x: auto;
}

.col-chart-item {
  flex: 1 1 28px;
  min-width: 22px;
  max-width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.col-chart-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.col-chart-bar {
  width: 72%;
  min-height: 2px;
  border-radius: 6px 6px 2px 2px;
  transition: height 0.2s ease;
}

.col-chart-label {
  font-size: var(--ds-fs-body);
  color: var(--muted);
  margin-top: 6px;
  white-space: nowrap;
  transform: rotate(-45deg);
  transform-origin: top center;
  height: 28px;
}

.pie-chart-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.pie-chart {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.pie-legend {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.pie-legend-item {
  display: grid;
  grid-template-columns: 14px 1fr auto auto;
  gap: 8px;
  align-items: center;
  font-size: var(--ds-fs-body);
}

.pie-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.pie-pct {
  color: var(--muted);
  font-size: var(--ds-fs-body);
}

.analytics-drill-table .drill-row {
  cursor: pointer;
}

.analytics-drill-table .drill-row:hover {
  background: rgba(37, 99, 235, 0.06);
}

.col-chart-item--drill {
  cursor: pointer;
}

.col-chart-item--drill:hover .col-chart-bar {
  filter: brightness(1.08);
}

.pie-legend-item--drill {
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 4px;
}

.pie-legend-item--drill:hover {
  background: rgba(37, 99, 235, 0.06);
}

.linkish {
  color: var(--brand);
  font-size: var(--ds-fs-body);
}

/* ── Analytics hub (compare-first) ── */
.card-sub {
  margin: 4px 0 0;
  font-size: var(--ds-fs-body);
}

.analytics-hub .card-head {
  align-items: flex-start;
  gap: 16px;
}

.seg-period {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}

.seg-period-btn {
  border: none;
  background: transparent;
  padding: 7px 14px;
  font-size: var(--ds-fs-body);
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
}

.seg-period-btn.active {
  background: var(--brand);
  color: #fff;
}

.analytics-insight {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  margin: 4px 0 16px;
  font-size: var(--ds-fs-body);
  line-height: 1.45;
  border: 1px solid transparent;
}

.analytics-insight.hidden { display: none; }

.analytics-insight--normal {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
  color: #065f46;
}

.analytics-insight--high {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.22);
  color: #991b1b;
}

.analytics-insight--low {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.18);
  color: #1e40af;
}

.analytics-insight-ico { font-size: 18px; flex-shrink: 0; }

.analytics-split,
.analytics-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 4px;
}

.analytics-panel {
  background: var(--card);
  border-radius: 16px;
  border: 1px solid #ffffff99;
  box-shadow: var(--shadow-out);
  padding: 16px 16px 12px;
}

.analytics-panel--scope {
  min-height: 260px;
}

.analytics-panel--spatial {
  min-height: 200px;
}

.analytics-viz--scope {
  min-height: 260px;
}

.analytics-viz--spatial {
  min-height: 180px;
}

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

.panel-head h3 {
  margin: 0;
  font-size: var(--ds-fs-body);
  font-weight: 700;
  color: var(--text);
}

.panel-hint {
  font-size: var(--ds-fs-body);
  color: var(--muted);
  white-space: nowrap;
}

.panel-desc {
  margin: 0 0 10px;
  font-size: var(--ds-fs-body);
}

.compare-chart {
  position: relative;
  padding-top: 8px;
  overflow: hidden;
}

.compare-chart--mini {
  padding-top: 4px;
  overflow: hidden;
}

.compare-avg-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 2px dashed rgba(37, 99, 235, 0.45);
  pointer-events: none;
  z-index: 2;
}

.compare-avg-tag {
  position: absolute;
  right: 0;
  top: -18px;
  font-size: var(--ds-fs-body);
  color: var(--brand);
  background: rgba(255, 255, 255, 0.92);
  padding: 1px 6px;
  border-radius: 4px;
}

.compare-col-chart { height: 240px; }

.col-chart-bar--current {
  background: linear-gradient(180deg, #ff9a5c, var(--brand)) !important;
  box-shadow: 0 2px 8px var(--brand-glow);
}

.col-chart-bar--hist {
  background: linear-gradient(180deg, #c5d0e0, #94a3b8) !important;
}

.col-chart-label--current {
  color: var(--brand);
  font-weight: 700;
  transform: none;
  height: auto;
}

.delta-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: var(--ds-fs-body);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.delta-badge--up {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.delta-badge--down {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.delta-badge--flat {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}

.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: var(--ds-fs-body);
  font-weight: 600;
}

.status-pill--normal { background: rgba(16, 185, 129, 0.12); color: #047857; }
.status-pill--high { background: rgba(239, 68, 68, 0.12); color: #b91c1c; }
.status-pill--low { background: rgba(37, 99, 235, 0.12); color: #1d4ed8; }

.stat-card.warn .stat-ico {
  background: linear-gradient(145deg, #fca5a5, #ef4444);
  box-shadow: 3px 3px 10px #ef444444;
}

.stat-card.warn .value { color: #dc2626; }

.stat-card.delta-up .value { color: #dc2626; }
.stat-card.delta-down .value { color: #2563eb; }

.spatial-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.spatial-chart-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px 12px;
  transition: box-shadow 0.16s ease, transform 0.16s ease;
  overflow: hidden;
}

.spatial-chart-card--drill {
  cursor: pointer;
}

.spatial-chart-card--drill:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.25);
}

.spatial-chart-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: var(--ds-fs-body);
}

.spatial-chart-head b { flex: 1; }

.spatial-drill-hint { margin-left: auto; }

.spatial-chart-meta {
  font-size: var(--ds-fs-body);
  color: var(--muted);
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.compare-col-chart--layer {
  height: 160px;
  gap: 4px;
  padding: 4px 2px 0;
}

.compare-col-chart--layer .col-chart-item {
  min-width: 20px;
  max-width: 36px;
}

.compare-col-chart--layer .col-chart-label {
  font-size: var(--ds-fs-body);
  height: 26px;
  transform: rotate(-40deg);
}

.compare-col-chart--mini {
  display: flex;
  align-items: flex-end;
  height: 72px;
  gap: 2px;
  padding: 2px 0 0;
  overflow: hidden;
}

.col-chart-item--mini {
  flex: 1 1 8px;
  min-width: 8px;
  max-width: 16px;
  height: 100%;
}

.col-chart-item--mini .col-chart-bar { width: 85%; }

.compare-col-chart--mini .col-chart-label {
  font-size: var(--ds-fs-body);
  height: 22px;
  transform: rotate(-50deg);
}

/* ── Scene settings ── */
.scene-hub .card-head { align-items: flex-start; gap: 16px; }

.scene-packages {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 16px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.scene-pkg-section { display: flex; flex-direction: column; gap: 10px; }

.scene-pkg-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.scene-pkg-title {
  margin: 0;
  font-size: var(--ds-fs-h3);
  font-weight: 600;
}

.scene-pkg-hint { margin: 4px 0 0; font-size: var(--ds-fs-body); }

.scene-pkg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
}

.scene-pkg-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  text-align: left;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}

.scene-pkg-card:hover {
  border-color: rgba(37, 99, 235, .35);
  box-shadow: 0 4px 14px rgba(37, 99, 235, .08);
  transform: translateY(-1px);
}

.scene-pkg-card--default {
  border-color: rgba(16, 185, 129, .35);
  background: rgba(16, 185, 129, .04);
}

.scene-pkg-icon { font-size: 22px; line-height: 1; }

.scene-pkg-name {
  font-size: var(--ds-fs-body);
  font-weight: 600;
  color: var(--text);
}

.scene-pkg-name em {
  font-style: normal;
  font-size: var(--ds-fs-body);
  font-weight: 500;
  color: #059669;
  margin-left: 4px;
}

.scene-pkg-desc,
.scene-pkg-summary {
  font-size: var(--ds-fs-body);
  line-height: 1.35;
  color: var(--muted);
}

.scene-custom-empty-wrap { padding: 4px 0; }

.scene-custom-empty { padding: 8px 0; }

.scene-pkg-card--custom {
  padding: 0;
  overflow: hidden;
  cursor: default;
}

.scene-pkg-card--custom:hover {
  transform: none;
}

.scene-pkg-card-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 12px 14px 8px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.scene-pkg-card-main:hover .scene-pkg-name {
  color: var(--primary, #2563eb);
}

.scene-pkg-card--custom:hover {
  border-color: rgba(37, 99, 235, .35);
  box-shadow: 0 4px 14px rgba(37, 99, 235, .08);
}

.scene-pkg-card-foot {
  display: flex;
  gap: 6px;
  width: 100%;
  padding: 0 10px 10px;
  border-top: 1px solid rgba(0, 0, 0, .04);
  margin-top: 2px;
  padding-top: 8px;
}

.scene-pkg-foot-btn {
  flex: 1;
  padding: 4px 6px;
  font-size: var(--ds-fs-body);
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.scene-pkg-foot-btn:hover {
  color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, .06);
}

.scene-pkg-foot-btn--danger:hover {
  color: #dc2626;
  background: rgba(239, 68, 68, .06);
}

.scene-status {
  padding: 12px 16px;
  border-radius: 14px;
  margin-bottom: 16px;
  font-size: var(--ds-fs-body);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scene-status--ok { background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.2); color: #065f46; }
.scene-status--pending { background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.22); color: #92400e; }
.scene-status--busy { background: rgba(37,99,235,.08); border: 1px solid rgba(37,99,235,.18); color: #1e40af; }
.scene-status--err { background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.2); color: #991b1b; }

.scene-slot-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.scene-slot-tab {
  border: 1px solid #d8e0ec;
  background: linear-gradient(145deg, #f5f8fc, #dfe6f0);
  border-radius: 14px;
  padding: 12px 20px;
  min-height: 48px;
  font-size: var(--ds-fs-h3);
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 4px 4px 10px #c5cdd855, -2px -2px 8px #ffffff;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.scene-slot-tab.active {
  background: var(--primary-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 16px var(--primary-glow);
}

.scene-hero {
  margin-bottom: 12px;
}

.scene-hero h3 { margin: 0 0 4px; font-size: var(--ds-fs-title); }

.scene-lux-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
  font-size: var(--ds-fs-body);
}

.scene-group-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.scene-group-row {
  display: grid;
  grid-template-columns: 72px 56px 1fr 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.scene-grp-name { font-size: var(--ds-fs-body); font-weight: 600; }

.scene-grp-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--ds-fs-body);
  color: var(--muted);
}

.scene-grp-field--l,
.scene-grp-field--c {
  display: block;
  flex: 1;
  min-width: 148px;
}

.scene-grp-field--l .lc-slider-head,
.scene-grp-field--c .lc-slider-head {
  margin-bottom: 4px;
}

.scene-grp-field--l .lc-val-l,
.scene-grp-field--c .lc-val-c {
  font-size: var(--ds-fs-title);
}

.scene-grp-field input[type=range]:not(.lc-range) { flex: 1; }

.scene-grp-field b:not(.lc-val-l):not(.lc-val-c) {
  min-width: 36px;
  text-align: right;
  color: var(--text);
}

.scene-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.scene-actions .hint { margin-right: auto; }

@media (max-width: 900px) {
  .scene-group-row { grid-template-columns: 1fr; }
}

/* ── Sensor linkage (highlight UI) ── */
.sensor-hub {
  margin-bottom: 32px;
  padding-bottom: 8px;
}

.sensor-hub .scene-packages {
  margin-bottom: 20px;
}

#sensorPanels {
  min-height: 0;
}

.sensor-hub-notice {
  margin: 0 0 16px;
}

.sensor-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 20px 0 0;
  padding: 10px;
  border-radius: 18px;
  background: linear-gradient(145deg, #eef2f8, #e4eaf2);
  box-shadow: var(--shadow-in);
  border: 1px solid #ffffffaa;
}

@media (max-width: 980px) {
  .sensor-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .sensor-tabs {
    grid-template-columns: 1fr;
  }
}

.sensor-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  border: 1px solid transparent;
  background: linear-gradient(145deg, #f8fafc88, #eef2f844);
  color: var(--muted);
  border-radius: 14px;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition:
    background 0.2s,
    color 0.2s,
    box-shadow 0.2s,
    border-color 0.2s,
    transform 0.15s;
}

.sensor-tab:hover {
  color: var(--text);
  background: linear-gradient(145deg, #ffffff, #f1f5f9);
  box-shadow: var(--shadow-out);
  transform: translateY(-1px);
}

.sensor-tab-icon {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 18px;
  background: linear-gradient(145deg, #ffffff, #e8eef6);
  box-shadow: var(--shadow-in);
  border: 1px solid #ffffffcc;
}

.sensor-tab-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sensor-tab-title {
  display: block;
  font-size: var(--ds-fs-body);
  font-weight: 700;
  line-height: 1.2;
  color: inherit;
}

.sensor-tab-desc {
  display: block;
  font-size: var(--ds-fs-body);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--section);
  opacity: 0.92;
}

.sensor-tab.active {
  color: #fff;
  border-color: #ffffff55;
  box-shadow:
    0 8px 22px #2563eb33,
    inset 0 1px 0 #ffffff55;
  transform: none;
}

.sensor-tab.active .sensor-tab-desc {
  color: #ffffffcc;
}

.sensor-tab.active .sensor-tab-icon {
  background: #ffffff22;
  box-shadow: inset 0 1px 0 #ffffff66;
  border-color: #ffffff44;
}

.sensor-tab[data-tab="board"].active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.sensor-tab[data-tab="presence"].active {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  box-shadow: 0 8px 22px #0ea5e944;
}

.sensor-tab[data-tab="lux"].active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 8px 22px #f59e0b44;
}

.sensor-tab[data-tab="schedule"].active {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  box-shadow: 0 8px 22px #8b5cf644;
}

.sensor-tab[data-tab="hardware"].active {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  box-shadow: 0 8px 22px #64748b44;
}

.sensor-tab[data-tab="slots"].active {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  box-shadow: 0 8px 22px #0d948844;
}

.sensor-panel { display: none; }
.sensor-panel.active { display: block; }

.sensor-panel-shell {
  padding: 20px 4px 32px;
  min-height: 0;
}

.sensor-panel-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  margin-bottom: 24px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f8fafc 0%, #eef4ff 55%, #fff8f0 100%);
  box-shadow: var(--shadow-out);
  border: 1px solid #ffffffaa;
}

.sensor-panel-hero--presence { border-left: 4px solid #0ea5e9; }
.sensor-panel-hero--lux { border-left: 4px solid #f59e0b; }
.sensor-panel-hero--schedule { border-left: 4px solid #8b5cf6; }
.sensor-panel-hero--hardware { border-left: 4px solid #64748b; }
.sensor-panel-hero--slots { border-left: 4px solid #0d9488; }
.sensor-panel-hero--board { border-left: 4px solid #2563eb; }

.sensor-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.sensor-slot-card {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-out);
}

.sensor-slot-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.sensor-slot-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 12px;
}

.sensor-slot-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--ds-fs-body);
}

.sensor-slot-scope { min-width: 140px; margin: 0; }

.sensor-slot-lc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sensor-hw-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.sensor-hw-compare-col--hb .sensor-param-kicker { color: #0d9488; }

.sensor-hw-compare-val {
  display: block;
  margin-top: 4px;
  font-size: var(--ds-fs-body);
  font-weight: 600;
  color: #334155;
}

.sensor-hero-tag {
  display: inline-block;
  font-size: var(--ds-fs-body);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 6px;
}

.sensor-panel-hero-copy h3 {
  margin: 0 0 8px;
  font-size: var(--ds-fs-title);
  font-weight: 700;
}

.sensor-panel-hero-copy p { margin: 0; max-width: 560px; line-height: 1.5; }

.sensor-state-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #ffffff88;
  box-shadow: var(--shadow-in);
}

.ssf-node {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: var(--ds-fs-body);
  font-weight: 600;
  white-space: nowrap;
}

.ssf-node--detect { background: #dbeafe; color: #1d4ed8; }
.ssf-node--on { background: #fef3c7; color: #b45309; }
.ssf-node--wait { background: #ffedd5; color: #c2410c; }
.ssf-node--m { background: #fce7f3; color: #be185d; }
.ssf-node--off { background: #e2e8f0; color: #475569; }
.ssf-arrow { color: var(--section); font-size: var(--ds-fs-body); }

.sensor-policy-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  align-items: start;
}

.sensor-policy-grid--tall { align-items: stretch; }

@media (max-width: 1100px) {
  .sensor-policy-grid { grid-template-columns: 1fr; }
}

.sensor-policy-card {
  padding: 24px;
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-out);
  min-height: 0;
  height: auto;
}

.sensor-policy-card--primary {
  border-top: 3px solid var(--primary);
}

.sensor-policy-card--secondary {
  border-top: 3px solid #94a3b8;
}

.sensor-card-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid #d8e0ec88;
}

.sensor-card-icon {
  font-size: 28px;
  line-height: 1;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-in);
}

.sensor-card-head h3 { margin: 0 0 4px; font-size: var(--ds-fs-title); }

.sensor-param-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 700px) {
  .sensor-param-grid { grid-template-columns: 1fr; }
}

.sensor-param-card {
  padding: 18px;
  border-radius: var(--radius-sm);
  background: linear-gradient(160deg, #ffffff 0%, #f1f5f9 100%);
  box-shadow: var(--shadow-in);
}

.sensor-param-card--compact { padding: 14px 16px; }

.sensor-param-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.sensor-param-kicker {
  font-size: var(--ds-fs-body);
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.04em;
}

.sensor-param-big {
  font-size: var(--ds-fs-display);
  font-weight: 800;
  color: var(--text);
}

.sensor-param-desc { margin: 0 0 12px; font-size: var(--ds-fs-body); }

.sensor-flow-hint {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(145deg, #f0f9ff, #e0f2fe);
  border: 1px solid #bae6fd;
  color: #0369a1;
  font-size: var(--ds-fs-body);
  font-weight: 600;
}

.sensor-presence-nm {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 720px) {
  .sensor-presence-nm {
    grid-template-columns: 1fr;
  }
}

.sensor-presence-advanced,
.sensor-advanced {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--card, #fff);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--shadow-in, none);
}

.sensor-presence-advanced > summary,
.sensor-advanced > summary {
  cursor: pointer;
  font-weight: 700;
  font-size: var(--ds-fs-body);
  color: var(--text-muted, #64748b);
  list-style: none;
}

.sensor-presence-advanced > summary::-webkit-details-marker,
.sensor-advanced > summary::-webkit-details-marker {
  display: none;
}

.sensor-advanced-body {
  margin-top: 12px;
}

.sensor-advanced-toolbar {
  margin: 8px 0 12px;
}

.sensor-presence-flow {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sensor-flow-step--timing {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 4px 0 12px 20px;
  margin-left: 18px;
  border-left: 3px dashed #cbd5e1;
}

.sensor-flow-arrow {
  flex-shrink: 0;
  width: 28px;
  margin-top: 18px;
  text-align: center;
  font-size: var(--ds-fs-display-md);
  line-height: 1;
  color: var(--primary);
  font-weight: 700;
}

.sensor-param-card--flow {
  flex: 1;
  min-width: 0;
}

.sensor-flow-step + .sensor-flow-step {
  margin-top: 4px;
}

.sensor-flow-step--timing + .sensor-flow-step {
  margin-top: 0;
}

.sp-range-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: var(--ds-fs-body);
  color: var(--section);
}

.sensor-action-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sensor-action-card {
  padding: 18px;
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow-out);
  border-left: 4px solid var(--primary);
}

.sensor-action-card--on { border-left-color: #f59e0b; }
.sensor-action-card--wait { border-left-color: #f97316; }
.sensor-action-card--off { border-left-color: #64748b; }

.sensor-action-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.sensor-action-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: var(--ds-fs-body);
  font-weight: 800;
  background: var(--primary-grad);
  color: #fff;
}

.sensor-action-card--on .sensor-action-badge { background: linear-gradient(145deg, #fbbf24, #f59e0b); }
.sensor-action-card--wait .sensor-action-badge { background: linear-gradient(145deg, #fb923c, #ea580c); }
.sensor-action-card--off .sensor-action-badge { background: linear-gradient(145deg, #94a3b8, #64748b); }

.sp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 120px;
}

.sp-field--grow { flex: 1; min-width: 0; }

.sp-field-label {
  font-size: var(--ds-fs-body);
  font-weight: 700;
  color: var(--label);
  letter-spacing: 0.03em;
}

.sp-select,
.sp-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d8e0ec;
  background: #fff;
  font-size: var(--ds-fs-body);
  color: var(--text);
  box-shadow: var(--shadow-in);
}

.sp-range-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.sp-range-label {
  min-width: 56px;
  font-size: var(--ds-fs-body);
  font-weight: 600;
  color: var(--label);
}

.sp-range {
  flex: 1;
  height: 6px;
  accent-color: var(--primary);
  cursor: pointer;
}

.sp-range--wide { width: 100%; margin-top: 4px; }

.sp-range-val {
  min-width: 44px;
  text-align: right;
  font-size: var(--ds-fs-body);
  font-weight: 700;
  color: var(--primary);
}

.sp-action-fields { display: flex; flex-direction: column; gap: 12px; }

.sp-action-body { padding-top: 4px; }

.sp-toggle-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--ds-fs-body);
  cursor: pointer;
}

.sensor-grp-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sensor-grp-card {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow-in);
  border: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.sensor-grp-card--open {
  border-color: #93c5fd;
  box-shadow: var(--shadow-out);
}

.sensor-grp-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.sensor-grp-toggle input { position: absolute; opacity: 0; pointer-events: none; }

.sensor-grp-toggle-ui {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}

.sensor-grp-toggle-ui::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px #00000022;
  transition: transform 0.2s;
}

.sensor-grp-card--open .sensor-grp-toggle-ui {
  background: var(--primary);
}

.sensor-grp-card--open .sensor-grp-toggle-ui::after {
  transform: translateX(20px);
}

.sensor-grp-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sensor-grp-toggle-text em {
  font-size: var(--ds-fs-body);
  color: var(--muted);
  font-style: normal;
}

.sensor-grp-body {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed #d8e0ec;
}

.sensor-grp-body.hidden { display: none; }

/* Lux gauge */
.sensor-lux-gauge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
  margin-bottom: 24px;
  padding: 20px;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, #fffbeb, #fef3c7);
  box-shadow: var(--shadow-in);
}

.sensor-lux-gauge-ring {
  --lux-pct: 43%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(#f59e0b 0 calc(var(--lux-pct) * 1%), #e2e8f0 calc(var(--lux-pct) * 1%) 100%);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-out);
}

.sensor-lux-gauge-inner {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-in);
}

.sensor-lux-gauge-val {
  font-size: var(--ds-fs-display-lg);
  font-weight: 800;
  color: #b45309;
  line-height: 1;
}

.sensor-lux-gauge-unit {
  font-size: var(--ds-fs-body);
  color: var(--muted);
  margin-top: 2px;
}

.sensor-lux-gauge-side { flex: 1; min-width: 200px; }

.sensor-lux-params {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 700px) {
  .sensor-lux-params { grid-template-columns: 1fr; }
}

/* Schedule */
.sensor-sched-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sensor-sched-card {
  padding: 20px 22px;
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-out);
}

.sensor-sched-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.sensor-sched-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.sensor-sched-badge {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: var(--ds-fs-body);
  font-weight: 700;
}

.sensor-sched-badge--on { background: #dcfce7; color: #15803d; }
.sensor-sched-badge--off { background: #fee2e2; color: #b91c1c; }

.sensor-sched-time {
  font-size: var(--ds-fs-h3);
  font-weight: 700;
  color: var(--text);
}

.sensor-sched-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.sensor-sched-detail {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #d8e0ec;
}

.sch-weekdays--pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.sch-wd-pill span {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: var(--ds-fs-body);
  font-weight: 600;
  background: #e2e8f0;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}

.sch-wd-pill input { display: none; }

.sch-wd-pill--on span {
  background: var(--primary-grad);
  color: #fff;
}

.sch-nm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
}

/* Hardware */
.sensor-hw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 720px), 1fr));
  gap: 20px;
  width: 100%;
}

.sensor-hw-card {
  position: relative;
  overflow: hidden;
  padding: 22px 24px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: var(--shadow-out);
  border: 1px solid #ffffffcc;
}

.sensor-hw-card-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #0ea5e9 0%, #64748b 100%);
}

.sensor-hw-card-head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 20px;
  padding-left: 6px;
}

.sensor-hw-head-copy {
  flex: 1;
  min-width: 0;
}

.sensor-hw-head-copy strong {
  display: block;
  font-size: var(--ds-fs-title);
  margin-bottom: 2px;
}

.sensor-hw-meta {
  display: block;
  font-size: var(--ds-fs-body);
  color: var(--section);
}

.sensor-hw-badge {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: var(--ds-fs-body);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0369a1;
  background: linear-gradient(145deg, #e0f2fe, #bae6fd);
  box-shadow: var(--shadow-in);
}

.sensor-hw-icon {
  flex: 0 0 52px;
  font-size: 28px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, #f0f9ff, #dbeafe);
  box-shadow: var(--shadow-in);
  border: 1px solid #ffffffaa;
}

.sensor-hw-param-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 760px) {
  .sensor-hw-param-grid {
    grid-template-columns: 1fr;
  }
}

.sensor-hw-param {
  margin: 0;
  min-height: 168px;
}

.sensor-hw-param--dist .sensor-param-kicker { color: #0284c7; }
.sensor-hw-param--sens .sensor-param-kicker { color: #64748b; }

.sensor-hw-value-line {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.sensor-hw-unit {
  font-size: var(--ds-fs-body);
  font-weight: 700;
  color: var(--section);
}

.sp-range-ticks--dense span { flex: 1; text-align: center; }
.sp-range-ticks--dense span:first-child { text-align: left; }
.sp-range-ticks--dense span:last-child { text-align: right; }

/* 硬件滑条 — Neu 凹槽 + 主题渐变轨 + Studio 白 thumb */
.sp-hw-track-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 4px;
  margin-top: 4px;
  border-radius: 12px;
  background: #c5cedb;
  box-shadow: inset 0 2px 4px #8fa0b866, inset 0 1px 0 #ffffff55;
}

.sp-hw-track-wrap::before {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 12px;
  border-radius: 6px;
  transform: translateY(-50%);
  pointer-events: none;
}

.sp-hw-track-wrap--dist::before {
  background: linear-gradient(90deg, #0c4a6e 0%, #0284c7 45%, #7dd3fc 100%);
}

.sp-hw-track-wrap--sens::before {
  background: linear-gradient(90deg, #334155 0%, #64748b 50%, #cbd5e1 100%);
}

.sp-hw-range {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  z-index: 1;
  width: 100%;
  height: 44px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.sp-hw-range:focus { outline: none; }

.sp-hw-range::-webkit-slider-runnable-track {
  height: 12px;
  background: transparent;
  border: none;
}

.sp-hw-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -6px;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 2px 4px #33000000,
    0 0 0 5px #ffffff55;
}

.sp-hw-range::-moz-range-track {
  height: 12px;
  background: transparent;
  border: none;
}

.sp-hw-range::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.2),
    0 0 0 5px rgba(255, 255, 255, 0.33);
}

/* Board */
.sensor-legend--inline { margin: 0; }

.sensor-board--tall .grp-zone-body { min-height: 100px; }

.sensor-master-wrap { margin-bottom: 20px; }

.sensor-zone--master {
  min-height: 120px;
  background: linear-gradient(145deg, #f0f9ff, #e0f2fe);
}

.sensor-zone-grid .grp-zone { min-height: 140px; }

.sensor-section-label { margin: 8px 0 14px; font-weight: 600; }

.sensor-drag-hint {
  text-align: center;
  margin-top: 16px;
  padding: 10px;
  border-radius: 10px;
  background: #f8fafc;
}

.sensor-tile {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 88px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: grab;
  font-size: var(--ds-fs-body);
  box-shadow: var(--shadow-out);
  transition: transform 0.15s, box-shadow 0.15s;
}

.sensor-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-out-lg);
}

.sensor-tile.dragging { opacity: 0.55; transform: scale(0.96); }

.sensor-tile--presence { border-color: #7dd3fc; background: linear-gradient(160deg, #fff, #f0f9ff); }
.sensor-tile--lux { border-color: #fcd34d; background: linear-gradient(160deg, #fff, #fffbeb); }
.sensor-tile--panel { border-color: #c4b5fd; background: linear-gradient(160deg, #fff, #f5f3ff); }

.sensor-tile-ico { font-size: 22px; }
.sensor-tile-name { font-weight: 700; text-align: center; max-width: 100px; }
.sensor-tile-meta { font-size: var(--ds-fs-body); color: var(--muted); }

.sensor-chip {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
}

.sensor-chip--presence { background: #0ea5e9; }
.sensor-chip--lux { background: #f59e0b; }
.sensor-chip--panel { background: #8b5cf6; }

.sensor-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 200px;
  padding: 40px 24px;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, #f8fafc, #eef2f7);
  box-shadow: var(--shadow-in);
  text-align: center;
}

.sensor-empty-icon { font-size: 40px; opacity: 0.7; }

.sensor-empty p { margin: 0; font-weight: 600; font-size: var(--ds-fs-h3); }

.hidden { display: none !important; }

@media (max-width: 900px) {
  .sensor-panel-hero { flex-direction: column; }
  .sensor-state-flow { width: 100%; }
}

/* ── Premises Governance (设备权限) ── */
.gov-hub {
  margin-bottom: 32px;
  padding-bottom: 8px;
}

.gov-handover-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0 12px;
  padding: 14px 18px;
  border-radius: 14px;
  background: linear-gradient(145deg, #f0fdf4, #dcfce7);
  border: 1px solid #bbf7d0;
}

.gov-handover-banner--cloud {
  background: linear-gradient(145deg, #eff6ff, #dbeafe);
  border-color: #93c5fd;
}

.gov-handover-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gov-handover-copy strong {
  font-size: var(--ds-fs-h3);
  color: var(--text);
}

.gov-handover-copy span {
  font-size: var(--ds-fs-body);
  color: var(--muted);
}

#govPanels .gov-panel[data-panel="showcase"].active {
  min-height: auto;
}

#govShowcasePanel {
  width: 100%;
}

.gov-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 20px 0 0;
  padding: 10px;
  border-radius: 18px;
  background: linear-gradient(145deg, #eef2f8, #e4eaf2);
  box-shadow: var(--shadow-in);
  border: 1px solid #ffffffaa;
}

@media (max-width: 980px) {
  .gov-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .gov-tabs { grid-template-columns: 1fr; }
}

.gov-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  border: 1px solid transparent;
  background: linear-gradient(145deg, #f8fafc88, #eef2f844);
  color: var(--muted);
  border-radius: 14px;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s, transform 0.15s;
}

.gov-tab:hover {
  color: var(--text);
  background: linear-gradient(145deg, #ffffff, #f1f5f9);
  box-shadow: var(--shadow-out);
  transform: translateY(-1px);
}

.gov-tab.active {
  color: var(--text);
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  border-color: #cbd5e1;
  box-shadow: var(--shadow-out);
}

.gov-tab-icon {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 18px;
  background: linear-gradient(145deg, #fff, #f1f5f9);
  box-shadow: var(--shadow-in);
}

.gov-tab-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.gov-tab-title { font-size: var(--ds-fs-body); font-weight: 700; }
.gov-tab-desc { font-size: var(--ds-fs-body); color: var(--muted); }

.gov-panel { display: none; padding-top: 18px; }
.gov-panel.active { display: block; }

.gov-panel-body { padding: 4px 2px 12px; }

.gov-panel-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(145deg, #fef2f2, #fee2e2);
  border: 1px solid #fecaca;
}

.gov-panel-hero-copy h3 { margin: 6px 0 4px; font-size: var(--ds-fs-title); }
.gov-hero-tag {
  display: inline-block;
  font-size: var(--ds-fs-body);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b91c1c;
}

.gov-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

@media (max-width: 820px) {
  .gov-stat-grid { grid-template-columns: 1fr; }
}

.gov-stat-card {
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(145deg, #fff, #f8fafc);
  box-shadow: var(--shadow-out);
  border: 1px solid var(--border);
}

.gov-stat-k {
  display: block;
  font-size: var(--ds-fs-body);
  color: var(--muted);
  margin-bottom: 6px;
}

.gov-stat-v {
  display: block;
  font-size: var(--ds-fs-display-md);
  margin-bottom: 4px;
}

.gov-rank-line {
  margin: 0 0 6px;
  font-size: var(--ds-fs-body);
  font-weight: 600;
}

.gov-rank-line span { color: var(--muted); margin: 0 4px; }

.gov-section-label { margin: 0 0 10px; font-weight: 600; }

.gov-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.gov-preset-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow-out);
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.gov-preset-card:hover:not(.disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-out-lg);
}

.gov-preset-card.active {
  border-color: #3b82f6;
  background: linear-gradient(160deg, #fff, #eff6ff);
}

.gov-preset-card.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.gov-preset-ico { font-size: 22px; margin-bottom: 4px; }
.gov-preset-card strong { font-size: var(--ds-fs-body); }
.gov-preset-card small { font-size: var(--ds-fs-body); color: var(--muted); line-height: 1.35; }

.gov-deny-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gov-deny-chip {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: var(--ds-fs-body);
  background: #f1f5f9;
  color: var(--muted);
  border: 1px solid #e2e8f0;
}

.gov-deny-chip--on {
  background: linear-gradient(145deg, #fef2f2, #fee2e2);
  color: #b91c1c;
  border-color: #fecaca;
  font-weight: 600;
}

.gov-gate-form {
  padding: 18px;
  border-radius: 14px;
  background: linear-gradient(145deg, #f8fafc, #eef2f7);
  box-shadow: var(--shadow-in);
}

.gov-form-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

@media (max-width: 820px) {
  .gov-form-row { grid-template-columns: 1fr; }
}

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

/* 设备禁用（0x7A）下发卡片 */
.gov-dis-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line, #e3e8ef);
  border-radius: 10px;
  background: var(--card-2, #f7f9fc);
}

.gov-dis-box .btn {
  align-self: flex-start;
}

@media (max-width: 620px) {
  .gov-deny-grid { grid-template-columns: 1fr; }
}

.gov-deny-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: var(--ds-fs-body);
}

.gov-deny-toggle input { accent-color: #dc2626; }

.gov-deny-toggle--ro {
  opacity: 0.92;
  cursor: default;
}

.gov-gate-form--readonly {
  margin-top: 12px;
}

.gov-readonly-hint { margin: 0 0 12px; }

.gov-form-row--readonly {
  margin-bottom: 14px;
}

.gov-readonly-field {
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
}

.gov-readonly-field strong {
  display: block;
  margin-top: 6px;
  font-size: var(--ds-fs-body);
}

.gov-handover-inline {
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(145deg, #f0fdf4, #dcfce7);
  border: 1px solid #bbf7d0;
  margin-bottom: 4px;
}

.gov-handover-inline p { margin: 0 0 6px; }
.gov-handover-inline p:last-child { margin-bottom: 0; }

.gov-pairs-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.gov-pairs-table { margin: 0; }
.gov-pair-row--bad { background: #fef2f2; }
.gov-pair-slot {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: var(--ds-fs-body);
  background: #f1f5f9;
}

.gov-showcase-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.gov-showcase-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 16px;
  background: linear-gradient(145deg, #fff7ed, #ffedd5);
  border: 1px solid #fed7aa;
  box-shadow: var(--shadow-out);
}

.gov-showcase-hero-ico {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  font-size: 26px;
  border-radius: 16px;
  background: linear-gradient(145deg, #fff, #ffedd5);
  box-shadow: var(--shadow-in);
}

.gov-showcase-hero-title {
  margin: 0 0 4px;
  font-size: var(--ds-fs-title);
  font-weight: 800;
  color: #9a3412;
}

.gov-showcase-notice {
  padding: 18px 20px 16px;
  border-radius: 14px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-left: 4px solid #f59e0b;
  line-height: 1.55;
  font-size: var(--ds-fs-body);
}

.gov-showcase-notice-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.gov-showcase-notice-ico {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fef3c7;
  color: #b45309;
  font-size: var(--ds-fs-h3);
  font-weight: 700;
}

.gov-showcase-notice-title {
  margin: 0;
  font-size: var(--ds-fs-title);
  font-weight: 800;
  color: #92400e;
  letter-spacing: 0.02em;
}

.gov-showcase-notice-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gov-showcase-notice-list li {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px 12px;
  align-items: start;
}

.gov-notice-k {
  font-size: var(--ds-fs-body);
  font-weight: 700;
  color: #b45309;
  white-space: nowrap;
}

.gov-notice-v {
  color: #44403c;
  line-height: 1.6;
}

@media (max-width: 480px) {
  .gov-showcase-notice-list li {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.gov-showcase-sync-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-radius: 12px;
  background: linear-gradient(145deg, #f0fdf4, #dcfce7);
  border: 1px solid #86efac;
}

.gov-showcase-sync-copy {
  font-size: var(--ds-fs-body);
  color: #166534;
}

.gov-showcase-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 960px) {
  .gov-showcase-grid2 { grid-template-columns: 1fr; }
}

.gov-showcase-block {
  padding: 22px;
  border-radius: 18px;
  background: linear-gradient(160deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: var(--shadow-out);
  border: 1px solid #e2e8f0;
  min-height: 280px;
}

.gov-showcase-block--create {
  border-top: 3px solid var(--primary);
}

.gov-showcase-block--unlock {
  border-top: 3px solid #f59e0b;
}

.gov-showcase-block-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.gov-showcase-step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: var(--ds-fs-body);
  font-weight: 800;
  color: #fff;
  background: var(--primary-grad);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.gov-showcase-step-num--alt {
  background: linear-gradient(145deg, #fbbf24, #f59e0b);
  box-shadow: 0 4px 12px #f59e0b44;
}

.gov-showcase-block--code {
  margin-top: 18px;
  padding: 20px;
  border-radius: 14px;
  background: linear-gradient(145deg, #fefce8, #fef9c3);
  border: 1px solid #fde047;
  text-align: center;
  box-shadow: var(--shadow-in);
  min-height: 0;
}

.gov-showcase-code-label {
  margin: 0 0 8px;
  font-size: var(--ds-fs-body);
  font-weight: 700;
  color: #92400e;
}

.gov-showcase-code-meta {
  margin: 10px 0 6px;
  font-size: var(--ds-fs-body);
  color: #78350f;
}

.gov-showcase-step {
  margin: 0 0 4px;
  font-size: var(--ds-fs-title);
  font-weight: 700;
  color: var(--text);
}

.gov-showcase-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gov-freeze-main-btn {
  min-height: 52px;
  font-size: var(--ds-fs-title);
  font-weight: 700;
  margin-top: 6px;
  border-radius: 14px;
}

.gov-freeze-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 200px;
  padding: 24px 16px;
  border-radius: 14px;
  background: linear-gradient(145deg, #f8fafc, #f1f5f9);
  border: 1px dashed #cbd5e1;
}

.gov-freeze-empty-ico {
  font-size: 36px;
  opacity: 0.85;
  margin-bottom: 10px;
}

.gov-freeze-empty p {
  margin: 0 0 6px;
  font-weight: 600;
  color: var(--text);
}

.gov-freeze-card {
  padding: 16px 18px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-out);
  margin-top: 12px;
}

.gov-freeze-card:first-child {
  margin-top: 0;
}

.gov-freeze-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.gov-freeze-status {
  font-size: var(--ds-fs-body);
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: linear-gradient(145deg, #dcfce7, #bbf7d0);
  color: #15803d;
}

.gov-freeze-time {
  margin: 0 0 4px;
  font-size: var(--ds-fs-body);
  color: var(--muted);
}

.gov-freeze-hint {
  margin: 0 0 12px;
  font-size: var(--ds-fs-body);
}

.gov-freeze-unlock-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}

.gov-unlock-input {
  flex: 1;
  min-width: 120px;
  font-size: var(--ds-fs-title);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  padding: 12px 14px;
  border-radius: 12px;
}

.gov-unlock-btn {
  min-width: 108px;
  min-height: 46px;
  font-weight: 700;
  border-radius: 12px;
}

.gov-showcase-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

@media (max-width: 900px) {
  .gov-showcase-grid { grid-template-columns: 1fr; }
}

.gov-showcase-col {
  padding: 18px;
  border-radius: 14px;
  background: linear-gradient(145deg, #fff, #f8fafc);
  box-shadow: var(--shadow-out);
  border: 1px solid var(--border);
}

.gov-showcase-list {
  margin: 14px 0;
  min-height: 80px;
}

.gov-showcase-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #eef2f7;
}

.gov-showcase-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.gov-unlock-reveal {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(145deg, #fefce8, #fef9c3);
  border: 1px solid #fde047;
}

.gov-unlock-code {
  display: block;
  margin: 10px auto 12px;
  font-size: var(--ds-fs-display-xl);
  font-weight: 800;
  letter-spacing: 0.2em;
  color: #92400e;
}

.gov-handover-doc {
  padding: 20px;
  border-radius: 14px;
  background: linear-gradient(145deg, #f8fafc, #eef2f7);
}

.gov-handover-doc h3 { margin: 0 0 12px; }
.gov-doc-list { margin: 0; padding-left: 20px; line-height: 1.7; }

.gov-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 32px;
  border-radius: 14px;
  background: #f8fafc;
  text-align: center;
}

.gov-actions { margin-top: 8px; }

.gov-anomaly-filter { margin: 0; white-space: nowrap; }

@media (max-width: 900px) {
  .gov-panel-hero { flex-direction: column; align-items: flex-start; }
  .gov-handover-banner { flex-direction: column; align-items: flex-start; }
}

/* ── 空间档案 site-spaces ── */
.spc-hub { margin-bottom: 32px; }

.spc-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 18px;
  margin-top: 16px;
  min-height: 420px;
}

@media (max-width: 900px) {
  .spc-layout { grid-template-columns: 1fr; }
}

.spc-panel-label {
  margin: 0 0 10px;
  font-weight: 600;
}

.spc-tree-panel,
.spc-detail-panel {
  padding: 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border);
  min-height: 360px;
}

.spc-tree {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.spc-tree-search {
  margin: 0 0 10px;
}

.spc-search-input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  font-size: var(--ds-fs-body);
  color: #1e293b;
  background: #eef2f7;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.spc-search-input::placeholder {
  color: var(--muted);
  font-size: var(--ds-fs-body);
}
.spc-search-input:focus {
  border-color: #5b4dbe;
  background: #fff;
}

.spc-tree-campus { margin-bottom: 12px; }
.spc-tree-building { margin-bottom: 8px; }

.spc-tree-buildings,
.spc-tree-floors,
.spc-tree-rooms {
  display: none;
  margin-left: 12px;
  padding-left: 10px;
  border-left: 2px solid #e2e8f0;
}

.spc-tree-campus.is-expanded > .spc-tree-buildings,
.spc-tree-building.is-expanded > .spc-tree-floors,
.spc-tree-floor.is-expanded > .spc-tree-rooms {
  display: block;
}

.spc-tree-chevron {
  flex: 0 0 14px;
  font-size: var(--ds-fs-body);
  color: var(--muted);
  line-height: 1;
}

.spc-tree-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 4px 0;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.spc-tree-item:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.spc-tree-item.active {
  border-color: #5b4dbe;
  background: rgba(91,77,190,0.06);
}

.spc-tree-ico { font-size: 18px; flex: 0 0 28px; text-align: center; }

.spc-tree-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.spc-tree-copy strong { font-size: var(--ds-fs-body); }
.spc-tree-copy small { font-size: var(--ds-fs-body); color: var(--muted); }

.spc-tree-empty { margin: 8px 0; padding-left: 8px; }

.spc-detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  text-align: center;
  gap: 8px;
}

.spc-detail-empty-ico { font-size: 42px; opacity: 0.65; }

.spc-detail-card { max-width: 480px; }

/* === 空间档案详情面板 v2 === */
.spc-detail-panel-v2 {
  max-width: 100%;
}
.spc-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.spc-detail-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.spc-detail-breadcrumb {
  font-size: var(--ds-fs-body);
  color: var(--muted);
}
.spc-detail-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.spc-detail-title {
  font-size: var(--ds-fs-title);
  font-weight: 700;
  color: #1e293b;
}
.spc-detail-title-input {
  font-size: var(--ds-fs-title);
  font-weight: 700;
  color: #1e293b;
  border: 1px solid #5b4dbe;
  border-radius: 6px;
  padding: 0 8px;
  height: 28px;
  outline: none;
  font-family: inherit;
  background: #fff;
}
.spc-status-badge {
  font-size: var(--ds-fs-body);
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(34,197,94,0.08);
  color: #22c55e;
  border: 1px solid rgba(34,197,94,0.2);
  font-weight: 600;
}
.spc-detail-rename-btn {
  margin-left: auto;
  font-size: var(--ds-fs-body);
  color: #5b4dbe;
  cursor: pointer;
  border: 1px solid #5b4dbe;
  border-radius: 6px;
  padding: 3px 10px;
  background: rgba(91,77,190,0.04);
  font-family: inherit;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}
.spc-detail-rename-btn:hover {
  background: rgba(91,77,190,0.1);
}
.spc-stats {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.spc-stat-card {
  flex: 1;
  padding: 10px 6px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.spc-stat-num {
  font-size: var(--ds-fs-display-md);
  font-weight: 700;
  color: #5b4dbe;
  line-height: 1.2;
}
.spc-stat-num.off {
  color: var(--muted);
}
.spc-stat-label {
  font-size: var(--ds-fs-body);
  color: var(--muted);
  margin-top: 2px;
}
.spc-detail-section {
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.spc-detail-section:first-of-type {
  border-top: none;
  padding-top: 0;
}
.spc-detail-section-title {
  font-size: var(--ds-fs-body);
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.spc-detail-badge {
  font-size: var(--ds-fs-body);
  padding: 1px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  border: 1px solid var(--border);
  font-weight: 400;
}
.spc-detail-badge.brand {
  background: rgba(91,77,190,0.08);
  color: #5b4dbe;
  border-color: rgba(91,77,190,0.2);
}
.spc-detail-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
}
.spc-detail-field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--ds-fs-body);
}
.spc-detail-field-label {
  font-size: var(--ds-fs-body);
  color: var(--muted);
  white-space: nowrap;
}
.spc-detail-field-value {
  color: #1e293b;
  font-weight: 500;
}
.spc-detail-field-value.is-readonly {
  color: var(--muted);
}
.spc-detail-field-value.mono {
  font-family: monospace;
  font-size: var(--ds-fs-body);
  color: var(--muted);
}
.spc-detail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: var(--ds-fs-body);
  cursor: pointer;
  margin-bottom: 6px;
}
.spc-detail-row:last-child {
  margin-bottom: 0;
}
.spc-detail-row-name {
  flex: 1;
  font-weight: 600;
  color: #1e293b;
}
.spc-detail-row-meta {
  font-size: var(--ds-fs-body);
  color: var(--muted);
}
.spc-detail-row-arrow {
  color: var(--muted);
  font-size: var(--ds-fs-body);
}
.spc-detail-row-mac {
  font-size: var(--ds-fs-body);
  color: var(--muted);
  font-family: monospace;
}
.spc-detail-empty-row {
  font-size: var(--ds-fs-body);
  color: var(--muted);
  text-align: center;
  padding: 16px 8px;
}
.spc-detail-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}
.spc-detail-btn-delete {
  color: #ef4444 !important;
  border: 1px solid rgba(239,68,68,0.4) !important;
  border-radius: 6px !important;
  padding: 4px 14px !important;
  background: rgba(239,68,68,0.04) !important;
  font-size: var(--ds-fs-body) !important;
  font-weight: 500 !important;
  cursor: pointer;
  font-family: inherit !important;
  transition: background 0.15s !important;
}
.spc-detail-btn-delete:hover {
  background: rgba(239,68,68,0.1) !important;
}

.spc-detail-head { margin-bottom: 16px; }
.spc-detail-tag {
  display: inline-block;
  font-size: var(--ds-fs-body);
  font-weight: 700;
  color: #2563eb;
  margin-bottom: 6px;
}

.spc-detail-head h3 { margin: 0; font-size: var(--ds-fs-title); }

.spc-id-line { margin: 12px 0 0; }
.spc-id-line code {
  font-size: var(--ds-fs-body);
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 6px;
}

.spc-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.spc-gw-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border);
}

.spc-gw-card {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(145deg, #f8fafc, #f1f5f9);
  border: 1px solid var(--border);
}

.spc-gw-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.spc-gw-kv {
  display: grid;
  gap: 8px;
  margin: 0;
}

.spc-gw-kv > div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px;
  align-items: baseline;
}

.spc-gw-kv dt {
  margin: 0;
  font-size: var(--ds-fs-body);
  color: var(--muted);
}

.spc-gw-kv dd {
  margin: 0;
  font-size: var(--ds-fs-body);
  word-break: break-all;
}

.spc-gw-kv--compact { margin-top: 10px; }

.spc-gw-advanced {
  margin-top: 10px;
  font-size: var(--ds-fs-body);
}

.spc-gw-advanced summary {
  cursor: pointer;
  color: var(--muted);
}

.spc-gw-empty { margin-top: 12px; }

.status-pill.warn {
  background: #fef3c7;
  color: #92400e;
}

.nav-item.hidden,
.nav-item[hidden] {
  display: none !important;
}

.spc-unassigned {
  margin-top: 20px;
  padding: 18px;
  border-radius: 14px;
  background: linear-gradient(145deg, #fffbeb, #fef3c7);
  border: 1px solid #fde68a;
}

.spc-unassigned-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.spc-unassigned-head h3 { margin: 0 0 4px; font-size: var(--ds-fs-h3); }

.spc-unassigned-list { display: flex; flex-direction: column; gap: 8px; }

.spc-unassigned-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #fde68a;
}

@media (max-width: 640px) {
  .spc-unassigned-row { flex-direction: column; align-items: flex-start; }
}

.spc-empty {
  padding: 32px 16px;
  text-align: center;
}

/* ── 行业模版主题（body[data-industry]） ── */
body[data-industry="education"] {
  --primary: #2563eb;
  --primary-grad: linear-gradient(145deg, #4a90d9, #2563eb);
  --brand: #ff6a00;
  --hero-tint: linear-gradient(145deg, #ff9a5c22, #2563eb11);
}

body[data-industry="office"] {
  --primary: #1e40af;
  --primary-grad: linear-gradient(145deg, #475569, #1e40af);
  --brand: #64748b;
  --hero-tint: linear-gradient(145deg, #94a3b822, #1e40af11);
  --bg-warm: #f4f6f9;
}

body[data-industry="retail"] {
  --primary: #0d9488;
  --primary-grad: linear-gradient(145deg, #14b8a6, #0d9488);
  --brand: #ca8a04;
  --hero-tint: linear-gradient(145deg, #fcd34d22, #0d948811);
  --bg-warm: #f0fdf9;
}

.industry-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: var(--ds-fs-body);
  font-weight: 600;
  color: #5b4dbe;
  background: #fff;
  border: 1px solid #5b4dbe;
  box-shadow: none;
}

.industry-badge.hidden { display: none; }

.industry-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.industry-card {
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-out);
  border: 2px solid transparent;
  transition: border-color 0.2s, transform 0.15s;
}

.industry-card--active {
  border-color: var(--primary);
  box-shadow: var(--shadow-out-lg), 0 0 0 1px var(--primary-glow);
}

.industry-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.industry-card-icon {
  font-size: 28px;
  line-height: 1;
}

.industry-card-head h3 {
  font-size: var(--ds-fs-title);
  margin-bottom: 4px;
}

.industry-card-badge {
  margin-left: auto;
  font-size: var(--ds-fs-body);
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--primary-grad);
  color: #fff;
  white-space: nowrap;
}

.industry-card-list {
  list-style: none;
  font-size: var(--ds-fs-body);
  color: var(--muted);
  line-height: 1.6;
}

.industry-card-list li { margin-bottom: 6px; }

.industry-card-foot { margin-top: 12px; font-size: var(--ds-fs-body); }

.industry-apply-btn { margin-top: 12px; width: 100%; }

/* ── 定时策略 day-schedule ── */
.ds-notice {
  padding: 18px 20px 16px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-left: 4px solid #22c55e;
}

.ds-notice-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.ds-notice-ico {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #dcfce7;
  color: #15803d;
  font-size: var(--ds-fs-h3);
  font-weight: 700;
}

.ds-notice-title {
  margin: 0;
  font-size: var(--ds-fs-title);
  font-weight: 800;
  color: #166534;
}

.ds-notice-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ds-notice-list li {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px 12px;
  align-items: start;
}

.ds-notice-k {
  font-size: var(--ds-fs-body);
  font-weight: 700;
  color: #15803d;
  white-space: nowrap;
}

.ds-notice-v {
  color: #44403c;
  line-height: 1.6;
  font-size: var(--ds-fs-body);
}

.ds-quick-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow-in);
}

.ds-quick-copy strong {
  display: block;
  font-size: var(--ds-fs-body);
  margin-bottom: 2px;
}

.ds-timeline-wrap {
  margin-bottom: 20px;
  padding: 18px 20px;
  border-radius: 16px;
  background: linear-gradient(160deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.ds-timeline-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.ds-timeline-title {
  font-size: var(--ds-fs-body);
  font-weight: 800;
  color: #475569;
}

.ds-timeline-bar {
  display: flex;
  gap: 3px;
  height: 44px;
  padding: 4px;
  border-radius: 12px;
  overflow: hidden;
  background: #e2e8f0;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.ds-timeline-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--ds-fs-body);
  color: #94a3b8;
}

.ds-timeline-seg {
  min-width: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: filter 0.15s;
}

.ds-timeline-seg:hover {
  filter: brightness(0.97);
}

.ds-timeline-seg-label {
  font-size: var(--ds-fs-body);
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  padding: 0 4px;
}

.ds-timeline-seg.ds-mode--fixed {
  background: #fef9c3;
  border: 1px solid #fde68a;
}

.ds-timeline-seg.ds-mode--fixed .ds-timeline-seg-label {
  color: #92400e;
}

.ds-timeline-seg.ds-mode--presence {
  background: #d1fae5;
  border: 1px solid #a7f3d0;
}

.ds-timeline-seg.ds-mode--presence .ds-timeline-seg-label {
  color: #065f46;
}

.ds-timeline-seg.ds-mode--fast {
  background: #dbeafe;
  border: 1px solid #bfdbfe;
}

.ds-timeline-seg.ds-mode--fast .ds-timeline-seg-label {
  color: #1e40af;
}

.ds-timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.ds-timeline-key {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: var(--ds-fs-body);
  line-height: 1.3;
  border: 1px solid transparent;
}

.ds-timeline-key.ds-mode--fixed {
  background: #fffbeb;
  border-color: #fde68a;
}

.ds-timeline-key.ds-mode--presence {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.ds-timeline-key.ds-mode--fast {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.ds-key-time {
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}

.ds-key-mode {
  color: #64748b;
  white-space: nowrap;
}

.ds-timeline-key.ds-mode--fixed .ds-key-mode { color: #b45309; }
.ds-timeline-key.ds-mode--presence .ds-key-mode { color: #047857; }
.ds-timeline-key.ds-mode--fast .ds-key-mode { color: #1d4ed8; }

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

.ds-list-title {
  margin: 0;
  font-size: var(--ds-fs-title);
  font-weight: 800;
}

.ds-schedule-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 8px;
}

.ds-slot-row {
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow-out);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.ds-slot-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.ds-slot-order {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary-grad);
  color: #fff;
  font-size: var(--ds-fs-body);
  font-weight: 800;
}

.ds-slot-head .ds-label {
  flex: 1;
  min-width: 0;
}

.ds-slot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr)) minmax(160px, 1.2fr) minmax(160px, 1.2fr);
  gap: 12px 14px;
  margin-bottom: 8px;
}

.ds-mode-hint {
  margin: 0 0 10px;
  font-size: var(--ds-fs-body);
}

.ds-wd-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin: 0 0 8px;
}

.ds-wd-bar-label {
  font-size: var(--ds-fs-body);
  font-weight: 700;
  color: var(--text-muted, #64748b);
}

.ds-wd-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ds-weekdays {
  margin-top: 4px;
}

.ds-empty {
  padding: 40px 20px;
  text-align: center;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow-in);
}

.ds-empty-icon {
  font-size: 36px;
  display: block;
  margin-bottom: 8px;
}

.ds-empty p {
  margin: 0 0 6px;
  font-weight: 700;
}

@media (max-width: 800px) {
  .ds-notice-list li { grid-template-columns: 1fr; gap: 4px; }
  .ds-slot-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .ds-slot-grid { grid-template-columns: 1fr; }
}

/* ── 用户与权限 users ── */
.usr-hub.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: none;
}
.usr-hub.card::before { display: none; }
.usr-notice {
  padding: 18px 20px 16px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  border-left: 4px solid #8b5cf6;
}

.usr-notice-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.usr-notice-ico {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #ede9fe;
  color: #6d28d9;
  font-weight: 700;
}

.usr-notice-title {
  margin: 0;
  font-size: var(--ds-fs-title);
  font-weight: 800;
  color: #5b21b6;
}

.usr-notice-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.usr-notice-list li {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px 12px;
}

.usr-notice-k {
  font-size: var(--ds-fs-body);
  font-weight: 700;
  color: #6d28d9;
}

.usr-notice-v {
  font-size: var(--ds-fs-body);
  color: #44403c;
  line-height: 1.6;
}

.usr-tabs {
  display: inline-flex;
  gap: 4px;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 16px;
}

.usr-tab {
  padding: 8px 18px;
  border-radius: 8px;
  border: none;
  background: transparent;
  font-size: var(--ds-fs-body);
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.18s ease;
}

.usr-tab:hover {
  color: #5b4dbe;
  background: rgba(91, 77, 190, 0.06);
}

.usr-tab.active {
  background: #5b4dbe;
  color: #fff;
  box-shadow: 0 1px 3px rgba(91, 77, 190, 0.3);
}

.usr-panel { display: none; }
.usr-panel.active { display: block; }

.usr-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.usr-subtitle {
  margin: 20px 0 10px;
  font-size: var(--ds-fs-body);
  font-weight: 800;
}

.usr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--ds-fs-body);
}

.usr-table th,
.usr-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #f4f4f5;
}

.usr-table th {
  font-size: var(--ds-fs-body);
  color: var(--muted);
  font-weight: 700;
  vertical-align: top;
}

/* ── 5. 客户列表表头：下拉箭头式筛选 + 列色条 ── */
.usr-table--filterable th {
  min-width: 0;
  padding: 0 !important;
  border-bottom: 2px solid var(--col-color, #e2e8f0) !important;
  position: relative;
  vertical-align: middle;
}

.usr-th-filter {
  position: relative;
  padding: 10px 14px 8px 6px !important;
}

.usr-th-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: var(--ds-fs-body);
  font-weight: 600;
  color: var(--col-color, #334155);
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--col-color, #334155);
  color: #fff;
  transition: all 0.15s ease;
  user-select: none;
}

.usr-th-label:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.usr-th-caret {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: transform 0.15s ease;
}

.usr-th-filter.has-filter .usr-th-label {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}

.usr-th-filter.has-filter .usr-th-caret {
  transform: rotate(180deg);
  opacity: 1;
}

.usr-th-select {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
  background: transparent;
}

.usr-th-action {
  text-align: center !important;
  padding: 8px 14px !important;
}

/* 数据单元格列色条 */
.usr-td-col {
  border-bottom: 1px solid #f1f5f9;
  border-left: 3px solid var(--col-color, #e2e8f0);
  padding: 10px 14px;
  font-size: var(--ds-fs-body);
  transition: background 0.15s ease;
}

.usr-td-col:first-child {
  border-left: none;
}

/* 表头第一列也去掉左边框 */
.usr-th-filter:first-child {
  border-left: none;
}

.usr-table--filterable tbody tr:hover .usr-td-col {
  background: rgba(59, 130, 246, 0.04);
}

.usr-table--filterable tbody tr:hover .usr-td-col:first-child {
  background: rgba(59, 130, 246, 0.04);
}

.usr-td-action {
  text-align: center;
  border-left: 3px solid var(--col-color, #94a3b8);
}

/* ── 服务商分组表格 ── */
.usr-table--provider {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}
.usr-table--provider thead th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  font-size: var(--ds-fs-body);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 12px;
  border-bottom: 2px solid #e2e8f0;
}
.usr-prov-row td {
  padding: 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #fafbff;
  vertical-align: middle;
}
.usr-prov-row:hover td {
  background: #f0f4ff;
}
.usr-prov-name {
  font-weight: 600;
  font-size: var(--ds-fs-body);
  color: #0f172a;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.usr-prov-sub {
  font-size: var(--ds-fs-body);
  color: #94a3b8;
  margin-top: 2px;
}
.usr-prov-sub code {
  font-size: var(--ds-fs-body);
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 3px;
  color: #475569;
}
.usr-prov-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  border-radius: 999px;
  background: #ede9fe;
  color: #6d28d9;
  font-weight: 700;
  font-size: var(--ds-fs-body);
  padding: 0 8px;
}

/* 子成员行 */
.usr-prov-child td {
  padding: 8px 12px;
  border-bottom: 1px dashed #e2e8f0;
  font-size: var(--ds-fs-body);
  background: #ffffff;
}
.usr-prov-child--empty td {
  background: #fafafa;
}
.usr-child-indent {
  display: inline-block;
  width: 24px;
  height: 28px;
  position: relative;
  vertical-align: middle;
  margin-left: 12px;
}
.usr-child-indent::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 100%;
  border-left: 1.5px solid #cbd5e1;
}
.usr-child-indent.is-last::before {
  height: 50%;
}
.usr-child-indent::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 14px;
  height: 0;
  border-top: 1.5px solid #cbd5e1;
}
.usr-child-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8b5cf6;
  box-shadow: 0 0 0 2px #ede9fe;
  vertical-align: middle;
  margin-right: 8px;
}
.usr-child-name {
  font-weight: 500;
  color: #1e293b;
}
.usr-child-role {
  margin-left: 6px;
}

/* ── 弹窗内区域授权区域 ── */
.usr-editor-grant-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;
  background: #fafafa;
}
.usr-editor-grant-proj {
  margin-bottom: 10px;
}
.usr-editor-proj-sel {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: var(--ds-fs-body);
  background: #ffffff;
}
.usr-grant-tree--inline {
  max-height: 150px;
  overflow-y: auto;
  border-radius: 8px;
  background: #ffffff;
  padding: 6px;
  border: 1px solid #e2e8f0;
}
.usr-grant-tree--inline .usr-tree-building-card {
  border-radius: 8px;
  box-shadow: none;
}
.usr-grant-tree--inline .usr-tree-building-head {
  padding: 7px 10px;
}
.usr-grant-tree--inline .usr-tree-floors {
  padding: 8px 10px;
  gap: 8px;
}
.usr-grant-tree--inline .usr-tree-floor-block {
  padding-left: 8px;
}
.usr-editor-grant-summary {
  margin-top: 8px;
  font-size: var(--ds-fs-body);
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 4px;
}
.usr-editor-grant-summary .usr-grant-stat-num {
  font-weight: 700;
  color: #6d28d9;
  font-size: var(--ds-fs-body);
}

/* 统计信息栏 */
.usr-cust-stats-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  margin-bottom: 8px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: var(--ds-fs-body);
  color: #475569;
}

.usr-cust-meta {
  margin: 0;
}

.usr-cust-filter-clear {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: var(--ds-fs-body);
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.usr-cust-filter-clear:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* 禁用行样式 */
.usr-row-disabled .usr-td-col {
  opacity: 0.6;
  background: #f8fafc;
}

.usr-row-disabled:hover .usr-td-col {
  background: #f1f5f9 !important;
}

.usr-row--off { opacity: 0.55; }

.usr-role {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: var(--ds-fs-body);
  font-weight: 700;
}

.usr-role--owner { background: #fff7ed; color: #c2410c; }
.usr-role--afp_ops { background: #ede9fe; color: #5b21b6; }
.usr-role--admin { background: #fce7f3; color: #9d174d; }
.usr-role--operator { background: #ecfdf5; color: #047857; }
.usr-role--viewer { background: #f1f5f9; color: #475569; }

.usr-status--on { color: #15803d; font-weight: 600; }
.usr-status--off { color: #b91c1c; font-weight: 600; }

.usr-actions {
  white-space: nowrap;
}

.usr-actions .btn + .btn { margin-left: 4px; }

.usr-time { color: var(--muted); font-size: var(--ds-fs-body); }

.usr-matrix-wrap {
  margin-top: 8px;
  overflow-x: auto;
}

.usr-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--ds-fs-body);
}

.usr-matrix th,
.usr-matrix td {
  padding: 8px 10px;
  border-bottom: 1px solid #f4f4f5;
}

.usr-matrix-cell {
  text-align: center;
  color: #15803d;
  font-weight: 700;
}

.usr-placeholder {
  padding: 48px 20px;
  text-align: center;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow-in);
}

.usr-placeholder-ico {
  font-size: 36px;
  display: block;
  margin-bottom: 8px;
}

.usr-editor {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.usr-editor.hidden { display: none; }

.usr-cust-edit-info {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  margin-bottom: 16px;
  font-size: var(--ds-fs-body);
  color: #64748b;
}
.usr-cust-edit-info-item { display: flex; align-items: center; gap: 5px; }
.usr-cust-edit-info-item strong { color: #333; font-weight: 500; }
.usr-cust-edit-info .usr-status-pill { margin-left: auto; }

.usr-field-readonly-tag {
  display: inline-block;
  font-size: var(--ds-fs-body);
  font-weight: 400;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  margin-left: 6px;
  vertical-align: middle;
  line-height: 16px;
}

.usr-input-readonly {
  background: #f1f5f9 !important;
  color: #64748b !important;
  cursor: not-allowed;
}

.usr-field-helper {
  font-size: var(--ds-fs-body);
  color: #94a3b8;
  line-height: 18px;
}

.usr-editor-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.usr-editor-footer .btn { min-width: 80px; }
.usr-editor-footer .btn-primary {
  background: #5b4dbe;
  box-shadow: none;
}
.usr-editor-footer .btn-primary:hover:not(:disabled) {
  background: #4c3fa8;
  transform: none;
  box-shadow: none;
}
.usr-editor-footer .btn-ghost {
  background: #fff;
  color: #64748b;
  border: 1px solid #e2e8f0;
  box-shadow: none;
}
.usr-editor-footer .btn-ghost:hover:not(:disabled) {
  background: #f8fafc;
  transform: none;
  box-shadow: none;
}

/* ── 弹窗内分区 ── */
.usr-editor-section {
  margin-bottom: 4px;
  padding-bottom: 4px;
}
.usr-editor-section-label {
  font-size: var(--ds-fs-body);
  font-weight: 600;
  color: #333333;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
}
.usr-field-req {
  color: #ef4444;
  margin-left: 2px;
}
.usr-field-opt {
  font-size: var(--ds-fs-body);
  color: #94a3b8;
  font-weight: 400;
}

/* ── 成员编辑弹窗输入框统一样式 ── */
#usrEditor .form-grid { gap: 6px; }
#usrEditor .field { margin-bottom: 0; }
#usrEditor .field label { margin-bottom: 3px; }
#usrEditor .field input,
#usrEditor .field select {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  box-shadow: none;
  padding: 6px 10px;
  font-size: var(--ds-fs-body);
}
#usrEditor .field input:focus,
#usrEditor .field select:focus {
  border-color: #5b4dbe;
  box-shadow: none;
}
#usrEditor .usr-input-readonly {
  background: #f1f5f9 !important;
  color: #64748b !important;
  border: 1px solid #e2e8f0 !important;
  cursor: not-allowed;
}

#usrCustomerEditor .field input,
#usrCustomerEditor .field select {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  box-shadow: none;
  padding: 8px 12px;
}
#usrCustomerEditor .field input:focus,
#usrCustomerEditor .field select:focus {
  border-color: #5b4dbe;
  box-shadow: none;
}
#usrCustomerEditor .usr-input-readonly {
  background: #f1f5f9 !important;
  color: #64748b !important;
  border: 1px solid #e2e8f0 !important;
  cursor: not-allowed;
}

.usr-editor-card {
  width: min(480px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 20px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: none;
}

.usr-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.usr-editor-head h3 {
  margin: 0;
  font-size: var(--ds-fs-title);
}

@media (max-width: 600px) {
  .usr-notice-list li { grid-template-columns: 1fr; gap: 4px; }
}

.usr-proj-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 24px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.usr-proj-field { min-width: 220px; margin: 0; }
.usr-proj-field select { width: 100%; }
.usr-proj-hint { flex: 1; min-width: 240px; margin: 0; font-size: var(--ds-fs-body); }

.usr-proj-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.9fr);
  gap: 24px;
  align-items: start;
}

.usr-proj-side {
  padding: 16px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
}

.usr-proj-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.usr-proj-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.usr-proj-card h4 {
  margin: 0 0 4px;
  font-size: var(--ds-fs-body);
  color: #0f172a;
}

.usr-proj-card p {
  margin: 0;
  font-size: var(--ds-fs-body);
  color: var(--muted);
  line-height: 1.5;
}

.usr-role--project_admin { background: #fce7f3; color: #9d174d; }
.usr-role--project_operator { background: #ecfdf5; color: #047857; }
.usr-role--project_viewer { background: #f1f5f9; color: #475569; }

.usr-grant-role-select {
  min-width: 140px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: var(--ds-fs-body);
}

.usr-proj-matrix-wrap { margin-top: 0; padding-top: 0; border-top: none; }

.usr-editor-card--wide { max-width: 640px; }

/* 区域授权 — 大窗口 + 视觉优化 */
.usr-editor-card--grant {
  width: min(1180px, 96vw);
  max-width: none;
  height: min(880px, 92vh);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.usr-grant-head {
  margin-bottom: 0 !important;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.usr-grant-head h3 {
  font-size: var(--ds-fs-display-md);
  font-weight: 700;
  color: #0f172a;
}

.usr-grant-subtitle {
  margin: 4px 0 0;
  font-size: var(--ds-fs-body);
}

.usr-grant-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0 24px 20px;
}

.usr-grant-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 14px 0 12px;
  flex-shrink: 0;
}

.usr-grant-member-field {
  margin: 0;
  min-width: 280px;
  flex: 1;
  max-width: 360px;
}

.usr-grant-member-field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: var(--ds-fs-body);
}

.usr-grant-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: var(--ds-fs-body);
  color: #64748b;
}

.usr-grant-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.usr-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.usr-legend-dot--building { background: #7c3aed; }
.usr-legend-dot--floor { background: #059669; }
.usr-legend-dot--room { background: #0284c7; }

.usr-grant-tree {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 4px;
  margin: 0 -4px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 16px;
  align-content: start;
}

.usr-tree-building-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.usr-tree-building-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(90deg, #f5f3ff 0%, #f8fafc 100%);
  border-bottom: 1px solid #e2e8f0;
}

.usr-tree-building-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.usr-tree-building-icon {
  font-size: 18px;
  line-height: 1;
}

.usr-tree-building-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.usr-tree-building-stat {
  font-size: var(--ds-fs-body);
  font-weight: 600;
  color: #64748b;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.usr-tree-building-stat--partial {
  color: #b45309;
  background: #fffbeb;
  border-color: #fcd34d;
}

.usr-tree-building-stat--on {
  color: #047857;
  background: #ecfdf5;
  border-color: #6ee7b7;
}

.btn-xs {
  padding: 4px 10px;
  font-size: var(--ds-fs-body);
  line-height: 1.3;
  border-radius: 8px;
}

.usr-tree-floors {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.usr-tree-floor-block {
  padding-left: 12px;
  border-left: 3px solid #cbd5e1;
  border-radius: 0 10px 10px 0;
  background: #fafbfc;
}

.usr-tree-floor-block:has(input[data-kind="floor"]:checked) {
  border-left-color: #10b981;
  background: #f0fdf4;
}

.usr-tree-floor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px 6px 0;
}

.usr-tree-floor-stat {
  font-size: var(--ds-fs-body);
  font-weight: 600;
  color: #94a3b8;
  min-width: 36px;
  text-align: right;
}

.usr-tree-rooms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 10px 28px;
}

.usr-tree-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--ds-fs-body);
  cursor: pointer;
  user-select: none;
  margin: 0;
}

.usr-tree-check {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  accent-color: #0d9488;
  cursor: pointer;
}

.usr-tree-row--building { font-weight: 700; color: #0f172a; }
.usr-tree-row--floor { font-weight: 600; color: #334155; font-size: var(--ds-fs-body); }

.usr-tree-meta {
  font-style: normal;
  font-size: var(--ds-fs-body);
  color: #94a3b8;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.15);
}

.usr-room-chip {
  position: relative;
  cursor: pointer;
  margin: 0;
}

.usr-room-chip-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.usr-room-chip-label {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: var(--ds-fs-body);
  color: #475569;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.usr-room-chip:hover .usr-room-chip-label {
  border-color: #94a3b8;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.usr-room-chip--on .usr-room-chip-label,
.usr-room-chip-input:checked + .usr-room-chip-label {
  color: #047857;
  background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: #34d399;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(16, 185, 129, 0.15);
}

.usr-grant-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.usr-grant-stats {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.usr-grant-stat-num {
  font-size: var(--ds-fs-display-lg);
  font-weight: 800;
  color: #0d9488;
  line-height: 1;
}

.usr-grant-stat-label {
  font-size: var(--ds-fs-body);
  font-weight: 600;
  color: #334155;
}

.usr-grant-stat-sep {
  color: #cbd5e1;
  margin: 0 2px;
}

.usr-grant-stat-sub {
  font-size: var(--ds-fs-body);
  color: #64748b;
}

.usr-grant-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.usr-grant-footer .usr-grant-save {
  min-width: 140px;
  padding: 10px 24px;
  font-weight: 600;
}

.usr-grant-scope-cell { line-height: 1.55; font-size: var(--ds-fs-body); }

@media (max-width: 720px) {
  .usr-editor-card--grant {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .usr-grant-form { padding: 0 14px 14px; }
  .usr-grant-head { padding: 16px; }

  .usr-grant-tree {
    grid-template-columns: 1fr;
  }

  .usr-grant-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .usr-grant-footer-actions {
    flex-direction: column;
  }

  .usr-grant-footer .usr-grant-save {
    width: 100%;
  }
}

.usr-grant-floor-wrap.hidden,
.usr-grant-room-wrap.hidden { display: none; }

.usr-area-tip { margin: 0; font-size: var(--ds-fs-body); line-height: 1.55; }

.usr-scope-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: var(--ds-fs-body);
  font-weight: 600;
  background: #e0f2fe;
  color: #0369a1;
}

.usr-scope-tag--building { background: #ede9fe; color: #5b21b6; }
.usr-scope-tag--floor { background: #ecfdf5; color: #047857; }
.usr-scope-tag--room { background: #fef3c7; color: #b45309; }

/* ── P1-4/P1-7：客户状态徽标 · 停用行 · 审计区 ─────────────── */
.usr-role--ok {
  background: #dcfce7;
  color: #15803d;
}
.usr-role--provider {
  background: #e0f2fe;
  color: #0369a1;
  font-size: var(--ds-fs-body);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  font-weight: 500;
}
.usr-role--disabled {
  background: #fee2e2;
  color: #b91c1c;
}
/* 子成员角色徽标（小） */
.usr-role--mbr {
  font-size: var(--ds-fs-body);
  padding: 1px 7px;
  border-radius: 999px;
  margin-left: 6px;
  font-weight: 600;
}
.usr-role--mbr.usr-role--admin    { background: #ede9fe; color: #7c3aed; }
.usr-role--mbr.usr-role--operator { background: #ecfeff; color: #0891b2; }
.usr-role--mbr.usr-role--viewer   { background: #fef3c7; color: #b45309; }

.usr-row-disabled {
  opacity: 0.55;
  background: repeating-linear-gradient(45deg, transparent, transparent 8px, rgba(148, 163, 184, 0.06) 8px, rgba(148, 163, 184, 0.06) 16px);
}
.usr-row-disabled td { color: #94a3b8; }
.usr-cust-enable { color: #15803d; }

/* ── 客户开户列表：树形展开（园区所有者 + 子成员） ── */
.usr-td-col--owner {
  position: relative;
}
.usr-cust-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  margin-right: 6px;
  vertical-align: top;
  margin-top: 2px;
  cursor: pointer;
  transition: background 120ms ease;
  flex-shrink: 0;
  background: transparent;
  color: #64748b;
}
.usr-cust-caret:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.usr-cust-caret--empty {
  cursor: default;
  background: transparent;
  pointer-events: none;
  visibility: hidden;
}
.usr-cust-caret-svg {
  width: 14px;
  height: 14px;
  transition: transform 160ms ease;
  transform: rotate(0deg);
}
.usr-cust-caret-svg.is-open {
  transform: rotate(90deg);
}
.usr-cust-owner-wrap {
  display: inline-flex;
  flex-direction: column;
  vertical-align: top;
  max-width: 260px;
}
.usr-cust-owner-wrap > div:first-child {
  font-weight: 600;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.usr-cust-owner-sub {
  font-size: var(--ds-fs-body);
  color: #64748b;
  margin-top: 2px;
}
.usr-owner-pill {
  display: inline-block;
  font-size: var(--ds-fs-body);
  padding: 1px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  color: #6d28d9;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.usr-cust-member-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--ds-fs-body);
  padding: 2px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #bfdbfe;
  transition: all 120ms ease;
}
.usr-cust-member-badge:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.15);
}
.usr-cust-member-badge--empty {
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
}
.usr-cust-member-badge--empty:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}
/* 添加成员按钮行 */
.usr-cust-add-row {
  background: #fafbff;
}
.usr-cust-add-cell {
  padding: 8px 12px 8px 48px;
  border-top: 1px dashed #e2e8f0;
}
/* 弹窗内 radio 行 */
.usr-radio-row {
  display: flex;
  gap: 20px;
  align-items: center;
}
.usr-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--ds-fs-body);
  cursor: pointer;
  color: #334155;
}
.usr-radio input[type="radio"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}
/* 空区域提示 */
.usr-grant-empty-hint {
  padding: 12px;
  border-radius: 8px;
  background: #fff8e8;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: var(--ds-fs-body);
  text-align: center;
}
.usr-cust-row {
  transition: background 120ms ease;
}
.usr-cust-row:hover {
  background: #fafbff;
}
/* 子成员行 */
.usr-cust-child-row {
  background: linear-gradient(90deg, #fafbff 0%, #ffffff 25%);
}
.usr-cust-child-row td {
  padding-top: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #e2e8f0;
  font-size: var(--ds-fs-body);
}
.usr-cust-child-row:last-child td {
  border-bottom: 1px solid #e2e8f0;
}
.usr-td-col--child {
  position: relative;
}
.usr-cust-child-indicator {
  position: relative;
  display: inline-flex;
  width: 28px;
  height: 14px;
  margin: 0 4px 0 28px;
  vertical-align: middle;
}
.usr-cust-child-line {
  position: absolute;
  left: 8px;
  top: 0;
  width: 0;
  height: 100%;
  border-left: 1.5px dashed #cbd5e1;
}
.usr-cust-child-line.is-last {
  height: 50%;
}
.usr-cust-child-dot {
  position: absolute;
  left: 5px;
  top: calc(50% - 3px);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8b5cf6;
  box-shadow: 0 0 0 2px #ede9fe;
}
.usr-cust-child-wrap {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  max-width: 260px;
}
.usr-cust-child-name {
  font-weight: 500;
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.usr-cust-child-phone {
  font-size: var(--ds-fs-body);
  color: #94a3b8;
  font-weight: 400;
}
.usr-cust-child-sub {
  margin-top: 2px;
  font-size: var(--ds-fs-body);
  color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.usr-cust-child-scope {
  color: #0891b2;
  font-size: var(--ds-fs-body);
}
.usr-cust-child-meta {
  font-size: var(--ds-fs-body);
  color: #0891b2;
  background: #ecfeff;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
  max-width: 140px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.usr-cust-child-gw {
  color: #cbd5e1;
  font-weight: 400;
  font-size: var(--ds-fs-body);
}
.usr-td-action--child {
  padding-top: 6px;
  padding-bottom: 6px;
}

/* ── 方案A：精简表格 ── */
/* 覆盖 .table-wrap 的渐变背景和内阴影 */
#usrCustomerTable .table-wrap,
#usrAuditTable .table-wrap {
  background: transparent;
  box-shadow: none;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  padding: 0;
  overflow: hidden;
}
.usr-table--clean {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--ds-fs-body);
}
.usr-table--clean th,
.usr-table--clean td {
  padding: 10px 12px;
  text-align: left;
  border: 1px solid #e2e8f0;
}
.usr-table--clean thead th {
  background: #f8fafc;
  font-size: var(--ds-fs-body);
  font-weight: 600;
  color: #64748b;
  border: 1px solid #e2e8f0;
}
.usr-table--clean tbody tr:last-child td {
  border-bottom: none;
}

.usr-th {
  font-size: var(--ds-fs-body);
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}
.usr-th-expand {
  width: 40px;
  text-align: center;
}
.usr-td {
  font-size: var(--ds-fs-body);
  color: #334155;
  border: 1px solid #e2e8f0;
}
.usr-td-expand {
  width: 40px;
  text-align: center;
  padding: 8px 4px;
}

/* 搜索栏 */
.usr-cust-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.usr-cust-search-wrap {
  position: relative;
  flex: 0 0 340px;
  max-width: 340px;
}
.usr-cust-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: #94a3b8;
  pointer-events: none;
}
.usr-cust-search {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 34px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: var(--ds-fs-body);
  color: #334155;
  background: #fff;
  box-shadow: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.usr-cust-search:focus {
  outline: none;
  border-color: #5b4dbe;
  box-shadow: 0 0 0 3px rgba(91, 77, 190, 0.08);
}

/* 详情行（园区、行业、成员数） */
.usr-cust-detail-row {
  background: #fafbfc;
}
.usr-cust-detail-row > td {
  border: 1px solid #e2e8f0;
}
.usr-cust-detail-cell {
  padding: 10px 12px 10px 16px;
}
.usr-cust-detail-grid {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.usr-cust-detail-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.usr-cust-detail-item label {
  font-size: var(--ds-fs-body);
  color: #94a3b8;
  font-weight: 500;
}
.usr-cust-detail-item span {
  font-size: var(--ds-fs-body);
  color: #334155;
  font-weight: 500;
}

/* 子成员行 */
.usr-cust-child-row {
  background: #fcfcfd;
}
.usr-cust-child-row > td {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
}
.usr-cust-child-role {
  display: inline-block;
  font-size: var(--ds-fs-body);
  padding: 1px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  margin-left: 6px;
}

/* ── 角色标签 ── */
.usr-role-badge {
  display: inline-block;
  font-size: var(--ds-fs-body);
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 18px;
}
.usr-role-badge--customer { background: #ede9fe; color: #5b21b6; }
.usr-role-badge--admin { background: #fce7f3; color: #9d174d; }
.usr-role-badge--afp_ops { background: #fef3c7; color: #b45309; }
.usr-role-badge--operator { background: #ecfdf5; color: #047857; }
.usr-role-badge--viewer { background: #f1f5f9; color: #475569; }
.usr-cust-child-scope {
  display: inline-block;
  font-size: var(--ds-fs-body);
  color: #64748b;
  margin-left: 8px;
  line-height: 16px;
}

/* 展开行 hover 效果 */
.usr-table--clean tbody tr:hover > td {
  background: #f8fafc;
}
.usr-cust-child-row:hover > td {
  background: #f6f8fa;
}
.usr-cust-detail-row:hover > td {
  background: #f6f8fa;
}

/* 覆盖旧版 usr-td-action 的彩色左边框 */
.usr-table--clean .usr-td-action {
  text-align: center;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
}

/* 禁用行样式 */
.usr-table--clean .usr-row-disabled > td {
  opacity: 0.55;
}
.usr-table--clean .usr-row-disabled:hover > td {
  background: #f1f5f9;
}

/* 添加成员按钮行 */
.usr-table--clean .usr-cust-add-cell {
  padding: 8px 12px 8px 52px;
  border: 1px solid #e2e8f0;
}

.usr-section--audit {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 55%);
  border-color: #e2e8f0;
}
.usr-audit-detail {
  font-size: var(--ds-fs-body);
  color: #64748b;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.usr-scope-tag--danger { background: #fee2e2; color: #b91c1c; }

@media (max-width: 900px) {
  .usr-proj-layout { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   USR · 用户与权限 UI V2 优化
   - 卡片分层 · 筛选条重构 · 表格节奏 · 角色对照着色
   ═══════════════════════════════════════════════════════════ */

/* ── 1. 模块卡片分层 + 淡彩色背景变体 ── */
.usr-section {
  background: #ffffff;
  border-radius: 14px;
  padding: 18px 20px 20px;
  border: 1px solid #e4e4e7;
  border-left: 1px solid #e4e4e7;
}
.usr-section + .usr-section { margin-top: 18px; }
.usr-section:hover {
  box-shadow: none;
}

/* 变体 A：成员与角色 */
.usr-section--members {
}

/* 变体 B：客户开户 */
.usr-section--account {
}

/* 变体 C：角色能力对照 */
.usr-section--matrix {
}

/* 卡片头部：淡彩条 + 更强分隔 */
.usr-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 0 0 10px;
  border-bottom: 1px solid #f0f0f0;
}
.usr-section-head .usr-subtitle { margin: 0; font-size: var(--ds-fs-h3); font-weight: 700; letter-spacing: 0.2px; }
.usr-section--members .usr-section-head .usr-subtitle { color: #5b21b6; }
.usr-section--account .usr-section-head .usr-subtitle { color: #333333; }
.usr-section--matrix .usr-section-head .usr-subtitle { color: #333333; }
.usr-section-head .usr-section-desc { margin: 4px 0 0; font-size: var(--ds-fs-body); color: var(--muted); line-height: 1.55; }
.usr-section-head .usr-section-actions { flex-shrink: 0; }

/* ── 2. 成员表头部工具条 ── */
.usr-member-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.usr-member-head .usr-member-hints {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 260px;
}
.usr-member-head .hint { margin: 0; }

/* ── 3. 表格增强：斑马纹 · hover · 状态Badge ── */
.usr-table tbody tr { transition: background 0.15s; }
.usr-table tbody tr:hover { background: #f5f3ff; }
.usr-table tbody tr:nth-child(even) { background: #faf9ff; }
.usr-table tbody tr:nth-child(even):hover { background: #ede9fe; }
.usr-table tbody tr.usr-row--off { background: #fff7f7; }
.usr-table tbody tr.usr-row--off:hover { background: #ffecec; }

.usr-table th {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 1;
}

/* 状态标签升级为 Badge */
.usr-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: var(--ds-fs-body);
  font-weight: 700;
  line-height: 1.4;
}
.usr-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.usr-status--on {
  background: #ecfdf5;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.usr-status--on::before { background: #22c55e; }
.usr-status--off {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.usr-status--off::before { background: #ef4444; }

/* 编辑按钮微立体 */
.usr-actions .btn-ghost {
  border: 1px solid #e4e4e7;
  background: #fff;
  border-radius: 8px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.usr-actions .btn-ghost:hover {
  border-color: #a78bfa;
  color: #5b21b6;
  background: #f5f3ff;
}

/* ── 4. 客户开户表单（呼应青绿卡片）── */
.usr-customer-form {
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #fafafa;
  border: 1px solid #e4e4e7;
  margin-bottom: 22px;
}
.usr-customer-form .field {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.usr-customer-form .field:first-child { width: auto; }
.usr-customer-form .field:last-of-type { width: auto; }
.usr-customer-form .field > label {
  font-size: var(--ds-fs-body);
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
  line-height: 38px;
}
.usr-customer-form .field > label .req {
  color: #ef4444;
  margin-left: 2px;
}
.usr-customer-form .field > input {
  width: 200px;
  flex-shrink: 0;
  box-sizing: border-box;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  box-shadow: none;
  font-size: var(--ds-fs-body);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.usr-customer-form .field > input:focus {
  outline: none;
  border-color: #5b4dbe;
  box-shadow: none;
}
.usr-customer-form .btn-primary {
  height: 38px;
  padding: 0 20px;
  white-space: nowrap;
  font-weight: 700;
  border-radius: 8px;
  background: #5b4dbe;
  transition: background 0.15s;
  border: none;
  color: white;
  flex-shrink: 0;
}
.usr-customer-form .btn-primary:hover {
  background: #4c3fa6;
}
@media (max-width: 720px) {
  .usr-customer-form { flex-direction: column; align-items: stretch; }
  .usr-customer-form .btn-primary { width: 100%; }
}

/* ── 状态 pill 标签 ── */
.usr-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--ds-fs-body);
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 18px;
}
.usr-status-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.usr-status-pill--on {
  background: #ecfdf5;
  color: #15803d;
}
.usr-status-pill--on::before { background: #22c55e; }
.usr-status-pill--off {
  background: #fef2f2;
  color: #b91c1c;
}
.usr-status-pill--off::before { background: #ef4444; }

/* ── 网关数量 ── */
.usr-gw-count {
  font-size: var(--ds-fs-body);
  font-weight: 600;
  color: #1e293b;
}
.usr-gw-count em {
  font-style: normal;
  font-size: var(--ds-fs-body);
  font-weight: 400;
  margin-left: 2px;
}
.usr-gw-count--zero {
  color: #94a3b8;
  opacity: 0.6;
}

/* ── 行业标签 ── */
.usr-cust-industry-tag {
  display: inline-block;
  font-size: var(--ds-fs-body);
  font-weight: 400;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
  vertical-align: middle;
  line-height: 16px;
}

/* ── 操作列文字链接 ── */
.usr-act-link {
  background: none;
  border: none;
  padding: 0;
  font-size: var(--ds-fs-body);
  font-weight: 500;
  color: #5b4dbe;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s;
}
.usr-act-link:hover {
  text-decoration: underline;
}
.usr-act-link--danger {
  color: #ef4444;
}
.usr-act-sep {
  display: inline-block;
  width: 1px;
  height: 12px;
  background: #e2e8f0;
  vertical-align: middle;
  margin: 0 6px;
}

/* ── 分页控件 ── */
.usr-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px;
  gap: 12px;
}
.usr-pagination-info {
  font-size: var(--ds-fs-body);
  color: #94a3b8;
  white-space: nowrap;
}
.usr-pagination-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}
.usr-page-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  font-size: var(--ds-fs-body);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.usr-page-btn:hover:not(:disabled):not(.is-active) {
  border-color: #5b4dbe;
  color: #5b4dbe;
}
.usr-page-btn.is-active {
  background: #5b4dbe;
  border-color: #5b4dbe;
  color: #fff;
  cursor: default;
}
.usr-page-btn:disabled,
.usr-page-btn.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.usr-page-ellipsis {
  padding: 0 4px;
  color: #94a3b8;
  font-size: var(--ds-fs-body);
}

/* ── 6. 角色能力对照表 V2：着色 + 呼应角色配色 ── */
.usr-matrix {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}
.usr-matrix thead th {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  font-size: var(--ds-fs-body);
  font-weight: 800;
  padding: 10px 12px;
  color: #334155;
  position: sticky;
  top: 0;
  z-index: 1;
}
/* 表头与角色 badge 呼应色 */
.usr-matrix thead th[data-role="afp_ops"]   { color: #5b21b6; border-bottom-color: #c4b5fd; }
.usr-matrix thead th[data-role="admin"]     { color: #9d174d; border-bottom-color: #f9a8d4; }
.usr-matrix thead th[data-role="operator"]  { color: #047857; border-bottom-color: #6ee7b7; }
.usr-matrix thead th[data-role="viewer"]    { color: #475569; border-bottom-color: #cbd5e1; }

.usr-matrix tbody td {
  border-bottom: 1px solid #f1f5f9;
  padding: 10px 12px;
  vertical-align: middle;
}
.usr-matrix tbody tr { transition: background 0.15s; }
.usr-matrix tbody tr:hover { background: #f8fafc; }
.usr-matrix tbody tr:nth-child(even) { background: #fcfcfd; }
.usr-matrix tbody tr:nth-child(even):hover { background: #f4f4f7; }

/* ── Space members / user management ── */
.spc-mem-section {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  background: #fff;
}
.spc-mem-section-title {
  font-size: var(--ds-fs-body);
  font-weight: 500;
  color: #333;
  margin: 0 0 12px 0;
}
.spc-mem-form { display: flex; flex-direction: column; gap: 0; }
.spc-mem-fields {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap;
}
.spc-mem-fields .field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
  margin-bottom: 0;
}
.spc-mem-fields .field label {
  display: inline;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: var(--ds-fs-body);
  margin-bottom: 0;
}
.spc-mem-fields .field input,
.spc-mem-fields .field select {
  width: auto;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: var(--ds-fs-body);
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  background: #fff;
  box-shadow: none;
  outline: none;
  font-family: inherit;
  transition: none;
}
.spc-mem-fields .field input:focus,
.spc-mem-fields .field select:focus {
  border-color: #5b4dbe;
  box-shadow: none;
}
.spc-mem-divider {
  border-top: 1px solid #e2e8f0;
  margin: 12px 0;
}
.spc-area-picker-field { position: relative; flex-shrink: 0; }
.spc-area-picker-input {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  flex-wrap: wrap;
  min-width: 160px;
}
.spc-area-picker-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.spc-picker-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: var(--ds-fs-body);
  line-height: 1.4;
  white-space: nowrap;
}
.spc-picker-tag-x {
  cursor: pointer;
  font-size: var(--ds-fs-body);
  color: #6366f1;
  font-weight: 600;
}
.spc-picker-tag-x:hover { color: #ef4444; }
.spc-area-picker-placeholder {
  color: #94a3b8;
  font-size: var(--ds-fs-body);
  flex: 1;
}
.spc-area-picker-arrow {
  color: #94a3b8;
  font-size: var(--ds-fs-body);
  margin-left: auto;
  flex-shrink: 0;
}
.spc-area-picker-panel {
  position: fixed;
  z-index: 9999;
  min-width: 220px;
  max-width: 360px;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  padding: 8px;
}
.spc-picker-tree { display: flex; flex-direction: column; gap: 2px; }
.spc-picker-node label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--ds-fs-body);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
}
.spc-picker-node label:hover { background: #f1f5f9; }
.spc-picker-project > label { font-weight: 600; }
.spc-picker-building > label { padding-left: 20px; }
.spc-picker-floor > label { padding-left: 40px; font-size: var(--ds-fs-body); color: #64748b; }
.spc-mem-tree {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px;
  background: #f8fafc;
  max-height: 240px;
  overflow-y: auto;
  font-size: var(--ds-fs-body);
}
.spc-tree-node { padding: 4px 0; }
.spc-tree-node > label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #333;
}
.spc-tree-node > label input[type="checkbox"] {
  width: 14px; height: 14px;
  accent-color: #5b4dbe;
}
.spc-tree-project > .spc-tree-project-name {
  font-weight: 600;
  font-size: var(--ds-fs-body);
  color: #333;
  padding: 4px 0;
}
.spc-tree-project > label {
  font-weight: 600;
  font-size: var(--ds-fs-body);
  color: #333;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.spc-tree-building > label { font-weight: 500; }
.spc-tree-floor > label { color: #555; }
.spc-tree-room > label { color: #888; font-size: var(--ds-fs-body); }
.spc-tree-children {
  margin-left: 20px;
  border-left: 1px dashed #e2e8f0;
  padding-left: 8px;
}
.spc-mem-actions {
  display: flex;
  justify-content: flex-end;
}
.spc-mem-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.spc-mem-search {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: var(--ds-fs-body);
  color: #64748b;
  background: #f8fafc;
  width: 220px;
}
.spc-pill {
  display: inline-block;
  font-size: var(--ds-fs-body);
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.spc-pill--owner { color: #c2410c; background: #fff7ed; }
.spc-pill--admin { color: #5b4dbe; background: #f3f0ff; }
.spc-pill--operator { color: #0f766e; background: #ecfdf5; }
.spc-pill--viewer { color: #64748b; background: #f1f5f9; }
.spc-pill--active { color: #16a34a; background: #f0fdf4; }
.spc-pill--disabled { color: #dc2626; background: #fef2f2; }
.spc-area-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.spc-area-tag {
  font-size: var(--ds-fs-body);
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.spc-area-empty { color: #cbd5e1; }
.spc-mem-name-area {
  display: flex;
  align-items: center;
  gap: 8px;
}
.spc-mem-name {
  font-weight: 500;
  white-space: nowrap;
}
.spc-area-inline {
  flex-wrap: wrap;
}
.spc-row-disabled {
  opacity: 0.6;
}
.spc-btn-warn {
  color: #b45309;
  border-color: #fcd34d;
  background: #fffbeb;
}
.spc-btn-warn:hover {
  background: #fef3c7;
}
.spc-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.spc-row-actions select {
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: var(--ds-fs-body);
}
.spc-btn-danger { color: #dc2626; }
.spc-area-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
}
.spc-area-dialog {
  background: #fff;
  border-radius: 12px;
  width: 480px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.spc-area-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
}
.spc-area-dialog-head h3 {
  font-size: var(--ds-fs-h3);
  font-weight: 500;
  margin: 0;
  color: #333;
}
.spc-area-close {
  border: none;
  background: none;
  font-size: var(--ds-fs-display);
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.spc-area-dialog-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}
.spc-area-dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid #e2e8f0;
}

.usr-matrix tbody td:first-child {
  font-weight: 600;
  color: #1e293b;
  background: linear-gradient(90deg, #fafafa 0%, transparent 100%);
  border-right: 1px dashed #e4e4e7;
}

/* 能力点：✓ 用彩色徽章 / — 用灰 */
.usr-matrix-cell {
  font-size: var(--ds-fs-body);
  padding: 8px 10px !important;
  text-align: center !important;
}
.usr-matrix-cell > i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 22px;
  border-radius: 6px;
  font-style: normal;
  font-weight: 800;
}
.usr-matrix-cell.is-yes-afp_ops > i    { background: #ede9fe; color: #5b21b6; border: 1px solid #c4b5fd; }
.usr-matrix-cell.is-yes-admin > i      { background: #fce7f3; color: #9d174d; border: 1px solid #f9a8d4; }
.usr-matrix-cell.is-yes-operator > i   { background: #d1fae5; color: #047857; border: 1px solid #6ee7b7; }
.usr-matrix-cell.is-yes-viewer > i     { background: #e2e8f0; color: #475569; border: 1px solid #cbd5e1; }
.usr-matrix-cell.is-no > i             { background: transparent; color: #cbd5e1; }

/* ── 7. Tab 视觉升级 ── */
.usr-tabs {
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  gap: 4px;
  margin-bottom: 16px;
  border: none;
  display: inline-flex;
}
.usr-tab {
  padding: 8px 18px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #64748b;
  font-weight: 600;
  transition: all 0.18s ease;
}
.usr-tab:hover:not(.active) {
  color: #5b4dbe;
  background: rgba(91, 77, 190, 0.06);
}
.usr-tab.active {
  background: #5b4dbe;
  color: #fff;
  box-shadow: 0 1px 3px rgba(91, 77, 190, 0.3);
  font-weight: 700;
}
.usr-tab.active::after {
  display: none;
}

/* ── 8. 小数据质量兜底 ── */
.usr-cell-placeholder {
  color: #cbd5e1;
  font-style: italic;
  font-size: var(--ds-fs-body);
}
.usr-cell-placeholder::before { content: '— '; }

/* ── 设置备份 backups / backup-guard ── */
.bk-notice {
  padding: 16px 18px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #3b82f6;
}

.bk-notice-list {
  margin: 0;
  padding-left: 18px;
  color: #334155;
  line-height: 1.65;
  font-size: var(--ds-fs-body);
}

.bk-create-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow-in);
}

.bk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--ds-fs-body);
}

.bk-table th,
.bk-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f4f4f5;
  text-align: left;
  vertical-align: top;
}

.bk-table th {
  font-size: var(--ds-fs-body);
  color: var(--muted);
}

.bk-actions {
  white-space: nowrap;
}

.bk-guard {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.bk-guard.hidden { display: none; }

.bk-guard-card {
  width: min(440px, 100%);
  padding: 22px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: none;
}

.bk-guard--device .bk-guard-card {
  border-top: none;
}

.bk-guard-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.bk-guard-ico { font-size: 24px; }

.bk-guard-head h3 {
  margin: 0;
  font-size: var(--ds-fs-title);
}

.bk-guard-body {
  margin: 0 0 8px;
  line-height: 1.6;
  color: #334155;
  white-space: pre-line;
}

.bk-guard-note {
  margin: 0 0 14px;
  font-size: var(--ds-fs-body);
}

.bk-guard-label {
  margin-bottom: 16px;
}

.bk-guard-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

/* ── 备份提醒弹窗（拖拽改组/设备档案移动触发）· 对齐设计系统 ── */
#bkGuardModal { z-index: 9100; }
#bkGuardModal .bk-guard-card {
  width: min(460px, 100%);
  padding: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ds-border);
  border-radius: 12px;
  background: var(--ds-surface);
}
#bkGuardModal .bk-guard-head {
  display: flex;
  align-items: center;
  gap: var(--ds-sp-2);
  margin: 0;
  padding: var(--ds-sp-4) var(--ds-sp-5);
  border-bottom: 1px solid var(--ds-border);
}
#bkGuardModal .bk-guard-ico {
  display: flex;
  align-items: center;
  font-size: 20px;
}
#bkGuardModal .bk-guard-ico svg {
  width: 20px;
  height: 20px;
  color: var(--ds-primary);
}
#bkGuardModal.bk-guard--device .bk-guard-ico svg { color: var(--ds-warning); }
#bkGuardModal .bk-guard-head h3 {
  margin: 0;
  font-size: var(--ds-fs-h3);
  font-weight: 500;
  color: var(--ds-text);
}
#bkGuardModal .bk-guard-main {
  padding: var(--ds-sp-4) var(--ds-sp-5);
}
#bkGuardModal .bk-guard-body {
  margin: 0 0 var(--ds-sp-2);
  font-size: var(--ds-fs-body);
  font-weight: 500;
  line-height: 1.6;
  color: var(--ds-text);
  white-space: pre-line;
}
#bkGuardModal .bk-guard-note {
  margin: 0 0 var(--ds-sp-4);
  padding: var(--ds-sp-2) var(--ds-sp-3);
  font-size: var(--ds-fs-body);
  line-height: 1.6;
  color: var(--ds-text-mut);
  background: var(--ds-muted-bg);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-r-md);
}
#bkGuardModal .bk-guard-label {
  display: flex;
  flex-direction: column;
  gap: var(--ds-sp-1);
  margin: 0;
}
#bkGuardModal .bk-guard-label > span {
  font-size: var(--ds-fs-body);
  font-weight: 500;
  color: var(--ds-text-mut);
}
#bkGuardModal .bk-guard-label input {
  height: 36px;
  padding: 0 var(--ds-sp-3);
  font-size: var(--ds-fs-body);
  color: var(--ds-text);
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-r-md);
  outline: none;
  box-sizing: border-box;
  width: 100%;
}
#bkGuardModal .bk-guard-label input:focus {
  border-color: var(--ds-primary);
  box-shadow: 0 0 0 3px var(--ds-primary-bg);
}
#bkGuardModal .bk-guard-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: var(--ds-sp-2);
  margin: 0;
  padding: var(--ds-sp-3) var(--ds-sp-5);
  border-top: 1px solid var(--ds-border);
}
#bkGuardModal .bk-guard-actions-right {
  display: flex;
  gap: var(--ds-sp-2);
}

.saas-modal {
  z-index: 400;
  backdrop-filter: blur(4px);
}

.saas-modal--confirm .bk-guard-card {
  border-top: none;
}

.saas-modal--pick .bk-guard-card {
  border-top: none;
}

.saas-pick-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0 16px;
  max-height: min(320px, 50vh);
  overflow-y: auto;
}

.saas-pick-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-out);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.saas-pick-item:hover,
.saas-pick-item:focus-visible {
  outline: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-out-lg);
}

.saas-pick-item:active {
  transform: translateY(0);
  box-shadow: var(--shadow-in);
}

.saas-pick-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--primary-grad);
  color: #fff;
  font-size: var(--ds-fs-body);
  font-weight: 600;
}

.saas-pick-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.saas-pick-meta strong {
  font-size: var(--ds-fs-body);
  font-weight: 600;
}

.saas-pick-meta .hint {
  font-size: var(--ds-fs-body);
  word-break: break-all;
}

.saas-pick-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-in);
}

.saas-pick-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--ds-fs-body);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.saas-pick-select-all input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.saas-pick-count {
  font-size: var(--ds-fs-body);
}

.saas-pick-item--multi {
  cursor: pointer;
}

.saas-pick-item--multi .saas-pick-check {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.saas-pick-item--multi:has(.saas-pick-check:checked) {
  box-shadow: var(--shadow-out-lg);
  outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent);
}

.saas-modal--pick .bk-guard-actions {
  justify-content: flex-end;
  gap: 10px;
}

/* 项目列表 */
.proj-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--ds-fs-body);
}

.proj-table th,
.proj-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f4f4f5;
  text-align: left;
  vertical-align: top;
}

.proj-table th {
  font-size: var(--ds-fs-body);
  color: var(--muted);
}

.proj-row--active {
  background: rgba(59, 130, 246, 0.04);
}

.proj-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: var(--ds-fs-body);
  font-weight: 600;
  color: #1d4ed8;
  background: #dbeafe;
}

.proj-actions {
  white-space: nowrap;
}

.proj-actions .btn + .btn {
  margin-left: 4px;
}

.proj-time {
  white-space: nowrap;
  color: var(--muted);
  font-size: var(--ds-fs-body);
}

.proj-empty {
  padding: 24px 0;
}

.proj-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.proj-bound-cell {
  white-space: nowrap;
}

.proj-bound-count {
  color: #b45309;
}

.proj-del--blocked {
  opacity: 0.45;
  cursor: not-allowed;
}

/* 空间档案 · 交工进度看板 */
.spc-progress-board {
  margin: 0 0 16px;
  padding: 18px 20px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border: 1px solid #e8ecf1;
}

.spc-progress-board.hidden {
  display: none;
}

.spc-progress-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.spc-progress-head h3 {
  margin: 0 0 4px;
  font-size: var(--ds-fs-title);
}

.spc-progress-current {
  text-align: right;
}

.spc-progress-pct {
  display: block;
  font-size: var(--ds-fs-display-lg);
  font-weight: 700;
  color: #1d4ed8;
  line-height: 1.1;
}

.spc-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.spc-stat-chip {
  min-width: 72px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #eef0f3;
}

.spc-stat-val {
  display: block;
  font-size: var(--ds-fs-title);
  font-weight: 700;
}

.spc-stat-lbl {
  display: block;
  font-size: var(--ds-fs-body);
  color: var(--muted);
  margin-top: 2px;
}

.spc-stat-chip--bound .spc-stat-val { color: #1d4ed8; }
.spc-stat-chip--done .spc-stat-val { color: #15803d; }
.spc-stat-chip--warn .spc-stat-val { color: #b45309; }

.spc-timeline-wrap {
  margin-bottom: 14px;
}

.spc-timeline-axis {
  display: flex;
  justify-content: space-between;
  font-size: var(--ds-fs-body);
  color: var(--muted);
  margin-bottom: 6px;
}

.spc-timeline-track {
  position: relative;
  height: 108px;
  border-bottom: 2px solid #dbeafe;
  background: #f8fbff;
  border-radius: 8px 8px 0 0;
  overflow: visible;
}

.spc-timeline-grid {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent calc(25% - 1px),
    rgba(148, 163, 184, 0.12) calc(25% - 1px),
    rgba(148, 163, 184, 0.12) 25%
  );
}

.spc-timeline-steps {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
}

.spc-timeline-step {
  position: absolute;
  bottom: 0;
  height: calc(var(--step-h, 0) * 1%);
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.35) 0%, rgba(37, 99, 235, 0.55) 100%);
  border-top: 2px solid #2563eb;
  pointer-events: none;
}

.spc-timeline-tick {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  text-align: center;
  min-width: 56px;
}

.spc-tick-pct {
  display: block;
  font-size: var(--ds-fs-body);
  font-weight: 700;
  color: #1e40af;
  margin-bottom: 2px;
}

.spc-tick-mark {
  display: block;
  width: 2px;
  height: 14px;
  margin: 0 auto 4px;
  background: #2563eb;
}

.spc-tick-date {
  display: block;
  font-size: var(--ds-fs-body);
  color: var(--muted);
  white-space: nowrap;
}

.spc-segment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.spc-segment-head h4 {
  margin: 0;
  font-size: var(--ds-fs-body);
}

.spc-segment-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.spc-segment-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #eef0f3;
}

.spc-segment-range {
  font-size: var(--ds-fs-body);
  color: var(--muted);
  margin-bottom: 4px;
}

.spc-segment-main {
  font-size: var(--ds-fs-body);
}

.spc-segment-sub {
  margin-top: 2px;
  font-size: var(--ds-fs-body);
}

.spc-bound-note {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e5e7eb;
}

.spc-room-tag {
  display: inline-block;
  padding: 0 6px;
  border-radius: 999px;
  font-size: var(--ds-fs-body);
  font-weight: 600;
}

.spc-room-tag--empty {
  color: #64748b;
  background: #f1f5f9;
}

.spc-room-tag--bound {
  color: #1d4ed8;
  background: #dbeafe;
}

.spc-room-tag--delivered {
  color: #15803d;
  background: #dcfce7;
}

.acr-detail-block {
  margin-bottom: 14px;
}

.acr-detail-block strong {
  display: block;
  margin-bottom: 6px;
  color: var(--section);
}

.acr-pre {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: var(--ds-fs-body);
  line-height: 1.55;
  max-height: 240px;
  overflow: auto;
}

.acr-review-bar {
  align-items: center;
  margin-top: 8px;
}

.acr-l2-panel {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

.acr-l2-title {
  margin: 0 0 8px;
  font-size: var(--ds-fs-h3);
}

.acr-l2-field {
  display: block;
  margin-bottom: 12px;
}

.acr-l2-field span {
  display: block;
  margin-bottom: 6px;
  font-size: var(--ds-fs-body);
  font-weight: 700;
  color: var(--section);
}

.acr-l2-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  font-family: inherit;
  font-size: var(--ds-fs-body);
  line-height: 1.5;
  resize: vertical;
}

.acr-l2-meta {
  margin-bottom: 8px;
}

/* ── v1.6.1 网关详情卡片 (分组页面 GW 图标) ─────────────────── */

.grp-gw-card {
  margin-bottom: 14px;
}

.grp-gw-card.hidden {
  display: none;
}

.grp-gw-card-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
  border: 1px solid #bfdbfe;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.grp-gw-card-inner:hover,
.grp-gw-card-inner:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.18);
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.grp-gw-card-ico {
  font-size: 32px;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.15);
}

.grp-gw-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.grp-gw-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.grp-gw-name {
  font-size: var(--ds-fs-h3);
  font-weight: 700;
  color: #0f172a;
}

.grp-gw-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: var(--ds-fs-body);
  color: #475569;
}

.grp-gw-card-meta--2 {
  color: #334155;
}

.grp-gw-card-meta--3 {
  color: #475569;
  font-size: var(--ds-fs-body);
}

.grp-gw-card-cta {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-size: var(--ds-fs-body);
  font-weight: 600;
  white-space: nowrap;
}

.grp-gw-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: var(--ds-fs-body);
  font-weight: 600;
  line-height: 1.5;
}

.grp-gw-tag--ok {
  background: #dcfce7;
  color: #166534;
}

.grp-gw-tag--off {
  background: #fee2e2;
  color: #991b1b;
}

.grp-gw-tag--na {
  background: #f1f5f9;
  color: #475569;
}

.grp-gw-tag--radar-on {
  background: #fef3c7;
  color: #92400e;
}

.grp-gw-tag--radar-off {
  background: #e0e7ff;
  color: #3730a3;
}

/* 网关详情抽屉 */
.saas-modal--gw .bk-guard-card {
  width: min(640px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  border-top: none;
}

.grp-gw-drawer-close {
  margin-left: auto;
}

.grp-gw-drawer-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 8px 0 12px;
}

.grp-gw-section {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  background: #f8fafc;
}

.grp-gw-section-title {
  font-size: var(--ds-fs-body);
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #cbd5e1;
}

.grp-gw-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  font-size: var(--ds-fs-body);
  line-height: 1.5;
}

.grp-gw-row + .grp-gw-row {
  border-top: 1px solid #f1f5f9;
}

.grp-gw-row-label {
  color: #64748b;
  flex-shrink: 0;
  min-width: 110px;
}

.grp-gw-row-val {
  color: #0f172a;
  text-align: right;
  word-break: break-all;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .grp-gw-card-inner {
    flex-wrap: wrap;
  }
  .grp-gw-card-cta {
    width: 100%;
    text-align: center;
  }
  .grp-gw-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .grp-gw-row-val {
    text-align: left;
  }
}

/* v1.17.1 — 数据缺失友好提示 */
.grp-gw-warn {
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  color: #92400e;
  font-size: var(--ds-fs-body);
  line-height: 1.6;
}

.grp-gw-drawer-warn {
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: var(--ds-fs-body);
  line-height: 1.7;
}

.grp-gw-na {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #94a3b8;
  font-size: var(--ds-fs-body);
  font-style: italic;
}

/* 雷达参数可编辑表单 */
.grp-gw-radar-config {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
}
.grp-gw-form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.grp-gw-form-row label {
  min-width: 90px;
  font-size: var(--ds-fs-body);
  color: #475569;
}
.grp-gw-form-row input[type="number"] {
  width: 100px;
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: var(--ds-fs-body);
  color: #0f172a;
  background: #fff;
}
.grp-gw-form-row input[type="number"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.grp-gw-form-row .hint {
  color: #94a3b8;
  font-size: var(--ds-fs-body);
}
.grp-gw-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}
.grp-gw-ok { color: #16a34a; }
.grp-gw-err { color: #dc2626; }

/* 传感器历史表格 */
.grp-gw-history-box {
  overflow-x: auto;
  margin-top: 4px;
}
.grp-gw-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--ds-fs-body);
}
.grp-gw-history-table thead th {
  text-align: left;
  padding: 6px 8px;
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
.grp-gw-history-table tbody td {
  padding: 6px 8px;
  border-bottom: 1px solid #f1f5f9;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.grp-gw-history-table tbody tr:hover {
  background: #f8fafc;
}
.grp-gw-history-table .grp-gw-ts {
  color: #64748b;
  font-size: var(--ds-fs-body);
  white-space: nowrap;
}
@media (max-width: 640px) {
  .grp-gw-history-table thead { display: none; }
  .grp-gw-history-table, .grp-gw-history-table tbody, .grp-gw-history-table tr, .grp-gw-history-table td { display: block; width: 100%; }
  .grp-gw-history-table tbody tr { padding: 6px 0; border-bottom: 1px solid #e2e8f0; }
  .grp-gw-history-table tbody td { border: none; padding: 2px 0; }
  .grp-gw-history-table tbody td::before { content: attr(data-label) ": "; color: #64748b; font-weight: 600; }
}

/* —— OTA 管理页 —— */
.ota-hub .ota-meta { margin: 0 0 12px; }
.ota-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.4fr);
  gap: 16px;
}
@media (max-width: 900px) {
  .ota-grid { grid-template-columns: 1fr; }
}
.ota-section-title {
  font-size: var(--ds-fs-body);
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}
.ota-form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.ota-form-row > label:first-child {
  min-width: 110px;
  color: #64748b;
  font-size: var(--ds-fs-body);
}
.ota-form-row input[type="number"] {
  width: 160px;
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}
.ota-form-row--checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--ds-fs-body);
  color: #334155;
  margin-right: 12px;
}
.ota-val { font-size: var(--ds-fs-body); color: #0f172a; font-weight: 600; }
.ota-select, #otaPkgProduct, #otaPkgLabel {
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: var(--ds-fs-body);
}
.ota-select { min-width: 220px; flex: 1; }
.ota-form-row--upload input[type="file"] { font-size: var(--ds-fs-body); max-width: 100%; }
.ota-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.ota-table-wrap { max-height: 320px; overflow: auto; }
.ota-table tbody tr.ota-row--incapable { opacity: 0.55; }
.ota-table tbody tr.ota-row--stale td { color: #94a3b8; }
.ota-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: var(--ds-fs-body);
  font-weight: 600;
}
.ota-tag--ok { background: #dcfce7; color: #166534; }
.ota-tag--off { background: #fee2e2; color: #991b1b; }
.ota-tag--na { background: #f1f5f9; color: #64748b; }
.ota-jobs { display: flex; flex-direction: column; gap: 8px; }
.ota-job {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  background: #fff;
}
.ota-job:hover, .ota-job.ota-job--active { border-color: #94a3b8; background: #f8fafc; }
.ota-job-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; font-size: var(--ds-fs-body); }
.ota-job-targets { margin-top: 6px; font-size: var(--ds-fs-body); color: #475569; line-height: 1.5; }
.ota-job-detail {
  margin-top: 10px;
  padding: 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  font-size: var(--ds-fs-body);
}
.ota-job-detail.hidden { display: none; }

/* ========== Scene page v2 (design system) ========== */
.sc-page-wrap { display: flex; flex-direction: column; gap: var(--ds-sp-4); }
.sc-page-wrap > .ds-section { margin-bottom: 0; }
.sc-page-wrap .ds-section-title { font-size: var(--ds-fs-h3); }

/* Package grid + cards */
.sc-pkg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--ds-sp-3); }
.sc-pkg-card { border: 1px solid var(--ds-border); border-radius: var(--ds-r-lg); background: var(--ds-surface); padding: var(--ds-sp-5); display: flex; flex-direction: column; gap: var(--ds-sp-3); position: relative; transition: border-color 0.15s; }
.sc-pkg-card:hover { border-color: var(--ds-text-light); }
.sc-pkg-top { display: flex; align-items: flex-start; gap: var(--ds-sp-3); }
.sc-pkg-icon-wrap { width: 44px; height: 44px; border-radius: var(--ds-r-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sc-pkg-icon-wrap svg { width: 24px; height: 24px; }
.sc-pkg-icon--hjg { background: var(--ds-warning-bg); color: var(--ds-warning); }
.sc-pkg-icon--classroom { background: var(--ds-primary-bg); color: var(--ds-primary); }
.sc-pkg-icon--meeting { background: var(--ds-primary-bg); color: var(--ds-primary); }
.sc-pkg-icon--custom { background: var(--ds-gray-bg); color: var(--ds-gray); }
.sc-pkg-body { flex: 1; min-width: 0; }
.sc-pkg-name { font-size: var(--ds-fs-h3); font-weight: 600; color: var(--ds-text); line-height: 1.4; }
.sc-pkg-desc { font-size: var(--ds-fs-body); color: var(--ds-text-mut); margin-top: 2px; line-height: 1.5; }
.sc-pkg-summary { font-size: var(--ds-fs-body); color: var(--ds-text-light); line-height: 1.5; padding: var(--ds-sp-1) var(--ds-sp-2); background: var(--ds-muted-bg); border-radius: var(--ds-r-sm); }
.sc-pkg-apply-btn { width: 100%; margin-top: auto; }
.sc-pkg-foot { display: flex; gap: var(--ds-sp-2); }
.sc-pkg-foot-btn { flex: 1; padding: 5px 0; font-size: var(--ds-fs-body); }
.sc-applied-tag { font-size: var(--ds-fs-body); color: var(--ds-text-mut); display: flex; align-items: center; gap: var(--ds-sp-1); }
.sc-applied-tag svg { width: 12px; height: 12px; }

/* Editor wrap */
.sc-editor-wrap { border: 1px solid var(--ds-border); border-radius: var(--ds-r-lg); background: var(--ds-surface); overflow: hidden; }

/* Slot tabs (file-folder style) */
.sc-slot-tabs { display: flex; gap: var(--ds-sp-1); padding: var(--ds-sp-4) var(--ds-sp-5) 0; }
.sc-slot-tab { padding: var(--ds-sp-2) var(--ds-sp-5); border: 1px solid var(--ds-border); border-bottom: none; border-radius: var(--ds-r-md) var(--ds-r-md) 0 0; background: var(--ds-muted-bg); font-size: var(--ds-fs-h3); cursor: pointer; color: var(--ds-text-mut); display: flex; align-items: center; gap: var(--ds-sp-1); transition: all 0.12s; }
.sc-slot-tab:hover { color: var(--ds-text); }
.sc-slot-tab.active { background: var(--ds-surface); color: var(--ds-text); font-weight: 600; border-bottom: 1px solid var(--ds-surface); margin-bottom: -1px; position: relative; z-index: 1; }
.sc-slot-tab svg { width: 16px; height: 16px; }

/* Editor body */
.sc-editor { border-top: 1px solid var(--ds-border); padding: var(--ds-sp-5); }
.sc-editor-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--ds-sp-4); }
.sc-hero-title { font-size: var(--ds-fs-h3); font-weight: 600; color: var(--ds-text); }
.sc-hero-sub { font-size: var(--ds-fs-body); color: var(--ds-text-mut); margin-top: 2px; }

/* Lux row */
.sc-lux-row { display: flex; align-items: center; gap: var(--ds-sp-6); padding: var(--ds-sp-3) 0; border-bottom: 1px solid var(--ds-border); margin-bottom: var(--ds-sp-4); flex-wrap: wrap; }
.sc-lux-check { display: flex; align-items: center; gap: var(--ds-sp-1); font-size: var(--ds-fs-body); color: var(--ds-text); cursor: pointer; }
.sc-lux-check input { width: 16px; height: 16px; accent-color: var(--ds-primary); }
.sc-lux-slider-group { display: flex; align-items: center; gap: var(--ds-sp-2); }
.sc-lux-slider-label { font-size: var(--ds-fs-body); color: var(--ds-text-mut); white-space: nowrap; }
.sc-lux-bar { width: 200px; }
.sc-lux-slider { width: 200px; height: 6px; -webkit-appearance: none; appearance: none; background: var(--ds-gray-bg); border-radius: var(--ds-r-sm); outline: none; }
.sc-lux-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--ds-primary); cursor: pointer; }
.sc-lux-slider::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--ds-primary); cursor: pointer; border: none; }
.sc-lux-val { font-size: var(--ds-fs-body); font-weight: 600; min-width: 60px; color: var(--ds-text); }

/* Group rows */
.sc-group-rows { display: flex; flex-direction: column; gap: var(--ds-sp-2); }
.sc-group-row { display: grid; grid-template-columns: 80px 50px 1fr 24px 1fr 80px; gap: var(--ds-sp-3); align-items: center; padding: var(--ds-sp-2) var(--ds-sp-3); border: 1px solid var(--ds-border); border-radius: var(--ds-r-md); background: var(--ds-muted-bg); }
.sc-grp-name { font-size: var(--ds-fs-h3); font-weight: 500; color: var(--ds-text); }
.sc-grp-on { display: flex; align-items: center; }
.sc-grp-on input { width: 16px; height: 16px; accent-color: var(--ds-primary); }
.sc-grp-field { display: flex; flex-direction: column; gap: var(--ds-sp-1); }
.sc-grp-field-label { font-size: var(--ds-fs-body); color: var(--ds-text-mut); }
.sc-grp-field-bar { height: 6px; background: var(--ds-gray-bg); border-radius: var(--ds-r-sm); position: relative; }
.sc-grp-field-fill { height: 100%; border-radius: var(--ds-r-sm); position: absolute; left: 0; top: 0; transition: width 0.08s; }
.sc-grp-field-fill--bright { background: #f59e0b; }
.sc-grp-field-fill--temp { background: #3b82f6; }
.sc-grp-field-fill--lux { background: var(--ds-primary); }
.sc-grp-field-range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; -webkit-appearance: none; appearance: none; background: transparent; }
.sc-grp-field-range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; cursor: pointer; }
.sc-grp-field-range::-moz-range-thumb { width: 16px; height: 16px; cursor: pointer; border: none; }
.sc-grp-field-val { font-size: var(--ds-fs-body); font-weight: 600; text-align: right; color: var(--ds-text); }
.sc-empty { padding: var(--ds-sp-6); text-align: center; color: var(--ds-text-light); font-size: var(--ds-fs-body); }

/* Editor actions - extend ds-actions */
.sc-editor-actions.ds-actions { justify-content: flex-start; margin-top: var(--ds-sp-5); padding-top: var(--ds-sp-4); border-top: 1px solid var(--ds-border); }

/* Modal */
.sc-modal-row { display: flex; align-items: center; gap: var(--ds-sp-2); margin-bottom: var(--ds-sp-3); }
.sc-modal-row-label { width: 50px; flex-shrink: 0; }
.sc-modal-row select { flex: 1; }
.sc-modal-summary { padding: var(--ds-sp-2) var(--ds-sp-3); background: var(--ds-muted-bg); border-radius: var(--ds-r-md); font-size: var(--ds-fs-body); color: var(--ds-text-mut); margin-bottom: var(--ds-sp-4); }
.sc-modal-summary b { color: var(--ds-text); }
.sc-modal-sub { font-size: var(--ds-fs-body); color: var(--ds-text-mut); margin-bottom: var(--ds-sp-5); }

/* Responsive */
@media (max-width: 900px) {
  .sc-pkg-grid { grid-template-columns: 1fr; }
  .sc-group-row { grid-template-columns: 80px 50px 1fr; }
  .sc-group-row > .sc-grp-gap { display: none; }
  .sc-group-row > .sc-grp-field:nth-child(5) { display: none; }
  .sc-group-row > .sc-grp-field-val { display: none; }
}


/* v1.22.60: A/B 节点升B标注 — 左上角 A橙/B蓝 */
.dev-tile-ab {
  position: absolute;
  top: -1px; left: -1px;
  z-index: 2;
  font-size: 10px; font-weight: 700;
  padding: 0 4px; border-radius: 6px 0 6px 0;
  line-height: 14px; pointer-events: none;
}
.dev-tile-ab.ab-A { background: #e67e22; color: #fff; }
.dev-tile-ab.ab-B { background: #2980d9; color: #fff; }