/* =====================================================================
   市政设施智慧管养平台 · 设计系统（浅色专业政务风）
   原则：信息优先、克制专业、8pt 网格、统一 token、完整交互状态。
   参考：Material 3 中性色板 + Ant Design 商务规范 + 政务 GIS 平台惯例。
   ===================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* 品牌色 */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --primary-border: #bfdbfe;

  /* 语义色（浅色底 + 深色字，WCAG AA） */
  --ok: #15803d;      --ok-bg: #f0fdf4;    --ok-border: #bbf7d0;
  --warn: #b45309;    --warn-bg: #fffbeb;  --warn-border: #fde68a;
  --danger: #dc2626;  --danger-bg: #fef2f2; --danger-border: #fecaca;
  --info: #1d4ed8;    --info-bg: #eff6ff;  --info-border: #bfdbfe;

  /* 中性色 */
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text-1: #1e293b;
  --text-2: #475569;
  --text-3: #94a3b8;

  /* 几何 */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 1px 3px rgba(15, 23, 42, .07), 0 4px 12px rgba(15, 23, 42, .05);
  --shadow-lg: 0 4px 8px rgba(15, 23, 42, .08), 0 12px 32px rgba(15, 23, 42, .10);
  --font: "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;

  /* 兼容旧引用 */
  --accent: var(--primary);
  --green: #16a34a; --orange: #d97706; --red: #dc2626;
  --text: var(--text-1); --muted: var(--text-3);
  --line: var(--border); --line2: var(--border);
  --panel: var(--surface); --panel2: var(--surface-2); --bg-panel: var(--surface);

  /* 旧蓝色基调 token 兼容别名（业务页内联样式引用） */
  --bl-1: #f3f5f9; --bl-2: #eef2f7; --bl-card: #ffffff;
  --bl-line: #e2e8f0; --bl-primary: #2563eb; --bl-primary-d: #1d4ed8;
  --bl-txt: #1e293b; --bl-muted: #64748b; --bl-ok: #16a34a; --bl-warn: #d97706; --bl-danger: #dc2626;
}

html, body { height: 100%; font-family: var(--font); background: var(--bg); color: var(--text-1); font-size: 14px; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* ---------- 表单控件 ---------- */
button { font-family: inherit; cursor: pointer; border: none; border-radius: var(--radius-sm); }
input, select, textarea {
  font-family: inherit; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: #fff; color: var(--text-1); padding: 8px 12px; font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

/* ---------- 按钮（层级：主按钮 > 次按钮 > 文字按钮） ---------- */
.btn {
  background: linear-gradient(160deg, #2f6fe8, #1d4ed8);
  box-shadow: 0 2px 10px rgba(37, 99, 235, .28), inset 0 1px 0 rgba(255, 255, 255, .18);
  background: var(--primary); color: #fff; padding: 8px 18px; font-weight: 600; font-size: 14px;
  border-radius: var(--radius-sm); transition: background .15s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: linear-gradient(160deg, #3b7bf5, #2563eb); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(37, 99, 235, .38), inset 0 1px 0 rgba(255, 255, 255, .18); }
.btn:active { background: #1e40af; transform: translateY(0); box-shadow: 0 1px 4px rgba(37, 99, 235, .3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { padding: 5px 12px; font-size: 13px; }
.btn.ghost {
  background: #fff; border: 1px solid var(--border-strong); color: var(--text-2);
  box-shadow: none;
}
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn.green { background: #16a34a; } .btn.green:hover { background: #15803d; }
.btn.orange { background: #d97706; } .btn.orange:hover { background: #b45309; }
.btn.red { background: #dc2626; } .btn.red:hover { background: #b91c1c; }
.btn.bl { background: var(--primary); } .btn.bl:hover { background: var(--primary-hover); }

/* ---------- 登录（兼容旧类名） ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-card { width: 380px; background: var(--surface); padding: 32px; border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow-md); }
.login-card h1 { font-size: 20px; margin-bottom: 4px; color: var(--text-1); }
.login-card .sub { color: var(--text-2); font-size: 13px; margin-bottom: 18px; }
.login-card label { display: block; font-size: 13px; color: var(--text-2); margin: 10px 0 4px; }
.login-card .row { display: flex; gap: 8px; }
.login-card .role-btns { display: flex; gap: 8px; margin: 12px 0; }
.login-card .role-btns button { flex: 1; padding: 8px; background: #fff; border: 1px solid var(--border-strong); color: var(--text-2); }
.login-card .role-btns button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.err { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 16px; }

/* ---------- 通用框架（旧 topbar 兼容） ---------- */
.topbar { height: 52px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 18px; gap: 14px; position: sticky; top: 0; z-index: 50; }
.topbar .logo { font-weight: 700; color: var(--primary); font-size: 16px; }
.topbar .who { margin-left: auto; color: var(--text-2); font-size: 13px; display: flex; gap: 10px; align-items: center; }
.topbar a.nav { color: var(--text-2); font-size: 14px; padding: 6px 12px; border-radius: var(--radius-sm); }
.topbar a.nav:hover { background: var(--surface-2); color: var(--text-1); }
.topbar a.nav.active { background: var(--primary); color: #fff; }
.main { padding: 16px; }
.grid { display: grid; gap: 14px; }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }

/* ---------- 卡片 ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.card h3 { font-size: 14px; color: var(--text-2); margin-bottom: 12px; font-weight: 600; }
.kpi { font-size: 30px; font-weight: 800; color: var(--text-1); font-variant-numeric: tabular-nums; }
.kpi.small { font-size: 22px; }

/* ---------- 标签（语义色系统） ---------- */
.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; }
.tag.green { background: var(--ok-bg); color: var(--ok); }
.tag.orange { background: var(--warn-bg); color: var(--warn); }
.tag.red { background: var(--danger-bg); color: var(--danger); }
.tag.blue { background: var(--info-bg); color: var(--info); }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--text-2); font-weight: 600; background: var(--surface-2); }
tr:hover td { background: var(--surface-2); }
.map { width: 100%; height: 100%; border-radius: var(--radius-sm); }
.map-box { height: 520px; }
.flex { display: flex; gap: 14px; }
.flex > .card { flex: 1; }
.muted { color: var(--text-3); }
.list { max-height: 520px; overflow: auto; }
.item { padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; background: var(--surface-2); }
.item .t { font-weight: 600; color: var(--text-1); }
.item .m { color: var(--text-2); font-size: 12px; margin-top: 4px; }

/* ---------- 反馈 ---------- */
.toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); background: #16a34a; color: #fff; padding: 10px 18px; border-radius: var(--radius-sm); font-weight: 600; z-index: 9999; display: none; box-shadow: var(--shadow-md); }
/* 弹窗：外层只负责宽度上限与滚动，内层 .dlg 不再自带宽度，避免 420px 套 440px 造成横向溢出/按钮被截断 */
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: none; align-items: center; justify-content: center; z-index: 9998; padding: 12px; box-sizing: border-box; }
.modal .box { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px;
  width: min(480px, 100%); max-width: 100%; box-sizing: border-box;
  max-height: 86vh; overflow: auto; overflow-wrap: anywhere; word-break: break-word;
  box-shadow: var(--shadow-lg); }
.modal .box h2 { font-size: 17px; margin-bottom: 12px; color: var(--text-1); }
.modal .box label { display: block; color: var(--text-2); font-size: 13px; margin: 10px 0 4px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.qr { text-align: center; }
.qr canvas, .qr img { margin: 0 auto; }

@media (max-width: 900px) {
  .cols-4, .cols-3, .cols-2 { grid-template-columns: 1fr; }
  .map-box { height: 360px; }
  .flex { flex-direction: column; }
}

/* =====================================================================
   数字孪生指挥中心 · 浅色专业主题
   设计原则：与业务端同一设计语言；白色面板 + 细描边 + 蓝色强调，
   与浅色底图同一色调，消除深浅割裂；零装饰性渐变/发光。
   ===================================================================== */
:root {
  --tw-bg: #eef2f7;
  --tw-panel: rgba(255, 255, 255, .93);
  --tw-panel-solid: #ffffff;
  --tw-border: #dbe4ee;
  --tw-border-strong: #c3d2e3;
  --tw-txt-1: #1e293b;
  --tw-txt-2: #475569;
  --tw-txt-3: #8494a9;
  --tw-accent: #2563eb;
  --tw-ok: #15803d;
  --tw-warn: #b45309;
  --tw-danger: #dc2626;
}
html, body.role-dispatch { background: var(--tw-bg); }

/* ---------- 外壳 ---------- */
.twin-shell {
  position: relative; height: 100vh; display: flex; flex-direction: column; overflow: hidden;
  color: var(--tw-txt-1);
  background: var(--tw-bg);
}

/* ---------- 顶栏（深空蓝科技带） ---------- */
.twin-head {
  height: 56px; flex: 0 0 56px; display: flex; align-items: center; gap: 20px;
  padding: 0 20px; position: relative; z-index: 10;
  background: linear-gradient(100deg, #0d1b3e 0%, #14295e 46%, #0e2f66 100%);
  border-bottom: none;
}
.twin-head::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; z-index: 11;
  background: linear-gradient(90deg, transparent, #2563eb 18%, #22d3ee 50%, #2563eb 82%, transparent);
  opacity: .85; box-shadow: 0 0 12px rgba(34, 211, 238, .55);
  animation: beamFlow 6s linear infinite; background-size: 200% 100%;
}
@keyframes beamFlow { from { background-position: 0% 0; } to { background-position: 200% 0; } }
.th-logo { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.th-logo .emblem {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px;
  background: linear-gradient(145deg, #2f6fe8, #22d3ee);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .18) inset, 0 0 14px rgba(34, 211, 238, .45);
  display: flex; align-items: center; justify-content: center;
}
.th-logo .em-core { font-size: 16px; font-weight: 700; color: #fff; }
.th-logo-txt { display: flex; flex-direction: column; line-height: 1.25; }
.th-logo-txt b { font-size: 14.5px; font-weight: 700; color: #fff; }
.th-logo-txt span { font-size: 10.5px; color: rgba(198, 214, 240, .75); letter-spacing: .3px; }
.th-center { flex: 1; display: flex; align-items: center; justify-content: center; gap: 14px; min-width: 0; }
.th-center h1 {
  font-size: 18px; font-weight: 700; letter-spacing: 1.5px; margin: 0; white-space: nowrap;
  color: #f4f8ff; text-shadow: 0 0 18px rgba(56, 132, 255, .55);
}
.th-center .th-ray { flex: 0 0 clamp(30px, 8vw, 120px); height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, .65)); }
.th-center .th-ray.right { background: linear-gradient(90deg, rgba(34, 211, 238, .65), transparent); }
.th-right { display: flex; align-items: center; gap: 22px; white-space: nowrap; }
.th-stat { display: flex; gap: 20px; }
.th-stat-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.th-stat-item .lbl { font-size: 10.5px; color: rgba(198, 214, 240, .7); }
.th-stat-item b { font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 0 12px rgba(56, 132, 255, .4); }
.th-stat-item b.r { color: #fca5a5; text-shadow: 0 0 12px rgba(239, 68, 68, .45); }
.th-stat-item b.g { color: #6ee7b7; font-size: 15px; text-shadow: 0 0 12px rgba(16, 185, 129, .45); }
.th-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.th-meta .clock { font-size: 15px; font-weight: 600; color: #dce8ff; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.th-update { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: rgba(198, 214, 240, .75); }
.upd-dot { width: 6px; height: 6px; border-radius: 50%; background: #34d399; display: inline-block;
  animation: dotPulse 2.2s ease-out infinite; }
@keyframes dotPulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .45); } 70% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
.upd-dot.flash { animation: updFlash .7s ease; }
@keyframes updFlash { 0% { box-shadow: 0 0 0 0 rgba(21,128,61,.5); } 100% { box-shadow: 0 0 0 7px rgba(21,128,61,0); } }
.icon-btn { width: 20px; height: 20px; line-height: 18px; text-align: center; border-radius: 8px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); color: #dce8ff; font-size: 13px; padding: 0; }
.icon-btn:hover { background: rgba(34, 211, 238, .18); border-color: rgba(34, 211, 238, .5); color: #a5f3fc; }

/* ---------- 主体：全屏地图 + 悬浮面板 ---------- */
.twin-body {
  position: relative; flex: 1; display: block; min-height: 0;
}
.map-full { position: absolute; inset: 0; }
.map-full .map-wrap { height: 100%; border-radius: 0; border: none; box-shadow: none; }
/* 地图两侧渐变压浅：悬浮面板下方的地图变浅，突出悬浮层次 */
.map-shade { position: absolute; top: 0; bottom: 0; z-index: 435; pointer-events: none; }
.map-shade.l { left: 0; width: 400px;
  background: linear-gradient(90deg, rgba(240, 245, 251, .62), rgba(240, 245, 251, 0)); }
.map-shade.r { right: 0; width: 440px;
  background: linear-gradient(270deg, rgba(240, 245, 251, .62), rgba(240, 245, 251, 0)); }
/* 悬浮列：覆盖在地图上方 */
.twin-col.float {
  position: absolute; top: 12px; bottom: 12px; left: 12px; width: 300px; z-index: 460;
  display: flex; flex-direction: column; gap: 10px; min-height: 0;
  overflow-y: auto; overflow-x: hidden; padding-right: 2px;
  pointer-events: auto;
}
.twin-col.float.right { left: auto; right: 12px; width: 340px; }
.twin-col.float::-webkit-scrollbar { width: 5px; }
.twin-col.float::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.twin-col.float::-webkit-scrollbar-track { background: transparent; }
/* 折叠/展开过渡 */
.twin-col.float, .map-shade { transition: transform .4s cubic-bezier(.4, 0, .2, 1), opacity .4s ease; }
body.no-lcol .twin-col.float.left { transform: translateX(calc(-100% - 16px)); opacity: 0; pointer-events: none; }
body.no-rcol .twin-col.float.right { transform: translateX(calc(100% + 16px)); opacity: 0; pointer-events: none; }
body.no-lcol .map-shade.l, body.no-rcol .map-shade.r { opacity: 0; }
/* 收起后：顶部信息条/图例/HD 复位到屏幕边缘 */
body.no-lcol .map-topbar { padding-left: 14px; }
body.no-rcol .map-topbar { padding-right: 14px; }
body.no-lcol .scene-legend { left: 14px; }
body.no-lcol .map-hud.tl, body.no-lcol .map-hud.bl { left: 12px; }
body.no-rcol .map-hud.tr, body.no-rcol .map-hud.br { right: 12px; }
/* 折叠按钮：贴边小把手 */
.fold-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 480;
  width: 18px; height: 58px; cursor: pointer;
  background: rgba(255, 255, 255, .9); color: #475569; font-size: 13px; line-height: 1;
  border: 1px solid var(--border); box-shadow: 0 2px 8px rgba(15, 23, 42, .12);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.fold-btn:hover { background: #fff; color: var(--primary); }
.fold-btn.fold-l { left: 0; right: auto; border-left: none; border-radius: 0 10px 10px 0; }
.fold-btn.fold-r { right: 0; left: auto; border-right: none; border-radius: 10px 0 0 10px; }
body.no-lcol .fold-l { border-radius: 0 10px 10px 0; }
/* 加载骨架屏 */
.skel {
  position: relative; overflow: hidden; min-height: 64px;
  background: linear-gradient(100deg, #eef2f7 38%, #f7fafc 50%, #eef2f7 62%);
  background-size: 200% 100%; animation: skelShimmer 1.3s ease-in-out infinite;
  border-radius: 10px;
}
.skel > * { visibility: hidden; }
@keyframes skelShimmer { from { background-position: 120% 0; } to { background-position: -80% 0; } }
/* 通用 hover tooltip（data-tip） */
[data-tip] { position: relative; cursor: default; }
[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 6px);
  transform: translateX(-50%); z-index: 90; white-space: nowrap;
  background: rgba(15, 23, 42, .92); color: #f1f5f9; font-size: 11px; font-weight: 500;
  padding: 5px 9px; border-radius: 8px; pointer-events: none;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .25);
}
.bar-row { cursor: default; }
.bar-row .bt { transition: filter .15s; }
.bar-row:hover .bt { filter: brightness(1.12); }
.bar-row:hover .bl { color: var(--primary); }
.tb .bar { cursor: pointer; }
.tb .bar:hover { filter: brightness(1.15); }
/* 宽屏投屏：字号流式放大（1920/2K/4K 自适应） */
.kpi-v { font-size: clamp(22px, 1.5vw, 30px); }
.th-center h1 { font-size: clamp(18px, 1.25vw, 24px); }
.th-stat-item b { font-size: clamp(17px, 1.15vw, 22px); }
@media (max-width: 1200px) { .kpi-v { font-size: 22px; } }
/* 悬浮面板：亚克力材质，地图透出变浅（透明度低、模糊补赏清晰度） */
.twin-col.float .panel {
  background: rgba(255, 255, 255, .55);
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 2px 6px rgba(15, 23, 42, .06), 0 10px 30px rgba(15, 23, 42, .10);
}
/* 悬浮面板文字：加重清晰度（半透明底上保证可读，保留层级） */
.twin-col.float .panel { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.twin-col.float .panel h3 { font-weight: 700; letter-spacing: .5px; }
.twin-col.float .panel { color: #334155; }
.twin-col.float .panel .kpi-v, .twin-col.float .panel b { color: #0f172a; }
.twin-col.float .panel .kpi-l, .twin-col.float .panel .muted, .twin-col.float .panel small { color: #64748b; }
@media (max-width: 1200px) {
  .twin-col.float { width: 262px; }
  .twin-col.float.right { width: 300px; }
  .map-shade.l { width: 350px; } .map-shade.r { width: 390px; }
}
@media (max-width: 900px) {
  .twin-body { overflow-y: auto; }
  .map-full { position: relative; height: 58vh; }
  .twin-col.float { position: static; width: auto; margin: 10px 12px; overflow: visible; }
  .map-shade { display: none; }
}
.twin-col { display: flex; flex-direction: column; gap: 10px; min-height: 0; }

/* ---------- 面板 ---------- */
.panel {
  position: relative; flex: 0 0 auto;
  background: var(--tw-panel);
  border: 1px solid var(--tw-border);
  border-radius: var(--radius); padding: 12px 14px 14px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: var(--shadow-sm);
}
.panel::before {
  content: ''; position: absolute; top: -1px; left: 12%; right: 12%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, .55), rgba(34, 211, 238, .55), transparent);
  pointer-events: none;
}
.panel-flex { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.panel h3 {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--tw-txt-1); letter-spacing: .4px;
  margin: 0 0 11px; padding-bottom: 8px;
  border-bottom: 1px solid var(--tw-border);
}
.panel h3::before { content: ''; width: 3px; height: 12px; border-radius: 2px;
  background: linear-gradient(180deg, #2563eb, #22d3ee); box-shadow: 0 0 6px rgba(34, 211, 238, .6); }
.h3-count, .trend-range {
  margin-left: auto; font-size: 11px; font-weight: 500; color: var(--tw-txt-3);
  border: 1px solid var(--tw-border); border-radius: 12px; padding: 2px 8px; letter-spacing: 0;
  background: var(--surface-2);
}
.panel-hd-row { display: flex; align-items: flex-start; justify-content: space-between; }
.panel-hd-row h3 { flex: 1; }

/* ---------- 核心指标 ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
/* KPI 超时/临超时徽标 */
.kpi-badge { display: inline-block; margin-top: 3px; padding: 1px 8px; border-radius: 8px; font-size: 10.5px; font-weight: 700; }
.kpi-badge.danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.kpi-badge.warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
/* 考核红线指标行 */
.h-sub { margin-left: auto; font-size: 10.5px; font-weight: 500; color: var(--tw-txt-3); letter-spacing: 0; }
.rl-wrap { display: flex; flex-direction: column; gap: 2px; }
.rl-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 10px; background: var(--surface-2); }
.rl-row + .rl-row { margin-top: 6px; }
.rl-name { font-size: 12px; color: var(--tw-txt-2); font-weight: 600; }
.rl-val { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rl-val b { font-size: 16px; }
.rl-val.ok { color: #15803d; } .rl-val.warn { color: #b45309; } .rl-val.bad { color: #dc2626; }
.rl-val.muted { color: var(--tw-txt-3); font-size: 12px; font-weight: 500; }
.rl-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.rl-val.ok .rl-dot { background: #16a34a; box-shadow: 0 0 6px rgba(22, 163, 74, .5); }
.rl-val.warn .rl-dot { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, .5); animation: dotPulse 2.2s ease-out infinite; }
.rl-val.bad .rl-dot { background: #dc2626; box-shadow: 0 0 6px rgba(220, 38, 38, .55); animation: dotPulse 1.4s ease-out infinite; }
.rl-target { font-size: 10.5px; color: var(--tw-txt-3); white-space: nowrap; }
/* 工单 SLA 徽标 */
.wo-lv { display: inline-block; padding: 1px 7px; border-radius: 8px; font-size: 10px; font-weight: 700; }
.lv-紧急 { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.lv-重要 { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.lv-一般 { background: #f0f9ff; color: #0369a1; border: 1px solid #bae6fd; }
.wo-sla { display: inline-block; padding: 1px 7px; border-radius: 8px; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wo-sla.overdue { background: #dc2626; color: #fff; animation: dotPulse 1.6s ease-out infinite; }
/* 防汛台账行 */
.fd-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border-radius: 10px; background: var(--surface-2); margin-bottom: 6px; }
.fd-row .fd-t { min-width: 0; }
.fd-row .fd-t b { display: block; font-size: 12.5px; color: var(--text-1); }
.fd-row .fd-t .muted { display: block; margin-top: 2px; }
.fd-due { display: block; font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
.fd-due.late { color: #dc2626; font-weight: 700; }
.fd-stock { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; color: #15803d; white-space: nowrap; }
.fd-stock.short { color: #dc2626; }
.wo-sla.warning { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.wo-sla.ok { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.wo-card.wo-overdue { border-color: #fca5a5; background: linear-gradient(0deg, rgba(254, 242, 242, .55), rgba(254, 242, 242, .55)); }
.kpi-cell {
  background: var(--surface-2); border: 1px solid var(--tw-border);
  border-radius: var(--radius-sm); padding: 10px 8px; text-align: center;
  position: relative; overflow: hidden;
}
.kpi-cell::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, .35), transparent); }
.kpi-v { font-weight: 800; line-height: 1.1; color: var(--tw-txt-1); font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px rgba(37, 99, 235, .22); }
.kpi-l { font-size: 10.5px; color: var(--tw-txt-3); margin-top: 4px; }

/* ---------- 片区分布图 ---------- */
.district-wrap { display: flex; justify-content: center; }
#districtMap { width: 100%; height: 176px; display: block; }

/* ---------- 通用图表 ---------- */
.chart-wrap { padding: 0; }
.bar-row { display: flex; align-items: center; gap: 8px; margin: 9px 0; font-size: 11.5px; color: var(--tw-txt-2); }
.bar-row .bl { flex: 0 0 92px; display: flex; align-items: center; gap: 5px; color: var(--tw-txt-1); }
.bar-row .bl .ln-ico { flex: 0 0 auto; opacity: .9; }
.bt-track { flex: 1; height: 7px; border-radius: 8px; background: #e8edf4; overflow: hidden; }
.bar-row .bt { display: block; height: 100%; border-radius: 8px; }
.bar-row .bv { flex: 0 0 34px; text-align: right; color: var(--tw-txt-1); font-weight: 700; font-variant-numeric: tabular-nums; }
.ring-wrap { display: flex; justify-content: center; }
.ring-arc { transition: stroke-dashoffset 1s ease; }

/* ---------- 线性图标 ---------- */
.ln-ico { display: inline-block; vertical-align: middle; }

/* ---------- 趋势图 ---------- */
.trend-bars { display: flex; align-items: flex-end; gap: 8px; height: 128px; padding: 6px 2px 0; flex: 1; }
.trend-bars .tb { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.trend-bars .tb-pair { display: flex; align-items: flex-end; gap: 4px; height: 96px; }
.trend-bars .bar { width: 9px; border-radius: 3px 3px 0 0; min-height: 2px; transition: height .6s ease; position: relative; }
.trend-bars .bar-wo { background: #93b4f9; }
.trend-bars .bar-cl { background: #34c391; }
.trend-bars .tb .lab { font-size: 10px; color: var(--tw-txt-3); }
.trend-legend { display: flex; gap: 18px; justify-content: center; font-size: 10.5px; color: var(--tw-txt-2); margin-top: 10px; }
.trend-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.trend-legend .lg-wo { background: #6d9bf2; }
.trend-legend .lg-cl { background: #22a87c; }

/* ---------- 中心地图 ---------- */
.map-wrap { position: relative; height: 100%; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--tw-border); background: #eef2f7; box-shadow: var(--shadow-sm); }
/* 地图 HUD 四角括号（科技定位框）：避开两侧悬浮列 */
.map-hud { position: absolute; width: 26px; height: 26px; z-index: 472; pointer-events: none;
  border: 2px solid rgba(37, 99, 235, .55); filter: drop-shadow(0 0 4px rgba(34, 211, 238, .4)); }
.map-hud.tl { top: 66px; left: calc(300px + 26px); border-right: none; border-bottom: none; border-top-left-radius: 8px; }
.map-hud.tr { top: 66px; right: calc(340px + 26px); border-left: none; border-bottom: none; border-top-right-radius: 8px; }
.map-hud.bl { bottom: 12px; left: calc(300px + 26px); border-right: none; border-top: none; border-bottom-left-radius: 8px; }
.map-hud.br { bottom: 12px; right: calc(340px + 26px); border-left: none; border-top: none; border-bottom-right-radius: 8px; }
.scene3d { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 430; background: #eef2f7; }
.scene3d canvas { display: block; }
.scene3d .leaflet-container { background: #eef2f7; font-family: inherit; }
.scene3d .leaflet-control-attribution { font-size: 9px; background: rgba(255,255,255,.7); }
.scene3d .leaflet-control-zoom a { color: #1e293b; }
.cesium-fallback { position: absolute; inset: 0; z-index: 495; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 30px; color: #b91c1c; font-size: 14px; line-height: 1.9; background: #f8fafc; }

/* ===== 指挥中心资产徽章（Leaflet 2D 版，视觉对齐旧 Cesium 版） ===== */
.dm-marker { background: none; border: none; }
.dm-pin { position: absolute; display: block; background-size: contain; background-repeat: no-repeat;
  background-position: center; cursor: pointer; transition: transform .12s ease; }
.dm-marker:hover .dm-pin { transform: scale(1.18); }
.dm-pulse { position: absolute; inset: -6px; border: 2px solid #dc2626; border-radius: 50%; pointer-events: none;
  animation: dmPulse 2.2s ease-out infinite; }
@keyframes dmPulse { 0% { transform: scale(.55); opacity: .85; } 100% { transform: scale(1.9); opacity: 0; } }
.dm-label { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); white-space: nowrap;
  font: 600 12px "Microsoft YaHei",sans-serif; color: #1e293b; text-shadow: 0 1px 2px #fff, 0 0 3px #fff;
  padding-top: 1px; }
.dm-district { background: none; border: none; }
.dm-district span { position: absolute; transform: translate(-50%, -50%); white-space: nowrap;
  font: 700 15px "Microsoft YaHei",sans-serif; color: #1d4ed8;
  text-shadow: 0 1px 3px #fff, 0 0 5px #fff, 0 0 8px #fff; pointer-events: none; }
.dm-focus.leaflet-interactive { pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .dm-pulse { animation: none; } }
/* 浅色底图与浅色 UI 同色调：不再压暗，仅轻微统一色温 */
.map-tint { position: absolute; inset: 0; z-index: 450; pointer-events: none;
  background: linear-gradient(180deg, rgba(37, 99, 235, .03), rgba(37, 99, 235, 0) 40%, rgba(30, 41, 59, .04)); }

/* 地图顶部信息条：让出两侧悬浮列位置 */
.map-topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 470;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 12px calc(340px + 26px) 12px calc(300px + 26px); pointer-events: none; }
.map-title { display: flex; flex-direction: column; gap: 3px; pointer-events: auto;
  background: rgba(255, 255, 255, .92); border: 1px solid var(--tw-border); border-radius: var(--radius-sm); padding: 7px 13px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: var(--shadow-sm); }
.map-title .mt-name { font-size: 13px; font-weight: 700; color: var(--tw-txt-1); }
.map-title .mt-sub { font-size: 10.5px; color: var(--tw-txt-3); }
.map-search { position: relative; pointer-events: auto; width: 268px; }
.map-search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px;
  fill: none; stroke: var(--tw-txt-3); stroke-width: 2; stroke-linecap: round; }
.map-search input { width: 100%; height: 36px; background: rgba(255, 255, 255, .95); border: 1px solid var(--tw-border);
  border-radius: var(--radius-sm); padding: 0 12px 0 34px; font-size: 12px; color: var(--tw-txt-1); outline: none;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: var(--shadow-sm); }
.map-search input::placeholder { color: var(--tw-txt-3); }
.map-search input:focus { border-color: var(--tw-accent); }
.search-pop { position: absolute; top: 42px; left: 0; right: 0; z-index: 480;
  background: #fff; border: 1px solid var(--tw-border); border-radius: var(--radius-sm); overflow: hidden;
  box-shadow: var(--shadow-lg); max-height: 300px; overflow-y: auto; }
.sp-row { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 9px 11px;
  background: transparent; color: var(--tw-txt-1); border-radius: 0; border-bottom: 1px solid var(--border); }
.sp-row:hover { background: var(--primary-soft); }
.sp-ico { flex: 0 0 auto; }
.sp-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.sp-main b { font-size: 12px; font-weight: 700; color: var(--tw-txt-1); }
.sp-main small { font-size: 10.5px; color: var(--tw-txt-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-st { font-size: 10.5px; font-weight: 600; }
.sp-empty { padding: 14px; text-align: center; color: var(--tw-txt-3); font-size: 12px; }

/* 图例：避开左侧悬浮列 */
.scene-legend { position: absolute; left: calc(300px + 26px); bottom: 14px; z-index: 460; display: flex; flex-direction: column;
  background: rgba(255, 255, 255, .93); border: 1px solid var(--tw-border); border-radius: var(--radius-sm); padding: 10px 12px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: var(--shadow-sm); }
.sl-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 11.5px; color: var(--tw-txt-2); }
.sl-ico { width: 22px; height: 22px; flex: 0 0 22px; display: flex; align-items: center; justify-content: center;
  border: 1px solid; border-radius: 8px; background: #fff; }
.sl-ico-alarm { color: var(--tw-danger); border-color: rgba(220, 38, 38, .45)!important; }
.sl-label { flex: 1; min-width: 68px; }
.sl-num { color: var(--tw-txt-1); font-weight: 700; font-variant-numeric: tabular-nums; }
.sl-sep { height: 1px; background: var(--tw-border); margin: 5px 0; }
.sl-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.sl-note { font-size: 10.5px; color: var(--tw-txt-3); margin-top: 4px; }
.scene-fallback { position: absolute; inset: 0; z-index: 490; display: none; align-items: center; justify-content: center;
  text-align: center; padding: 24px; color: #b91c1c; font-size: 14px; background: rgba(248, 250, 252, .96); }

/* 地图工具条 */
.map-tools { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 486; display: flex; gap: 4px;
  background: rgba(255, 255, 255, .95); border: 1px solid var(--tw-border); border-radius: 10px; padding: 4px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: var(--shadow-md); }
.map-tools button { display: flex; align-items: center; gap: 5px; background: transparent; color: var(--tw-txt-2);
  font-size: 11.5px; padding: 6px 11px; border-radius: 8px; white-space: nowrap; }
.map-tools button:hover { background: var(--primary-soft); color: var(--primary); }
.map-tools button.off { opacity: .4; }
.map-tools .gico { font-size: 14px; line-height: 1; color: var(--tw-accent); }

/* ---------- 设备档案浮层（底部居中紧凑卡，不遮挡地图与两侧面板）---------- */
.map-detail { position: absolute; left: 50%; right: auto; transform: translateX(-50%);
  bottom: 58px; z-index: 650; width: 540px; max-width: calc(100% - 28px);
  max-height: min(44vh, 360px); overflow-y: auto; overscroll-behavior: contain;
  background: rgba(255, 255, 255, .97); border: 1px solid var(--tw-border-strong); border-radius: var(--radius); padding: 11px 14px 12px;
  box-shadow: var(--shadow-lg); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.map-detail::-webkit-scrollbar { width: 5px; }
.map-detail::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.md-close { position: absolute; top: 9px; right: 11px; width: 24px; height: 24px; border-radius: 8px;
  background: var(--surface-2); color: var(--tw-txt-2); font-size: 17px; line-height: 1; border: 1px solid var(--border); }
.md-close:hover { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.md-head { display: flex; align-items: center; gap: 8px; padding-right: 22px; }
.md-icon { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); border: 1px solid var(--primary-border); border-radius: var(--radius-sm); }
.md-titles { flex: 1; min-width: 0; }
.md-id { font-size: 15px; font-weight: 800; color: var(--tw-txt-1); letter-spacing: .5px; }
.md-type { font-size: 10.5px; color: var(--tw-txt-2); margin-top: 1px; }
.md-status { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 16px; border: 1px solid; }
.md-body { display: flex; gap: 12px; margin-top: 9px; }
.md-info { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px 12px; }
.md-row { display: flex; justify-content: space-between; gap: 6px; padding: 3px 0;
  border-bottom: 1px dashed var(--tw-border); font-size: 11.5px; min-width: 0; }
.md-row.full { grid-column: 1 / -1; }
.md-row .rk { color: var(--tw-txt-3); flex: 0 0 auto; }
.md-row .rv { color: var(--tw-txt-1); text-align: right; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; max-width: 128px; }
.md-photos { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.md-photos img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; cursor: zoom-in;
  border: 1px solid var(--tw-border); transition: transform .15s; }
.md-photos img:hover { transform: scale(1.06); }
.md-photo-count { font-size: 11px; color: var(--tw-txt-3); }
.md-qr { flex: 0 0 118px; text-align: center; border-left: 1px solid var(--tw-border); padding-left: 11px; }
.qr-box { background: #fff; border-radius: 6px; padding: 4px; display: inline-block; border: 1px solid var(--border); }
.qr-box img { display: block; width: 92px; height: 92px; }
.qr-tip { font-size: 10px; color: var(--tw-txt-3); margin: 5px 0 6px; }
.md-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.md-actions .btn.sm { font-size: 10.5px; padding: 4px 6px; }

/* ---------- 报警滚动条（信息唯一入口）---------- */
.tv-alarm { position: absolute; inset: 0; z-index: 475; pointer-events: none; overflow: hidden; }
.tv-bar { position: absolute; top: 62px; left: 50%; transform: translateX(-50%); width: min(70%, 720px);
  height: 34px; display: flex; align-items: center; gap: 9px; padding: 0 8px 0 12px; pointer-events: auto;
  background: linear-gradient(90deg, #c22424, #dc2626 50%, #c22424);
  border: 1px solid rgba(185, 28, 28, .55); border-radius: 8px;
  box-shadow: var(--shadow-md); color: #fff; }
.tv-bar.flash { animation: tvFlash 1.1s ease-out; }
.tv-siren { flex: 0 0 auto; color: #ffd9d2; display: flex; }
.tv-tag { flex: 0 0 auto; font-size: 11px; font-weight: 800; letter-spacing: .5px; padding: 3px 9px; border-radius: 8px;
  background: rgba(255, 255, 255, .95); color: #b91c1c; white-space: nowrap; }
.tv-marquee { flex: 1; overflow: hidden; white-space: nowrap; }
.tv-text { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .3px; color: #fff4ec; will-change: transform;
  animation: tvMarquee 26s linear infinite; }
.tv-count { flex: 0 0 auto; font-size: 10.5px; opacity: .85; white-space: nowrap; }
.tv-mute { flex: 0 0 auto; width: 26px; height: 24px; border-radius: 8px; cursor: pointer; font-size: 15px;
  background: rgba(255, 255, 255, .16); color: #fff; }
.tv-mute.on { background: rgba(255, 255, 255, .34); }
@keyframes tvMarquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes tvFlash { 0%, 100% { box-shadow: var(--shadow-md); } 25% { box-shadow: 0 4px 20px rgba(220, 38, 38, .45); } }

/* ---------- 视频监控 ---------- */
.cam-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cam-cell { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
  background: var(--surface); cursor: pointer; padding: 0; text-align: left; font: inherit;
  transition: border-color .15s, box-shadow .15s; }
.cam-cell:hover { border-color: var(--primary); box-shadow: 0 2px 10px var(--primary-soft); }
.cam-view { position: relative; aspect-ratio: 16 / 9; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; color: var(--text-3);
  background: repeating-linear-gradient(135deg, #f4f6fa 0 10px, #eceff5 10px 20px); }
.cam-view svg { width: 22px; height: 22px; stroke: #94a3b8; }
.cam-view .st { font-size: 10px; letter-spacing: 1px; }
.cam-view .tm { position: absolute; right: 5px; bottom: 4px; font-size: 9px; color: #b6c1d1;
  font-variant-numeric: tabular-nums; }
.cam-cell.online .cam-view { background: #0f172a; color: #cbd5e1; }
.cam-cell.online .cam-view svg { stroke: #94a3b8; }
.cam-bar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-top: 1px solid var(--border); }
.cam-bar .dot { width: 7px; height: 7px; border-radius: 50%; background: #d97706; flex: 0 0 auto; }
.cam-cell.online .cam-bar .dot { background: #16a34a; animation: dotPulse 2.2s ease-out infinite; }
.cam-bar .nm { font-size: 11px; color: var(--text-2); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cam-bar .no { margin-left: auto; font-size: 10px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.cam-foot { margin-top: 8px; font-size: 10.5px; color: var(--text-3); line-height: 1.6; }

/* ---------- 工单指挥 ---------- */
.wo-scroll { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.wo-scroll::-webkit-scrollbar { width: 4px; }
.wo-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }
.wo-card { padding: 9px 11px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--tw-border); }
.wo-card:hover { border-color: var(--primary-border); }
.wo-top { display: flex; align-items: center; gap: 8px; }
.wo-id { font-weight: 700; font-size: 12px; color: var(--tw-txt-1); }
.wo-top .tag { margin-left: auto; }
.wo-meta { font-size: 11px; color: var(--tw-txt-2); margin-top: 4px; }
.wo-desc { font-size: 11px; color: var(--tw-txt-3); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wo-act { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* 工单状态机步骤条 */
.stepper { display: flex; align-items: center; margin: 9px 0 2px; }
.stepper .st { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 0 0 auto; }
.stepper .st .dot { width: 9px; height: 9px; border-radius: 50%; background: #e2e8f0; border: 1px solid var(--border-strong); }
.stepper .st.on .dot { background: var(--primary); border-color: var(--primary); }
.stepper .st.cur .dot { width: 12px; height: 12px; background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.stepper .st .lb { font-size: 9px; color: var(--tw-txt-3); white-space: nowrap; }
.stepper .st.on .lb, .stepper .st.cur .lb { color: var(--primary); }
.stepper .bar { flex: 1; height: 1px; background: var(--border-strong); margin: 0 2px; align-self: flex-start; margin-top: 5px; }
.stepper .bar.on { background: var(--primary); }

/* ---------- 异常设施台账 ---------- */
.feed-filter { display: flex; gap: 3px; }
.feed-filter button { font-size: 10px; padding: 3px 8px; border-radius: 12px; background: var(--surface-2);
  color: var(--tw-txt-3); border: 1px solid transparent; }
.feed-filter button.active { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-border); }
.feed { display: flex; flex-direction: column; gap: 6px; flex: 1; overflow-y: auto; min-height: 0; }
.feed::-webkit-scrollbar { width: 4px; }
.feed::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }
.feed-row { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 8px 9px;
  border-radius: 8px; background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--tw-txt-1); }
.feed-row:hover { background: #fde8e8; }
.fr-ico { flex: 0 0 auto; display: flex; }
.fr-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.fr-title { font-size: 11.5px; font-weight: 700; color: var(--tw-txt-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-meta { font-size: 10px; color: var(--tw-txt-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.fr-status { flex: 0 0 auto; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 12px;
  color: var(--danger); background: #fee2e2; }
.fr-status.warn { color: var(--warn); background: var(--warn-bg); }
.empty-state { padding: 20px; text-align: center; color: var(--tw-txt-3); font-size: 12px; }

/* IoT 泵站行（兼容） */
.iot-pump { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--tw-txt-2); }
.iot-pump i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 2px; }
.iot-pump b { color: var(--tw-txt-1); font-variant-numeric: tabular-nums; }

/* Leaflet 浮层提示（兼容） */
.twin-tip, .asset-tip { background: #fff; color: var(--text-1); border: 1px solid var(--border); border-radius: 10px;
  padding: 7px 10px; font-size: 12px; box-shadow: var(--shadow-md); }
.asset-tip { position: absolute; z-index: 500; display: none; pointer-events: none; }
.map-banner { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 900;
  padding: 8px 16px; border-radius: 10px; font-size: 12px; color: #fff; box-shadow: var(--shadow-md); max-width: 86%; text-align: center; }

/* ---------- 打印 ---------- */
.print-area { display: none; }
@media print {
  body * { visibility: hidden !important; }
  #printArea, #printArea * { visibility: visible !important; }
  #printArea { display: block !important; position: fixed; left: 0; top: 0; width: 100%; height: 100%;
    background: #fff; color: #000; padding: 24px; box-sizing: border-box; }
  .pq-card { max-width: 330px; margin: 20px auto; text-align: center; border: 2px solid #1c5fb0; border-radius: 16px; padding: 20px; }
  .pq-head { font-size: 18px; font-weight: 700; color: #1c5fb0; }
  .pq-id { font-size: 15px; margin: 8px 0; font-weight: 700; }
  .pq-qr img { width: 210px; height: 210px; }
  .pq-info { text-align: left; font-size: 12px; margin: 10px 0; line-height: 1.7; color: #222; }
  .pq-tip { font-size: 13px; color: #1c5fb0; font-weight: 700; }
  .pq-foot { font-size: 10px; color: #666; word-break: break-all; margin-top: 8px; }
}

/* =====================================================================
   业务端通用组件（管理/运维/防汛/考核/市民/采集页共用）
   ===================================================================== */
body { background: var(--bg); }

/* 应用顶栏 */
.appbar { height: 52px; display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.appbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, .5) 30%, rgba(34, 211, 238, .5) 70%, transparent);
  pointer-events: none; }
.appbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: var(--text-1); white-space: nowrap; }
.appbar .brand .mk { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #2f6fe8, #22d3ee); box-shadow: 0 0 10px rgba(34, 211, 238, .35); color: #fff; font-size: 14px; }
.appbar .brand small { font-size: 10px; color: var(--text-3); font-weight: 500; letter-spacing: .5px; }
.appbar .nav { display: flex; gap: 4px; margin-left: 10px; }
.appbar .nav a { color: var(--text-2); font-size: 13px; padding: 6px 13px; border-radius: var(--radius-sm); text-decoration: none; }
.appbar .nav a:hover { background: var(--surface-2); color: var(--text-1); }
.appbar .nav a.active { background: var(--primary); color: #fff; }
.appbar .spacer { flex: 1; }
.appbar .clock { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.appbar .who { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 10px; }
.appbar .role-chip { font-size: 11px; padding: 3px 9px; border-radius: 12px; background: var(--primary-soft);
  color: var(--primary); border: 1px solid var(--primary-border); }

/* 页面容器与标题 */
.page { padding: 18px 20px 30px; max-width: 1440px; margin: 0 auto; }
.page-hd { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.page-hd h2 { font-size: 20px; font-weight: 700; color: var(--text-1); letter-spacing: .3px; }
.page-hd .desc { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--text-1); margin: 18px 0 10px; }
.section-title::before { content: ''; width: 3px; height: 14px; border-radius: 2px; background: var(--primary); }

/* 统计卡 */
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
  position: relative; box-shadow: var(--shadow-sm); }
.stat-card .n { font-size: 28px; font-weight: 800; line-height: 1.05; color: var(--text-1); font-variant-numeric: tabular-nums; }
.stat-card .l { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.stat-card.primary .n { color: var(--primary); }
.stat-card.ok .n { color: var(--ok); }
.stat-card.warn .n { color: var(--warn); }
.stat-card.danger .n { color: var(--danger); }

/* 工具栏 / 筛选 */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input, .toolbar select { background: #fff; border: 1px solid var(--border-strong); color: var(--text-1);
  border-radius: var(--radius-sm); padding: 8px 11px; font-size: 13px; }
.toolbar .seg { display: flex; gap: 3px; background: var(--surface-2); padding: 3px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.toolbar .seg button { background: transparent; color: var(--text-2); font-size: 12px; padding: 5px 12px; border-radius: 8px; }
.toolbar .seg button.active { background: var(--primary); color: #fff; }
.toolbar .grow { flex: 1; }

/* 表格 */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { color: var(--text-2); font-weight: 600; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text-1); }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl .mono { font-variant-numeric: tabular-nums; font-family: Consolas, Monaco, monospace; }

/* 状态标签 */
.pill { display: inline-block; padding: 3px 10px; border-radius: 16px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.pill.ok { color: var(--ok); background: var(--ok-bg); }
.pill.warn { color: var(--warn); background: var(--warn-bg); }
.pill.danger { color: var(--danger); background: var(--danger-bg); }
.pill.info { color: var(--info); background: var(--info-bg); }
.pill.mute { color: var(--text-2); background: var(--surface-2); }

/* 空态 / 加载态 */
.blank { padding: 36px 20px; text-align: center; color: var(--text-3); font-size: 13px; }
.blank .big { font-size: 30px; opacity: .4; margin-bottom: 8px; }
.skeleton { background: linear-gradient(90deg, #eef2f7, #f7fafc, #eef2f7);
  background-size: 200% 100%; animation: skMove 1.2s linear infinite; border-radius: 8px; }
@keyframes skMove { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* 进度条 */
.pbar { height: 8px; border-radius: 8px; background: #e8edf4; overflow: hidden; }
.pbar > i { display: block; height: 100%; border-radius: 8px; background: var(--primary); }
.pbar.ok > i { background: #16a34a; }
.pbar.warn > i { background: #d97706; }

/* 详情/表单弹窗 */
/* .dlg 只做内容容器：视觉边框/内边距由外层 .modal .box 统一提供，杜绝双层宽度叠加 */
.dlg { width: 100%; max-width: 100%; box-sizing: border-box; overflow-wrap: anywhere; }
.dlg h2 { font-size: 17px; margin-bottom: 14px; color: var(--text-1); }
.dlg label { display: block; color: var(--text-2); font-size: 12px; margin: 12px 0 5px; }
.dlg .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
/* 长 URL / 长编号在弹窗内必须换行，不能撑破内容区 */
.modal .box .muted { overflow-wrap: anywhere; word-break: break-word; }
/* 弹窗内表格横向可滚动，不撑破弹窗 */
.modal .box table { max-width: 100%; }
.modal .box .tbl-wrap { overflow-x: auto; max-width: 100%; }

/* ===== 现场照片查看器 ===== */
.photo-viewer { text-align: left; }
.pv-main { background: rgba(15,23,42,.04); border-radius: 12px; padding: 10px; text-align: center; }
.pv-main img { display: block; max-width: 100%; max-height: 56vh; margin: 0 auto; border-radius: 8px; cursor: zoom-in; }
.pv-thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.pv-thumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 2px solid transparent; cursor: pointer; }
.pv-thumbs img.on { border-color: #2563eb; }
.photo-btn { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }

/* ===== 现场采集：外业照片墙 + 人员在岗 + 告警条 ===== */
.field-photos {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-bottom: 10px;
}
.fp-item {
  position: relative; margin: 0; border-radius: 10px; overflow: hidden;
  background: #e8eef6; aspect-ratio: 4 / 3; border: 1px solid rgba(37, 99, 235, .14);
}
.fp-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fp-item figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 3px 6px; font-size: 11px; color: #fff;
  background: linear-gradient(180deg, rgba(13, 27, 62, 0) 0%, rgba(13, 27, 62, .78) 100%);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fp-empty {
  grid-column: 1 / -1; padding: 18px 12px; border-radius: 10px;
  border: 1px dashed #b9c8de; color: #64748b; font-size: 12px; text-align: center;
  background: rgba(240, 246, 253, .5);
}
.field-live-list { display: flex; flex-direction: column; gap: 6px; }
.fl-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  border-radius: 9px; background: rgba(37, 99, 235, .05);
  border: 1px solid rgba(37, 99, 235, .12); font-size: 12.5px;
}
.fl-row.off { background: rgba(220, 38, 38, .05); border-color: rgba(220, 38, 38, .18); }
.fl-dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 6px rgba(22, 163, 74, .7); flex: none; }
.fl-row.off .fl-dot { background: #dc2626; box-shadow: 0 0 6px rgba(220, 38, 38, .7); }
.fl-name { font-weight: 600; color: #1e293b; flex: none; }
.fl-zone { color: #2563eb; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-when { color: #64748b; flex: none; font-size: 11.5px; }
.fl-empty { padding: 10px; border-radius: 9px; border: 1px dashed #b9c8de; color: #64748b; font-size: 12px; text-align: center; }
.field-alert-bar {
  margin-bottom: 10px; padding: 8px 11px; border-radius: 9px;
  background: rgba(220, 38, 38, .08); border: 1px solid rgba(220, 38, 38, .3);
  color: #b91c1c; font-size: 12.5px; line-height: 1.5;
  animation: fieldAlertPulse 2.4s ease-in-out infinite;
}
.field-alert-bar b { margin-right: 6px; }
@keyframes fieldAlertPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .18); }
  50% { box-shadow: 0 0 0 5px rgba(220, 38, 38, .10); }
}

/* ===== 管理端：外业人员监控面板 ===== */
.fld-alert-head {
  padding: 7px 12px; border-radius: 9px; font-size: 12.5px; font-weight: 600;
  background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; margin-bottom: 8px;
}
.fld-alert-head.ok { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.fld-alert {
  display: flex; align-items: baseline; gap: 10px; padding: 9px 12px; margin-bottom: 6px;
  border-radius: 9px; background: #fff; border: 1px solid #e2e8f0; font-size: 12.5px;
  border-left: 3px solid #dc2626;
}
.fld-alert.t-device_install, .fld-alert.t-device_update { border-left-color: #2563eb; }
.fld-alert.t-idle { border-left-color: #d97706; }
.fld-alert b { flex: none; color: #1e293b; }
.fld-alert span { flex: 1; color: #475569; min-width: 0; }
.fld-alert i { flex: none; font-style: normal; color: #94a3b8; font-size: 11.5px; }
.fld-person {
  position: relative; padding: 9px 12px 9px 14px; margin-bottom: 7px;
  border-radius: 10px; background: #fff; border: 1px solid #e2e8f0;
}
.fld-person.off { background: #fef2f2; border-color: #fecaca; }
.fld-person .fp-name { font-size: 13.5px; font-weight: 600; color: #1e293b; display: flex; align-items: center; gap: 8px; }
.fld-person .fp-zone { font-size: 11.5px; font-weight: 600; color: #2563eb; background: rgba(37, 99, 235, .08); padding: 1px 8px; border-radius: 999px; }
.fld-person .fp-meta { font-size: 11.5px; color: #64748b; margin-top: 4px; }
.fld-person .fp-badge {
  position: absolute; right: 10px; top: 10px; font-size: 10.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0;
}
.fld-person.off .fp-badge { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

/* ===== 采集记录删除审批（采集员申请 → 管理员确认）===== */
.del-req {
  background: #fff; border: 1px solid #f3d8ac; border-left: 3px solid #e8830c;
  border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
}
.del-req .dr-top { display: flex; align-items: center; gap: 8px; }
.del-req .dr-top b { font-size: 13.5px; color: #1e293b; }
.del-req .dr-id { font-size: 11.5px; color: #64748b; background: #f1f5f9; padding: 1px 7px; border-radius: 6px; font-family: Consolas, monospace; }
.del-req .dr-meta { font-size: 11.5px; color: #64748b; margin-top: 3px; }
.del-req .dr-who { color: #b45309; }
.del-req .dr-acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
