/* ============================================================
   大聚 X9 · 远程控制台样式（remote-core 维护）
   依赖 shared/css/tokens.css + base.css
   布局：桌面（>820px）左侧深色导航 + 深色顶栏 + 浅色内容
         移动（≤820px）深色顶栏 + 底部 Tab + 抽屉菜单
   ============================================================ */

:root {
  --rp-side-w: 232px;
  --rp-top-h: 60px;
  --rp-tab-h: 58px;
  --rp-gap: 16px;
  --rp-dark: #16181b;
  --rp-dark-2: #1d1f23;
  --rp-dark-3: #26282d;
  --rp-content-pad: 24px;
  --rp-max: 1560px;
}

html, body { height: 100%; }
body {
  background: var(--bg);
  overflow-x: hidden;
  overscroll-behavior-y: none;
}
body.shell-mode { overflow: hidden; }
body.login-mode { overflow-y: auto; }
#app { height: 100%; }
[hidden] { display: none !important; }

* { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }

/* ============================================================
   启动 / 错误兜底
   ============================================================ */
.boot-splash {
  height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; background:
    radial-gradient(760px 480px at 50% -10%, #e7edff 0%, transparent 60%),
    var(--bg);
}
.boot-logo { width: 62px; height: 62px; animation: bootpulse 1.6s ease-in-out infinite; }
@keyframes bootpulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.94); opacity: .7; } }
.boot-name { font-size: 19px; font-weight: 800; letter-spacing: 1px; color: var(--ink); }
.boot-sub { font-size: 13px; color: var(--muted); }
.boot-bar { width: 168px; height: 4px; border-radius: 2px; background: #e2e5ea; overflow: hidden; margin-top: 8px; }
.boot-bar i { display: block; width: 40%; height: 100%; border-radius: 2px; background: var(--blue); animation: bootbar 1.2s ease-in-out infinite; }
@keyframes bootbar { 0% { transform: translateX(-110%); } 100% { transform: translateX(280%); } }
.boot-noscript { padding: 40px; text-align: center; color: var(--ink-2); }

.boot-error {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 36px 22px; text-align: center;
}
.boot-error-ic {
  width: 82px; height: 82px; border-radius: 22px; background: var(--red-soft); color: var(--red);
  display: flex; align-items: center; justify-content: center;
}
.boot-error h1 { font-size: 22px; font-weight: 800; }
.boot-error p { font-size: 15px; color: var(--ink-2); max-width: 560px; line-height: 1.7; }
.boot-error-hint { font-size: 13px; color: var(--muted); max-width: 560px; line-height: 1.9; }
.boot-error-hint code { background: var(--panel-3); padding: 2px 7px; border-radius: 5px; font-family: var(--font-num); }
.boot-error-actions { margin-top: 6px; }
.boot-error-foot { margin-top: 26px; font-size: 12px; color: #b3b7be; letter-spacing: .5px; }

.route-loading { min-height: 320px; display: flex; align-items: center; justify-content: center; }
.route-fallback {
  min-height: 400px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center; padding: 40px 20px;
}
.route-fallback-ic {
  width: 76px; height: 76px; border-radius: 20px; background: var(--panel-3); color: var(--ink-3);
  display: flex; align-items: center; justify-content: center;
}
.route-fallback-ic.err { background: var(--red-soft); color: var(--red); }
.route-fallback h2 { font-size: 19px; font-weight: 800; }
.route-fallback p { font-size: 14px; color: var(--muted); max-width: 520px; line-height: 1.7; }
.route-fallback code { background: var(--panel-3); padding: 2px 7px; border-radius: 5px; }
.route-fallback-actions { display: flex; gap: 10px; margin-top: 8px; }

/* ============================================================
   外壳骨架
   ============================================================ */
.shell { display: flex; height: 100dvh; overflow: hidden; width: 100%; }

/* ---------- 桌面左侧导航 ---------- */
.sidenav {
  width: var(--rp-side-w); flex: 0 0 var(--rp-side-w);
  background: linear-gradient(180deg, #1c1e22 0%, #141518 100%);
  color: #d7dae0; display: flex; flex-direction: column;
  padding: 0 12px 10px; position: relative; z-index: 30;
}
.sn-brand { display: flex; align-items: center; gap: 10px; padding: 16px 6px 14px; }
.sn-logo { width: 34px; height: 34px; }
.sn-brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.sn-brand-text b { font-size: 16.5px; font-weight: 800; color: #fff; letter-spacing: .6px; }
.sn-brand-text span { font-size: 10.5px; color: #8d929b; letter-spacing: 1.4px; }

.sn-device {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 10px; margin-bottom: 12px; border-radius: 10px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .09);
  color: #fff; cursor: pointer; text-align: left; transition: background .15s;
}
.sn-device:hover { background: rgba(255, 255, 255, .11); }
.sn-dev-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sn-dev-text b { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sn-dev-text span { font-size: 10.5px; color: #8d929b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sn-device .ic { color: #8d929b; flex: 0 0 auto; }

.sn-nav { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; margin: 0 -4px; padding: 0 4px; }
.sn-nav::-webkit-scrollbar { width: 5px; }
.sn-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); }
.sn-group { padding: 5px 0; }
.sn-label { font-size: 10.5px; color: #63676e; letter-spacing: 1.6px; padding: 4px 10px 5px; font-weight: 700; }
.sn-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  height: 39px; padding: 0 11px; border: 0; border-radius: 9px;
  background: transparent; color: #b9bdc4; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: background .14s, color .14s; text-align: left;
}
.sn-item .ic { color: #8b9099; flex: 0 0 auto; transition: color .14s; }
.sn-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sn-item:hover .ic { color: #dfe2e6; }
.sn-item.active { background: var(--blue); color: #fff; box-shadow: 0 6px 16px rgba(31, 94, 255, .32); }
.sn-item.active .ic { color: #fff; }
.sn-item.disabled { opacity: .34; cursor: not-allowed; }
.sn-item.disabled:hover { background: transparent; color: #b9bdc4; }

.sn-foot { flex: 0 0 auto; margin-top: 8px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .07); }
.sn-conn { display: flex; align-items: center; gap: 7px; padding: 5px 8px 9px; font-size: 11.5px; color: #9aa0a8; }
.sn-user {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px;
  border: 0; border-radius: 10px; background: rgba(255, 255, 255, .05); color: #fff;
  cursor: pointer; text-align: left; transition: background .15s;
}
.sn-user:hover { background: rgba(255, 255, 255, .1); }
.sn-user-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sn-user-text b { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sn-user-text span { font-size: 10.5px; color: #8d929b; }
.sn-user .ic { color: #7c8189; }
.sn-logout {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 34px;
  margin-top: 6px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: #9aa0a8; font-size: 12px; font-weight: 600; cursor: pointer;
}
.sn-logout:hover { background: rgba(229, 72, 77, .16); color: #ff9a9d; }
.sn-ver { margin-top: 8px; padding: 0 4px; font-size: 10px; color: #4f545c; letter-spacing: .3px; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--blue), #6b8cff); color: #fff;
  font-size: 12.5px; font-weight: 700; letter-spacing: .5px;
  font-family: var(--font-sans);
}

/* ---------- 右侧主区 ---------- */
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; height: 100%; }

/* ---------- 顶栏 ---------- */
.topbar {
  height: var(--rp-top-h); flex: 0 0 var(--rp-top-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 18px; background: var(--rp-dark); color: #fff;
  position: relative; z-index: 20; box-shadow: 0 1px 0 rgba(0, 0, 0, .25);
}
.tb-menu, .tb-brand-m, .tb-back { display: none; }
.tb-back {
  align-items: center; justify-content: center; width: 34px; height: 34px; border: 0;
  border-radius: 9px; background: rgba(255, 255, 255, .07); color: #dfe2e6; cursor: pointer; flex: 0 0 auto;
}
.tb-device {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 11px;
  border-radius: 9px; background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .1); cursor: pointer; transition: background .15s;
  flex: 0 0 auto; max-width: 260px;
}
.tb-device:hover { background: rgba(255, 255, 255, .14); }
.tb-dev-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-dev-extra { font-size: 11px; color: #8d929b; font-family: var(--font-num); white-space: nowrap; }
.tb-device .ic { color: #9aa0a8; flex: 0 0 auto; }
.tb-title { font-size: 14.5px; font-weight: 700; color: #fff; letter-spacing: .6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-spacer { flex: 1 1 auto; min-width: 8px; }
.tb-chip {
  display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px;
  border-radius: 8px; background: rgba(255, 255, 255, .06); color: #c7cad1;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; flex: 0 0 auto;
}
.tb-chip .ic { color: #9aa0a8; }
.tb-weather-text { font-family: var(--font-num); }
.tb-net { gap: 9px; }
.tb-net-eth, .tb-net-sim { display: inline-flex; align-items: center; gap: 4px; color: #7fdca0; }
.tb-net i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; display: inline-block; }
.tb-net .off { color: #6b7078; opacity: .6; }
.tb-clock { font-family: var(--font-num); letter-spacing: .4px; }
.tb-bell {
  position: relative; width: 38px; height: 38px; border-radius: 9px; border: 0;
  background: rgba(255, 255, 255, .06); color: #c7cad1; display: inline-flex;
  align-items: center; justify-content: center; cursor: pointer; transition: background .15s, color .15s;
  flex: 0 0 auto;
}
.tb-bell:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.tb-bell.has-alarm { color: #ffb4b6; }
.tb-bell.critical { color: #fff; background: var(--red); animation: bellpulse 1.6s infinite; }
@keyframes bellpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .5); } 50% { box-shadow: 0 0 0 7px rgba(229, 72, 77, 0); } }
.tb-bell-badge {
  position: absolute; top: -2px; right: -3px; min-width: 14px; height: 14px; padding: 0 3px;
  border-radius: 7px; background: var(--red); color: #fff; font-size: 9px; font-weight: 700;
  font-family: var(--font-num); display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--rp-dark); box-sizing: content-box;
}
.tb-user {
  display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 8px;
  border: 0; border-radius: 9px; background: transparent; color: #fff; cursor: pointer;
  transition: background .15s; flex: 0 0 auto;
}
.tb-user:hover { background: rgba(255, 255, 255, .1); }
.tb-avatar { width: 30px; height: 30px; font-size: 11.5px; }
.tb-user-text { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.tb-user-text b { font-size: 12.5px; font-weight: 700; }
.tb-user-text span { font-size: 10.5px; color: #8d929b; }

/* ---------- 连接提示条 ---------- */
.conn-banner {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 18px; font-size: 13px; font-weight: 600;
  border-bottom: 1px solid transparent; flex: 0 0 auto;
}
.conn-banner[hidden] { display: none !important; }
.conn-banner.red { background: var(--red-soft); color: var(--red-deep); border-color: #f7c9cb; }
.conn-banner.amber { background: var(--amber-soft); color: #8a5a00; border-color: #f3ddb3; }
.conn-banner.green { background: var(--green-soft); color: var(--green); border-color: #bfe6cd; }
.conn-banner-icon { display: inline-flex; flex: 0 0 auto; }
.conn-banner-text { flex: 1 1 auto; min-width: 0; }
.conn-banner-retry {
  border: 1px solid currentColor; background: transparent; color: inherit;
  height: 28px; padding: 0 12px; border-radius: 7px; font-size: 12px; font-weight: 700;
  cursor: pointer; flex: 0 0 auto;
}
.conn-banner-retry[hidden] { display: none !important; }

/* ---------- 内容区 ---------- */
.content { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; position: relative; }
.view { padding: var(--rp-content-pad); max-width: var(--rp-max); margin: 0 auto; width: 100%; min-height: 100%; }
.route-loading { min-height: 300px; }

/* ---------- 移动端底部 Tab ---------- */
.tabbar { display: none; }

/* ---------- 移动端抽屉 ---------- */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(10, 11, 14, .48);
  opacity: 0; transition: opacity .2s; z-index: 55; backdrop-filter: blur(1px);
}
.drawer-mask.show { opacity: 1; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: min(86vw, 322px);
  background: linear-gradient(180deg, #1c1e22 0%, #141518 100%); color: #d7dae0;
  z-index: 60; transform: translateX(-102%); transition: transform .24s cubic-bezier(.3, .8, .3, 1);
  display: flex; flex-direction: column; padding: 0 12px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 12px 0 40px rgba(0, 0, 0, .4);
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 18px 4px 12px; }
.drawer-head img { width: 34px; height: 34px; }
.drawer-head-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.drawer-head-text b { font-size: 14.5px; font-weight: 800; color: #fff; }
.drawer-head-text span { font-size: 10px; color: #8d929b; letter-spacing: .4px; }
.drawer-user {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  background: rgba(255, 255, 255, .06); border-radius: 11px; margin-bottom: 10px;
}
.drawer-avatar { width: 38px; height: 38px; font-size: 13px; }
.drawer-user-text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.drawer-user-text b { font-size: 14px; font-weight: 700; color: #fff; }
.drawer-user-text span { font-size: 11px; color: #8d929b; }
.drawer-conn { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: #9aa0a8; }
.drawer-nav { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; }
.drawer-foot { flex: 0 0 auto; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .07); }
.drawer-logout { width: 100%; }
.drawer-ver { margin-top: 9px; text-align: center; font-size: 10px; color: #4f545c; }
@media (min-width: 821px) {
  .drawer, .drawer-mask { display: none !important; }
}

/* ============================================================
   通用页面框架 / 组件（ui.js 的视觉实现）
   ============================================================ */
.rp-page { display: flex; flex-direction: column; gap: 16px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head-main { min-width: 0; }
.page-title { font-size: 22px; font-weight: 800; letter-spacing: .4px; color: var(--ink); line-height: 1.2; }
.page-sub { margin-top: 5px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.page-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; flex: 0 0 auto; }
.page-body { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.confirm-msg { font-size: 15px; line-height: 1.75; color: var(--ink-2); }
.confirm-msg b { color: var(--ink); font-family: var(--font-num); font-size: 17px; }
.confirm-tip { margin-top: 14px; }
.modal-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.loading {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 44px 20px; color: var(--muted); font-size: 13.5px;
}
.empty .big { display: flex; justify-content: center; }
.empty-text { font-size: 14.5px; color: var(--ink-3); font-weight: 600; }
.empty-hint { margin-top: 6px; font-size: 12.5px; color: var(--muted); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 4px 2px; flex-wrap: wrap; }
.pager-info { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.pager-info b { color: var(--ink-2); }
.pager-btns { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pager-num, .pager-nav {
  min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  font-family: var(--font-num); font-size: 13.5px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .14s, border-color .14s, color .14s;
}
.pager-num:hover, .pager-nav:hover:not(:disabled) { background: var(--panel-3); border-color: var(--line-strong); }
.pager-num.on { background: var(--dark); border-color: var(--dark); color: #fff; }
.pager-nav:disabled { opacity: .35; cursor: not-allowed; }
.pager-gap { padding: 0 3px; color: var(--muted); font-size: 13px; }

.keypad-wrap { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.keypad-display {
  height: 60px; border-radius: 10px; background: var(--panel-3); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: flex-end; padding: 0 16px; width: 100%;
  font-family: var(--font-num); font-size: 30px; font-weight: 700; color: var(--ink);
}
.keypad-display .unit { font-size: 15px; color: var(--muted); margin-left: 6px; }
.keypad-hint { width: 100%; }
.kp-quick { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.keypad { width: 100%; }
.keypad button.ok { grid-column: span 1; }

/* 标签/状态点微调 */
.tag .ic { width: 12px; height: 12px; }
.hint code { background: rgba(0, 0, 0, .06); padding: 1px 6px; border-radius: 5px; }

/* ============================================================
   登录页
   ============================================================ */
.login-page {
  min-height: 100dvh; width: 100%;
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  background: var(--bg);
}
.login-hero {
  position: relative; overflow: hidden; color: #fff;
  padding: 48px 56px; display: flex; flex-direction: column;
  background:
    radial-gradient(900px 620px at 12% 0%, rgba(63, 122, 58, .55) 0%, transparent 55%),
    radial-gradient(760px 560px at 100% 100%, rgba(31, 94, 255, .38) 0%, transparent 58%),
    linear-gradient(155deg, #191b1f 0%, #101114 100%);
}
.login-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(700px 480px at 30% 30%, #000 0%, transparent 78%);
}
.login-brand { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.login-brand img { width: 46px; height: 46px; }
.login-brand-text { display: flex; flex-direction: column; }
.login-brand-text b { font-size: 16px; font-weight: 800; letter-spacing: .6px; }
.login-brand-text span { font-size: 9.5px; color: #9aa3ad; letter-spacing: 1.6px; margin-top: 2px; }
.login-hero-main { position: relative; z-index: 1; margin-top: auto; margin-bottom: auto; padding: 40px 0 24px; max-width: 560px; }
.login-hero-main h1 { font-size: 40px; line-height: 1.22; font-weight: 800; letter-spacing: 1px; }
.login-hero-main h1 em { font-style: normal; color: #8ed49a; }
.login-hero-main > p { margin-top: 16px; font-size: 14.5px; line-height: 1.85; color: #a9b2bc; max-width: 470px; }
.login-feats { margin-top: 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 500px; }
.login-feat {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-radius: 11px; background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .08); font-size: 13px; color: #cfd6dd;
}
.login-feat .ic { color: #8ed49a; flex: 0 0 auto; }
.login-hero-foot { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: #6f7780; }
.login-hero-foot .dot-line { flex: 1 1 auto; height: 1px; background: rgba(255, 255, 255, .09); }

.login-panel { display: flex; align-items: center; justify-content: center; padding: 36px 28px; background: #fff; }
.login-card { width: 100%; max-width: 372px; }
.login-card h2 { font-size: 23px; font-weight: 800; letter-spacing: .5px; }
.login-card .login-sub { margin-top: 7px; font-size: 13px; color: var(--muted); }
.login-notice {
  margin-top: 16px; display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 13px; border-radius: 9px; background: var(--amber-soft); color: #8a5a00;
  font-size: 12.5px; line-height: 1.6;
}
.login-form { margin-top: 24px; display: flex; flex-direction: column; gap: 15px; }
.login-field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-3); margin-bottom: 7px; letter-spacing: .3px; }
.login-input-wrap {
  display: flex; align-items: center; gap: 9px; height: 46px; padding: 0 13px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.login-input-wrap:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31, 94, 255, .12); }
.login-input-wrap .ic { color: var(--muted); flex: 0 0 auto; }
.login-input-wrap input {
  border: 0; outline: none; background: transparent; flex: 1 1 auto; min-width: 0;
  font-size: 15px; color: var(--ink); font-family: inherit; height: 100%;
}
.login-input-wrap input::placeholder { color: #b3b7be; }
.login-eye { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 4px; display: inline-flex; }
.login-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: -2px; }
.login-remember { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; user-select: none; }
.login-remember input { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }
.login-error {
  display: none; align-items: center; gap: 7px; padding: 10px 12px; border-radius: 9px;
  background: var(--red-soft); color: var(--red-deep); font-size: 12.5px; font-weight: 600;
}
.login-error.show { display: flex; animation: shake .32s; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.login-submit { width: 100%; height: 47px; font-size: 15px; border-radius: 10px; }
.login-submit .spinner { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
.login-demo { margin-top: 26px; padding-top: 20px; border-top: 1px dashed var(--line); }
.login-demo-title { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: 1.2px; margin-bottom: 10px; }
.login-demo-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.login-demo-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel-2); cursor: pointer; transition: border-color .14s, background .14s; text-align: left;
}
.login-demo-item:hover { border-color: var(--blue); background: var(--blue-soft); }
.login-demo-item b { font-size: 13px; font-weight: 700; color: var(--ink); }
.login-demo-item span { font-size: 11px; color: var(--muted); font-family: var(--font-num); }
.login-service { margin-top: 22px; display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.login-service .led { width: 7px; height: 7px; }
.login-service b { color: var(--ink-3); font-weight: 600; }
.login-access {
  margin-top: 10px; padding: 9px 11px; border-radius: 9px; background: var(--panel-3);
  font-size: 11px; color: var(--ink-3); line-height: 1.9; word-break: break-all;
}
.login-access code {
  font-family: var(--font-num); font-size: 11px; color: var(--blue-deep);
  background: #fff; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line);
}
.login-access-lan { display: block; color: var(--muted); }
.login-foot { margin-top: 18px; font-size: 10.5px; color: #b3b7be; line-height: 1.7; }

/* ============================================================
   总览页
   ============================================================ */
.ov-hero {
  display: grid; grid-template-columns: 286px minmax(0, 1fr) 236px; gap: 14px;
}
.ov-weather {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 18px 20px; border-radius: var(--radius-lg); color: #fff;
  background: linear-gradient(150deg, #1d2025 0%, #2b3138 100%);
  box-shadow: var(--shadow-1); position: relative; overflow: hidden;
}
.ov-weather::after {
  content: ""; position: absolute; right: -34px; top: -34px; width: 130px; height: 130px;
  border-radius: 50%; background: rgba(255, 255, 255, .06);
}
.ov-weather-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ov-weather-loc { font-size: 12px; color: #a9b2bc; letter-spacing: .4px; }
.ov-weather-date { font-size: 11px; color: #7f8892; font-family: var(--font-num); }
.ov-weather-main { display: flex; align-items: center; gap: 13px; margin: 10px 0 8px; }
.ov-weather-main .ic { color: #ffd479; }
.ov-weather-temp { font-family: var(--font-num); font-size: 42px; font-weight: 700; line-height: 1; letter-spacing: -1px; }
.ov-weather-temp u { text-decoration: none; font-size: 20px; font-weight: 600; color: #c7cad1; }
.ov-weather-desc { display: flex; flex-direction: column; gap: 2px; }
.ov-weather-desc b { font-size: 15px; font-weight: 700; }
.ov-weather-desc span { font-size: 11.5px; color: #a9b2bc; }
.ov-weather-foot { display: flex; align-items: center; gap: 14px; font-size: 11.5px; color: #8f98a2; flex-wrap: wrap; }
.ov-weather-foot b { color: #dfe4ea; font-family: var(--font-num); font-size: 12.5px; }

.ov-stats-card { padding: 16px 18px; border-radius: var(--radius-lg); background: var(--panel); box-shadow: var(--shadow-1); }
.ov-stats-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.ov-stats-title { font-size: 14.5px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.ov-stats-title .dot { width: 4px; height: 15px; border-radius: 2px; background: var(--dark); }
.ov-stats-sub { font-size: 11.5px; color: var(--muted); }
.ov-stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ov-stat {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px;
  border-radius: 11px; background: var(--panel-3); min-width: 0;
}
.ov-stat-ic {
  width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: #fff; color: var(--blue); box-shadow: 0 1px 3px rgba(16, 18, 22, .06);
}
.ov-stat-ic.green { color: var(--green); }
.ov-stat-ic.amber { color: var(--amber); }
.ov-stat-ic.red { color: var(--red); }
.ov-stat-body { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.ov-stat-k { font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.ov-stat-v { font-family: var(--font-num); font-size: 21px; font-weight: 700; line-height: 1.1; color: var(--ink); white-space: nowrap; }
.ov-stat-v u { text-decoration: none; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.ov-stat-v.blue { color: var(--blue-deep); }

.ov-quick-card { padding: 16px; border-radius: var(--radius-lg); background: var(--panel); box-shadow: var(--shadow-1); display: flex; flex-direction: column; }
.ov-quick-title { font-size: 14.5px; font-weight: 800; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ov-quick-title .dot { width: 4px; height: 15px; border-radius: 2px; background: var(--dark); }
.ov-quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; flex: 1 1 auto; }
.ov-quick {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 7px;
  padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; transition: border-color .14s, background .14s, transform .14s; text-align: left;
}
.ov-quick:hover { border-color: var(--blue); background: var(--blue-soft); transform: translateY(-1px); }
.ov-quick .ic { color: var(--blue); }
.ov-quick span { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.ov-quick small { font-size: 10px; color: var(--muted); }

/* 报警横幅 */
.ov-alarm-bar {
  display: flex; align-items: center; gap: 13px; padding: 13px 18px;
  border-radius: var(--radius-lg); color: #fff; cursor: pointer;
  background: linear-gradient(100deg, #c62f35 0%, #e5484d 62%, #ef6b60 100%);
  box-shadow: 0 8px 22px rgba(198, 47, 53, .26); transition: transform .15s, box-shadow .15s;
}
.ov-alarm-bar:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(198, 47, 53, .34); }
.ov-alarm-bar-ic {
  width: 38px; height: 38px; border-radius: 11px; background: rgba(255, 255, 255, .17);
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
  animation: bellpulse 1.8s infinite;
}
.ov-alarm-bar-main { flex: 1 1 auto; min-width: 0; }
.ov-alarm-bar-main b { font-size: 14.5px; font-weight: 800; }
.ov-alarm-bar-main p { margin-top: 3px; font-size: 12px; color: rgba(255, 255, 255, .82); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-alarm-bar-go { flex: 0 0 auto; font-size: 12.5px; font-weight: 700; display: flex; align-items: center; gap: 5px; }

/* 设备卡片 */
.ov-devices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dev-card {
  background: var(--panel); border-radius: var(--radius-lg); box-shadow: var(--shadow-1);
  overflow: hidden; display: flex; flex-direction: column; min-width: 0;
  border: 1px solid rgba(16, 18, 22, .04);
}
.dev-card-head { display: flex; align-items: center; gap: 11px; padding: 15px 17px 12px; }
.dev-card-ic {
  width: 40px; height: 40px; border-radius: 11px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--dark); color: #fff;
}
.dev-card-title { flex: 1 1 auto; min-width: 0; }
.dev-card-title b { display: flex; align-items: center; gap: 7px; font-size: 16px; font-weight: 800; }
.dev-card-title span { display: block; margin-top: 3px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev-card-alarm {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px;
  border-radius: 7px; background: var(--red-soft); color: var(--red-deep);
  font-size: 11.5px; font-weight: 700; flex: 0 0 auto; cursor: pointer;
  border: 0; font-family: inherit;
}
.dev-card-alarm.ok { background: var(--green-soft); color: var(--green); }
.dev-card-body { padding: 2px 17px 0; display: flex; gap: 16px; }
.dev-card-main { flex: 1 1 auto; min-width: 0; }
.dev-temp-row { display: flex; align-items: flex-end; gap: 14px; }
.dev-temp-main { display: flex; flex-direction: column; gap: 2px; }
.dev-temp-label { font-size: 11px; color: var(--muted); font-weight: 600; }
.dev-temp-value { font-family: var(--font-num); font-size: 40px; font-weight: 700; line-height: 1; letter-spacing: -1px; color: var(--blue-deep); display: flex; align-items: baseline; gap: 3px; }
.dev-temp-value u { text-decoration: none; font-size: 16px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.dev-temp-value.hot { color: var(--red); }
.dev-temp-side { display: flex; flex-direction: column; gap: 4px; padding-bottom: 4px; }
.dev-temp-target { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); }
.dev-temp-target b { font-family: var(--font-num); font-size: 13px; color: var(--ink-2); }
.dev-temp-delta { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-num); font-size: 12px; font-weight: 700; color: var(--green); }
.dev-temp-delta.warn { color: var(--amber); }
.dev-temp-delta.bad { color: var(--red); }
.dev-spark { flex: 0 0 138px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; padding-bottom: 2px; min-width: 0; }
.dev-spark-label { font-size: 10.5px; color: var(--muted); }
.dev-spark-box { width: 100%; height: 46px; }

.dev-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-top: 13px; background: var(--line); border-radius: 10px; overflow: hidden; }
.dev-metric { background: var(--panel-2); padding: 9px 11px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dev-metric i { font-style: normal; font-size: 10.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.dev-metric b { font-family: var(--font-num); font-size: 16px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.dev-metric b u { text-decoration: none; font-size: 10px; font-weight: 600; color: var(--muted); }
.dev-metric b.blue { color: var(--blue-deep); }
.dev-metric b.red { color: var(--red); }
.dev-metric b.green { color: var(--green); }

.dev-card-foot { display: flex; align-items: center; gap: 8px; padding: 13px 17px 15px; flex-wrap: wrap; }
.dev-card-foot .btn { flex: 0 0 auto; }
.dev-card-foot .btn-dev-detail { flex: 1 1 auto; }
.dev-card-extra { display: flex; align-items: center; gap: 10px; margin-left: auto; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.dev-card-extra .led { width: 7px; height: 7px; }
.dev-mode-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: 5px; background: var(--panel-3); color: var(--ink-3); font-size: 11px; font-weight: 700;
}
.dev-mode-chip.auto { background: var(--blue-soft); color: var(--blue-deep); }

.ov-section-title { display: flex; align-items: center; gap: 9px; margin-top: 2px; }
.ov-section-title h2 { font-size: 16px; font-weight: 800; letter-spacing: .3px; }
.ov-section-title .dot { width: 4px; height: 16px; border-radius: 2px; background: var(--dark); }
.ov-section-title .sub { font-size: 12px; color: var(--muted); margin-left: 2px; }

/* ============================================================
   响应式：桌面中屏
   ============================================================ */
@media (max-width: 1280px) {
  :root { --rp-side-w: 216px; --rp-content-pad: 20px; }
  .tb-clock { display: none; }
  .ov-hero { grid-template-columns: 260px minmax(0, 1fr) 214px; }
}
@media (max-width: 1120px) {
  .ov-hero { grid-template-columns: 250px minmax(0, 1fr); }
  .ov-quick-card { grid-column: 1 / -1; }
  .ov-quick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tb-user-text { display: none; }
  .tb-weather-text { display: none; }
}
@media (max-width: 980px) {
  .ov-devices { grid-template-columns: 1fr; }
  .ov-stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   响应式：移动端 ≤820px
   ============================================================ */
@media (max-width: 820px) {
  :root { --rp-content-pad: 14px; }
  .sidenav { display: none; }
  .shell { flex-direction: column; }
  .main { width: 100%; }

  .topbar {
    height: 54px; flex: 0 0 54px; gap: 9px; padding: 0 12px;
    padding-top: env(safe-area-inset-top);
    height: calc(54px + env(safe-area-inset-top));
    flex-basis: calc(54px + env(safe-area-inset-top));
  }
  .tb-menu {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border: 0; border-radius: 9px;
    background: rgba(255, 255, 255, .07); color: #dfe2e6; cursor: pointer; flex: 0 0 auto;
  }
  .tb-back:not([hidden]) {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border: 0; border-radius: 9px;
    background: rgba(255, 255, 255, .07); color: #dfe2e6; cursor: pointer; flex: 0 0 auto;
  }
  .tb-brand-m { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
  .tb-brand-m img { width: 24px; height: 24px; }
  .tb-brand-m b { font-size: 14px; font-weight: 800; letter-spacing: .4px; }
  .tb-device { display: none; }
  .tb-title { font-size: 14px; flex: 1 1 auto; min-width: 0; }
  .tb-weather, .tb-net, .tb-clock, .tb-user { display: none; }
  .tb-bell { width: 36px; height: 36px; }
  .tb-user-text { display: none; }

  .content { -webkit-overflow-scrolling: touch; }
  .view { padding: 14px 14px 20px; }

  .tabbar {
    display: flex; flex: 0 0 auto; height: calc(var(--rp-tab-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: #fff; border-top: 1px solid var(--line); z-index: 25;
    box-shadow: 0 -2px 14px rgba(16, 18, 22, .06);
  }
  .tab-item {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; border: 0; background: transparent; color: #8d929b; font-size: 10.5px; font-weight: 600;
    cursor: pointer; position: relative; padding: 5px 0 3px;
  }
  .tab-item .ic { width: 21px; height: 21px; }
  .tab-item.active { color: var(--blue); }
  .tab-item.active::before {
    content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 24px; height: 3px; border-radius: 0 0 3px 3px; background: var(--blue);
  }
  .tab-item.disabled { opacity: .4; }
  .tab-badge {
    position: absolute; top: 1px; left: 50%; margin-left: 4px; min-width: 15px; height: 15px;
    padding: 0 3px; border-radius: 8px; background: var(--red); color: #fff;
    font-size: 9.5px; font-weight: 700; font-family: var(--font-num);
    display: flex; align-items: center; justify-content: center; border: 1.5px solid #fff;
  }

  /* 页面框架 */
  .page-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .page-title { font-size: 19px; }
  .page-sub { font-size: 12px; }
  .page-tools { justify-content: flex-start; }
  .page-tools .seg { width: 100%; }
  .page-tools .seg button { flex: 1 1 auto; padding: 0 10px; }
  .rp-page { gap: 12px; }
  .page-body { gap: 12px; }

  /* 登录 */
  .login-page { grid-template-columns: 1fr; min-height: 100dvh; }
  .login-hero { padding: 22px 20px 26px; min-height: 0; }
  .login-brand img { width: 38px; height: 38px; }
  .login-brand-text b { font-size: 14px; }
  .login-hero-main { padding: 18px 0 4px; margin: 0; }
  .login-hero-main h1 { font-size: 25px; }
  .login-hero-main > p { margin-top: 10px; font-size: 13px; line-height: 1.7; }
  .login-feats { display: none; }
  .login-hero-foot { display: none; }
  .login-panel { padding: 24px 20px 34px; align-items: flex-start; }
  .login-card { max-width: 100%; }
  .login-card h2 { font-size: 20px; }
  .login-demo-list { grid-template-columns: 1fr 1fr; }

  /* 总览 */
  .ov-hero { grid-template-columns: 1fr; gap: 12px; }
  .ov-weather { min-height: 128px; }
  .ov-weather-temp { font-size: 38px; }
  .ov-stats-grid { grid-template-columns: 1fr 1fr; }
  .ov-quick-card { padding: 14px; }
  .ov-quick-grid { grid-template-columns: 1fr 1fr; }
  .ov-devices { grid-template-columns: 1fr; gap: 12px; }
  .dev-card-body { flex-direction: column; gap: 10px; }
  .dev-spark { flex: 1 1 auto; align-items: stretch; width: 100%; }
  .dev-spark-box { height: 42px; width: 100%; }
  .dev-metrics { grid-template-columns: 1fr 1fr; }
  .dev-card-foot { gap: 8px; }
  .dev-card-foot .btn-dev-detail { flex: 1 1 100%; }
  .ov-alarm-bar { padding: 12px 14px; }
  .ov-alarm-bar-main p { max-width: 100%; }
}

/* ============================================================
   总览页补充
   ============================================================ */
.ov-updated { font-size: 11.5px; color: var(--muted); font-family: var(--font-num); white-space: nowrap; }
.ov-devices-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; flex-wrap: wrap; }
.ov-conn { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.ov-env-row {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
  margin-top: 10px; padding-top: 11px; border-top: 1px dashed var(--line);
}
.ov-env-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ov-env-item i { font-style: normal; font-size: 10.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.ov-env-item b { font-family: var(--font-num); font-size: 17px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.ov-env-item b u { text-decoration: none; font-size: 10.5px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.ov-env-item b.red { color: var(--red); }
.ov-env-item b.green { color: var(--green); }
.ov-alarm-bar.warn { background: linear-gradient(100deg, #a86a00 0%, #ef9f1f 70%, #f6b544 100%); box-shadow: 0 8px 22px rgba(168, 106, 0, .24); }
.dev-spark-empty { font-size: 10.5px; color: var(--muted); }

@media (max-width: 820px) {
  .ov-env-row { grid-template-columns: 1fr 1fr; }
  .ov-devices-head { margin-top: 2px; }
  .ov-updated { display: none; }
}

/* 移动端：顶栏不重复显示路由标题（页面标题已足够） */
@media (max-width: 820px) {
  .tb-title { display: none; }
  .tb-spacer { min-width: 0; }
}

/* ============================================================
   舍详情页
   ============================================================ */
.house-top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 14px; }
.house-env-card .card-body, .house-svg-card .card-body, .house-chart-card .card-body,
.house-mode-card .card-body, .house-dev-card .card-body, .house-alarm-card .card-body { padding-top: 2px; }

.house-conn { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-right: 4px; }
.house-conn .led { width: 7px; height: 7px; }
.house-env-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* 仪表盘 */
.gauges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 4px; }
.gauge { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0 2px; min-width: 0; }
.gauge-ring { position: relative; width: 84px; height: 84px; }
.gauge-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge-track { fill: none; stroke: #eef0f3; stroke-width: 9; }
.gauge-fill { fill: none; stroke: var(--blue); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .5s ease, stroke .3s; }
.gauge-fill.amber { stroke: var(--amber); }
.gauge-fill.green { stroke: var(--green); }
.gauge-fill.warn { stroke: var(--amber); }
.gauge-fill.bad { stroke: var(--red); }
.gauge-text {
  position: absolute; inset: 0; display: flex; align-items: baseline; justify-content: center;
  padding-top: 31px; font-family: var(--font-num); color: var(--blue-deep);
}
.gauge-text b { font-size: 19px; font-weight: 700; line-height: 1; letter-spacing: -.3px; }
.gauge-text u { text-decoration: none; font-size: 9px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.gauge-label { font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
.gauge-target { font-size: 10px; color: var(--muted); text-align: center; line-height: 1.3; min-height: 13px; }

.house-wind-row {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
  margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line);
}
.house-wind-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); min-width: 0; flex-wrap: wrap; }
.house-wind-item .ic { color: var(--blue); flex: 0 0 auto; }
.house-wind-item b { font-family: var(--font-num); font-size: 15px; font-weight: 700; color: var(--ink); }
.house-wind-item span { flex: 0 0 auto; }

/* 鸡舍 SVG */
.house-svg-wrap { background: linear-gradient(180deg, #fbfcfd 0%, #f4f6f9 100%); border-radius: 12px; border: 1px solid var(--line); padding: 4px 6px 0; overflow: hidden; }
.house-svg { width: 100%; height: auto; display: block; }
.house-svg .hs-fan .hs-fan-blades { transform-box: fill-box; transform-origin: center; }
.house-svg .hs-fan.fan-on .hs-fan-blades { animation: hs-spin 1.3s linear infinite; }
@keyframes hs-spin { to { transform: rotate(360deg); } }
.house-svg .hs-fan.fan-on > circle:first-child { fill: #fdecec; stroke: var(--red); }
.house-svg .hs-fan.fan-on [data-fan-text] { fill: var(--red-deep); font-weight: 700; }
.house-svg .hs-inlet line { transition: transform .4s ease; }
.house-svg .hs-inlet.open line { stroke: var(--blue); stroke-width: 3.2; }
.house-svg .hs-pad.on rect { fill: #7fb8f0; stroke: var(--blue); }
.house-svg .hs-pad.on { filter: drop-shadow(0 0 4px rgba(31, 94, 255, .35)); }
.house-svg [data-light].on circle { fill: #ffe9b8; stroke: var(--amber); }
.house-svg [data-light].on path { stroke: var(--amber); }
.house-svg [data-light].on { filter: drop-shadow(0 0 5px rgba(239, 159, 31, .5)); }
.house-svg .hs-feed.running line { stroke: var(--green); }
.house-svg .hs-feed.running circle { stroke: var(--green); fill: var(--green-soft); }
.house-svg .hs-spray.on line { stroke: var(--blue); stroke-dasharray: 3 4; }
.house-svg .hs-spray.on circle { fill: var(--blue); }
.house-svg .hs-spray.on { animation: hs-pulse 1.6s ease-in-out infinite; }
@keyframes hs-pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.house-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 8px 2px 2px; font-size: 11px; color: var(--muted); }
.house-legend span { display: inline-flex; align-items: center; gap: 5px; }
.lg-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; background: #c9ccd2; }
.lg-dot.blue { background: var(--blue); }
.lg-dot.sky { background: #6ea8e0; }
.lg-dot.red { background: var(--red); }
.lg-dot.amber { background: var(--amber); }
.lg-dot.green { background: var(--green); }
.lg-dot.gray { background: #9aa0a8; }
.house-legend-inline { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); }
.house-legend-inline b { font-family: var(--font-num); color: var(--red-deep); font-size: 12px; }
.house-legend-inline span { white-space: nowrap; }

/* 中段：曲线 + 模式 */
.house-mid { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); gap: 14px; }
.house-chart { min-height: 232px; }
.house-chart-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.house-chart-legend { font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }

.house-mode-block { padding: 4px 0 10px; }
.house-mode-block + .house-mode-block { border-top: 1px dashed var(--line); padding-top: 11px; }
.house-mode-label { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .3px; margin-bottom: 7px; display: flex; align-items: center; gap: 7px; }
.house-mode-seg { width: 100%; }
.house-mode-seg button { flex: 1 1 0; }
.house-vent-seg { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.house-vent-seg button {
  height: 33px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2);
  color: var(--ink-3); font-size: 12px; font-weight: 700; cursor: pointer; transition: all .14s;
}
.house-vent-seg button:hover { border-color: var(--line-strong); background: var(--panel-3); }
.house-vent-seg button.on { background: var(--dark); border-color: var(--dark); color: #fff; }
.level-ctl {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 8px; border-radius: 11px; background: var(--panel-3);
}
.level-btn {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink-2); cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; transition: all .14s;
}
.level-btn:hover { background: var(--panel-3); border-color: var(--blue); color: var(--blue); }
.level-num { display: flex; flex-direction: column; align-items: center; min-width: 88px; }
.level-num b { font-family: var(--font-num); font-size: 36px; font-weight: 700; line-height: 1; color: var(--blue-deep); letter-spacing: -1px; }
.level-num span { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.level-actions { display: flex; gap: 8px; margin-top: 9px; }
.level-actions .btn { flex: 1 1 0; }
.house-cycle {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 11px; color: var(--muted); padding: 9px 10px; border-radius: 9px; background: var(--panel-3);
  margin-top: 2px;
}
.house-cycle .ic { color: var(--blue); }

/* 底段：设备状态 + 报警 */
.house-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.house-dev-group { margin-bottom: 10px; }
.house-dev-group-head { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; }
.house-dev-group-head .ic { color: var(--blue); }
.house-dev-group-head span { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--muted); }
.fan-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.fan-chip {
  display: inline-flex; align-items: center; gap: 3px; height: 26px; padding: 0 7px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2);
  font-family: var(--font-num); font-size: 12px; font-weight: 700; color: var(--ink-3);
}
.fan-chip i { font-style: normal; font-size: 9px; font-weight: 600; color: var(--muted); }
.fan-chip.on { background: var(--red-soft); border-color: #f3b9bb; color: var(--red-deep); }
.fan-chip.on i { color: var(--red); }
.house-dev-rows { display: flex; flex-direction: column; }
.house-dev-row { display: flex; align-items: center; gap: 9px; padding: 7px 2px; border-top: 1px solid var(--line); min-width: 0; }
.house-dev-row:first-child { border-top: 0; }
.house-dev-ic {
  width: 28px; height: 28px; border-radius: 8px; flex: 0 0 auto; display: inline-flex;
  align-items: center; justify-content: center; background: var(--panel-3); color: var(--ink-3);
}
.house-dev-ic.blue { background: var(--blue-soft); color: var(--blue); }
.house-dev-ic.red { background: var(--red-soft); color: var(--red); }
.house-dev-ic.amber { background: var(--amber-soft); color: #b57606; }
.house-dev-ic.green { background: var(--green-soft); color: var(--green); }
.house-dev-ic.gray { background: var(--panel-3); color: var(--muted); }
.house-dev-name { font-size: 12.5px; font-weight: 700; color: var(--ink-2); flex: 0 0 66px; white-space: nowrap; }
.house-dev-status { font-size: 11.5px; color: var(--muted); min-width: 0; flex: 1 1 auto; text-align: right; }

/* 报警列表 */
.house-alarm-count { font-family: var(--font-num); }
.house-alarms { display: flex; flex-direction: column; gap: 8px; max-height: 268px; overflow-y: auto; }
.house-alarm-empty {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 30px 12px; color: var(--green); font-size: 13px; font-weight: 600;
  background: var(--green-soft); border-radius: 10px;
}
.house-alarm-item {
  display: flex; align-items: flex-start; gap: 9px; padding: 10px 11px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); min-width: 0;
}
.house-alarm-lv {
  flex: 0 0 auto; height: 20px; padding: 0 7px; border-radius: 5px;
  font-size: 10.5px; font-weight: 700; display: inline-flex; align-items: center;
  background: var(--panel-3); color: var(--ink-3);
}
.house-alarm-lv.red { background: var(--red-soft); color: var(--red-deep); }
.house-alarm-lv.amber { background: var(--amber-soft); color: #a86a00; }
.house-alarm-main { flex: 1 1 auto; min-width: 0; }
.house-alarm-main b { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink); }
.house-alarm-main span { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); line-height: 1.45; }
.house-alarm-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: 0 0 auto; }
.house-alarm-time { font-size: 10px; color: var(--muted); font-family: var(--font-num); }
.house-alarm-acts { display: flex; gap: 5px; }
.house-alarm-acts .btn { height: 25px; padding: 0 8px; font-size: 11px; }

@media (max-width: 1180px) {
  .house-top { grid-template-columns: 1fr; }
  .house-mid { grid-template-columns: 1fr; }
  .house-bottom { grid-template-columns: 1fr; }
  .gauges { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .house-wind-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .gauges { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 2px; }
  .gauge-ring { width: 92px; height: 92px; }
  .gauge-text { padding-top: 33px; }
  .gauge-text b { font-size: 19px; }
  .gauge-text u { font-size: 8.5px; }
  .house-env-card .card-head { flex-wrap: wrap; gap: 6px; }
  .house-wind-row { grid-template-columns: 1fr 1fr; }
  .house-vent-seg { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .level-btn { width: 48px; height: 48px; }
  .level-num b { font-size: 34px; }
  .level-actions .btn { height: 40px; }
  .house-dev-name { flex-basis: 60px; }
  .house-dev-status { font-size: 11px; }
  .house-alarm-item { padding: 9px 10px; }
  .house-alarms { max-height: none; }
  .house-chart-tools { gap: 6px; }
  .house-legend { gap: 9px; font-size: 10.5px; }
  .house-legend-inline { display: none; }
}

/* ============================================================
   远程控制页
   ============================================================ */
.ctrl-viewer-tip { margin-bottom: 2px; align-items: center; }
.ctrl-safety { border: 1px solid rgba(16, 18, 22, .05); }
.ctrl-safety .card-body { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 13px 18px; }
.ctrl-safety-left { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.ctrl-safety-mode, .ctrl-safety-vent { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.ctrl-safety-label { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .3px; }
.ctrl-mode-seg button { height: 30px; padding: 0 15px; font-size: 13px; }
.ctrl-safety-sub { font-size: 11.5px; color: var(--muted); }
.ctrl-safety-sub b { font-family: var(--font-num); font-size: 14px; color: var(--blue-deep); }
.ctrl-safety-right { display: flex; align-items: center; gap: 9px; }
.ctrl-safety-right .btn { height: 36px; }

.ctrl-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.ctrl-card { min-width: 0; }
.ctrl-card-tools { display: flex; align-items: center; gap: 6px; }
.card-sub-tag { font-size: 11px; color: var(--muted); font-weight: 600; font-family: var(--font-num); }
.ctrl-rows { display: flex; flex-direction: column; }
.ctrl-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 0;
  border-top: 1px solid var(--line); min-width: 0;
}
.ctrl-row:first-child { border-top: 0; }
.ctrl-row-state {
  display: inline-flex; align-items: center; gap: 5px; flex: 0 0 84px;
  font-size: 11.5px; color: var(--ink-3); font-weight: 700;
}
.ctrl-row-state i { font-style: normal; font-family: var(--font-num); font-size: 10.5px; color: var(--muted); font-weight: 600; }
.ctrl-row-ic {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel-3); color: var(--ink-3);
}
.ctrl-row-ic.blue { background: var(--blue-soft); color: var(--blue); }
.ctrl-row-ic.green { background: var(--green-soft); color: var(--green); }
.ctrl-row-main { flex: 1 1 auto; min-width: 0; }
.ctrl-row-main > b { display: block; font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.35; }
.ctrl-row-main > span { display: block; margin-top: 1px; font-size: 10.5px; color: var(--muted); line-height: 1.5; }
.ctrl-row-main > span b { font-family: var(--font-num); color: var(--ink-2); }
.ctrl-row-ctrl { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.ctrl-row-ctrl-col { flex-direction: column; align-items: flex-end; gap: 7px; }
.ctrl-mini-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--muted); font-weight: 600; }
.ctrl-speed { display: flex; align-items: center; gap: 6px; }
.ctrl-speed-val { font-family: var(--font-num); font-size: 11px; font-weight: 700; color: var(--ink-2); width: 34px; text-align: right; }
.ctrl-range-val { font-family: var(--font-num); font-size: 11.5px; font-weight: 700; color: var(--ink-2); width: 42px; text-align: right; }
.ctrl-row-ctrl input[type="range"] {
  width: 92px; height: 30px; accent-color: var(--blue); cursor: pointer; margin: 0;
}
.ctrl-row-ctrl input[type="range"]:disabled { opacity: .4; cursor: not-allowed; }
.ctrl-row-ctrl .switch { flex: 0 0 auto; }

.ctrl-log-card { grid-column: 1 / -1; }
.ctrl-logs { display: flex; flex-direction: column; }
.ctrl-log-row {
  display: grid; grid-template-columns: 124px 68px minmax(108px, auto) minmax(0, 1fr) 56px;
  align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--ink-3); min-width: 0;
}
.ctrl-log-row:first-child { border-top: 0; }
.ctrl-log-time { font-family: var(--font-num); color: var(--muted); font-size: 11px; white-space: nowrap; }
.ctrl-log-user { font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctrl-log-action { font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctrl-log-detail { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctrl-log-result { text-align: right; font-weight: 700; white-space: nowrap; }
.ctrl-log-result.ok { color: var(--green); }
.ctrl-log-result.err { color: var(--red); }

@media (max-width: 1180px) {
  .ctrl-grid { grid-template-columns: 1fr; }
  .ctrl-log-card { grid-column: auto; }
}
@media (max-width: 820px) {
  .ctrl-safety .card-body { flex-direction: column; align-items: stretch; }
  .ctrl-safety-left { gap: 10px; }
  .ctrl-safety-right { justify-content: flex-end; }
  .ctrl-safety-right .btn { flex: 1 1 0; height: 42px; }
  .ctrl-row { flex-wrap: wrap; row-gap: 7px; padding: 10px 0; }
  .ctrl-row-state { flex: 0 0 76px; }
  .ctrl-row-main { flex: 1 1 calc(100% - 90px); }
  .ctrl-row-ctrl { flex: 1 1 100%; justify-content: flex-end; }
  .ctrl-row-ctrl-col { flex-direction: row; justify-content: flex-end; }
  .ctrl-row-ctrl input[type="range"] { width: 118px; height: 34px; }
  .ctrl-card-tools .btn { height: 32px; }
  .ctrl-log-row { grid-template-columns: 1fr auto; row-gap: 2px; }
  .ctrl-log-user { display: none; }
  .ctrl-log-action { grid-column: 1 / 2; }
  .ctrl-log-time { grid-column: 2 / 3; text-align: right; }
  .ctrl-log-detail { grid-column: 1 / -1; white-space: normal; }
  .ctrl-log-result { display: none; }
}

/* ============================================================
   历史数据页
   ============================================================ */
.hist-filter .card-body { display: flex; flex-direction: column; gap: 11px; padding: 14px 18px 15px; }
.hist-filter-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hist-filter-label { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .3px; flex: 0 0 62px; }
.hist-range-seg button, .hist-grain-seg button { height: 30px; padding: 0 14px; font-size: 13px; }
.hist-filter-hint { font-size: 11px; color: var(--muted); font-family: var(--font-num); }
.hist-custom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hist-custom-field { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.hist-custom-field input {
  height: 32px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff;
  padding: 0 9px; font-size: 12.5px; font-family: var(--font-num); color: var(--ink); outline: none;
}
.hist-custom-field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31, 94, 255, .12); }
.hist-custom-sep { color: var(--muted); font-size: 11px; }
.hist-params { display: flex; flex-wrap: wrap; gap: 6px; }
.hist-param {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  color: var(--ink-3); font-size: 12px; font-weight: 600; cursor: pointer; transition: all .14s;
}
.hist-param i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.hist-param u { text-decoration: none; font-size: 9.5px; color: var(--muted); }
.hist-param:hover { border-color: var(--line-strong); background: var(--panel-3); }
.hist-param.on { background: var(--dark); border-color: var(--dark); color: #fff; }
.hist-param.on u { color: rgba(255, 255, 255, .6); }

.hist-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(188px, 1fr)); gap: 9px; }
.hist-summary-item {
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
  padding: 10px 12px; background: var(--panel-3); border-radius: 10px; min-width: 0;
}
.hist-summary-item i { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; align-self: center; }
.hist-sum-label { font-size: 11.5px; font-weight: 700; color: var(--ink-3); }
.hist-summary-item b { font-family: var(--font-num); font-size: 20px; font-weight: 700; color: var(--blue-deep); line-height: 1.1; }
.hist-summary-item u { text-decoration: none; font-size: 10px; color: var(--muted); }
.hist-sum-sub { flex: 0 0 100%; font-size: 10.5px; color: var(--muted); }
.hist-summary-loading, .hist-summary-empty { font-size: 12px; color: var(--muted); padding: 6px 0; }
.hist-points-info { font-size: 11px; color: var(--muted); font-family: var(--font-num); }
.hist-charts { display: flex; flex-direction: column; gap: 14px; }
.hist-chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hist-chart-card .card-body { padding: 0 12px 8px; }
.hist-chart { width: 100%; }
.hist-unit { font-size: 10.5px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.hist-stat-inline { display: flex; align-items: center; gap: 11px; font-size: 10.5px; color: var(--muted); flex-wrap: wrap; justify-content: flex-end; }
.hist-stat-inline b { font-family: var(--font-num); color: var(--ink-2); font-size: 11.5px; }
.hist-table-hint { font-size: 10.5px; color: var(--muted); }
.hist-tbl-scroll { overflow-x: auto; }
.hist-tbl { min-width: 480px; }
.hist-tbl thead th:first-child, .hist-tbl tbody td:first-child { text-align: left; }

@media (max-width: 1120px) {
  .hist-chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .hist-filter .card-body { padding: 12px 14px 14px; gap: 10px; }
  .hist-filter-row { align-items: flex-start; }
  .hist-filter-label { flex: 0 0 100%; margin-bottom: -3px; }
  .hist-range-seg { width: 100%; }
  .hist-range-seg button { flex: 1 1 auto; padding: 0 8px; font-size: 12.5px; }
  .hist-grain-seg button { flex: 1 1 auto; padding: 0 8px; }
  .hist-custom { width: 100%; }
  .hist-custom-field { flex: 1 1 100%; justify-content: space-between; }
  .hist-custom-field input { flex: 1 1 auto; min-width: 0; }
  .hist-custom-sep { display: none; }
  .hist-custom .btn { flex: 1 1 100%; height: 36px; }
  .hist-params { gap: 5px; }
  .hist-param { height: 32px; padding: 0 10px; font-size: 12px; }
  .hist-summary { grid-template-columns: 1fr 1fr; }
  .hist-summary-item b { font-size: 18px; }
  .hist-stat-inline { gap: 8px; font-size: 10px; }
}



