html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  background: #f3f4f8;
  overflow: auto;
  scroll-behavior: auto;
}

body.view-subcontrol {
  display: block;
  overflow: hidden;
  background: #0f1419;
  height: 100%;
  min-height: 100%;
}

body.view-subcontrol.desktop-mode {
  align-items: stretch !important;
  justify-content: flex-start !important;
}

body.view-subcontrol #demoFrameRoot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  margin: 0;
}

body.view-subcontrol .demo-sc-stage {
  flex: 0 0 auto;
  position: relative;
  overflow: visible;
}

body.view-subcontrol .desktop-shell {
  position: relative;
  top: auto;
  left: auto;
  flex: 0 0 auto;
  width: var(--demo-sc-design-w, 760px);
  max-width: none;
  height: auto;
  min-height: 0;
  margin: 0;
  transform: none;
  border-radius: 0;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
}

body.view-subcontrol .window-title-bar .title-close-btn,
body.view-subcontrol .compact-close-btn,
body.view-subcontrol #license-panel,
body.view-subcontrol #tab-row {
  display: none !important;
}

body.view-subcontrol .desktop-col-left .tab-panels .tab-content {
  display: flex !important;
}

/* 副中控演示：右栏 Tab + 子卡片网格；左栏空调与右栏网格等高底对齐 */
body.view-subcontrol.demo-frame-body {
  --demo-light-card-h: 140px;
  --demo-light-grid-gap: 12px;
  --demo-light-grid-inset: 12px;
  --demo-aux-tab-header-h: 46px;
  --demo-light-grid-rows: 2;
  --demo-light-grid-body-h: calc(
    var(--demo-light-card-h) * var(--demo-light-grid-rows) +
    var(--demo-light-grid-gap) * max(0, var(--demo-light-grid-rows) - 1) +
    var(--demo-light-grid-inset) * 2
  );
  --demo-remote-card-h: var(--demo-light-grid-body-h);
  --demo-sc-design-w: 760px;
  --demo-sc-scale: 1;
  display: block !important;
  height: 100% !important;
  min-height: 100%;
  overflow: hidden;
}

body.view-subcontrol.demo-frame-body .desktop-main {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  flex: 0 0 auto !important;
  height: auto !important;
  min-height: 0;
  align-items: stretch;
  overflow: visible;
}

body.view-subcontrol.demo-frame-body .desktop-col-left,
body.view-subcontrol.demo-frame-body .desktop-col-right {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: auto;
  min-height: 0;
  overflow: visible;
}

body.view-subcontrol.demo-frame-body .col-section-label {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  min-height: var(--demo-aux-tab-header-h);
  padding: 6px 12px 4px;
  text-align: center;
}

body.view-subcontrol.demo-frame-body .desktop-col-left > .remote-container.ac-remote-card,
body.view-subcontrol.demo-frame-body.desktop-mode .desktop-col-left > .remote-container.ac-remote-card {
  flex: 0 0 auto !important;
  height: var(--demo-remote-card-h) !important;
  min-height: var(--demo-remote-card-h) !important;
  max-height: var(--demo-remote-card-h) !important;
  overflow: hidden !important;
}

body.view-subcontrol.demo-frame-body .desktop-col-right > .remote-container.aux-remote-card,
body.view-subcontrol.demo-frame-body.desktop-mode .desktop-col-right > .remote-container.aux-remote-card {
  flex: 0 0 auto !important;
  height: var(--demo-remote-card-h) !important;
  min-height: var(--demo-remote-card-h) !important;
  max-height: var(--demo-remote-card-h) !important;
  overflow: hidden !important;
}

body.view-subcontrol.demo-frame-body.desktop-mode .desktop-col-right > .remote-container:not(.aux-remote-card) {
  height: var(--demo-remote-card-h) !important;
  min-height: var(--demo-remote-card-h) !important;
  max-height: var(--demo-remote-card-h) !important;
}

body.view-subcontrol.demo-frame-body .ac-remote-card {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

body.view-subcontrol.demo-frame-body .ac-remote-card .tab-panels,
body.view-subcontrol.demo-frame-body .ac-remote-card .tab-content.active,
body.view-subcontrol.demo-frame-body #ac-panel {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  overflow: hidden !important;
}

body.view-subcontrol.demo-frame-body #ac-panel .controls {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

body.view-subcontrol.demo-frame-body.desktop-mode #ac-panel .controls {
  justify-content: flex-start !important;
  gap: 8px !important;
  padding: 4px 12px 10px !important;
}

body.view-subcontrol.demo-frame-body.desktop-mode #ac-panel .row:has(.power) {
  margin-top: auto !important;
}

body.view-subcontrol.demo-frame-body .aux-tab-panel:not(.active) {
  display: none !important;
}

body.view-subcontrol.demo-frame-body .col-section-label--aux {
  position: relative;
  z-index: 40;
  flex-shrink: 0;
  min-height: var(--demo-aux-tab-header-h);
  padding: 6px 12px 4px;
  pointer-events: auto;
  -webkit-app-region: no-drag;
  app-region: no-drag;
}

body.view-subcontrol.demo-frame-body .col-section-label--aux .aux-tab-row {
  gap: 12px;
  justify-content: center;
  width: 100%;
  pointer-events: auto;
}

body.view-subcontrol.demo-frame-body .col-section-label--aux .tab-btn {
  position: relative;
  z-index: 41;
  min-width: 76px;
  min-height: 36px;
  padding: 6px 16px;
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-app-region: no-drag;
  app-region: no-drag;
}

body.view-subcontrol.demo-frame-body .aux-remote-card {
  position: relative;
  z-index: 1;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

body.view-subcontrol.demo-frame-body .aux-tab-panels {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
}

body.view-subcontrol.demo-frame-body .aux-tab-panel.active {
  flex: 1 1 auto;
  min-height: 0;
}

body.view-subcontrol.demo-frame-body .lights-section .sidebar-devices,
body.view-subcontrol.demo-frame-body .fresh-air-section .sidebar-devices {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
}

body.view-subcontrol.demo-frame-body .lights-section .sidebar-devices-grid,
body.view-subcontrol.demo-frame-body .fresh-air-section .sidebar-devices-grid {
  flex: 1 1 auto;
  width: 100%;
  height: 100% !important;
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(var(--demo-light-grid-rows, 2), var(--demo-light-card-h, 140px)) !important;
  grid-auto-rows: var(--demo-light-card-h, 140px) !important;
  gap: var(--demo-light-grid-gap, 12px);
  padding: var(--demo-light-grid-inset, 12px);
  box-sizing: border-box;
  align-content: start;
  overflow: hidden !important;
}

body.view-subcontrol.demo-frame-body .fresh-air-section.aux-tab-panel.active {
  justify-content: flex-start;
}

body.view-subcontrol.demo-frame-body .fresh-air-section .sidebar-devices-grid {
  flex: 1 1 auto;
  height: 100% !important;
  grid-template-rows: repeat(var(--demo-light-grid-rows, 2), var(--demo-light-card-h, 140px)) !important;
  align-content: start;
}

body.view-subcontrol.demo-frame-body .fresh-air-section .sidebar-devices-grid .sidebar-device-card {
  grid-row: 2 !important;
}

body.view-subcontrol.demo-frame-body #lights-sidebar .sidebar-devices-grid .sidebar-device-card,
body.view-subcontrol.demo-frame-body #fresh-air-sidebar .sidebar-devices-grid .sidebar-device-card,
body.view-subcontrol.demo-frame-body.desktop-mode #lights-sidebar.sidebar-devices .sidebar-device-card,
body.view-subcontrol.demo-frame-body.desktop-mode #fresh-air-sidebar.sidebar-devices .sidebar-device-card,
body.view-subcontrol.demo-frame-body .sidebar-device-card {
  height: var(--demo-light-card-h, 140px) !important;
  min-height: var(--demo-light-card-h, 140px) !important;
  max-height: var(--demo-light-card-h, 140px) !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  align-items: center !important;
  align-self: stretch !important;
  justify-self: stretch !important;
  padding: 8px 6px 6px !important;
  gap: 6px !important;
  overflow: visible !important;
  box-sizing: border-box;
}

body.view-subcontrol.demo-frame-body .lights-section .sidebar-card-name,
body.view-subcontrol.demo-frame-body .lights-section .sidebar-device-name,
body.view-subcontrol.demo-frame-body .fresh-air-section .sidebar-card-name,
body.view-subcontrol.demo-frame-body .fresh-air-section .sidebar-device-name {
  flex: 0 0 auto;
  width: 100%;
  min-height: calc(0.72rem * 1.2 * 2);
  max-height: calc(0.72rem * 1.2 * 2);
  font-size: 0.72rem;
  line-height: 1.2;
  text-align: center;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
}

body.view-subcontrol.demo-frame-body .lights-section .sidebar-card-visual,
body.view-subcontrol.demo-frame-body .fresh-air-section .sidebar-card-visual {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
}

body.view-subcontrol.demo-frame-body .lights-section .sidebar-card-actions,
body.view-subcontrol.demo-frame-body .fresh-air-section .sidebar-card-actions {
  flex: 0 0 auto;
  margin-top: 4px;
}

/* 右栏 Tab：扩大可点击区域，避免「新风」点不进去 */
body.view-subcontrol.demo-frame-body .aux-tab-header,
body.view-subcontrol.demo-frame-body .col-section-label--aux {
  position: relative;
  z-index: 40;
  pointer-events: auto;
  -webkit-app-region: no-drag;
  app-region: no-drag;
}

body.view-subcontrol.demo-frame-body .aux-tab-header .aux-tab-row,
body.view-subcontrol.demo-frame-body .col-section-label--aux .aux-tab-row {
  gap: 12px;
  justify-content: center;
  width: 100%;
  pointer-events: auto;
}

body.view-subcontrol.demo-frame-body .aux-tab-header .tab-btn,
body.view-subcontrol.demo-frame-body .col-section-label--aux .tab-btn {
  position: relative;
  z-index: 41;
  min-width: 76px;
  min-height: 36px;
  padding: 6px 16px;
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-app-region: no-drag;
  app-region: no-drag;
}

body.view-subcontrol.demo-frame-body.desktop-mode .aux-remote-card,
body.view-subcontrol.demo-frame-body.desktop-mode .aux-tab-panels,
body.view-subcontrol.demo-frame-body.desktop-mode .aux-tab-panel.active,
body.view-subcontrol.demo-frame-body.desktop-mode .lights-section .sidebar-devices,
body.view-subcontrol.demo-frame-body.desktop-mode .fresh-air-section .sidebar-devices {
  overflow: hidden !important;
  height: auto !important;
}

body.view-subcontrol.demo-frame-body.desktop-mode #lights-sidebar .sidebar-devices-grid,
body.view-subcontrol.demo-frame-body.desktop-mode #fresh-air-sidebar .sidebar-devices-grid {
  grid-template-rows: repeat(var(--demo-light-grid-rows, 2), var(--demo-light-card-h, 140px)) !important;
  grid-auto-rows: var(--demo-light-card-h, 140px) !important;
  height: 100% !important;
  overflow: hidden !important;
}

body.view-subcontrol.demo-frame-body.desktop-mode #lights-sidebar .sidebar-devices-grid .sidebar-device-card,
body.view-subcontrol.demo-frame-body.desktop-mode #fresh-air-sidebar .sidebar-devices-grid .sidebar-device-card {
  height: var(--demo-light-card-h, 140px) !important;
  min-height: var(--demo-light-card-h, 140px) !important;
  max-height: var(--demo-light-card-h, 140px) !important;
  overflow: visible !important;
}

body.view-subcontrol.demo-frame-body.desktop-mode .desktop-col-left > .remote-container.ac-remote-card,
body.view-subcontrol.demo-frame-body.desktop-mode .desktop-col-right > .remote-container.aux-remote-card {
  height: var(--demo-remote-card-h) !important;
  min-height: var(--demo-remote-card-h) !important;
  max-height: var(--demo-remote-card-h) !important;
}

/* 空调卡片：按模式切换背景色 */
body.view-subcontrol.demo-frame-body .ac-remote-card::before {
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

body.view-subcontrol.demo-frame-body .ac-remote-card.mode-cool::before,
body.view-subcontrol.demo-frame-body .ac-remote-card.ac-powered-on.mode-cool::before {
  background: linear-gradient(165deg, rgba(14, 165, 233, 0.28) 0%, rgba(24, 28, 36, 0.94) 58%);
  border-color: rgba(79, 195, 247, 0.38);
  box-shadow: inset 0 1px 0 rgba(129, 212, 250, 0.12);
}

body.view-subcontrol.demo-frame-body .ac-remote-card.mode-heat::before,
body.view-subcontrol.demo-frame-body .ac-remote-card.ac-powered-on.mode-heat::before {
  background: linear-gradient(165deg, rgba(249, 115, 22, 0.32) 0%, rgba(24, 28, 36, 0.94) 58%);
  border-color: rgba(255, 107, 107, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 171, 145, 0.12);
}

body.view-subcontrol.demo-frame-body .ac-remote-card.mode-fan_only::before,
body.view-subcontrol.demo-frame-body .ac-remote-card.ac-powered-on.mode-fan_only::before {
  background: linear-gradient(165deg, rgba(16, 185, 129, 0.26) 0%, rgba(24, 28, 36, 0.94) 58%);
  border-color: rgba(102, 187, 106, 0.38);
  box-shadow: inset 0 1px 0 rgba(129, 199, 132, 0.12);
}

body.view-subcontrol.demo-frame-body .ac-remote-card.mode-dry::before,
body.view-subcontrol.demo-frame-body .ac-remote-card.ac-powered-on.mode-dry::before,
body.view-subcontrol.demo-frame-body .ac-remote-card.mode-auto::before,
body.view-subcontrol.demo-frame-body .ac-remote-card.ac-powered-on.mode-auto::before {
  background: linear-gradient(165deg, rgba(171, 71, 188, 0.24) 0%, rgba(24, 28, 36, 0.94) 58%);
  border-color: rgba(206, 147, 216, 0.36);
  box-shadow: inset 0 1px 0 rgba(206, 147, 216, 0.1);
}

body.view-subcontrol.demo-frame-body .ac-remote-card.mode-off::before,
body.view-subcontrol.demo-frame-body .ac-remote-card.ac-powered-off::before {
  background: rgba(24, 28, 36, 0.92);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.view-subcontrol.demo-frame-body #ac-panel .control-group.mode-group {
  transition: background 0.3s ease, border-color 0.3s ease;
}

/* 包厢概览：内置等距图（有人 / 空闲） */
.demo-frame-app .dashboard-suite-isometric {
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.demo-frame-app .dashboard-suite-isometric.occupied {
  background-image: url("assets/suite-room-occupied.png") !important;
}

.demo-frame-app .dashboard-suite-isometric.idle {
  background-image: url("assets/suite-room-idle.png") !important;
}

.demo-frame-view-overview .dashboard-suite-card.occupied .dashboard-suite-isometric {
  filter: drop-shadow(0 14px 24px rgba(16, 24, 40, 0.2));
  opacity: 1;
}

.demo-frame-view-overview .dashboard-suite-card.idle .dashboard-suite-isometric {
  filter: drop-shadow(0 10px 18px rgba(16, 24, 40, 0.12));
  opacity: 0.92;
}

.demo-frame-view-overview .dashboard-suite-visual {
  min-height: 132px;
  padding: 10px 0 6px;
}

.demo-frame-view-overview .dashboard-suite-isometric {
  width: min(100%, 220px);
  aspect-ratio: 1 / 0.88;
}

/* 包厢详情：平铺网格，卡片按内容高度 */
.demo-frame-view-detail #page-rooms,
.demo-frame-view-detail #page-rooms .demo-frame-grid-host,
.demo-frame-view-detail #roomsGrid {
  width: 100% !important;
  max-width: none !important;
}

.demo-frame-view-detail #roomsGrid {
  display: grid !important;
  grid-template-columns: repeat(
    auto-fill,
    minmax(min(100%, 240px), 1fr)
  ) !important;
  gap: 12px !important;
  align-items: start !important;
  grid-auto-rows: auto !important;
}

.demo-frame-view-detail #roomsGrid > .rp-suite-pro-card {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  align-self: start !important;
  justify-self: stretch !important;
}

.demo-frame-view-detail .rp-suite-pro-card--physical {
  display: flex !important;
  flex-direction: column !important;
  height: auto !important;
}

.demo-frame-view-detail .rp-suite-pro-device-matrix--physical {
  display: grid !important;
  grid-template-rows:
    minmax(var(--rp-suite-ac-min, 88px), var(--rp-suite-ac-min, 88px))
    minmax(var(--rp-suite-lights-min, 44px), var(--rp-suite-lights-min, 44px))
    minmax(var(--rp-suite-vent-min, 88px), var(--rp-suite-vent-min, 88px)) !important;
  gap: var(--rp-suite-matrix-gap, 4px);
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
}

.demo-frame-view-detail .rp-suite-pro-device-matrix--physical > .rp-suite-pro-ac {
  grid-row: 1;
}

.demo-frame-view-detail .rp-suite-pro-device-matrix--physical > .rp-suite-pro-lights {
  grid-row: 2;
}

.demo-frame-view-detail .rp-suite-pro-device-matrix--physical > .rp-suite-pro-vent {
  grid-row: 3;
}

/* 排风 / 送风 双列并排，避免 is-single 导致文字重叠 */
.demo-frame-view-detail .rp-suite-pro-vent,
.demo-frame-view-detail .rp-suite-pro-vent.is-single {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  min-height: var(--rp-suite-vent-min, 88px) !important;
  height: var(--rp-suite-vent-min, 88px) !important;
  overflow: hidden;
}

.demo-frame-view-detail .rp-suite-pro-vent-col {
  min-height: 0 !important;
  height: 100% !important;
  overflow: hidden;
}

.demo-frame-view-detail .rp-suite-pro-vent-label {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* 包厢概览：卡片平铺 */
.demo-frame-view-overview #roomOverviewGrid {
  display: grid !important;
  grid-template-columns: repeat(
    auto-fill,
    minmax(min(100%, 260px), 1fr)
  ) !important;
  gap: 14px !important;
  width: 100% !important;
  align-items: stretch !important;
}

.demo-frame-view-overview #roomOverviewGrid > .dashboard-suite-card {
  width: 100% !important;
  height: auto !important;
}

/* 包厢控制：对齐 room_panel #infoModalBody / modal-overview */
.demo-frame-view-devices .demo-room-control-host,
.demo-frame-view-devices .demo-frame-grid-host {
  width: 100% !important;
}

.demo-frame-view-devices .demo-room-control-host {
  padding: 0;
}

.demo-frame-view-devices .demo-room-control-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
  padding: 0;
}

.demo-frame-view-devices .demo-room-control-body .rp-overview-modal {
  max-height: none;
  overflow: visible;
  padding-right: 0;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  padding: 14px;
}

.demo-frame-view-devices .demo-room-control-body .rp-overview-board {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px !important;
  align-items: stretch !important;
}

.demo-frame-view-devices .demo-room-control-body .rp-subcontrol-master-bar,
.demo-frame-view-devices .demo-room-control-body .rp-bulk-control--master {
  margin-bottom: 10px;
}

.demo-frame-view-devices .demo-room-control-body .rp-overview-slot-card.is-collapsed .rp-detail-expand {
  display: none;
}

.demo-frame-view-devices .rp-overview-temp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.demo-frame-view-devices .rp-temp-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: #334155;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.demo-frame-view-devices .rp-temp-btn:hover {
  border-color: rgba(99, 102, 241, 0.35);
  color: #4338ca;
}

body.view-room-panel {
  background: #f3f4f8;
  color: #1e293b;
  overflow: hidden;
}

body.room-panel-page.demo-frame-body {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100%;
  overflow: hidden;
  align-items: stretch !important;
  justify-content: flex-start !important;
}

body.room-panel-page.demo-frame-body #demoFrameRoot,
body.room-panel-page.demo-frame-body .demo-frame-app.demo-frame-app--embedded,
body.room-panel-page.demo-frame-body #roomPanelApp.shell-app {
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
}

/* ===== 嵌入演示：无内层侧栏，主区全宽 ===== */
.demo-frame-app.demo-frame-app--embedded {
  display: flex !important;
  flex-direction: column !important;
  width: 100%;
  min-height: 100%;
  height: 100%;
  background: #f3f4f8;
}

.demo-frame-app.demo-frame-app--embedded > .demo-frame-main {
  flex: 1 1 auto;
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
  min-height: 0;
}

.demo-frame-app.shell-app {
  min-height: 100%;
  height: 100%;
}

.demo-frame-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.demo-frame-main .rp-main-top.demo-frame-scroll-header {
  position: static;
  top: auto;
  flex-shrink: 0;
  padding: 0;
  margin-bottom: 0;
}

.demo-frame-overview-chrome {
  flex-shrink: 0;
}

.demo-frame-main .room-panel-content.demo-frame-scroll {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 10px 14px 14px;
  overflow: auto;
  overscroll-behavior-y: auto;
  scroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
}

.demo-frame-main .rp-main-top {
  padding: 0;
  flex-shrink: 0;
}

.demo-frame-main .rp-room-pages-chrome {
  display: block !important;
  flex-shrink: 0;
  margin-bottom: 12px;
}

.demo-frame-view-detail .demo-frame-overview-chrome,
.demo-frame-view-devices .demo-frame-overview-chrome,
.demo-frame-view-detail .rp-main-top,
.demo-frame-view-devices .rp-main-top,
.demo-frame-view-detail .rp-room-pages-chrome,
.demo-frame-view-devices .rp-room-pages-chrome,
.demo-frame-view-detail .rp-dashboard-bar,
.demo-frame-view-devices .rp-dashboard-bar {
  display: none !important;
}

.demo-frame-main .rp-dashboard-bar {
  margin-bottom: 0;
}

.demo-frame-main .page.active {
  flex: 0 0 auto;
  min-height: auto;
  display: block;
}

.demo-frame-main .rp-list-page {
  flex: 0 0 auto;
  min-height: auto;
}

.demo-frame-cards-only,
.demo-frame-cards-only .suite-room-grid {
  min-height: auto;
  overflow: visible;
}

.demo-frame-view-detail .room-panel-content,
.demo-frame-view-devices .room-panel-content {
  padding-top: 12px;
}

.demo-frame-view-detail #roomsGrid,
.demo-frame-view-overview #roomOverviewGrid {
  overflow: visible !important;
  max-height: none !important;
}

.demo-frame-view-detail .rp-suite-pro-card,
.demo-frame-view-overview .dashboard-suite-card {
  overflow: visible;
}

/* 演示页精简顶栏，避免挤占内容宽度 */
.demo-frame-main .rp-page-header {
  gap: 12px;
}

.demo-frame-main .rp-page-actions .rp-wizard-chip,
.demo-frame-main .rp-page-actions .rp-activity-log-chip,
.demo-frame-main .rp-page-actions .rp-virtual-chip,
.demo-frame-main .rp-page-actions .rp-refresh-btn {
  display: none !important;
}

.demo-frame-main .rp-page-actions {
  flex-wrap: nowrap;
  gap: 8px;
}

.demo-frame-main .rp-metrics-row {
  gap: clamp(8px, 1.2vw, 16px);
}

/* 场景 + 批量控制：保证两列与内部卡片比例 */
.demo-frame-main .rp-dashboard-row2 {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 12px;
}

.demo-frame-main .rp-dashboard-row2 .rp-scene-preset-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.demo-frame-main .rp-dashboard-row2 .rp-scene-preset-card {
  min-height: 72px;
  height: 100%;
  padding: 12px 14px;
  gap: 12px;
  align-items: center;
}

.demo-frame-main .rp-dashboard-row2 .rp-scene-preset-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.demo-frame-main .rp-dashboard-row2 .rp-scene-preset-copy strong {
  font-size: 15px;
  line-height: 1.2;
}

.demo-frame-main .rp-dashboard-row2 .rp-scene-preset-copy em {
  font-size: 12px;
  line-height: 1.3;
  -webkit-line-clamp: 1;
}

.demo-frame-main .rp-dashboard-row2 .rp-quick-control-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.demo-frame-main .rp-dashboard-row2 .rp-quick-section {
  padding: 12px 14px;
  min-height: 72px;
  height: 100%;
  gap: 8px;
  justify-content: space-between;
}

.demo-frame-main .rp-dashboard-row2 .rp-quick-section-head {
  padding: 0 0 6px;
  margin: 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.demo-frame-main .rp-dashboard-row2 .rp-quick-section-head span {
  font-size: 13px;
  white-space: nowrap;
}

.demo-frame-main .rp-dashboard-row2 .rp-quick-section-actions {
  margin-top: auto;
}

.demo-frame-main .rp-dashboard-row2 .rp-dash-panel--quick .rp-scene-hud-btn {
  min-height: 34px;
  font-size: 12px;
  padding: 6px 8px;
}

.demo-frame-grid-host {
  flex: 0 0 auto;
  min-height: auto;
  display: block;
}

.demo-frame-grid-host .suite-room-grid {
  min-height: auto;
  overflow: visible;
}

.demo-frame-grid-host .rp-overview-modal {
  min-height: auto;
  display: block;
  overflow: visible;
  margin-top: 0;
}

.demo-frame-grid-host .rp-overview-stage {
  min-height: auto;
  display: block;
}

.demo-frame-grid-host .rp-overview-board {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.demo-frame-grid-host .rp-overview-slot {
  min-height: auto;
  height: auto;
  padding: 14px;
}

.demo-frame-grid-host .rp-overview-slot-list {
  flex: none;
  overflow: visible;
  max-height: none;
}

.demo-frame-grid-host .rp-overview-slot-card {
  min-height: 72px;
  flex-shrink: 0;
}

.demo-frame-main .rp-page-toolbar .field input,
.demo-frame-main .dashboard-sort-select,
.demo-frame-main .room-page-sort-select {
  pointer-events: none;
}

.demo-frame-app .rp-scene-preset-card.is-active,
.demo-frame-app .rp-scene-preset-card.is-season-active {
  border-color: #f97316;
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.35);
}

@media (max-width: 1180px) {
  .demo-frame-main .rp-dashboard-row2 {
    grid-template-columns: 1fr;
  }

  .demo-frame-grid-host .rp-overview-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .demo-frame-view-devices .demo-room-control-body .rp-overview-board,
  .demo-frame-grid-host .rp-overview-board {
    grid-template-columns: 1fr !important;
  }
  .demo-frame-main .rp-dashboard-row2 .rp-quick-control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .demo-frame-main .rp-metrics-row {
    flex-wrap: wrap;
  }

  .demo-frame-main .rp-page-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .demo-frame-main .room-panel-content.demo-frame-scroll {
    padding: 8px 10px 12px;
  }
}

@media (max-width: 560px) {
  body.view-subcontrol.demo-frame-body:not(.demo-fs-desktop) .desktop-main {
    grid-template-columns: 1fr !important;
  }

  .demo-frame-main .rp-dashboard-row2 .rp-scene-preset-grid {
    grid-template-columns: 1fr;
  }

  .demo-frame-main .rp-dashboard-row2 .rp-quick-control-grid {
    grid-template-columns: 1fr;
  }

  .demo-frame-view-overview #roomOverviewGrid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Fullscreen desktop layout — override embedded mobile breakpoints */
body.demo-fs-desktop.demo-frame-body .demo-frame-main .rp-dashboard-row2 {
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr) !important;
}

body.demo-fs-desktop .demo-frame-main .rp-dashboard-row2 .rp-scene-preset-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

body.demo-fs-desktop .demo-frame-main .rp-dashboard-row2 .rp-quick-control-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

body.demo-fs-desktop .demo-frame-main .rp-metrics-row {
  flex-wrap: nowrap !important;
}

body.demo-fs-desktop .demo-frame-main .rp-page-header {
  flex-wrap: nowrap !important;
}

body.demo-fs-desktop .demo-frame-grid-host .rp-overview-board {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

body.demo-fs-desktop.demo-frame-view-overview #roomOverviewGrid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)) !important;
}

body.demo-fs-desktop.view-subcontrol.demo-frame-body #demoFrameRoot {
  align-items: center !important;
  justify-content: center !important;
}

body.demo-fs-desktop.view-subcontrol .demo-sc-stage {
  margin: 0 auto;
}

body.demo-fs-desktop.view-subcontrol.demo-frame-body .desktop-main {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  align-items: stretch !important;
}

body.demo-fs-desktop.view-subcontrol.demo-frame-body .desktop-col-left,
body.demo-fs-desktop.view-subcontrol.demo-frame-body .desktop-col-right {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
}

body.demo-fs-desktop.view-subcontrol.demo-frame-body .col-section-label,
body.demo-fs-desktop.view-subcontrol.demo-frame-body .col-section-label--aux {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  min-height: var(--demo-aux-tab-header-h) !important;
}

body.demo-fs-desktop.view-subcontrol.demo-frame-body .col-section-label--aux .aux-tab-row {
  justify-content: center !important;
  width: 100% !important;
}

body.demo-fs-desktop.view-subcontrol.demo-frame-body .desktop-col-left > .remote-container.ac-remote-card,
body.demo-fs-desktop.view-subcontrol.demo-frame-body .desktop-col-right > .remote-container.aux-remote-card {
  flex: 0 0 auto !important;
  height: var(--demo-remote-card-h) !important;
  min-height: var(--demo-remote-card-h) !important;
  max-height: var(--demo-remote-card-h) !important;
}

body.demo-fs-desktop.view-subcontrol.demo-frame-body #ac-panel .row:has(.power) {
  margin-top: auto !important;
}

body.demo-fs-desktop.view-subcontrol.demo-frame-body .fresh-air-section .sidebar-devices-grid .sidebar-device-card {
  grid-row: 2 !important;
}

body.demo-fs-desktop .demo-frame-main .room-panel-content.demo-frame-scroll {
  padding: 10px 14px 14px !important;
}
