:root {
  --bg: #f2f5f9;
  --card: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e5ebf3;
  --sidebar: #0b1220;
  --sidebar-2: #111c30;
  --primary: #0f9d8a;
  --primary-2: #14b8a6;
  --primary-ink: #0b6b5f;
  --blue: #2563eb;
  --amber: #d97706;
  --red: #dc2626;
  --purple: #7c3aed;
  --cyan: #0891b2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px -12px rgba(15, 23, 42, .18);
  --shadow-lg: 0 24px 60px -20px rgba(15, 23, 42, .35);
}

* { box-sizing: border-box; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c7d2e0; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 登录 ---------------- */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  background: #07101f;
}
.login-brand {
  position: relative;
  overflow: hidden;
  padding: 56px 64px;
  color: #e2e8f0;
  background:
    radial-gradient(900px 500px at 10% 0%, rgba(20, 184, 166, .30), transparent 60%),
    radial-gradient(700px 500px at 90% 90%, rgba(37, 99, 235, .28), transparent 60%),
    #07101f;
}
.login-brand::after {
  content: "";
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(148, 163, 184, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, .08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse at 40% 40%, #000 20%, transparent 75%);
}
.login-brand-inner { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; }
.login-logo { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 19px; letter-spacing: .5px; }
.login-logo .mark {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(145deg, #14b8a6, #0e7490);
  box-shadow: 0 10px 24px -8px rgba(20, 184, 166, .8);
}
/* Hirano 品牌字：Arial Black + 矢车菊蓝 */
.hirano-word {
  font-family: "Arial Black", Arial, "Microsoft YaHei", sans-serif;
  font-weight: 900;
  color: #6495ED;
  letter-spacing: -1px;
}
.login-logo-cn { font-weight: 600; font-size: 17px; letter-spacing: .5px; }
.login-headline { margin-top: auto; }
.login-headline h1 { font-size: 44px; line-height: 1.22; margin: 0 0 18px; font-weight: 800; letter-spacing: -.5px; }
.login-headline h1 em { font-style: normal; background: linear-gradient(90deg, #2dd4bf, #38bdf8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-headline p { color: #94a3b8; max-width: 520px; line-height: 1.9; font-size: 15px; margin: 0; }
.login-feats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.login-feats span {
  border: 1px solid rgba(45, 212, 191, .3); color: #99f6e4; background: rgba(15, 157, 138, .12);
  padding: 7px 13px; border-radius: 999px; font-size: 12.5px;
}
.login-foot { margin-top: 40px; color: #64748b; font-size: 12px; }
.login-panel { background: #fff; display: grid; place-items: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 26px; margin: 0 0 8px; }
.login-card .sub { color: var(--muted); margin: 0 0 28px; }
.login-card label { display: block; font-size: 13px; color: var(--ink-2); margin: 18px 0 8px; font-weight: 600; }
.login-input { position: relative; }
.login-input input {
  width: 100%; padding: 13px 46px 13px 42px; border: 1px solid var(--line); border-radius: 11px;
  background: #f8fafc; outline: none; transition: .18s;
}
.login-input input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(15, 157, 138, .12); }
.login-input .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #94a3b8; pointer-events: none; }
.login-eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px;
  display: grid; place-items: center; border: 0; background: transparent; color: #94a3b8; cursor: pointer; border-radius: 8px;
}
.login-eye:hover { color: var(--primary); background: #effcf9; }
.login-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin: 4px 0 20px; }
.login-tabs button {
  position: relative; border: 0; background: transparent; padding: 0 0 12px; color: var(--muted);
  font-size: 14px; cursor: pointer; white-space: nowrap;
}
.login-tabs button.active { color: var(--primary-ink); font-weight: 700; }
.login-tabs button.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--primary);
}
.login-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; font-size: 12.5px; }
.login-check { display: inline-flex !important; align-items: center; gap: 6px; margin: 0 !important; color: var(--ink-2); font-size: 12.5px !important; font-weight: 400 !important; cursor: pointer; }
.login-check input, .login-agree input { width: 14px; height: 14px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.login-link { border: 0; background: transparent; padding: 0; color: var(--primary-ink); font-size: 12.5px; cursor: pointer; }
.login-link:hover { text-decoration: underline; }
.login-agree { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.login-agree label { display: inline; margin: 0; color: var(--muted); font-size: 12px; font-weight: 400; cursor: pointer; }
.login-agree .login-link { font-size: 12px; }
.login-btn {
  width: 100%; margin-top: 24px; padding: 13px; border: 0; border-radius: 11px; cursor: pointer;
  background: linear-gradient(135deg, #0f9d8a, #0b7d75); color: #fff; font-weight: 700; letter-spacing: .5px;
  box-shadow: 0 12px 24px -12px rgba(15, 157, 138, .9); transition: .18s;
}
.login-btn:hover { transform: translateY(-1px); }
.login-btn:disabled { opacity: .6; cursor: wait; }
.login-err { color: var(--red); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* ---------------- 布局 ---------------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 238px; flex: 0 0 238px; background: var(--sidebar); color: #cbd5e1;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 20px 18px 16px; }
.brand .mark {
  width: 78px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 78px;
  background: #fff; padding: 3px 5px; box-shadow: 0 2px 6px rgba(0, 0, 0, .28);
}
.brand .mark .brand-logo { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand .txt b { display: block; font-size: 15px; color: #6495ED; letter-spacing: .3px; }
.brand .txt span { font-size: 11px; color: #64748b; letter-spacing: .4px; }
.nav { flex: 1; overflow-y: auto; padding: 6px 10px 20px; }
.nav::-webkit-scrollbar-thumb { background: #1e293b; }
.nav-group { margin: 14px 0 6px; padding: 0 12px; font-size: 11px; color: #475569; letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px;
  color: #94a3b8; cursor: pointer; margin-bottom: 2px; font-size: 13.5px; transition: .15s;
}
.nav-item:hover { background: #16223a; color: #e2e8f0; }
.nav-item.active { background: linear-gradient(90deg, rgba(20, 184, 166, .18), rgba(20, 184, 166, .04)); color: #5eead4; box-shadow: inset 2px 0 0 #2dd4bf; }
.nav-item .badge-dot { margin-left: auto; background: #ef4444; color: #fff; font-size: 10px; min-width: 17px; height: 17px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px; }
.side-foot { padding: 12px 16px; border-top: 1px solid #1e293b; font-size: 11px; color: #475569; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px;
  background: var(--sidebar);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 8px 20px -14px rgba(2, 8, 20, .9);
  display: flex; align-items: center; gap: 16px; padding: 0 24px;
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 700; color: #fff; }
/* 标题：沿用原艺术字效果（粗体 + 蓝青渐变），深色顶栏下提亮色阶 */
.topbar-title {
  font-size: 22px; font-weight: 800; letter-spacing: 2px; line-height: 1;
  background: linear-gradient(92deg, #dbeafe 0%, #7dd3fc 45%, #5eead4 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 2px rgba(2, 8, 20, .55));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.topbar .icon-btn, .topbar .user-chip { border-color: rgba(255, 255, 255, .55); box-shadow: 0 2px 8px rgba(6, 60, 56, .22); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.env-badge { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .5px; border: 1px solid transparent; white-space: nowrap; }
.env-badge.test { color: #92400e; background: #fef3c7; border-color: #fde68a; }
.env-badge.prod { color: #b91c1c; background: #fee2e2; border-color: #fecaca; }
.icon-btn { position: relative; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: #ef4444; border: 1.5px solid #fff; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 5px 10px 5px 5px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; background: linear-gradient(135deg, #0f9d8a, #0891b2); overflow: hidden; flex: 0 0 30px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-chip .meta b { display: block; font-size: 12.5px; line-height: 1.2; }
.user-chip .meta span { font-size: 11px; color: var(--muted); }
.user-menu {
  position: absolute; right: 24px; top: 58px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 200px; padding: 6px; z-index: 50; display: none;
}
.user-menu.show { display: block; }
.user-menu .mi { padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.user-menu .mi:hover { background: #f1f5f9; }
.user-menu .who { padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.user-menu .who b { display: block; }
.user-menu .who span { font-size: 11.5px; color: var(--muted); }

.content { padding: 22px 24px 40px; max-width: 1560px; width: 100%; margin: 0 auto; }

/* ---------------- 通用组件 ---------------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 21px; }
.page-head h2.hero-slogan {
  font-size: 30px; font-weight: 800; letter-spacing: 2px; line-height: 1.25;
  background: linear-gradient(92deg, #0f2a5c 0%, #1d4ed8 48%, #0d9488 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  text-shadow: 0 1px 0 rgba(15, 42, 92, .08);
}
.be .page-head h2.hero-slogan { font-size: 20px; letter-spacing: 1px; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card-head h3 { margin: 0; font-size: 15px; }
.card-head .sub { color: var(--muted); font-size: 12px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 16px 18px; }

.grid { display: grid; gap: 14px; }
.kpi-grid { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }
.cat-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; min-height: 130px; }
.kpi::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, rgba(15, 157, 138, .10), transparent 70%); }
.kpi .label { color: var(--muted); font-size: 12.5px; }
.kpi .val { font-size: 27px; font-weight: 800; margin-top: 6px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.kpi .val small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.kpi .foot { margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.kpi.green .val { color: #0f766e; }
.kpi.blue .val { color: #1d4ed8; }
.kpi.cyan .val { color: #0e7490; }
.kpi.orange .val { color: #b45309; }
.kpi.red .val { color: #b91c1c; }
.kpi.purple .val { color: #6d28d9; }

.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); padding: 8px 14px;
  border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px;
  transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #cbd5e1; background: #f8fafc; }
.btn.primary { background: linear-gradient(135deg, #0f9d8a, #0b7d75); border-color: transparent; color: #fff; box-shadow: 0 8px 18px -10px rgba(15, 157, 138, .9); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { background: #fff1f2; border-color: #fecdd3; color: #be123c; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.input, .select, textarea.input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; outline: none; color: var(--ink);
  transition: .15s;
}
.input:focus, .select:focus, textarea.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 157, 138, .12); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.toolbar .search { position: relative; display: flex; align-items: center; }
.toolbar .search input { padding-left: 34px; min-width: 230px; height: 36px; }
.toolbar .search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #94a3b8; }
/* 电池列表：右侧导出按钮 + 设备数 */
.bms-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.bms-tools .btn { height: 36px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg { display: inline-flex; align-items: center; background: #f1f5f9; padding: 3px; border-radius: 10px; gap: 2px; flex-wrap: wrap; min-height: 36px; }
.seg button { border: 0; background: transparent; height: 28px; padding: 0 11px; border-radius: 7px; cursor: pointer; font-size: 12.5px; line-height: 1; color: var(--muted); }
.seg button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); font-weight: 600; }

/* 电池列表：字段选择器 */
.bms-cols { position: relative; }
.bms-cols-backdrop { display: none; }
.bms-cols .cols-count { font-size: 11.5px; color: #64748b; margin-left: 2px; }
.bms-cols-panel { position: absolute; top: calc(100% + 6px); right: 0; z-index: 50; width: 280px; max-height: 380px; overflow-y: auto; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 23, 42, .18); padding: 8px; display: none; }
.bms-cols-panel.open { display: block; }
.bms-cols-panel h5 { margin: 8px 6px 4px; font-size: 12px; color: #64748b; font-weight: 600; }
.bms-cols-panel label { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; cursor: pointer; font-size: 12.5px; color: #334155; }
.bms-cols-panel label:hover { background: #f1f5f9; }
.bms-cols-panel .cols-actions { display: flex; gap: 6px; padding: 8px 4px 2px; border-top: 1px solid #eef2f7; margin-top: 6px; }
.bms-cols-panel .cols-actions button { flex: 1; height: 28px; font-size: 12px; border: 1px solid #e2e8f0; background: #fff; border-radius: 6px; cursor: pointer; color: #475569; }
.bms-cols-panel .cols-actions button:hover { border-color: #5b9bd5; color: #5b9bd5; }

.table-wrap { overflow-x: auto; overflow-y: scroll; }
/* 电池列表：列多时不压缩、不换行，由外层 .table-wrap 横向滚动；纵向滚动条始终可见，便于快速拖拽 */
#bms-grid { max-height: calc(100vh - 400px); }
#bms-grid .table { width: max-content; min-width: 100%; }
#bms-grid .table td { white-space: nowrap; }
/* 电池列表内容字号与表头一致 */
#bms-grid .table td, #bms-grid .table .mono, #bms-grid .table .muted { font-size: 12px; }
/* 后台表格列较多：保证表头文字完整，超出宽度时横向滚动，不压缩、不截断 */
.be-table { min-width: 1180px; }
.be-table th, .be-table td { white-space: nowrap; }
/* 设备档案列表：内容字号统一（序号/编号/型号等一致） */
.be-table td, .be-table td .mono, .be-table td .muted { font-size: 12.5px; }
/* 中日英语言切换 */
.lang-switch { display: flex; gap: 4px; align-items: center; }
.lang-switch button { border: 1px solid #e2e8f0; background: #fff; color: #475569; font-size: 12px; line-height: 1; padding: 6px 10px; border-radius: 999px; cursor: pointer; transition: all .15s ease; }
.lang-switch button:hover { border-color: #0f766e; color: #0f766e; }
.lang-switch button.active { background: #0f766e; border-color: #0f766e; color: #fff; }
.login-page .login-lang { position: absolute; top: 20px; right: 26px; z-index: 30; background: rgba(255, 255, 255, .82); padding: 4px; border-radius: 999px; box-shadow: 0 4px 14px rgba(15, 23, 42, .08); }
@media (max-width: 640px) { .login-page .login-lang { top: 12px; right: 12px; } }

/* 电池列表：单元格内容字号统一（编号/型号/数值一致） */
#bms-grid td, #bms-grid td.muted, #bms-grid td .mono, #bms-grid td .strong { font-size: 12.5px; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; padding: 11px 14px; color: var(--muted); font-weight: 600; font-size: 12px;
  background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0;
}
.table td { padding: 12px 14px; border-bottom: 1px solid #eef2f7; vertical-align: middle; }
.table tbody tr { transition: .12s; }
/* 电池列表可点击单元格样式：电池编号 / BMS SN / HWID 均可点击跳转详情，颜色与电池编号统一为深灰黑 */
.table .bms-link { color: var(--ink); text-decoration: none; cursor: pointer; font-weight: 600; }
.table .bms-link:hover { text-decoration: underline; color: var(--primary-ink); }
/* 行交替填充：第 1 行无填充、第 2 行填充、第 3 行无填充、第 4 行填充（odd 白 / even 浅灰）*/
.table tbody tr:nth-child(even) { background: #f5f8fc; }
.table tbody tr:hover { background: #eaf2fb; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .mono { font-family: "JetBrains Mono", Consolas, monospace; font-size: 12.5px; letter-spacing: .2px; }
.table .strong { font-weight: 600; color: var(--ink); }
.table .muted { color: var(--muted); font-size: 12px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions-cell { white-space: nowrap; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; background: #f1f5f9; color: #475569; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.green { background: #ecfdf5; color: #047857; }
.badge.blue { background: #eff6ff; color: #1d4ed8; }
.badge.amber { background: #fffbeb; color: #b45309; }
.badge.orange { background: #fff7ed; color: #c2410c; }
.badge.red { background: #fef2f2; color: #b91c1c; }
.badge.purple { background: #f5f3ff; color: #6d28d9; }
.badge.cyan { background: #ecfeff; color: #0e7490; }
.badge.gray { background: #f1f5f9; color: #64748b; }
.badge.solid { color: #fff; }
.badge.solid::before { background: #fff; }

.chip { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 6px; background: #f1f5f9; font-size: 11.5px; color: #475569; }
.money { font-variant-numeric: tabular-nums; font-weight: 600; }
.money.red { color: #b91c1c; }
.money.green { color: #047857; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  padding: 12px 16px; cursor: pointer; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent;
  white-space: nowrap; font-weight: 500;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--primary-ink); border-bottom-color: var(--primary); font-weight: 700; }

.empty { padding: 46px 20px; text-align: center; color: var(--muted); }
.empty .big { font-size: 34px; opacity: .35; margin-bottom: 8px; }

.pager { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); }
.pager .info { color: var(--muted); font-size: 12px; }
.pager .spacer { margin-left: auto; }
.pager button { min-width: 32px; height: 32px; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; color: var(--ink-2); }
.pager button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* modal */
.modal-mask { position: fixed; inset: 0; background: rgba(7, 16, 31, .5); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 100; padding: 24px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 620px; max-height: 88vh; display: flex; flex-direction: column; animation: pop .18s ease; }
.modal.wide { max-width: 860px; }
.modal.narrow { max-width: 440px; }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-head .x { margin-left: auto; width: 30px; height: 30px; border-radius: 8px; border: 0; background: #f1f5f9; cursor: pointer; font-size: 16px; color: var(--muted); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }

/* toast */
#toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #0f172a; color: #e2e8f0; padding: 10px 18px; border-radius: 10px; font-size: 13px; box-shadow: var(--shadow-lg); animation: drop .2s ease; display: flex; align-items: center; gap: 8px; }
.toast.ok { background: #065f46; }
.toast.err { background: #991b1b; }
@keyframes drop { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* dashboard */
.dash-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 14px; margin-top: 14px; }
.dash-grid2 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-top: 14px; }
.chart-box { height: 240px; position: relative; }
.chart-box canvas { width: 100%; height: 100%; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.legend i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; margin-right: 5px; }
.alert-item { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px dashed var(--line); align-items: flex-start; }
.alert-item:last-child { border-bottom: 0; }
.alert-item .lvl { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; flex: 0 0 7px; }
.alert-item .lvl.critical { background: #ef4444; box-shadow: 0 0 0 3px #fee2e2; }
.alert-item .lvl.warning { background: #f59e0b; box-shadow: 0 0 0 3px #fef3c7; }
.alert-item .lvl.info { background: #38bdf8; box-shadow: 0 0 0 3px #e0f2fe; }
.alert-item .txt { flex: 1; min-width: 0; }
.alert-item .txt b { font-size: 12.8px; display: block; }
.alert-item .txt span { font-size: 11.5px; color: var(--muted); display: block; margin-top: 2px; }
.alert-item .time { font-size: 11px; color: #94a3b8; white-space: nowrap; }

.legend-list { display: flex; flex-direction: column; gap: 9px; }
.legend-list .row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.legend-list .row .dot { width: 8px; height: 8px; border-radius: 3px; }
.legend-list .row .name { color: var(--ink-2); }
.legend-list .row .num { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.bar-track { height: 8px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.bar-track > i { display: block; height: 100%; border-radius: 999px; }

/* battery detail */
.batt-head { display: flex; gap: 18px; align-items: center; padding: 18px 20px; flex-wrap: wrap; }
.batt-ico { width: 54px; height: 54px; border-radius: 14px; background: linear-gradient(145deg, #e6fffb, #ccfbf1); display: grid; place-items: center; color: #0f766e; flex: 0 0 54px; }
.batt-head .id h2 { margin: 0; font-size: 20px; letter-spacing: .3px; }
.batt-head .id .sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.batt-head .right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.batt-tabs { background: #fff; border-bottom: 1px solid var(--line); padding: 10px 20px; display: flex; gap: 6px; overflow-x: auto; }
.batt-tabs .tab { padding: 8px 14px; border-radius: 8px; border-bottom: 0; background: #f1f5f9; color: #475569; }
.batt-tabs .tab:hover { background: #e6edf6; color: var(--ink); }
.batt-tabs .tab.active { background: var(--primary-ink); color: #fff; font-weight: 600; }
.batt-tabs .tab.active:hover { background: #0a5f55; color: #fff; }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }

/* 电池详情 · 基础信息下方 4 个历史趋势卡片 */
.batt-charts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 12px; }
.batt-charts-bar { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.batt-charts-bar label { font-size: 12px; color: #64748b; }
.trend-select { height: 30px; padding: 0 8px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; color: #334155; font-size: 12.5px; cursor: pointer; }
.batt-chart { background: #fff; border: 1px solid #eef1f6; border-radius: 12px; padding: 10px 12px 6px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.batt-chart-head { position: relative; display: flex; align-items: center; justify-content: center; min-height: 24px; margin-bottom: 2px; }
.batt-chart-head h3 { margin: 0; font-size: 15px; font-weight: 700; color: #1e293b; text-align: center; letter-spacing: .2px; }
.batt-chart-tools { position: absolute; right: -2px; top: -1px; display: flex; gap: 2px; }
.batt-chart-tools button { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: #9aa8bb; border-radius: 6px; cursor: pointer; padding: 0; transition: background .15s, color .15s; }
.batt-chart-tools button:hover { background: #f1f5f9; color: #3b82f6; }
.batt-chart-legend { display: flex; align-items: center; gap: 14px; min-height: 20px; padding: 0 2px 2px; }
.batt-chart-stat { background: none; padding: 0; font-size: 11px; line-height: 1.4; color: #94a3b8; white-space: nowrap; text-align: right; margin-left: auto; }
.batt-legend { display: flex; gap: 14px; align-items: center; }
.batt-legend .lg { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #64748b; cursor: pointer; user-select: none; transition: opacity .15s; }
.batt-legend .lg i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.batt-legend .lg.off { opacity: .35; text-decoration: line-through; }
.batt-chart canvas { cursor: grab; }
.batt-chart .chart-box { height: 240px; }
.batt-chart.batt-chart-lg .chart-box { height: 240px; }
.batt-charts-note { padding: 10px 2px 0; color: #64748b; font-size: 12px; }
@media (max-width: 860px) { .batt-charts { grid-template-columns: 1fr; } }
.info-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.info-list .it { padding: 9px 0; border-bottom: 1px dashed #eef2f7; display: flex; gap: 8px; font-size: 12.8px; }
.info-list .it.full { grid-column: 1 / -1; }
.info-list .it label { color: var(--muted); min-width: 86px; flex: 0 0 86px; }
.info-list .it span { color: var(--ink); font-weight: 500; word-break: break-all; }

.realtime-hero { display: grid; grid-template-columns: 1.1fr 2fr; gap: 14px; }
.gauge-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mini-stat { background: #f8fafc; border: 1px solid #eef2f7; border-radius: 11px; padding: 11px 13px; }
.mini-stat .k { font-size: 11.5px; color: var(--muted); }
.mini-stat .v { font-size: 19px; font-weight: 800; margin-top: 3px; font-variant-numeric: tabular-nums; }
.mini-stat .v small { font-size: 11px; color: var(--muted); font-weight: 500; }
.cells-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.cell-chip { background: #f8fafc; border: 1px solid #eef2f7; border-radius: 8px; padding: 6px 4px; min-height: 44px; text-align: center; font-size: 13px; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cell-chip b { display: block; font-size: 10.5px; color: #64748b; font-weight: 600; font-variant-numeric: tabular-nums; }
.cell-chip.hi { border-color: #fda4af; background: #fff1f2; color: #be123c; }
.cell-chip.hi b { color: #e11d48; }
.cell-chip.lo { border-color: #fcd34d; background: #fffbeb; color: #b45309; }
.cell-chip.lo b { color: #b45309; }

.section-title { font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 4px 0 12px; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--primary); }

.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 1px; background: var(--line); }
.timeline .ti { position: relative; padding-bottom: 16px; }
.timeline .ti::before { content: ""; position: absolute; left: -17px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); }
.timeline .ti.danger::before { border-color: #ef4444; }
.timeline .ti .t { font-size: 12.8px; font-weight: 600; }
.timeline .ti .d { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.timeline .ti .when { font-size: 11px; color: #94a3b8; margin-top: 3px; }

/* kanban */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 12px; align-items: start; }
.kan-col { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 160px; }
.kan-col h4 { margin: 2px 4px 10px; font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.kan-col h4 .n { margin-left: auto; background: #e2e8f0; border-radius: 999px; padding: 1px 8px; font-size: 11px; color: #475569; }
.kan-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; margin-bottom: 8px; cursor: pointer; box-shadow: 0 1px 2px rgba(15,23,42,.04); transition: .15s; }
.kan-card:hover { border-color: #b6e9e3; transform: translateY(-1px); }
.kan-card .no { font-size: 11px; color: var(--muted); font-family: Consolas, monospace; }
.kan-card .ttl { font-size: 13px; font-weight: 600; margin: 4px 0; }
.kan-card .meta { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* device grid */
.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.device { border: 1px solid var(--line); border-radius: 12px; padding: 13px; background: #fff; cursor: pointer; transition: .15s; position: relative; }
.device:hover { box-shadow: var(--shadow); border-color: #cdeae6; }
.device .top { display: flex; align-items: center; gap: 8px; }
.device .sn { font-family: Consolas, monospace; font-size: 12.5px; font-weight: 600; }
.device .dot { width: 8px; height: 8px; border-radius: 50%; margin-left: auto; }
.device .dot.on { background: #10b981; box-shadow: 0 0 0 3px #d1fae5; }
.device .dot.off { background: #94a3b8; box-shadow: 0 0 0 3px #f1f5f9; }
.device .cust { font-size: 11.5px; color: var(--muted); margin: 6px 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.device .metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.device .metrics div { background: #f8fafc; border-radius: 7px; padding: 5px 6px; }
.device .metrics span { display: block; font-size: 10px; color: var(--muted); }
.device .metrics b { font-size: 12.5px; font-variant-numeric: tabular-nums; }

.progress { height: 6px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, #14b8a6, #0891b2); }

.note-box { background: #f8fafc; border: 1px solid #eef2f7; border-radius: 10px; padding: 12px 14px; font-size: 12.8px; color: var(--ink-2); line-height: 1.7; }
.ai-tag { display: inline-flex; align-items: center; gap: 5px; background: linear-gradient(135deg, #eef2ff, #ecfeff); color: #4338ca; border: 1px solid #e0e7ff; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; }
.risk-list { margin: 0; padding-left: 18px; font-size: 12.5px; color: #b45309; line-height: 1.9; }

.stat-row { display: flex; gap: 18px; flex-wrap: wrap; }
.stat-row .s { min-width: 110px; }
.stat-row .s .k { font-size: 11.5px; color: var(--muted); }
.stat-row .s .v { font-size: 21px; font-weight: 800; margin-top: 2px; }

.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; align-items: start; }
.split-even { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }

.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 12.8px; }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow b { display: block; font-weight: 600; }
.list-row .grow span { color: var(--muted); font-size: 11.5px; }

.upload-box { border: 1.5px dashed #cbd5e1; border-radius: 11px; padding: 18px; text-align: center; color: var(--muted); font-size: 12.5px; cursor: pointer; }
.upload-box:hover { border-color: var(--primary); color: var(--primary-ink); background: #f7fffd; }

@media (max-width: 1180px) {
  .dash-grid, .dash-grid2, .split, .split-even, .realtime-hero { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .sidebar { position: fixed; left: -240px; transition: .2s; }
  .sidebar.open { left: 0; }
  .content { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .info-list { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; }
  .topbar h1 { font-size: 15px; }
  .topbar-title { font-size: 17px; letter-spacing: 1px; }
  .user-chip .meta { display: none; }
  /* ===== 移动端告警中心 ===== */
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi { min-height: 110px; padding: 14px 14px 12px; }
  .kpi .val { font-size: 22px; }
  .cat-grid { grid-template-columns: 1fr; }
  .toolbar { flex-wrap: wrap; }
  .toolbar .search, .toolbar .select, .toolbar input[type="date"] { width: auto !important; flex: 1 1 100% !important; min-width: 0; }
  .toolbar #seg { width: 100%; justify-content: flex-start; }
  .bms-tools { margin-left: 0; width: 100%; justify-content: space-between; }
  /* 移动端：字段面板改为相对视口的居中弹窗 + 遮罩，彻底避免被裁切/跑出屏幕 */
  .bms-cols-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(7, 16, 31, .45); z-index: 999; }
  .bms-cols-panel { position: fixed !important; left: 14px; right: 14px; top: 50%; transform: translateY(-50%); width: auto !important; max-width: none; max-height: 78vh; z-index: 1000; }
  .table-wrap { overflow-x: auto; overflow-y: scroll; }
  .table-wrap table { min-width: 560px; }
  #cat-usage table, #cat-system table, #cat-cell table { min-width: auto; }
}

/* 小屏/横屏手机（≤1000px）：字段面板也用居中弹窗，避免下拉被屏幕边缘裁切 */
@media (max-width: 1000px) {
  .bms-cols-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(7, 16, 31, .45); z-index: 999; }
  .bms-cols-panel { position: fixed !important; left: 14px; right: 14px; top: 50%; transform: translateY(-50%); width: auto !important; max-width: none; max-height: 78vh; z-index: 1000; }
}

/* ===== 管理后台（独立控制台） ===== */
.be { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: #eef2f6; }
.be-top { height: 48px; background: linear-gradient(90deg, #0f2a5c 0%, #1d4ed8 100%); color: #fff; display: flex; align-items: center; padding: 0 16px; flex-shrink: 0; box-shadow: 0 1px 4px rgba(15, 42, 92, .25); }
.be-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.be-title svg { fill: #fff; }
.be-top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 13px; }
.be-back { color: #fff; text-decoration: none; border: 1px solid rgba(255, 255, 255, .6); padding: 4px 10px; border-radius: 4px; }
.be-back:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.be-body { flex: 1; display: flex; min-height: 0; }
.be-side { width: 200px; flex-shrink: 0; background: #2f3640; padding: 10px 0; overflow-y: auto; }
.be-mi { display: flex; align-items: center; gap: 9px; padding: 10px 16px; color: #cfd6e0; font-size: 13px; cursor: pointer; border-left: 3px solid transparent; white-space: nowrap; }
.be-mi svg { flex-shrink: 0; }
.be-mi span { flex-shrink: 0; white-space: nowrap; }
.be-mi:hover { background: #3a424e; color: #fff; }
.be-mi.active { background: #3a424e; color: #fff; border-left-color: #5b9bd5; }
.be-mg { margin-top: 6px; padding: 10px 16px 4px; font-size: 11px; color: #8b95a5; border-top: 1px solid #3f4753; letter-spacing: .5px; }
/* 下级菜单：账号管理 → 用户账号 / 角色管理 */
.be-parent .caret { margin-left: auto; font-size: 10px; color: #8b95a5; transition: transform .15s ease; }
.be-parent.open .caret { transform: rotate(180deg); }
.be-sub { display: none; }
.be-sub.open { display: block; }
.be-sub-i { padding-left: 36px; font-size: 12.5px; }
.be-main { flex: 1; overflow: auto; padding: 14px; min-width: 0; }
.be-page { display: flex; flex-direction: column; gap: 14px; }
.be-tabs { display: flex; gap: 4px; border-bottom: 1px solid #e2e8f0; }
.be-tab { padding: 8px 18px; border: 0; background: none; color: #64748b; font-size: 13px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.be-tab:hover { color: #2563eb; }
.be-tab.active { color: #2563eb; font-weight: 600; border-bottom-color: #2563eb; }

/* 权限矩阵（系统 / 模块 / 查询 / 编辑） */
.perm-toolbar { display: flex; gap: 8px; margin-bottom: 10px; }
.perm-table-wrap { max-height: 400px; overflow: auto; border: 1px solid #e5e9f0; border-radius: 4px; }
.perm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.perm-table th { background: #f7f9fc; color: #1f2d3d; font-weight: 600; padding: 10px 8px; border-bottom: 1px solid #e5e9f0; text-align: center; position: sticky; top: 0; z-index: 1; }
.perm-table td { border-bottom: 1px solid #eef1f6; padding: 6px 8px; text-align: center; }
.perm-table tbody tr:nth-child(even) { background: #fafbfd; }
.perm-table .perm-sys-col { width: 130px; }
.perm-table .perm-mod-col { width: 230px; }
.perm-table .perm-col { width: 108px; }
.perm-table .perm-sys { background: #f7f9fc; font-weight: 600; color: #1f2d3d; vertical-align: middle; border-right: 1px solid #e5e9f0; }
.perm-table .perm-mod { color: #1f2d3d; border-right: 1px solid #eef1f6; }
.perm-btn { display: inline-block; min-width: 68px; padding: 4px 10px; border: 0; border-radius: 3px; color: #fff; font-size: 12px; line-height: 1.5; cursor: pointer; }
.perm-btn.on { background: #4a90d9; }
.perm-btn.off { background: #e0604a; }
.perm-btn:hover { opacity: .88; }
.perm-btn.locked { opacity: .7; cursor: not-allowed; }
.perm-disabled { opacity: .45; pointer-events: none; }
.be-card { background: #fff; border-radius: 4px; padding: 16px; box-shadow: 0 1px 3px rgba(15, 23, 42, .08); }
.be-card-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.be-card-head h3 { margin: 0; font-size: 15px; white-space: nowrap; }
.be-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.be-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 16px; }
.be-tile { border: 1px solid #e2e8f0; border-radius: 6px; padding: 14px; cursor: pointer; transition: .15s; }
.be-tile:hover { border-color: #5b9bd5; box-shadow: 0 2px 8px rgba(91, 155, 213, .18); }
.be-tile b { display: block; margin-bottom: 6px; font-size: 14px; }
.be-tile span { font-size: 12px; color: #64748b; line-height: 1.6; }
.be-form-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.be-form-head h3 { margin: 0; font-size: 15px; }
.be-form-head p { margin: 4px 0 0; font-size: 12px; }
.be-form-actions { margin-top: 16px; display: flex; gap: 10px; }
.be-row { cursor: pointer; }
.be-row:hover { background: #f8fafc; }
.be .page-head h2 { font-size: 16px; }
.be .page-head p { font-size: 12px; }
.be .content, .be .kpi { box-shadow: none; }

/* ===== 电池详情：键值网格（概览 / BMS信息） ===== */
.kv-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid #e2e8f0; border-radius: 4px; overflow: hidden; width: 100%; }
.kv { display: flex; border-right: 1px solid #eef2f7; border-bottom: 1px solid #eef2f7; min-height: 38px; }
.kv label { width: 108px; flex-shrink: 0; background: #f7f9fc; color: #475569; font-size: 12.5px; padding: 10px; border-right: 1px solid #eef2f7; }
.kv span { flex: 1; padding: 10px; font-size: 12.5px; font-weight: 600; color: #0f172a; word-break: break-all; }
@media (max-width: 1100px) { .kv-grid { grid-template-columns: repeat(2, 1fr); } }

/* ===== 实时数据 ===== */
.rt-head { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; padding: 10px 14px; background: #f8fafc; border: 1px solid #e8eef6; border-radius: 8px; margin-bottom: 16px; }
.rt-meta { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; }
.rt-meta label { color: #94a3b8; }
.rt-meta b { color: #0f172a; font-weight: 600; }
.rt-head-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.rt-hero { display: grid; grid-template-columns: .9fr .9fr .9fr 1.8fr; gap: 14px; margin-bottom: 14px; }
.rt-big { background: #fff; border: 1px solid #e8eef6; border-radius: 10px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; box-shadow: 0 1px 3px rgba(15, 23, 42, .05); }
.rt-big .h { font-size: 12.5px; color: #fff; text-align: center; padding: 8px; font-weight: 600; letter-spacing: .5px; }
.rt-big.volt .h { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.rt-big.curr .h { background: linear-gradient(90deg, #0d9488, #2dd4bf); }
.rt-big.soc .h { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.rt-big .v { font-size: 34px; font-weight: 700; color: #0f172a; text-align: center; padding: 16px 0 10px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.rt-big .v small { font-size: 13px; color: #64748b; margin-left: 4px; font-weight: 500; }
.rt-big .rt-bar { height: 5px; margin: 0 16px 14px; background: #eef2f7; border-radius: 99px; overflow: hidden; }
.rt-big.volt .rt-bar i { background: linear-gradient(90deg, #2563eb, #93c5fd); }
.rt-big.curr .rt-bar i { background: linear-gradient(90deg, #0d9488, #5eead4); }
.rt-big.soc .rt-bar i { background: linear-gradient(90deg, #7c3aed, #c4b5fd); }
.rt-big .rt-bar i { display: block; height: 100%; border-radius: 99px; transition: width .4s ease; }
.rt-side { border: 1px solid #e8eef6; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .05); }
.rt-row { display: grid; grid-template-columns: 62% 1fr; align-items: center; padding: 6px 12px; font-size: 12.5px; border-bottom: 1px solid #f1f5f9; }
.rt-row:nth-child(odd) { background: #fbfdff; }
.rt-row:last-child { border-bottom: none; }
.rt-row span { color: #64748b; }
.rt-row b { color: #0f172a; font-weight: 600; font-variant-numeric: tabular-nums; }
.rt-kv { grid-template-columns: repeat(4, 1fr); border-radius: 8px; }
.rt-kv .kv span { font-weight: 600; }
.rt-panel-title { font-size: 13px; font-weight: 600; color: #334155; background: linear-gradient(90deg, #f1f5f9, #f8fafc); border-left: 3px solid #3b82f6; padding: 7px 12px; border-radius: 4px; margin: 18px 0 10px; display: flex; align-items: center; gap: 8px; }
.rt-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: #e0e7ff; color: #4338ca; font-size: 11px; font-weight: 700; }
.rt-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 4px; }
.rt-stat { position: relative; border: 1px solid #e8eef6; border-radius: 10px; padding: 10px 12px 9px; background: #fff; overflow: hidden; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.rt-stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #cbd5e1; }
.rt-stat label { display: block; font-size: 11.5px; color: #64748b; margin-bottom: 5px; }
.rt-stat b { display: block; font-size: 20px; line-height: 1.15; color: #0f172a; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.rt-stat b small { font-size: 11.5px; color: #94a3b8; margin-left: 3px; font-weight: 500; }
.rt-stat span { display: block; margin-top: 4px; font-size: 11px; color: #94a3b8; }
.rt-stat.rose { background: linear-gradient(180deg, #fff5f6, #fff); }
.rt-stat.rose::before { background: #f43f5e; }
.rt-stat.rose b { color: #be123c; }
.rt-stat.amber { background: linear-gradient(180deg, #fffbeb, #fff); }
.rt-stat.amber::before { background: #f59e0b; }
.rt-stat.amber b { color: #b45309; }
.rt-stat.orange { background: linear-gradient(180deg, #fff7ed, #fff); }
.rt-stat.orange::before { background: #f97316; }
.rt-stat.orange b { color: #c2410c; }
.rt-stat.sky { background: linear-gradient(180deg, #f0f9ff, #fff); }
.rt-stat.sky::before { background: #0ea5e9; }
.rt-stat.sky b { color: #0369a1; }
.rt-stat.violet { background: linear-gradient(180deg, #f5f3ff, #fff); }
.rt-stat.violet::before { background: #8b5cf6; }
.rt-stat.violet b { color: #6d28d9; }
.rt-stat.indigo { background: linear-gradient(180deg, #eef2ff, #fff); }
.rt-stat.indigo::before { background: #6366f1; }
.rt-stat.indigo b { color: #4338ca; }
.rt-stat.teal { background: linear-gradient(180deg, #f0fdfa, #fff); }
.rt-stat.teal::before { background: #14b8a6; }
.rt-stat.teal b { color: #0f766e; }
.rt-stat.emerald { background: linear-gradient(180deg, #ecfdf5, #fff); }
.rt-stat.emerald::before { background: #10b981; }
.rt-stat.emerald b { color: #047857; }
.temps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.temp-chip { background: linear-gradient(180deg, #f0fdf4, #f8fafc); border: 1px solid #dcfce7; border-radius: 8px; padding: 6px 4px; text-align: center; font-size: 11px; color: #166534; }
.temp-chip b { display: block; font-size: 10.5px; color: #64748b; font-weight: 600; }
.temp-chip span { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.temp-chip i { font-style: normal; font-size: 10px; color: #94a3b8; margin-left: 1px; }
.temp-chip.hi { border-color: #fda4af; background: linear-gradient(180deg, #fff1f2, #fff); color: #be123c; }
.temp-chip.hi b { color: #e11d48; }
.temp-chip.lo { border-color: #bae6fd; background: linear-gradient(180deg, #f0f9ff, #fff); color: #0369a1; }
.temp-chip.lo b { color: #0284c7; }

/* ===== 数据查询 ===== */
.dq-hint { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 12px; border-radius: 4px; margin: 0 14px 10px; }
.dq-toggle { margin-left: auto; display: flex; align-items: center; gap: 6px; color: #475569; cursor: pointer; }
.dq-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid #eef2f7; }
.pg-info { font-size: 12px; color: #64748b; }
.pg-btns { display: flex; align-items: center; gap: 4px; }
.pg { min-width: 28px; height: 26px; border: 1px solid #e2e8f0; background: #fff; border-radius: 3px; font-size: 12px; color: #475569; cursor: pointer; }
.pg.active { background: #5b9bd5; border-color: #5b9bd5; color: #fff; }
.pg:hover:not(.active) { border-color: #5b9bd5; color: #5b9bd5; }
.dq-fault td { background: #fff7e6; }

/* ===== 后台设备列表筛选栏 ===== */
.be-filters { display: flex; flex-wrap: wrap; gap: 14px 18px; padding: 4px 2px 14px; border-bottom: 1px solid #eef2f7; margin-bottom: 12px; }
.be-filter { display: flex; align-items: center; gap: 8px; }
.be-filter label { font-size: 12.5px; color: #475569; white-space: nowrap; min-width: 56px; }
.be-filter .input { width: 170px; min-width: 140px; flex: 0 0 auto; height: 30px; }
.be-filter .select { width: 150px; min-width: 140px; flex: 0 0 auto; height: 30px; padding-right: 26px; }
.be-filter > div { flex: 0 0 auto; }
.be-filter-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* ===== 设备二维码弹窗 ===== */
.qr-wrap { text-align: center; padding: 6px 0 2px; }
.qr-wrap img { border: 1px solid #e5ebf3; border-radius: 8px; background: #fff; }
.qr-url { margin: 12px auto 6px; max-width: 420px; font-size: 11.5px; color: #475569; word-break: break-all; background: #f7f9fc; border: 1px solid #e8eef6; border-radius: 4px; padding: 8px 10px; }
