*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.45;
  min-height: 100vh;
}

button { font-family: inherit; cursor: default; border: none; background: none; }
img { display: block; max-width: 100%; }

/* ── Gallery shell ── */
.gallery {
  padding: 40px 32px 80px;
  max-width: 100%;
}

.gallery-header {
  max-width: 960px;
  margin: 0 auto 36px;
}

.gallery-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 10px;
}

.gallery-eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
  animation: pulse-dot 2s ease infinite;
}

.gallery-header h1 {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 8px;
}

.gallery-header p {
  font-size: 15px;
  color: var(--text-2);
  max-width: 560px;
}

.gallery-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.gallery-nav a {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-body);
  text-decoration: none;
  background: var(--surface);
  box-shadow: var(--sh-border);
  transition-property: background-color, color, box-shadow, transform;
  transition-duration: 150ms;
  transition-timing-function: var(--ease-out);
}

.gallery-nav a:hover {
  background: var(--hover);
  color: var(--accent);
  box-shadow: var(--sh-border-hover);
}

.gallery-nav a:active {
  transform: scale(0.96);
}

.section-block {
  margin-bottom: 48px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 20px 8px;
}

.phone-row {
  display: flex;
  flex-wrap: wrap;
  gap: 36px 28px;
  align-items: flex-start;
}

.phone-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: var(--phone-w);
}

.phone-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-body);
  padding-left: 4px;
}

.phone-label span {
  font-weight: 400;
  color: var(--text-3);
  margin-left: 6px;
}

/* ── Phone chrome ── */
.phone {
  width: var(--phone-w);
  height: var(--phone-h);
  border-radius: var(--r-phone);
  background: var(--bg);
  box-shadow: var(--sh-phone);
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  flex-shrink: 0;
}

.phone.phone-tall {
  height: auto;
  min-height: var(--phone-h);
}

.phone-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}

/* Status bar */
.status-bar {
  height: var(--status-h);
  padding: 14px 22px 0;
  padding-right: var(--capsule-right);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  z-index: 2;
  position: relative;
}

/* 微信胶囊占位（预览用），避免误以为右上角可放控件 */
.status-bar::after {
  content: "";
  position: absolute;
  top: 11px;
  right: 10px;
  width: 87px;
  height: 32px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.04);
  pointer-events: none;
  z-index: 3;
}

.status-bar.on-blue::after {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.14);
}

.status-bar.on-blue {
  color: #fff;
}

.status-bar-time {
  min-width: 54px;
  font-variant-numeric: tabular-nums;
}

.status-bar-icons {
  display: none; /* 微信预览：右上角为胶囊，不再用系统信号图标占位 */
}

.status-bar-icons svg {
  display: block;
}

/* Page scroll body */
.page-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.page-scroll::-webkit-scrollbar { width: 0; }

/* ── Tab bar ── */
.tab-bar {
  height: var(--tab-h);
  padding: 6px 0 var(--safe-b);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--hairline);
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  flex-shrink: 0;
  z-index: 5;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding-top: 2px;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.tab-item.active {
  color: var(--accent);
}

.tab-item svg {
  width: 24px;
  height: 24px;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke-width: 1.6;
}

/* Active: light fill + slightly heavier stroke (outline → filled presence) */
.tab-item.active svg {
  fill: currentColor;
  fill-opacity: 0.18;
  stroke: currentColor;
  stroke-width: 2;
}

/* ── Home header band ── */
.home-header {
  background: var(--grad-header);
  color: #fff;
  padding: 0 0 28px;
  margin-top: calc(-1 * var(--status-h));
  padding-top: var(--status-h);
  flex-shrink: 0;
}

.home-header .status-bar {
  margin-bottom: 4px;
}

.home-greeting {
  padding: 4px var(--pad-x) 0;
  padding-right: var(--capsule-right);
}

.home-greeting .hi {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.85;
  margin-bottom: 4px;
}

.home-greeting h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  text-wrap: balance;
}

.home-greeting .sub {
  margin-top: 6px;
  font-size: 13px;
  opacity: 0.8;
  font-weight: 400;
  text-wrap: pretty;
}

/* Content below blue header — positive gap, do not tuck cards under header */
.content-sheet {
  margin-top: 12px;
  padding: 0 var(--pad-x) 16px;
  position: relative;
  z-index: 1;
}

/* Flat page (detection) */
.page-flat {
  padding: 0 var(--pad-x) 16px;
}

.page-title-row {
  padding: 8px 0 14px;
  padding-right: calc(var(--capsule-right) - var(--pad-x));
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.page-title-row h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.page-title-row .meta {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ── KPI grid ── */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.kpi-cell {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 14px 14px 12px;
  box-shadow: var(--sh-card);
}

.kpi-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.kpi-value .unit {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-3);
}

.kpi-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-4);
  font-weight: 500;
}

.kpi-meta.up { color: var(--heat); }
.kpi-meta.ok { color: var(--live); }

/* ── CTA card ── */
.cta-card {
  background: var(--grad-cta);
  border-radius: var(--r-card);
  padding: 18px 16px;
  color: #fff;
  box-shadow: var(--sh-cta);
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  position: relative;
}

.cta-card::after {
  content: '';
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  top: -48px;
  right: -28px;
  pointer-events: none;
}

.cta-card h2 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
  text-wrap: balance;
}

.cta-card p {
  font-size: 12px;
  opacity: 0.88;
  line-height: 1.45;
  position: relative;
  z-index: 1;
  text-wrap: pretty;
}

.cta-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

.btn-solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  transition-property: transform, background-color, box-shadow;
  transition-duration: 150ms;
  transition-timing-function: var(--ease-press);
}

.btn-solid:active { transform: scale(0.96); }

.btn-glass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 13px;
  font-weight: 550;
  border: 1px solid rgba(255, 255, 255, 0.28);
  transition-property: transform, background-color, border-color;
  transition-duration: 150ms;
  transition-timing-function: var(--ease-press);
}

.btn-glass:active { transform: scale(0.96); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.28);
  transition-property: transform, background-color, box-shadow;
  transition-duration: 150ms;
  transition-timing-function: var(--ease-press);
}

.btn-primary:active:not(:disabled) { transform: scale(0.96); }
.btn-primary:disabled { opacity: 0.45; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-body);
  font-size: 14px;
  font-weight: 550;
  box-shadow: var(--sh-border);
  transition-property: transform, background-color, box-shadow;
  transition-duration: 150ms;
  transition-timing-function: var(--ease-press);
}

.btn-secondary:active:not(:disabled) { transform: scale(0.96); }
.btn-secondary:disabled { opacity: 0.45; }

/* ── Section label ── */
.section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin: 4px 2px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-label .more {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-link);
}

/* ── Scene cards ── */
.scene-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.scene-card {
  background: var(--surface);
  border-radius: var(--r-panel); /* 20 = 8 + 12 */
  padding: 12px;
  box-shadow: var(--sh-card);
  display: flex;
  align-items: center;
  gap: 12px;
}

.scene-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px; /* concentric with card padding */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.scene-icon.retail { background: rgba(0, 113, 227, 0.1); color: var(--accent); }
.scene-icon.kitchen { background: rgba(255, 107, 0, 0.12); color: var(--heat); }
.scene-icon.server { background: rgba(94, 92, 230, 0.12); color: var(--indigo); }

.scene-main { flex: 1; min-width: 0; }

.scene-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.scene-sub {
  font-size: 12px;
  color: var(--text-3);
}

.scene-count {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

.scene-count.muted,
.scene-count.zero { color: var(--text-4); }

.scene-count-label {
  font-size: 10px;
  color: var(--text-4);
  text-align: right;
  margin-top: 2px;
  font-weight: 500;
}

/* ── Alert rows (recent / list) ── */
.alert-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.alert-card {
  background: var(--surface);
  border-radius: var(--r-card); /* 18 = 8 + 10 */
  padding: 10px;
  box-shadow: var(--sh-card);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--r-thumb);
  flex-shrink: 0;
  background: linear-gradient(145deg, #e8e8ed 0%, #d2d2d7 100%);
  overflow: hidden;
  outline: 1px solid oklch(0 0 0 / 0.1);
  outline-offset: -1px;
}

.thumb-lg {
  width: 100%;
  height: 200px;
  border-radius: var(--r-card);
  background: linear-gradient(145deg, #c8c8d0 0%, #a8a8b0 40%, #d8d8de 100%);
  position: relative;
  outline: 1px solid oklch(0 0 0 / 0.1);
  outline-offset: -1px;
}

.thumb-lg::after {
  content: '截图预览';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
}

.alert-main { flex: 1; min-width: 0; }

.alert-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.alert-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alert-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alert-foot {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Confidence bar */
.conf-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.conf-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--track);
  overflow: hidden;
  min-width: 48px;
}

.conf-fill {
  height: 100%;
  border-radius: 2px;
}

.conf-fill.ok { background: var(--live); }
.conf-fill.high { background: var(--heat); }
.conf-fill.danger { background: var(--danger); }

.conf-text {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 32px;
}

.conf-text.ok { color: var(--live); }
.conf-text.high { color: var(--heat); }
.conf-text.danger { color: var(--danger); }

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.tag.heat { background: var(--heat-bg); color: var(--heat); }
.tag.ok { background: var(--ok-bg); color: #248a3d; }
.tag.muted { background: rgba(142, 142, 147, 0.14); color: var(--text-2); }
.tag.live { background: var(--live-bg); color: #248a3d; }

/* ── Filter chips ── */
.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 14px;
  margin: 0 calc(-1 * var(--pad-x));
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
  -webkit-overflow-scrolling: touch;
}

.chip-row::-webkit-scrollbar { height: 0; }

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-body);
  background: var(--surface);
  box-shadow: var(--sh-border);
  white-space: nowrap;
  flex-shrink: 0;
  gap: 4px;
  transition-property: transform, background-color, color, box-shadow;
  transition-duration: 150ms;
  transition-timing-function: var(--ease-press);
}

.chip:active { transform: scale(0.96); }

.chip.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.28);
}

.chip .chip-x {
  font-size: 14px;
  opacity: 0.7;
  margin-left: 2px;
}

.filter-hint {
  font-size: 12px;
  color: var(--text-3);
  margin: -6px 0 12px;
  font-weight: 500;
}

/* ── Empty / skeleton ── */
.empty-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 40px;
  text-align: center;
}

.empty-illus {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: rgba(0, 113, 227, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--accent);
}

.empty-illus svg {
  width: 32px;
  height: 32px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  text-wrap: balance;
}

.empty-desc {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.5;
  max-width: 240px;
  margin-bottom: 18px;
  text-wrap: pretty;
}

/* Skeleton */
.sk {
  background: linear-gradient(90deg, #ececf0 25%, #f5f5f7 50%, #ececf0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 8px;
}

.sk-kpi {
  height: 78px;
  border-radius: var(--r-card);
}

.sk-card {
  height: 68px;
  border-radius: var(--r-card);
  margin-bottom: 10px;
}

.sk-row {
  height: 80px;
  border-radius: var(--r-card);
  margin-bottom: 8px;
}

.sk-title {
  height: 28px;
  width: 160px;
  margin-bottom: 10px;
  border-radius: 6px;
}

.sk-chip {
  height: 36px;
  width: 72px;
  border-radius: var(--r-pill);
}

/* ── Detail screen ── */
.detail-meta {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 14px 16px;
  box-shadow: var(--sh-card);
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.meta-row .k { color: var(--text-3); font-weight: 500; }
.meta-row .v { color: var(--text); font-weight: 550; text-align: right; }

.detail-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.detail-actions .btn-secondary,
.detail-actions .btn-primary {
  flex: 1;
}

.nav-back {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 4px;
  max-width: calc(100% - (var(--capsule-right) - var(--pad-x)));
}

.nav-back svg { width: 18px; height: 18px; }

.llm-box {
  background: var(--hover);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-body);
  line-height: 1.55;
  border: 1px solid var(--hairline);
}

.llm-box .label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

/* Icon helpers for scene */
.ic-svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Segmented control (画面 · 实时|截图) ── */
.seg {
  display: flex;
  padding: 3px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 12px; /* 9 + 3 */
  margin: 0 0 14px;
}

.seg button {
  flex: 1;
  min-height: 36px;
  height: 36px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 550;
  color: var(--text-2);
  transition-property: background-color, color, box-shadow, transform;
  transition-duration: 150ms;
  transition-timing-function: var(--ease-press);
}

.seg button:active { transform: scale(0.96); }

.seg button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--sh-border);
}

/* ── 画面 · 实时预览 ── */
.picker-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.picker {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--sh-border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.picker .caret {
  width: 14px;
  height: 14px;
  color: var(--text-3);
  display: inline-flex;
  flex-shrink: 0;
}

.picker .caret svg {
  width: 14px;
  height: 14px;
}

.preview-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-card);
  background: linear-gradient(145deg, #2c2c2e 0%, #1c1c1e 55%, #3a3a3c 100%);
  box-shadow: var(--sh-panel);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
}

.preview-stage.live::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(0, 113, 227, 0.25), transparent 55%),
    radial-gradient(ellipse at 70% 70%, rgba(94, 92, 230, 0.2), transparent 50%);
  pointer-events: none;
}

.preview-stage .live-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  z-index: 1;
}

.preview-stage .live-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.5);
  animation: pulse-dot 2s ease infinite;
}

.preview-stage.offline {
  background: #e8e8ed;
  color: var(--text-3);
}

.preview-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.preview-actions .btn-primary,
.preview-actions .btn-secondary {
  flex: 1;
}

.channel-sheet {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--sh-card);
  overflow: hidden;
}

.channel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
}

.channel-row:last-child { border-bottom: none; }
.channel-row.active { background: rgba(0, 113, 227, 0.06); }

.channel-row .online-dot,
.cam-row .online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  flex-shrink: 0;
}

.channel-row .online-dot.on,
.cam-row .online-dot.on {
  background: var(--live);
  box-shadow: 0 0 0 3px rgba(48, 209, 88, 0.18);
}

.channel-row .main { flex: 1; min-width: 0; }
.channel-row .title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.channel-row .sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* ── 画面 · 图片监控 ── */
.snap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.snap-card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--sh-card);
  overflow: hidden;
}

.snap-thumb {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #e8e8ed, #d2d2d7);
  outline: 1px solid oklch(0 0 0 / 0.1);
  outline-offset: -1px;
}

.snap-body {
  padding: 8px 10px 10px;
}

.snap-body .title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.snap-body .time {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.snap-body .btn-ghost {
  margin-top: 6px;
  font-size: 11px;
  color: var(--accent);
  font-weight: 550;
  padding: 0;
}

/* ── 我的 ── */
.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--sh-card);
  margin-bottom: 16px;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--grad-cta);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-main { flex: 1; min-width: 0; }
.profile-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.profile-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}

.menu-group {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--sh-card);
  overflow: hidden;
  margin-bottom: 12px;
}

.menu-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--hairline);
}

.menu-row:last-child { border-bottom: none; }

.menu-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(0, 113, 227, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.menu-icon svg {
  width: 18px;
  height: 18px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-icon.tint-cam { background: rgba(0, 113, 227, 0.1); color: var(--accent); }
.menu-icon.tint-bell { background: rgba(255, 107, 0, 0.12); color: var(--heat); }
.menu-icon.tint-info { background: rgba(94, 92, 230, 0.12); color: var(--indigo); }
.menu-icon.tint-out { background: rgba(255, 59, 48, 0.1); color: #ff3b30; }

.menu-row .label {
  flex: 1;
  font-size: 15px;
  font-weight: 550;
  color: var(--text);
}

.menu-row .hint {
  font-size: 12px;
  color: var(--text-3);
}

.menu-row .chev {
  width: 16px;
  height: 16px;
  color: var(--text-4);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-row .chev svg {
  width: 16px;
  height: 16px;
}

.menu-row.danger .label { color: #ff3b30; }
.menu-row.danger .menu-icon { color: #ff3b30; background: rgba(255, 59, 48, 0.1); }

.toggle {
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: var(--faint);
  position: relative;
  flex-shrink: 0;
  transition-property: background-color;
  transition-duration: 200ms;
  transition-timing-function: var(--ease-press);
}

/* Expand hit area to ~44×44 without overlapping neighbors too hard */
.toggle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
}

.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition-property: transform;
  transition-duration: 200ms;
  transition-timing-function: var(--ease-out);
  pointer-events: none;
}

.toggle.on {
  background: var(--live);
}

.toggle.on::after {
  transform: translateX(18px);
}

/* ── 摄像头管理 ── */
.group-block {
  margin-bottom: 12px;
}

.group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 4px 8px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-2);
}

.group-head .count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.group-head .fold {
  width: 16px;
  height: 16px;
  color: var(--text-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.group-head .fold svg {
  width: 14px;
  height: 14px;
}

.group-head .fold.is-collapsed svg {
  transform: rotate(-90deg);
}

/* 整组通道用一张圆角卡片，避免 first-of-type 选不中导致顶直角 */
.cam-sheet {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--sh-card);
  overflow: hidden;
}

.cam-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
}

.cam-row:last-child {
  border-bottom: none;
}

.cam-row .main { flex: 1; min-width: 0; }
.cam-row .title {
  font-size: 14px;
  font-weight: 600;
}
.cam-row .sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

/* Respect reduced motion (shimmer / pulse / press scales) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

