/* ============================================================
   HA-SaaS · Neon Glass Theme
   设计语言：深空黑 · 玻璃磨砂 · 霓虹渐变 · 科技网格
   字体策略：本地托管 woff2（位于 public/fonts/），不再访问 Google Fonts。
   字体源于 Google Fonts CC0/SIL OFL（Inter / JetBrains Mono / Orbitron）。
   ============================================================ */

/* —— 本地 @font-face：Inter / JetBrains Mono / Orbitron ——
   仅保留 latin 子集（U+0000-00FF + 部分标点）。
   latin-ext (U+0100-02BA, 主要是欧洲特殊字符 ñ/ü/ß) 在中文 + ASCII 场景永远不会被命中，
   去掉以节省静态资源体积、减少不必要的请求与缓存条目。 */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/inter-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/fonts/inter-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/fonts/inter-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/fonts/inter-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face { font-family: "Inter"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("/fonts/inter-800-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/jetbrains-mono-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/fonts/jetbrains-mono-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/fonts/jetbrains-mono-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face { font-family: "Orbitron"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/fonts/orbitron-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face { font-family: "Orbitron"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/fonts/orbitron-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face { font-family: "Orbitron"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/fonts/orbitron-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face { font-family: "Orbitron"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("/fonts/orbitron-800-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* —— 基础面板（沿用旧变量名以兼容内联样式） —— */
  --paper-1:    #06060a;   /* 主背景：近黑（去蓝调） */
  --paper-2:    rgba(255, 255, 255, 0.04);   /* 主玻璃面 */
  --paper-3:    rgba(255, 255, 255, 0.06);   /* 高亮玻璃面 */
  --paper-4:    rgba(255, 255, 255, 0.025);  /* 弱化玻璃面 */
  --paper-edge: rgba(255, 255, 255, 0.10);
  --vellum:     rgba(10, 10, 14, 0.55);      /* 侧栏玻璃 */

  /* 实体玻璃底色（不透明版本，用于某些需要遮挡的元素） */
  --glass-1:    #0a0a0d;
  --glass-2:    #101013;
  --glass-3:    #1a1a1f;

  /* —— 文本层级（中性灰，无蓝调） —— */
  --ink:        #f5f5f7;   /* 主文 */
  --ink-soft:   #d4d4d8;   /* 副文 */
  --ink-faded:  #a1a1aa;   /* 注释 */
  --ink-dim:    #71717a;

  /* 兼容别名：历史代码大量使用 --text / --text-muted，指向同一组 ink-* */
  --text:        var(--ink);
  --text-muted:  var(--ink-faded);
  --text-dim:    var(--ink-dim);

  /* —— 描边 —— */
  --line:       rgba(255, 255, 255, 0.10);
  --line-soft:  rgba(255, 255, 255, 0.05);
  --line-bold:  rgba(255, 255, 255, 0.22);

  /* —— 语义色（命名沿用旧 seal-*） ——
     主体色不再为青/蓝，统一改为银白系 */
  --seal-red:   #e5e7eb;   /* 主品牌 / 高亮（银白） */
  --seal-red-d: #cbd5e1;
  --seal-blue:  #cbd5e1;
  --seal-blue-d:#94a3b8;
  --seal-green: #10b981;
  --seal-green-d:#059669;
  --seal-amber: #f59e0b;

  /* 旧变量名 neon-* 现在指向银白系，functional 颜色（pink/lime/rose）保持 */
  --neon-cyan:    #e5e7eb;   /* 原 #22d3ee */
  --neon-blue:    #cbd5e1;   /* 原 #3b82f6 */
  --neon-purple:  #94a3b8;   /* 原 #a855f7 */
  --neon-pink:    #ec4899;
  --neon-rose:    #f43f5e;
  --neon-lime:    #84cc16;

  /* —— 渐变 ——
     主体色：黑 / 银（替代旧的青→蓝→紫渐变） */
  --grad-primary:   linear-gradient(135deg, #2a2a30 0%, #1a1a1d 50%, #050505 100%);
  --grad-primary-h: linear-gradient(135deg, #3a3a40 0%, #25252a 50%, #15151a 100%);
  --grad-accent:    linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  --grad-success:   linear-gradient(135deg, #10b981 0%, #059669 100%);
  --grad-warn:      linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  --grad-danger:    linear-gradient(135deg, #f43f5e 0%, #ec4899 100%);
  --grad-cool:      linear-gradient(135deg, #71717a 0%, #1c1c20 100%);
  --grad-text:      linear-gradient(135deg, #ffffff 0%, #a1a1aa 100%);

  /* 阴影 / 光晕（保留旧变量名兼容；颜色已统一为银白光） */
  --glow-cyan:   0 0 24px rgba(255, 255, 255, 0.25);
  --glow-blue:   0 0 24px rgba(255, 255, 255, 0.18);
  --glow-purple: 0 0 24px rgba(255, 255, 255, 0.14);
  --shadow-md:   0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-lg:   0 16px 48px rgba(0, 0, 0, 0.55);

  /* —— 字体 —— */
  --font-ui:        "Inter", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei",
                    "Hiragino Sans GB", -apple-system, BlinkMacSystemFont,
                    "Segoe UI", system-ui, sans-serif;
  --font-display:   "Orbitron", "Inter", "PingFang SC", system-ui, sans-serif;
  --font-typewriter:"JetBrains Mono", "SF Mono", Consolas, monospace;
  --font-mono:      "JetBrains Mono", "SF Mono", Consolas, "Courier New", monospace;
  --font-serif:     var(--font-ui);

  /* —— 尺寸 —— */
  --side-w: 248px;
  --side-w-collapsed: 72px;
  --top-h:  64px;
  --radius: 10px;
  --radius-r: 14px;
  --radius-sm: 6px;
}

/* ============================================================
   浅色主题：变量级覆盖 —— 通过 html[data-theme="light"] 启用
   关键策略：仅重定义颜色变量；具体组件样式不动，沿用变量自动适配。
   对极少数硬编码 rgba(255,255,255,*) 的地方做兜底覆盖。
   ============================================================ */
html[data-theme="light"] {
  --paper-1:    #f7f7f9;
  --paper-2:    rgba(0, 0, 0, 0.04);
  --paper-3:    rgba(0, 0, 0, 0.06);
  --paper-4:    rgba(0, 0, 0, 0.025);
  --paper-edge: rgba(0, 0, 0, 0.10);
  --vellum:     rgba(255, 255, 255, 0.78);

  --glass-1:    #ffffff;
  --glass-2:    #f4f4f7;
  --glass-3:    #e9e9ee;

  --ink:        #18181b;
  --ink-soft:   #3f3f46;
  --ink-faded:  #52525b;
  --ink-dim:    #71717a;

  --line:       rgba(0, 0, 0, 0.10);
  --line-soft:  rgba(0, 0, 0, 0.05);
  --line-bold:  rgba(0, 0, 0, 0.22);

  --seal-red:   #18181b;
  --seal-red-d: #3f3f46;
  --seal-blue:  #3f3f46;
  --seal-blue-d:#52525b;

  --neon-cyan:    #18181b;
  --neon-blue:    #3f3f46;
  --neon-purple:  #52525b;

  --grad-primary:   linear-gradient(135deg, #f4f4f5 0%, #e4e4e7 50%, #d4d4d8 100%);
  --grad-primary-h: linear-gradient(135deg, #ffffff 0%, #f4f4f5 50%, #e4e4e7 100%);
  --grad-cool:      linear-gradient(135deg, #d4d4d8 0%, #71717a 100%);
  --grad-text:      linear-gradient(135deg, #18181b 0%, #71717a 100%);

  --glow-cyan:   0 0 24px rgba(0, 0, 0, 0.08);
  --glow-blue:   0 0 24px rgba(0, 0, 0, 0.06);
  --glow-purple: 0 0 24px rgba(0, 0, 0, 0.05);
  --shadow-md:   0 8px 32px rgba(0, 0, 0, 0.10);
  --shadow-lg:   0 16px 48px rgba(0, 0, 0, 0.14);
}

/* body 背景图直接覆盖（不走变量） */
html[data-theme="light"] body {
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 8% -10%,  rgba(0,0,0,0.04),  transparent 60%),
    radial-gradient(900px 700px  at 100% 10%, rgba(0,0,0,0.03),  transparent 55%),
    radial-gradient(900px 700px  at 50% 110%, rgba(0,0,0,0.03),  transparent 60%),
    linear-gradient(180deg, #f7f7f9 0%, #ffffff 50%, #f3f3f5 100%);
  background-attachment: fixed;
}
html[data-theme="light"] body::before {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px) !important;
}

/* —— 兜底：把项目里硬编码 rgba(255,255,255,*) 的高频背景/边框翻转成
   浅色对应——避免浅色背景下出现"白底白雾"。仅覆盖最常见的几个范围。 */
html[data-theme="light"] .card,
html[data-theme="light"] .pcs-filter,
html[data-theme="light"] .pcs-tab,
html[data-theme="light"] .pcs-search-wrap,
html[data-theme="light"] .pc-card,
html[data-theme="light"] .room-pro,
html[data-theme="light"] .ac-pad,
html[data-theme="light"] .pc-tile,
html[data-theme="light"] .rp-pc-stat,
html[data-theme="light"] .topbar,
html[data-theme="light"] .sidebar,
html[data-theme="light"] .modal-box,
html[data-theme="light"] .role-chip,
html[data-theme="light"] .console-banner,
html[data-theme="light"] .pcs-banner,
html[data-theme="light"] .balance-chip {
  background-color: rgba(255,255,255,0.65);
  border-color: rgba(0,0,0,0.08);
  color: var(--ink);
}
html[data-theme="light"] .pcs-tab.on {
  background: linear-gradient(135deg, rgba(0,0,0,0.06), rgba(0,0,0,0.10));
  color: #18181b; border-color: rgba(0,0,0,0.22);
}
html[data-theme="light"] .pcs-tab-cnt,
html[data-theme="light"] .pcs-tab-dot.off,
html[data-theme="light"] .rp-pc-stat.off {
  background: rgba(0,0,0,0.08); color: #18181b;
}
html[data-theme="light"] .nav .item:hover,
html[data-theme="light"] .nav .item.active {
  background: rgba(0,0,0,0.06);
}
html[data-theme="light"] .data-table tbody tr:nth-child(odd),
html[data-theme="light"] .data-table tbody tr:hover {
  background: rgba(0,0,0,0.03);
}
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  /* 注意：必须用 background-color 而不是 background shorthand。
     shorthand 会把 background-image / background-repeat / background-position
     全部重置 — select 的下拉箭头 SVG 就会被默认 repeat 平铺成一排 "v v v v"。 */
  background-color: #ffffff;
  border-color: rgba(0,0,0,0.12);
  color: var(--ink);
}
html[data-theme="light"] .muted,
html[data-theme="light"] .dim,
html[data-theme="light"] .small.muted {
  color: var(--ink-faded);
}
html[data-theme="light"] .rp-head { border-bottom-color: rgba(0,0,0,0.10); }
html[data-theme="light"] .rp-badge.off {
  background: rgba(0,0,0,0.05); color: var(--ink-faded); border-color: rgba(0,0,0,0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 450;
  line-height: 1.6;
  letter-spacing: 0.1px;
  color: var(--ink);
  background: var(--paper-1);
  /* 深空背景：基底黑 + 淡灰光晕（去蓝调） */
  background-image:
    radial-gradient(1200px 700px at 8% -10%,  rgba(255, 255, 255, 0.05),  transparent 60%),
    radial-gradient(900px 700px  at 100% 10%, rgba(255, 255, 255, 0.04),  transparent 55%),
    radial-gradient(900px 700px  at 50% 110%, rgba(255, 255, 255, 0.03),  transparent 60%),
    linear-gradient(180deg, #050507 0%, #0a0a0e 50%, #050507 100%);
  background-attachment: fixed;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 页面本身不滚动：滚动职责全部下放到 main#view（内容区）和 .sidebar .nav
   （导航列表）内部。这样：
   - 不再需要强制渲染页面级滚动条 → 右缘不会出现一条空的黑色滚动槽
     （内嵌 iframe / 门店视图这类单屏页尤其明显）；
   - 侧栏品牌块 / 用户名 / 底部按钮恒定钉住，窗口矮时只有导航列表滚动；
   - 内容高度变化不会引起页面级滚动条出现/消失导致的背景左右跳。 */
html {
  height: 100%;
  overflow: hidden;
}

/* 全局网格层（在所有内容下方，body::before 覆盖整页） */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 30%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 30%, transparent 90%);
  z-index: 0;
}
/* body::after（星点装饰）已按用户要求移除，登录页仅保留 body::before 的网格 */

#cyber-bg { z-index: 0; }
#shell, .topbar, .sidebar, main#view { position: relative; z-index: 1; }
#login { z-index: 50; }

::selection { background: rgba(255, 255, 255, 0.32); color: #fff; }

/* 显示字体仅用于品牌 / 大标题 */
.page-head .title,
.card-head h2, .card h2, .panel h2,
.brand-text,
.brand-icon,
.login-card h1,
.topbar .crumb b,
.modal-head > span,
.empty-title,
.stat .num {
  font-family: var(--font-display);
  letter-spacing: 0.6px;
}
.stat .num { letter-spacing: 0; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--neon-cyan), var(--neon-purple));
  background-clip: padding-box;
  border: 2px solid transparent;
}
/* Firefox（不识别 ::-webkit-scrollbar）：scrollbar-width / scrollbar-color 都是
   可继承属性，挂在 html 上即可让全站所有滚动容器（含 AI 对话消息区 #_ai_msgs、
   代客查看 .view-as-tabs、代码块 .md-code）拿到统一细滚动条样式，避免回退成系统默认粗滚动条。 */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.20) transparent;
}

/* ---------- Utility ---------- */
.hidden { display: none !important; }
.muted  { color: var(--ink-faded); }
.dim    { color: var(--ink-dim); }
.small  { font-size: 12.5px; }
.tiny   { font-size: 11px; letter-spacing: 0.4px; }
.mono, .kbd, .copy-input input { font-family: var(--font-mono); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.num, table td, .stat .num, .balance-chip { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.right  { text-align: right; }
.spacer { flex: 1; }
.gap-2  { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-2   { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-2   { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }

.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.col { display: flex; flex-direction: column; gap: 8px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

a { color: var(--neon-cyan); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--neon-blue); text-shadow: 0 0 12px rgba(255, 255, 255, 0.5); }

hr {
  border: 0; height: 1px;
  background: linear-gradient(to right, transparent, var(--line-bold), transparent);
  margin: 16px 0;
}

/* ---------- Buttons ---------- */
button, .btn {
  cursor: pointer;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius);
  letter-spacing: 0.3px;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease;
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset, 0 4px 12px rgba(0,0,0,0.25);
}
button:hover, .btn:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.45);
  color: var(--neon-cyan);
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.08) inset,
    0 6px 20px rgba(255, 255, 255, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.25);
}
button:active, .btn:active { transform: translateY(0); }
button:disabled, .btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }

/* 主按钮：黑色渐变填充 + 银白描边 */
button.primary, .btn.primary {
  background: var(--grad-primary);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 700;
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.10) inset;
}
button.primary:hover, .btn.primary:hover {
  background: var(--grad-primary-h);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow:
    0 6px 26px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.20) inset;
}

button.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--ink-soft);
  padding: 6px 14px;
  box-shadow: none;
  backdrop-filter: blur(8px);
}
button.ghost:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.20);
}

button.danger {
  background: var(--grad-danger);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 18px rgba(244, 63, 94, 0.4);
}
button.danger:hover { filter: brightness(1.1); color: #fff; box-shadow: 0 6px 24px rgba(244, 63, 94, 0.55); }

button.success {
  background: var(--grad-success);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.4);
}
button.success:hover { filter: brightness(1.1); color: #fff; box-shadow: 0 6px 24px rgba(16, 185, 129, 0.55); }

button.warn {
  background: var(--grad-warn);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.4);
}
button.warn:hover { filter: brightness(1.1); color: #fff; }

button.small { padding: 4px 12px; font-size: 12px; }
button.icon-only {
  padding: 4px 8px; box-shadow: none; border: 0; background: transparent;
  color: var(--ink-faded);
}
button.icon-only:hover { background: rgba(255, 255, 255, 0.08); color: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.20); }
button.link {
  background: none; color: var(--ink); padding: 2px 4px; box-shadow: none; border: 0;
  text-decoration: underline; font-weight: 500;
}
button.link:hover { color: #fff; background: none; transform: none; box-shadow: none; }

/* ---------- Inputs ---------- */
input, select, textarea {
  font-family: var(--font-ui);
  font-size: 13.5px;
  width: 100%;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius);
  color: var(--ink);
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
  line-height: 1.4;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.06);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.10),
    0 0 16px rgba(255, 255, 255, 0.10);
}
input::placeholder, textarea::placeholder { color: var(--ink-dim); }
input[readonly], input:disabled { color: var(--ink-faded); background: rgba(255, 255, 255, 0.02); }
input[readonly] { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0; }

/* ---------- 浏览器自动填充：覆盖 Chrome/Edge/Safari 默认的白/黄/蓝色背景 ---------- */
/* WebKit / Blink */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
textarea:-webkit-autofill:active,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus,
select:-webkit-autofill:active {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px #101013 inset;
          box-shadow: 0 0 0 1000px #101013 inset;
  caret-color: var(--ink);
  border-color: rgba(255, 255, 255, 0.10);
  /* 延迟背景色过渡，避免短暂闪现浏览器默认色 */
  transition: background-color 9999s ease-in-out 0s,
              -webkit-text-fill-color 0s;
}
/* 自动填充状态下保留 focus 的银白光环 */
input:-webkit-autofill:focus,
textarea:-webkit-autofill:focus,
select:-webkit-autofill:focus {
  -webkit-box-shadow:
    0 0 0 1000px #101013 inset,
    0 0 0 3px rgba(255, 255, 255, 0.15),
    0 0 16px rgba(255, 255, 255, 0.15);
          box-shadow:
    0 0 0 1000px #14172b inset,
    0 0 0 3px rgba(255, 255, 255, 0.15),
    0 0 16px rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.55);
}
/* 标准 / Firefox */
input:autofill,
textarea:autofill,
select:autofill {
  background-color: #101013 !important;
  color: var(--ink) !important;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2322d3ee' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}
select option { background: var(--glass-2); color: var(--ink); }

.field { margin-bottom: 14px; }
.field label {
  display: block; margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--ink-soft);
  font-weight: 600;
  text-transform: uppercase;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }
.field .help { font-size: 12px; color: var(--ink-faded); margin-top: 4px; }

.input-group { display: flex; align-items: stretch; }
.input-group input { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0; }
.input-group button { border-top-left-radius: 0; border-bottom-left-radius: 0; }

/* ---------- Tags（霓虹徽章） ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-soft);
  white-space: nowrap;
  position: relative;
}
.tag::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}
.tag-active, .tag-online   { color: var(--neon-lime); background: rgba(132, 204, 22, 0.08); }
.tag-pending  { color: var(--seal-amber); background: rgba(245, 158, 11, 0.08); }
.tag-expired, .tag-offline { color: var(--neon-rose); background: rgba(244, 63, 94, 0.08); }
.tag-disabled { color: var(--ink-dim); background: rgba(255, 255, 255, 0.03); }
.tag-disabled::before { box-shadow: none; }
.tag-info     { color: #67e8f9; background: rgba(103, 232, 249, 0.10); }   /* 保留：功能性信息标签（青）*/
.tag-purple   { color: #c084fc; background: rgba(192, 132, 252, 0.10); }   /* 保留：功能性紫标签 */
.tag-plain    { color: var(--ink-faded); }
.tag-plain::before { display: none; }

/* ---------- Layout ---------- */
.shell {
  height: 100%;
  overflow: hidden;
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  /* 新增 banner 行：「门店过期/未激活/被禁用」全局横幅。
     新增 viewas 行：admin / agent 代客查看时的身份提示 + 网咖运营子导航。
     两行都默认无内容时 auto 行高 ≈ 0，不会占位影响 main 高度。 */
  grid-template-rows: var(--top-h) auto auto 1fr;
  grid-template-areas:
    "side top"
    "side banner"
    "side viewas"
    "side main";
  transition: grid-template-columns .25s cubic-bezier(.4,0,.2,1);
}

/* 代客查看 host：与 main 等宽，左右 padding 与 main 对齐
   空内容时（admin/agent 不在代客查看模式 / store 自己用）整行 0 高，不可见。 */
#view_as_host {
  grid-area: viewas;
  padding: 14px 36px 0 36px;
}
#view_as_host:empty { padding: 0; }

/* ============ 全局横幅：门店账号异常状态 ============
   覆盖 main 上方整条横向区域，跟随侧栏宽度自适应，
   背景红/琥珀渐变 + 边线高亮，确保所有 store 子页面都能看到。 */
.store-banner {
  grid-area: banner;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 24px;
  margin: 0;
  font-size: 13.5px; line-height: 1.5;
  color: #fff5f5;
  background: linear-gradient(90deg, rgba(244,63,94,0.22), rgba(244,63,94,0.08) 70%);
  border-bottom: 1px solid rgba(244,63,94,0.45);
  box-shadow: 0 2px 12px -6px rgba(244,63,94,0.4);
  z-index: 5;
}
.store-banner.warn-amber {
  color: #fff7e6;
  background: linear-gradient(90deg, rgba(245,158,11,0.22), rgba(245,158,11,0.08) 70%);
  border-bottom-color: rgba(245,158,11,0.45);
  box-shadow: 0 2px 12px -6px rgba(245,158,11,0.4);
}
.store-banner .sb-ico {
  flex: none; width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  font-weight: 800; font-size: 12px;
}
.store-banner .sb-msg { flex: 1 1 auto; min-width: 0; }
.store-banner .sb-msg b { color: #fff; margin-right: 4px; }
.store-banner .sb-act {
  flex: none;
  padding: 4px 12px;
  font-size: 12.5px; font-weight: 600;
  color: #fff;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.32);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease;
}
.store-banner .sb-act:hover { background: rgba(255,255,255,0.28); }
html[data-theme="light"] .store-banner {
  color: #7f1d1d;
  background: linear-gradient(90deg, rgba(244,63,94,0.16), rgba(244,63,94,0.04) 70%);
}
html[data-theme="light"] .store-banner.warn-amber {
  color: #78350f;
  background: linear-gradient(90deg, rgba(245,158,11,0.18), rgba(245,158,11,0.04) 70%);
}
html[data-theme="light"] .store-banner .sb-msg b { color: #111; }
html[data-theme="light"] .store-banner .sb-act {
  color: #1f1f1f;
  background: rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.18);
}
html[data-theme="light"] .store-banner .sb-act:hover { background: rgba(0,0,0,0.12); }
.shell.collapsed { grid-template-columns: var(--side-w-collapsed) 1fr; }

/* ============ 侧栏折叠动画期间 ============
   在 250ms grid-template-columns 过渡过程中，JS 会给 <html> 加上
   .is-sidebar-toggling 标记。这段时间内只关掉昂贵的 backdrop-filter
   （最大化时大面积模糊每帧重采样是闪烁的元凶）。
   过渡结束后 (~320ms) backdrop-filter 自动恢复。
   注意：
   - 不再去碰 .card / .stat / .kpi 的 animation 属性，否则在解除该类时
     `animation: float-in .3s` 会被浏览器视作新动画从头重放一次，看起来
     就像"整页又刷新了一下"。
   - 不再用通用 * 选择器统改 transition-property，避免在解除该类时
     `transition: all` 元素（如 chip-btn）把 backdrop-filter 从 none
     回到 blur 这一变化插值播放一遍，造成回弹瞬闪。
   - 改为对玻璃元素显式禁用所有 transition，让 backdrop-filter 在解除
     时瞬时回到原状，无插值、无补帧。 */
.is-sidebar-toggling .sidebar,
.is-sidebar-toggling .topbar,
.is-sidebar-toggling .card,
.is-sidebar-toggling .panel,
.is-sidebar-toggling .chip-btn,
.is-sidebar-toggling .topbar .balance-chip,
.is-sidebar-toggling .role-chip {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: none !important;
}

.shell.collapsed .sidebar .brand-block {
  padding: 0;
  justify-content: center;
  gap: 0;
}
.shell.collapsed .sidebar .brand-icon { display: none; }
.shell.collapsed .sidebar .brand-text { display: none; }
.shell.collapsed .sidebar-toggle {
  position: static;
  margin: 0;
  width: 32px; height: 32px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.shell.collapsed .sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.45);
}
.shell.collapsed .sidebar .footer-actions {
  padding: 14px 8px 10px;
}

.shell.collapsed .sidebar .role-chip {
  margin: 10px 10px 6px;
  padding: 5px;
  justify-content: center;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.shell.collapsed .sidebar .role-chip::before,
.shell.collapsed .sidebar .role-chip::after { display: none; }
.shell.collapsed .sidebar .role-chip .info   { display: none; }
.shell.collapsed .sidebar .role-chip .avatar { width: 38px; height: 38px; font-size: 15px; }

.shell.collapsed .sidebar .nav { padding: 10px 6px; gap: 2px; }
.shell.collapsed .sidebar .nav-section { display: none !important; }
.shell.collapsed .sidebar .nav-group + .nav-group {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line-soft);
}
.shell.collapsed .sidebar .nav-group .nav-list { max-height: 800px !important; opacity: 1 !important; pointer-events: auto !important; }

.shell.collapsed .sidebar .nav-item {
  justify-content: center;
  padding: 10px 0;
  gap: 0;
  border-left: none;
  margin: 1px 0;
  position: relative;
}
.shell.collapsed .sidebar .nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}
.shell.collapsed .sidebar .nav-item .icn { width: 18px; height: 18px; opacity: 1; }
.shell.collapsed .sidebar .nav-item span:not(.icn),
.shell.collapsed .sidebar .nav-item .badge { display: none; }
.shell.collapsed .sidebar .nav-item.active {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.04) 100%);
  color: #fff;
  box-shadow: inset 2px 0 0 0 rgba(255, 255, 255, 0.8);
}
.shell.collapsed .sidebar .nav-item.active::after { display: none; }

.shell.collapsed .sidebar .footer-actions button {
  padding: 8px 0; justify-content: center; flex: 1;
  font-size: 0;
}
.shell.collapsed .sidebar .footer-actions button svg { width: 16px; height: 16px; }
.shell.collapsed .sidebar .footer-actions button span { display: none; }

/* —— Sidebar：玻璃面板 —— */
.sidebar {
  grid-area: side;
  /* 双层背景：上层为浅银渐变，下层为半透明深色玻璃，保证可读 */
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.05) 0%,
      transparent 35%,
      transparent 65%,
      rgba(255, 255, 255, 0.04) 100%),
    linear-gradient(180deg, rgba(10, 10, 14, 0.42) 0%, rgba(6, 6, 10, 0.60) 100%);
  border-right: 1px solid transparent;
  border-image: linear-gradient(180deg,
      rgba(255, 255, 255, 0.20) 0%,
      rgba(255, 255, 255, 0.06) 35%,
      rgba(255, 255, 255, 0.06) 65%,
      rgba(255, 255, 255, 0.20) 100%) 1;
  height: 100%;
  min-height: 0;
  /* 只让中间的 .nav 列表滚动：品牌块 / 用户名 / 底部按钮恒定钉住，
     窗口矮时标题不会被卷出视野 */
  overflow: hidden;
  z-index: 10;
  display: flex; flex-direction: column;
  box-shadow:
    inset -1px 0 0 0 rgba(255, 255, 255, 0.04),
    4px 0 32px rgba(0, 0, 0, 0.35);
  transform: translateZ(0);
  backface-visibility: hidden;
  contain: layout style paint;
}
.sidebar::before {
  /* 顶部高光条 */
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  pointer-events: none;
}
/* 导航列表的滚动条：窗口矮（内嵌 iframe / 小屏）时导航放不下会滚动，
   全局 10px 滚动条压在侧栏右缘像一条黑槽——收成 4px 细条，
   平时全透明，悬停侧栏才显出淡淡的滑块。 */
.sidebar .nav { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.sidebar:hover .nav { scrollbar-color: rgba(255, 255, 255, 0.22) transparent; }
.sidebar .nav::-webkit-scrollbar { width: 4px; }
.sidebar .nav::-webkit-scrollbar-thumb {
  background: transparent;
  border: 0;
  border-radius: 4px;
}
.sidebar:hover .nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.22); }
html[data-theme="light"] .sidebar:hover .nav { scrollbar-color: rgba(0, 0, 0, 0.25) transparent; }
html[data-theme="light"] .sidebar .nav::-webkit-scrollbar-thumb { background: transparent; }
html[data-theme="light"] .sidebar:hover .nav::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.25); }
.sidebar svg.icn { transform: translateZ(0); }

.sidebar .brand-block {
  padding: 0 18px 0 22px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--line);
  height: var(--top-h);
  position: relative;
}
.sidebar-toggle {
  margin-left: auto;
  width: 28px; height: 28px;
  padding: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: none;
  transition: all .15s ease;
  flex-shrink: 0;
}
.sidebar-toggle:hover {
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--neon-cyan);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.25);
  transform: none;
}
.sidebar-toggle .ico-expand   { display: none; }
.shell.collapsed .sidebar-toggle .ico-collapse { display: none; }
.shell.collapsed .sidebar-toggle .ico-expand   { display: block; }

.sidebar .brand-icon {
  width: 38px; height: 38px;
  border-radius: 11px;
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 800; font-size: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 55%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(161, 161, 170, 0.85) 50%, rgba(255, 255, 255, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -1px 0 rgba(0, 0, 0, 0.20),
    0 6px 18px rgba(0, 0, 0, 0.45),
    0 0 22px rgba(255, 255, 255, 0.20);
  backdrop-filter: blur(8px) saturate(160%);
  -webkit-backdrop-filter: blur(8px) saturate(160%);
  flex-shrink: 0;
  transform: none;
  position: relative;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.sidebar .brand-icon::after {
  /* 顶部弧形高光 */
  content: "";
  position: absolute;
  left: 4px; right: 4px; top: 3px;
  height: 38%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.40), transparent);
  border-radius: 8px 8px 50% 50% / 8px 8px 30px 30px;
  pointer-events: none;
}
.sidebar .brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  line-height: 1.05;
  position: relative;
  padding-left: 14px;
}
.sidebar .brand-text::before {
  /* 左侧渐变发光竖条 */
  content: "";
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, #f5f5f7 0%, #a1a1aa 50%, #3f3f46 100%);
  box-shadow:
    0 0 10px rgba(0, 0, 0, 0.55),
    0 0 18px rgba(255, 255, 255, 0.30);
}
.sidebar .brand-text .bt-main {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 1px;
  background:
    linear-gradient(135deg,
      #ffffff 0%,
      #e5e7eb 35%,
      #cbd5e1 70%,
      #94a3b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.45))
          drop-shadow(0 0 14px rgba(255, 255, 255, 0.18));
  white-space: nowrap;
}
.sidebar .brand-text .bt-sub {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-weight: 600;
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.75);
  white-space: nowrap;
}

.sidebar .role-chip {
  margin: 14px 14px 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex; align-items: center; gap: 12px;
  position: relative;
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.sidebar .role-chip::before { display: none; }
.sidebar .role-chip .avatar {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700; font-size: 15px;
  color: rgba(255, 255, 255, 0.92);
  flex-shrink: 0;
  position: relative;
  /* 扁平极简：无毛玻璃、无内阴影、无外发光、无高光层 */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  text-shadow: none;
}
.sidebar .role-chip .avatar::after { content: none; }

/* 三种角色：扁平 + 半透明渐变（保留炫彩） */
.role-admin .avatar {
  background: linear-gradient(135deg,
    rgba(244, 63, 94, 0.50)   0%,
    rgba(236, 72, 153, 0.50) 55%,
    rgba(255, 255, 255, 0.50) 100%);
  border: 1px solid rgba(236, 72, 153, 0.50);
}
.role-agent .avatar {
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.50)  0%,
    rgba(255, 255, 255, 0.50) 55%,
    rgba(161, 161, 170, 0.50) 100%);
  border: 1px solid rgba(255, 255, 255, 0.50);
}
.role-store .avatar {
  background: linear-gradient(135deg,
    rgba(16, 185, 129, 0.50)  0%,
    rgba(20, 184, 166, 0.50) 55%,
    rgba(255, 255, 255, 0.50) 100%);
  border: 1px solid rgba(16, 185, 129, 0.50);
}
.sidebar .role-chip .info { flex: 1; min-width: 0; }
.sidebar .role-chip .info .nm { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.sidebar .role-chip .info .sub { font-size: 11.5px; color: var(--ink-faded); }

.sidebar .nav { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 1px; }

.sidebar .nav-group { display: flex; flex-direction: column; }
.sidebar .nav-group .nav-list {
  display: flex; flex-direction: column; gap: 2px;
  overflow: hidden;
  max-height: 800px;
  transition: max-height .22s ease, opacity .15s ease;
}
.sidebar .nav-group.collapsed .nav-list {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}
.sidebar .nav-section {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 8px 6px;
  font-size: 10.5px;
  color: var(--ink-faded);
  letter-spacing: 1.4px;
  font-weight: 700;
  border-bottom: 0;
  margin-bottom: 4px;
  position: relative;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  border-radius: 0;
  transition: color .12s ease;
  text-transform: uppercase;
}
.sidebar .nav-section:hover { color: #fff; transform: none; box-shadow: none; }
.sidebar .nav-section:active { transform: none; }
.sidebar .nav-section::before {
  content: "";
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
}
.sidebar .nav-section .ns-text { flex: 1; }
.sidebar .nav-section .ns-chevron {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-faded);
  transition: transform .2s ease;
}
.sidebar .nav-group.collapsed .nav-section .ns-chevron { transform: rotate(-90deg); }

.sidebar .nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius);
  margin: 0 2px;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
  user-select: none;
  position: relative;
  border-left: 0;
  text-decoration: none;
}
.sidebar .nav-item .icn { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.75; transition: opacity .15s ease; }
.sidebar .nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
}
.sidebar .nav-item:hover .icn { opacity: 1; }
.sidebar .nav-item.active {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.05) 60%, transparent 100%);
  color: #fff;
  font-weight: 600;
  box-shadow:
    inset 2px 0 0 0 rgba(255, 255, 255, 0.8),
    0 4px 18px rgba(0, 0, 0, 0.35);
}
.sidebar .nav-item.active .icn { opacity: 1; color: #fff; }
.sidebar .nav-item.active::after {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.55);
  margin-left: auto;
}
.sidebar .nav-item .badge {
  margin-left: auto;
  background: var(--grad-danger);
  color: #fff;
  font-size: 10px;
  padding: 1px 7px;
  height: 16px;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.55);
}

.sidebar .footer-actions {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
  display: flex; gap: 8px;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.25) 100%);
}
.sidebar .footer-actions::before { display: none; }
.sidebar .footer-actions button {
  flex: 1; font-size: 12px; padding: 7px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-weight: 500;
  letter-spacing: 0.3px;
}
.sidebar .footer-actions button:hover {
  background: rgba(244, 63, 94, 0.10);
  color: var(--neon-rose);
  border-color: rgba(244, 63, 94, 0.45);
  box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.2);
}

/* —— 主题切换按钮：紫色 hover（与退出登录的红色区分），太阳/月亮图标互斥显示 —— */
.sidebar .footer-actions button.theme-toggle:hover {
  background: rgba(168, 85, 247, 0.10);
  color: #c4b5fd;
  border-color: rgba(168, 85, 247, 0.45);
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.18);
}
/* 默认深色：只显月亮；切到浅色（is-light）：只显太阳 */
.theme-toggle .ico-theme-light { display: none; }
.theme-toggle .ico-theme-dark  { display: inline-block; }
.theme-toggle.is-light .ico-theme-light { display: inline-block; }
.theme-toggle.is-light .ico-theme-dark  { display: none; }
.theme-toggle svg { transition: transform 0.4s ease; }
.theme-toggle:hover svg { transform: rotate(-18deg) scale(1.08); }
/* 浅色主题下：按钮配色（避免黑底白字残留） */
html[data-theme="light"] .sidebar .footer-actions button {
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.12);
  color: var(--ink-soft);
}
html[data-theme="light"] .sidebar .footer-actions button:hover {
  background: rgba(244, 63, 94, 0.10);
  color: #be123c;
  border-color: rgba(244, 63, 94, 0.35);
}
html[data-theme="light"] .sidebar .footer-actions button.theme-toggle:hover {
  background: rgba(168, 85, 247, 0.10);
  color: #6d28d9;
  border-color: rgba(168, 85, 247, 0.35);
}

/* —— Topbar：玻璃顶栏 —— */
.topbar {
  grid-area: top;
  /* 极淡背景：横向青→紫赛博色调叠在半透明深色玻璃上 */
  background:
    linear-gradient(90deg,
      rgba(255, 255, 255, 0.05) 0%,
      transparent 30%,
      transparent 70%,
      rgba(255, 255, 255, 0.05) 100%),
    rgba(6, 6, 10, 0.28);
  border-bottom: 1px solid transparent;
  height: var(--top-h);
  display: flex; align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky; top: 0; z-index: 5;
}
.topbar::after {
  content: "";
  position: absolute; bottom: -1px; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.55), transparent);
  pointer-events: none;
}

.topbar .crumb {
  font-size: 13.5px;
  color: var(--ink-faded);
  display: flex; align-items: center; gap: 10px;
}
.topbar .crumb b {
  color: var(--ink);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.6px;
}
.topbar .crumb svg { color: var(--ink-dim); }

/* 面包屑链接：与 .muted 同色，hover 时升亮一档 + 加下划线提示可点 */
.topbar .crumb a.crumb-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 4px;
  margin: 0 -4px;
  transition: color .15s ease, background .15s ease;
}
.topbar .crumb a.crumb-link:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
}
html[data-theme="light"] .topbar .crumb a.crumb-link:hover {
  background: rgba(0, 0, 0, 0.05);
}

.topbar .top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.topbar .balance-chip {
  padding: 6px 14px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--seal-amber);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  display: inline-flex; align-items: center; gap: 6px;
  position: relative;
  font-variant-numeric: tabular-nums lining-nums;
  border-radius: 999px;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.15);
}
.topbar .balance-chip svg { flex-shrink: 0; }
.topbar .balance-chip #tb_balance_val { letter-spacing: 0.3px; }
.topbar .balance-chip::before { display: none; }

/* 全局门店筛选器（topbar 右侧、balance-chip 左边） */
.topbar .store-filter {
  display: inline-flex; align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  background: var(--paper-2, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  border-radius: 999px;
  color: var(--text);
  height: 32px;
  transition: border-color .15s, background .15s;
}
.topbar .store-filter.hidden { display: none; }
.topbar .store-filter:hover { border-color: var(--line-bold, rgba(255, 255, 255, 0.28)); background: var(--paper-2, rgba(255, 255, 255, 0.08)); }
.topbar .store-filter-ico {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted, #a1a1aa);
  flex-shrink: 0;
}
.topbar .store-filter-sel {
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  padding: 0 4px;
  cursor: pointer;
  outline: none;
  min-width: 100px;
  max-width: 180px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%237dd3fc' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 18px;
}
.topbar .store-filter-sel option { background: #1a1f2b; color: var(--text); }

/* editRoomModal 顶部的只读"所属门店"标签 */
.field-readonly {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  color: var(--text);
  font-size: 13.5px;
}
.field-readonly .ha-tag {
  display: inline-flex; align-items: center; gap: 5px;
  color: #7dd3fc; font-weight: 600;
}

/* —— Main ——
   页面唯一的滚动容器（html/body/shell 均 overflow:hidden）。
   scrollbar-gutter 预留槽位：切页时滚动条出现/消失不会让内容宽度跳动；
   空槽透出的是 main 自身透明底（即页面背景），不会像页面级强制滚动条
   那样在最右缘糊一条黑槽。 */
main#view {
  grid-area: main;
  padding: 28px 36px 64px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  min-width: 0;
  min-height: 0;
  /* 提升到独立合成层，让侧栏折叠动画期间 main 内部的重绘
     不再连累 sidebar / topbar / body 背景的 backdrop-filter 反复采样。 */
  transform: translateZ(0);
  isolation: isolate;
}
main#view > * { max-width: 100%; }
.view-inner {
  max-width: 1600px;
  margin: 0 auto;
}

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
  padding-bottom: 18px;
  position: relative;
}
.page-head::after {
  content: ""; position: absolute; bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--line-bold), transparent);
}
.page-head::before { display: none; }
.page-head .title {
  font-size: 26px; font-weight: 700;
  letter-spacing: 1px; color: var(--ink);
  line-height: 1.2;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.page-head .subtitle {
  font-size: 13px;
  color: var(--ink-faded);
  margin-top: 8px;
  letter-spacing: 0.2px;
}
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* —— Cards / panels：玻璃面板 —— */
.card, .panel {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: var(--radius-r);
  padding: 22px 24px;
  margin-bottom: 16px;
  position: relative;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 8px 32px rgba(0, 0, 0, 0.30);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  pointer-events: none;
}
.card::after { display: none; }
.panel::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  pointer-events: none;
}
.card.tight { padding: 14px 18px; }

.card:hover {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 12px 40px rgba(0, 0, 0, 0.40);
}

.card h2, .panel h2 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--ink);
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  position: relative;
  text-transform: uppercase;
}
.card h2::after {
  content: ""; position: absolute; bottom: -1px; left: 0; width: 56px;
  height: 1px;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.55), transparent);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.25);
}
.card h2 svg, .panel h2 svg { color: var(--ink-soft); }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; border: 0; padding: 0; }
.card-head h2::after { display: none; }

/* —— Stat Cards —— */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  padding: 18px 20px;
  position: relative;
  border-radius: var(--radius-r);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 8px 28px rgba(0, 0, 0, 0.30);
}
.stat::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--stat-color, var(--neon-cyan)), transparent);
  pointer-events: none;
}
.stat::after {
  content: "";
  position: absolute;
  right: -30px; top: -30px;
  width: 120px; height: 120px;
  background: radial-gradient(circle, var(--stat-color, var(--neon-cyan)) 0%, transparent 60%);
  opacity: 0.18;
  pointer-events: none;
  filter: blur(8px);
  border-radius: 50%;
  transform: none;
}
.stat:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 12px 40px rgba(0, 0, 0, 0.40),
    0 0 0 1px var(--stat-color, var(--neon-cyan)) inset;
}
.stat .lbl {
  font-size: 11.5px; color: var(--ink-faded);
  display: flex; align-items: center; gap: 6px;
  letter-spacing: 1.2px;
  font-weight: 600;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}
.stat .lbl svg { color: var(--stat-color, var(--neon-cyan)); filter: drop-shadow(0 0 4px var(--stat-color, var(--neon-cyan))); }
.stat .num {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  margin-top: 6px;
  letter-spacing: 0;
  color: var(--ink);
  line-height: 1.1;
  font-variant-numeric: tabular-nums lining-nums;
  position: relative;
  z-index: 1;
}
.stat .delta { font-size: 12px; color: var(--ink-faded); margin-top: 6px; position: relative; z-index: 1; }
.stat .delta.up { color: var(--neon-lime); }
.stat .delta.dn { color: var(--neon-rose); }

.stat.cyan   { --stat-color: var(--neon-cyan); }
.stat.green  { --stat-color: var(--neon-lime); }
.stat.purple { --stat-color: var(--neon-purple); }
.stat.pink   { --stat-color: var(--neon-pink); }
.stat.amber  { --stat-color: var(--seal-amber); }
.stat.rose   { --stat-color: var(--neon-rose); }

/* —— Tables —— */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
th, td {
  padding: 12px 14px;
  text-align: left;
  font-size: 13.5px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  white-space: nowrap;
}
td.wrap, td .wrap { white-space: normal; }
th {
  background: rgba(255, 255, 255, 0.04);
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 11.5px;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--line-bold);
  text-transform: uppercase;
}
td b { color: var(--ink); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s ease; }
tbody tr:nth-child(odd) { background: transparent; }
tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.018); }
tbody tr:hover { background: rgba(255, 255, 255, 0.06); }
td .row { gap: 6px; }
td a { font-weight: 500; }
.tbl-empty { padding: 50px; text-align: center; color: var(--ink-faded); }

.card { overflow-x: auto; }
.tbl-wrap { width: 100%; overflow-x: auto; margin-top: 8px; border-radius: var(--radius); }
.tbl-wrap > table { width: 100%; }
.expire-cell { white-space: nowrap; }

.tbl-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.tbl-toolbar input { max-width: 280px; }
.tbl-toolbar select { width: auto; min-width: 130px; }

/* ===========================================================
   Login Page · Split Glass
   左：品牌叙事 · 右：表单
   =========================================================== */
.login {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  /* 透明：让全局 .cyber-bg（极光 + 涂鸦 + 扫描线）显示在登录页背后 */
  background: transparent;
  z-index: 50;
  overflow: hidden;
  padding: 24px;
}
/* 极细网格 */
.login::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 30%, transparent 92%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 30%, transparent 92%);
  pointer-events: none;
}

/* ===========================================================
   Global Cyber-Graffiti Backdrop · 全站赛博涂鸦背景
   极光 + 涂鸦 SVG + VHS 扫描线，位于所有页面之下
   =========================================================== */
.cyber-bg {
  position: fixed; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  /* 独立 GPU 合成层：避免主内容切换/重排时整层重绘，消除导航点击时的肉眼抖动 */
  transform: translateZ(0);
  will-change: transform;
  contain: layout style paint;
  backface-visibility: hidden;
}
.cyber-bg .aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.48;
  mix-blend-mode: screen;
}
.cyber-bg .aurora-a {
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.85) 0%, transparent 65%);
  top: -170px; left: -170px;
  animation: aurora-a 22s ease-in-out infinite;
}
.cyber-bg .aurora-b {
  width: 640px; height: 640px;
  background: radial-gradient(circle, rgba(180, 180, 190, 0.7) 0%, transparent 65%);
  bottom: -220px; right: -200px;
  opacity: 0.36;
  animation: aurora-b 26s ease-in-out infinite;
}
.cyber-bg .aurora-c {
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(220, 220, 230, 0.6) 0%, transparent 65%);
  top: 30%; right: -120px;
  opacity: 0.28;
  animation: aurora-c 30s ease-in-out infinite;
}
@keyframes aurora-a {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(40px, 30px); }
}
@keyframes aurora-b {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(-50px, -40px); }
}
@keyframes aurora-c {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(30px, -50px); }
}

/* —— 赛博涂鸦 SVG 图层（全局，淡化以保证内容可读） —— */
.cyber-bg .graffiti-layer {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  opacity: 0.55;
  mix-blend-mode: screen;
  /* 把涂鸦 SVG 中的彩色变成银灰色（保留形状/动效，去蓝紫调） */
  filter: grayscale(1) brightness(0.85) drop-shadow(0 0 14px rgba(255, 255, 255, 0.18));
  transition: opacity .35s ease;
}
.cyber-bg .aurora,
.cyber-bg .scanlines {
  transition: opacity .35s ease;
}
/* 登录页时增强涂鸦的视觉强度（仅当 #login 未隐藏时） */
body:has(#login:not(.hidden)) .cyber-bg .graffiti-layer { opacity: 0.88; }
body:has(#login:not(.hidden)) .cyber-bg .aurora { opacity: 0.55; }
body:has(#login:not(.hidden)) .cyber-bg .aurora-b { opacity: 0.42; }
body:has(#login:not(.hidden)) .cyber-bg .aurora-c { opacity: 0.32; }
body:has(#login:not(.hidden)) .cyber-bg .scanlines { opacity: 0.55; }

.cyber-bg .graffiti-layer .g-pulse {
  transform-box: fill-box;
  transform-origin: center;
  animation: graf-pulse 6s ease-in-out infinite;
}
.cyber-bg .graffiti-layer .g-pulse-delay {
  transform-box: fill-box;
  transform-origin: center;
  animation: graf-pulse 7.5s ease-in-out -2s infinite;
}
.cyber-bg .graffiti-layer .g-drift {
  animation: graf-drift 14s ease-in-out infinite;
}
.cyber-bg .graffiti-layer .g-drift-slow {
  animation: graf-drift 22s ease-in-out infinite;
}
@keyframes graf-pulse {
  0%, 100% { opacity: 1;    filter: none; }
  50%      { opacity: 0.55; filter: drop-shadow(0 0 18px currentColor); }
}
@keyframes graf-drift {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(14px, -10px); }
}

/* —— VHS 扫描线覆盖（全局，淡化） —— */
.cyber-bg .scanlines {
  position: absolute; inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.025) 0px,
    rgba(255, 255, 255, 0.025) 1px,
    transparent 1px,
    transparent 4px
  );
  mix-blend-mode: overlay;
  opacity: 0.30;
}

/* —— 双栏面板 —— */
.login-panel {
  position: relative; z-index: 1;
  width: 880px; max-width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(10, 10, 14, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 18px;
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 32px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.login-panel::before {
  /* 极细顶光线 */
  content: "";
  position: absolute; top: 0; left: 24px; right: 24px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  pointer-events: none;
}

/* —— 左栏：SVG 智能管家星球 + 品牌标题 —— */
.login-info {
  padding: 20px 20px 4px;
  display: flex; flex-direction: column;
  justify-content: center;
  align-items: center;
  background:
    radial-gradient(460px 300px at 30% 32%, rgba(255, 255, 255, 0.18), transparent 70%),
    radial-gradient(420px 260px at 100% 100%, rgba(236, 72, 153, 0.18), transparent 70%),
    radial-gradient(300px 220px at 50% 50%, rgba(255, 255, 255, 0.12), transparent 75%);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
  min-height: 480px;
}
/* 左侧栏：极细赛博网格背景 */
.login-info::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 72, 153, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 30%, transparent 95%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 30%, transparent 95%);
  pointer-events: none;
  z-index: 0;
}
.mascots {
  width: 100%;
  max-width: 340px;
  height: auto;
  max-height: 360px;
  display: block;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.45));
  animation: mascots-idle 7s ease-in-out infinite;
}
.mascot {
  transform-origin: 50% 95%;
  will-change: transform;
}
.mascot .body {
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.35));
}
@keyframes mascots-idle {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}

/* —— 品牌标题（SVG 下方） —— */
.brand-title {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 8px 16px 22px;
}
.brand-title h2 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 3px;
  line-height: 1.2;
  background: linear-gradient(135deg, #ffffff 0%, #d4d4d8 50%, #71717a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 12px rgba(255, 255, 255, 0.30));
}
.brand-title p {
  margin: 8px 0 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 6px;
  color: var(--ink-faded);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand-title p::before,
.brand-title p::after {
  content: "";
  width: 18px;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.35), transparent);
}

/* —— 右栏：表单 —— */
.login-form {
  padding: 36px 42px 36px;
  display: flex; flex-direction: column;
  justify-content: center;
}
.lf-head { margin-bottom: 22px; }
.lf-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: transparent;
  background: linear-gradient(135deg, #ffffff 0%, #a1a1aa 60%, #3f3f46 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 14px;
  position: relative;
}
.lf-brand::before,
.lf-brand::after {
  content: "";
  flex: 1;
  height: 2px;
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.30);
}
.lf-brand::before {
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.6) 30%, rgba(255, 255, 255, 0.8));
}
.lf-brand::after {
  background: linear-gradient(to right, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.4) 70%, transparent);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.30);
}
.lf-head h1 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #fff;
  line-height: 1.2;
}
.lf-head p {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--ink-faded);
  letter-spacing: 0.2px;
}

/* —— 输入字段 —— */
.login-field {
  position: relative;
  margin-bottom: 12px;
  display: flex; align-items: stretch;
}
.login-field .lf-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-dim);
  pointer-events: none;
  display: flex;
  transition: color .15s ease;
  z-index: 1;
}
.login-field input {
  flex: 1;
  padding: 11px 14px 11px 40px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--ink);
  font-size: 13.5px;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.login-field input:focus {
  border-color: rgba(255, 255, 255, 0.50);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}
.login-field:focus-within .lf-icon { color: var(--neon-cyan); }

/* 密码显隐按钮 */
.lf-toggle {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--ink-dim);
  border-radius: 6px;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: none;
  transition: color .15s ease, background .15s ease;
}
.lf-toggle:hover {
  color: var(--neon-cyan);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-50%);
  box-shadow: none;
}
.lf-toggle .ico-eye-off { display: none; }
.lf-toggle.on .ico-eye   { display: none; }
.lf-toggle.on .ico-eye-off { display: block; }

/* —— 验证码字段 —— */
.captcha-field { margin-bottom: 8px; }
.captcha-field input {
  padding-right: 142px;
  font-family: var(--font-mono);
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 600;
}
.captcha-box {
  position: absolute;
  right: 4px; top: 50%;
  transform: translateY(-50%);
  width: 124px; height: 36px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: none;
  overflow: hidden;
  transition: filter .15s ease, opacity .15s ease;
  display: grid; place-items: center;
}
.captcha-box:hover {
  background: transparent;
  transform: translateY(-50%);
  filter: brightness(1.15) saturate(1.15);
}
.captcha-box.loading { pointer-events: none; }
.captcha-box svg { width: 100%; height: 100%; display: block; }
.captcha-box .captcha-loading {
  font-size: 10.5px;
  color: var(--ink-faded);
  letter-spacing: 1px;
  font-family: var(--font-mono);
}

/* —— 登录按钮：黑色玻璃质感 + 银白高光 —— */
.login-submit {
  margin-top: 18px;
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 6px;
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0) 55%),
    linear-gradient(135deg, #2a2a30 0%, #1a1a1d 50%, #050505 100%);
  background-size: 200% 200%, 220% 220%;
  background-position: 0% 0%, 0% 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.32),
    0 10px 28px rgba(0, 0, 0, 0.55),
    0 0 36px rgba(255, 255, 255, 0.10);
  justify-content: center;
  position: relative;
  transition: transform .15s ease, box-shadow .18s ease, filter .15s ease, opacity .15s ease, background-position .9s ease;
  overflow: hidden;
}
/* 扫光高光（hover 时滑过） */
.login-submit::before {
  content: "";
  position: absolute;
  top: 0; left: -40%;
  width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.30) 50%, transparent 100%);
  transform: skewX(-18deg);
  pointer-events: none;
  transition: left .7s cubic-bezier(.4,0,.2,1);
}
.login-submit:hover {
  transform: translateY(-1px);
  filter: brightness(1.18);
  background-position: 100% 100%, 100% 50%;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.40),
    inset 0 -1px 0 rgba(0, 0, 0, 0.32),
    0 14px 36px rgba(0, 0, 0, 0.65),
    0 0 50px rgba(255, 255, 255, 0.18);
}
.login-submit:hover::before { left: 130%; }
.login-submit:active { transform: translateY(0); filter: brightness(1.02); }
.login-submit:disabled { opacity: 0.6; cursor: progress; transform: none; filter: none; }

.login-submit .ls-text,
.login-submit .ls-spinner { position: relative; z-index: 1; }
.login-submit .ls-spinner {
  display: none;
  width: 15px; height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.30);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.login-submit.loading .ls-text { display: none; }
.login-submit.loading .ls-spinner { display: inline-block; }

/* —— 错误提示 + Hint —— */
.login-form .err {
  color: var(--neon-rose);
  min-height: 16px;
  font-size: 12.5px;
  margin-top: 10px;
  text-align: center;
  letter-spacing: 0.2px;
}

/* —— 登录页脚：版本号 + ICP 备案号（上下两行排列） —— */
.login-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed rgba(255, 255, 255, 0.10);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.4px;
  color: var(--ink-faded);
  text-align: center;
}
.login-footer .lf-version { white-space: nowrap; }
.login-footer .lf-sep { display: none; }   /* 上下排列时不再需要分隔符 */
.login-footer .lf-beian {
  color: var(--ink-faded);
  text-decoration: none;
  transition: color .15s ease, text-shadow .15s ease;
  white-space: nowrap;
}
.login-footer .lf-beian:hover {
  color: #ffffff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.45);
}
.login-footer .lf-beian:focus-visible {
  outline: 1px dashed rgba(255, 255, 255, 0.45);
  outline-offset: 3px;
  border-radius: 3px;
}
.login-form .err:not(:empty) {
  padding: 7px 12px;
  background: rgba(244, 63, 94, 0.06);
  border: 1px solid rgba(244, 63, 94, 0.20);
  border-radius: 8px;
  animation: err-shake .42s cubic-bezier(.36, .07, .19, .97);
}
@keyframes err-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
/* —— 窄屏：隐藏左侧角色组，只显示表单 —— */
@media (max-width: 760px) {
  .login-panel {
    grid-template-columns: 1fr;
    width: 420px;
  }
  .login-info { display: none; }
  .login-form { padding: 40px 36px 34px; }
}
@media (max-width: 460px) {
  .login { padding: 12px; }
  .login-form { padding: 28px 22px 22px; }
}

/* —— Modal：浮空玻璃 —— */
.modal { position: fixed; inset: 0; z-index: 99; display: grid; place-items: center; padding: 20px; }
.modal-bg {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
}
.modal-box {
  position: relative;
  width: 580px; max-width: 100%; max-height: 88vh;
  display: flex; flex-direction: column;
  background: rgba(10, 10, 14, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 30px 80px rgba(0, 0, 0, 0.60),
    0 0 60px rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.modal-box::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.6), transparent);
  pointer-events: none;
}
.modal-box.wide { width: 760px; }
.modal-box.x-wide { width: 960px; }
/* 门店视图子窗口：取消暗淡全屏遮挡（不挡取色/看地图），点击穿透到背后画布，仅弹窗本体可交互 */
.modal.modal-dimless { pointer-events: none; }
.modal.modal-dimless .modal-bg { display: none; }
.modal.modal-dimless .modal-box { pointer-events: auto; }
.modal-head {
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  position: relative;
  color: var(--ink);
}
.modal-head::after { display: none; }
.modal-head button { font-size: 22px; line-height: 1; padding: 4px 10px; border-radius: 8px; }
.modal-body { padding: 22px 24px; overflow: auto; flex: 1; }
.modal-foot {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  display: flex; gap: 10px; justify-content: flex-end;
  background: rgba(0, 0, 0, 0.20);
}

/* —— Toast：浮窗 —— */
.toast {
  position: fixed;
  bottom: 30px; left: 50%; transform: translateX(-50%);
  padding: 12px 22px;
  background: rgba(20, 24, 51, 0.80);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 999px;
  z-index: 200;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 12px 40px rgba(0, 0, 0, 0.55),
    0 0 32px rgba(255, 255, 255, 0.20);
  animation: toast-in .25s cubic-bezier(.4,0,.2,1);
  display: flex; align-items: center; gap: 8px;
  letter-spacing: 0.3px;
}
.toast.err  { border-color: rgba(244, 63, 94, 0.45); color: var(--neon-rose); box-shadow: 0 0 0 1px rgba(244,63,94,0.15) inset, 0 12px 40px rgba(244,63,94,0.25), 0 0 32px rgba(244,63,94,0.30); }
.toast.ok   { border-color: rgba(132, 204, 22, 0.45); color: var(--neon-lime); box-shadow: 0 0 0 1px rgba(132,204,22,0.15) inset, 0 12px 40px rgba(132,204,22,0.25), 0 0 32px rgba(132,204,22,0.30); }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* —— HA grid / Device cards —— */
.ha-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.ha-card {
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  position: relative;
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  transition: all .18s ease;
  overflow: hidden;
}
.ha-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.16), transparent);
  pointer-events: none;
}
.ha-card:hover {
  border-color: rgba(255, 255, 255, 0.32);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.40), 0 0 0 1px rgba(255, 255, 255, 0.2);
}
.ha-card .name {
  font-family: var(--font-ui);
  font-weight: 700; font-size: 15px;
  letter-spacing: 0.3px;
  color: var(--ink);
}
.ha-card .target {
  font-size: 12px; color: var(--ink-faded);
  font-family: var(--font-mono);
  margin-top: 4px;
}

.ha-row {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  margin-bottom: 8px;
  border-radius: var(--radius);
  flex-wrap: wrap;
  backdrop-filter: blur(8px);
}
.ha-row input { flex: 1; }

/* —— Devices —— */
.devices-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.area-section { margin-bottom: 28px; }
.area-section .area-title {
  font-size: 14px; font-weight: 700;
  color: var(--ink);
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px;
  padding: 0 0 8px;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--line);
  text-transform: uppercase;
}
.area-section .area-title::before {
  content: "";
  width: 3px; height: 14px;
  background: var(--grad-primary);
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}
.area-section .area-title::after {
  content: ""; flex: 1; height: 1px;
  background-image: linear-gradient(to right, var(--line-bold), transparent);
}
.area-section .area-title .count {
  color: var(--ink-faded); font-weight: 400;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0;
}

.dev-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
/* 大店性能（2026-07 网鱼中山路 6000+ 实体复盘）：
   ⚠ 不要用 content-visibility:auto——几千张高度不一的卡在同一个 grid 里时，
   离屏卡片按 contain-intrinsic-size 估高参与行高计算，滚动/重进页面时
   "解锁真实高度→行高变→视口内容移位→重新估算"来回抖动，Chrome 会陷入
   长时间布局收敛（表现＝页面卡死很久、下方卡片一片空白像"设备变少"）。
   改用安全的 contain:content：只隔离卡片内部的布局/绘制影响面，不做尺寸估算，
   无任何视觉副作用。 */
.dev-list .dev {
  contain: content;
}
/* 千卡级列表的绘制减负（JS 侧在卡片数 >500 时给容器挂 .dev-perf）：
   每张卡一个 backdrop-filter: blur(10px) 是合成器灾难——滚动时几百个可见
   模糊层逐帧重采样背景；transition:all 又让任何 class 翻转都触发全属性过渡。
   大店直接砍掉毛玻璃、收窄过渡属性；几十张卡的小店不受影响。 */
.dev-perf .dev {
  backdrop-filter: none;
  transition: border-color .15s ease, background-color .15s ease;
}
.dev {
  position: relative;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all .15s ease;
  backdrop-filter: blur(10px);
  overflow: hidden;
}
.dev::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.14), transparent);
  pointer-events: none;
}
.dev:hover { border-color: rgba(255, 255, 255, 0.2); box-shadow: 0 6px 20px rgba(0,0,0,0.35); transform: translateY(-1px); }
.dev.on {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.06));
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), 0 0 30px rgba(255, 255, 255, 0.15);
}
.dev .dev-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.dev .dev-name {
  font-family: var(--font-ui);
  font-weight: 600; font-size: 14.5px; line-height: 1.3;
  color: var(--ink);
}
.dev .dev-id {
  font-size: 11px; color: var(--ink-dim);
  font-family: var(--font-mono);
  margin-top: 4px; word-break: break-all;
}
.dev .dev-state {
  font-size: 13px;
  color: var(--neon-cyan);
  margin-top: 8px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.dev .dev-domain {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 700;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink-faded);
  border: 1px solid var(--line);
  letter-spacing: 0.6px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  text-transform: uppercase;
  border-radius: 999px;
}
.dev .dev-actions { display: flex; gap: 6px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.dev .dev-actions input[type=range] { flex: 1; }

/* —— Range / slider —— */
input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  padding: 0;
  border: 0;
  height: 20px;
  cursor: pointer;
}
input[type=range]::-webkit-slider-runnable-track {
  background: linear-gradient(to right, #71717a, #1c1c20);
  border: 0;
  height: 4px;
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.45);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  margin-top: -6px;
  border: 0;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.6),
    0 0 14px rgba(255, 255, 255, 0.18);
  cursor: pointer;
}

/* —— Chips —— */
.chip-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px;
}
.chip {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  transition: all .15s ease;
  display: flex; align-items: center; gap: 8px; justify-content: center;
  color: var(--ink-soft);
  letter-spacing: 0.3px;
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
}
.chip:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.45);
  color: var(--neon-cyan);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.20);
}
.chip svg { width: 14px; height: 14px; }

/* —— Loading —— */
.loading {
  padding: 40px; text-align: center; color: var(--ink-faded);
  font-size: 13.5px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  letter-spacing: 0.4px;
}
.loading::before {
  content: "";
  width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.10);
  border-top-color: var(--neon-cyan);
  border-right-color: var(--neon-purple);
  border-radius: 50%;
  animation: spin 1s cubic-bezier(.5,.1,.5,.9) infinite;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.5));
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 操作日志：刷新过渡（避免闪烁/重建）============ */
.logs-wrap {
  position: relative;
  min-height: 120px;
  /* 表格列宽固定，详情列至少 260px；窄屏允许横向滚动而不是挤变形 */
  overflow-x: auto;
  /* 强容器化 + 独立合成层：侧栏折叠 250ms 动画期间，表格内 50 行
     文本因 table-layout:fixed 自动列宽变化会触发大量回流，必须把
     重排 / 重绘 / 合成都圈在 .logs-wrap 内部，不要外溢到整页。 */
  contain: layout paint style;
  transform: translateZ(0);
  isolation: isolate;
}
.logs-wrap > table.logs-table {
  table-layout: fixed;
  min-width: 888px;
}
/* 宽表（列特别多，如 OSS 流量统计 16 列）：888px 保底会把所有列挤扁且永远不触发
   .logs-wrap 的横向滚动条 → 用更大的保底宽度让容器自然出横向滚动。
   每张表可用 style="--tbl-minw:1450px" 按自己的列数微调。 */
.logs-wrap > table.logs-table.logs-table-wide {
  min-width: var(--tbl-minw, 1280px);
}
.logs-wrap > table.logs-table td {
  vertical-align: top;
  /* 防止 tag/JSON 等长字符串横向溢出到下一列 */
  overflow: hidden;
}
.logs-wrap > table.logs-table td.wrap {
  word-break: break-word;
  line-height: 1.55;
}
/* 表格内的 tag 标签：稍小字号 + 更高对比，符合密集表格阅读 */
.logs-wrap .tag {
  font-size: 12px;
  letter-spacing: 0;
  padding: 2px 8px;
  /* 单元格列宽固定，tag 内文字若过长则裁剪显示而不撑破列 */
  max-width: 100%;
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.logs-wrap .tag-plain {
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}
.logs-wrap .tag-info {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.55);
}
.logs-wrap .tag-active, .logs-wrap .tag-online {
  background: rgba(132, 204, 22, 0.14);
  border-color: rgba(132, 204, 22, 0.55);
}
.logs-wrap .tag-expired, .logs-wrap .tag-offline {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.55);
}
.logs-wrap.is-refreshing { pointer-events: none; }
.logs-wrap.is-refreshing > table,
.logs-wrap.is-refreshing > .pager {
  opacity: 0.55;
  transition: opacity .15s ease;
}
.logs-wrap.is-refreshing::after {
  content: "";
  position: absolute;
  top: 16px; right: 16px;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: var(--neon-cyan);
  animation: spin .8s linear infinite;
  z-index: 5;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.35);
}

/* —— Empty state —— */
.empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--ink-faded);
}
.empty .icon {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  color: var(--ink-dim);
  opacity: 0.7;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.20));
}
.empty .empty-title {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.empty .empty-msg { font-size: 13px; color: var(--ink-faded); }
.empty button { margin-top: 16px; }

/* Sparkline */
.spark { width: 100%; height: 60px; }

/* Expire cell */
.expire-cell {
  display: inline-flex; flex-direction: row; gap: 8px;
  line-height: 1.35; align-items: center; white-space: nowrap;
}
.expire-cell > div { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink); }
.expire-cell .tag { font-size: 10px; padding: 2px 8px; white-space: nowrap; }

/* —— 门店列表里展开的 HA 子行（按 HA 计费/到期）—— */
tr.ha-subrow > td { background: var(--surface-2, rgba(127,127,127,0.04)); font-size: 12.5px; padding-top: 6px; padding-bottom: 6px; }
tr.ha-subrow:hover > td { background: var(--surface-3, rgba(127,127,127,0.08)); }

/* 门店分组表（主行 + 其下 HA 子行）：关掉全局斑马纹。
   隐藏的 HA 子行（display:none）仍被 :nth-child 计数，各门店子行数量不同会把
   后续可见主行的奇偶推乱 → 背景深浅参差不齐。这里统一让主行透明，分组靠子行浅底色体现。 */
table.ha-grouped tbody tr:nth-child(odd),
table.ha-grouped tbody tr:nth-child(even) { background: transparent; }
table.ha-grouped tbody tr:hover { background: rgba(255, 255, 255, 0.06); }
html[data-theme="light"] table.ha-grouped tbody tr:nth-child(odd),
html[data-theme="light"] table.ha-grouped tbody tr:nth-child(even) { background: transparent; }
html[data-theme="light"] table.ha-grouped tbody tr:hover { background: rgba(0, 0, 0, 0.05); }

/* —— Range chips —— */
.range-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip-btn {
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  cursor: pointer;
  letter-spacing: 0.2px;
  border-radius: 999px;
  /* 显式列出过渡属性，刻意不包含 backdrop-filter ——
     侧栏折叠动画收尾解除 .is-sidebar-toggling 时，避免毛玻璃从 none
     回到 blur(8px) 的 150ms 插值在 16 颗 chip 上同时播放，导致整页"刷新感"。 */
  transition: background .15s ease, border-color .15s ease, color .15s ease,
              box-shadow .15s ease, transform .15s ease, font-weight .15s ease;
  font-family: inherit;
  line-height: 1.3;
  box-shadow: none;
  backdrop-filter: blur(8px);
}
.chip-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.40);
  color: #fff;
  transform: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.chip-btn.active {
  background: var(--grad-primary);
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
  font-weight: 600;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.14) inset;
}
.chip-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* —— BarChart —— */
.barchart-wrap { width: 100%; }
.barchart { width: 100%; height: auto; display: block; }
.barchart-legend {
  display: flex; gap: 18px; flex-wrap: wrap;
  justify-content: center; padding: 8px 0 2px;
  font-size: 12px; color: var(--ink-soft);
}
.barchart-legend .legend-item {
  display: inline-flex; align-items: center; gap: 6px;
}
.barchart-legend .legend-item i {
  display: inline-block; width: 12px; height: 12px;
  border-radius: 3px; margin: 0;
}

/* —— KPI cards —— */
.kpi-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.kpi {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  padding: 16px 18px;
  border-radius: var(--radius-r);
  position: relative;
  backdrop-filter: blur(12px);
  overflow: hidden;
  transition: all .18s ease;
}
.kpi::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.14), transparent);
}
.kpi:hover {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.40);
}
.kpi .lbl {
  font-size: 11px; color: var(--ink-faded); margin-bottom: 8px;
  letter-spacing: 1.2px; text-transform: uppercase; font-weight: 600;
}
.kpi .val { font-size: 22px; font-weight: 700; font-family: var(--font-display); letter-spacing: 0.4px; }
.kpi .sub { font-size: 11.5px; color: var(--ink-faded); margin-top: 4px; }
.kpi.in  .val { background: var(--grad-success); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.kpi.out .val { background: var(--grad-danger); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.kpi.net .val { background: var(--grad-warn); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.kpi.fee .val { color: var(--ink); }

/* —— Custom date —— */
.range-custom {
  display: inline-flex; gap: 8px; align-items: center;
  padding: 0 4px;
}
.range-custom .chip-date {
  padding: 5px 11px;
  font-size: 12.5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 999px;
  font-family: inherit;
  width: auto; min-width: 140px; max-width: 180px;
}
.range-custom .chip-date:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

/* —— Pager —— */
.pager {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  padding: 14px 4px 4px;
  margin-top: 10px;
  border-top: 1px dashed var(--line);
}
.pager-meta {
  font-size: 12.5px; color: var(--ink-faded);
  font-variant-numeric: tabular-nums;
}
.pager-grp { display: flex; gap: 4px; align-items: center; }
.pager-grp .chip-btn { min-width: 30px; padding: 4px 10px; font-size: 12.5px; }
.pager-size {
  width: auto; min-width: 110px;
  padding: 5px 11px; font-size: 12.5px;
  margin-left: auto;
}

/* —— Filter bar —— */
.filter-bar {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}

/* —— Toggle switch（用于"启用自动清理"等开关） —— */
.switch-wrap input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 42px;
  height: 22px;
  flex: 0 0 42px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.switch-wrap input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
  transition: transform .18s ease, background .18s ease;
}
.switch-wrap input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #2a2a30, #050505);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.10),
    0 0 14px rgba(0, 0, 0, 0.55);
}
.switch-wrap input[type="checkbox"]:checked::after {
  transform: translateX(20px);
}
.switch-wrap input[type="checkbox"]:focus {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.14),
    0 0 14px rgba(0, 0, 0, 0.55);
}
.filter-bar .filter-group {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}
.filter-bar .filter-label {
  font-size: 11px;
  color: var(--ink-faded);
  letter-spacing: 1px;
  margin-right: 4px;
  text-transform: uppercase;
  font-weight: 600;
}
.filter-bar input[type=search],
.filter-bar input[type=text] { width: auto; min-width: 200px; max-width: 280px; }
.filter-bar select { width: auto; min-width: 120px; }

/* —— 中窄屏（平板 / 集成接口 iframe 内嵌第三方 UI）——
   此档侧栏默认自动折叠成图标栏（app.js _sideCollapsed），这里同步收紧
   内容区留白 / 标题字号 / 筛选栏密度，让中等尺寸 iframe 里不显局促。
   注意保持在 600px 块之前：≤600 的更紧凑值要能覆盖本块。 */
@media (max-width: 1024px) {
  main#view { padding: 20px 20px 56px; }
  #view_as_host { padding: 12px 20px 0 20px; }
  #view_as_host:empty { padding: 0; }
  .topbar { padding: 0 18px; }
  .page-head { margin-bottom: 18px; padding-bottom: 14px; }
  .page-head .title { font-size: 23px; }
  .filter-bar { gap: 10px; }
  .filter-bar input[type=search],
  .filter-bar input[type=text] { min-width: 140px; }
  /* 卡片网格：最小列宽放宽一档，900px 上下的 iframe 也能排两列 */
  .room-pro-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .dpanel-grid   { grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); }
}

/* —— Mobile —— */
@media (max-width: 600px) {
  main#view { padding: 16px 14px 40px; }
  #view_as_host { padding: 10px 14px 0 14px; }
  #view_as_host:empty { padding: 0; }
  .topbar { padding: 0 16px; gap: 10px; }
  .page-head .title { font-size: 22px; }
  .topbar .crumb b { font-size: 16px; }
  /* 代客查看子导航在窄屏滚动而非换行，避免一屏占满 */
  .view-as-tabs { flex-wrap: nowrap; overflow-x: auto; }
  .view-as-tab  { flex: 0 0 auto; }
}

/* —— Misc —— */
.kbd {
  display: inline-block;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-soft);
  letter-spacing: 0.5px;
}
.copy-input {
  display: flex; gap: 0; align-items: stretch;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(8px);
}
.copy-input input {
  flex: 1; border: 0; background: transparent;
  font-family: var(--font-mono);
  font-size: 13px;
  border-radius: 0;
}
.copy-input input:focus { box-shadow: none; background: transparent; }
.copy-input button {
  border: 0; border-left: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
  padding: 8px 16px;
}
.copy-input button:hover { background: rgba(255, 255, 255, 0.08); }

iframe.full {
  width: 100%; height: calc(100vh - 110px);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius);
}

.warn { color: var(--seal-amber); }
.err  { color: var(--neon-rose); min-height: 18px; font-size: 13px; }
.ok   { color: var(--neon-lime); }

/* —— Letterpress / decor 旧规则覆盖 —— */
.stat .num,
.kpi  .val,
.balance-chip,
.page-head .title {
  text-shadow: none;
}

/* —— Ornament divider —— */
.ornament-divider {
  display: flex; align-items: center; gap: 14px;
  color: var(--ink-faded);
  font-size: 12.5px;
  text-align: center;
  margin: 22px auto;
}
.ornament-divider::before,
.ornament-divider::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(to right, transparent, var(--line-bold) 30%, var(--line-bold) 70%, transparent);
}

/* —— 修：旧版 :has 表格 overflow 规则保留 ——
   注意：当卡片内部已经有显式 .logs-wrap / .tbl-wrap 作为滚动容器时，
   不要再给卡片本身加 overflow-x:auto，避免嵌套滚动容器在侧栏折叠动画
   期间反复争抢，引起整页闪烁。 */
.card { overflow: visible; }
.card:has(> table),
.card:has(> .tbl-wrap) { overflow-x: auto; }
.card:has(thead):not(:has(.logs-wrap)):not(:has(.tbl-wrap)) { overflow-x: auto; }

/* —— 微动画：登录卡 / modal 入场 —— */
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 24px rgba(255, 255, 255, 0.25); }
  50%      { box-shadow: 0 0 36px rgba(255, 255, 255, 0.50); }
}
@keyframes float-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.login-panel { animation: float-in .4s cubic-bezier(.4,0,.2,1); }
.modal-box   { animation: float-in .25s cubic-bezier(.4,0,.2,1); }
.card, .stat, .kpi { animation: float-in .3s cubic-bezier(.4,0,.2,1); }

/* —— 提升 stat 中数字的渐变文字（部分有 amber 类的金额数字） —— */
.stat.amber .num,
.stat.rose  .num {
  background: linear-gradient(135deg, var(--stat-color, var(--neon-cyan)) 0%, #fff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* —— Wax seal（兼容旧 .wax-seal 类，作为登录页装饰隐藏） —— */
.wax-seal { display: none; }

/* ============================================================
   性能优化分区（GPU 降负载）
   策略：登录页保持炫酷视觉；登录后（#shell 显示）大幅瘦身。
   - 登录后整张 #cyber-bg + body 装饰层全部隐藏 → 不再合成/动画
   - 削减满屏 backdrop-filter，仅保留 sidebar/topbar/modal-box/login-panel
   - 极光层降低 blur 半径、去掉 mix-blend-mode（最贵的合成成本）
   - 不再用 background-attachment: fixed（滚动时整屏重绘）
   - 尊重 prefers-reduced-motion：彻底关掉所有循环动画
   ============================================================ */

/* —— 1. 登录后隐藏全部装饰层（最大单笔收益） —— */
body:has(#shell:not(.hidden)) #cyber-bg,
body:has(#shell:not(.hidden))::before,
body:has(#shell:not(.hidden))::after {
  display: none !important;
}
/* 登录后页面背景退化为纯色（去掉多层径向渐变 + fixed attachment） */
body:has(#shell:not(.hidden)) {
  background-image: none;
  background-attachment: scroll;
  background: var(--paper-1);
}

/* —— 2. 极光层减负：blur 90→40、不再 mix-blend、整体降透明 —— */
.cyber-bg .aurora {
  filter: blur(40px);
  mix-blend-mode: normal;
  opacity: 0.28;
}
.cyber-bg .aurora-b { opacity: 0.22; }
.cyber-bg .aurora-c { opacity: 0.18; }

/* 涂鸦层 / 扫描线：去掉 mix-blend-mode（全屏混色合成极贵） */
.cyber-bg .graffiti-layer { mix-blend-mode: normal; opacity: 0.40; }
.cyber-bg .scanlines      { mix-blend-mode: normal; opacity: 0.18; }

/* —— 3. 削减 backdrop-filter ——
   仅保留以下大块玻璃面板的模糊（视觉差别最明显）：
     .sidebar / .topbar / .modal-box / .login-panel / .modal-bg
   其余所有元素一律取消 backdrop-filter，避免每一帧反复采样背景。 */
.card, .panel, .stat, .kpi,
.ha-card, .ha-row, .dev,
.chip, .chip-btn, .chip-date, .range-custom .chip-date,
.copy-input, .balance-chip, .brand-icon, .role-chip,
.footer-actions, .login-submit,
button, .btn,
input, select, textarea,
.toast {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
/* modal 遮罩仅做半透黑遮挡，不再 blur 整屏 */
.modal-bg {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(0, 0, 0, 0.62);
}

/* —— 4. 主面板（仍保留 blur 的几处）适度降低半径 —— */
.sidebar, .topbar {
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
}
.modal-box {
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
}
.login-panel {
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
}

/* —— 5. 减少滚动时整屏重绘 —— */
html, body { background-attachment: scroll; }

/* —— 6. 用户开启「减少动态效果」时只关装饰动画 ——
   注意：不要用 `* { animation-duration: 0s }`，这会把
   spinner (`spin`)、toast 入场 (`toast-in`)、错误抖动 (`err-shake`)
   这些有功能意义的反馈一起干掉。 */
@media (prefers-reduced-motion: reduce) {
  .cyber-bg .aurora,
  .cyber-bg .graffiti-layer .g-pulse,
  .cyber-bg .graffiti-layer .g-pulse-delay,
  .cyber-bg .graffiti-layer .g-drift,
  .cyber-bg .graffiti-layer .g-drift-slow,
  .mascots,
  .login-panel,
  .modal-box,
  .card, .stat, .kpi { animation: none !important; }
}

/* —— 7. 让 cyber-bg 真正成为独立层（已在原规则中声明），
       再加 content-visibility 让滚动屏外时跳过渲染 —— */
.cyber-bg { content-visibility: auto; }

/* ============================================================
   修复：登录页输入框被浏览器自动填充时变白
   原因：通用的 input:-webkit-autofill 用 box-shadow 蒙版伪装暗色，
        但 .login-field input:focus 自己又设置了 box-shadow，
        两者特异性相同、且后者在源代码中靠后 → focus 时蒙版被挤掉，
        Chrome/Edge 的原生黄白底就漏出来了。
   解法：用更高特异性（.login-field input:-webkit-autofill:focus）
        重新铺上暗色蒙版 + focus 光环，统一三种状态：
        默认 / hover / focus 都是同一套深底色。
   ============================================================ */
.login-field input:-webkit-autofill,
.login-field input:-webkit-autofill:hover,
.login-field input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--ink) !important;
  -webkit-box-shadow: 0 0 0 1000px #101013 inset !important;
          box-shadow: 0 0 0 1000px #101013 inset !important;
  caret-color: var(--ink) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 10px !important;
  background-clip: padding-box !important;
  transition: background-color 9999s ease-in-out 0s,
              -webkit-text-fill-color 0s !important;
}
.login-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink) !important;
  -webkit-box-shadow:
    0 0 0 1000px #101013 inset,
    0 0 0 3px rgba(255, 255, 255, 0.12) !important;
          box-shadow:
    0 0 0 1000px #101013 inset,
    0 0 0 3px rgba(255, 255, 255, 0.12) !important;
  caret-color: var(--ink) !important;
  border: 1px solid rgba(255, 255, 255, 0.50) !important;
  border-radius: 10px !important;
  background-clip: padding-box !important;
}

/* —— Agent exe 编译进度 —— */
.build-progress-wrap { margin-bottom: 14px; }
.build-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12.5px;
}
.build-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.build-progress-bar > i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #10b981, #34d399);
  transition: width 0.35s ease;
}
.build-log {
  margin-top: 12px;
  max-height: 220px;
  overflow: auto;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
}
.build-checks { margin-top: 12px; display: grid; gap: 6px; }
.build-check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12.5px;
  line-height: 1.45;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}
.build-check.ok { border-color: rgba(16, 185, 129, 0.25); background: rgba(16, 185, 129, 0.06); }
.build-check.bad { border-color: rgba(249, 115, 115, 0.25); background: rgba(249, 115, 115, 0.06); }
.build-check .ico { flex: 0 0 auto; font-weight: 700; }
.build-check.ok .ico { color: #86efac; }
.build-check.bad .ico { color: #fca5a5; }

/* ============================================================
   网咖控制台 / 房间管理 / 房间详情
   ============================================================ */

/* 房间网格 + 房间卡 */
.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.room-card {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.room-card:hover {
  transform: translateY(-2px);
  border-color: rgba(103, 232, 249, 0.30);
  background: rgba(255, 255, 255, 0.04);
}
.room-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
}
.room-card-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 auto;
  min-width: 0;
}
.room-card-title b { font-size: 14.5px; }
.zone-tag {
  display: inline-block;
  align-self: flex-start;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(139, 92, 246, 0.14);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.30);
}

/* 上机率条 */
.ratio-row { display: flex; flex-direction: column; gap: 4px; }
.ratio-text { font-size: 13px; }
.ratio-text b { font-size: 16px; color: #67e8f9; }
.ratio-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.ratio-fill {
  height: 100%;
  background: linear-gradient(90deg, #22d3ee, #a855f7);
  transition: width 0.35s ease;
}

/* 空调状态行 */
.ac-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
}
.ac-row .ac-name {
  flex: 1 1 100%;
  font-size: 11.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 2px;
}
.ac-mode {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}
.ac-mode.on {
  background: rgba(103, 232, 249, 0.12);
  border-color: rgba(103, 232, 249, 0.32);
  color: #a5f3fc;
}
.ac-temp b { color: var(--text); }

/* 房间详情 顶部卡 */
.area-detail-top {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.10), rgba(139, 92, 246, 0.06));
}
.area-detail-top .big-temp {
  font-size: 56px;
  font-weight: 700;
  font-family: 'Orbitron', 'Segoe UI', sans-serif;
  color: #67e8f9;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.area-detail-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  min-width: 480px;
}
.area-detail-stats > div {
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
@media (max-width: 640px) {
  .area-detail-stats { grid-template-columns: repeat(2, 1fr); min-width: 0; }
}

/* PC 小方块网格 */
.pc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 6px;
}
.pc-tile {
  padding: 8px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  text-align: center;
  font-size: 11px;
  line-height: 1.3;
  transition: all 0.18s ease;
}
.pc-tile .pc-name { font-weight: 600; font-size: 12px; color: var(--text); }
.pc-tile .pc-state { color: var(--text-muted); font-size: 10.5px; margin-top: 2px; }
.pc-tile.on {
  background: rgba(34, 197, 94, 0.10);
  border-color: rgba(34, 197, 94, 0.38);
}
.pc-tile.on .pc-name { color: #86efac; }
.pc-tile.on .pc-state { color: #86efac; }
.pc-tile.offline {
  background: rgba(249, 115, 115, 0.06);
  border-color: rgba(249, 115, 115, 0.30);
}
.pc-tile.offline .pc-name { color: #fca5a5; }
.pc-tile.offline .pc-state { color: #fca5a5; }

/* PC 多选选项（房间编辑 modal 内） */
.pc-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pc-picker input[type="text"], .pc-picker > input { padding: 6px 10px; font-size: 12.5px; }
.pc-list {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
}
/* ====================================================================
   控制台 Pro / 房间卡 Pro / PC 导航页 — 完整样式
   ==================================================================== */

/* 通用：状态圆点 */
.dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 999px;
  background: rgba(255,255,255,0.25); flex: 0 0 auto; vertical-align: middle;
}
.dot-on    { background: #4ade80; box-shadow: 0 0 6px rgba(74, 222, 128, 0.55); }
.dot-cool  { background: #67e8f9; box-shadow: 0 0 6px rgba(103, 232, 249, 0.55); }
.dot-err   { background: #f43f5e; box-shadow: 0 0 6px rgba(244, 63, 94, 0.55); }
.dot-muted { background: rgba(255,255,255,0.20); }

/* ===== 控制台顶部 banner ===== */
.console-banner {
  display: grid; grid-template-columns: 1fr 360px; gap: 24px;
  padding: 22px 26px; margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(103,232,249,0.10) 0%, rgba(167,139,250,0.06) 60%, rgba(0,0,0,0) 100%);
  border: 1px solid rgba(255,255,255,0.10); border-radius: 16px;
  position: relative; overflow: hidden;
}
.console-banner .cb-left { display: flex; flex-direction: column; gap: 8px; }
.cb-tag {
  display: inline-block; align-self: flex-start;
  padding: 4px 11px; border-radius: 999px;
  background: rgba(103,232,249,0.18); color: #67e8f9;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.5px;
}
.cb-title {
  margin: 4px 0 2px; font-size: 24px; font-weight: 700;
  letter-spacing: 0.5px; line-height: 1.3;
}
.cb-title b { color: #67e8f9; padding: 0 2px; }
.cb-sub { margin: 0; color: var(--text-muted); font-size: 13px; }
.console-banner .cb-right { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.cb-time { color: var(--text-muted); font-size: 12px; text-align: right; }
.cb-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.cb-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  font-size: 11.5px;
}
.cb-chip b { color: var(--text); }
.cb-bar { height: 8px; background: rgba(255,255,255,0.06); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.cb-bar-fill {
  height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #67e8f9, #a78bfa);
  transition: width 0.4s ease;
}
.cb-bar-lbl { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-top: 2px; }

@media (max-width: 920px) {
  .console-banner { grid-template-columns: 1fr; }
}

/* ===== 季节预设 ===== */
.season-panel {
  padding: 16px 18px; margin-bottom: 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
}
.season-panel.is-off { opacity: 0.85; }
.season-panel.is-off .season-card { opacity: 0.55; filter: grayscale(0.4); }
.season-panel.is-off .season-card:hover { opacity: 0.85; }
.season-panel.is-off .patrol-bar-fill { background: rgba(255,255,255,0.18); box-shadow: none; }
.season-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; gap: 16px; flex-wrap: wrap;
}
.season-head-l { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; flex-wrap: wrap; }
.season-head-l .season-head-sub { white-space: normal; flex: 1; min-width: 200px; }

/* —— 季节预设分组 Tab 栏（2026-07 分组化）——
   一行：左侧分组 Tab（默认「一组」+ 店主自建组 + ＋新建），右侧当前组操作
   （绑定房间 / 改名 / 删除）。点 Tab 切换下方三张季节卡显示的分组参数。 */
.season-groups {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
  margin: 2px 0 12px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
}
.season-groups .sg-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.sg-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  font-size: 12.5px; line-height: 20px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.sg-tab:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.sg-tab.active {
  color: var(--text);
  background: rgba(122,162,255,0.14);
  border-color: rgba(122,162,255,0.45);
}
.sg-tab .sg-def {
  font-size: 10px; line-height: 14px; padding: 0 5px;
  border-radius: 4px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.08);
}
.sg-tab .sg-cnt { font-size: 11px; color: var(--text-muted); }
.sg-tab.active .sg-cnt { color: inherit; opacity: .75; }
.sg-tab.sg-add { border-style: dashed; }
.season-groups .sg-acts { display: flex; align-items: center; gap: 6px; }
.season-groups .sg-acts button.ghost.small { padding: 3px 10px; font-size: 11.5px; }
.season-groups .sg-acts button.danger-txt { color: var(--danger, #f87171); }
.season-groups .sg-acts button[disabled] { opacity: .45; cursor: not-allowed; }

/* 分组绑定房间弹窗：房间勾选列表 */
.sg-room-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px;
  max-height: 46vh; overflow-y: auto;
  padding: 2px;
}
.sg-room-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.sg-room-item:hover { background: rgba(255,255,255,0.04); }
.sg-room-item.is-on { border-color: rgba(122,162,255,0.45); background: rgba(122,162,255,0.10); }
.sg-room-item input { flex: 0 0 auto; }
.sg-room-item .sg-room-name { flex: 1; min-width: 0; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-room-item .sg-room-note { font-size: 10.5px; color: var(--warn, #fbbf24); margin-left: 4px; }
.sg-room-item .sg-room-note.muted { color: var(--text-muted); }

/* 季节总开关（iOS 风格 toggle） */
.season-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
}
.season-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.season-toggle .toggle-track {
  position: relative;
  width: 40px; height: 22px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.12);
  transition: background 0.18s ease, border-color 0.18s ease;
}
.season-toggle .toggle-thumb {
  position: absolute;
  top: 1px; left: 1px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
  transition: left 0.18s cubic-bezier(.4,.2,.2,1), background 0.18s ease;
}
.season-toggle input:checked + .toggle-track {
  background: rgba(74, 222, 128, 0.45);
  border-color: rgba(74, 222, 128, 0.65);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.25);
}
.season-toggle input:checked + .toggle-track .toggle-thumb {
  left: 19px; background: #f0fdf4;
}
.season-toggle .toggle-lbl {
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  min-width: 44px;
}
.season-toggle input:checked ~ .toggle-lbl { color: #86efac; }

/* 房间卡片：顾客控制四开关（顾客禁止 / 模式禁止 / 巡检豁免 / 任务豁免，房间管理页专属）。
   勾选 = 限制态，用琥珀色提示这是一项约束。两行 × 每行两个（grid 均分）。 */
.rp-custops {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 6px 10px;
  margin: 2px 0 8px;
  padding: 0 2px;
}
.rp-custops-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; user-select: none;
  flex: 0 1 auto; min-width: 0;
}
/* 右列（第 2/4 个）贴卡片右缘，左列贴左缘——中间留白，不然右列悬在中间很难看 */
.rp-custops-toggle:nth-child(even) { justify-self: end; }
.rp-custops-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.rp-custops-toggle .toggle-track {
  position: relative;
  width: 36px; height: 20px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.12);
  transition: background 0.18s ease, border-color 0.18s ease;
}
.rp-custops-toggle .toggle-thumb {
  position: absolute;
  top: 1px; left: 1px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
  transition: left 0.18s cubic-bezier(.4,.2,.2,1), background 0.18s ease;
}
.rp-custops-toggle input:checked + .toggle-track {
  background: rgba(245, 158, 11, 0.45);
  border-color: rgba(245, 158, 11, 0.65);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
}
.rp-custops-toggle input:checked + .toggle-track .toggle-thumb {
  left: 17px; background: #fffbeb;
}
.rp-custops-lbl {
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.rp-custops-toggle input:checked ~ .rp-custops-lbl { color: #fbbf24; }

/* ============================================================
 *  通用 iOS 风格 toggle 滑块（与 .season-toggle 视觉一致，去掉文字标签依赖）
 *  用法：
 *    <label class="ui-toggle [small]">
 *      <input type="checkbox" checked?>
 *      <span class="toggle-track"><span class="toggle-thumb"></span></span>
 *    </label>
 *  适合表格行内的"启用/禁用"列；加 .small 类缩成 32×18px 适合密集场景
 * ============================================================ */
.ui-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; user-select: none;
  vertical-align: middle;
}
.ui-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.ui-toggle .toggle-track {
  position: relative;
  width: 40px; height: 22px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.12);
  transition: background 0.18s ease, border-color 0.18s ease;
  flex-shrink: 0;
}
.ui-toggle .toggle-thumb {
  position: absolute;
  top: 1px; left: 1px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
  transition: left 0.18s cubic-bezier(.4,.2,.2,1), background 0.18s ease;
}
.ui-toggle input:checked + .toggle-track {
  background: rgba(74, 222, 128, 0.45);
  border-color: rgba(74, 222, 128, 0.65);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.25);
}
.ui-toggle input:checked + .toggle-track .toggle-thumb {
  left: 19px; background: #f0fdf4;
}
.ui-toggle.disabled { opacity: 0.55; cursor: not-allowed; }
.ui-toggle.disabled input { pointer-events: none; }

/* small：表格行内紧凑尺寸 */
.ui-toggle.small .toggle-track { width: 32px; height: 18px; }
.ui-toggle.small .toggle-thumb { width: 14px; height: 14px; top: 1px; left: 1px; }
.ui-toggle.small input:checked + .toggle-track .toggle-thumb { left: 15px; }
.season-head-r {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.season-head-r .patrol-lbl {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--text-muted); font-size: 11px;
}
.season-head-r .patrol-bar {
  width: 96px; height: 6px; border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.season-head-r .patrol-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #22d3ee, #4ade80);
  transition: width 0.45s linear;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.35);
}
.season-head-r .patrol-txt { min-width: 36px; text-align: right; color: var(--text-muted); font-size: 11px; }
.season-head-r button.ghost.small { padding: 2px 8px; font-size: 11px; }

.season-tag {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.5px;
  color: var(--text); padding: 3px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
}
.season-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.season-card {
  position: relative;
  padding: 16px 18px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  display: grid; grid-template-columns: 38px 1fr auto;
  grid-template-rows: auto auto auto auto;
  column-gap: 12px; row-gap: 4px; align-items: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.season-card:hover { border-color: rgba(255,255,255,0.18); }
.season-card .sc-edit {
  position: absolute; top: 8px; right: 8px;
  width: 24px; height: 24px; padding: 0;
  display: grid; place-items: center;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted); cursor: pointer;
  opacity: 0; transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.season-card:hover .sc-edit,
.season-card.active .sc-edit { opacity: 1; }
.season-card .sc-edit:hover { background: rgba(103,232,249,0.18); color: #67e8f9; border-color: rgba(103,232,249,0.35); }
.season-card .sc-ico {
  grid-row: 1 / 3; grid-column: 1;
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.05);
}
.season-card .sc-name {
  grid-row: 1; grid-column: 2;
  font-size: 14px; font-weight: 700; letter-spacing: 0.3px;
  display: flex; align-items: center; gap: 8px;
}
.season-card .sc-desc {
  grid-row: 2; grid-column: 2;
  font-size: 12px; color: var(--text-muted);
}
.season-card .sc-range {
  grid-row: 3; grid-column: 1 / -1;
  font-size: 10.5px; color: var(--text-muted);
  padding: 5px 8px; margin-top: 6px;
  border-radius: 6px;
  background: rgba(255,255,255,0.025);
  border: 1px dashed rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 4px;
}
.season-card .sc-range svg { vertical-align: -1px; }
.season-card .sc-hint {
  grid-row: 4; grid-column: 1 / -1;
  font-size: 10.5px; color: var(--text-muted); white-space: nowrap;
  margin-top: 2px;
}
.season-card .sc-auto-flag {
  display: inline-block;
  font-size: 10px; font-weight: 600; letter-spacing: 0.4px;
  padding: 1px 6px; border-radius: 999px;
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.30);
}
.season-card.season-amber .sc-ico { color: #fbbf24; background: rgba(245,158,11,0.10); }
.season-card.season-cyan  .sc-ico { color: #67e8f9; background: rgba(103,232,249,0.10); }
.season-card.season-lime  .sc-ico { color: #84cc16; background: rgba(132,204,22,0.12); }

/* 激活态：被启用的季节卡——更亮的边框 + 高亮 */
.season-card.active { border-color: rgba(103, 232, 249, 0.55); background: rgba(103, 232, 249, 0.06); box-shadow: 0 0 0 1px rgba(103, 232, 249, 0.15), inset 0 0 24px rgba(103, 232, 249, 0.05); }
.season-card.active.season-amber { border-color: rgba(251, 191, 36, 0.55); background: rgba(251, 191, 36, 0.06); box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.18), inset 0 0 24px rgba(251, 191, 36, 0.05); }
.season-card.active.season-lime  { border-color: rgba(132, 204, 22, 0.55); background: rgba(132, 204, 22, 0.06); box-shadow: 0 0 0 1px rgba(132, 204, 22, 0.18), inset 0 0 24px rgba(132, 204, 22, 0.05); }
.season-card .sc-active-flag {
  display: inline-block;
  font-size: 14px;
  color: #4ade80;
  vertical-align: middle;
  animation: scActivePulse 1.6s ease-in-out infinite;
}
@keyframes scActivePulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

/* 季节编辑器 */
.season-edit .field-row { gap: 12px; }
.season-edit .field label { font-size: 12px; color: var(--text-muted); }
.season-card .sc-hint svg { vertical-align: -1px; }

/* 适用月份选择器 */
.season-months {
  margin-bottom: 14px; padding: 12px;
  border: 1px solid var(--border, #2a2a2a); border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}
.season-months-hd {
  display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px;
}
.season-months-hd > span:first-child { font-size: 13px; font-weight: 600; }
.season-months-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
}
.sm-cell {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 8px 4px; min-height: 46px; cursor: pointer;
  border: 1px solid var(--border, #333); border-radius: 8px;
  background: var(--panel-2, #1a1a1a); color: var(--text, #ddd);
  font-size: 13px; transition: all .12s ease;
}
.sm-cell:hover { border-color: #5a8; }
.sm-cell .sm-m { font-weight: 600; }
.sm-cell .sm-own { font-size: 10px; line-height: 1; color: var(--text-muted); }
.sm-cell.is-on {
  background: rgba(64, 160, 120, 0.22); border-color: #4caf80; color: #d6f5e6;
}
.sm-cell.is-on .sm-own { color: #bfe8d3; }
.sm-cell.is-taken {
  opacity: 0.62; background: rgba(255, 255, 255, 0.015); border-style: dashed;
}
.sm-cell.is-conflict {
  background: rgba(220, 70, 70, 0.22); border-color: #e05555; color: #ffd9d9;
}
.sm-cell.is-conflict .sm-own { color: #ffc2c2; }
.season-months-warn {
  margin-top: 8px; padding: 7px 10px; border-radius: 7px;
  background: rgba(220, 70, 70, 0.14); border: 1px solid rgba(220, 70, 70, 0.4);
  color: #ff9b9b; font-size: 12px;
}
@media (max-width: 820px) {
  .season-months-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 820px) {
  .season-row { grid-template-columns: 1fr; }
  .season-head-r .patrol-bar { width: 60px; }
}

/* ===== 控制台 筛选区（grid 两栏布局，杜绝 flex 收缩重叠） ===== */
.console-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px; padding: 10px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
}
.cf-search {
  display: flex; align-items: center; gap: 8px;
  min-width: 0;
  padding: 7px 12px; border-radius: 8px;
  background: rgba(0,0,0,0.20); border: 1px solid rgba(255,255,255,0.06);
}
.cf-search svg { color: var(--text-muted); flex: 0 0 auto; }
.cf-search input {
  flex: 1 1 auto; min-width: 0; width: 100%;
  background: none; border: none; outline: none; color: var(--text);
  font-size: 13px;
}
.cf-actions {
  display: inline-flex; gap: 12px; align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.cf-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; cursor: pointer; user-select: none;
  color: var(--text-muted);
  white-space: nowrap;
}
.cf-toggle span { white-space: nowrap; word-break: keep-all; }
.cf-toggle input[type="checkbox"] {
  width: 14px; height: 14px; margin: 0; flex: 0 0 auto;
}
.cf-toggle:hover { color: var(--text); }
/* 类型筛选下拉：和 cf-toggle 同一行，外观贴合圆角胶囊视觉语言 */
.cf-zone-sel {
  background: rgba(0,0,0,0.20);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}
.cf-zone-sel:hover {
  border-color: rgba(103,232,249,0.35);
}
html[data-theme="light"] .cf-zone-sel {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.10);
}

/* ============================================================
 *  Task Editor（IF-THEN 块状编辑器）
 *  ----------------------------------------------------------
 *  每个 .te-block 是一块语义块（基础信息 / WHEN / IF / THEN / AFTER），
 *  内部用 .te-row 横排"label + input"。条件叶子 / 动作行用 .te-leaf / .te-act
 *  做内嵌横排卡片，移动端 flex-wrap 自动折行。
 * ============================================================ */
.task-editor { display: flex; flex-direction: column; gap: 14px; }
.te-block {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px; padding: 12px 14px;
}
html[data-theme="light"] .te-block { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.08); }
.te-block-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 10px;
}
.te-block-title { font-weight: 600; color: var(--accent, #67e8f9); font-size: 13px; letter-spacing: 0.4px; }
.te-row {
  display: flex; align-items: center; gap: 10px;
  margin: 6px 0; flex-wrap: wrap;
}
.te-row .input, .te-row .select { flex: 1; min-width: 160px; }
.te-label { flex: 0 0 90px; color: var(--text-muted); font-size: 12px; }
.te-cb { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 12px; cursor: pointer; }
.te-cb input { margin: 0; }
.te-trig-type { max-width: 220px; }
.te-cron-tpls { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.te-leaves { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.te-leaf, .te-act {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  padding: 8px 10px; border-radius: 8px;
  background: rgba(103,232,249,0.04);
  border: 1px solid rgba(103,232,249,0.12);
}
html[data-theme="light"] .te-leaf, html[data-theme="light"] .te-act {
  background: rgba(103,232,249,0.06);
  border-color: rgba(103,232,249,0.18);
}
.te-leaf-watch { min-width: 180px; }
.te-leaf-fields { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; align-items: center; }
.te-leaf-fields .input, .te-leaf-fields .select { min-width: 110px; flex: 1; }
.te-leaf-del, .te-act-del { padding: 4px 10px; }
.te-acts { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.te-advanced { margin-top: 10px; }
.te-advanced summary { cursor: pointer; color: var(--text-muted); font-size: 12px; padding: 4px 0; }
.te-advanced[open] summary { color: var(--text); }

.cf-view {
  display: inline-flex; flex: 0 0 auto;
  border-radius: 999px; padding: 3px;
  background: rgba(0,0,0,0.20); border: 1px solid rgba(255,255,255,0.06);
}
.cf-view-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 999px;
  background: transparent; border: none; color: var(--text-muted);
  font-size: 12px; cursor: pointer; transition: all 0.12s ease;
  white-space: nowrap;
}
.cf-view-btn:hover { color: var(--text); }
.cf-view-btn.on {
  background: rgba(103,232,249,0.20); color: #a5f3fc;
  box-shadow: 0 0 0 1px rgba(103,232,249,0.35) inset;
}
/* 小屏：两栏改成纵向堆叠，actions 占满第二行 */
@media (max-width: 720px) {
  .console-filter { grid-template-columns: 1fr; }
  .cf-actions { justify-content: space-between; }
}

/* ===== Pro 版房间卡 ===== */
.room-area { margin-top: 4px; }
.room-pro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}
.room-pro {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.room-pro:hover { border-color: rgba(255,255,255,0.18); transform: translateY(-1px); }
.room-pro.is-on { border-color: rgba(103,232,249,0.30); }
.room-pro.is-empty { opacity: 0.78; }

/* ===== 房间卡整卡「空调运行」点亮（2026-07 店主反馈：只亮操控块区分度不够）=====
   store.js makeRoomCardPro 按绑定空调运行模式挂 .ac-run + .acm-<模式>；
   整卡描边 + 顶部渐变洗色 + 外发光，制冷蓝/制热橙/除湿琥珀/送风青。
   「无人但空调开着」的房间同样点亮（覆盖 is-empty 的降透明度），一眼揪出异常。 */
.room-pro.acm-cool      { --acm: 96,165,250; }
.room-pro.acm-heat      { --acm: 251,146,60; }
.room-pro.acm-dry       { --acm: 251,191,36; }
.room-pro.acm-fan_only  { --acm: 45,212,191; }
.room-pro.acm-auto, .room-pro.acm-heat_cool { --acm: 103,232,249; }
.room-pro.ac-run,
.room-pro.ac-run:hover {
  border-color: rgba(var(--acm, 103,232,249), 0.55);
  background:
    linear-gradient(180deg, rgba(var(--acm, 103,232,249), 0.07), rgba(var(--acm, 103,232,249), 0.015) 46%, rgba(255,255,255,0.02) 100%);
  box-shadow: 0 0 0 1px rgba(var(--acm, 103,232,249), 0.10) inset, 0 12px 34px -16px rgba(var(--acm, 103,232,249), 0.60);
}
.room-pro.is-empty.ac-run { opacity: 1; }
html[data-theme="light"] .room-pro.acm-cool      { --acm: 37,99,235; }
html[data-theme="light"] .room-pro.acm-heat      { --acm: 234,88,12; }
html[data-theme="light"] .room-pro.acm-dry       { --acm: 217,119,6; }
html[data-theme="light"] .room-pro.acm-fan_only  { --acm: 13,148,136; }
html[data-theme="light"] .room-pro.acm-auto, html[data-theme="light"] .room-pro.acm-heat_cool { --acm: 8,145,178; }
html[data-theme="light"] .room-pro.ac-run,
html[data-theme="light"] .room-pro.ac-run:hover {
  border-color: rgba(var(--acm, 8,145,178), 0.55);
  background:
    linear-gradient(180deg, rgba(var(--acm, 8,145,178), 0.06), rgba(var(--acm, 8,145,178), 0.012) 46%, #ffffff 100%);
  box-shadow: 0 0 0 1px rgba(var(--acm, 8,145,178), 0.08) inset, 0 10px 28px -16px rgba(var(--acm, 8,145,178), 0.40);
}

/* 拖拽重排（仅房间管理页 showCrud=true 时启用） */
.room-pro.is-draggable {
  cursor: grab;
}
.room-pro.is-draggable:active { cursor: grabbing; }
.room-pro.is-draggable .rp-ac,
.room-pro.is-draggable button,
.room-pro.is-draggable input,
.room-pro.is-draggable .ac-pad,
.room-pro.is-draggable .rp-tool,
.room-pro.is-draggable .rp-pc {
  cursor: auto;
}
.room-pro.is-draggable button,
.room-pro.is-draggable .rp-tool { cursor: pointer; }
.room-pro.dragging { opacity: 0.45; transform: rotate(-1deg) scale(0.99); }
.room-pro.dnd-over-before { box-shadow: -3px 0 0 0 #67e8f9, 0 0 12px rgba(103,232,249,0.35); }
.room-pro.dnd-over-after  { box-shadow:  3px 0 0 0 #67e8f9, 0 0 12px rgba(103,232,249,0.35); }

.rp-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 10px; border-bottom: 1px dashed rgba(255,255,255,0.08);
}
.rp-title { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--text); }
.rp-title > svg { color: var(--ink-faded); flex: 0 0 auto; transition: transform 0.3s ease, color 0.2s ease; }
/* 房间名：渐变文字 + 字距 + 微光晕，让"大厅 1-10 / 57-64 包厢"这种朴素标题有质感 */
.rp-title b {
  font-weight: 800;
  letter-spacing: 1px;
  font-size: 15px;
  background: linear-gradient(135deg, #ffffff 0%, #d4d4d8 55%, #a1a1aa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 0 12px rgba(255,255,255,0.10));
  transition: background 0.3s ease, filter 0.3s ease, letter-spacing 0.3s ease;
}
.room-pro:hover .rp-title b {
  background: linear-gradient(135deg, #ffffff 0%, #e9d5ff 45%, #a855f7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 18px rgba(168,85,247,0.30));
  letter-spacing: 1.4px;
}
.room-pro:hover .rp-title > svg {
  color: #a855f7;
  transform: rotate(-8deg) scale(1.08);
}
/* 浅色主题：把渐变换成深色版，避免白底白字 */
html[data-theme="light"] .rp-title b {
  background: linear-gradient(135deg, #18181b 0%, #3f3f46 55%, #71717a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(0,0,0,0.06));
}
html[data-theme="light"] .room-pro:hover .rp-title b {
  background: linear-gradient(135deg, #18181b 0%, #7c3aed 50%, #a855f7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 12px rgba(168,85,247,0.25));
}
.rp-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  white-space: nowrap;      /* 防止"有人 5"被挤换行成"有人 / 5" */
  flex: 0 0 auto;            /* 不被挤压 */
}
.rp-badge.on  { background: rgba(74,222,128,0.12); color: #86efac; border: 1px solid rgba(74,222,128,0.30); }
.rp-badge.off { background: rgba(255,255,255,0.04); color: var(--text-muted); border: 1px solid rgba(255,255,255,0.08); }
/* 订座标识：对外订座接口预定进行中（预定开的空调、等顾客上机），任务完成/取消后消除 */
.rp-badge.book { background: rgba(251,191,36,0.14); color: #fcd34d; border: 1px solid rgba(251,191,36,0.35); }
html[data-theme="light"] .rp-badge.book { background: rgba(251,191,36,0.18); color: #92400e; border-color: rgba(180,120,10,0.40); }

/* 季节预设分组徽章（房间卡标题/列表房间名旁）：房间归属的分组名。
   非默认组蓝色点亮，默认「一组」灰色低调——扫一眼就能分清哪些房间套了特殊参数。 */
.rp-sg {
  display: inline-flex; align-items: center;
  padding: 1px 7px;
  margin-left: 6px;
  border-radius: 999px;
  font-size: 10.5px; line-height: 16px; font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
  flex: 0 0 auto;
  background: rgba(122,162,255,0.12);
  color: #a5c0ff;
  border: 1px solid rgba(122,162,255,0.32);
}
.rp-sg.def {
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  border-color: rgba(255,255,255,0.10);
}
html[data-theme="light"] .rp-sg { background: rgba(59,102,241,0.10); color: #3b5bdb; border-color: rgba(59,102,241,0.32); }
html[data-theme="light"] .rp-sg.def { background: rgba(0,0,0,0.04); color: var(--text-muted); border-color: rgba(0,0,0,0.10); }

/* v2.x 起 PC↔空调自动联动已下线，相关 .rp-title.linked / .room-name-linked
   样式已删除（房间名不再有"已联动"vs"普通"两态）。 */

/* 无人占位 */
.rp-empty {
  text-align: center; padding: 24px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.rp-empty-icon { color: var(--text-muted); opacity: 0.6; }
.rp-empty-text { font-size: 16px; font-weight: 600; color: var(--text-muted); margin-top: 6px; }
.rp-empty-sub  { font-size: 11.5px; color: var(--text-muted); opacity: 0.7; }

/* PC mini grid */
.rp-pc-section { display: flex; flex-direction: column; gap: 8px; }
.rp-section-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11.5px; color: var(--text-muted); letter-spacing: 0.3px;
}
.rp-section-title {
  font-weight: 600; color: var(--text); text-transform: uppercase;
}
.rp-pc-stats { display: inline-flex; gap: 10px; align-items: center; }
.rp-pc-stat {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,0.04);
}
.rp-pc-stat.on { color: #d1fae5; background: rgba(74,222,128,0.14); }
.rp-pc-stat.off { color: var(--text-muted); }
.rp-pc-stat.offline { color: #fda4af; background: rgba(244,63,94,0.10); }
.rp-pc-hint {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 4px;
  font-size: 11px;
}
.rp-pc-hint svg { color: currentColor; opacity: 0.7; }
/* PC 网格：固定双行高度——
   - 少于 2 行的房间也撑到 2 行（与多机房间视觉对齐）
   - 多于 2 行的房间出现内部滚动条（不再挤垮整张卡片）
   - 行高用 CSS 变量统一，方便日后微调 */
.rp-pc-grid {
  --rp-pc-row-h: 40px;
  --rp-pc-gap:   5px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: var(--rp-pc-row-h);
  gap: var(--rp-pc-gap);
  /* 锁死 2 行可视高度：min=max 双向夹紧 */
  min-height: calc(var(--rp-pc-row-h) * 2 + var(--rp-pc-gap));
  max-height: calc(var(--rp-pc-row-h) * 2 + var(--rp-pc-gap));
  overflow-y: auto;
  scrollbar-gutter: stable;     /* 有/无滚动条时不抖动 */
  align-content: start;          /* 不足两行时贴顶，下半留空 */
}
.rp-pc-grid::-webkit-scrollbar { width: 6px; }
.rp-pc-grid::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.16);
  border-radius: 3px;
}
.rp-pc-grid::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.26); }
.rp-pc {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 4px 2px; border-radius: 6px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  font-size: 10.5px;
  color: var(--text-muted);
  position: relative;
  min-width: 0;       /* 配合 grid，让 ellipsis 生效 */
  overflow: hidden;
}
.rp-pc-name {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.rp-pc.on { background: rgba(74,222,128,0.18); border-color: rgba(74,222,128,0.42); color: #d1fae5; }
.rp-pc.on .rp-pc-ico { color: #4ade80; }
.rp-pc.offline { background: rgba(244,63,94,0.10); border-color: rgba(244,63,94,0.28); color: #fda4af; }
.rp-pc.offline .rp-pc-ico { color: #f43f5e; }
.rp-pc.more {
  display: grid; place-items: center;
  background: rgba(255,255,255,0.06); color: var(--text-muted);
  font-weight: 600;
}
.rp-pc-ico { color: var(--text-muted); line-height: 0; }
.rp-pc-name { font-weight: 600; letter-spacing: 0.3px; }

/* 空调控制面板 */
.rp-ac {
  margin-top: 2px; padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.rp-ac-empty { padding: 8px; text-align: center; opacity: 0.6; }

/* ===== 空调操控器开/关一眼可辨（2026-07 店主反馈：状态不够明显）=====
   device-render.js 按运行模式给 .rp-ac 挂 .is-running + .m-<模式> / .is-off；
   运行中整块按模式着色（边框+渐变浅底+状态胶囊高亮），关着保持中性灰。
   与 device-render.css 中同名段落保持一致（顾客页独立加载那份副本）。 */
.rp-ac.m-cool      { --acm: 96,165,250;  --acm-ink: #93c5fd; }
.rp-ac.m-heat      { --acm: 251,146,60;  --acm-ink: #fdba74; }
.rp-ac.m-dry       { --acm: 251,191,36;  --acm-ink: #fcd34d; }
.rp-ac.m-fan_only  { --acm: 45,212,191;  --acm-ink: #5eead4; }
.rp-ac.m-auto, .rp-ac.m-heat_cool { --acm: 103,232,249; --acm-ink: #a5f3fc; }
.rp-ac.is-running {
  border-color: rgba(var(--acm, 103,232,249), 0.42);
  background: linear-gradient(180deg, rgba(var(--acm, 103,232,249), 0.09), rgba(var(--acm, 103,232,249), 0.02));
  box-shadow: 0 0 0 1px rgba(var(--acm, 103,232,249), 0.10) inset, 0 6px 22px -10px rgba(var(--acm, 103,232,249), 0.45);
}
.rp-ac.is-running .ac-pad-state.on {
  background: rgba(var(--acm, 103,232,249), 0.16);
  color: var(--acm-ink, #a5f3fc);
  border-color: rgba(var(--acm, 103,232,249), 0.48);
  font-weight: 700;
}
.rp-ac.is-running .ac-pad-state .dot {
  background: rgb(var(--acm, 103,232,249));
  box-shadow: 0 0 6px rgba(var(--acm, 103,232,249), 0.60);
}
/* 关机态：状态胶囊给足对比（描边加深 + 文字提亮一档），不再和背景融为一体 */
.rp-ac.is-off .ac-pad-state {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.16);
  color: var(--text);
  opacity: 0.75;
}
html[data-theme="light"] .rp-ac.m-cool      { --acm: 37,99,235;  --acm-ink: #1d4ed8; }
html[data-theme="light"] .rp-ac.m-heat      { --acm: 234,88,12;  --acm-ink: #c2410c; }
html[data-theme="light"] .rp-ac.m-dry       { --acm: 217,119,6;  --acm-ink: #b45309; }
html[data-theme="light"] .rp-ac.m-fan_only  { --acm: 13,148,136; --acm-ink: #0f766e; }
html[data-theme="light"] .rp-ac.m-auto, html[data-theme="light"] .rp-ac.m-heat_cool { --acm: 8,145,178; --acm-ink: #0e7490; }
html[data-theme="light"] .rp-ac.is-running {
  border-color: rgba(var(--acm, 8,145,178), 0.50);
  background: linear-gradient(180deg, rgba(var(--acm, 8,145,178), 0.07), rgba(var(--acm, 8,145,178), 0.015));
  box-shadow: 0 0 0 1px rgba(var(--acm, 8,145,178), 0.08) inset, 0 6px 18px -10px rgba(var(--acm, 8,145,178), 0.35);
}
html[data-theme="light"] .rp-ac.is-running .ac-pad-state.on {
  background: rgba(var(--acm, 8,145,178), 0.12);
  color: var(--acm-ink, #0e7490);
  border-color: rgba(var(--acm, 8,145,178), 0.45);
}
html[data-theme="light"] .rp-ac.is-off .ac-pad-state {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.16);
  color: var(--ink);
  opacity: 0.75;
}

/* ===== 房间卡内嵌「绑定设备」区（v3.x：空调 + 任意设备卡片）===== */
.rp-devices { margin-top: 8px; }
.rp-dev-card { margin-top: 6px; }
.rp-dev-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; margin-bottom: 4px;
}
.rp-dev-head .rp-dev-ico { display: inline-flex; opacity: 0.8; }
.rp-dev-head .rp-dev-name { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-dev-scope {
  font-size: 10px; padding: 1px 7px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14); opacity: 0.85; white-space: nowrap;
}
.rp-dev-scope.room { background: rgba(103,232,249,0.12); color: #67e8f9; border-color: rgba(103,232,249,0.30); }
.rp-dev-scope.pcs  { background: rgba(250,204,21,0.12);  color: #facc15; border-color: rgba(250,204,21,0.30); }
.rp-dev-body { }

/* 多卡：下拉组合框选择 + 按机位机位标注 */
.rp-dev-sel .rp-dev-combo { margin-bottom: 8px; }
.rp-dev-pcs { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 1px 0 7px; }
.rp-dev-pcs-lbl { font-size: 11px; color: var(--text-muted); }
.rp-dev-pcchip {
  font-size: 11px; padding: 2px 8px; border-radius: 6px; white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.04); color: var(--text-muted);
}
.rp-dev-pcchip.on { background: rgba(74,222,128,0.14); color: #4ade80; border-color: rgba(74,222,128,0.35); }
.rp-dev-pcchip.offline { opacity: 0.5; }
html[data-theme="light"] .rp-dev-pcchip { background: rgba(0,0,0,0.03); }

/* 多卡：紧凑标签页 */
.rp-dev-tabbar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.rp-dev-tab {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 3px 8px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.10); background: rgba(255,255,255,0.04);
  color: var(--text-muted); cursor: pointer; max-width: 130px;
}
.rp-dev-tab .rp-dev-tab-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-dev-tab:hover { border-color: rgba(255,255,255,0.20); }
.rp-dev-tab.active {
  background: rgba(103,232,249,0.12); color: #67e8f9;
  border-color: rgba(103,232,249,0.35);
}
html[data-theme="light"] .rp-dev-tab { background: rgba(0,0,0,0.03); }

/* ===== 设备绑定管理 modal ===== */
.rbind-modal .rbind-head { font-weight: 600; font-size: 13px; margin: 10px 0 6px; }
.rbind-modal .rbind-sep { height: 1px; background: rgba(255,255,255,0.10); margin: 12px 0; }
.rbind-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.03);
  margin-bottom: 6px;
}
.rbind-info { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.rbind-info .rbind-card { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rbind-acts { display: flex; gap: 4px; flex-shrink: 0; }
.rbind-acts .ghost.small.on { background: rgba(103,232,249,0.14); color: #67e8f9; border-color: rgba(103,232,249,0.35); }
.rbind-pcs { display: flex; flex-wrap: wrap; gap: 5px; padding: 2px 4px 10px 4px; }
.rbind-pc {
  font-size: 11px; padding: 3px 9px; border-radius: 6px; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.04); color: var(--text-muted);
}
.rbind-pc.on { background: rgba(250,204,21,0.14); color: #facc15; border-color: rgba(250,204,21,0.35); }
/* 可拖拽排序的绑定项 */
.rbind-item { margin-bottom: 6px; border-radius: 7px; }
.rbind-item > .rbind-row { margin-bottom: 0; }
.rbind-item.dragging { opacity: 0.45; }
.rbind-drag {
  cursor: grab; user-select: none; flex-shrink: 0;
  color: var(--text-muted); font-size: 14px; line-height: 1; padding: 0 2px;
}
.rbind-item[draggable="true"]:hover .rbind-drag { color: var(--text); }
.rbind-item.dragging .rbind-drag { cursor: grabbing; }
.rbind-add { display: flex; gap: 8px; align-items: center; }
/* 二级筛选：标签下拉（定宽）+ 设备卡片下拉（占满）。均为 UI.combo 包裹元素，
   视觉由内部 .combo-trigger 负责，这里只管布局宽度。 */
.rbind-tabsel { flex: 0 0 132px; min-width: 0; }
.rbind-select { flex: 1; min-width: 0; }
.ac-pad-head {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
.ac-pad-state {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
}
.ac-pad-state.on { background: rgba(103,232,249,0.12); color: #a5f3fc; border-color: rgba(103,232,249,0.32); }
.ac-pad-cur { font-size: 12px; color: var(--text-muted); }
.ac-pad-cur b { color: var(--text); font-size: 13px; }
.ac-pad-title { font-size: 13px; font-weight: 600; color: var(--text); margin-right: 2px; }
.ac-pad-power {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  background: rgba(255,255,255,0.06); color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.10);
  cursor: pointer;
}
.ac-pad-power.on {
  background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff;
  border-color: rgba(249,115,22,0.45);
  box-shadow: 0 4px 14px rgba(249,115,22,0.30);
}
.ac-pad-power:hover { filter: brightness(1.1); }

.ac-pad-temp {
  display: grid; grid-template-columns: 44px 1fr 44px;
  align-items: center; gap: 6px;
}
.ac-pad-btn {
  width: 44px; height: 44px; border-radius: 50%;
  /* flex 居中：- 和 + 这两个字形的基线本身就偏上，纯靠 line-height 居中肉眼会觉得"向上飘"。
     padding:0 抹掉浏览器对 <button> 的默认内边距；font-family:inherit 用 Inter（math 字符
     位置标准）而不是 UA 默认的 system-ui，避免不同平台字形高低不一致。 */
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  font-family: inherit;
  font-size: 22px; font-weight: 700; line-height: 1;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.10);
  color: var(--text); cursor: pointer;
}
.ac-pad-btn:hover:not(:disabled) { background: rgba(103,232,249,0.15); border-color: rgba(103,232,249,0.35); color: #a5f3fc; }
.ac-pad-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.ac-pad-temp-display { text-align: center; }
.ac-pad-temp-val { font-size: 32px; font-weight: 700; color: var(--text); line-height: 1; }
.ac-pad-temp-val sup { font-size: 14px; font-weight: 400; vertical-align: super; color: var(--text-muted); margin-left: 1px; }
.ac-pad-temp-lbl { letter-spacing: 0.3px; margin-top: 1px; }

/* 各组（模式 / 风速 / 摆风）带左侧标签，避免按钮文案重复（如两个"自动"）时用户分不清。
   .ac-pad-group 是 grid：左列是 36px 宽的标签，右列是按钮 wrap 区域。
   不用 flex+label-before 是因为 flex-wrap 后标签会跟着第一行按钮一起换，不优雅。 */
.ac-pad-group {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: start;
  gap: 0 8px;
}
.ac-pad-group-lbl {
  font-size: 11px; font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  line-height: 28px;        /* 与按钮 padding 后的总高对齐，标签视觉居中第一行 */
  text-align: right;
  padding-right: 2px;
  user-select: none;
}

/* 模式 / 风速 / 摆风 都用横向按钮组 */
.ac-pad-modes, .ac-pad-fans, .ac-pad-swing {
  display: flex; gap: 5px; flex-wrap: wrap;
}
.ac-mode-btn, .ac-fan-btn, .ac-swing-btn {
  flex: 1 0 auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 6px 10px; border-radius: 999px;
  font-size: 11.5px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted); cursor: pointer;
  transition: all 0.12s ease;
}
.ac-mode-btn:hover, .ac-fan-btn:hover, .ac-swing-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.18); }
.ac-mode-btn.on, .ac-fan-btn.on, .ac-swing-btn.on {
  background: rgba(103,232,249,0.18); color: #a5f3fc;
  border-color: rgba(103,232,249,0.45);
  box-shadow: 0 0 0 1px rgba(103,232,249,0.20) inset;
}

/* ===== 列表视图 ===== */
.data-table.room-list-tbl { width: 100%; border-collapse: collapse; }
.data-table.room-list-tbl th, .data-table.room-list-tbl td {
  padding: 10px 12px; text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.data-table.room-list-tbl thead th {
  font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600;
  background: rgba(255,255,255,0.02);
}
.data-table.room-list-tbl tbody tr:hover { background: rgba(255,255,255,0.03); }

/* ===== 智能设备管控页（store/panel）=====
   声明式组件模型：顶部标签栏(分类/面包屑) + 卡片网格 + 13 种组件渲染器。
   AI / 店主同源搭建，状态实时来自 HA。前缀约定：
     .dpanel-*  页面级容器（标签栏 / 网格 / 图标选择 / 组件编辑器）
     .dpc-*     卡片与卡内组件
     .dcr-*     卡片编辑 modal 里的组件编辑行 */

/* —— 顶部标签栏（面包屑/分类）—— */
.dpanel-tabs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 14px;
}
.dpanel-tab {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 999px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted); cursor: pointer;
  font-size: 13px; font-weight: 600;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.dpanel-tab:hover { color: var(--text); border-color: rgba(255,255,255,0.18); }
.dpanel-tab .dpt-ico { display: inline-flex; align-items: center; color: inherit; opacity: 0.85; }
.dpanel-tab.active {
  background: rgba(56,189,248,0.14); color: #7dd3fc;
  border-color: rgba(56,189,248,0.40);
  box-shadow: 0 0 0 1px rgba(56,189,248,0.14) inset;
}
.dpanel-tab.add {
  padding: 7px 10px; color: var(--text-muted);
  border-style: dashed;
}
.dpanel-tab.add:hover { color: #7dd3fc; border-color: rgba(56,189,248,0.40); }
.dpt-op {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; margin-left: 1px;
  padding: 0; border-radius: 5px;
  border: 1px solid transparent; background: transparent;
  color: inherit; opacity: 0.7; cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.dpt-op:hover { background: rgba(255,255,255,0.10); opacity: 1; }
.dpanel-tab[draggable="true"] { cursor: grab; }
.dpanel-tab.dragging { opacity: 0.5; }

/* —— 操作条 + 网格 —— */
.dpanel-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.dpanel-search { flex: 1 1 auto; min-width: 200px; }
.dpanel-fault-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; margin-bottom: 12px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius);
  font-size: 13px; color: #f87171; line-height: 1.4;
}
.dpanel-fault-bar .dpfb-icon { flex-shrink: 0; color: #ef4444; }
.dpanel-fault-bar .dpfb-text b { color: #fca5a5; font-weight: 600; }
.dpanel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  align-items: start;
}

/* —— 设备卡片 —— */
.dpanel-card {
  position: relative;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.dpanel-card:hover { border-color: rgba(255,255,255,0.18); box-shadow: 0 6px 18px rgba(0,0,0,0.20); }
.dpanel-card.dragging { opacity: 0.5; }
/* —— 整卡「运行中」点亮：卡上任一可控设备开着 → 语义色边框 + 外发光（store.js makeDeviceCard
   挂 .is-act + .dpc-acc--<key>，颜色变量来自"状态驱动配色"段的 --dpa，深浅主题自动切换）—— */
.dpanel-card.is-act,
.dpanel-card.is-act:hover {
  border-color: rgba(var(--dpa, 103,232,249), 0.60);
  background: linear-gradient(180deg, rgba(var(--dpa, 103,232,249), 0.10), rgba(var(--dpa, 103,232,249), 0.02) 52%, transparent 100%);
  box-shadow: 0 0 0 1px rgba(var(--dpa, 103,232,249), 0.14) inset, 0 10px 30px -12px rgba(var(--dpa, 103,232,249), 0.55);
}
.dpanel-card.is-act .dpc-ico { color: var(--dpa-ink, #67e8f9); }
/* 卡头名称也点亮，离远了看整张卡"色调"一致 */
.dpanel-card.is-act .dpc-head { border-bottom-color: rgba(var(--dpa, 103,232,249), 0.25); }
.rp-dev-card.is-act {
  border: 1px solid rgba(var(--dpa, 103,232,249), 0.55); border-radius: 10px;
  padding: 6px 8px;
  background: linear-gradient(180deg, rgba(var(--dpa, 103,232,249), 0.10), rgba(var(--dpa, 103,232,249), 0.02) 60%, transparent 100%);
  box-shadow: 0 0 0 1px rgba(var(--dpa, 103,232,249), 0.10) inset, 0 8px 22px -14px rgba(var(--dpa, 103,232,249), 0.50);
}
.rp-dev-card.is-act .rp-dev-ico { color: var(--dpa-ink, #67e8f9); opacity: 1; }
html[data-theme="light"] .dpanel-card.is-act,
html[data-theme="light"] .dpanel-card.is-act:hover {
  border-color: rgba(var(--dpa, 8,145,178), 0.60);
  background: linear-gradient(180deg, rgba(var(--dpa, 8,145,178), 0.08), rgba(var(--dpa, 8,145,178), 0.015) 52%, #ffffff 100%);
  box-shadow: 0 0 0 1px rgba(var(--dpa, 8,145,178), 0.10) inset, 0 8px 24px -12px rgba(var(--dpa, 8,145,178), 0.38);
}
html[data-theme="light"] .rp-dev-card.is-act {
  border-color: rgba(var(--dpa, 8,145,178), 0.55);
  background: linear-gradient(180deg, rgba(var(--dpa, 8,145,178), 0.07), rgba(var(--dpa, 8,145,178), 0.012) 60%, #ffffff 100%);
  box-shadow: 0 0 0 1px rgba(var(--dpa, 8,145,178), 0.08) inset, 0 6px 18px -12px rgba(var(--dpa, 8,145,178), 0.30);
}
/* —— 设备整机离线：醒目红框 + 名称后“离线”角标，店主扫一眼即可辨别 —— */
.dpanel-card.is-offline {
  border-color: rgba(239,68,68,0.65);
  box-shadow: 0 0 0 1px rgba(239,68,68,0.35), 0 6px 18px rgba(239,68,68,0.12);
}
.dpanel-card.is-offline:hover {
  border-color: rgba(239,68,68,0.9);
  box-shadow: 0 0 0 1px rgba(239,68,68,0.5), 0 6px 20px rgba(239,68,68,0.18);
}
.dpanel-card.is-offline .dpc-ico { color: #fca5a5; }
.dpanel-card.is-offline .dpc-name::after {
  content: "离线"; margin-left: 8px; vertical-align: middle;
  font-size: 11px; font-weight: 600; color: #fca5a5;
  padding: 1px 7px; border-radius: 999px;
  border: 1px solid rgba(239,68,68,0.5); background: rgba(239,68,68,0.10);
}
.rp-dev-card.is-offline {
  border: 1px solid rgba(239,68,68,0.6); border-radius: 10px;
  padding: 6px 8px; background: rgba(239,68,68,0.04);
}
.rp-dev-card.is-offline .rp-dev-name { color: #fca5a5; }
.rp-dev-card.is-offline .rp-dev-name::after {
  content: "离线"; margin-left: 6px;
  font-size: 10px; font-weight: 600; color: #fca5a5;
  padding: 0 6px; border-radius: 999px;
  border: 1px solid rgba(239,68,68,0.5); background: rgba(239,68,68,0.10);
}
.dpc-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px dashed rgba(255,255,255,0.08);
}
.dpc-drag {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted); opacity: 0.45; cursor: grab; flex: 0 0 auto;
}
.dpc-drag:hover { opacity: 0.9; }
.dpc-ico {
  flex: 0 0 26px; width: 26px; height: 26px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(56,189,248,0.12); border: 1px solid rgba(56,189,248,0.22);
  color: #7dd3fc;
}
.dpc-name {
  flex: 1 1 auto; min-width: 0;
  font-size: 14px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dpc-ops { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.dpc-op {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; padding: 0; border-radius: 6px;
  border: 1px solid transparent; background: transparent;
  color: var(--text-muted); cursor: pointer;
  opacity: 0; transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.dpanel-card:hover .dpc-op { opacity: 1; }
.dpc-op:hover { background: rgba(255,255,255,0.06); color: var(--text); border-color: rgba(255,255,255,0.10); }
.dpc-del:hover { background: rgba(239,68,68,0.12); color: #fca5a5; border-color: rgba(239,68,68,0.32); }
.dpc-body { padding: 6px 12px 10px; display: flex; flex-direction: column; }

/* —— 通用行（toggle/number/sensor/state/binary/button…）—— */
.dpc-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
}
.dpc-row + .dpc-row,
.dpc-slider + .dpc-row, .dpc-row + .dpc-slider,
.dpc-modes + .dpc-row, .dpc-row + .dpc-modes,
.dpc-progress + .dpc-row, .dpc-row + .dpc-progress { border-top: 1px solid rgba(255,255,255,0.05); }
.dpc-row-ico {
  width: 24px; height: 24px; flex: 0 0 24px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #7dd3fc; background: rgba(56,189,248,0.10); border-radius: 7px;
}
.dpc-row-info { flex: 1 1 auto; min-width: 0; }
.dpc-row-name {
  font-size: 13px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dpc-missing { opacity: 0.9; }
.dpc-missing .dpc-row-ico { color: #fca5a5; background: rgba(239,68,68,0.10); }
.dpc-miss-eid { font-size: 11px; color: #fca5a5; word-break: break-all; }

/* iOS 风格开关 */
.dpc-toggle {
  position: relative; display: inline-flex; align-items: center;
  width: 40px; height: 23px; flex: 0 0 40px; cursor: pointer;
}
.dpc-toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.dpc-tk {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px; transition: background 0.18s ease, border-color 0.18s ease;
}
.dpc-tt {
  position: absolute; top: 2px; left: 2px;
  width: 17px; height: 17px; border-radius: 50%;
  background: #f8fafc; box-shadow: 0 1px 2px rgba(0,0,0,0.30);
  transition: left 0.18s ease;
}
.dpc-toggle.on .dpc-tk { background: rgba(56,189,248,0.55); border-color: rgba(56,189,248,0.65); }
.dpc-toggle.on .dpc-tt { left: 20px; }

/* 滑块 */
.dpc-slider { padding: 8px 0; }
.dpc-slider-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.dpc-slider-head .dpc-row-name { flex: 1 1 auto; }
.dpc-slider-val { font-size: 12px; font-weight: 700; color: var(--text); flex: 0 0 auto; }
.dpc-slider input[type="range"] { width: 100%; accent-color: #38bdf8; }

/* 模式 / 选择 / 空调 / 窗帘 / 颜色 共用 */
.dpc-modes, .dpc-climate, .dpc-cover, .dpc-color { padding: 8px 0; }
.dpc-modes-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.dpc-modes-head .dpc-row-name { flex: 1 1 auto; }
.dpc-cli-cur { font-size: 12px; color: var(--text-muted); flex: 0 0 auto; }
.dpc-mode-sel {
  width: 100%; padding: 7px 10px; border-radius: 8px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.10);
  color: var(--text); font-size: 13px;
}
.dpc-mode-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dpc-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; padding: 5px 11px; border-radius: 999px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.10);
  color: var(--text-muted); cursor: pointer; transition: all 0.15s ease;
}
.dpc-chip.sm { font-size: 11px; padding: 4px 9px; }
.dpc-chip:hover { color: var(--text); border-color: rgba(255,255,255,0.20); }
.dpc-chip.active {
  background: rgba(56,189,248,0.14); color: #7dd3fc; border-color: rgba(56,189,248,0.40);
}

/* 步进器（空调温度 / number） */
.dpc-stepper {
  display: inline-flex; align-items: center; gap: 2px; flex: 0 0 auto;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px; padding: 2px;
}
.dpc-climate .dpc-stepper { margin-bottom: 8px; }
.dpc-step {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 28px; padding: 0; border-radius: 8px;
  background: transparent; border: none; color: var(--text); cursor: pointer;
  transition: background 0.15s ease;
}
.dpc-step:hover { background: rgba(255,255,255,0.08); }
.dpc-step-val { min-width: 52px; text-align: center; font-size: 14px; font-weight: 700; color: var(--text); }

/* 颜色选择 */
.dpc-color-input {
  width: 40px; height: 26px; padding: 0; flex: 0 0 auto;
  background: transparent; border: 1px solid rgba(255,255,255,0.14);
  border-radius: 7px; cursor: pointer;
}

/* 动作按钮 */
.dpc-action-btn {
  display: inline-flex; align-items: center; gap: 6px; width: 100%;
  justify-content: center; padding: 9px 12px; border-radius: 10px;
  background: rgba(56,189,248,0.12); border: 1px solid rgba(56,189,248,0.30);
  color: #7dd3fc; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dpc-action-btn:hover { background: rgba(56,189,248,0.20); border-color: rgba(56,189,248,0.50); }

/* 进度条（滤芯/电量/湿度…） */
.dpc-progress { padding: 8px 0; }
.dpc-progress-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.dpc-progress-head .dpc-row-name { flex: 1 1 auto; }
.dpc-progress-val { font-size: 13px; font-weight: 700; color: var(--text); flex: 0 0 auto; }
.dpc-progress-val.ok { color: #4ade80; }
.dpc-progress-val.mid { color: #fbbf24; }
.dpc-progress-val.low { color: #f87171; }
.dpc-progress-bar { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.06); overflow: hidden; }
.dpc-progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #38bdf8, #7dd3fc); transition: width 0.3s ease; }
.dpc-progress-fill.ok { background: linear-gradient(90deg, #22c55e, #4ade80); }
.dpc-progress-fill.mid { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.dpc-progress-fill.low { background: linear-gradient(90deg, #dc2626, #f87171); }

/* 读数 / 状态 / 二元 */
.dpc-sensor-val, .dpc-state-val { font-size: 13px; font-weight: 600; color: var(--text); flex: 0 0 auto; text-align: right; }
.dpc-badge {
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10); flex: 0 0 auto;
}
.dpc-badge.on  { background: rgba(239,68,68,0.14); color: #fca5a5; border-color: rgba(239,68,68,0.32); }
.dpc-badge.off { background: rgba(255,255,255,0.04); color: var(--text-muted); }

/* 分隔标题 */
.dpc-text {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 0 4px; margin-top: 2px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase;
  color: var(--text-muted);
}
.dpc-text .dpc-row-ico { width: 18px; height: 18px; flex: 0 0 18px; background: transparent; }

/* —— 不可用 / 未知态：控件置灰，明确告知离线，避免假装"关" —— */
.dpc-unavail { opacity: 0.55; }
.dpc-unavail .dpc-row-ico { color: var(--text-muted); background: rgba(255,255,255,0.04); }

/* —— 布局容器（group）：横排 / 网格排版的 div —— */
.dpc-group { padding: 6px 0; }
.dpc-group-label { margin-bottom: 6px; font-weight: 600; }
.dpc-group-inner { width: 100%; }
.dpc-group-inner > .dpc-group-item { min-width: 0; }
/* flex 横/竖排时子项可伸缩共享空间；网格(display:grid)下 flex 属性自动失效 */
.dpc-group-inner[style*="flex"] > .dpc-group-item { flex: 1 1 auto; }
/* 横排兜底：永远允许换行 + 子项给足可读宽度。
   否则 AI 把多个带标签的行塞进一个窄横排时，子项会被压到 0 宽、
   标签被 ellipsis 截成"指..""状""固"——信息被遮盖。
   有了 min-width，放不下就自动换行到下一行，标签保持完整。 */
.dpc-group-inner[style*="flex-direction:row"] { flex-wrap: wrap; }
.dpc-group-inner[style*="flex-direction:row"] > .dpc-group-item { flex: 1 1 auto; min-width: 116px; }
/* 容器内（横排/网格）的行标签允许折成两行而非硬截断，尽量别遮盖信息 */
.dpc-group-item .dpc-row-name {
  white-space: normal; overflow: visible; text-overflow: clip;
  line-height: 1.25; overflow-wrap: anywhere;
}
/* 容器内相邻组件不画分隔线（分隔线是竖向堆叠时的视觉，横排/网格里多余） */
.dpc-group-inner .dpc-group-item { border-top: 0 !important; }
.dpc-group--bordered { border: 1px solid var(--line); border-radius: 10px; padding: 10px; }

/* 宽控件（大步进器/空调/调色/窗帘/进度条）整行独占：grid 下跨满所有列、flex 下整行换行，
   再也不会被挤到与相邻档位/开关重叠。 */
/* 状态异常项里的「消除」按钮：右对齐、低调，hover 才明显 */
.dash-alert-item { position: relative; }
.dash-alert-dismiss { margin-left: auto; flex: 0 0 auto; white-space: nowrap; }

.dpc-group-item--wide {
  grid-column: 1 / -1;
  flex: 1 1 100% !important;
  min-width: 0 !important;
  width: 100%;
}
/* 兜底：任何 group 子项的内容都不许溢出自身边框去盖住邻居（窄到极限时宁可内部自适应也不重叠） */
.dpc-group-inner > .dpc-group-item { min-width: 0; max-width: 100%; }
.dpc-group-inner > .dpc-group-item > * { max-width: 100%; }

/* ============================================================
   主题感知配色预设（tone）—— group 当分区底色、text(badge) 当标签药丸用。
   全部基于 CSS 变量 / 半透明叠加，明暗主题都不会撞色；AI 只填语义名即可。
   ============================================================ */
.dpc-tone { border: 1px solid transparent; }
.dpc-group.dpc-tone { padding: 10px; border-radius: 10px; }
.dpc-tone--panel   { background: var(--paper-2);                 border-color: var(--line); }
.dpc-tone--muted   { background: var(--paper-4);                 border-color: var(--line-soft); color: var(--text-muted); }
.dpc-tone--accent  { background: rgba(255,255,255,0.10);         border-color: var(--line-bold); }
.dpc-tone--info    { background: rgba(59,130,246,0.12);          border-color: rgba(59,130,246,0.30);  color: #93c5fd; }
.dpc-tone--success { background: rgba(16,185,129,0.12);          border-color: rgba(16,185,129,0.30);  color: #6ee7b7; }
.dpc-tone--warning { background: rgba(245,158,11,0.13);          border-color: rgba(245,158,11,0.32);  color: #fcd34d; }
.dpc-tone--danger  { background: rgba(239,68,68,0.12);           border-color: rgba(239,68,68,0.30);   color: #fca5a5; }
/* group 容器内的子项文字仍走各自的主题色，不被 tone 文字色带跑 */
.dpc-group.dpc-tone .dpc-group-item { color: var(--text); }

/* 浅色主题下重新调一版（半透明叠加在白底上太淡，文字色也要压深） */
html[data-theme="light"] .dpc-tone--info    { background: rgba(37,99,235,0.10);  border-color: rgba(37,99,235,0.28);  color: #1d4ed8; }
html[data-theme="light"] .dpc-tone--success { background: rgba(5,150,105,0.10);  border-color: rgba(5,150,105,0.28);  color: #047857; }
html[data-theme="light"] .dpc-tone--warning { background: rgba(217,119,6,0.12);  border-color: rgba(217,119,6,0.30);  color: #b45309; }
html[data-theme="light"] .dpc-tone--danger  { background: rgba(220,38,38,0.10);  border-color: rgba(220,38,38,0.28);  color: #b91c1c; }
html[data-theme="light"] .dpc-tone--accent  { background: rgba(0,0,0,0.05);      border-color: rgba(0,0,0,0.14); }

/* text(badge) 主题感知标签药丸：左对齐、宽度自适应 */
.dpc-text-badge-wrap { display: flex; padding: 4px 0; }
.dpc-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: var(--paper-2); border: 1px solid var(--line); color: var(--text-muted);
}
.dpc-pill .dpc-row-ico { width: 14px; height: 14px; flex: 0 0 14px; background: transparent; }

/* ============================================================
   积木组件「好看变体」—— 让 AI 用积木也能拼出空调控件那种精致样式
   ============================================================ */
/* 大号 ± 步进器（number/slider size=lg；复用 .ac-pad-temp 的栅格 + 大字号） */
.dpc-hero { padding: 6px 0; }

/* 电源大按钮（toggle style=button），样式同空调电源键但不右浮、占整行可点 */
.dpc-row-btnonly { padding: 6px 0; }
.dpc-powerbtn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
  background: rgba(255,255,255,0.06); color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.10); cursor: pointer;
  transition: filter 0.12s ease;
}
.dpc-powerbtn.on {
  background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff;
  border-color: rgba(249,115,22,0.45); box-shadow: 0 4px 14px rgba(249,115,22,0.30);
}
.dpc-powerbtn:hover { filter: brightness(1.1); }

/* 模式图标瓷砖（mode_select style=tiles）：图标在上、文字在下 */
.dpc-tiles { display: flex; flex-wrap: wrap; gap: 6px; }
.dpc-tile {
  flex: 1 0 auto; min-width: 56px;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 8px 10px; border-radius: 10px;
  font-size: 11.5px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted); cursor: pointer; transition: all 0.12s ease;
}
.dpc-tile:hover { color: var(--text); border-color: rgba(255,255,255,0.18); }
.dpc-tile.active {
  background: rgba(103,232,249,0.18); color: #a5f3fc;
  border-color: rgba(103,232,249,0.45); box-shadow: 0 0 0 1px rgba(103,232,249,0.20) inset;
}
.dpc-tile-ico { display: inline-flex; }
html[data-theme="light"] .dpc-tile.active,
html[data-theme="light"] .dpc-powerbtn:not(.on) { color: var(--text); }

/* ============================================================
 * ===== 状态驱动配色（语义 accent）+ hero / gauge 组件 =====
 * 与 device-render.css 中同名段落保持一致（顾客页独立加载那份副本）。
 * 设备激活时按 domain 取色：灯=暖黄、空调制冷=蓝制热=橙、插座=绿…
 * JS 端（device-render.js _accentOf/_activeOf）往元素挂 .dpc-acc--<key> [+.act/.on]，
 * 这里用 CSS 变量 --dpa(rgb三元组)/--dpa-ink(前景色) 统一上色。
 * ============================================================ */
.dpc-acc--amber  { --dpa: 251,191,36;  --dpa-ink: #fbbf24; }
.dpc-acc--green  { --dpa: 52,211,153;  --dpa-ink: #34d399; }
.dpc-acc--cyan   { --dpa: 103,232,249; --dpa-ink: #67e8f9; }
.dpc-acc--blue   { --dpa: 96,165,250;  --dpa-ink: #60a5fa; }
.dpc-acc--orange { --dpa: 251,146,60;  --dpa-ink: #fb923c; }
.dpc-acc--purple { --dpa: 192,132,252; --dpa-ink: #c084fc; }
.dpc-acc--teal   { --dpa: 45,212,191;  --dpa-ink: #2dd4bf; }
.dpc-acc--indigo { --dpa: 129,140,248; --dpa-ink: #818cf8; }
.dpc-acc--rose   { --dpa: 251,113,133; --dpa-ink: #fb7185; }
html[data-theme="light"] .dpc-acc--amber  { --dpa: 217,119,6;   --dpa-ink: #b45309; }
html[data-theme="light"] .dpc-acc--green  { --dpa: 5,150,105;   --dpa-ink: #047857; }
html[data-theme="light"] .dpc-acc--cyan   { --dpa: 8,145,178;   --dpa-ink: #0e7490; }
html[data-theme="light"] .dpc-acc--blue   { --dpa: 37,99,235;   --dpa-ink: #1d4ed8; }
html[data-theme="light"] .dpc-acc--orange { --dpa: 234,88,12;   --dpa-ink: #c2410c; }
html[data-theme="light"] .dpc-acc--purple { --dpa: 147,51,234;  --dpa-ink: #7e22ce; }
html[data-theme="light"] .dpc-acc--teal   { --dpa: 13,148,136;  --dpa-ink: #0f766e; }
html[data-theme="light"] .dpc-acc--indigo { --dpa: 79,70,229;   --dpa-ink: #4338ca; }
html[data-theme="light"] .dpc-acc--rose   { --dpa: 225,29,72;   --dpa-ink: #be123c; }

/* 行图标激活态：语义色点亮 + 微光 */
.dpc-row-ico.act {
  color: var(--dpa-ink, #7dd3fc);
  background: rgba(var(--dpa, 56,189,248), 0.14);
  box-shadow: 0 0 10px rgba(var(--dpa, 56,189,248), 0.22);
}
/* 亮色主题下后文有 html[data-theme="light"] .dpc-row-ico 通用覆盖，这里特异性更高保住激活色 */
html[data-theme="light"] .dpc-row-ico.act {
  color: var(--dpa-ink, #0e7490);
  background: rgba(var(--dpa, 8,145,178), 0.12);
  box-shadow: 0 0 10px rgba(var(--dpa, 8,145,178), 0.18);
}
/* 拨杆开关激活态跟随语义色（accent 类挂在 .dpc-row 上，变量继承下来） */
.dpc-row[class*="dpc-acc--"] .dpc-toggle.on .dpc-tk {
  background: rgba(var(--dpa), 0.55);
  border-color: rgba(var(--dpa), 0.65);
}
/* 电源大按钮激活态语义色渐变 */
.dpc-powerbtn.on[class*="dpc-acc--"] {
  background: linear-gradient(135deg, rgba(var(--dpa), 0.95), rgba(var(--dpa), 0.70));
  border-color: rgba(var(--dpa), 0.50);
  box-shadow: 0 4px 14px rgba(var(--dpa), 0.30);
  color: #fff;
}
/* 空调模式按钮按模式取色：制冷蓝 / 制热橙 / 除湿琥珀 / 送风青 */
.ac-mode-btn.on.m-cool     { background: rgba(96,165,250,0.18);  color: #93c5fd; border-color: rgba(96,165,250,0.45);  box-shadow: 0 0 0 1px rgba(96,165,250,0.20) inset; }
.ac-mode-btn.on.m-heat     { background: rgba(251,146,60,0.18);  color: #fdba74; border-color: rgba(251,146,60,0.45);  box-shadow: 0 0 0 1px rgba(251,146,60,0.20) inset; }
.ac-mode-btn.on.m-dry      { background: rgba(251,191,36,0.16);  color: #fcd34d; border-color: rgba(251,191,36,0.42);  box-shadow: 0 0 0 1px rgba(251,191,36,0.18) inset; }
.ac-mode-btn.on.m-fan_only { background: rgba(45,212,191,0.16);  color: #5eead4; border-color: rgba(45,212,191,0.42);  box-shadow: 0 0 0 1px rgba(45,212,191,0.18) inset; }
html[data-theme="light"] .ac-mode-btn.on.m-cool     { color: #1d4ed8; }
html[data-theme="light"] .ac-mode-btn.on.m-heat     { color: #c2410c; }
html[data-theme="light"] .ac-mode-btn.on.m-dry      { color: #b45309; }
html[data-theme="light"] .ac-mode-btn.on.m-fan_only { color: #0f766e; }

/* ===== hero：操控器头部（大图标 + 名称 + 状态摘要 + 圆形电源键）===== */
.dpc-herocard {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin: 4px 0;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.dpc-hero-ico {
  width: 46px; height: 46px; flex: 0 0 46px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 13px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.dpc-herocard.act {
  border-color: rgba(var(--dpa, 103,232,249), 0.30);
  box-shadow: 0 0 0 1px rgba(var(--dpa, 103,232,249), 0.08), 0 6px 22px -8px rgba(var(--dpa, 103,232,249), 0.35);
}
.dpc-herocard.act .dpc-hero-ico {
  color: var(--dpa-ink, #67e8f9);
  background: rgba(var(--dpa, 103,232,249), 0.13);
  border-color: rgba(var(--dpa, 103,232,249), 0.35);
  box-shadow: 0 0 14px rgba(var(--dpa, 103,232,249), 0.30);
}
.dpc-hero-info { flex: 1 1 auto; min-width: 0; }
.dpc-hero-name {
  font-size: 14.5px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dpc-hero-sub {
  font-size: 12px; color: var(--text-muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dpc-herocard.act .dpc-hero-sub { color: var(--dpa-ink, #67e8f9); }
.dpc-hero-power {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.05); color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.12); cursor: pointer;
  transition: all 0.15s ease;
}
.dpc-hero-power:hover { filter: brightness(1.15); }
.dpc-hero-power.on {
  color: #fff;
  background: linear-gradient(135deg, rgba(var(--dpa, 103,232,249), 0.95), rgba(var(--dpa, 103,232,249), 0.70));
  border-color: rgba(var(--dpa, 103,232,249), 0.50);
  box-shadow: 0 3px 12px rgba(var(--dpa, 103,232,249), 0.40);
}
html[data-theme="light"] .dpc-herocard { background: rgba(0,0,0,0.025); border-color: rgba(0,0,0,0.08); }
html[data-theme="light"] .dpc-hero-ico { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.08); }
html[data-theme="light"] .dpc-hero-power { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.14); }

/* ===== gauge：环形仪表盘（270° 圆弧 + 居中读数）===== */
.dpc-gauge {
  display: inline-flex; flex-direction: column; align-items: center;
  padding: 8px 6px 4px; min-width: 88px; vertical-align: top;
}
.dpc-gauge-dial { position: relative; width: 76px; height: 76px; }
.dpc-gauge-dial svg { width: 76px; height: 76px; display: block; }
.dpc-gauge-track, .dpc-gauge-fill { fill: none; stroke-width: 7; stroke-linecap: round; }
.dpc-gauge-track { stroke: rgba(255,255,255,0.08); }
.dpc-gauge-fill { stroke: #38bdf8; transition: stroke-dasharray 0.4s ease; }
.dpc-gauge.ok  .dpc-gauge-fill { stroke: #34d399; }
.dpc-gauge.mid .dpc-gauge-fill { stroke: #fbbf24; }
.dpc-gauge.low .dpc-gauge-fill { stroke: #f87171; }
.dpc-gauge-val {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: var(--text);
  padding: 0 10px; overflow: hidden;
}
.dpc-gauge.ok  .dpc-gauge-val { color: #34d399; }
.dpc-gauge.mid .dpc-gauge-val { color: #fbbf24; }
.dpc-gauge.low .dpc-gauge-val { color: #f87171; }
.dpc-gauge-unit { font-size: 9.5px; font-weight: 500; color: var(--text-muted); margin-left: 2px; }
.dpc-gauge-lbl {
  margin-top: -6px; font-size: 11.5px; color: var(--text-muted);
  max-width: 96px; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html[data-theme="light"] .dpc-gauge-track { stroke: rgba(0,0,0,0.08); }
html[data-theme="light"] .dpc-gauge.ok  .dpc-gauge-val,
html[data-theme="light"] .dpc-gauge.ok  .dpc-gauge-fill { color: #047857; stroke: #059669; }
html[data-theme="light"] .dpc-gauge.mid .dpc-gauge-val,
html[data-theme="light"] .dpc-gauge.mid .dpc-gauge-fill { color: #b45309; stroke: #d97706; }
html[data-theme="light"] .dpc-gauge.low .dpc-gauge-val,
html[data-theme="light"] .dpc-gauge.low .dpc-gauge-fill { color: #b91c1c; stroke: #dc2626; }

/* —— 查询类控件（button response=true）的返回结果弹窗 —— */
.dpc-query-result { display: flex; flex-direction: column; gap: 14px; }
.dpc-qr-sec { display: flex; flex-direction: column; gap: 6px; }
.dpc-qr-h { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.dpc-qr-pre {
  margin: 0; padding: 10px 12px; border-radius: 8px;
  background: rgba(0,0,0,0.28); border: 1px solid rgba(255,255,255,0.08);
  font-family: var(--mono, ui-monospace, monospace); font-size: 12px; line-height: 1.5;
  color: var(--text); white-space: pre-wrap; word-break: break-word;
  max-height: 320px; overflow: auto;
}
.dpc-qr-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dpc-qr-tbl td {
  padding: 5px 10px; border-bottom: 1px solid rgba(255,255,255,0.06);
  vertical-align: top; word-break: break-word;
}
.dpc-qr-tbl td:first-child { color: var(--text-muted); width: 40%; font-family: var(--mono, ui-monospace, monospace); }
html[data-theme="light"] .dpc-qr-pre { background: rgba(0,0,0,0.05); }
html[data-theme="light"] .dpc-qr-tbl td { border-bottom-color: rgba(0,0,0,0.08); }

/* —— 图标选择器（标签 / 卡片 modal）—— */
.dpanel-iconpick {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 4px;
}
.dpi {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; border-radius: 8px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted); cursor: pointer; transition: all 0.15s ease;
}
.dpi:hover { color: var(--text); border-color: rgba(255,255,255,0.20); }
.dpi.active { background: rgba(56,189,248,0.14); color: #7dd3fc; border-color: rgba(56,189,248,0.40); }

/* —— 卡片编辑 modal：组件编辑器 —— */
.dpanel-comp-list { display: flex; flex-direction: column; gap: 10px; margin: 8px 0; }
.dpanel-comp-row {
  padding: 10px 12px; border-radius: 10px;
  background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.08);
}
.dcr-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.dcr-type {
  flex: 1 1 auto; padding: 6px 10px; border-radius: 8px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.10);
  color: var(--text); font-size: 13px;
}
.dcr-ops { display: inline-flex; gap: 4px; flex: 0 0 auto; }
.dcr-op {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0; border-radius: 6px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted); cursor: pointer; transition: all 0.15s ease;
}
.dcr-op:hover { color: var(--text); border-color: rgba(255,255,255,0.18); }
.dcr-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.dcr-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dcr-field > label { font-size: 11px; color: var(--text-muted); }
.dcr-field input, .dcr-field select, .dcr-field textarea {
  width: 100%; padding: 6px 9px; border-radius: 7px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.10);
  color: var(--text); font-size: 12px;
}
.dcr-field textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.dcr-field input[type="checkbox"] { width: auto; }

/* ===== PC 导航页 ===== */
.pcs-banner .cb-right { text-align: right; gap: 6px; }
.pcs-filter {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 16px; padding: 10px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
}
.pcs-tabs { display: inline-flex; gap: 4px; flex: 0 0 auto; }
.pcs-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted); font-size: 12.5px; cursor: pointer;
  transition: all 0.12s ease;
}
.pcs-tab:hover { color: var(--text); }
.pcs-tab.on {
  background: linear-gradient(135deg, rgba(103,232,249,0.20), rgba(167,139,250,0.18));
  color: #fff; border-color: rgba(103,232,249,0.40);
}
.pcs-tab-cnt {
  display: inline-block; padding: 0 6px; border-radius: 999px;
  background: rgba(255,255,255,0.10); font-size: 10.5px; min-width: 18px; text-align: center;
}
/* tab 前小圆点（开机/关机/离线 三色） */
.pcs-tab-dot {
  display: inline-block;
  width: 7px; height: 7px; border-radius: 50%;
  flex-shrink: 0;
}
.pcs-tab-dot.on { background: #4ade80; box-shadow: 0 0 6px rgba(74, 222, 128, 0.55); }
.pcs-tab-dot.off { background: rgba(255,255,255,0.30); }
.pcs-tab-dot.offline { background: #f43f5e; box-shadow: 0 0 6px rgba(244, 63, 94, 0.55); }
/* 房间下拉筛选：直接复用全局 native <select> 样式（玻璃底 + 青色 chevron + 焦点光环），
   不再自造包装/图标/chevron，保持与设备页"全部 (250)" 等所有 select 的视觉一致。 */
.pcs-room-sel {
  width: auto;
  min-width: 160px;
  max-width: 240px;
  font-size: 13px;
  font-weight: 500;
}
.pcs-search-wrap {
  display: flex; align-items: center; gap: 8px; flex: 1 1 auto;
  padding: 7px 12px; border-radius: 8px;
  background: rgba(0,0,0,0.20); border: 1px solid rgba(255,255,255,0.06);
}
.pcs-search-wrap svg { color: var(--text-muted); flex: 0 0 auto; }
.pcs-search-wrap input {
  flex: 1 1 auto; background: none; border: none; outline: none;
  color: var(--text); font-size: 13px;
}
.pcs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.pc-card {
  position: relative;
  padding: 14px 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  display: flex; flex-direction: column; gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pc-card:hover { border-color: rgba(255,255,255,0.18); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,0.20); }
.pc-card.on      { border-color: rgba(74,222,128,0.28); }
.pc-card.offline { border-color: rgba(244,63,94,0.30); }
.pc-card.on::before, .pc-card.offline::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(circle at top right, currentColor 0%, transparent 50%);
  opacity: 0.08; pointer-events: none;
}
.pc-card.on::before      { color: #4ade80; }
.pc-card.offline::before { color: #f43f5e; }

.pc-card-head {
  display: flex; align-items: center; gap: 10px;
}
.pc-card-ico {
  width: 36px; height: 36px; border-radius: 9px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
  display: grid; place-items: center; color: var(--text-muted);
  flex: 0 0 auto;
}
.pc-card.on .pc-card-ico { color: #4ade80; background: rgba(74,222,128,0.10); border-color: rgba(74,222,128,0.20); }
.pc-card.offline .pc-card-ico { color: #f43f5e; background: rgba(244,63,94,0.10); border-color: rgba(244,63,94,0.20); }
.pc-card-title { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pc-card-title b { font-size: 14px; font-weight: 700; letter-spacing: 0.4px; color: var(--text); }
.pc-card-title .muted { font-size: 11px; }
.pc-card-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
}
.pc-card-badge.on      { background: rgba(74,222,128,0.14); color: #86efac; border-color: rgba(74,222,128,0.28); }
.pc-card-badge.offline { background: rgba(244,63,94,0.14); color: #fda4af; border-color: rgba(244,63,94,0.28); }

.pc-card-body { display: flex; flex-direction: column; gap: 6px; }
.pc-card-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11.5px;
}
.pc-card-row .muted { color: var(--text-muted); }
.pc-card-row .mono { font-family: var(--mono, monospace); font-size: 11px; color: var(--text); }

/* 表单内所有 checkbox 统一着色（青色）+ 尺寸 */
.modal input[type="checkbox"],
.modal-body input[type="checkbox"] {
  accent-color: #67e8f9;
  width: 15px;
  height: 15px;
  cursor: pointer;
  flex: 0 0 auto;
  margin: 0;
  vertical-align: middle;
}

/* 横排 label（带 .inline-check 的 checkbox label）—— 强制覆盖 .field label{display:block;text-transform:uppercase;...}  */
.field label.inline-check {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  margin: 0 !important;
  padding: 8px 14px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-weight: 500 !important;
  font-size: 13px !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  color: var(--text) !important;
  user-select: none;
  white-space: nowrap;
  transition: border-color 0.12s ease;
  width: auto;
}
.field label.inline-check:hover { border-color: rgba(103, 232, 249, 0.35); }

/* 自定义 combobox（用于空调下拉，替代 native <select> 防止滚轮 bug） */
.combo {
  position: relative;
  width: 100%;
}
.combo-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  font-family: inherit;
}
.combo-trigger:hover { border-color: rgba(103, 232, 249, 0.25); }
.combo-trigger:focus-visible { outline: 2px solid rgba(103, 232, 249, 0.5); outline-offset: -1px; }
.combo-current {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.combo-arrow {
  opacity: 0.5;
  font-size: 11px;
  transition: transform 0.15s ease;
}
.combo-panel {
  position: fixed;       /* 用 fixed 脱离 modal-body 的 overflow 裁剪 */
  z-index: 10000;        /* 高于 modal (99) */
  max-height: 340px;
  display: flex;
  flex-direction: column;
  background: var(--glass-2, #101013);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.combo-panel[hidden] { display: none; }
.combo-search {
  flex: 0 0 auto;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 12.5px;
  outline: none;
}
.combo-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 4px;
}
.combo-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12.5px;
  transition: background 0.1s ease;
}
.combo-item:hover { background: rgba(255, 255, 255, 0.06); }
.combo-item.on {
  background: rgba(103, 232, 249, 0.14);
  color: #a5f3fc;
}
.combo-item.private .combo-item-name { color: var(--text-muted); }
.combo-item-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.combo-item-area {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.combo-item-check {
  color: #67e8f9;
  font-weight: bold;
}
.combo-item-hint {
  padding: 6px 10px;
  text-align: center;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
  margin-top: 4px;
}
.combo-item.disabled { opacity: 0.45; cursor: not-allowed; }
.combo-arrow { user-select: none; }

/* —— 行内操作下拉菜单（UI.actionMenu）—— */
.actmenu { display: inline-block; position: relative; }
.actmenu-trigger { display: inline-flex; align-items: center; gap: 4px; }
.actmenu-arrow { font-size: 10px; user-select: none; opacity: .8; }
.actmenu-pop {
  position: fixed;
  z-index: 10000;            /* 高于 modal */
  min-width: 132px;
  padding: 4px;
  background: var(--glass-2, #101013);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.actmenu-pop[hidden] { display: none; }
.actmenu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: var(--text, #e8eaed);
  font-size: 12.5px;
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s ease;
}
.actmenu-item:hover { background: rgba(255, 255, 255, 0.07); }
/* danger 项是 <button class="actmenu-item danger">，会被全局 button.danger 的粉色渐变背景命中；
   这里显式还原为透明背景（仅红色文字），hover 时再给淡红底，避免"粉底+浅红字"对比冲突。 */
.actmenu-item.danger { color: #fca5a5; background: none; box-shadow: none; }
.actmenu-item.danger:hover { background: rgba(248, 113, 113, 0.12); color: #fecaca; box-shadow: none; filter: none; }
html[data-theme="light"] .actmenu-item.danger { color: #dc2626; }
html[data-theme="light"] .actmenu-item.danger:hover { background: rgba(220, 38, 38, 0.08); color: #b91c1c; }
.actmenu-ico { display: inline-flex; align-items: center; opacity: .85; }
.actmenu-lbl { flex: 1 1 auto; white-space: nowrap; }
html[data-theme="light"] .actmenu-pop {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}
html[data-theme="light"] .actmenu-item:hover { background: rgba(0, 0, 0, 0.05); }

/* 顶栏 / 代客横幅的门店下拉换成 combo 后：外层 .store-filter / .view-as-ha-slot
   本身已经是带边框的胶囊，里面的 combo 不能再画一层框/箭头（否则"框中框"+双 chevron）。
   这些选择器特异性 >= 旧的 native <select> 规则，确保覆盖掉它们的 background-image/padding。 */
.topbar .store-filter .combo.store-filter-sel,
.view-as-banner .view-as-ha-slot .combo.store-filter-sel {
  background-image: none !important;
  padding: 0 !important;
  width: auto;
  min-width: 90px;
  max-width: 200px;
}
.topbar .store-filter .combo.store-filter-sel .combo-trigger,
.view-as-banner .view-as-ha-slot .combo.store-filter-sel .combo-trigger {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 2px !important;
  height: auto !important;
  min-height: 0 !important;
}

/* 这些类原本是给 native <select> 画外框的；换成 combo 后由 combo-trigger 画框，
   去掉 wrapper 自带的 padding/底色/边框，避免出现"框中框"。其 flex/width 尺寸保留。 */
.dpc-mode-sel.combo,
.dcr-type.combo {
  padding: 0;
  background: transparent;
  border: 0;
}

/* 行内 / 工具栏场景：combo 默认 width:100%（表单里铺满），但在筛选条 / 工具栏 /
   面包屑等紧凑场景里按内容宽度（沿用原生 <select> 的 width:auto + min-width 观感）。
   这些容器内的 combo 若未显式给宽度，就不撑满。 */
.tbl-toolbar .combo,
.filter-bar .combo,
.console-filter .combo,
.cf-actions .combo,
.pcs-filter .combo,
.dpanel-bar .combo,
.te-row .combo,
.te-leaf .combo,
.te-act .combo,
.head-select.combo {
  width: auto;
  max-width: 100%;
}
/* combo 触发器在紧凑工具栏里高度对齐其它 32~36px 控件 */
.tbl-toolbar .combo .combo-trigger,
.filter-bar .combo .combo-trigger { padding-top: 7px; padding-bottom: 7px; }

/* field 头：左侧 label，右侧 私人开关 */
.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  gap: 12px;
}
.field-head > label:first-child {
  margin: 0;
}
.field-head > .private-toggle,
.private-toggle {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  color: var(--text-muted) !important;
  white-space: nowrap;
  margin: 0 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  user-select: none;
  flex: 0 0 auto;
}
.private-toggle:hover { color: var(--text) !important; }

/* PC picker 顶部"自动识别到 N 个前缀"提示 */
.pc-hint {
  padding: 4px 0 8px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
  margin-bottom: 6px;
}

/* 隐藏区 / 提示行（贯通所有列） */
.pc-group-hint {
  grid-column: 1 / -1;
  padding: 8px 4px;
  text-align: center;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
  margin-top: 6px;
}

/* PC tile：卡片化，左 checkbox + 右内容（名 / ID / area / 通电标签） */
.pc-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
  min-height: 38px;
}
.pc-opt:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.14);
}
.pc-opt.on {
  background: rgba(103, 232, 249, 0.10);
  border-color: rgba(103, 232, 249, 0.40);
}
.pc-opt .pc-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}
.pc-opt .pc-name {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.3px;
}
.pc-opt .pc-eid {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 400;
  opacity: 0.5;
  font-family: var(--mono, monospace);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pc-opt .pc-area {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pc-opt .pc-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
}
.pc-opt .pc-dot.on {
  background: #67e8f9;
  box-shadow: 0 0 6px rgba(103, 232, 249, 0.6);
}
.tag.tiny { font-size: 10px; padding: 1px 5px; }

/* 事件时间轴 */
.event-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 540px;
  overflow-y: auto;
}
.event-item {
  display: grid;
  grid-template-columns: 24px 70px 1fr 120px;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 12.5px;
}
.event-item:last-child { border-bottom: 0; }
.event-item .ev-ico { color: var(--text-muted); }
.event-item .ev-kind { font-family: monospace; font-size: 11.5px; color: var(--text-muted); }
.event-item .ev-msg { color: var(--text); }
.event-item.ev-warn { background: rgba(245, 158, 11, 0.04); }
.event-item.ev-warn .ev-ico { color: #fbbf24; }
.event-item.ev-err  { background: rgba(249, 115, 115, 0.05); }
.event-item.ev-err  .ev-ico { color: #fca5a5; }
.event-item.ev-err  .ev-msg { color: #fca5a5; }

/* row-between 工具类（公用，多处用到） */
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* =====================================================
   控制台 Dashboard（图1 风格）
   ===================================================== */
.dash-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 18px;
  gap: 16px;
  flex-wrap: wrap;
}
.dash-title-row { display: flex; flex-direction: column; gap: 4px; }
.dash-title { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: 0.2px; }
.dash-sub { color: var(--text-muted); }
/* ===== KPI 4 大卡 ===== */
.dash-kpi {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
@media (max-width: 960px) { .dash-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: transform .15s, border-color .15s;
}
.kpi-card::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--kpi-accent, transparent);
  opacity: 0.08;
  pointer-events: none;
}
.kpi-card:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.16); }
.kpi-card.kpi-blue { --kpi-accent: radial-gradient(circle at 20% 0%, #5b9bff 0%, transparent 70%); }
.kpi-card.kpi-cool { --kpi-accent: radial-gradient(circle at 20% 0%, #38bdf8 0%, transparent 70%); }
.kpi-card.kpi-pink { --kpi-accent: radial-gradient(circle at 20% 0%, #f472b6 0%, transparent 70%); }
.kpi-card.kpi-grey { --kpi-accent: radial-gradient(circle at 20% 0%, #94a3b8 0%, transparent 70%); }
.kpi-row1 { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 12.5px; }
.kpi-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
}
.kpi-card.kpi-blue .kpi-ico { color: #93c5fd; background: rgba(91,155,255,0.16); }
.kpi-card.kpi-cool .kpi-ico { color: #7dd3fc; background: rgba(56,189,248,0.16); }
.kpi-card.kpi-pink .kpi-ico { color: #f9a8d4; background: rgba(244,114,182,0.16); }
.kpi-card.kpi-grey .kpi-ico { color: #cbd5e1; background: rgba(148,163,184,0.16); }
.kpi-label { font-size: 13px; color: var(--text); font-weight: 500; }
.kpi-num {
  margin-top: 12px;
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: 0.5px;
}
.kpi-num b { font-weight: 700; }
.kpi-den { font-size: 14px; color: var(--text-muted); font-weight: 500; margin-left: 4px; }
.kpi-bar {
  margin-top: 10px;
  height: 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 99px;
  overflow: hidden;
}
.kpi-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .35s ease;
}
.kpi-card.kpi-blue .kpi-bar-fill { background: linear-gradient(90deg, #5b9bff, #7dd3fc); }
.kpi-card.kpi-cool .kpi-bar-fill { background: linear-gradient(90deg, #38bdf8, #0ea5e9); }
.kpi-card.kpi-pink .kpi-bar-fill { background: linear-gradient(90deg, #f472b6, #ec4899); }
.kpi-card.kpi-grey .kpi-bar-fill { background: linear-gradient(90deg, #94a3b8, #64748b); }
.kpi-foot {
  margin-top: 8px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px;
}
.kpi-pct { color: var(--text); font-weight: 600; }
.kpi-hint { color: var(--text-muted); }

/* ===== 图表区（环 + 柱）===== */
.dash-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
@media (max-width: 960px) { .dash-charts { grid-template-columns: 1fr; } }
.dash-chart-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 16px 18px;
}
.dash-chart-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.dash-chart-title { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text); }
.dash-chart-title svg { color: #7dd3fc; }
.dash-chart-sub { color: var(--text-muted); }
.dash-chart-body { display: flex; align-items: center; gap: 24px; }
.dash-ring { flex-shrink: 0; }
/* 环形图：SVG 内的背景环 / 中央百分比 / 副标题文字
   统一用 class + CSS 控制颜色，避免 SVG fill 属性硬编码导致浅色主题下不可读 */
.dash-ring .ring-bg  { stroke: rgba(255, 255, 255, 0.08); }
.dash-ring .ring-pct { fill: var(--ink); }
.dash-ring .ring-lbl { fill: var(--ink-faded); }
.dash-chart-meta { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.cm-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.cm-row b { margin-left: auto; font-weight: 700; color: var(--text); font-size: 14px; }
.cm-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }

/* PC 柱状图 */
.dash-bars { width: 100%; display: flex; flex-direction: column; gap: 14px; }
.dash-bar-row { display: grid; grid-template-columns: 50px 1fr 80px; align-items: center; gap: 12px; }
.dash-bar-lbl { font-size: 13px; color: var(--text-muted); }
.dash-bar-track {
  height: 14px;
  background: rgba(255,255,255,0.05);
  border-radius: 99px;
  overflow: hidden;
}
.dash-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .35s ease;
}
.dash-bar-fill.on { background: linear-gradient(90deg, #34d399, #10b981); }
.dash-bar-fill.off { background: linear-gradient(90deg, #64748b, #475569); }
.dash-bar-fill.offline { background: linear-gradient(90deg, #ef4444, #b91c1c); }
.dash-bar-val { text-align: right; color: var(--text); font-size: 13px; }
.dash-bar-val b { font-weight: 700; }

/* ===== 异常报警区 ===== */
.dash-alert-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.dash-alert-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.dash-alert-head .dash-chart-title svg { color: #fbbf24; }
.dash-alert-list { display: flex; flex-direction: column; }
.dash-alert-empty { padding: 18px 0; text-align: center; }
.dash-alert-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  border: 1px solid transparent;
  margin-bottom: 6px;
}
.dash-alert-item.warn { background: rgba(245, 158, 11, 0.05); border-color: rgba(245, 158, 11, 0.15); }
.dash-alert-item.err { background: rgba(239, 68, 68, 0.06); border-color: rgba(239, 68, 68, 0.18); }
.dash-alert-tag {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}
.dash-alert-tag.warn { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
.dash-alert-tag.err  { background: rgba(239, 68, 68, 0.18);  color: #fca5a5; }
.dash-alert-room { flex-shrink: 0; color: var(--text); }
.dash-alert-msg { flex: 1; color: var(--text); }
.dash-alert-eid { flex-shrink: 0; font-family: monospace; color: var(--text-muted); }

/* AI 任务列表行内的健康徽标（巡检问题的精简提示，hover 看详情） */
.ai-health-badge {
  display: inline-block;
  padding: 1px 7px;
  margin-left: 4px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: middle;
  cursor: help;
}
.ai-health-badge.warn { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
.ai-health-badge.err  { background: rgba(239, 68, 68, 0.18);  color: #fca5a5; }

/* ===== 快捷入口 ===== */
.dash-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 960px) { .dash-links { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dash-link-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  transition: transform .15s, border-color .15s, background .15s;
}
.dash-link-card:hover { transform: translateY(-1px); border-color: rgba(255,255,255,0.18); background: rgba(255,255,255,0.05); }
.dlk-ico {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.dash-link-card.lnk-blue .dlk-ico { color: #93c5fd; background: rgba(91,155,255,0.16); }
.dash-link-card.lnk-green .dlk-ico { color: #6ee7b7; background: rgba(16,185,129,0.16); }
.dash-link-card.lnk-purple .dlk-ico { color: #c4b5fd; background: rgba(139,92,246,0.16); }
.dash-link-card.lnk-grey .dlk-ico { color: #cbd5e1; background: rgba(148,163,184,0.16); }
.dlk-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.dlk-label { font-size: 14px; font-weight: 600; }
.dlk-desc { color: var(--text-muted); }
.dlk-arrow { color: var(--text-muted); }
.dash-link-card:hover .dlk-arrow { color: var(--text); transform: translateX(2px); transition: all .15s; }

/* ===== 房态卡 CRUD 工具 ===== */
.rp-head-right { display: flex; align-items: center; gap: 8px; }
.rp-tools { display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.room-pro:hover .rp-tools { opacity: 1; }
.rp-tool {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
  width: 24px; height: 24px;
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all .15s;
}
.rp-tool:hover { color: var(--text); border-color: rgba(255,255,255,0.18); background: rgba(255,255,255,0.08); }
.rp-tool.danger:hover { color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.1); }

/* ============================================================
   浅色主题：综合兜底覆盖
   ------------------------------------------------------------
   说明：上面的组件样式里硬编码了大量 rgba(255,255,255,*) 作为白色
   高光 / 玻璃面板背景，以及 rgba(0,0,0,0.2+) 的暗色搜索框/工具条
   背景；这些都只为深色面板设计，切到浅色主题时会出现：
     - 白底元素消失（白色高光叠在浅色背景上完全看不到）
     - 暗色搜索框 / 过滤器/弹层在浅色背景上太"重"
     - "#fff"白文字、白渐变文字在白底上不可读
     - 范围滑块 / 开关 / 主按钮 / 登录提交按钮 等的暗色渐变
   下面这段统一翻转最常见的几类硬编码颜色，确保浅色主题下整页可读。
   ============================================================ */

/* —— 文本选中、滚动条：白色 → 深色 —— */
html[data-theme="light"] ::selection {
  background: rgba(0, 0, 0, 0.14);
  color: #18181b;
}
html[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(0,0,0,0.18), rgba(0,0,0,0.08));
}
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #71717a, #18181b);
}
/* Firefox 浅色主题滚动条配色（与 webkit 深浅保持一致） */
html[data-theme="light"] {
  scrollbar-color: rgba(0,0,0,0.22) transparent;
}

/* —— 链接：去掉白色 text-shadow（在浅色上是奇怪的白雾） —— */
html[data-theme="light"] a:hover {
  color: var(--ink);
  text-shadow: none;
}

/* —— 通用按钮：去掉所有 "#fff" 白字（在浅色 hover 状态下不可读） —— */
html[data-theme="light"] button:hover,
html[data-theme="light"] .btn:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.28);
  color: var(--ink);
  box-shadow:
    0 1px 0 rgba(0,0,0,0.04) inset,
    0 6px 20px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.12);
}
/* primary / 主按钮：保留深色填充（设计语言），但去掉过度阴影 */
html[data-theme="light"] button.primary,
html[data-theme="light"] .btn.primary {
  background: linear-gradient(135deg, #18181b 0%, #27272a 50%, #3f3f46 100%);
  color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.18);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.10) inset;
}
html[data-theme="light"] button.primary:hover,
html[data-theme="light"] .btn.primary:hover {
  background: linear-gradient(135deg, #27272a 0%, #3f3f46 50%, #52525b 100%);
  color: #ffffff;
  border-color: rgba(0, 0, 0, 0.30);
}
html[data-theme="light"] button.ghost {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: var(--ink-soft);
}
html[data-theme="light"] button.ghost:hover {
  color: var(--ink);
  border-color: rgba(0, 0, 0, 0.32);
  background: rgba(0, 0, 0, 0.05);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.10);
}
html[data-theme="light"] button.icon-only:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.10);
}
html[data-theme="light"] button.link { color: var(--ink); }
html[data-theme="light"] button.link:hover { color: #000; }

/* —— 输入框：补全 focus 和自动填充的浅色配色 ——
   同样必须用 background-color，否则 select:focus 时下拉箭头 SVG 会被擦掉 */
html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus {
  border-color: rgba(0, 0, 0, 0.45);
  background-color: #ffffff;
  box-shadow:
    0 0 0 3px rgba(0, 0, 0, 0.08),
    0 0 16px rgba(0, 0, 0, 0.05);
}
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder { color: var(--ink-dim); }

/* 浏览器自动填充：浅色主题需要白色蒙版 */
html[data-theme="light"] input:-webkit-autofill,
html[data-theme="light"] input:-webkit-autofill:hover,
html[data-theme="light"] input:-webkit-autofill:focus,
html[data-theme="light"] input:-webkit-autofill:active,
html[data-theme="light"] textarea:-webkit-autofill,
html[data-theme="light"] textarea:-webkit-autofill:hover,
html[data-theme="light"] textarea:-webkit-autofill:focus,
html[data-theme="light"] textarea:-webkit-autofill:active,
html[data-theme="light"] select:-webkit-autofill,
html[data-theme="light"] select:-webkit-autofill:hover,
html[data-theme="light"] select:-webkit-autofill:focus,
html[data-theme="light"] select:-webkit-autofill:active {
  -webkit-text-fill-color: var(--ink) !important;
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
          box-shadow: 0 0 0 1000px #ffffff inset !important;
  caret-color: var(--ink);
  border-color: rgba(0, 0, 0, 0.12) !important;
}
html[data-theme="light"] .login-field input:-webkit-autofill,
html[data-theme="light"] .login-field input:-webkit-autofill:hover,
html[data-theme="light"] .login-field input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--ink) !important;
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
          box-shadow: 0 0 0 1000px #ffffff inset !important;
  border: 1px solid rgba(0, 0, 0, 0.10) !important;
}
html[data-theme="light"] .login-field input:-webkit-autofill:focus {
  -webkit-box-shadow:
    0 0 0 1000px #ffffff inset,
    0 0 0 3px rgba(0, 0, 0, 0.10) !important;
          box-shadow:
    0 0 0 1000px #ffffff inset,
    0 0 0 3px rgba(0, 0, 0, 0.10) !important;
  border: 1px solid rgba(0, 0, 0, 0.45) !important;
}
/* 修正 select 下拉箭头颜色
   注意：连同 background-repeat / background-position 一起重新声明，
   防止任何上游误用 background shorthand 把这两个属性重置成默认值
   (会让箭头平铺成 "v v v v" 一排) */
html[data-theme="light"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2352525b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
html[data-theme="light"] select option {
  background-color: #ffffff;
  color: var(--ink);
}

/* —— Sidebar / Topbar：清理掉硬编码的深色渐变 background-image —— */
html[data-theme="light"] .sidebar {
  background:
    linear-gradient(180deg,
      rgba(0, 0, 0, 0.025) 0%,
      transparent 35%,
      transparent 65%,
      rgba(0, 0, 0, 0.025) 100%),
    rgba(255, 255, 255, 0.78);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  border-image: none;
  box-shadow:
    inset -1px 0 0 0 rgba(0, 0, 0, 0.04),
    4px 0 32px rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .sidebar::before {
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.18), transparent);
}
html[data-theme="light"] .sidebar .footer-actions {
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.04) 100%);
}
html[data-theme="light"] .sidebar .role-chip {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
html[data-theme="light"] .sidebar-toggle {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.10);
  color: var(--ink-soft);
}
html[data-theme="light"] .sidebar-toggle:hover {
  border-color: rgba(0, 0, 0, 0.30);
  color: var(--ink);
  background: rgba(0, 0, 0, 0.06);
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .sidebar .nav-item:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--ink);
}
html[data-theme="light"] .sidebar .nav-item.active {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.10) 0%, rgba(0, 0, 0, 0.04) 60%, transparent 100%);
  color: var(--ink);
  box-shadow:
    inset 2px 0 0 0 rgba(0, 0, 0, 0.55),
    0 4px 18px rgba(0, 0, 0, 0.06);
}
html[data-theme="light"] .sidebar .nav-item.active .icn { color: var(--ink); }
html[data-theme="light"] .sidebar .nav-item.active::after {
  background: var(--ink);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
}
html[data-theme="light"] .sidebar .nav-section:hover { color: var(--ink); }
html[data-theme="light"] .sidebar .nav-section::before {
  background: rgba(0, 0, 0, 0.45);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.18);
}
html[data-theme="light"] .shell.collapsed .sidebar-toggle {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.10);
}
html[data-theme="light"] .shell.collapsed .sidebar-toggle:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.30);
}
html[data-theme="light"] .shell.collapsed .sidebar .nav-item:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--ink);
}
html[data-theme="light"] .shell.collapsed .sidebar .nav-item.active {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.03) 100%);
  color: var(--ink);
  box-shadow: inset 2px 0 0 0 rgba(0, 0, 0, 0.55);
}

/* 品牌图标 + 文字：把白色渐变换成深色 */
html[data-theme="light"] .sidebar .brand-icon {
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 55%),
    linear-gradient(135deg, #3f3f46 0%, #18181b 50%, #3f3f46 100%);
  border: 1px solid rgba(0, 0, 0, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 0 rgba(0, 0, 0, 0.20),
    0 6px 18px rgba(0, 0, 0, 0.18);
}
html[data-theme="light"] .sidebar .brand-text::before {
  background: linear-gradient(180deg, #18181b 0%, #52525b 50%, #a1a1aa 100%);
  box-shadow: none;
}
html[data-theme="light"] .sidebar .brand-text .bt-main {
  background: linear-gradient(135deg, #18181b 0%, #3f3f46 35%, #52525b 70%, #71717a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: none;
}
html[data-theme="light"] .sidebar .brand-text .bt-sub {
  color: rgba(82, 82, 91, 0.85);
}

/* Topbar：去掉硬编码深色玻璃，使用浅色玻璃 */
html[data-theme="light"] .topbar {
  background:
    linear-gradient(90deg,
      rgba(0, 0, 0, 0.025) 0%,
      transparent 30%,
      transparent 70%,
      rgba(0, 0, 0, 0.025) 100%),
    rgba(255, 255, 255, 0.7);
}
html[data-theme="light"] .topbar::after {
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.20), rgba(0, 0, 0, 0.20), transparent);
}
html[data-theme="light"] .topbar .store-filter-sel option {
  background: #ffffff;
  color: var(--ink);
}

/* —— 页头标题渐变文字：白渐变 → 深渐变 —— */
html[data-theme="light"] .page-head .title {
  background: linear-gradient(135deg, #18181b 0%, #52525b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* —— Card / Panel / Stat / KPI：白色装饰高光线条不可见，换成深色 —— */
html[data-theme="light"] .card::before,
html[data-theme="light"] .panel::before,
html[data-theme="light"] .ha-card::before,
html[data-theme="light"] .dev::before,
html[data-theme="light"] .kpi::before {
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.10), transparent);
}
html[data-theme="light"] .card h2::after {
  background: linear-gradient(to right, rgba(0, 0, 0, 0.30), transparent);
  box-shadow: none;
}
html[data-theme="light"] .stat,
html[data-theme="light"] .kpi,
html[data-theme="light"] .ha-card,
html[data-theme="light"] .ha-row,
html[data-theme="light"] .dev,
html[data-theme="light"] .kpi-card,
html[data-theme="light"] .dash-chart-card,
html[data-theme="light"] .dash-alert-card,
html[data-theme="light"] .dash-link-card,
html[data-theme="light"] .room-card,
html[data-theme="light"] .season-card,
html[data-theme="light"] .season-panel,
html[data-theme="light"] .console-filter,
html[data-theme="light"] .field-readonly {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--ink);
}
html[data-theme="light"] .kpi-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.7));
}
html[data-theme="light"] .stat:hover,
html[data-theme="light"] .kpi:hover,
html[data-theme="light"] .ha-card:hover,
html[data-theme="light"] .room-pro:hover,
html[data-theme="light"] .dev:hover,
html[data-theme="light"] .kpi-card:hover,
html[data-theme="light"] .pc-card:hover,
html[data-theme="light"] .dash-link-card:hover,
html[data-theme="light"] .season-card:hover {
  border-color: rgba(0, 0, 0, 0.20);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
}

/* —— Devices/PC/Room/Season 类：白底面板 + 边框 —— */
html[data-theme="light"] .pc-tile,
html[data-theme="light"] .area-detail-stats > div,
html[data-theme="light"] .pcs-tab,
html[data-theme="light"] .pcs-filter,
html[data-theme="light"] .pc-card,
html[data-theme="light"] .room-pro,
html[data-theme="light"] .rp-ac,
html[data-theme="light"] .rp-pc,
html[data-theme="light"] .rp-pc-stat,
html[data-theme="light"] .rp-tool,
html[data-theme="light"] .ac-pad-state,
html[data-theme="light"] .ac-pad-power,
html[data-theme="light"] .ac-pad-btn,
html[data-theme="light"] .ac-mode-btn,
html[data-theme="light"] .ac-fan-btn,
html[data-theme="light"] .ac-swing-btn,
html[data-theme="light"] .ac-mode,
html[data-theme="light"] .pc-card-badge,
html[data-theme="light"] .pc-card-ico,
html[data-theme="light"] .pc-opt,
html[data-theme="light"] .pc-opt .pc-area,
html[data-theme="light"] .combo-item-area,
html[data-theme="light"] .chip,
html[data-theme="light"] .chip-btn,
html[data-theme="light"] .range-custom .chip-date,
html[data-theme="light"] .kbd,
html[data-theme="light"] .cb-chip,
html[data-theme="light"] .season-tag,
html[data-theme="light"] .season-head-r,
html[data-theme="light"] .field label.inline-check,
html[data-theme="light"] .combo-trigger {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.10);
  color: var(--ink);
}
html[data-theme="light"] .rp-pc,
html[data-theme="light"] .rp-pc-stat,
html[data-theme="light"] .ac-mode,
html[data-theme="light"] .ac-pad-state,
html[data-theme="light"] .ac-pad-power,
html[data-theme="light"] .ac-pad-group-lbl,
html[data-theme="light"] .ac-mode-btn,
html[data-theme="light"] .ac-fan-btn,
html[data-theme="light"] .ac-swing-btn,
html[data-theme="light"] .pc-card-badge,
html[data-theme="light"] .pc-card-ico {
  color: var(--ink-faded);
}
html[data-theme="light"] .pcs-tab-cnt {
  background: rgba(0, 0, 0, 0.08);
  color: var(--ink);
}
html[data-theme="light"] .pcs-tab-dot.off {
  background: rgba(0, 0, 0, 0.30);
}
html[data-theme="light"] .rp-head {
  border-bottom-color: rgba(0, 0, 0, 0.10);
}
html[data-theme="light"] .room-pro:hover,
html[data-theme="light"] .pc-card:hover,
html[data-theme="light"] .pc-opt:hover {
  border-color: rgba(0, 0, 0, 0.20);
}
html[data-theme="light"] .rp-tool:hover {
  color: var(--ink);
  border-color: rgba(0, 0, 0, 0.20);
  background: rgba(0, 0, 0, 0.06);
}
html[data-theme="light"] .ac-mode-btn:hover,
html[data-theme="light"] .ac-fan-btn:hover,
html[data-theme="light"] .ac-swing-btn:hover {
  color: var(--ink);
  border-color: rgba(0, 0, 0, 0.20);
}
html[data-theme="light"] .ac-pad-btn:hover:not(:disabled) {
  background: rgba(103, 232, 249, 0.20);
  border-color: rgba(8, 145, 178, 0.45);
  color: #0e7490;
}
/* tab.on / chip.active：保留主色，但在浅色下用更深的对比 */
html[data-theme="light"] .chip-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.30);
  color: var(--ink);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.10);
}
html[data-theme="light"] .chip-btn.active {
  background: linear-gradient(135deg, #18181b 0%, #3f3f46 100%);
  border-color: rgba(0, 0, 0, 0.30);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}
html[data-theme="light"] .chip:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.30);
  color: var(--ink);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .pc-card:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .data-table.room-list-tbl th,
html[data-theme="light"] .data-table.room-list-tbl td {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .data-table.room-list-tbl thead th {
  background: rgba(0, 0, 0, 0.04);
}
html[data-theme="light"] .data-table.room-list-tbl tbody tr:hover {
  background: rgba(0, 0, 0, 0.03);
}

/* —— 全局 table（默认表）的浅色覆盖 —— */
html[data-theme="light"] table {
  border-color: rgba(0, 0, 0, 0.10);
}
html[data-theme="light"] th {
  background: rgba(0, 0, 0, 0.04);
  color: var(--ink-soft);
  border-bottom-color: rgba(0, 0, 0, 0.20);
}
html[data-theme="light"] td {
  border-bottom-color: rgba(0, 0, 0, 0.05);
}
html[data-theme="light"] tbody tr:nth-child(even) { background: rgba(0, 0, 0, 0.02); }
html[data-theme="light"] tbody tr:hover { background: rgba(0, 0, 0, 0.05); }

/* —— 暗色搜索条 / 过滤器（背景 rgba(0,0,0,0.20) 的）→ 浅灰玻璃 —— */
html[data-theme="light"] .cf-search,
html[data-theme="light"] .cf-view,
html[data-theme="light"] .pcs-search-wrap,
html[data-theme="light"] .pc-list,
html[data-theme="light"] .combo-search,
html[data-theme="light"] .modal-foot {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.10);
  color: var(--ink);
}
html[data-theme="light"] .cf-search input,
html[data-theme="light"] .pcs-search-wrap input {
  color: var(--ink);
  font-weight: 500;
}
html[data-theme="light"] .cf-toggle,
html[data-theme="light"] .cf-search svg,
html[data-theme="light"] .pcs-search-wrap svg,
html[data-theme="light"] .cf-view-btn {
  color: var(--ink-faded);
}
html[data-theme="light"] .cf-toggle:hover,
html[data-theme="light"] .cf-view-btn:hover {
  color: var(--ink);
}
/* .pcs-room-sel 是 native <select>，复用 input/select 的全局浅色覆盖（在更上方定义），
   这里无需单独写，保证它和"全部 (250)"等设备页 select 完全一致。 */

/* —— Modal box / Toast / Modal-bg —— */
html[data-theme="light"] .modal-box {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.10);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.04) inset,
    0 30px 80px rgba(0, 0, 0, 0.20);
}
html[data-theme="light"] .modal-box::before {
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.20), rgba(0, 0, 0, 0.20), transparent);
}
html[data-theme="light"] .modal-bg {
  background: rgba(0, 0, 0, 0.32) !important;
}
html[data-theme="light"] .modal-head {
  border-bottom-color: rgba(0, 0, 0, 0.10);
  color: var(--ink);
}
html[data-theme="light"] .modal-foot {
  border-top-color: rgba(0, 0, 0, 0.10);
}
html[data-theme="light"] .toast {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--ink);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.04) inset,
    0 12px 40px rgba(0, 0, 0, 0.15);
}

/* —— Tags：白色背景与边框 → 浅色版 —— */
html[data-theme="light"] .tag {
  background: rgba(0, 0, 0, 0.04);
}
html[data-theme="light"] .tag-disabled {
  color: var(--ink-dim);
  background: rgba(0, 0, 0, 0.03);
}
html[data-theme="light"] .logs-wrap .tag-plain {
  color: var(--ink-soft);
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.18);
}
html[data-theme="light"] .logs-wrap .tag-info {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
  border-color: rgba(0, 0, 0, 0.30);
}

/* —— Range slider / Switch / Build progress：暗色渐变 → 浅色 —— */
html[data-theme="light"] input[type=range]::-webkit-slider-runnable-track {
  background: linear-gradient(to right, #d4d4d8, #a1a1aa);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.10);
}
html[data-theme="light"] input[type=range]::-webkit-slider-thumb {
  background: #18181b;
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.18),
    0 0 8px rgba(0, 0, 0, 0.15);
}
html[data-theme="light"] .switch-wrap input[type="checkbox"] {
  background: rgba(0, 0, 0, 0.10);
  border-color: rgba(0, 0, 0, 0.18);
}
html[data-theme="light"] .switch-wrap input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #18181b, #3f3f46);
  border-color: rgba(0, 0, 0, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}
html[data-theme="light"] .season-toggle .toggle-track {
  background: rgba(0, 0, 0, 0.10);
  border-color: rgba(0, 0, 0, 0.15);
}
html[data-theme="light"] .build-progress-bar {
  background: rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .build-log {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.10);
  color: var(--ink);
}
html[data-theme="light"] .build-check {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

/* —— 进度条 / 比例条背景（rgba(255,255,255,0.06) 类）→ 浅灰 —— */
html[data-theme="light"] .ratio-bar,
html[data-theme="light"] .cb-bar,
html[data-theme="light"] .kpi-bar,
html[data-theme="light"] .dash-bar-track,
html[data-theme="light"] .season-head-r .patrol-bar {
  background: rgba(0, 0, 0, 0.07);
}

/* —— Console banner（彩色渐变 banner 在浅色下仍可读，但边框要变） —— */
html[data-theme="light"] .console-banner {
  background: linear-gradient(135deg, rgba(103,232,249,0.14) 0%, rgba(167,139,250,0.10) 60%, rgba(255,255,255,0) 100%);
  border-color: rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .cb-chip {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.10);
}

/* —— Login 页：完整浅色适配（最关键，登录前就是这一页） —— */
html[data-theme="light"] .login-panel {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.03) inset,
    0 32px 80px rgba(0, 0, 0, 0.18);
}
html[data-theme="light"] .login-panel::before {
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.14), transparent);
}
html[data-theme="light"] .login-info {
  background:
    radial-gradient(460px 300px at 30% 32%, rgba(0, 0, 0, 0.04), transparent 70%),
    radial-gradient(420px 260px at 100% 100%, rgba(236, 72, 153, 0.10), transparent 70%),
    radial-gradient(300px 220px at 50% 50%, rgba(0, 0, 0, 0.03), transparent 75%);
  border-right: 1px solid rgba(0, 0, 0, 0.06);
}
html[data-theme="light"] .login-info::before {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 72, 153, 0.06) 1px, transparent 1px);
}
html[data-theme="light"] .brand-title h2 {
  background: linear-gradient(135deg, #18181b 0%, #3f3f46 50%, #71717a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: none;
}
html[data-theme="light"] .brand-title p::before,
html[data-theme="light"] .brand-title p::after {
  background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.30), transparent);
}
html[data-theme="light"] .lf-brand {
  background: linear-gradient(135deg, #18181b 0%, #52525b 60%, #a1a1aa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
html[data-theme="light"] .lf-brand::before {
  background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.32) 30%, rgba(0, 0, 0, 0.55));
  box-shadow: none;
}
html[data-theme="light"] .lf-brand::after {
  background: linear-gradient(to right, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.30) 70%, transparent);
  box-shadow: none;
}
html[data-theme="light"] .lf-head h1 { color: var(--ink); }
html[data-theme="light"] .login-field input {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.10);
  color: var(--ink);
}
html[data-theme="light"] .login-field input:focus {
  border-color: rgba(0, 0, 0, 0.45);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .lf-toggle:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.05);
}
html[data-theme="light"] .login-submit {
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0) 55%),
    linear-gradient(135deg, #18181b 0%, #27272a 50%, #3f3f46 100%);
  border: 1px solid rgba(0, 0, 0, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.20),
    inset 0 -1px 0 rgba(0, 0, 0, 0.20),
    0 10px 28px rgba(0, 0, 0, 0.20);
}
html[data-theme="light"] .login-submit:hover {
  filter: brightness(1.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 14px 36px rgba(0, 0, 0, 0.25);
}
html[data-theme="light"] .login-footer {
  border-top-color: rgba(0, 0, 0, 0.10);
}
html[data-theme="light"] .login-footer .lf-beian:hover {
  color: var(--ink);
  text-shadow: none;
}

/* —— Combo / 自定义下拉浮层：硬编码深色 → 浅色 —— */
html[data-theme="light"] .combo-panel {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}
html[data-theme="light"] .combo-search {
  background: rgba(0, 0, 0, 0.04);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--ink);
}
html[data-theme="light"] .combo-item:hover {
  background: rgba(0, 0, 0, 0.05);
}
html[data-theme="light"] .combo-item-hint {
  border-top-color: rgba(0, 0, 0, 0.08);
}

/* —— 复制框 / iframe / 输入分组 —— */
html[data-theme="light"] .copy-input {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.10);
}
html[data-theme="light"] .copy-input button {
  background: rgba(0, 0, 0, 0.04);
  border-left-color: rgba(0, 0, 0, 0.10);
}
html[data-theme="light"] .copy-input button:hover {
  background: rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] iframe.full {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.10);
}

/* —— 仪表盘事件项 / 时间线 / 房间名渐变文字 —— */
html[data-theme="light"] .event-item {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}
html[data-theme="light"] .ratio-text b { color: #0e7490; }

/* —— Spinner / loading —— */
html[data-theme="light"] .loading::before {
  border: 2px solid rgba(0, 0, 0, 0.10);
  border-top-color: #18181b;
  border-right-color: #52525b;
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.10));
}
html[data-theme="light"] .logs-wrap.is-refreshing::after {
  border: 2px solid rgba(0, 0, 0, 0.18);
  border-top-color: #18181b;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.12);
}

/* —— 装饰阴影 / 高光：把白色光晕替换为不可见的弱阴影 —— */
html[data-theme="light"] .area-section .area-title::before {
  background: var(--grad-text);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.18);
}
html[data-theme="light"] .area-section .area-title::after {
  background-image: linear-gradient(to right, rgba(0, 0, 0, 0.22), transparent);
}

/* —— 滚动条轨道在浅色主题加点对比 —— */
html[data-theme="light"] ::-webkit-scrollbar-track {
  background: transparent;
}

/* ============================================================
   浅色主题 · 第二批：字体颜色 / 卡片状态高亮 / 区块强调色
   ------------------------------------------------------------
   原版组件大量用 tailwind 300/400 级浅色作为"语义色文字"，例如
   #86efac(绿)、#fca5a5(红)、#a5f3fc(青)、#d1fae5(薄荷)、#fda4af(粉)、
   #c4b5fd(紫)、#cbd5e1(灰)、#fbbf24(金)、#fcd34d(黄)、#67e8f9(青)、
   #7dd3fc(蓝)、#93c5fd(蓝)、#f9a8d4(粉)、#6ee7b7(绿) ……
   它们都是为深色背景设计的"高亮文字"，放到白底上对比度极低、几乎看不见。
   下面这段把所有这类语义色文字翻为更深的同色系，并修正状态高亮/banner。
   ============================================================ */

/* —— 通用语义色文字（独立 selector，列长但成本最低） —— */
html[data-theme="light"] .cb-tag,
html[data-theme="light"] .cb-title b,
html[data-theme="light"] .area-detail-top .big-temp,
html[data-theme="light"] .ratio-text b,
html[data-theme="light"] .ac-pad-state.on,
html[data-theme="light"] .ac-mode.on,
html[data-theme="light"] .ac-mode-btn.on,
html[data-theme="light"] .ac-fan-btn.on,
html[data-theme="light"] .ac-swing-btn.on,
html[data-theme="light"] .ac-pad-btn:hover:not(:disabled),
html[data-theme="light"] .combo-item.on,
html[data-theme="light"] .combo-item-check,
html[data-theme="light"] .cf-view-btn.on,
html[data-theme="light"] .season-card .sc-edit:hover {
  color: #0e7490;
}
html[data-theme="light"] .rp-badge.on,
html[data-theme="light"] .rp-pc.on,
html[data-theme="light"] .rp-pc-stat.on,
html[data-theme="light"] .rp-pc.on .rp-pc-ico,
html[data-theme="light"] .pc-card-badge.on,
html[data-theme="light"] .pc-tile.on .pc-name,
html[data-theme="light"] .pc-tile.on .pc-state,
html[data-theme="light"] .season-toggle input:checked ~ .toggle-lbl,
html[data-theme="light"] .build-check.ok .ico {
  color: #15803d;
}
html[data-theme="light"] .rp-pc.offline,
html[data-theme="light"] .rp-pc-stat.offline,
html[data-theme="light"] .rp-pc.offline .rp-pc-ico,
html[data-theme="light"] .pc-card-badge.offline,
html[data-theme="light"] .pc-tile.offline .pc-name,
html[data-theme="light"] .pc-tile.offline .pc-state,
html[data-theme="light"] .build-check.bad .ico,
html[data-theme="light"] .event-item.ev-err .ev-ico,
html[data-theme="light"] .event-item.ev-err .ev-msg,
html[data-theme="light"] .dash-alert-tag.err,
html[data-theme="light"] .rp-tool.danger:hover {
  color: #b91c1c;
}
html[data-theme="light"] .event-item.ev-warn .ev-ico,
html[data-theme="light"] .dash-alert-head .dash-chart-title svg,
html[data-theme="light"] .dash-alert-tag.warn,
html[data-theme="light"] .season-card .sc-auto-flag,
html[data-theme="light"] .season-card.season-amber .sc-ico {
  color: #b45309;
}
html[data-theme="light"] .season-card.season-cyan .sc-ico,
html[data-theme="light"] .dash-chart-title svg,
html[data-theme="light"] .field-readonly .ha-tag {
  color: #0369a1;
}
html[data-theme="light"] .topbar .store-filter-ico { color: var(--text-muted, #52525b); }
html[data-theme="light"] .season-card.season-lime .sc-ico {
  color: #4d7c0f;
}
html[data-theme="light"] .zone-tag {
  color: #6d28d9;
  background: rgba(139, 92, 246, 0.10);
  border-color: rgba(139, 92, 246, 0.30);
}
html[data-theme="light"] .season-card .sc-active-flag {
  color: #16a34a;
}

/* —— KPI / Dashboard 链接卡的圆角图标：原浅色版在白底上太弱 —— */
html[data-theme="light"] .kpi-card.kpi-blue .kpi-ico,
html[data-theme="light"] .dash-link-card.lnk-blue .dlk-ico {
  color: #1d4ed8;
  background: rgba(91, 155, 255, 0.16);
}
html[data-theme="light"] .kpi-card.kpi-cool .kpi-ico {
  color: #0369a1;
  background: rgba(56, 189, 248, 0.16);
}
html[data-theme="light"] .kpi-card.kpi-pink .kpi-ico {
  color: #be185d;
  background: rgba(244, 114, 182, 0.16);
}
html[data-theme="light"] .kpi-card.kpi-grey .kpi-ico,
html[data-theme="light"] .dash-link-card.lnk-grey .dlk-ico {
  color: #475569;
  background: rgba(148, 163, 184, 0.16);
}
html[data-theme="light"] .dash-link-card.lnk-green .dlk-ico {
  color: #047857;
  background: rgba(16, 185, 129, 0.16);
}
html[data-theme="light"] .dash-link-card.lnk-purple .dlk-ico {
  color: #6d28d9;
  background: rgba(139, 92, 246, 0.16);
}

/* —— 卡片状态高亮：on / offline / active 在浅色下要"看得见"
       使用深色边框 + 略深的染色背景，确保对白底有对比 —— */

/* .dev.on：原版白色高亮在浅色下完全不可见 → 改用浅灰描边 + 极浅染色 */
html[data-theme="light"] .dev.on {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.03));
  border-color: rgba(0, 0, 0, 0.32);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.10),
    0 0 20px rgba(0, 0, 0, 0.04);
}
html[data-theme="light"] .dev .dev-domain {
  background: rgba(0, 0, 0, 0.05);
  color: var(--ink-faded);
  border-color: rgba(0, 0, 0, 0.10);
}

/* PCS Tab 激活态：保留 cyan→purple 主题色但加深 */
html[data-theme="light"] .pcs-tab.on {
  background: linear-gradient(135deg, rgba(103, 232, 249, 0.28), rgba(167, 139, 250, 0.22));
  color: #0e7490;
  border-color: rgba(8, 145, 178, 0.45);
}

/* `.combo-item.on`、`.cf-view-btn.on` 的青色加深 + 增强对比 */
html[data-theme="light"] .combo-item.on {
  background: rgba(103, 232, 249, 0.22);
}
html[data-theme="light"] .cf-view-btn.on {
  background: rgba(103, 232, 249, 0.28);
  box-shadow: 0 0 0 1px rgba(8, 145, 178, 0.40) inset;
}

/* 房间卡 / PC 卡的 "on / offline" 边框在浅色下加深 */
html[data-theme="light"] .room-pro.is-on {
  border-color: rgba(8, 145, 178, 0.55);
}
html[data-theme="light"] .pc-card.on {
  border-color: rgba(21, 128, 61, 0.45);
  background: rgba(74, 222, 128, 0.04);
}
html[data-theme="light"] .pc-card.offline {
  border-color: rgba(185, 28, 28, 0.45);
  background: rgba(244, 63, 94, 0.04);
}
html[data-theme="light"] .pc-tile.on {
  background: rgba(74, 222, 128, 0.14);
  border-color: rgba(34, 197, 94, 0.50);
}
html[data-theme="light"] .pc-tile.offline {
  background: rgba(244, 63, 94, 0.10);
  border-color: rgba(185, 28, 28, 0.40);
}
html[data-theme="light"] .rp-pc.on {
  background: rgba(74, 222, 128, 0.22);
  border-color: rgba(21, 128, 61, 0.55);
}
html[data-theme="light"] .rp-pc.offline {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(185, 28, 28, 0.45);
}
html[data-theme="light"] .rp-pc-stat.on {
  background: rgba(74, 222, 128, 0.20);
}
html[data-theme="light"] .rp-pc-stat.offline {
  background: rgba(244, 63, 94, 0.14);
}
html[data-theme="light"] .rp-pc-grid::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
}
html[data-theme="light"] .rp-pc-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.30);
}
html[data-theme="light"] .rp-badge.on {
  background: rgba(74, 222, 128, 0.16);
  border-color: rgba(21, 128, 61, 0.45);
}
html[data-theme="light"] .ac-pad-state.on {
  background: rgba(103, 232, 249, 0.20);
  border-color: rgba(8, 145, 178, 0.45);
}
html[data-theme="light"] .ac-mode.on {
  background: rgba(103, 232, 249, 0.18);
  border-color: rgba(8, 145, 178, 0.40);
}
html[data-theme="light"] .ac-pad-btn:hover:not(:disabled) {
  background: rgba(103, 232, 249, 0.22);
  border-color: rgba(8, 145, 178, 0.50);
}
html[data-theme="light"] .ac-mode-btn.on,
html[data-theme="light"] .ac-fan-btn.on,
html[data-theme="light"] .ac-swing-btn.on {
  background: rgba(103, 232, 249, 0.24);
  border-color: rgba(8, 145, 178, 0.50);
  box-shadow: 0 0 0 1px rgba(8, 145, 178, 0.20) inset;
}
html[data-theme="light"] .ac-pad-power.on {
  /* 橙色保持，但加深以匹配白底 */
  background: linear-gradient(135deg, #ea580c, #c2410c);
  color: #ffffff;
  border-color: rgba(194, 65, 12, 0.45);
}
html[data-theme="light"] .pc-card-badge.on {
  background: rgba(74, 222, 128, 0.16);
  border-color: rgba(21, 128, 61, 0.35);
}
html[data-theme="light"] .pc-card-badge.offline {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(185, 28, 28, 0.35);
}
html[data-theme="light"] .pc-opt.on {
  background: rgba(103, 232, 249, 0.18);
  border-color: rgba(8, 145, 178, 0.45);
}

/* season-card.active：加深 cyan/amber/lime 边框 + 染色 */
html[data-theme="light"] .season-card.active {
  border-color: rgba(8, 145, 178, 0.65);
  background: rgba(103, 232, 249, 0.12);
  box-shadow: 0 0 0 1px rgba(8, 145, 178, 0.22), inset 0 0 24px rgba(103, 232, 249, 0.10);
}
html[data-theme="light"] .season-card.active.season-amber {
  border-color: rgba(180, 83, 9, 0.55);
  background: rgba(251, 191, 36, 0.14);
  box-shadow: 0 0 0 1px rgba(180, 83, 9, 0.22), inset 0 0 24px rgba(251, 191, 36, 0.10);
}
html[data-theme="light"] .season-card.active.season-lime {
  border-color: rgba(77, 124, 15, 0.55);
  background: rgba(132, 204, 22, 0.14);
  box-shadow: 0 0 0 1px rgba(77, 124, 15, 0.22), inset 0 0 24px rgba(132, 204, 22, 0.10);
}
html[data-theme="light"] .season-card .sc-auto-flag {
  background: rgba(251, 191, 36, 0.18);
  border-color: rgba(180, 83, 9, 0.35);
}

/* —— 区块 banner：浅色下底色 + 边框 + 强调字 —— */
html[data-theme="light"] .console-banner {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18) 0%, rgba(167, 139, 250, 0.14) 60%, rgba(255, 255, 255, 0.4) 100%);
  border-color: rgba(8, 145, 178, 0.18);
}
html[data-theme="light"] .cb-tag {
  background: rgba(103, 232, 249, 0.24);
}
html[data-theme="light"] .area-detail-top {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(139, 92, 246, 0.10));
  border-color: rgba(0, 0, 0, 0.08);
}

/* —— 渐变填充图标 / 横条：在浅色下加深起点色，避免起点白 —— */
html[data-theme="light"] .cb-bar-fill,
html[data-theme="light"] .ratio-fill {
  background: linear-gradient(90deg, #0891b2, #7c3aed);
}
html[data-theme="light"] .kpi-card.kpi-blue .kpi-bar-fill { background: linear-gradient(90deg, #1d4ed8, #0369a1); }
html[data-theme="light"] .kpi-card.kpi-cool .kpi-bar-fill { background: linear-gradient(90deg, #0369a1, #0c4a6e); }
html[data-theme="light"] .kpi-card.kpi-pink .kpi-bar-fill { background: linear-gradient(90deg, #be185d, #9d174d); }
html[data-theme="light"] .kpi-card.kpi-grey .kpi-bar-fill { background: linear-gradient(90deg, #475569, #1e293b); }
html[data-theme="light"] .dash-bar-fill.on  { background: linear-gradient(90deg, #16a34a, #15803d); }
html[data-theme="light"] .dash-bar-fill.off { background: linear-gradient(90deg, #64748b, #334155); }
html[data-theme="light"] .dash-bar-fill.offline { background: linear-gradient(90deg, #dc2626, #991b1b); }
html[data-theme="light"] .build-progress-bar > i { background: linear-gradient(90deg, #15803d, #16a34a); }
html[data-theme="light"] .ratio-fill { background: linear-gradient(90deg, #0891b2, #7c3aed); }

/* —— Sidebar 导航激活态：去掉跟设计语言不合的"白点" + 高亮文字 —— */
html[data-theme="light"] .sidebar .nav-section::before {
  background: linear-gradient(135deg, #18181b, #71717a);
}

/* —— 通用 .dot 状态点（绿/红/青/灰）：保持颜色但用更鲜艳的版本 —— */
html[data-theme="light"] .dot { background: rgba(0, 0, 0, 0.25); }
html[data-theme="light"] .dot-muted { background: rgba(0, 0, 0, 0.18); }
html[data-theme="light"] .dot-on    { background: #16a34a; box-shadow: 0 0 6px rgba(22, 163, 74, 0.55); }
html[data-theme="light"] .dot-cool  { background: #0891b2; box-shadow: 0 0 6px rgba(8, 145, 178, 0.55); }
html[data-theme="light"] .dot-err   { background: #dc2626; box-shadow: 0 0 6px rgba(220, 38, 38, 0.55); }
html[data-theme="light"] .pcs-tab-dot.on { background: #16a34a; box-shadow: 0 0 6px rgba(22, 163, 74, 0.55); }
html[data-theme="light"] .pcs-tab-dot.offline { background: #dc2626; box-shadow: 0 0 6px rgba(220, 38, 38, 0.55); }

/* —— 余额 chip：保留琥珀色语义（金额相关），但浅色版用更深的金色 —— */
html[data-theme="light"] .topbar .balance-chip,
html[data-theme="light"] .balance-chip {
  background-color: rgba(251, 191, 36, 0.16);
  border-color: rgba(180, 83, 9, 0.35);
  color: #92400e;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.10);
}

/* —— 链接：恢复语义色 —— */
html[data-theme="light"] a {
  color: #0e7490;
}
html[data-theme="light"] a:hover {
  color: #0c4a6e;
  text-shadow: none;
}

/* —— dev.on 内部 dev-state（电量/状态读数）确保深色 —— */
html[data-theme="light"] .dev .dev-state {
  color: var(--ink);
}

/* —— Tag 系列：除 disabled 外，所有 tag 文字在浅色都用深色版本 —— */
html[data-theme="light"] .tag-active,
html[data-theme="light"] .tag-online {
  color: #15803d;
  background: rgba(132, 204, 22, 0.14);
  border-color: rgba(21, 128, 61, 0.40);
}
html[data-theme="light"] .tag-pending {
  color: #b45309;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(180, 83, 9, 0.40);
}
html[data-theme="light"] .tag-expired,
html[data-theme="light"] .tag-offline {
  color: #b91c1c;
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(185, 28, 28, 0.40);
}
html[data-theme="light"] .tag-info {
  color: #0e7490;
  background: rgba(103, 232, 249, 0.18);
  border-color: rgba(8, 145, 178, 0.40);
}
html[data-theme="light"] .tag-purple {
  color: #6d28d9;
  background: rgba(192, 132, 252, 0.14);
  border-color: rgba(109, 40, 217, 0.40);
}
html[data-theme="light"] .tag-plain {
  color: var(--ink-faded);
}
html[data-theme="light"] .logs-wrap .tag-active,
html[data-theme="light"] .logs-wrap .tag-online {
  background: rgba(132, 204, 22, 0.18);
  border-color: rgba(21, 128, 61, 0.45);
  color: #15803d;
}
html[data-theme="light"] .logs-wrap .tag-expired,
html[data-theme="light"] .logs-wrap .tag-offline {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(185, 28, 28, 0.45);
  color: #b91c1c;
}

/* —— 警报项：背景在白底要可见 —— */
html[data-theme="light"] .dash-alert-item.warn {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(180, 83, 9, 0.25);
}
html[data-theme="light"] .dash-alert-item.err {
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(185, 28, 28, 0.25);
}
html[data-theme="light"] .dash-alert-room,
html[data-theme="light"] .dash-alert-msg {
  color: var(--ink);
}
html[data-theme="light"] .dash-alert-eid {
  color: var(--ink-faded);
}

/* —— PC card 的发光 ::before 在白底下也降低强度 —— */
html[data-theme="light"] .pc-card.on::before,
html[data-theme="light"] .pc-card.offline::before {
  opacity: 0.05;
}

/* —— combo-item-area / 区域小标签：浅色下深色 —— */
html[data-theme="light"] .pc-opt .pc-area,
html[data-theme="light"] .combo-item-area {
  color: var(--ink-faded);
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.10);
}

/* —— pc-opt 的小蓝点 —— */
html[data-theme="light"] .pc-opt .pc-dot.on {
  background: #0891b2;
  box-shadow: 0 0 6px rgba(8, 145, 178, 0.55);
}

/* —— ev 系列文字：警告 / 错误项的文本要可读 —— */
html[data-theme="light"] .event-item {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}
html[data-theme="light"] .event-item.ev-warn {
  background: rgba(245, 158, 11, 0.06);
}
html[data-theme="light"] .event-item.ev-err {
  background: rgba(244, 63, 94, 0.06);
}

/* —— 季节预设主开关：浅色 toggle.track（已打开）用深色滑块 + 浅绿底 —— */
html[data-theme="light"] .season-toggle input:checked + .toggle-track {
  background: rgba(22, 163, 74, 0.40);
  border-color: rgba(21, 128, 61, 0.55);
  box-shadow: 0 0 8px rgba(22, 163, 74, 0.20);
}
html[data-theme="light"] .season-toggle .toggle-thumb {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* —— 通用 ui-toggle light 主题 —— */
html[data-theme="light"] .ui-toggle .toggle-track {
  background: rgba(0, 0, 0, 0.10);
  border-color: rgba(0, 0, 0, 0.15);
}
html[data-theme="light"] .ui-toggle input:checked + .toggle-track {
  background: rgba(22, 163, 74, 0.40);
  border-color: rgba(21, 128, 61, 0.55);
  box-shadow: 0 0 8px rgba(22, 163, 74, 0.20);
}
html[data-theme="light"] .ui-toggle .toggle-thumb {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* —— 房间卡四开关（rp-custops）light 主题：未选 track 用深色调，琥珀选中态照旧 —— */
html[data-theme="light"] .rp-custops-toggle .toggle-track {
  background: rgba(0, 0, 0, 0.10);
  border-color: rgba(0, 0, 0, 0.15);
}
html[data-theme="light"] .rp-custops-toggle .toggle-thumb {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
html[data-theme="light"] .rp-custops-toggle input:checked + .toggle-track {
  background: rgba(217, 119, 6, 0.45);
  border-color: rgba(180, 83, 9, 0.60);
  box-shadow: 0 0 8px rgba(217, 119, 6, 0.20);
}
html[data-theme="light"] .rp-custops-toggle input:checked ~ .rp-custops-lbl { color: #b45309; }

/* —— field-readonly：白底 + 深字 + 蓝标签 —— */
html[data-theme="light"] .field-readonly {
  background: rgba(0, 0, 0, 0.025);
  border-color: rgba(0, 0, 0, 0.10);
  color: var(--ink);
}

/* —— area-detail-top 内的大温度数字：原 #67e8f9（cyan-300）在白底太淡 —— */
html[data-theme="light"] .area-detail-top .big-temp {
  color: #0e7490;
}

/* —— ::selection 在 input 内部也保持可读 —— */
html[data-theme="light"] input::selection,
html[data-theme="light"] textarea::selection {
  background: rgba(8, 145, 178, 0.25);
  color: var(--ink);
}

/* —— stat 数字渐变文字：原版渐变到 #fff（在白底上消失） →
       浅色主题改成"主色 → 主色加深"的同色系渐变 —— */
html[data-theme="light"] .stat.amber .num {
  background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
html[data-theme="light"] .stat.rose .num {
  background: linear-gradient(135deg, #be123c 0%, #f43f5e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* delta 上升 / 下降：上升原 #84cc16 在白底太淡 */
html[data-theme="light"] .stat .delta.up { color: #15803d; }
html[data-theme="light"] .stat .delta.dn { color: #be123c; }

/* —— stat 彩色变体的图标 glow：浅色下深色变量让 glow 看不到，
       恢复对应主色（保留视觉分类语义） —— */
html[data-theme="light"] .stat.cyan   { --stat-color: #0e7490; }
html[data-theme="light"] .stat.purple { --stat-color: #6d28d9; }
html[data-theme="light"] .stat.green  { --stat-color: #15803d; }
html[data-theme="light"] .stat.pink   { --stat-color: #be185d; }
html[data-theme="light"] .stat.amber  { --stat-color: #b45309; }
html[data-theme="light"] .stat.rose   { --stat-color: #be123c; }

/* —— KPI 数字也用同样思路（in/out/net 的渐变在浅色下加深） —— */
html[data-theme="light"] .kpi.in .val {
  background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
html[data-theme="light"] .kpi.out .val {
  background: linear-gradient(135deg, #be123c 0%, #f43f5e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
html[data-theme="light"] .kpi.net .val {
  background: linear-gradient(135deg, #b45309 0%, #ea580c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* —— 环形图 (dash-ring)：浅色下背景环用浅灰，避免白底白圈不可见 —— */
html[data-theme="light"] .dash-ring .ring-bg {
  stroke: rgba(0, 0, 0, 0.08);
}
/* ring-pct / ring-lbl 已用 var(--ink) / var(--ink-faded)，在浅色主题下自动是深色 */

/* —— a 链接的语义色已在上面定义，但需要排除已用 var(--ink) 着色的链接（如登录页 lf-beian、面包屑等） —— */
html[data-theme="light"] .login-footer .lf-beian,
html[data-theme="light"] .topbar .crumb a,
html[data-theme="light"] .dash-link-card,
html[data-theme="light"] a.dash-link-card,
html[data-theme="light"] .nav-item,
html[data-theme="light"] a.nav-item {
  color: inherit;
}
html[data-theme="light"] .login-footer .lf-beian:hover { color: var(--ink); }

/* ============================================================
   浅色主题：智能设备管控页 —— 深色玻璃换白底，白文本换深墨。
   ============================================================ */
html[data-theme="light"] .dpanel-tab {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.10);
  color: var(--ink-faded);
}
html[data-theme="light"] .dpanel-tab:hover { color: var(--ink); border-color: rgba(0, 0, 0, 0.20); }
html[data-theme="light"] .dpanel-tab.active {
  background: rgba(8, 145, 178, 0.12); color: #0e7490; border-color: rgba(8, 145, 178, 0.40);
}
html[data-theme="light"] .dpt-op:hover { background: rgba(0, 0, 0, 0.08); }

html[data-theme="light"] .dpanel-fault-bar {
  background: rgba(239, 68, 68, 0.06); border-color: rgba(220, 38, 38, 0.30); color: #dc2626;
}
html[data-theme="light"] .dpanel-fault-bar .dpfb-icon { color: #dc2626; }
html[data-theme="light"] .dpanel-fault-bar .dpfb-text b { color: #b91c1c; }
html[data-theme="light"] .dpanel-card {
  background: #ffffff; border-color: rgba(0, 0, 0, 0.10);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}
html[data-theme="light"] .dpanel-card:hover {
  border-color: rgba(0, 0, 0, 0.20); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .dpanel-card.is-offline {
  border-color: rgba(220,38,38,0.7);
  box-shadow: 0 0 0 1px rgba(220,38,38,0.28), 0 6px 18px rgba(220,38,38,0.12);
}
html[data-theme="light"] .dpanel-card.is-offline .dpc-ico,
html[data-theme="light"] .dpanel-card.is-offline .dpc-name::after,
html[data-theme="light"] .rp-dev-card.is-offline .rp-dev-name,
html[data-theme="light"] .rp-dev-card.is-offline .rp-dev-name::after {
  color: #dc2626; border-color: rgba(220,38,38,0.5); background: rgba(220,38,38,0.08);
}
html[data-theme="light"] .dpc-head { border-bottom-color: rgba(0, 0, 0, 0.08); }
html[data-theme="light"] .dpc-name { color: var(--ink); }
html[data-theme="light"] .dpc-ico {
  background: rgba(8, 145, 178, 0.10); border-color: rgba(8, 145, 178, 0.28); color: #0e7490;
}
html[data-theme="light"] .dpc-op:hover { background: rgba(0, 0, 0, 0.05); color: var(--ink); }
html[data-theme="light"] .dpc-row + .dpc-row,
html[data-theme="light"] .dpc-slider + .dpc-row, html[data-theme="light"] .dpc-row + .dpc-slider,
html[data-theme="light"] .dpc-modes + .dpc-row, html[data-theme="light"] .dpc-row + .dpc-modes,
html[data-theme="light"] .dpc-progress + .dpc-row, html[data-theme="light"] .dpc-row + .dpc-progress {
  border-top-color: rgba(0, 0, 0, 0.06);
}
html[data-theme="light"] .dpc-row-ico { color: #0e7490; background: rgba(8, 145, 178, 0.10); }
html[data-theme="light"] .dpc-row-name,
html[data-theme="light"] .dpc-slider-val, html[data-theme="light"] .dpc-step-val,
html[data-theme="light"] .dpc-progress-val, html[data-theme="light"] .dpc-sensor-val,
html[data-theme="light"] .dpc-state-val { color: var(--ink); }
html[data-theme="light"] .dpc-tk { background: rgba(0, 0, 0, 0.10); border-color: rgba(0, 0, 0, 0.12); }
html[data-theme="light"] .dpc-tt { background: #ffffff; }
html[data-theme="light"] .dpc-toggle.on .dpc-tk { background: rgba(8, 145, 178, 0.65); border-color: rgba(8, 145, 178, 0.75); }
html[data-theme="light"] .dpc-chip, html[data-theme="light"] .dpc-mode-sel,
html[data-theme="light"] .dpc-stepper, html[data-theme="light"] .dpi,
html[data-theme="light"] .dcr-type, html[data-theme="light"] .dcr-op,
html[data-theme="light"] .dpanel-comp-row,
html[data-theme="light"] .dcr-field input, html[data-theme="light"] .dcr-field select,
html[data-theme="light"] .dcr-field textarea {
  background: rgba(0, 0, 0, 0.03); border-color: rgba(0, 0, 0, 0.10); color: var(--ink);
}
html[data-theme="light"] .dpc-chip { color: var(--ink-faded); }
html[data-theme="light"] .dpc-chip:hover, html[data-theme="light"] .dpi:hover,
html[data-theme="light"] .dcr-op:hover { color: var(--ink); border-color: rgba(0, 0, 0, 0.20); }
html[data-theme="light"] .dpc-chip.active, html[data-theme="light"] .dpi.active {
  background: rgba(8, 145, 178, 0.14); color: #0e7490; border-color: rgba(8, 145, 178, 0.40);
}
html[data-theme="light"] .dpc-step { color: var(--ink); }
html[data-theme="light"] .dpc-step:hover { background: rgba(0, 0, 0, 0.06); }
html[data-theme="light"] .dpc-action-btn {
  background: rgba(8, 145, 178, 0.12); border-color: rgba(8, 145, 178, 0.34); color: #0e7490;
}
html[data-theme="light"] .dpc-progress-bar { background: rgba(0, 0, 0, 0.06); }
html[data-theme="light"] .dpc-badge.off { background: rgba(0, 0, 0, 0.04); color: var(--ink-faded); }

/* ============================================================
   浅色主题：cyber-bg 极光层
   ============================================================ */

/* —— cyber-bg 极光层：浅色主题下白色光晕 + screen 混合等于看不到，
       并且涂鸦层 grayscale 后在白底也没意义；直接弱化以节省 GPU 与视觉杂讯 —— */
html[data-theme="light"] .cyber-bg .aurora,
html[data-theme="light"] .cyber-bg .aurora-b,
html[data-theme="light"] .cyber-bg .aurora-c {
  opacity: 0.10;
  mix-blend-mode: multiply;
}
html[data-theme="light"] .cyber-bg .aurora-a {
  background: radial-gradient(circle, rgba(91, 155, 255, 0.30) 0%, transparent 65%);
}
html[data-theme="light"] .cyber-bg .aurora-b {
  background: radial-gradient(circle, rgba(236, 72, 153, 0.22) 0%, transparent 65%);
}
html[data-theme="light"] .cyber-bg .aurora-c {
  background: radial-gradient(circle, rgba(167, 139, 250, 0.20) 0%, transparent 65%);
}
html[data-theme="light"] .cyber-bg .graffiti-layer {
  opacity: 0.10;
  mix-blend-mode: multiply;
  filter: none;
}
html[data-theme="light"] .cyber-bg .scanlines {
  opacity: 0.08;
  mix-blend-mode: multiply;
}
html[data-theme="light"] body:has(#login:not(.hidden)) .cyber-bg .aurora,
html[data-theme="light"] body:has(#login:not(.hidden)) .cyber-bg .aurora-b,
html[data-theme="light"] body:has(#login:not(.hidden)) .cyber-bg .aurora-c,
html[data-theme="light"] body:has(#login:not(.hidden)) .cyber-bg .graffiti-layer,
html[data-theme="light"] body:has(#login:not(.hidden)) .cyber-bg .scanlines {
  opacity: 0.18;
}

/* ============================================================
   代客查看 (admin / agent 进入门店运营页面时顶部固定的两行)
   ------------------------------------------------------------
   .view-as-header  外层容器（圆角 + 琥珀边框）
     .view-as-banner  第一行：身份标签 + 门店名 + 返回门店详情
     .view-as-tabs    第二行：网咖运营子导航 tabs
   ============================================================ */
.view-as-header {
  display: flex;
  flex-direction: column;
  /* host 自己负责上下间距，header 不再加 bottom margin，避免叠加 */
  margin: 0;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.14), rgba(245, 158, 11, 0.04));
  border: 1px solid rgba(245, 158, 11, 0.35);
  overflow: hidden;
}
.view-as-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
}
.view-as-banner .view-as-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  color: var(--seal-amber);
  font-weight: 600;
  letter-spacing: .3px;
  white-space: nowrap;
}
.view-as-banner .view-as-name { color: var(--ink-faded); }
.view-as-banner .view-as-name b { color: var(--ink); font-weight: 600; }
.view-as-banner .view-as-spacer { flex: 1; }

/* HA 选择器槽位：admin/agent 代客查看时把 #tb_store_filter 的内容搬到这里，
   让"门店身份 / HA 切换 / 返回"在同一条 banner 上一气呵成。
   样式与 .topbar .store-filter 对齐（包括下拉箭头和 option 背景色）。 */
.view-as-banner .view-as-ha-slot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  height: 28px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.10);
}
.view-as-banner .view-as-ha-slot:empty { display: none; }
.view-as-banner .view-as-ha-slot .store-filter-ico {
  display: inline-flex;
  align-items: center;
  color: var(--seal-amber);
  opacity: .9;
}
.view-as-banner .view-as-ha-slot .store-filter-sel {
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--ink);
  font-size: 12.5px;
  padding: 0 18px 0 2px;
  min-width: 90px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23fbbf24' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 18px;
}
/* select 展开后的 option 列表是 OS/浏览器原生绘制，
   不能完全控制，但 Chromium / Edge 会读取这条规则。
   颜色与 .topbar .store-filter-sel option 保持一致，避免主题切到代客查看
   横幅时下拉变白底。 */
.view-as-banner .view-as-ha-slot .store-filter-sel option {
  background: #1a1f2b;
  color: var(--ink);
}
html[data-theme="light"] .view-as-banner .view-as-ha-slot {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.10);
}
html[data-theme="light"] .view-as-banner .view-as-ha-slot .store-filter-sel option {
  background: #ffffff;
  color: var(--ink);
}

.view-as-banner .view-as-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all .15s;
}
.view-as-banner .view-as-back:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.18);
}
.view-as-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 10px 8px 10px;
  border-top: 1px solid rgba(245, 158, 11, 0.18);
  background: rgba(0, 0, 0, 0.12);
}
.view-as-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--ink-faded);
  text-decoration: none;
  border: 1px solid transparent;
  transition: all .15s;
  white-space: nowrap;
}
.view-as-tab:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}
.view-as-tab.active {
  color: var(--seal-amber);
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.42);
  font-weight: 600;
}
.view-as-tab svg { opacity: .85; }
.view-as-tab.active svg { opacity: 1; }

html[data-theme="light"] .view-as-header {
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.12), rgba(217, 119, 6, 0.02));
  border-color: rgba(217, 119, 6, 0.35);
}
html[data-theme="light"] .view-as-banner .view-as-back {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--ink);
}
html[data-theme="light"] .view-as-banner .view-as-back:hover {
  background: rgba(0, 0, 0, 0.07);
}
html[data-theme="light"] .view-as-tabs {
  background: rgba(0, 0, 0, 0.03);
  border-top-color: rgba(217, 119, 6, 0.20);
}
html[data-theme="light"] .view-as-tab:hover {
  background: rgba(0, 0, 0, 0.06);
}
html[data-theme="light"] .view-as-tab.active {
  color: #b45309;
  background: rgba(217, 119, 6, 0.12);
  border-color: rgba(217, 119, 6, 0.42);
}

/* ============================================================
 *  AI 对话区 —— Markdown 排版
 * ------------------------------------------------------------
 *  渲染器在 store.js 的 _renderMarkdown 里手写；这里只补样式。
 *  目标：在 ai-bubble-md 容器内让 DeepSeek 输出有合理段落 / 列表 / 表格 /
 *       代码块；同时不污染气泡外其它地方。
 * ============================================================ */
.ai-bubble-md .md-p             { margin: 0 0 6px; }
.ai-bubble-md .md-p:last-child  { margin-bottom: 0; }
.ai-bubble-md .md-h             { margin: 10px 0 4px; line-height: 1.35; font-weight: 600; }
.ai-bubble-md .md-h:first-child { margin-top: 0; }
.ai-bubble-md .md-h1            { font-size: 16px; }
.ai-bubble-md .md-h2            { font-size: 15px; }
.ai-bubble-md .md-h3            { font-size: 14px; }
.ai-bubble-md .md-h4,
.ai-bubble-md .md-h5,
.ai-bubble-md .md-h6            { font-size: 13.5px; }
.ai-bubble-md .md-list          { margin: 0 0 6px 18px; padding: 0; }
.ai-bubble-md .md-list li       { margin: 2px 0; }
.ai-bubble-md .md-list .md-list { margin-bottom: 0; }
.ai-bubble-md .md-hr            { border: 0; border-top: 1px dashed var(--line); margin: 8px 0; }
.ai-bubble-md .md-link          { color: #6c5ce7; text-decoration: underline; text-underline-offset: 2px; }
.ai-bubble-md .md-icode         {
  font-family: ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  background: rgba(108, 92, 231, 0.10);
  border: 1px solid rgba(108, 92, 231, 0.18);
  border-radius: 4px;
  padding: 0 4px;
}
.ai-bubble-md .md-code {
  margin: 6px 0;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.5;
}
.ai-bubble-md .md-code code {
  font-family: ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  background: transparent;
  padding: 0;
  border: 0;
}
.ai-bubble-md .md-table {
  border-collapse: collapse;
  margin: 6px 0;
  font-size: 12.5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.ai-bubble-md .md-table th,
.ai-bubble-md .md-table td {
  border: 1px solid var(--line);
  padding: 4px 8px;
  vertical-align: top;
}
.ai-bubble-md .md-table th {
  background: rgba(108, 92, 231, 0.10);
  font-weight: 600;
}
.ai-bubble-md .md-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}
html[data-theme="light"] .ai-bubble-md .md-code {
  background: rgba(0, 0, 0, 0.04);
}
html[data-theme="light"] .ai-bubble-md .md-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.03);
}

/* ============================================================
 *  AI 任务页 —— 标签栏（chip）+ 分组 section（标题朝上的分组框）
 *  设计目标：
 *    · chip 紧凑横排，hover 显示右侧 ✎ / × 按钮（虚拟"全部"/"未分组"不显示）
 *    · section 用 fieldset 风格，header 在上、标题左侧带"标签色点"，让店主一眼分组
 * ============================================================ */
.ai-tagbar {
  display: flex; flex-wrap: wrap; gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.015);
  margin-bottom: 12px;          /* 与下方 tbl-toolbar / 任务列表之间留呼吸感 */
}
.ai-tag-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12.5px;
  cursor: pointer;
  transition: all .15s ease;
  position: relative;
  user-select: none;
  white-space: nowrap;
}
.ai-tag-chip:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.30);
}
.ai-tag-chip.active {
  background: rgba(108, 92, 231, 0.18);
  border-color: rgba(108, 92, 231, 0.55);
  color: #fff;
}
.ai-tag-chip-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.ai-tag-chip-name { font-weight: 500; }
.ai-tag-chip-cnt {
  font-size: 11px; padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  color: var(--ink-soft);
}
.ai-tag-chip.active .ai-tag-chip-cnt {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.ai-tag-chip-acts {
  display: none; gap: 2px; margin-left: 2px;
}
.ai-tag-chip:hover .ai-tag-chip-acts { display: inline-flex; }
.ai-tag-chip-btn {
  background: transparent; border: 0; cursor: pointer;
  color: var(--ink-soft); font-size: 14px; line-height: 1;
  padding: 0 4px; border-radius: 4px;
}
.ai-tag-chip-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.ai-tagbar-add {
  display: inline-flex; align-items: center;
  padding: 4px 12px;
  border: 1px dashed var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12.5px;
  cursor: pointer;
  transition: all .15s ease;
}
.ai-tagbar-add:hover {
  border-style: solid;
  border-color: rgba(108, 92, 231, 0.55);
  color: #fff;
  background: rgba(108, 92, 231, 0.10);
}

/* 标签分组 section —— fieldset 风格（标题角朝上） */
.ai-tag-section {
  --tag-color: #888;
  margin: 12px 12px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.015);
}
.ai-tag-section-head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--tag-color) 22%, transparent),
    transparent 60%);
  border-bottom: 1px solid var(--line);
}
.ai-tag-section-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--tag-color);
  box-shadow: 0 0 8px var(--tag-color);
}
.ai-tag-section-title {
  font-weight: 600; font-size: 13.5px; letter-spacing: 0.3px;
}
.ai-tag-section-count {
  font-size: 11px; padding: 1px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-soft);
}
.ai-tag-section-body {
  padding: 0;
  /* 横向滚动兜底：单条任务的"触发"列可能是很长的 entity_id /
     条件表达式（如 climate.090615_ktf_0016_ai... > 26），不出横滚动条
     就会被外层 .ai-tag-section { overflow: hidden } 裁掉，后面的状态 /
     下次执行 / 操作等列全看不见。 */
  overflow-x: auto;
}
.ai-tag-section-body .logs-table {
  border: 0; border-radius: 0;
  /* 保底宽度：8 列（开关 32 + 名称 ~180 + 触发 ~220 + 状态 70 + 下次执行 120 +
     已执行 60 + 最后结果 120 + 操作 220）一起能放下；窄屏 / 长内容时出横向滚动条 */
  min-width: 920px;
}
/* 触发列、最后结果列内的长文本断词，避免 entity_id 撑得太离谱 */
.ai-tag-section-body .logs-table td {
  word-break: break-word;
  vertical-align: middle;
}
html[data-theme="light"] .ai-tag-chip {
  background: rgba(0, 0, 0, 0.03);
}
html[data-theme="light"] .ai-tag-chip:hover {
  background: rgba(0, 0, 0, 0.06);
}
html[data-theme="light"] .ai-tag-chip.active {
  background: rgba(108, 92, 231, 0.15);
}
html[data-theme="light"] .ai-tagbar {
  background: rgba(0, 0, 0, 0.02);
}
html[data-theme="light"] .ai-tag-section {
  background: rgba(0, 0, 0, 0.015);
}

/* 任务分页栏（每个 section / 平铺视图独立 20 条 / 页） */
.ai-paged { display: block; }
.ai-pager {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.01);
}
.ai-pager-btn {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  color: inherit;
  font-size: 12px;
  font-family: var(--font-ui);
  transition: all .12s ease;
}
.ai-pager-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.30);
  color: #fff;
}
.ai-pager-btn:disabled {
  opacity: 0.35; cursor: not-allowed;
}
.ai-pager-info { padding: 0 6px; }
.ai-pager-info b { color: var(--ink); font-weight: 600; }
html[data-theme="light"] .ai-pager {
  background: rgba(0, 0, 0, 0.015);
}

/* ============================================================
   AI 对话悬浮窗（AI Dock）—— 脱离导航的右下角常驻入口
   ============================================================ */
/* —— 悬浮按钮（FAB）—— 采用与主品牌一致的深枪灰渐变（--grad-primary），不再用紫青 —— */
.ai-dock-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  cursor: pointer;
  z-index: 90;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
  background: var(--grad-primary);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255,255,255,0.06) inset;
  transition: transform .16s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease, opacity .18s ease, border-color .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.ai-dock-fab:hover { transform: translateY(-2px) scale(1.05); border-color: rgba(255,255,255,0.32); box-shadow: 0 12px 34px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.14) inset; }
.ai-dock-fab:active { transform: scale(0.96); }
/* 拖拽中：关掉过渡/缩放/脉冲，指针跟手不打架 */
.ai-dock-fab.is-dragging,
.ai-dock-fab.is-dragging:hover,
.ai-dock-fab.is-dragging:active { transition: none; transform: none; cursor: grabbing; }
.ai-dock-fab.is-dragging .ai-dock-fab-glow { animation: none; opacity: 0; }
.ai-dock-fab { touch-action: none; }
.ai-dock-fab .ai-dock-fab-ico { position: relative; z-index: 1; display: block; }
/* 打开窗口时隐藏 FAB（缩回去），关闭/最小化时再出现 */
.ai-dock-fab--hidden { opacity: 0; transform: scale(0.4); pointer-events: none; }
/* 脉冲光圈：用中性银白，深浅色主题都可见且不抢眼 */
.ai-dock-fab-glow {
  position: absolute; inset: -1px; border-radius: 50%;
  border: 1px solid var(--line-bold, rgba(255,255,255,0.22));
  z-index: 0;
  animation: ai-dock-pulse 2.6s ease-out infinite;
}
@keyframes ai-dock-pulse {
  0%   { transform: scale(1);   opacity: .6; }
  70%  { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1.55); opacity: 0; }
}
/* 右上角 AI 标识：高对比单色徽标 */
.ai-dock-fab-tag {
  position: absolute; top: -3px; right: -3px; z-index: 2;
  font-family: var(--font-ui);
  font-size: 9px; font-weight: 800; letter-spacing: .3px;
  line-height: 1; padding: 3px 4px; border-radius: 7px;
  color: var(--paper-1); background: var(--ink);
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
/* 最小化态：FAB 边缘加一圈中性高亮，提示"对话还开着" */
.ai-dock-fab--min { box-shadow: 0 8px 26px rgba(0,0,0,0.5), 0 0 0 3px rgba(148,163,184,0.55); }

/* —— 对话窗 —— 对齐 .modal-box 的玻璃质感，与主题完全一致 —— */
.ai-dock-win {
  position: fixed;
  z-index: 92;            /* 在 modal(99) 之下：UI.confirm 等弹窗仍能盖在上面 */
  display: none;          /* JS 控制显示为 flex */
  flex-direction: column;
  width: 760px; height: 580px;
  min-width: 360px; min-height: 360px;
  max-width: calc(100vw - 16px); max-height: calc(100vh - 16px);
  /* 用全站主背景实色（深 #06060a / 浅 #f7f7f9），与左侧导航、主内容区同底，
     不用半透明毛玻璃——否则会把背后页面内容透上来导致色调偏浅、和导航对不齐。 */
  background: var(--paper-1, #06060a);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  border-radius: 16px;
  overflow: hidden;       /* 配合 resize:both 出现右下角拉伸手柄 */
  resize: both;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 30px 80px rgba(0, 0, 0, 0.60);
  animation: ai-dock-in .18s cubic-bezier(.4,0,.2,1);
}
/* 干掉浏览器默认的白色拉伸手柄（深色下很扎眼），换成与主题一致的低调斜纹 */
.ai-dock-win::-webkit-resizer { background: transparent; }
.ai-dock-win::after {
  content: "";
  position: absolute;
  right: 4px; bottom: 4px;
  width: 9px; height: 9px;
  z-index: 3;
  pointer-events: none;       /* 不挡住底下的原生 resize 拖拽区 */
  opacity: 0.55;
  background:
    linear-gradient(135deg, transparent 44%, var(--ink-faded) 44%, var(--ink-faded) 56%, transparent 56%),
    linear-gradient(135deg, transparent 70%, var(--ink-faded) 70%, var(--ink-faded) 82%, transparent 82%);
}
@keyframes ai-dock-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.ai-dock-head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px 9px 12px;
  border-bottom: 1px solid var(--line, rgba(255,255,255,0.10));
  background: rgba(255, 255, 255, 0.03);
  cursor: move;
  user-select: none;
  touch-action: none;     /* pointer 拖拽时禁用浏览器手势 */
}
.ai-dock-head.dragging { cursor: grabbing; }
.ai-dock-head-ico {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 7px;
  color: var(--ink); flex-shrink: 0;
  background: var(--grad-primary);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.ai-dock-head-ico svg { display: block; }
.ai-dock-title { font-weight: 600; font-size: 13.5px; color: var(--ink); flex-shrink: 0; }
.ai-dock-ha { display: flex; align-items: center; }
.ai-dock-ha-sel {
  max-width: 180px;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--line, rgba(255,255,255,0.10));
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 12px;
  cursor: pointer;
}
.ai-dock-ha-sel option { background: #1a1f2b; color: var(--ink); }
.ai-dock-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  padding: 0; line-height: 0;
  border: none; border-radius: 7px;
  background: transparent; color: var(--ink-soft);
  cursor: pointer; flex-shrink: 0;
  transition: background .12s ease, color .12s ease;
}
.ai-dock-btn svg { display: block; }
.ai-dock-btn:hover { background: rgba(255,255,255,0.10); color: var(--ink); }
.ai-dock-body {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  padding: 10px;
  overflow: hidden;
  background: transparent;   /* 让玻璃窗底色透出，内部 .card 与全站一致 */
}
.ai-dock-loading {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--ink-faded); font-size: 13px;
}
/* 嵌入模式下：会话列表窄一点、字号略收，适配较小窗口 */
.ai-layout-embedded .ai-quick-bar { padding: 5px 6px; }
.ai-layout-embedded .ai-quick-chip { font-size: 11.5px; padding: 3px 8px; }

/* 浅色主题适配（grad-primary / ink / paper 变量已随主题切换，FAB 与图标自动适配） */
html[data-theme="light"] .ai-dock-win {
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.03) inset,
    0 30px 80px rgba(0,0,0,0.22);
}
html[data-theme="light"] .ai-dock-fab { border-color: rgba(0,0,0,0.10); box-shadow: 0 8px 26px rgba(0,0,0,0.18); }
html[data-theme="light"] .ai-dock-head { background: rgba(0,0,0,0.02); }
html[data-theme="light"] .ai-dock-head-ico { border-color: rgba(0,0,0,0.10); }
html[data-theme="light"] .ai-dock-ha-sel { background: #fff; }
html[data-theme="light"] .ai-dock-ha-sel option { background: #fff; color: #111; }
html[data-theme="light"] .ai-dock-btn:hover { background: rgba(0,0,0,0.06); }

/* 小屏：占满大部分视口，FAB 略小 */
@media (max-width: 640px) {
  .ai-dock-win {
    width: calc(100vw - 16px) !important;
    height: calc(100vh - 90px) !important;
    left: 8px !important; top: 8px !important;
    resize: none;
  }
  .ai-dock-fab { width: 50px; height: 50px; right: 16px; bottom: 16px; }
}
