:root {
  --brand: #2563eb;
  --brand-soft: #eff6ff;
  --bg: #f5f6f8;
  --panel: #ffffff;
  --border: #e5e7eb;
  --text: #1f2937;
  --text-2: #6b7280;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --app-font-size: 14px;
  --app-small-font-size: 12px;
}

* { box-sizing: border-box; }
.ble-page-layout.ble-connection-only { grid-template-columns:minmax(0,1fr); }
html[data-theme="dark"] ::selection { color:#fff; background:#2459a0; }
html[data-theme="dark"] .target-version-stats .ok { color:#86efac; background:#123629; }
html[data-theme="dark"] .target-version-stats .warn { color:#fde68a; background:#45351b; }
html[data-theme="dark"] .el-button--primary,
html[data-theme="dark"] .el-radio-button.is-active .el-radio-button__inner { color:#fff; background:#2459a0; border-color:#60a5fa; }
html[data-theme="dark"] .el-button--primary.is-plain { color:#bfdbfe; background:#173653; }

html, body, #app {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: var(--app-font-size);
}
html[data-font-size="small"] { --app-font-size: 13px; --app-small-font-size: 11px; --el-font-size-base: 13px; --el-font-size-small: 12px; }
html[data-font-size="medium"] { --app-font-size: 14px; --app-small-font-size: 12px; --el-font-size-base: 14px; --el-font-size-small: 13px; }
html[data-font-size="large"] { --app-font-size: 16px; --app-small-font-size: 14px; --el-font-size-base: 16px; --el-font-size-small: 15px; }
html[data-font-size] .layout,
html[data-font-size] .el-table,
html[data-font-size] .el-form-item__label,
html[data-font-size] .el-input__inner,
html[data-font-size] .el-button,
html[data-font-size] .el-select__wrapper { font-size: var(--app-font-size); }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: var(--panel);
}
.login-brand {
  position: relative;
  background: #0f172a;
  color: #fff;
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.login-brand::after {
  content: "";
  position: absolute;
  right: -180px;
  top: -180px;
  width: 460px;
  height: 460px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 50%;
}
.login-brand h1 {
  font-size: 30px;
  margin: 16px 0 8px;
  letter-spacing: 0;
}
.login-brand .sub {
  color: #94a3b8;
  max-width: 420px;
  line-height: 1.8;
}
.login-brand .brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: #fff;
  padding: 6px;
  object-fit: contain;
}
.login-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.login-card {
  width: 360px;
}
.login-card h2 {
  font-size: 24px;
  margin: 0 0 8px;
}
.login-card .tip { color: var(--text-2); margin: 0 0 28px; }
.login-card .el-input { margin-bottom: 18px; }
.login-btn { width: 100%; height: 42px; }
.login-register {
  margin-top: 18px;
  text-align: center;
  color: var(--text-2);
}
.login-register a { color: var(--brand); cursor: pointer; }
.login-legal { display:flex; flex-direction:column; align-items:flex-start; gap:8px; position:relative; z-index:1; }
.site-icp { color:var(--text-2); text-decoration:none; transition:color .15s; }
.site-icp:hover { color:var(--brand); }
.login-brand .site-icp { color:#94a3b8; }
.login-brand .site-icp:hover { color:#e2e8f0; }
.login-panel-icp { display:none; }

/* ---------- layout ---------- */
.layout {
  height: 100vh;
  display: flex;
}
.sidebar {
  width: 216px;
  flex: none;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.sidebar-head {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
}
.sidebar-head img { width: 32px; height: 32px; }
.sidebar-head .title { font-size: 16px; font-weight: 600; white-space: nowrap; }
.sidebar-nav { flex: 1; padding: 10px 8px; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  margin-bottom: 2px;
  border-radius: 6px;
  color: var(--text-2);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: #f3f4f6; color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-item svg { width: 17px; height: 17px; }
.nav-parent .nav-arrow { margin-left: auto; width: 14px; height: 14px; transition: transform .18s ease; }
.nav-parent .nav-arrow.open { transform: rotate(180deg); }
.nav-children { padding-left: 10px; }
.nav-item.child { position: relative; width: 100%; }
.nav-item.child::before { content: ""; position: absolute; left: 5px; top: 0; bottom: 0; border-left: 1px solid #e2e8f0; }
.nav-item.child svg { margin-left: 9px; }
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 60px;
  flex: none;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
}
.topbar .crumb { font-size: 15px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.preference-pills { display:inline-flex; align-items:center; padding:2px; border:1px solid var(--border); border-radius:7px; background:#f8fafc; }
.preference-pills button { min-width:30px; height:26px; padding:0 7px; border:0; border-radius:5px; background:transparent; color:var(--text-2); cursor:pointer; font:inherit; }
.preference-pills button:hover { color:var(--brand); }
.preference-pills button.active { background:#fff; color:var(--brand); font-weight:700; box-shadow:0 1px 3px rgba(15,23,42,.12); }
.topic-builder { display:grid; grid-template-columns:110px minmax(220px,1fr) auto; gap:8px; align-items:center; margin:10px 0; }
.topic-builder > label { color:#606266; text-align:right; padding-right:4px; }
.topic-builder > small { grid-column:2 / 4; color:var(--text-2); font-family:Consolas,monospace; overflow-wrap:anywhere; }
.ble-page-layout { display:grid; grid-template-columns:minmax(0,1fr); gap:16px; align-items:start; }
.ble-page-layout.admin-tools { grid-template-columns:minmax(0,1fr) 360px; }
.ble-page-main { min-width:0; }
.ble-passthrough { position:sticky; top:0; min-width:0; padding:14px; background:#fff; border:1px solid var(--border); border-radius:8px; }
.ble-passthrough.collapsed { width:68px; justify-self:end; padding:8px; }
.ble-passthrough-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:12px; }
.ble-passthrough-head small { display:block; margin-top:3px; color:var(--text-2); }
.ble-direction { display:flex; flex-direction:column; gap:2px; margin:14px 0 7px; }
.ble-direction span { color:var(--text-2); font-size:var(--app-small-font-size); font-family:Consolas,monospace; }
.ble-terminal { height:280px; overflow:auto; padding:10px; border-radius:6px; background:#0f172a; color:#d1fae5; font:12px/1.55 Consolas,monospace; white-space:pre-wrap; overflow-wrap:anywhere; }
.ble-terminal > div > span { color:#64748b; }
.ble-terminal-empty { color:#64748b; text-align:center; padding-top:110px; }
.ble-terminal-tools,.ble-send-row { display:flex; align-items:center; gap:8px; margin-top:8px; }
@media (max-width:1180px) { .ble-page-layout.admin-tools { grid-template-columns:1fr; } .ble-passthrough { position:static; width:100%; } .ble-passthrough.collapsed { width:100%; } }
@media (max-width:720px) { .topic-builder { grid-template-columns:1fr auto; } .topic-builder > label { grid-column:1 / 3; text-align:left; } .topic-builder > small { grid-column:1 / 3; } }
.top-utility { color: var(--text-2); font-size: 12px; white-space: nowrap; }
.top-link { color: var(--brand); font-size: 12px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.mqtt-dot { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 12px; }
.mqtt-dot .dot { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; }
.mqtt-dot .dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(22,163,74,0.18); }
.mqtt-dot .dot.off { background: var(--red); box-shadow: 0 0 0 3px rgba(220,38,38,0.15); }
.content { flex: 1; overflow-y: auto; padding: 20px 22px; }
.site-footer { flex:none; min-height:34px; display:flex; align-items:center; justify-content:center; padding:7px 16px; border-top:1px solid var(--border); background:var(--panel); font-size:12px; line-height:20px; }
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.page-head h2 { font-size: 18px; margin: 0; }

/* ---------- cards & tables ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.stat-grid.admin { grid-template-columns:repeat(6,1fr); }
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  min-width: 0;
}
.stat-card .label { color: var(--text-2); font-size: 13px; }
.stat-card .value { font-size: 26px; font-weight: 700; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat-card .unit { font-size: 12px; color: var(--text-2); margin-left: 2px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
.panel-title { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.panel-heading .panel-title { margin-bottom: 4px; }
.panel-subtitle { color: var(--text-2); font-size: 12px; }
.trend-summary { display: flex; gap: 18px; color: var(--text-2); font-size: 12px; white-space: nowrap; }
.trend-summary b { color: var(--text); font-size: 15px; margin: 0 2px; }
.trend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.trend-dot.device { background: #60a5fa; }
.trend-dot.user { background: #a78bfa; }
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.table-toolbar .spacer { flex: 1; }
.two-line .second { color: var(--text-2); font-size: 12px; margin-top: 2px; }
.mono { font-family: Consolas, "Courier New", monospace; }
.url-cell { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }

.mqtt-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-2);
}
.mqtt-banner .state { font-weight: 600; }
.mqtt-banner .state.on { color: var(--green); }
.mqtt-banner .state.off { color: var(--red); }

.trend-chart { width: 100%; height: 220px; }
.chart-bar-device { fill: #60a5fa; }
.chart-bar-user { fill: #a78bfa; }
.chart-bar:hover { opacity: .82; }
.chart-val { fill: #475569; font-size: 11px; text-anchor: middle; }
.chart-label { fill: #64748b; font-size: 11px; text-anchor: middle; }
.chart-axis { stroke: #e2e8f0; }

.status-overview-grid { display: grid; grid-template-columns: minmax(0,1fr) 220px; gap: 36px; align-items: center; padding: 18px 24px 22px; }
.status-bars { display: grid; gap: 24px; }
.status-bar-row { display: grid; grid-template-columns: 44px minmax(120px,1fr) 54px; gap: 12px; align-items: center; }
.status-bar-row > span { color: var(--text-2); }
.status-bar-row > b { font-size: 20px; text-align: right; }
.status-track { height: 16px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.status-track i { display: block; height: 100%; min-width: 3px; border-radius: inherit; transition: width .3s; }
.status-track i.online { background: linear-gradient(90deg,#22c55e,#16a34a); }
.status-track i.offline { background: linear-gradient(90deg,#cbd5e1,#94a3b8); }
.rate-donut { width: 150px; height: 150px; justify-self: center; border-radius: 50%; background: conic-gradient(var(--green) var(--rate),#e8edf3 0); display: grid; place-items: center; position: relative; }
.rate-donut::after { content:""; position:absolute; inset:16px; border-radius:50%; background:#fff; }
.rate-donut > div { position:relative; z-index:1; display:flex; flex-direction:column; align-items:center; }
.rate-donut b { font-size:26px; }
.rate-donut span { color:var(--text-2); font-size:12px; margin-top:4px; }
.dashboard-lists { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.dashboard-lists .panel { min-width:0; }

.signal-cell { display:flex; align-items:flex-end; gap:7px; color:var(--text-2); font-size:12px; }
.signal-bars { height:18px; display:flex; align-items:flex-end; gap:2px; }
.signal-bars i { display:block; width:4px; background:#d8dee8; border-radius:1px; }
.signal-bars i:nth-child(1){height:5px}.signal-bars i:nth-child(2){height:9px}.signal-bars i:nth-child(3){height:13px}.signal-bars i:nth-child(4){height:17px}
.signal-bars i.on { background:var(--green); }
.signal-offline { color:#94a3b8; font-size:18px; font-weight:600; line-height:1; }
.model-tree-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.model-root { display:flex; align-items:center; gap:8px; padding:10px 12px; background:#f8fafc; border-radius:6px; font-weight:700; }
.model-node { margin-left:18px; padding:12px 10px 12px 22px; border-left:1px solid #cbd5e1; display:flex; align-items:center; justify-content:space-between; gap:12px; }
.model-node > div:first-child { display:grid; grid-template-columns:minmax(100px,1fr) auto; column-gap:12px; flex:1; }
.model-node small { grid-column:1/-1; color:var(--text-2); margin-top:3px; }
.model-node .mono { color:#475569; font-size:12px; }

.group-model-picker { border:1px solid var(--line); border-radius:10px; overflow:hidden; margin:2px 0 14px; background:#fff; }
.group-model-picker-head { display:flex; align-items:center; justify-content:space-between; padding:12px 16px; background:#f8fafc; border-bottom:1px solid var(--line); }
.group-model-picker-head > div { display:flex; align-items:center; gap:10px; }
.group-model-picker-head span { color:var(--text-2); font-size:12px; }
.group-model-columns { display:grid; grid-template-columns:1fr 1fr; gap:0; }
.group-model-column { min-height:150px; padding:12px 14px 14px; }
.group-model-column + .group-model-column { border-left:1px solid var(--line); }
.group-model-type { display:flex; align-items:center; justify-content:space-between; padding:9px 10px; border-radius:7px; margin-bottom:8px; }
.group-model-type.wifi { background:#eff6ff; }
.group-model-type.mobile { background:#fff7ed; }
.group-model-option { padding:7px 10px; border-radius:6px; }
.group-model-option:hover { background:#f8fafc; }
.group-model-option .el-checkbox { width:100%; }
.group-model-option .el-checkbox__label { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; }
.group-model-option small { color:var(--text-2); font-family:ui-monospace, SFMono-Regular, Menlo, monospace; }
.group-model-tags { display:flex; flex-wrap:wrap; gap:6px; }

.pagination-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.config-hint {
  background: var(--brand-soft);
  border-radius: 6px;
  padding: 10px 12px;
  color: #1d4ed8;
  font-size: 13px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.firmware-upload-box { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }

.login-error { margin-bottom: 14px; }

.empty-block { color: var(--text-2); text-align: center; padding: 30px 0; }

.device-owner-cell .second { color: var(--text-2); font-size: 12px; }

.status-tag-online { color: var(--green); }
.status-tag-offline { color: #9ca3af; }

.profile-item { display: flex; gap: 10px; margin-bottom: 16px; }
.profile-item .label { width: 70px; flex: none; line-height: 32px; color: var(--text-2); }

.ble-log {
  background: #0f172a;
  border-radius: 8px;
  padding: 12px 14px;
  height: 260px;
  overflow-y: auto;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.8;
}
.ble-log-item { color: #e2e8f0; word-break: break-all; }
.ble-log-item .time { color: #64748b; margin-right: 8px; }
.ble-log-item.c-green { color: #4ade80; }
.ble-log-item.c-red { color: #f87171; }
.ble-log-item.c-yellow { color: #facc15; }
.ble-log-item.c-blue { color: #60a5fa; }
.ble-operation-log-panel { margin-top: 16px; }
.ble-operation-log-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.ble-operation-log-head .panel-title { margin-bottom: 4px; }
.ble-log-empty { color: #64748b; text-align: center; padding-top: 96px; }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-grid.admin { grid-template-columns: repeat(3, 1fr); }
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel-icp { display:block; position:absolute; left:50%; bottom:18px; transform:translateX(-50%); white-space:nowrap; }
  .dashboard-lists, .model-tree-grid { grid-template-columns:1fr; }
}
@media (max-width: 640px) {
  .group-model-columns { grid-template-columns:1fr; }
  .group-model-column + .group-model-column { border-left:0; border-top:1px solid var(--line); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid.admin { grid-template-columns: repeat(2, 1fr); }
  .sidebar { width: 60px; }
  .sidebar-head .title, .nav-item span { display: none; }
  .nav-item { justify-content: center; }
  .content { padding: 14px; }
  .status-overview-grid { grid-template-columns:1fr; padding:10px; }
  .top-utility, .top-link { display:none; }
}

/* ---------- theme, device history & location ---------- */
.theme-trigger { width:32px; height:32px; display:grid; place-items:center; padding:0; border:1px solid var(--border); border-radius:7px; background:var(--panel); color:var(--text-2); cursor:pointer; }
.theme-trigger:hover { color:var(--brand); border-color:var(--brand); }
.token-chip { display:inline-flex; align-items:center; gap:6px; height:30px; padding:0 10px; border:1px solid #bfdbfe; border-radius:999px; background:#eff6ff; color:#1d4ed8; cursor:pointer; }
.token-chip b { font-variant-numeric:tabular-nums; }
.token-balance-card { display:flex; align-items:center; justify-content:space-between; padding:18px 22px; border-radius:10px; color:#fff; background:linear-gradient(135deg,#1d4ed8,#0ea5e9); }
.token-balance-card > div { display:flex; align-items:baseline; gap:8px; }
.token-balance-card small { align-self:center; opacity:.8; margin-right:10px; }
.token-balance-card strong { font-size:34px; }
.token-balance-card > .el-icon { font-size:42px; opacity:.35; }
.token-plus { color:var(--green); font-weight:700; }.token-minus { color:var(--red); font-weight:700; }

.signal-copy { display:flex; flex-direction:column; line-height:1.15; }
.signal-copy b { color:var(--text); font-size:12px; }.signal-copy small { color:var(--text-2); margin-top:3px; }
.wifi-provision-card { display:flex; align-items:flex-start; gap:12px; margin-top:14px; padding:12px 14px; border:1px solid var(--border); border-left:3px solid #3b82f6; border-radius:7px; background:#f8fafc; }
.wifi-provision-card.is-success { border-left-color:var(--green); background:#f0fdf4; }.wifi-provision-card.is-failed,.wifi-provision-card.is-timeout { border-left-color:var(--red); background:#fef2f2; }
.wifi-provision-card .wifi-provision-icon { font-size:22px; color:#3b82f6; }.wifi-provision-card.is-success .wifi-provision-icon { color:var(--green); }.wifi-provision-card.is-failed .wifi-provision-icon,.wifi-provision-card.is-timeout .wifi-provision-icon { color:var(--red); }
.wifi-provision-card p { margin:4px 0; color:var(--text-2); }.wifi-provision-card small { color:var(--text-2); font-family:Consolas,monospace; }

.history-toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:14px; }
.history-summary { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:16px; }
.history-summary > div { display:flex; flex-direction:column; gap:5px; padding:12px 14px; border:1px solid var(--border); border-radius:7px; background:#f8fafc; }
.history-summary small { color:var(--text-2); }.history-summary b { font-size:17px; }.online-text { color:var(--green); }.offline-text { color:#94a3b8; }
.status-timeline { position:relative; height:24px; overflow:hidden; border-radius:6px; background:#e2e8f0; }
.status-timeline-base { position:absolute; inset:0; background:#94a3b8; }.status-timeline-segment { position:absolute; top:0; bottom:0; min-width:2px; }.status-timeline-segment.online { background:#22c55e; }.status-timeline-segment.offline { background:#94a3b8; }
.timeline-legend { display:flex; align-items:center; gap:16px; margin-top:8px; color:var(--text-2); font-size:12px; }.timeline-legend .spacer { flex:1; }.timeline-legend i { display:inline-block; width:9px; height:9px; border-radius:2px; margin-right:5px; }.timeline-legend i.online { background:#22c55e; }.timeline-legend i.offline { background:#94a3b8; }

.location-input-summary { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:14px; }.location-input-summary > span { display:flex; flex-direction:column; gap:5px; min-width:0; padding:12px; border:1px solid var(--border); border-radius:7px; background:#f8fafc; }.location-input-summary small { color:var(--text-2); }.location-input-summary b { overflow:hidden; text-overflow:ellipsis; }
.location-provider-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:10px; }.location-provider-card { display:flex; align-items:flex-start; gap:9px; min-height:92px; padding:13px; border:1px solid var(--border); border-radius:8px; cursor:pointer; transition:.15s; }.location-provider-card:hover { border-color:#93c5fd; }.location-provider-card.selected { border-color:var(--brand); box-shadow:0 0 0 2px rgba(37,99,235,.1); background:var(--brand-soft); }.location-provider-card.disabled { opacity:.55; cursor:not-allowed; }.location-provider-card span { display:flex; flex-direction:column; gap:7px; }.location-provider-card small { color:var(--text-2); line-height:1.4; }
.location-provider-card .provider-accuracy-note { padding-top:6px; border-top:1px dashed var(--border); }
.location-actions { display:flex; align-items:center; justify-content:flex-end; gap:12px; margin:16px 0; }.location-insufficient { color:var(--red); font-size:12px; }
.location-result-card { display:flex; align-items:center; gap:14px; padding:15px; border:1px solid #bbf7d0; border-radius:9px; background:#f0fdf4; }.location-result-icon { width:42px; height:42px; display:grid; place-items:center; flex:none; border-radius:50%; background:#dcfce7; color:var(--green); font-size:22px; }.location-result-main { flex:1; min-width:0; }.location-result-main small,.location-result-main p { color:var(--text-2); }.location-result-main h3 { margin:4px 0 7px; font-size:15px; }.location-result-main p { margin:3px 0; font-size:12px; }
.saved-location-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:10px; margin-top:12px; }.saved-location-card { display:flex; flex-direction:column; gap:6px; padding:12px; text-align:left; border:1px solid var(--border); border-radius:8px; background:var(--panel); color:var(--text); cursor:pointer; }.saved-location-card.active { border-color:var(--brand); box-shadow:0 0 0 2px rgba(37,99,235,.1); }.saved-location-card > span { display:flex; align-items:center; justify-content:space-between; gap:8px; }.saved-location-card small { color:var(--text-2); line-height:1.4; }
.location-service-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; margin-bottom:14px; }.location-service-setting { display:grid; gap:11px; padding:14px; border:1px solid var(--border); border-radius:8px; background:#f8fafc; }.location-service-setting > div { display:flex; align-items:center; justify-content:space-between; gap:8px; }.location-service-setting small { color:var(--text-2); }
.dashboard-map-panel { overflow:hidden; }.device-location-map { width:100%; height:420px; border:1px solid var(--border); border-radius:9px; overflow:hidden; touch-action:none; }.map-locked-state { height:180px; display:grid; place-items:center; align-content:center; gap:7px; color:var(--text-2); border:1px dashed var(--border); border-radius:9px; background:#f8fafc; }.map-locked-state .el-icon { font-size:32px; }.map-locked-state p { margin:0; color:var(--text); font-weight:600; }.map-accuracy-notes { display:grid; gap:7px; margin-top:12px; color:var(--text-2); font-size:12px; line-height:1.5; }.map-accuracy-notes span { display:flex; align-items:flex-start; }.map-accuracy-notes i { width:9px; height:9px; flex:none; margin:4px 8px 0 0; border-radius:50%; }.map-accuracy-notes i.cellocation-wifi { background:#16a34a; }.map-accuracy-notes i.tianditu-map { background:#1677ff; }.device-map-label { display:grid; grid-template-columns:8px auto; gap:1px 6px; min-width:130px; max-width:220px; padding:6px 9px; border:1px solid rgba(15,23,42,.15); border-radius:7px; background:rgba(255,255,255,.94); color:#172033; box-shadow:0 4px 14px rgba(15,23,42,.14); line-height:1.2; }.device-map-label>i { width:8px; height:8px; margin-top:3px; border-radius:50%; background:#9ca3af; }.device-map-label.online>i { background:#16a34a; box-shadow:0 0 0 3px rgba(22,163,74,.14); }.device-map-label b,.device-map-label small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.device-map-label small { grid-column:2; color:#64748b; font:11px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace; }.device-map-label em { display:none; }
.token-package-editor { margin:16px 0; padding-top:14px; border-top:1px solid var(--border); }.token-package-row { display:grid; grid-template-columns:minmax(130px,1fr) 150px auto 170px auto 50px; gap:8px; align-items:center; margin-top:9px; }.token-package-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); gap:8px; margin-bottom:12px; }.token-package-card { display:flex; flex-direction:column; gap:5px; padding:11px; border:1px solid var(--border); border-radius:8px; background:#f8fafc; }.token-package-card strong { color:var(--brand); }.token-package-card span { color:var(--text-2); }.token-price-list { display:flex; flex-wrap:wrap; gap:7px 14px; margin-bottom:14px; color:var(--text-2); font-size:12px; }
.integration-card { display:grid; gap:10px; padding:14px; margin:4px 0 16px; border:1px solid var(--border); border-radius:9px; background:#f8fafc; }.integration-card > div:first-child { display:flex; align-items:center; justify-content:space-between; gap:10px; }.integration-card p { margin:0; color:var(--text-2); font-size:12px; line-height:1.55; }.integration-endpoint,.integration-secret { display:flex; align-items:center; gap:9px; min-width:0; padding:9px 11px; border-radius:7px; background:#eef2f7; }.integration-endpoint small { color:var(--green); font-weight:700; }.integration-endpoint code,.integration-secret code { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.integration-secret small { color:var(--text-2); }.integration-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }.integration-actions > small { margin-left:auto; color:var(--text-2); }

html[data-theme="dark"] {
  --brand:#60a5fa; --brand-soft:#13233b; --bg:#08111f; --panel:#0f1b2d; --border:#27364b; --text:#e5edf7; --text-2:#94a3b8;
  --el-color-primary:#60a5fa; --el-bg-color:#0f1b2d; --el-bg-color-overlay:#142238; --el-fill-color-blank:#0f1b2d; --el-fill-color-light:#17263b; --el-fill-color-lighter:#1b2b42; --el-fill-color-dark:#0a1525; --el-border-color:#33445c; --el-border-color-light:#293a51; --el-border-color-lighter:#233249; --el-text-color-primary:#e5edf7; --el-text-color-regular:#c1cede; --el-text-color-secondary:#94a3b8; --el-mask-color:rgba(0,0,0,.68);
}
html[data-theme="dark"] .nav-item:hover,html[data-theme="dark"] .preference-pills,html[data-theme="dark"] .history-summary>div,html[data-theme="dark"] .location-input-summary>span,html[data-theme="dark"] .location-service-setting,html[data-theme="dark"] .wifi-provision-card,html[data-theme="dark"] .map-locked-state,html[data-theme="dark"] .token-package-card,html[data-theme="dark"] .integration-card { background:#142238; }
html[data-theme="dark"] .integration-endpoint,html[data-theme="dark"] .integration-secret { background:#0b1727; }
html[data-theme="dark"] .preference-pills button.active { background:#24344b; box-shadow:none; }
html[data-theme="dark"] .ble-passthrough,html[data-theme="dark"] .group-model-picker { background:var(--panel); }
html[data-theme="dark"] .model-root,html[data-theme="dark"] .group-model-picker-head,html[data-theme="dark"] .group-model-option:hover { background:#142238; }
html[data-theme="dark"] .rate-donut::after { background:var(--panel); }
html[data-theme="dark"] .status-track { background:#26364b; }
html[data-theme="dark"] .chart-val,html[data-theme="dark"] .chart-label { fill:#94a3b8; } html[data-theme="dark"] .chart-axis { stroke:#334155; }
html[data-theme="dark"] .token-chip { color:#bfdbfe; border-color:#315a8b; background:#132c4f; }
html[data-theme="dark"] .wifi-provision-card.is-success,html[data-theme="dark"] .location-result-card { background:#102a20; border-color:#22543d; }
html[data-theme="dark"] .wifi-provision-card.is-failed,html[data-theme="dark"] .wifi-provision-card.is-timeout { background:#321b22; }
html[data-theme="dark"] .location-provider-card.selected { background:#13233b; }
html[data-theme="dark"] .el-table tr,html[data-theme="dark"] .el-table th.el-table__cell { background:var(--panel); }
html[data-theme="dark"] .el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell { background:#17263b; }

@media (max-width:760px) {
  .history-summary,.location-input-summary,.location-provider-grid,.location-service-grid,.saved-location-grid { grid-template-columns:1fr; }
  .token-package-row { grid-template-columns:1fr 1fr; }.token-package-row > span { display:none; }
  .topbar-right { gap:7px; }.theme-trigger { width:29px;height:29px; }.token-chip span { display:none; }
}

/* ---------- Qilin platform enhancements ---------- */
html[data-font-size] .sidebar-head .title { font-size:calc(var(--app-font-size) + 2px); }
html[data-font-size] .topbar .crumb { font-size:calc(var(--app-font-size) + 1px); }
.topbar-leading { display:flex; align-items:center; gap:10px; min-width:0; }
.mobile-menu-button { display:none; width:34px; height:34px; padding:0; border:1px solid var(--border); border-radius:7px; background:var(--panel); color:var(--text); cursor:pointer; }
.mobile-nav-mask { display:none; }
.stat-card.clickable { cursor:pointer; transition:transform .15s, border-color .15s, box-shadow .15s; }
.stat-card.clickable:hover { transform:translateY(-2px); border-color:#93c5fd; box-shadow:0 8px 18px rgba(15,23,42,.07); }
.announcement-banner { display:grid; grid-template-columns:auto auto minmax(0,1fr) auto; align-items:center; gap:10px; margin-bottom:14px; padding:11px 14px; border:1px solid #fde68a; border-radius:9px; background:linear-gradient(90deg,#fffbeb,#fff); color:#92400e; cursor:pointer; }
.announcement-banner > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#a16207; }
.notice-badge .el-badge__content { transform:translate(55%,-35%) scale(.86); }
.announcement-title { margin:0 0 12px; }.announcement-content { min-height:90px; white-space:pre-wrap; line-height:1.8; color:var(--text); }.announcement-time { display:block; margin-top:14px; color:var(--text-2); }
.announcement-list { display:grid; gap:5px; margin-top:18px; padding-top:12px; border-top:1px solid var(--border); }.announcement-list button { display:flex; align-items:center; gap:8px; width:100%; padding:8px; border:0; border-radius:6px; background:transparent; color:var(--text); text-align:left; cursor:pointer; }.announcement-list button:hover { background:var(--brand-soft); }.announcement-list i { width:7px; height:7px; border-radius:50%; background:#cbd5e1; }.announcement-list i.unread { background:#ef4444; }
.customer-service-card { display:flex; align-items:center; gap:16px; margin:10px 0 16px; padding:14px; border:1px solid var(--border); border-radius:8px; background:#f8fafc; }.customer-service-card img { width:82px; height:82px; object-fit:contain; flex:none; }.customer-service-info { flex:1; min-width:0; }.customer-service-info> b { display:block; margin-bottom:8px; font-size:15px; }.customer-service-info dl { display:grid; gap:5px; margin:0; }.customer-service-info dl>div { display:grid; grid-template-columns:72px minmax(0,1fr); gap:8px; }.customer-service-info dt { color:var(--text-2); }.customer-service-info dd { margin:0; font-weight:600; overflow-wrap:anywhere; }.customer-service-info a { color:var(--brand); text-decoration:none; }
.wechat-pay-card { display:flex; flex-direction:column; align-items:center; gap:9px; text-align:center; }.wechat-pay-card > strong { color:#ef4444; font-size:28px; }.wechat-pay-card > img { width:280px; max-width:100%; border:1px solid var(--border); border-radius:10px; }.wechat-pay-card > small { color:var(--text-2); line-height:1.55; }
.device-map-marker { display:flex; align-items:center; gap:5px; max-width:150px; padding:5px 8px; border:1px solid #fff; border-radius:999px; color:#fff; box-shadow:0 3px 12px rgba(15,23,42,.25); font-size:12px; white-space:nowrap; }.device-map-marker.online { background:#16a34a; }.device-map-marker.offline { background:#94a3b8; }.device-map-marker i { width:7px; height:7px; border-radius:50%; background:#fff; }.device-map-marker span { overflow:hidden; text-overflow:ellipsis; }
.device-map-marker em { display:grid; place-items:center; min-width:23px; height:18px; padding:0 4px; border-radius:9px; background:rgba(15,23,42,.28); color:#fff; font-size:10px; font-style:normal; }.map-device-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:9px; margin-top:12px; }.map-device-list button { display:flex; align-items:center; gap:9px; min-width:0; padding:10px 12px; border:1px solid var(--border); border-radius:9px; background:var(--surface); color:var(--text); text-align:left; cursor:pointer; }.map-device-list button:hover,.map-device-list button.active { border-color:var(--primary); box-shadow:0 3px 12px rgba(37,99,235,.1); }.map-device-list button.active { background:var(--brand-soft); }.map-device-list button>i { width:9px; height:9px; flex:none; border-radius:50%; }.map-device-list button>i.online { background:#16a34a; box-shadow:0 0 0 4px rgba(22,163,74,.12); }.map-device-list button>i.offline { background:#94a3b8; }.map-device-list button>span { display:flex; flex:1; min-width:0; flex-direction:column; gap:3px; }.map-device-list button b,.map-device-list button small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.map-device-list button small { color:var(--text-2); }.map-device-list button>em { color:var(--primary); font-style:normal; font-size:12px; }
.map-device-detail,.device-detail-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }.map-device-detail>div,.device-detail-grid>div { display:flex; flex-direction:column; gap:5px; padding:11px; border:1px solid var(--border); border-radius:7px; background:#f8fafc; min-width:0; }.map-device-detail span,.device-detail-grid span { color:var(--text-2); font-size:var(--app-small-font-size); }.map-device-detail b,.device-detail-grid b { overflow-wrap:anywhere; }.map-device-detail .wide,.device-detail-grid .wide { grid-column:1/-1; }
.reboot-choice { display:grid; gap:10px; margin-top:16px; }.reboot-choice .el-radio { margin-right:0; }
.image-picker { display:flex; align-items:center; gap:10px; }.image-picker img { width:74px; height:74px; object-fit:contain; border:1px solid var(--border); border-radius:7px; }.wide-form-item { grid-column:1/-1; }
.target-version-row { display:grid; grid-template-columns:180px minmax(220px,1fr); gap:10px 16px; align-items:center; padding:13px 0; border-bottom:1px solid var(--border); }.target-version-row>div:first-child { display:flex; align-items:center; gap:8px; }.target-version-stats { grid-column:1/-1; display:flex; gap:8px; flex-wrap:wrap; color:var(--text-2); font-size:var(--app-small-font-size); }.target-version-stats span { padding:3px 7px; border-radius:5px; background:#f1f5f9; }.target-version-stats .ok { color:#15803d; background:#f0fdf4; }.target-version-stats .warn { color:#b45309; background:#fffbeb; }
html[data-theme="dark"] .announcement-banner { border-color:#854d0e; background:linear-gradient(90deg,#38280a,#1b2432); color:#fde68a; }
html[data-theme="dark"] .announcement-banner>span { color:#fcd34d; }
html[data-theme="dark"] .customer-service-card,html[data-theme="dark"] .map-device-detail>div,html[data-theme="dark"] .device-detail-grid>div { background:#142238; }
html[data-theme="dark"] .target-version-stats span { background:#17263b; }

@media (max-width:760px) {
  .layout { position:relative; }
  .sidebar { position:fixed; z-index:1200; inset:0 auto 0 0; width:min(82vw,280px); transform:translateX(-105%); box-shadow:8px 0 24px rgba(15,23,42,.18); transition:transform .2s ease; }
  .sidebar.open { width:min(82vw,280px); transform:translateX(0); }
  .sidebar-head .title,.sidebar.open .sidebar-head .title,.sidebar .nav-item span { display:inline; }
  .sidebar .nav-item { justify-content:flex-start; }
  .mobile-nav-mask { display:block; position:fixed; z-index:1190; inset:0; background:rgba(15,23,42,.48); }
  .mobile-menu-button { display:grid; place-items:center; flex:none; }
  .main { width:100%; }
  .topbar { padding:0 12px; }
  .topbar .crumb { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .topbar-right .mqtt-dot,.topbar-right .preference-pills { display:none; }
  .topbar-right { gap:6px; }
  .content { padding:12px; }
  .site-footer { min-height:30px; padding:5px 10px; font-size:11px; }
  .announcement-banner { grid-template-columns:auto minmax(0,1fr) auto; }.announcement-banner>span { display:none; }
  .map-device-detail,.device-detail-grid { grid-template-columns:1fr; }.map-device-detail .wide,.device-detail-grid .wide { grid-column:auto; }
  .target-version-row { grid-template-columns:1fr; }.target-version-stats { grid-column:auto; }
  .el-dialog { max-width:calc(100vw - 24px); }
  .device-location-map { height:330px; }
}
.config-category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 12px;
  margin-bottom: 2px;
  scrollbar-width: thin;
}
.config-category-tabs button {
  flex: 0 0 auto;
  min-width: 104px;
  padding: 10px 18px;
  border: 1px solid var(--el-border-color, #dcdfe6);
  border-radius: 12px;
  color: var(--text-color, #374151);
  background: var(--panel-bg, #fff);
  cursor: pointer;
}
.config-category-tabs button.active {
  color: #fff;
  border-color: #1687e8;
  background: linear-gradient(135deg, #1677ff, #19a8e8);
  box-shadow: 0 6px 16px rgba(22, 119, 255, .2);
}
.ble-category-tabs { margin: 0 0 14px; padding: 4px 2px 8px; }
.config-source-banner { display:flex;align-items:center;justify-content:space-between;gap:18px;margin:0 0 14px;padding:14px 16px;border:1px solid #bfdbfe;border-radius:14px;background:linear-gradient(135deg,#eff6ff,#f0f9ff); }
.config-source-banner > div:first-child { display:flex;flex-direction:column;gap:4px; }
.config-source-banner b { color:#0f3f70;font-size:15px; }
.config-source-banner span,.config-source-banner small { color:#64748b;font-size:12px; }
.config-source-code { display:flex;flex-direction:column;align-items:flex-end;gap:4px;flex:0 0 auto; }
.config-source-code strong { color:#1677ff;font-size:15px; }
[data-theme="dark"] .config-source-banner { border-color:#1e4d73;background:linear-gradient(135deg,#102a43,#0f2438); }
[data-theme="dark"] .config-source-banner b { color:#dbeafe; }
@media (max-width:720px) { .config-source-banner { align-items:flex-start;flex-direction:column; }.config-source-code { align-items:flex-start; } }

.rtu-io-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:12px; }
.rtu-io-card { border:1px solid var(--border-color,#dbe3ee); border-radius:14px; padding:14px; background:var(--panel-bg,#fff); }
.rtu-io-card-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.rtu-io-value { display:flex; align-items:center; justify-content:space-between; min-height:42px; padding:9px 11px; border-radius:10px; background:var(--soft-bg,#f5f8fc); margin-bottom:10px; }
.rtu-io-value span { color:#64748b; font-size:12px; }
.rtu-io-actions { display:flex; flex-wrap:wrap; gap:7px; }
.firmware-target-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin: 12px 0;
  color: #6b7280;
}
.firmware-target-summary b { color: var(--text-color, #111827); }
