/* ============================================================
   大聚 X9 屏端 HMI · 外壳与通用页面样式（1920×1080 设计基准）
   ============================================================ */
@import url("../shared/css/tokens.css");
@import url("../shared/css/base.css");

html, body { height: 100%; overflow: hidden; background: #141517; }
body { display: flex; align-items: center; justify-content: center; }

#stage {
  width: 1920px; height: 1080px; background: var(--bg);
  position: relative; overflow: hidden;
  transform-origin: center center;
  display: grid;
  grid-template-rows: 88px 1fr 120px;
  grid-template-columns: 128px 1fr;
  grid-template-areas:
    "header header"
    "sidebar content"
    "bottombar bottombar";
  font-size: 15px;
  color: var(--ink);
  user-select: none;
}

/* ======================= 顶部 ======================= */
.hmi-header { grid-area: header; display: flex; background: var(--dark); position: relative; z-index: 30; }
.brand-block {
  width: 372px; flex: 0 0 372px; background: #fff; display: flex; align-items: center;
  gap: 12px; padding: 0 20px 0 24px;
}
.brand-block .logo { width: 46px; height: 46px; flex: 0 0 auto; }
.brand-block .bt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.brand-block .bt b { font-size: 16.5px; letter-spacing: 0.6px; color: var(--ink); white-space: nowrap; }
.brand-block .bt span { font-size: 8.5px; letter-spacing: 0.8px; color: #9aa0a8; white-space: nowrap; }
.brand-block .fd { margin-left: auto; color: #c9ccd2; }

.status-bar {
  flex: 1; display: flex; align-items: center; gap: 26px; padding: 0 26px 0 30px; color: #fff;
  min-width: 0;
}
.status-bar .model { display: flex; align-items: baseline; gap: 14px; white-space: nowrap; }
.status-bar .model b { font-family: var(--font-num); font-size: 30px; font-weight: 800; letter-spacing: 1.5px; }
.status-bar .model span { font-size: 23px; font-weight: 800; letter-spacing: 3px; }
.status-bar .device-switch {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 8px; cursor: pointer; font-size: 14px;
  color: #e8eaee; background: rgba(255, 255, 255, .06); white-space: nowrap;
}
.status-bar .device-switch:hover { background: rgba(255, 255, 255, .12); }
.status-bar .device-switch .dot-on { width: 7px; height: 7px; border-radius: 50%; background: #43d17c; box-shadow: 0 0 8px #43d17c; }
.status-bar .device-switch .dot-off { width: 7px; height: 7px; border-radius: 50%; background: #e5484d; }
.status-bar .spacer { flex: 1; }
.status-bar .hse-info { display: flex; flex-direction: column; gap: 2px; text-align: right; white-space: nowrap; }
.status-bar .hse-info b { font-size: 14px; font-weight: 600; color: #f0f2f4; }
.status-bar .hse-info span { font-size: 11.5px; color: #9ca3ad; }
.status-bar .date { font-family: var(--font-num); font-size: 17px; letter-spacing: 0.4px; white-space: nowrap; color: #e8eaee; }
.status-bar .weather { display: flex; align-items: center; gap: 8px; font-size: 15px; color: #e8eaee; white-space: nowrap; }
.status-bar .weather svg { color: #f2c14e; }
.status-bar .net { display: flex; align-items: center; gap: 12px; }
.status-bar .net .item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #cbd0d6; }
.status-bar .net .item svg { color: #7fd48a; }
.status-bar .net .item.off svg { color: #6b7078; }
.status-bar .bell {
  position: relative; width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center;
  justify-content: center; color: #e8eaee; cursor: pointer; background: rgba(255, 255, 255, .06);
}
.status-bar .bell:hover { background: rgba(255, 255, 255, .14); }
.status-bar .bell.has-alarm { color: #ff6b70; animation: bellshake 2.4s infinite; }
.status-bar .bell .badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
@keyframes bellshake {
  0%, 100% { transform: rotate(0); }
  6% { transform: rotate(-12deg); } 12% { transform: rotate(10deg); }
  18% { transform: rotate(-6deg); } 24% { transform: rotate(0); }
}

/* ======================= 左侧栏 ======================= */
.hmi-sidebar {
  grid-area: sidebar; background: var(--bg); padding: 14px 7px 10px;
  display: flex; flex-direction: column; gap: 9px; z-index: 20;
}
.nav-item {
  height: 62px; border-radius: 10px; background: #fff; box-shadow: 0 1px 2px rgba(20, 22, 26, .05);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s, transform .1s;
  border: 1px solid transparent;
}
.nav-item:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.nav-item svg { width: 25px; height: 25px; }
.nav-item span { font-size: 12.5px; font-weight: 600; letter-spacing: 0.5px; }
.nav-item.active { background: var(--dark); color: #fff; box-shadow: var(--shadow-2); }
.hmi-sidebar .spacer { flex: 1; }
.sidebar-badge {
  display: flex; align-items: center; justify-content: center; gap: 4px; color: var(--muted);
  font-size: 10.5px; letter-spacing: 0.4px; padding-bottom: 4px;
}
.sidebar-mascot {
  width: 100%; height: 70px; border-radius: 12px; background: #fff; display: flex;
  align-items: center; justify-content: center; color: var(--brand); box-shadow: 0 1px 2px rgba(20,22,26,.05);
}

/* ======================= 内容区 ======================= */
.hmi-content {
  grid-area: content; min-width: 0; min-height: 0; padding: 12px 24px 12px 24px;
  display: flex; flex-direction: column; overflow: hidden;
}
.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.screen-head { flex: 0 0 auto; height: 48px; display: flex; align-items: center; justify-content: center; position: relative; }
.screen-title { font-size: 27px; font-weight: 800; letter-spacing: 4px; color: var(--ink); }
.screen-sub {
  position: absolute; right: 2px; bottom: 12px; font-size: 12.5px; color: var(--muted);
  display: flex; align-items: center; gap: 12px;
}
.screen-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; padding-top: 6px; }

.grid { display: grid; gap: 14px; min-height: 0; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row-fill { flex: 1; min-height: 0; }

.panel { background: #fff; border-radius: 14px; box-shadow: var(--shadow-1); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px 9px; flex: 0 0 auto; }
.panel-title { font-size: 15.5px; font-weight: 700; letter-spacing: 0.5px; display: flex; align-items: center; gap: 8px; }
.panel-title .bar { width: 4px; height: 15px; border-radius: 2px; background: var(--dark); display: inline-block; }
.panel-title .sub { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: 0.2px; }
.panel-tools { display: flex; align-items: center; gap: 8px; }
.panel-body { padding: 4px 18px 16px; flex: 1; min-height: 0; overflow: auto; }
.panel-body.flush { padding: 0; }

/* 页面底部控制条（模式条，如通风级别页） */
.ctrl-strip {
  flex: 0 0 auto; height: 74px; border-radius: 14px; background: var(--dark); color: #fff;
  display: flex; align-items: center; gap: 22px; padding: 0 26px; box-shadow: var(--shadow-1);
}
.ctrl-strip .grp { display: flex; align-items: center; gap: 12px; }
.ctrl-strip .mode-btn {
  min-width: 106px; height: 46px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .22);
  background: transparent; color: #d8dce2; font-size: 15px; font-weight: 700; letter-spacing: 1px;
  display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
}
.ctrl-strip .mode-btn:hover { background: rgba(255, 255, 255, .1); }
.ctrl-strip .mode-btn.on { background: #fff; color: var(--ink); border-color: #fff; }
.ctrl-strip .mode-btn.on.red { background: var(--red); color: #fff; border-color: var(--red); }
.ctrl-strip .mode-btn .mk { width: 9px; height: 9px; border-radius: 50%; background: currentColor; opacity: .8; }
.ctrl-strip .lbl { font-size: 13px; color: #aeb4bc; letter-spacing: 0.5px; }
.ctrl-strip .val-chip {
  height: 46px; min-width: 96px; padding: 0 16px; border-radius: 9px; background: rgba(255, 255, 255, .1);
  display: flex; align-items: center; justify-content: center; gap: 4px; font-family: var(--font-num);
  font-size: 22px; font-weight: 700; cursor: pointer; border: 1px solid rgba(255,255,255,.12);
}
.ctrl-strip .val-chip u { text-decoration: none; font-size: 13px; color: #aeb4bc; font-family: var(--font-sans); }
.ctrl-strip .val-chip:hover { background: rgba(255, 255, 255, .18); }
.ctrl-strip .spacer { flex: 1; }
.ctrl-strip .pager { display: flex; align-items: center; gap: 8px; font-family: var(--font-num); font-size: 16px; }
.ctrl-strip .pager button { width: 38px; height: 38px; border-radius: 8px; border: 1px solid rgba(255,255,255,.22); background: transparent; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ctrl-strip .pager button:hover { background: rgba(255,255,255,.12); }
.ctrl-strip .round-btn {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .4);
  background: transparent; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.ctrl-strip .round-btn:hover { background: rgba(255, 255, 255, .14); }

/* ======================= 底部工具栏 ======================= */
.hmi-bottombar {
  grid-area: bottombar; background: var(--dark); display: flex; align-items: center;
  padding: 0 30px; gap: 20px; z-index: 25;
}
.bottombar-group { display: flex; align-items: center; gap: 16px; }
.bb-icon {
  width: 60px; height: 60px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  color: #b9bec7; cursor: pointer; background: transparent; border: 1px solid transparent;
}
.bb-icon:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.bb-icon.active { color: #fff; background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .12); }
.bb-icon svg { width: 30px; height: 30px; }
.hmi-bottombar .spacer { flex: 1; }
.bottombar-status {
  display: flex; align-items: center; gap: 22px; color: #9ca3ad; font-size: 13px;
  font-family: var(--font-num); letter-spacing: 0.5px; margin-right: 8px;
}
.bottombar-status b { color: #e8eaee; font-weight: 600; }
.bb-round {
  width: 66px; height: 66px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .45);
  background: transparent; color: #fff; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.bb-round:hover { background: rgba(255, 255, 255, .1); }
.bb-round svg { width: 32px; height: 32px; }
.bb-round.running { border-color: #43d17c; color: #43d17c; }
.bb-round.muted { border-color: #6b7078; color: #6b7078; }

/* ======================= 通用数据展示件 ======================= */
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 8px; }
.metric { padding: 10px 12px; border-radius: 10px; background: var(--panel-3); min-width: 0; }
.metric .k { font-size: 11.5px; color: var(--ink-3); font-weight: 600; letter-spacing: 0.3px; white-space: nowrap; }
.metric .v { margin-top: 3px; font-family: var(--font-num); font-size: 25px; font-weight: 700; line-height: 1.1; color: var(--ink); white-space: nowrap; }
.metric .v u { text-decoration: none; font-size: 13px; font-weight: 600; color: var(--ink-3); margin-left: 2px; font-family: var(--font-sans); }
.metric .v.blue { color: var(--blue-deep); }
.metric .v.red { color: var(--red); }
.metric .v.green { color: var(--green); }
.metric .s { margin-top: 2px; font-size: 11px; color: var(--muted); }
.metric.plain { background: transparent; padding: 4px 0; }

.big-metric { display: flex; align-items: baseline; gap: 6px; }
.big-metric .v { font-family: var(--font-num); font-size: 40px; font-weight: 800; line-height: 1; }
.big-metric .u { font-size: 14px; color: var(--muted); }

.kv-list { display: flex; flex-direction: column; }
.kv-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv-row:last-child { border-bottom: 0; }
.kv-row .k { color: var(--ink-3); font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.kv-row .v { font-family: var(--font-num); font-size: 17px; font-weight: 700; color: var(--ink); }
.kv-row .v u { font-size: 12px; color: var(--muted); text-decoration: none; font-family: var(--font-sans); margin-left: 2px; }
.kv-row .v.blue { color: var(--blue-deep); }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 6px;
  font-size: 12.5px; font-weight: 700; background: var(--green-soft); color: var(--green);
}
.status-pill.off { background: #eef0f2; color: var(--muted); }
.status-pill.warn { background: var(--amber-soft); color: #a86a00; }
.status-pill.red { background: var(--red-soft); color: var(--red-deep); }

.actuator-list { display: flex; flex-direction: column; gap: 8px; }
.actuator-row {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  background: var(--panel-3); cursor: pointer; transition: background .12s;
}
.actuator-row:hover { background: #eef0f2; }
.actuator-row .ic { width: 34px; height: 34px; border-radius: 8px; background: #fff; display: flex; align-items: center; justify-content: center; color: var(--ink-2); flex: 0 0 auto; }
.actuator-row .nm { flex: 1; min-width: 0; }
.actuator-row .nm b { display: block; font-size: 14px; font-weight: 600; }
.actuator-row .nm span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.actuator-row .st { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.actuator-row .st b { font-family: var(--font-num); font-size: 15px; color: var(--ink); }
.actuator-row.on { background: var(--blue-soft); }
.actuator-row.on .ic { color: var(--blue); }
.actuator-row.warm { background: var(--red-soft); }
.actuator-row.warm .ic { color: var(--red); }

.empty-mini { padding: 24px 8px; text-align: center; color: var(--muted); font-size: 13px; }

/* 编辑提示 / 单元格 */
.cell-edit { cursor: pointer; }
.cell-edit:hover { background: var(--blue-soft) !important; }
.cell-input {
  width: 74px; height: 30px; text-align: center; border: 1px solid var(--line-strong); border-radius: 6px;
  font-family: var(--font-num); font-size: 15px; font-weight: 600; color: var(--blue-deep); outline: none;
}
.cell-input:focus { border-color: var(--blue); }
input[type="time"].input, input[type="date"].input { font-family: var(--font-num); }

/* 通用按钮组 */
.btn-row { display: flex; align-items: center; gap: 10px; }
.btn-row.right { justify-content: flex-end; }

/* 状态卡列表（报警等） */
.event-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 8px; border-bottom: 1px solid var(--line);
}
.event-row:last-child { border-bottom: 0; }
.event-row .time { font-family: var(--font-num); font-size: 13px; color: var(--muted); width: 96px; flex: 0 0 auto; }
.event-row .txt { flex: 1; min-width: 0; font-size: 14px; color: var(--ink-2); }
.event-row .txt b { font-weight: 700; color: var(--ink); }

/* 表格内风机圆点 */
.fan-dot {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 50%; font-family: var(--font-num); font-size: 14px; font-weight: 700;
  background: #eef0f2; color: var(--muted); cursor: pointer;
}
.fan-dot.on { background: var(--red); color: #fff; box-shadow: 0 3px 8px rgba(229, 72, 77, .3); }
.fan-dot.mid { background: var(--amber); color: #fff; }
.fan-dot.off { background: #eef0f2; color: var(--ink-3); }

/* 报警弹窗专用 */
.alarm-pop { display: flex; gap: 18px; align-items: flex-start; }
.alarm-pop .ic-big {
  width: 64px; height: 64px; border-radius: 16px; background: var(--red-soft); color: var(--red);
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.alarm-pop .tt { font-size: 20px; font-weight: 800; letter-spacing: 0.5px; }
.alarm-pop .mm { margin-top: 8px; font-size: 15px; color: var(--ink-3); line-height: 1.7; }
.alarm-pop .mm b { font-family: var(--font-num); font-size: 22px; color: var(--red); }
.alarm-pop .meta { margin-top: 10px; font-size: 12.5px; color: var(--muted); }

/* 屏幕正在开发占位 */
.dev-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 14px; color: var(--muted); }
.dev-placeholder .big { font-size: 54px; opacity: .35; }
.dev-placeholder b { font-size: 18px; color: var(--ink-3); }

/* 页面无数据 / 加载 */
.page-loading { display: flex; align-items: center; justify-content: center; height: 100%; gap: 12px; color: var(--muted); }

/* 表格滚动条细 */
.panel-body::-webkit-scrollbar { width: 6px; }
.panel-body::-webkit-scrollbar-thumb { background: #d5d8dd; }

/* 电量/信号小条 */
.signal-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.signal-bars i { width: 3px; background: #cfd3d9; border-radius: 1px; display: block; }
.signal-bars i.on { background: var(--green); }

/* ======================= 首页 ======================= */
.home-grid {
  display: grid; grid-template-columns: 310px minmax(0, 1fr) 314px; gap: 14px;
  flex: 1; min-height: 0;
}
.home-left, .home-right { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.home-left .panel:first-child { flex: 0 0 auto; }
.home-left .home-mode { flex: 1; min-height: 0; }
.home-right .panel:first-child { flex: 1.4; min-height: 0; }
.home-right .home-alarms { flex: 1; min-height: 0; }
.home-metrics .metric { padding: 9px 11px; }
.home-metrics .metric .v { font-size: 23px; }
.home-metrics .metric .s { font-size: 10.5px; }

.home-house { display: flex; flex-direction: column; min-height: 0; }
.house-wrap {
  position: relative; flex: 1; min-height: 0; margin: 0 10px;
  border-radius: 14px;
  background: radial-gradient(85% 70% at 50% 36%, #ffffff 0%, #f2f5f8 58%, #e7ecf1 100%);
  overflow: hidden; border: 1px solid #eef1f4;
}
.house-svg { position: absolute; inset: 0; }
.house-tags { position: absolute; inset: 0; pointer-events: none; }
.house-hint {
  position: absolute; left: 14px; bottom: 12px; z-index: 2;
  font-size: 11.5px; color: var(--muted); background: rgba(255, 255, 255, .82);
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; pointer-events: none;
  letter-spacing: .3px;
}
.house-tools { gap: 8px; }
.house-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px;
  border-radius: 7px; border: 1px solid var(--line-strong); background: #fff;
  color: var(--ink-3); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.house-btn:hover { border-color: var(--ink-3); color: var(--ink); }
.house-btn.active { background: var(--dark); border-color: var(--dark); color: #fff; }
.house-tag {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 7px;
  background: rgba(255, 255, 255, .95); border: 1px solid #e3e7ec;
  box-shadow: 0 4px 14px rgba(20, 28, 38, .1);
  border-radius: 999px; padding: 6px 12px 6px 9px;
  font-size: 11.5px; color: #3c4046; pointer-events: auto; cursor: pointer;
  white-space: nowrap; transition: box-shadow .12s;
}
.house-tag.tl { transform: translate(0, -50%); }
.house-tag.tr { transform: translate(-100%, -50%); }
.house-tag:hover { box-shadow: 0 6px 18px rgba(20, 28, 38, .16); z-index: 3; }
.house-tag b { font-family: var(--font-num); font-size: 13.5px; font-weight: 700; color: #16181b; }
.house-tag span { color: #8d929b; font-size: 10.5px; }
.house-tag svg { color: #5b6470; }
.house-tag.on { border-color: #f2b5b7; background: #fff4f4; }
.house-tag.on svg, .house-tag.on b { color: #c62f35; }
.house-tag.on-blue { border-color: #b3c9f7; background: #f2f6ff; }
.house-tag.on-blue svg, .house-tag.on-blue b { color: #1f5eff; }
.house-tag.on-warm { border-color: #f3d3a4; background: #fff8ec; }
.house-tag.on-warm svg, .house-tag.on-warm b { color: #b26b00; }

.house-foot {
  flex: 0 0 auto; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px;
  padding: 12px 16px 14px; margin-top: 8px; border-top: 1px solid var(--line);
}
.hf-item { display: flex; align-items: baseline; gap: 5px; justify-content: center; }
.hf-item span { font-size: 11px; color: var(--muted); }
.hf-item b { font-family: var(--font-num); font-size: 19px; font-weight: 700; color: var(--ink); }
.hf-item u { text-decoration: none; font-size: 10.5px; color: var(--muted); }

/* 运行模式卡 */
.home-mode .panel-body { padding-top: 0; }
.mode-level {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--panel-3); border-radius: 12px; padding: 12px 14px;
}
.ml-left .k { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.ml-val { display: flex; align-items: baseline; gap: 4px; margin-top: 2px; }
.ml-val b { font-family: var(--font-num); font-size: 40px; font-weight: 800; line-height: 1; color: var(--blue-deep); }
.ml-val span { font-size: 13px; color: var(--muted); }
.ml-btns { display: flex; gap: 8px; align-items: center; }
.ml-btns .btn { height: 38px; min-width: 42px; padding: 0 10px; font-size: 18px; }
.ml-btns .btn.btn-sm { font-size: 13px; }
.target-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px;
}
.target-row .k { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.target-row .tv { font-family: var(--font-num); font-size: 24px; font-weight: 700; color: var(--ink); margin-top: 1px; }
.target-row .tv u { text-decoration: none; font-size: 12px; color: var(--muted); margin-left: 2px; font-family: var(--font-sans); }
.mode-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mode-btn {
  height: 48px; border-radius: 10px; border: 1px solid var(--line-strong); background: #fff;
  color: var(--ink-2); font-size: 14.5px; font-weight: 700; cursor: pointer; letter-spacing: 0.5px;
}
.mode-btn:hover { border-color: var(--dark); }
.mode-btn.on { background: var(--dark); border-color: var(--dark); color: #fff; }
.mode-btn.auto { grid-column: span 3; }
.mode-btn.auto.on { background: var(--blue); border-color: var(--blue); }

.alarm-mini {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 6px;
  border-bottom: 1px solid var(--line); cursor: pointer;
}
.alarm-mini:last-child { border-bottom: 0; }
.alarm-mini:hover { background: #fafbfc; }
.alarm-mini .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: 0 0 auto; }
.alarm-mini .dot.red { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.alarm-mini .dot.amber { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.am-txt b { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.am-txt span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }

/* ======================= 主菜单 ======================= */
.menu-body {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
  padding: 16px 26px 20px; align-content: center; flex: 1; min-height: 0;
}
.menu-group-title {
  display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700;
  color: var(--ink-2); margin-bottom: 12px; letter-spacing: 0.5px;
}
.menu-group-title .bar { width: 4px; height: 16px; border-radius: 2px; background: var(--dark); }
.menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.menu-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  height: 186px; border-radius: 16px; border: 1px solid var(--line); background: #fff;
  cursor: pointer; transition: transform .14s, box-shadow .14s, border-color .14s;
}
.menu-item:hover { transform: translateY(-3px); border-color: #c9ced6; box-shadow: 0 10px 26px rgba(20, 28, 38, .1); }
.menu-item:active { transform: scale(.98); }
.mi-icon {
  width: 66px; height: 66px; border-radius: 18px; background: var(--panel-3);
  display: flex; align-items: center; justify-content: center; color: var(--ink); margin-bottom: 6px;
}
.mi-label { font-size: 16px; font-weight: 700; letter-spacing: 0.4px; }
.mi-desc { font-size: 11.5px; color: var(--muted); }

/* 缩放适配容器 */
#viewport { width: 100vw; height: 100vh; display: flex; align-items: center; justify-content: center; overflow: hidden; }
