/* ==========================================================================
   监测大屏 · 样式表
   ========================================================================== */
:root {
  --bg: #f2f5fa;
  --panel: #ffffff;
  --line: #e5eaf2;
  --line-soft: #eff2f8;
  --text: #182230;
  --muted: #6b7789;
  --muted-2: #93a0b3;
  --primary: #2f6bff;
  --primary-dark: #1d55e0;
  --primary-weak: #edf2ff;
  --teal: #0fa89a;
  --teal-weak: #e8f8f5;
  --danger: #e5484d;
  /* 大屏皮肤变量（模板库）：默认 = 深空蓝 · 指挥舱。
     各模板在 css/templates.css 中按 [data-bs-template="…"] 覆盖 */
  --bs-bg0: #020b1c;
  --bs-bg1: #041431;
  --bs-bg2: #0a2a5e;
  --bs-panel0: #0a1626;
  --bs-panel: rgba(8, 24, 46, .96);
  --bs-line: rgba(64, 140, 255, .25);
  --bs-text: #eaf6ff;
  --bs-text-b: #d5ecff;
  --bs-text-2: #9cc2e8;
  --bs-text-3: #6f9cc9;
  --bs-accent: #3fd4ff;
  --bs-accent-glow: rgba(0, 200, 255, .75);
  --bs-glow: rgba(0, 200, 255, .5);
  --bs-ok: #5fd6c0;
  --bs-warn: #ffb020;
  --bs-blue: #4aa8ff;
  --radius: 14px;
  --gap: 14px;
  --row-h: 64px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 18px 40px -24px rgba(16, 24, 40, .35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
svg { font-family: var(--font); }

/* ------------------------------ 布局 ------------------------------ */
.app { display: flex; height: 100vh; overflow: hidden; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { flex: 1; min-height: 0; overflow: auto; padding: 20px 24px 36px; }
.content::-webkit-scrollbar { width: 10px; height: 10px; }
.content::-webkit-scrollbar-thumb { background: #d6dde9; border-radius: 8px; border: 3px solid var(--bg); }
.content::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------ 侧边栏 ------------------------------ */
.sidebar {
  width: 218px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 0 10px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; height: 62px; padding: 0 6px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(140deg, #2f6bff, #12b5a5);
  color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .5px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 16px -8px rgba(47, 107, 255, .85);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; letter-spacing: .2px; }
.brand-text span { font-size: 11px; color: var(--muted-2); margin-top: 2px; }

.nav-group { margin-top: 10px; }
.nav-caption { font-size: 11px; color: var(--muted-2); padding: 6px 10px; letter-spacing: .6px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { text-decoration: none; cursor: pointer;

  display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 10px;
  border: none; background: transparent; border-radius: 9px;
  color: #4b5768; font-size: 13.5px; text-align: left;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: #f5f7fb; color: var(--text); }
.nav-item.active { background: var(--primary-weak); color: var(--primary); font-weight: 600; }
.nav-ico { display: inline-flex; width: 18px; height: 18px; }
.nav-ico svg { width: 18px; height: 18px; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.ws-card {
  display: flex; gap: 9px; align-items: center;
  padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe;
}
.ws-avatar {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  background: #e8eefc; color: #33589c; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.ws-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ws-info strong { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-info span { font-size: 10.5px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-note { font-size: 10.5px; color: #a9b4c4; line-height: 1.6; padding: 0 6px; }

/* ------------------------------ 顶栏 ------------------------------ */
.topbar {
  height: 56px; flex-shrink: 0;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; gap: 16px;
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; }
.crumb-cur { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb-sep { color: #cbd4e2; }
.top-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ------------------------------ 按钮 ------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 33px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: #33404f;
  font-size: 13px; font-weight: 500;
  transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #c6d2e5; background: #fbfcff; }
.btn:active { transform: translateY(.5px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 8px 16px -10px rgba(47, 107, 255, .9); }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: #f1f4fa; color: var(--text); }
.btn.sm { height: 27px; padding: 0 9px; font-size: 12px; border-radius: 7px; }
.btn svg { flex-shrink: 0; }
.icon-btn {
  width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: #8b97a8; border-radius: 6px; transition: .15s;
}
.icon-btn:hover { background: #eff3f9; color: #33404f; }
.link-btn { border: none; background: transparent; color: var(--primary); font-size: 12px; padding: 0 4px; }
.link-btn:hover { text-decoration: underline; }

/* ------------------------------ 仪表板头部 ------------------------------ */
.dash-tabs {
  display: flex; align-items: center; gap: 2px;
  margin: -4px 0 14px; padding-bottom: 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.dash-tab {
  border: none; border-bottom: 2px solid transparent; background: transparent;
  padding: 8px 12px 9px; font-size: 12.5px; color: var(--muted);
  white-space: nowrap; border-radius: 7px 7px 0 0; transition: .15s;
}
.dash-tab:hover { background: #f5f8fd; color: var(--text); }
.dash-tab.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); background: #f7faff; }
.dash-tab.ghost { color: var(--muted-2); font-size: 12px; }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.dash-title { font-size: 22px; font-weight: 650; letter-spacing: -.2px; }
.dash-sub { font-size: 12px; color: var(--muted-2); margin-top: 5px; }
.dash-actions { display: flex; gap: 8px; align-items: center; }

/* 筛选条 */
.filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 14px; min-height: 30px;
}
.filter-title { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 27px; padding: 0 6px 0 10px;
  background: #fff; border: 1px solid #dbe4f3; border-radius: 20px;
  font-size: 12px; color: #3c4c66;
}
.chip button { border: none; background: transparent; color: #8d9bb0; display: flex; padding: 2px; border-radius: 50%; }
.chip button:hover { background: #eef2f9; color: #33404f; }

/* ------------------------------ 栅格画布 ------------------------------ */
.canvas {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: var(--row-h);
  gap: var(--gap);
  align-items: stretch;
}
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  min-width: 0; overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.card:hover { border-color: #d3ddec; box-shadow: 0 8px 22px -18px rgba(16, 24, 40, .4); }
.card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 107, 255, .12); }
.card.drag-over { border-color: var(--primary); border-style: dashed; }
.card-head {
  height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 0 10px 0 13px;
  border-bottom: 1px solid var(--line-soft);
  cursor: grab;
}
.card-head:active { cursor: grabbing; }
.card-title {
  font-size: 13px; font-weight: 600; color: #26313f;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-tools { display: flex; align-items: center; gap: 1px; opacity: 0; transition: opacity .15s; }
.card:hover .card-tools, .card.selected .card-tools { opacity: 1; }
.card-body { flex: 1; min-height: 0; position: relative; }
.resize-handle {
  position: absolute; right: 0; bottom: 0; width: 16px; height: 16px;
  cursor: nwse-resize; opacity: 0; transition: opacity .15s;
  background: linear-gradient(135deg, transparent 46%, #b9c7dd 46%, #b9c7dd 54%, transparent 54%, transparent 62%, #b9c7dd 62%, #b9c7dd 70%, transparent 70%);
}
.card:hover .resize-handle, .card.selected .resize-handle { opacity: 1; }
body.resizing { cursor: nwse-resize; user-select: none; }

/* ------------------------------ 图表文字 ------------------------------ */
.card-body svg text.ax { fill: #8a94a6; font-size: 11px; }
.card-body svg text.lg { fill: #5d6b80; font-size: 11px; }
.card-body svg text.val { fill: #55637a; font-size: 10.5px; }
.card-body svg text.donut-total { fill: #182230; font-size: 15px; font-weight: 650; }

.chart-empty {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: #a7b2c3; font-size: 12px;
}
.chart-empty-ico { font-size: 22px; opacity: .5; }
.chart-error { padding: 16px; color: var(--danger); font-size: 12px; }

/* KPI */
.kpi { height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 6px 14px 8px; gap: 0; overflow: hidden; }
.kpi-top { display: flex; align-items: center; gap: 7px; }
.kpi-label { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-badge { font-size: 10px; color: #8a94a6; background: #f3f6fb; border-radius: 4px; padding: 1px 5px; flex-shrink: 0; }
.kpi-value {
  font-size: 30px; font-weight: 660; letter-spacing: -.8px; line-height: 1.18;
  font-variant-numeric: tabular-nums; color: #131c28;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kpi-spark { display: block; margin: 1px 0 0; width: 100%; max-width: 190px; }
.kpi-foot { font-size: 10.5px; color: #9aa6b8; }

/* 明细表 */
.tbl-wrap { height: 100%; overflow: auto; padding: 0 8px 6px; }
.tbl-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.tbl-wrap::-webkit-scrollbar-thumb { background: #dde4ef; border-radius: 6px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th, .tbl td { padding: 7px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid #f1f4f9; }
.tbl th {
  position: sticky; top: 0; z-index: 1;
  background: #f7f9fc; color: #6b7789; font-weight: 500; font-size: 11.5px;
}
.tbl th:first-child, .tbl td.dim-col { text-align: left; }
.tbl tbody tr:hover td { background: #f8faff; }
.tbl td { color: #3a4658; font-variant-numeric: tabular-nums; }
.tbl td.dim-col { color: #26313f; font-weight: 500; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.tbl tfoot td { background: #f7f9fc; font-weight: 600; border-top: 1px solid #e9eef6; position: sticky; bottom: 0; }
.tbl-note { font-size: 10.5px; color: #9aa6b8; padding: 6px 8px; text-align: center; }

/* ------------------------------ 配置面板 ------------------------------ */
.config-panel {
  width: 292px; flex-shrink: 0;
  background: var(--panel); border-left: 1px solid var(--line);
  display: none; flex-direction: column; overflow: hidden;
}
.config-panel.open { display: flex; }
.panel-head {
  height: 52px; flex-shrink: 0; padding: 0 12px 0 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px; font-weight: 600;
}
.panel-body { padding: 14px 16px 30px; overflow: auto; }
.panel-body::-webkit-scrollbar { width: 8px; }
.panel-body::-webkit-scrollbar-thumb { background: #dde4ef; border-radius: 6px; }
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
.field select, .field input[type="text"], .field input[type="number"] {
  width: 100%; height: 32px;
  border: 1px solid var(--line); border-radius: 7px;
  padding: 0 9px; background: #fff; outline: none;
  font-size: 12.5px; color: #2b3646;
  transition: border-color .15s, box-shadow .15s;
}
.field select:focus, .field input:focus { border-color: #9db9ff; box-shadow: 0 0 0 3px rgba(47, 107, 255, .1); }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.type-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 2px 7px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: #6b7789; font-size: 10.5px; transition: .15s;
}
.type-btn:hover { border-color: #bcd0f4; color: var(--primary); background: #fbfcff; }
.type-btn.active { border-color: var(--primary); color: var(--primary); background: var(--primary-weak); font-weight: 600; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #445164; margin-bottom: 9px; cursor: pointer; }
.check-line input { width: 14px; height: 14px; accent-color: var(--primary); }
.range-line { display: flex; align-items: center; gap: 10px; }
.range-line input[type="range"] { flex: 1; accent-color: var(--primary); }
.range-line .range-val { width: 30px; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.panel-split { height: 1px; background: var(--line-soft); margin: 16px 0; }
.panel-tip { font-size: 11px; color: #9aa6b8; line-height: 1.6; }

/* ------------------------------ 数据集 / 数据源 ------------------------------ */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head h1 { font-size: 20px; font-weight: 640; letter-spacing: -.2px; }
.page-head p { font-size: 12.5px; color: var(--muted-2); margin-top: 5px; }
.btn-row { display: flex; gap: 8px; align-items: center; }

.split { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 16px; align-items: start; }
.list-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list-head { padding: 12px 14px; font-size: 11.5px; color: var(--muted-2); border-bottom: 1px solid var(--line-soft); letter-spacing: .3px; }
.ds-item {
  width: 100%; text-align: left; border: none; background: transparent;
  padding: 11px 14px; border-bottom: 1px solid var(--line-soft); transition: background .15s;
}
.ds-item:last-child { border-bottom: none; }
.ds-item:hover { background: #f8faff; }
.ds-item.active { background: var(--primary-weak); box-shadow: inset 3px 0 0 var(--primary); }
.ds-item strong { display: block; font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.ds-item span { font-size: 11px; color: var(--muted-2); }

.detail-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 18px; min-width: 0; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.detail-head h2 { font-size: 16px; font-weight: 640; }
.detail-head p { font-size: 12px; color: var(--muted-2); margin-top: 4px; }
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { font-size: 11px; color: #4c5a70; background: #f2f5fa; border-radius: 20px; padding: 3px 9px; white-space: nowrap; }
.pill.blue { background: var(--primary-weak); color: #3157a8; }
.pill.teal { background: var(--teal-weak); color: #0b7a70; }

.section-title { font-size: 12px; color: var(--muted); margin: 18px 0 9px; display: flex; align-items: center; justify-content: space-between; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 7px; }
.field-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 7px 9px; font-size: 12px; text-align: left; transition: .15s;
}
.field-chip:hover { border-color: #bfd1f2; }
.field-chip .role { font-size: 10px; padding: 1px 5px; border-radius: 4px; }
.field-chip.is-dimension .role { background: var(--primary-weak); color: #3157a8; }
.field-chip.is-measure .role { background: var(--teal-weak); color: #0b7a70; }
.field-chip .fname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-wrap { border: 1px solid var(--line); border-radius: 10px; overflow: auto; max-height: 300px; margin-top: 8px; }
.preview-wrap table { width: 100%; border-collapse: collapse; font-size: 12px; }
.preview-wrap th, .preview-wrap td { padding: 8px 10px; text-align: left; white-space: nowrap; border-bottom: 1px solid #f2f5fa; }
.preview-wrap th { background: #f8fafd; color: var(--muted); font-weight: 500; position: sticky; top: 0; font-size: 11.5px; }
.preview-wrap td { color: #46536a; font-variant-numeric: tabular-nums; }
.preview-wrap tr:hover td { background: #f9fbff; }

.source-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 14px; }
.source-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px; display: flex; flex-direction: column; gap: 10px; transition: .15s;
}
.source-card:hover { border-color: #cfdaeb; box-shadow: 0 10px 26px -22px rgba(16, 24, 40, .5); }
.source-top { display: flex; align-items: center; gap: 10px; }
.source-ico {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: #eef3ff; color: #2f6bff; display: flex; align-items: center; justify-content: center;
}
.source-top strong { display: block; font-size: 13.5px; font-weight: 600; }
.source-top span { font-size: 11px; color: var(--muted-2); }
.source-meta { font-size: 11.5px; color: #8d99ab; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.source-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 9px; border-top: 1px solid var(--line-soft); font-size: 11px; color: var(--muted-2); }
.dot-ok { display: inline-flex; align-items: center; gap: 5px; color: #12805c; }
.dot-ok::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #17b26a; }

.upload-zone {
  border: 1.5px dashed #cfd9e8; border-radius: var(--radius);
  background: #fafcff; padding: 22px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--muted); transition: .15s; cursor: pointer;
}
.upload-zone:hover { border-color: #9db9ff; background: #f6f9ff; }
.upload-zone strong { font-size: 13px; color: #2b3646; }
.upload-zone span { font-size: 11.5px; color: var(--muted-2); }

.empty-state {
  background: #fff; border: 1px dashed #d5dfee; border-radius: var(--radius);
  padding: 48px 20px; text-align: center; color: var(--muted);
}
.empty-state h3 { font-size: 15px; margin-bottom: 6px; color: #2b3646; }
.empty-state p { font-size: 12.5px; color: var(--muted-2); margin-bottom: 16px; }

/* ------------------------------ 弹窗 / 提示 ------------------------------ */
.modal-root { position: fixed; inset: 0; display: none; z-index: 100; }
.modal-root.show { display: block; }
.modal-mask {
  position: absolute; inset: 0; background: rgba(15, 23, 42, .42);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade .15s ease;
}
.modal {
  width: 460px; max-width: 100%; max-height: 86vh; overflow: auto;
  background: #fff; border-radius: 14px; box-shadow: 0 30px 70px -30px rgba(15, 23, 42, .6);
  animation: pop .18s ease;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px; }
.modal-head h2 { font-size: 16px; font-weight: 640; }
.modal-body { padding: 4px 18px 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.type-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.type-card {
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 14px 8px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 12.5px; color: #3c4a5e; transition: .15s;
}
.type-card:hover { border-color: var(--primary); background: #f8faff; color: var(--primary); transform: translateY(-1px); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }

.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 14px);
  background: #1f2937; color: #fff; font-size: 12.5px;
  padding: 9px 16px; border-radius: 8px; opacity: 0; pointer-events: none;
  transition: .22s; z-index: 200; box-shadow: 0 16px 30px -16px rgba(0, 0, 0, .6);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------ 预览模式 ------------------------------ */
.app.preview .sidebar, .app.preview .config-panel { display: none; }
.app.preview { background: #eef2f8; }
.app.preview .topbar { background: #fff; }
.app.preview .content { padding: 22px 32px 40px; max-width: 1680px; margin: 0 auto; width: 100%; }
.app.preview .card-tools, .app.preview .resize-handle { display: none; }
.app.preview .card { box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.app.preview .card-head { cursor: default; }
.app.preview .dash-title { font-size: 24px; }

/* ==========================================================================
   数据大屏（暗色科技风）
   ========================================================================== */
.app.bigscreen .sidebar,
.app.bigscreen .topbar,
.app.bigscreen .config-panel { display: none; }
.app.bigscreen { background: var(--bs-bg0); }
.app.bigscreen .content { padding: 0; overflow: hidden; background: radial-gradient(1200px 700px at 50% -10%, var(--bs-bg2) 0%, var(--bs-bg1) 46%, var(--bs-bg0) 100%); }

/* 首屏启动态：index.html 里直接写死，脚本加载与首轮数据到达前就显示，
   刷新时不会再露出旧的后台骨架（旧后台侧栏 / 仪表板导航） */
body.bs-boot { background: var(--bs-bg0); }
body.bs-boot .content { background: radial-gradient(1200px 700px at 50% -10%, var(--bs-bg2) 0%, var(--bs-bg1) 46%, var(--bs-bg0) 100%); }
.bs-boot-splash {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; text-align: center;
  background: radial-gradient(1200px 700px at 50% -10%, var(--bs-bg2) 0%, var(--bs-bg1) 46%, var(--bs-bg0) 100%);
  color: var(--bs-text-2);
}
.bs-boot-splash b {
  font-size: 20px; font-weight: 600; letter-spacing: 6px;
  color: var(--bs-text-b); text-shadow: 0 0 18px rgba(70, 190, 255, .45);
}
.bs-boot-splash > span { font-size: 17px; letter-spacing: 5px; color: var(--bs-text-3); }
.bsb-ring { position: relative; width: 54px; height: 54px; margin-bottom: 6px; }
.bsb-ring i {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid rgba(70, 190, 255, .22);
  border-top-color: #46beff;
  animation: bsbSpin 1.05s linear infinite;
}
.bsb-ring i:nth-child(2) {
  inset: 7px; border-color: rgba(70, 190, 255, .16);
  border-bottom-color: #22d3ee; animation-duration: 1.6s; animation-direction: reverse;
}
@keyframes bsbSpin { to { transform: rotate(360deg); } }
.bsb-bar {
  position: relative; width: 240px; height: 3px; margin-top: 8px;
  background: rgba(70, 190, 255, .14); border-radius: 2px; overflow: hidden;
}
.bsb-bar::after {
  content: ''; position: absolute; top: 0; left: 0; width: 45%; height: 100%;
  background: linear-gradient(90deg, transparent, #46beff, transparent);
  animation: bsbSlide 1.15s ease-in-out infinite;
}
@keyframes bsbSlide { from { transform: translateX(-110%); } to { transform: translateX(330%); } }

.bs-stage-wrap { position: relative; width: 100%; height: 100vh; overflow: hidden; }
.bs-stage {
  position: absolute; left: 50%; top: 50%;
  width: 1920px; height: 1080px;
  transform-origin: center center;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column;
  padding: 0 26px 22px;
  animation: bsFade .5s ease;
}
@keyframes bsFade { from { opacity: 0; } to { opacity: 1; } }

/* 头部（参照有人云顶栏版式：左时钟+天气 / 中发光标题 / 右操作钮，底部贯穿辉光线） */
.bs-header {
  height: 58px; flex-shrink: 0; position: relative;   /* 高度 77→58，收窄 25% */
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 calc(-1 * var(--bs-padx, 26px)); padding: 0 42px;   /* 通栏 1920：负边距跟随自由画布的可调边距 */
}
.bs-header::after {
  content: ""; position: absolute; left: 2%; right: 2%; bottom: 5px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--bs-accent-glow) 20%, var(--bs-accent-glow) 80%, transparent);
  box-shadow: 0 0 12px var(--bs-glow);
}
.bs-head-left { display: flex; align-items: center; gap: 24px; min-width: 0; }
.bs-head-left #bsClock { display: flex; flex-direction: column; flex-shrink: 0; }
.bs-time {
  font-size: 28px; font-weight: 700; letter-spacing: 2px; line-height: 1.05;
  color: var(--bs-text-b); font-variant-numeric: tabular-nums;
  font-family: "DIN Alternate", Bahnschrift, "Segoe UI", var(--font);
  text-shadow: 0 0 12px var(--bs-glow);
}
.bs-date { margin-top: 2px; font-size: 12.5px; color: var(--bs-text-3); letter-spacing: 1.5px; }
/* 右侧：数据源角标与控制台按钮同一行，角标在左 */
.bs-head-right { display: flex; flex-direction: row; align-items: center; justify-content: flex-end; gap: 14px; }

/* 数据源状态标识：绿色=实时读库，橙色=演示数据 */
.bs-src {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  font-size: 11.5px; letter-spacing: .5px; border-radius: 12px; border: 1px solid transparent;
  font-variant-numeric: tabular-nums; white-space: nowrap; cursor: default;
}
.bs-src i { width: 6px; height: 6px; border-radius: 50%; display: block; }
.bs-src.live { color: var(--bs-ok); border-color: rgba(95, 214, 192, .42); background: rgba(95, 214, 192, .1); }
.bs-src.live i { background: var(--bs-ok); box-shadow: 0 0 8px var(--bs-ok); animation: bs-src-pulse 2s ease-in-out infinite; }
.bs-src.demo, .bs-src.local { color: var(--bs-warn); border-color: rgba(255, 180, 84, .42); background: rgba(255, 180, 84, .1); }
.bs-src.demo i, .bs-src.local i { background: var(--bs-warn); box-shadow: 0 0 8px rgba(255, 180, 84, .8); }
.bs-src.loading { color: var(--bs-text-3); border-color: rgba(127, 176, 221, .36); background: rgba(127, 176, 221, .08); }
.bs-src.loading i { background: var(--bs-text-3); }
@keyframes bs-src-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.bs-head-btns { display: flex; gap: 10px; }
.bs-console-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 18px; font-size: 14px; letter-spacing: 3px;
  color: var(--bs-accent); border: 1px solid rgba(0, 210, 255, .6); border-radius: 3px;
  background: linear-gradient(180deg, rgba(0, 120, 200, .28), rgba(0, 60, 140, .16));
  box-shadow: inset 0 0 12px rgba(0, 200, 255, .22), 0 0 10px rgba(0, 180, 255, .22);
  text-shadow: 0 0 10px rgba(0, 210, 255, .55); transition: .15s;
}
.bs-console-btn:hover { color: #fff; background: rgba(0, 150, 255, .35); box-shadow: 0 0 16px rgba(0, 180, 255, .4); }
.bs-title-wrap { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); white-space: nowrap; }
.bs-title {
  margin: 0; font-size: 30px; font-weight: 700; letter-spacing: 4px;
  color: var(--bs-accent); white-space: nowrap;
  text-shadow: 0 0 8px rgba(0, 220, 255, .85), 0 0 26px rgba(0, 150, 255, .55);
  font-family: "Microsoft YaHei", var(--font);
}
.bs-title.long { font-size: 22px; letter-spacing: 2px; }
.bs-title-wrap.narrow .bs-title-deco { display: none; }
.bs-title-deco {
  position: absolute; top: 50%; margin-top: -7px; width: 170px; height: 14px;
  background: linear-gradient(90deg, rgba(0, 200, 255, 0), rgba(0, 200, 255, .55));
  -webkit-mask-image: linear-gradient(90deg, transparent, #000);
  mask-image: linear-gradient(90deg, transparent, #000);
}
.bs-title-deco.left { right: calc(100% + 22px); }
.bs-title-deco.right { left: calc(100% + 22px); transform: scaleX(-1); }

/* KPI 指标带 */
.bs-kpis {
  flex-shrink: 0; display: grid; gap: 16px;
  grid-template-columns: repeat(4, 1fr);
  margin: 16px 2px 14px;
}
.bs-kpi {
  position: relative; height: 96px;
  display: flex; flex-direction: column; justify-content: center; gap: 3px;
  padding: 0 22px;
  background: linear-gradient(160deg, rgba(16, 52, 110, .55), rgba(6, 22, 52, .65));
  border: 1px solid rgba(64, 156, 255, .3); border-radius: 8px;
  overflow: hidden;
}
.bs-kpi::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, #2fd7ff, rgba(47, 212, 255, .05));
  box-shadow: 0 0 12px rgba(47, 212, 255, .8);
}
.bs-kpi-label { font-size: 14px; color: #8fb8e0; letter-spacing: 2px; }
.bs-kpi-value {
  font-size: 34px; font-weight: 700; line-height: 1.15; color: #ffffff;
  font-family: Bahnschrift, "Segoe UI", var(--font); font-variant-numeric: tabular-nums;
  text-shadow: 0 0 20px rgba(47, 212, 255, .85);
}
.bs-kpi-foot { font-size: 11.5px; color: #5f87b8; letter-spacing: 1px; }

/* 主体三栏 */
.bs-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 480px minmax(0, 1fr) 480px; gap: 16px; }
.bs-col { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.bs-col > .bs-panel { flex: 1 1 0; min-height: 0; }

/* 自由画布（大屏设计器保存的布局）：面板按百分比绝对定位。
   每个槽位四周内缩 gap/2，两块相邻面板之间的视觉间距正好等于 gap。 */
.bs-body.is-free { display: block; position: relative; }
.bs-body.is-free > .bs-free-slot {
  position: absolute; box-sizing: border-box;
  padding: calc(var(--bs-gap, 12px) / 2);
  min-width: 0; min-height: 0;
}
.bs-body.is-free > .bs-free-slot > .bs-panel {
  width: 100%; height: 100%; min-height: 0;
}

/* 大屏页脚：版权与数据更新时间，均来自系统设置 */
.bs-foot {
  flex: 0 0 18px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px; font-size: 12px; letter-spacing: .5px;
  color: rgba(160, 196, 240, .55);
}
.bs-foot b { color: rgba(196, 224, 255, .8); font-weight: 600; }
/* 页脚两角是两个独立组件：只剩一角时靠各自方向对齐 */
.bs-foot.is-left-only { justify-content: flex-start; }
.bs-foot.is-right-only { justify-content: flex-end; }
.bs-foot-l, .bs-foot-r { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
/* 页脚版本号：用来判断大屏页签是否跑着旧代码（与最新构建版本对比） */
.bs-foot .bs-build {
  font-style: normal; margin-left: 8px; font-size: 11px;
  color: rgba(160, 196, 240, .38); letter-spacing: 0;
}
/* 大屏诊断浮层（Shift+D）：参数到底有没有传进来，一眼可见 */
.bs-diag {
  position: fixed; left: 12px; top: 12px; z-index: 9999;
  padding: 10px 14px; border-radius: 8px;
  font: 12.5px/1.7 Consolas, "Courier New", monospace;
  color: #dbeaff; background: rgba(4, 14, 34, .92);
  border: 1px solid rgba(94, 158, 255, .45);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .35);
  pointer-events: none; max-width: 520px;
}
.bs-diag b { display: block; margin-bottom: 4px; color: #8fc0ff; font-size: 12.5px; letter-spacing: .5px; }
.bs-diag em { font-style: normal; color: #ffd166; font-weight: 700; }
.bs-diag .warn { color: #ff8a8a; }

/* 面板 */
.bs-panel {
  position: relative; min-height: 0;
  display: flex; flex-direction: column;
  overflow: hidden;   /* 列宽 minmax(0,Nfr) 严格定宽后，裁剪超出面板的内容 */
  background: linear-gradient(165deg, rgba(13, 44, 96, .48) 0%, rgba(6, 21, 50, .66) 100%);
  border: 1px solid rgba(64, 156, 255, .26);
  border-radius: 4px;
  box-shadow: inset 0 0 30px rgba(24, 84, 180, .12);
  animation: bsFade .6s ease both;
}
.bs-panel:nth-child(2) { animation-delay: .06s; }
.bs-panel:nth-child(3) { animation-delay: .12s; }
.bs-panel-head {
  height: 44px; flex-shrink: 0;
  display: flex; align-items: center; gap: 9px; padding: 0 14px;
  position: relative;
}
.bs-panel-head h3 {
  margin: 0; font-size: 15.5px; font-weight: 600; letter-spacing: 3px;
  color: var(--bs-text-b); text-shadow: 0 0 12px rgba(47, 212, 255, .4);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bs-accent {
  width: 4px; height: 16px; flex-shrink: 0; border-radius: 1px;
  background: linear-gradient(180deg, #2fd7ff, #1e6fe0);
  box-shadow: 0 0 10px rgba(47, 212, 255, .9);
}
.bs-head-line {
  position: absolute; left: 14px; right: 14px; bottom: 0; height: 1px;
  background: linear-gradient(90deg, rgba(47, 212, 255, .65), rgba(64, 156, 255, .12) 60%, transparent);
}
.bs-panel-body { flex: 1; min-height: 0; padding: 6px 10px 10px; position: relative; }
.bs-panel-body svg { filter: drop-shadow(0 0 5px rgba(47, 212, 255, .18)); }

/* 监测曲线：上下双图（ppm 组 / 百分比组） */
.bs-curve-split { height: 100%; display: flex; flex-direction: column; gap: 8px; }
.bs-curve-half { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.bs-curve-cap {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; letter-spacing: 1.5px; color: var(--bs-text-3);
  padding: 0 2px 2px;
}
.bs-curve-cap i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.bs-curve-host { flex: 1; min-height: 0; }

/* 通用 BI 组件：关键指标卡（2×2 数字墙） */
.bs-kpis { height: 100%; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 10px; }
.bs-kpi {
  display: flex; flex-direction: column; justify-content: center; gap: 3px;
  padding: 8px 14px; border-radius: 4px;
  background: linear-gradient(160deg, rgba(13, 44, 96, .42), rgba(6, 21, 50, .6));
  border: 1px solid rgba(64, 156, 255, .2);
}
.bs-kpi .l { font-size: 12px; letter-spacing: 2px; color: var(--bs-text-3); }
.bs-kpi strong { font-size: 30px; font-weight: 700; color: var(--bs-text-b); line-height: 1.05; text-shadow: 0 0 14px rgba(70, 190, 255, .4); }
.bs-kpi strong i { font-size: 12px; font-style: normal; font-weight: 400; color: var(--bs-text-3); margin-left: 5px; letter-spacing: 1px; }
.bs-kpi .s { font-size: 11px; color: var(--bs-text-3); opacity: .85; }
.bs-kpi.ok strong { color: #5fe6ae; text-shadow: 0 0 14px rgba(67, 229, 160, .4); }
.bs-kpi.bad strong { color: #ff7a8a; text-shadow: 0 0 14px rgba(255, 107, 107, .45); }

/* 通用 BI 组件：在线率半环仪表盘 */
.bs-gauge { height: 100%; display: flex; align-items: center; justify-content: center; }
.bs-gauge svg { height: 100%; max-width: 100%; }
.bs-gauge .gv { font-size: 40px; font-weight: 700; }
.bs-gauge .gl { font-size: 13px; fill: var(--bs-text-3); letter-spacing: 3px; }
.bs-gauge .gt { font-size: 10px; fill: var(--bs-text-3); opacity: .7; }

/* 四角描边 */
.bs-corner { position: absolute; width: 14px; height: 14px; pointer-events: none; }
.bs-corner.tl { left: -1px; top: -1px; border-left: 2px solid var(--bs-accent); border-top: 2px solid var(--bs-accent); }
.bs-corner.tr { right: -1px; top: -1px; border-right: 2px solid var(--bs-accent); border-top: 2px solid var(--bs-accent); }
.bs-corner.bl { left: -1px; bottom: -1px; border-left: 2px solid var(--bs-accent); border-bottom: 2px solid var(--bs-accent); }
.bs-corner.br { right: -1px; bottom: -1px; border-right: 2px solid var(--bs-accent); border-bottom: 2px solid var(--bs-accent); }
.bs-corner { filter: drop-shadow(0 0 4px rgba(63, 212, 255, .8)); }

/* 大屏图表文字 */
.bs-panel-body svg text.ax { fill: var(--bs-text-3); font-size: 12px; }
.bs-panel-body svg text.lg { fill: var(--bs-text-2); font-size: 12px; }
.bs-panel-body svg text.val { fill: var(--bs-text-b); font-size: 11.5px; }
.bs-panel-body svg text.donut-total { fill: var(--bs-text); font-size: 19px; font-weight: 650; }

/* 大屏明细表 */
.bs-panel-body .tbl th { background: rgba(20, 58, 118, .65); color: var(--bs-text-2); border-bottom: 1px solid rgba(64, 156, 255, .3); }
.bs-panel-body .tbl th, .bs-panel-body .tbl td { border-bottom: 1px solid rgba(64, 156, 255, .14); }
.bs-panel-body .tbl td { color: var(--bs-text-2); }
.bs-panel-body .tbl td.dim-col { color: var(--bs-text); }
.bs-panel-body .tbl tbody tr:hover td { background: rgba(47, 130, 255, .12); }
.bs-panel-body .tbl tfoot td { background: rgba(20, 58, 118, .55); border-top: 1px solid rgba(64, 156, 255, .3); color: var(--bs-accent); }
.bs-panel-body .tbl-wrap::-webkit-scrollbar-thumb { background: rgba(64, 156, 255, .35); }

.bs-empty {
  height: 100%; display: flex; align-items: center; justify-content: center;
  color: #4f7db0; font-size: 14px; letter-spacing: 3px;
}

/* ------------------------------ 环境监测大屏固定版式 ------------------------------ */
.bs-weather {
  display: flex; align-items: center; gap: 11px;
  padding-left: 24px; border-left: 1px solid rgba(64, 156, 255, .22);
}
.bs-weather svg { width: 38px; height: 38px; flex-shrink: 0; filter: drop-shadow(0 0 6px rgba(0, 180, 255, .55)); }
.bs-weather b { display: block; font-size: 24px; line-height: 1.1; color: var(--bs-text-b); font-family: "DIN Alternate", Bahnschrift, "Segoe UI", var(--font); letter-spacing: 1px; }
.bs-weather b i { font-style: normal; font-size: 13px; color: var(--bs-text-2); }
.bs-weather b em { font-style: normal; font-size: 13.5px; color: var(--bs-text-2); margin-left: 6px; }
.bs-weather span { display: block; font-size: 12px; color: var(--bs-text-3); letter-spacing: 1.5px; margin-top: 2px; }

.env-alarm { height: 100%; display: flex; align-items: center; gap: 14px; padding: 4px 16px 6px; }
.env-alarm-hex { flex: 0 0 152px; display: flex; justify-content: center; }

/* 雷达动态图（参照参考页：外圈旋转 + 反向中圈 + 旋转六边形层 + 呼吸核心） */
.hex-anim { position: relative; width: 146px; height: 146px; flex: none; }
.hex-ring { position: absolute; inset: 0; margin: auto; border-radius: 50%; }
.hex-ring.ring-outer {
  width: 144px; height: 144px;
  border: 1px dashed rgba(47, 212, 255, .45);
  animation: hexSpin 22s linear infinite;
}
.hex-ring.ring-mid {
  width: 122px; height: 122px;
  border: 1px solid rgba(47, 160, 255, .35);
  box-shadow: inset 0 0 18px rgba(0, 150, 255, .22);
  animation: hexSpin 14s linear infinite reverse;
}
.hex-layer {
  position: absolute; inset: 0; margin: auto;
  background: linear-gradient(135deg, rgba(0, 170, 255, .22), rgba(0, 60, 160, .08));
  clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%);
}
.hex-layer-1 { width: 106px; height: 106px; animation: hexSpin 18s linear infinite; }
.hex-layer-2 {
  width: 86px; height: 86px;
  background: linear-gradient(135deg, rgba(0, 210, 255, .35), rgba(0, 80, 200, .12));
  animation: hexSpin 12s linear infinite reverse;
}
.hex-core {
  position: absolute; inset: 0; margin: auto; z-index: 2;
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(0, 140, 255, .35), rgba(0, 40, 120, .2));
  box-shadow: 0 0 16px rgba(0, 200, 255, .55);
  animation: hexBreathe 2.4s ease-in-out infinite;
}
@keyframes hexSpin { to { transform: rotate(360deg); } }
@keyframes hexBreathe {
  0%, 100% { box-shadow: 0 0 12px rgba(0, 200, 255, .4); }
  50% { box-shadow: 0 0 26px rgba(0, 220, 255, .85); }
}
.env-alarm-rows { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.env-arow {
  display: flex; align-items: center; padding: 0 14px 0 0; height: 34px; border-radius: 3px;
  background: linear-gradient(97deg, rgba(58, 96, 170, .78) 0 37%, rgba(21, 42, 88, .72) 37.5% 100%);
  border: 1px solid rgba(80, 140, 230, .22);
}
.env-arow .lbl { width: 37%; text-align: center; font-size: 13.5px; font-weight: 600; color: var(--bs-text); letter-spacing: 1px; }
.env-arow strong {
  margin-left: auto; font-size: 19px; font-weight: 700; color: #e8f7ff;
  font-family: Bahnschrift, "Segoe UI", var(--font); font-variant-numeric: tabular-nums;
  text-shadow: 0 0 10px rgba(47, 212, 255, .55);
}
.env-arow .unit { width: 44px; font-size: 10.5px; color: var(--bs-text-3); text-align: right; }

/* 四路气体行：名称 | 各监测点均值（居中） | 单位 | 安全区间 */
.env-arow.gas {
  height: 36px; padding-right: 9px;
  background: linear-gradient(97deg, rgba(58, 96, 170, .78) 0 30%, rgba(21, 42, 88, .72) 30.5% 100%);
}
.env-arow.gas .lbl {
  width: 30%; text-align: left; padding-left: 12px;
  font-size: 13px; letter-spacing: .5px; white-space: nowrap;
}
.env-arow.gas .lbl i { font-style: normal; font-size: 9.5px; color: #8fb4d8; margin-left: 5px; letter-spacing: .5px; }
.env-arow.gas strong { flex: 1; margin-left: 0; text-align: center; font-size: 20px; }
.env-arow.gas .unit { width: 42px; font-size: 10px; }
.env-arow.gas .rng {
  width: 74px; text-align: right; font-size: 9.5px; color: var(--bs-text-3);
  letter-spacing: .2px; font-variant-numeric: tabular-nums;
}
/* 超出后台阈值：整行橙色告警 */
.env-arow.gas.is-bad {
  background: linear-gradient(97deg, rgba(150, 76, 26, .84) 0 30%, rgba(62, 30, 14, .8) 30.5% 100%);
  border-color: rgba(255, 162, 62, .55);
  box-shadow: inset 0 0 14px rgba(255, 140, 40, .18);
}
.env-arow.gas.is-bad strong { color: #ffc46b; text-shadow: 0 0 10px rgba(255, 150, 50, .6); }
.env-arow.gas.is-bad .rng { color: #ffb45c; }
.env-arow.gas.is-bad .lbl { color: #ffe3bd; }
.gas-note { margin-top: 3px; font-size: 9.5px; color: var(--bs-text-3); letter-spacing: .5px; text-align: right; }
.gas-note b { color: #ffb45c; font-weight: 600; }
.gas-note b.ok { color: #38e0a0; }

/* 徽章式面板标题（监测点位布置） */
.bs-badge-head {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  background: linear-gradient(180deg, rgba(28, 70, 130, .55), rgba(12, 34, 68, .55));
  border: 1px solid rgba(64, 180, 255, .55); border-radius: 4px;
  padding: 3px 16px 3px 10px; margin: 8px 0 2px 10px;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
}
.bs-badge-head .chev { color: var(--bs-accent); font-size: 15px; font-weight: 700; letter-spacing: -2px; margin-right: -4px; text-shadow: 0 0 8px rgba(53, 214, 255, .8); }
.bs-badge-head h3 { font-size: 14px; color: #bfe9ff; letter-spacing: 2px; }

.env-device { height: 100%; display: flex; align-items: center; gap: 10px; padding: 4px 18px 8px; }
.env-device-rows { flex: 1; display: flex; flex-direction: column; gap: 13px; min-width: 0; }
.env-drow { display: flex; align-items: center; gap: 13px; }
.env-drow .ico { width: 40px; height: 40px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.env-drow .lbl { font-size: 14px; color: var(--bs-text-2); letter-spacing: 1px; }
.env-drow strong { margin-left: auto; font-size: 17px; color: #e8f7ff; font-family: Bahnschrift, "Segoe UI", var(--font); }
.env-device-donut { flex: 0 0 168px; display: flex; flex-direction: column; align-items: center; }
/* 环图配色走类名，便于浅色皮肤统一覆盖（原为内联 stroke，换肤时改不动） */
.env-device-donut .dn-track { stroke: #3d434d; }
.env-device-donut .dn-bar { stroke: #2f6bff; filter: drop-shadow(0 0 7px rgba(47, 107, 255, .65)); }
.env-device-donut .dn-txt { fill: #4f8cff; }

/* 报警信息（左列第三块） */
.env-alist { height: 100%; display: flex; flex-direction: column; padding: 0 8px; min-height: 0; }
.env-alist-head, .env-alist-row {
  display: grid; grid-template-columns: 54px minmax(0, 1fr) 94px 54px; gap: 6px; align-items: center;
}
.env-alist-head {
  flex-shrink: 0; padding: 1px 8px 5px; font-size: 11px; color: var(--bs-text-3); letter-spacing: 1px;
  border-bottom: 1px solid rgba(64, 156, 255, .18);
}
.env-alist-head span:nth-child(3) { text-align: center; }
.env-alist-head span:nth-child(4) { text-align: center; }
.env-alist-body { flex: 1; min-height: 0; overflow: hidden; position: relative; }
.env-alist-body::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 18px; pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 21, 50, 0), rgba(6, 21, 50, .92));
}
.env-alist-row {
  height: 32px; padding: 0 8px; font-size: 12.5px;
  border-bottom: 1px dashed rgba(64, 156, 255, .13);
}
.env-alist-row .t { color: var(--bs-text-3); font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.env-alist-row .p { color: var(--bs-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; letter-spacing: 0; }
.env-alist-row .k {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  color: #ffc46b; white-space: nowrap; overflow: hidden;
}
.env-alist-row .k i {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  background: #ff6b4a; box-shadow: 0 0 7px rgba(255, 107, 74, .9);
}
.env-alist-row.is-new .k i { animation: alarmPulse 1.4s ease-in-out infinite; }
@keyframes alarmPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.72); }
}
.env-alist-row .s {
  text-align: center; font-size: 10.5px; line-height: 18px; border-radius: 3px; letter-spacing: .5px;
}
.env-alist-row .s.pending { color: #ff9a7a; background: rgba(255, 90, 60, .12); border: 1px solid rgba(255, 107, 74, .42); }
.env-alist-row .s.done { color: var(--bs-ok); background: rgba(95, 214, 192, .1); border: 1px solid rgba(95, 214, 192, .26); }
.env-alist-empty { padding: 26px 0; text-align: center; font-size: 12px; color: var(--bs-text-3); }
.env-alist-foot {
  flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 6px 8px 1px; font-size: 11px; color: var(--bs-text-3); letter-spacing: .5px;
  border-top: 1px solid rgba(64, 156, 255, .16);
}
.env-alist-foot b { font-size: 13px; color: #ffd166; margin: 0 2px; font-variant-numeric: tabular-nums; }
.env-alist-foot .pending b { color: #ff8f6b; }
.bs-head-badge {
  margin-left: auto; flex-shrink: 0; font-size: 11px; letter-spacing: .5px; padding: 1px 8px;
  color: #ff9a7a; background: rgba(255, 90, 60, .1); border: 1px solid rgba(255, 107, 74, .4); border-radius: 10px;
}
.bs-head-badge.ok { color: var(--bs-ok); background: rgba(95, 214, 192, .08); border-color: rgba(95, 214, 192, .3); }
/* 面板头部右侧说明（如纵轴口径） */
.bs-note {
  margin-left: auto; flex-shrink: 0; font-size: 11px; letter-spacing: .4px;
  padding: 1px 8px; color: #7fa9d0; background: rgba(28, 74, 140, .18);
  border: 1px solid rgba(64, 156, 255, .26); border-radius: 10px; white-space: nowrap;
}

.bs-map { height: 100%; border-radius: 6px; overflow: hidden; }
.map-ring { animation: mapPulse 2.2s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes mapPulse {
  0% { transform: scale(.55); opacity: .85; }
  70% { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ------------------------------ 地图组件（自研瓦片引擎 · 高德底图） ------------------------------ */
.env-map { position: relative; height: 100%; border-radius: 6px; overflow: hidden; background: var(--bs-panel0); }
.env-map-canvas-host { position: absolute; inset: 0; }
/* 底图暗色化：对瓦片层做反色+色相旋转，保持道路/地标要素可读（覆盖物不参与滤镜） */
.tm-tiles {
  filter: invert(1) hue-rotate(180deg) brightness(.82) contrast(1.08) saturate(.85);
}
/* 地图加载失败：诚实报错 + 重试，不做假图遮挡 */
.env-map-error {
  position: absolute; inset: 0; z-index: 15;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: radial-gradient(60% 60% at 50% 45%, rgba(18, 42, 74, .92), rgba(7, 17, 31, .96));
  color: var(--bs-text-2); text-align: center; padding: 0 24px;
}
.env-map.map-failed .env-map-error { display: flex; }
.env-map.ready .env-map-error { display: none; }
/* 未配置地图中心：不落到任何内置城市，直接给出明确提示 */
.env-map-unset {
  position: absolute; inset: 0; z-index: 16;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: radial-gradient(60% 60% at 50% 45%, rgba(18, 42, 74, .72), rgba(7, 17, 31, .9));
  color: var(--bs-text-2); text-align: center; padding: 0 24px;
}
.env-map.map-unset .env-map-unset { display: flex; }
.env-map.map-unset .env-map-legend { display: none; }
.env-map-unset b { font-size: 15px; letter-spacing: 2px; color: var(--bs-text-b); }
.env-map-unset span { font-size: 12px; color: var(--bs-text-3); letter-spacing: 1px; max-width: 420px; line-height: 1.7; }
.env-map-unset .eme-retry {
  margin-top: 4px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  height: 30px; padding: 0 14px; font-size: 12.5px; letter-spacing: 1.5px;
  color: var(--bs-accent); background: rgba(20, 70, 130, .35);
  border: 1px solid rgba(70, 190, 255, .55); border-radius: 4px; transition: .15s;
}
.env-map-unset .eme-retry:hover { color: #fff; background: rgba(30, 120, 210, .5); }
.env-map-error .eme-ico { color: var(--bs-blue); opacity: .8; }
.env-map-error b { font-size: 15px; letter-spacing: 2px; color: var(--bs-text-b); }
.env-map-error .eme-msg { font-size: 12px; color: var(--bs-text-3); letter-spacing: 1px; max-width: 420px; }
.env-map-error .eme-retry {
  margin-top: 4px; display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 14px; font-size: 12.5px; letter-spacing: 1.5px; cursor: pointer;
  color: var(--bs-accent); background: rgba(20, 70, 130, .35);
  border: 1px solid rgba(70, 190, 255, .55); border-radius: 4px; transition: .15s;
}
.env-map-error .eme-retry:hover { color: #fff; background: rgba(30, 120, 210, .5); }
.env-map-legend {
  position: absolute; top: 10px; left: 12px; z-index: 20;
  display: flex; gap: 12px; padding: 5px 12px;
  background: rgba(7, 22, 42, .78); border: 1px solid rgba(64, 140, 255, .3); border-radius: 4px;
  font-size: 12px; color: #bfe0ff; letter-spacing: 1px;
}
.env-map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.env-map-legend i { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 6px currentColor; }
.env-map-loading {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px;
  align-items: center; justify-content: center;
  color: #6fa5d8; font-size: 13px; letter-spacing: 2px; background: var(--bs-panel0);
}
.env-map-loading span {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--bs-line); border-top-color: #35a1ff;
  animation: envSpin 1s linear infinite;
}
@keyframes envSpin { to { transform: rotate(360deg); } }

/* 瓦片引擎结构层 */
.tm-viewport { position: absolute; inset: 0; overflow: hidden; cursor: grab; background: var(--bs-panel0); touch-action: none; }
.tm-viewport:active { cursor: grabbing; }
.tm-tiles { position: absolute; inset: 0; }
.tm-tile { position: absolute; width: 256px; height: 256px; pointer-events: none; user-select: none; }
.tm-overlay { position: absolute; inset: 0; pointer-events: none; }
.tm-attrib {
  position: absolute; right: 8px; bottom: 6px; z-index: 25; pointer-events: none;
  font-size: 10px; color: #7ba3cc; letter-spacing: .5px; text-shadow: 0 1px 2px rgba(0, 0, 0, .65);
}
.tm-pin {
  position: absolute; width: 30px; height: 38px; z-index: 10;
  background-size: 100% 100%; background-repeat: no-repeat;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .5));
}
.tm-label {
  position: absolute; transform: translate(-50%, -100%); z-index: 9; text-align: center;
  font-size: 11px; color: #d8ecff; letter-spacing: 1px; white-space: nowrap; line-height: 1.25;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9), 0 0 6px rgba(0, 0, 0, .6);
}
.tm-label b { display: block; font-weight: 600; }
.tm-label i {
  display: block; font-style: normal; font-size: 9.5px; letter-spacing: .5px;
  color: #7fd4ff; opacity: .9;
}
.tm-iw { position: absolute; z-index: 30; transform: translate(-50%, calc(-100% - 44px)); }
.tm-iw-arrow {
  position: absolute; left: 50%; bottom: -5.5px; width: 10px; height: 10px; z-index: 1;
  background: var(--bs-panel); border-right: 1px solid rgba(64, 160, 255, .55);
  border-bottom: 1px solid rgba(64, 160, 255, .55);
  transform: translateX(-50%) rotate(45deg);
}

/* 自定义信息窗体 */
.env-map-iw {
  min-width: 190px; padding: 10px 12px 8px;
  background: var(--bs-panel); border: 1px solid rgba(64, 160, 255, .55); border-radius: 6px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .5); color: #d8ecff; font-size: 12px;
}
.env-map-iw .iw-head { display: flex; align-items: center; gap: 7px; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--bs-line); }
.env-map-iw .iw-dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.env-map-iw .iw-head b { font-size: 13.5px; color: var(--bs-text); letter-spacing: 1px; }
.env-map-iw .iw-badge { margin-left: auto; font-size: 10.5px; padding: 1px 7px; border: 1px solid; border-radius: 9px; }
.env-map-iw table { border-collapse: collapse; width: 100%; }
.env-map-iw td { padding: 2.5px 0; color: var(--bs-text-2); }
.env-map-iw td + td { text-align: right; }
.env-map-iw td b { color: var(--bs-accent); font-size: 13px; font-family: Bahnschrift, "Segoe UI", sans-serif; }
.env-map-iw td i { font-style: normal; color: var(--bs-text-3); font-size: 10px; margin-left: 3px; }
.env-map-iw .iw-foot { margin-top: 6px; padding-top: 5px; border-top: 1px dashed var(--bs-line); color: var(--bs-warn); text-align: right; }
/* 作业班组信息（地点 / 作业内容 / 监护人 / 入井时间） */
.env-map-iw .iw-sub { margin: -2px 0 6px; color: #7fa9d0; font-size: 11px; letter-spacing: .5px; }
.env-map-iw table.iw-facts { margin-bottom: 6px; padding-bottom: 5px; border-bottom: 1px dashed var(--bs-line); }
.env-map-iw .iw-facts td { color: #8fb4d8; font-size: 11.5px; }
.env-map-iw .iw-facts td + td { color: #cfe6ff; }
.env-map-iw .iw-gas th { font-size: 10.5px; font-weight: 400; color: var(--bs-text-3); text-align: left; padding-bottom: 2px; letter-spacing: .5px; }
.env-map-iw .iw-gas th + th { text-align: right; }

/* ------------------------- 浅色底图地图（map-light） -------------------------
   与深色版共用同一套瓦片引擎与点位覆盖物，仅取消瓦片暗色滤镜，并把
   图例 / 标注 / 信息窗 / 提示层改为浅底深字，保证浅色路网可读。 */
.env-map.is-light { background: #eef3f8; }
.env-map.is-light .tm-viewport { background: #eef3f8; }
.env-map.is-light .tm-tiles { filter: none; }
.env-map.is-light .tm-pin { filter: drop-shadow(0 2px 4px rgba(20, 40, 70, .28)); }
.env-map.is-light .tm-label {
  color: #1c2c40; letter-spacing: .6px;
  text-shadow: 0 1px 2px rgba(255, 255, 255, .96), 0 0 6px rgba(255, 255, 255, .9);
}
.env-map.is-light .tm-label i { color: #1a6cbb; }
.env-map.is-light .tm-attrib { color: #5b7591; text-shadow: 0 1px 2px rgba(255, 255, 255, .9); }
.env-map.is-light .env-map-legend {
  background: rgba(255, 255, 255, .94); border-color: rgba(140, 168, 200, .5);
  color: #2b3a4d; box-shadow: 0 3px 12px rgba(23, 43, 71, .12);
}
/* 信息窗：白底深字 + 浅色描边，避免深色气泡压在浅底图上 */
.env-map.is-light .tm-iw-arrow {
  background: #fff; border-right-color: rgba(140, 168, 200, .6); border-bottom-color: rgba(140, 168, 200, .6);
}
.env-map.is-light .env-map-iw {
  background: #fff; border-color: rgba(140, 168, 200, .6); color: #2b3a4d;
  box-shadow: 0 10px 26px rgba(23, 43, 71, .18);
}
.env-map.is-light .env-map-iw .iw-head { border-bottom-color: #e3eaf3; }
.env-map.is-light .env-map-iw .iw-head b { color: #16283d; }
.env-map.is-light .env-map-iw .iw-sub { color: #5b7591; }
.env-map.is-light .env-map-iw td { color: #43566d; }
.env-map.is-light .env-map-iw td b { color: #0f5fbe; }
.env-map.is-light .env-map-iw td i { color: #7e8fa3; }
.env-map.is-light .env-map-iw .iw-foot { border-top-color: #e3eaf3; color: #b4530a; }
.env-map.is-light .env-map-iw .iw-facts td { color: #5b7591; }
.env-map.is-light .env-map-iw .iw-facts td + td { color: #1d3049; }
.env-map.is-light .env-map-iw .iw-gas th { color: #7e8fa3; }
/* 未设置中心 / 加载失败提示层：同步改浅 */
.env-map.is-light .env-map-unset,
.env-map.is-light .env-map-error {
  background: radial-gradient(60% 60% at 50% 45%, rgba(255, 255, 255, .97), rgba(232, 239, 247, .98));
}
.env-map.is-light .env-map-unset b,
.env-map.is-light .env-map-error b { color: #16283d; }
.env-map.is-light .env-map-unset span,
.env-map.is-light .env-map-error .eme-msg { color: #5b7591; }
.env-map.is-light .env-map-error .eme-ico { color: #2b6fb8; opacity: .75; }
.env-map.is-light .env-map-unset .eme-retry,
.env-map.is-light .env-map-error .eme-retry {
  color: #1668c9; background: #e9f2fd; border-color: #a9c9ec;
}
.env-map.is-light .env-map-unset .eme-retry:hover,
.env-map.is-light .env-map-error .eme-retry:hover { color: #fff; background: #2b7ad4; }

.bs-cam { height: 100%; position: relative; overflow: hidden; border-radius: 6px; background: #04101f; }
.bs-cam img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.94) brightness(.97); }
.bs-cam-tag {
  position: absolute; top: 10px; left: 10px; display: flex; align-items: center; gap: 7px;
  background: rgba(4, 18, 38, .68); border: 1px solid rgba(64, 140, 255, .42);
  font-size: 12px; color: #bfe3ff; letter-spacing: 1px; padding: 4px 11px; border-radius: 4px;
}
.bs-cam-tag i { width: 8px; height: 8px; border-radius: 50%; background: #ff4d5e; box-shadow: 0 0 6px #ff4d5e; animation: camBlink 1.3s infinite; }
@keyframes camBlink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.bs-cam-led {
  position: absolute; right: 12px; top: 12px;
  display: grid; grid-template-columns: auto auto; gap: 5px 14px;
  background: rgba(2, 10, 22, .84); border: 1px solid #1f4a7d; border-radius: 6px; padding: 8px 12px;
}
.bs-cam-led span { font-size: 11.5px; color: #59d6ff; letter-spacing: .6px; white-space: nowrap; }
.bs-cam-led b { font-size: 14px; color: var(--bs-warn); font-family: Bahnschrift, "Segoe UI", var(--font); margin: 0 4px 0 6px; }
.bs-cam-led span.is-bad, .bs-cam-led span.is-bad b { color: #ff6b6b; }

/* ------------------------------ 后台配置 ------------------------------ */
.cfg-grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; align-items: start; }
.cfg-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cfg-side { position: sticky; top: 0; }
.cfg-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.cfg-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 15px 18px 13px; border-bottom: 1px solid var(--line-soft);
}
.cfg-head h2 { font-size: 14.5px; font-weight: 640; letter-spacing: -.1px; }
.cfg-head p { font-size: 11.5px; color: var(--muted-2); margin-top: 4px; line-height: 1.6; }
.cfg-body { padding: 16px 18px 4px; }
.cfg-body .field { margin-bottom: 13px; }
.cfg-body .field > label { font-size: 11.5px; }
.cfg-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cfg-row .field { margin-bottom: 13px; }

/* 气体安全阈值表单（四路气体 × 下限/上限） */
.gas-cfg { display: flex; flex-direction: column; gap: 7px; margin-bottom: 4px; }
.gas-cfg-head, .gas-cfg-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 96px 96px 62px;
  align-items: center; gap: 10px;
}
.gas-cfg-head { font-size: 11px; color: var(--muted); letter-spacing: 1px; padding: 0 2px 1px; }
.gas-cfg-row { padding: 0 2px; }
.gas-cfg-row .gname { font-size: 12.5px; color: #2b3646; letter-spacing: .5px; }
.gas-cfg-row .gname b { font-weight: 600; }
.gas-cfg-row .gname i { font-style: normal; font-size: 10px; color: #8ea3ba; margin-left: 6px; }
.gas-cfg-row input[type="number"] {
  width: 100%; height: 32px; border: 1px solid var(--line); border-radius: 7px;
  padding: 0 9px; background: #fff; outline: none; font-size: 12.5px; color: #2b3646;
  transition: border-color .15s, box-shadow .15s;
}
.gas-cfg-row input[type="number"]:focus { border-color: #9db9ff; box-shadow: 0 0 0 3px rgba(47, 107, 255, .1); }
.gas-cfg-row .gunit { font-size: 11px; color: var(--muted); letter-spacing: .5px; }
.cfg-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-bottom: 14px; }
.cfg-hint { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted-2); }
.cfg-hint svg { flex-shrink: 0; color: #9db9ff; }
.cfg-note { font-size: 11px; color: var(--muted-2); padding: 10px 18px 14px; line-height: 1.6; }

/* 所在地与气象：行政区划级联 */
.cfg-cascade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin-bottom: 12px; }
.cfg-div { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cfg-div > label { font-size: 11.5px; color: var(--muted); letter-spacing: .2px; }
.cfg-div select, .cfg-div input {
  width: 100%; height: 34px; padding: 0 9px; font-size: 12.5px; border-radius: 7px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
}
.cfg-div select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8aa2c0 50%), linear-gradient(135deg, #8aa2c0 50%, transparent 50%); background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 26px; }
.cfg-div select:disabled { background-color: #f5f7fa; color: #a6b0bf; cursor: not-allowed; }
.cfg-div select:focus, .cfg-div input:focus { outline: none; border-color: #7ba7f0; box-shadow: 0 0 0 3px rgba(79, 140, 255, .12); }
.cfg-place-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 11px; margin-bottom: 10px; border-radius: 7px;
  background: #f4f7fc; border: 1px solid var(--line-soft);
}
.cfg-place-name { font-size: 12px; color: var(--ink); font-weight: 600; }
.cfg-place-coord { font-size: 11px; color: var(--muted-2); font-variant-numeric: tabular-nums; }

.cfg-weather {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px; margin-bottom: 12px;
  border-radius: 9px; border: 1px solid #cddff8;
  background: linear-gradient(120deg, #f4f8ff, #eaf2ff);
}
.cfg-w-ico { display: flex; flex-shrink: 0; }
.cfg-w-ico.muted { opacity: .5; }
.cfg-w-main { flex: 1; min-width: 0; }
.cfg-w-main b {
  display: block; font-size: 26px; line-height: 1.1; color: #16324f;
  font-family: "DIN Alternate", Bahnschrift, "Segoe UI", var(--font);
  font-variant-numeric: tabular-nums;
}
.cfg-w-main b i { font-style: normal; font-size: 13px; color: #5a7392; }
.cfg-w-main span { display: block; font-size: 11.5px; color: #4a6b8f; margin-top: 3px; }
.cfg-w-side { text-align: right; flex: none; }
.cfg-w-side em { display: block; font-style: normal; font-size: 11.5px; color: #37597f; }
.cfg-w-side span { display: block; font-size: 10.5px; color: var(--muted-2); margin-top: 3px; }

/* 大屏标题条天气图标容器 */
.bs-weather .bs-w-ico { display: flex; flex-shrink: 0; }

/* 标题条预览 */
.cfg-preview {
  margin: 14px 18px 0; border-radius: 10px; overflow: hidden;
  background: linear-gradient(135deg, #0a1a33 0%, #0d2846 55%, #07162b 100%);
  border: 1px solid #1e4a7d; padding: 12px 14px 13px;
  box-shadow: inset 0 0 30px rgba(31, 106, 189, .22);
}
.cfg-preview-top { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--bs-text-3); letter-spacing: .4px; }
.cfg-preview-title {
  margin: 9px 0 10px; text-align: center; font-size: 16px; font-weight: 700; letter-spacing: 2px;
  color: #dff2ff; text-shadow: 0 0 14px rgba(63, 160, 255, .65); line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cfg-preview-title.long { font-size: 13px; letter-spacing: .5px; }
.cfg-preview-bottom { display: flex; justify-content: space-between; gap: 10px; font-size: 10.5px; color: #7fa9d2; }
.cfg-preview-bottom span:first-child { color: #b9dcff; }

/* 地图拾取 */
.cfg-map-card { display: flex; flex-direction: column; }
.cfg-map { position: relative; height: 300px; background: #071426; border-top: 1px solid var(--line); }
.cfg-map-host { position: absolute; inset: 0; }
.cfg-map-host canvas { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.92) saturate(.9); }
.cfg-cross {
  position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px;
  pointer-events: none; z-index: 5;
}
.cfg-cross::before, .cfg-cross::after {
  content: ''; position: absolute; background: #4da3ff; box-shadow: 0 0 8px rgba(77, 163, 255, .9);
}
.cfg-cross::before { left: 0; right: 0; top: 50%; height: 1.5px; margin-top: -.75px; }
.cfg-cross::after { top: 0; bottom: 0; left: 50%; width: 1.5px; margin-left: -.75px; }
.cfg-cross-tip {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, 16px); z-index: 5;
  font-size: 10.5px; color: #9fd0ff; background: rgba(6, 22, 42, .78);
  border: 1px solid rgba(77, 163, 255, .45); border-radius: 4px; padding: 2px 7px; pointer-events: none;
  white-space: nowrap;
}
.cfg-map-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 14px; font-size: 11.5px; color: var(--muted); background: #fbfcfe;
}
.cfg-map-foot b { color: #2b3646; font-variant-numeric: tabular-nums; }
.cfg-map-fail {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: #8fa6c2; font-size: 12.5px; text-align: center;
}
.cfg-map-fail span { font-size: 11px; color: #6d819b; }
.cfg-map-fail .btn { margin-top: 8px; }
.cfg-map.failed .cfg-cross, .cfg-map.failed .cfg-cross-tip { display: none; }

/* 腾讯地图 Key 配置行 */
.cfg-map-key {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-top: 1px solid var(--line); background: #fff;
}
.cfg-map-key label { flex-shrink: 0; font-size: 12px; color: #3c4a5c; }
.cfg-map-key input {
  flex: 1; min-width: 0; height: 30px; padding: 0 10px; font-size: 12px;
  border: 1px solid var(--line); border-radius: 5px; color: #2b3646; background: #fbfcfe;
  font-family: Consolas, "SFMono-Regular", monospace;
}
.cfg-map-key input:focus { outline: none; border-color: #9cc4ff; box-shadow: 0 0 0 2px rgba(64, 156, 255, .12); }
.cfg-map-key .btn { flex-shrink: 0; }

@media (max-width: 1240px) {
  .cfg-grid { grid-template-columns: minmax(0, 1fr); }
  .cfg-side { position: static; }
}


/* ------------------------------ 标题条天气：同步状态 ------------------------------ */
.bs-weather { cursor: pointer; border-radius: 6px; transition: background .18s; }
.bs-weather:hover { background: rgba(47, 212, 255, .06); }
.bs-weather:hover .bs-w-ico { filter: drop-shadow(0 0 14px rgba(0, 190, 255, .95)); }
.bs-weather.syncing .bs-w-ico { animation: wxFade 1.5s ease-in-out infinite; }
.bs-weather.syncing #bsWeatherSub { color: var(--bs-text-3); }
.bs-weather.stale #bsWeatherSub { color: var(--bs-warn); }
@keyframes wxFade { 0%, 100% { opacity: .38; } 50% { opacity: 1; } }

/* ------------------------------ 地图中心点位坐标窗（后台配置页） ------------------------------ */
.map-center-win {
  position: absolute; left: 50%; top: 50%; z-index: 12;
  transform: translate(-50%, calc(-100% - 26px));
  min-width: 238px; padding: 9px 11px 8px;
  background: linear-gradient(180deg, rgba(9, 30, 56, .96), rgba(6, 19, 36, .94));
  border: 1px solid rgba(77, 163, 255, .5); border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .45), inset 0 0 20px rgba(47, 212, 255, .07);
}
.map-center-win::after {
  content: ''; position: absolute; left: 50%; bottom: -5px; width: 8px; height: 8px;
  margin-left: -4px; transform: rotate(45deg);
  background: rgba(6, 19, 36, .96);
  border-right: 1px solid rgba(77, 163, 255, .5);
  border-bottom: 1px solid rgba(77, 163, 255, .5);
}
.mcw-head { display: flex; align-items: center; gap: 6px; font-size: 10.5px; letter-spacing: 1.6px; color: #8fc4f2; }
.mcw-head i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--bs-accent);
  box-shadow: 0 0 9px var(--bs-accent); animation: mcwPulse 1.9s ease-in-out infinite;
}
@keyframes mcwPulse { 0%, 100% { opacity: .32; transform: scale(.78); } 50% { opacity: 1; transform: scale(1.18); } }
.mcw-coord {
  display: flex; align-items: baseline; gap: 3px; margin: 5px 0 6px;
  font-family: Bahnschrift, "DIN Alternate", "Segoe UI", monospace; font-variant-numeric: tabular-nums;
}
.mcw-coord b { font-size: 15px; font-weight: 600; color: var(--bs-accent); letter-spacing: .4px; text-shadow: 0 0 10px rgba(47, 212, 255, .45); }
.mcw-coord em { font-style: normal; font-size: 10px; color: var(--bs-text-3); }
.mcw-sep { align-self: center; width: 1px; height: 12px; margin: 0 6px; background: rgba(77, 163, 255, .35); }
.mcw-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 5px; border-top: 1px dashed rgba(77, 163, 255, .22); }
.mcw-foot span { font-size: 10.5px; color: var(--bs-text-3); letter-spacing: 1.2px; }
.mcw-copy {
  font-size: 10.5px; color: #9fd0ff; padding: 2px 8px; border-radius: 4px; cursor: pointer;
  background: rgba(47, 140, 255, .14); border: 1px solid rgba(77, 163, 255, .42); transition: .15s;
}
.mcw-copy:hover { background: rgba(47, 140, 255, .3); color: var(--bs-text); }
.cfg-map-hint { color: #8fa6c2; font-size: 10.5px; }
.cfg-map.failed .map-center-win { display: none; }

/* ------------------------------ 响应式 ------------------------------ */
@media (max-width: 1180px) {
  .config-panel { width: 264px; }
}
@media (max-width: 980px) {
  .sidebar { width: 66px; padding: 0 8px 12px; }
  .brand-text, .nav-caption, .nav-item { font-size: 0; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item .nav-ico svg { width: 19px; height: 19px; }
  .sidebar-foot { display: none; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .content { padding: 14px; }
  .canvas { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .card { grid-column: span 6 !important; }
  .config-panel { position: fixed; right: 0; top: 0; bottom: 0; z-index: 60; box-shadow: -20px 0 50px -30px rgba(0,0,0,.4); }
  .dash-head { flex-direction: column; align-items: flex-start; }
}

/* 后台配置迁移指引（原配置页内容已并入 admin.html） */
.moved-tb { width: 100%; border-collapse: collapse; font-size: 13px; }
.moved-tb th {
  text-align: left; font-weight: 500; font-size: 11.5px; color: var(--muted-2);
  padding: 7px 10px; border-bottom: 1px solid var(--line);
}
.moved-tb td { padding: 11px 10px; border-bottom: 1px solid var(--line-soft); color: var(--text); }
.moved-tb tbody tr:last-child td { border-bottom: 0; }
.moved-tb td:nth-child(2) { color: var(--muted); }
