:root {
  --primary: #1d4ed8; --primary-dark: #1e3a8a;
  --danger: #dc2626; --warn: #f59e0b; --ok: #16a34a; --info: #2563eb;
  --bg: #f1f5f9; --card: #fff; --line: #e2e8f0; --muted: #64748b; --text: #0f172a;
  --dark: #0f172a;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
.hidden { display: none !important; }
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; }

/* ===== 轻提示 Toast（默认隐藏，.show 时淡入，2200ms 后自动淡出） ===== */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(16px);
  max-width: 86vw; padding: 10px 18px; background: rgba(15, 23, 42, .92); color: #fff;
  font-size: 13px; line-height: 1.5; border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
  opacity: 0; visibility: hidden; pointer-events: none; z-index: 10000;
  transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
}
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* ===== 登录 ===== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #1d4ed8 100%); padding: 20px; }
.login-card { width: 360px; max-width: 92vw; background: #fff; border-radius: 16px; padding: 36px 30px;
  text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-card .logo { font-size: 42px; }
.login-card h1 { font-size: 20px; margin: 10px 0 4px; color: var(--dark); }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.login-card input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; margin-bottom: 14px; outline: none; }
.login-card input:focus { border-color: var(--primary); }
.login-card .err { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ===== 布局 ===== */
.app { display: flex; flex-direction: column; min-height: 100vh; }
.topbar { display: flex; align-items: center; gap: 16px; color: #fff;
  background: linear-gradient(90deg, #16273f 0%, #1e3a5c 50%, #16273f 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 2px 8px rgba(10,20,35,.25);
  padding: 0 16px; height: 42px; position: sticky; top: 0; z-index: 50; }
.topbar .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; white-space: nowrap; }
.topbar .brand .logo { font-size: 22px; }
.topbar .nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.topbar .nav::-webkit-scrollbar { display: none; }
.nav a { color: #f8fafc; padding: 6px 12px; border-radius: 8px; font-size: 15px; font-weight: 600; letter-spacing: .5px; white-space: nowrap; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.14); }
.nav a.on { color: #fff; background: var(--primary); font-weight: 700; }
.air-badge { flex: none; display: inline-flex; align-items: baseline; gap: 4px; padding: 0 12px; font-size: 14px; font-weight: 700; letter-spacing: .5px; white-space: nowrap; }
.air-badge .air-label { color: #fff; }
.air-badge .air-num { color: #ff4d4f; }
.userbox { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.role-badge { font-size: 12px; padding: 3px 9px; border-radius: 20px; background: rgba(255,255,255,.15); }
.uname { font-size: 13px; color: #e2e8f0; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { background: none; border: none; color: #fff; font-size: 18px; cursor: pointer; padding: 6px; border-radius: 8px; }
.icon-btn:hover { background: rgba(255,255,255,.12); }
.view { flex: 1; padding: 14px; width: 100%; }
.view.full { padding: 0; }

/* ===== 卡片 ===== */
.card { background: var(--card); border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 16px; margin-bottom: 14px; }
.card .hdr { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card .hdr h3 { font-size: 15px; }
.card .hdr .sub { color: var(--muted); font-size: 12px; }
.hdr .sp { margin-left: auto; }

/* ===== 按钮 ===== */
.btn { border: 1px solid transparent; border-radius: 9px; padding: 8px 14px; font-size: 13px; cursor: pointer;
  transition: .15s; display: inline-flex; align-items: center; gap: 5px; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: #1e40af; }
.btn.direct { background: #0d9488; color: #fff; }
.btn.direct:hover { background: #0f766e; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #b91c1c; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--text); }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn.outline { background: #fff; border-color: var(--primary); color: var(--primary); }
.btn.block { width: 100%; justify-content: center; font-size: 15px; padding: 12px; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.xs { padding: 3px 8px; font-size: 11px; border-radius: 6px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ===== 表格 ===== */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #f8fafc; color: var(--muted); font-weight: 600; position: sticky; top: 0; }
tbody tr:hover { background: #f8fafc; }
.table-wrap { overflow: auto; max-height: 420px; border-radius: 8px; }
/* 表格美化：仅保留表头底色（奇偶列交替底色已按需求去掉） */
.zebra { border-collapse: collapse; width: 100%; }
.zebra th { background: #e2eaf3; color: #334155; font-weight: 700; }
.zebra td, .zebra th { padding: 8px 10px; border-bottom: 1px solid #eef2f7; white-space: nowrap; }
.zebra tbody tr:hover td { background: #e8f0f8 !important; }
.geo { display: inline-block; max-width: 220px; white-space: normal; word-break: break-all; overflow-wrap: anywhere; line-height: 1.4; vertical-align: middle; }
.pager { display: flex; align-items: center; gap: 8px; margin-top: 10px; justify-content: flex-end; font-size: 13px; color: var(--muted); }
.pager button { border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 4px 11px; cursor: pointer; font-size: 12px; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* ===== 标签 ===== */
.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 20px; font-weight: 600; }
.tag.red { background: #fee2e2; color: #b91c1c; }
.tag.blue { background: #dbeafe; color: #1d4ed8; }
.tag.green { background: #dcfce7; color: #15803d; }
.tag.gray { background: #e5e7eb; color: #4b5563; }
.tag.orange { background: #ffedd5; color: #c2410c; }
.tag.white { background: #cffafe; color: #0e7490; }
.tag.black { background: #111827; color: #fff; }
.tag.whitelist { background: #0891b2; color: #fff; }
.tag.outline { background: #fff; border: 1px solid var(--line); color: var(--muted); }

/* ===== 实时探测 ===== */
.statsbar { display: flex; gap: 10px; flex-wrap: wrap; }
.statsbar .cell { flex: 1; min-width: 90px; background: var(--bg); border-radius: 10px; padding: 10px 14px; }
.statsbar .cell .n { font-size: 22px; font-weight: 700; }
.statsbar .cell .l { font-size: 12px; color: var(--muted); }
.statsbar .cell.red .n { color: var(--danger); } .statsbar .cell.blue .n { color: var(--info); }
.statsbar .cell.green .n { color: var(--ok); } .statsbar .cell.gray .n { color: #6b7280; }
.rt-page { display: flex; flex-direction: column; height: calc(100vh - 56px); gap: 0; padding: 0; }
.rt-stats { flex: 0 0 auto; background: var(--card); border-radius: 12px; padding: 10px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.stats-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.stats-head .t { font-size: 13px; font-weight: 700; color: var(--text); }
.rt-stats.collapsed .statsbar { display: none; }
.rt-stats.collapsed { padding: 8px 14px; }
.rt-wrap { flex: 1; display: flex; gap: 0; min-height: 0; }
.rt-map { flex: 1; min-width: 0; position: relative; display: flex; }
.mapbox { flex: 1; height: auto; min-height: 0; border-radius: 0; overflow: hidden; position: relative; }
.rt-side { width: 340px; max-width: 100%; display: flex; flex-direction: column; min-height: 0; transition: width .18s ease; }
.rt-side.collapsed { width: 0; overflow: hidden; min-height: 0; }
.rt-side-card { flex: 1; display: flex; flex-direction: column; min-height: 0; margin-bottom: 0; border-radius: 0; box-shadow: none; border-left: 1px solid var(--line); }
.side-toggle { position: absolute; right: 0; top: 50%; transform: translateY(-50%); z-index: 11; width: 18px; height: 56px;
  border: 1px solid var(--line); border-right: none; background: #fff; border-radius: 6px 0 0 6px; cursor: pointer;
  font-size: 12px; line-height: 1; color: #64748b; padding: 0; box-shadow: -1px 0 4px rgba(0,0,0,.12); }
.side-toggle:hover { background: var(--primary); color: #fff; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; position: absolute; left: 10px; bottom: 10px; z-index: 10;
  background: rgba(255,255,255,.92); border-radius: 8px; padding: 6px 10px; font-size: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.layerswitch { position: absolute; right: 10px; top: 10px; z-index: 10; background: #fff; border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.2); overflow: hidden; display: flex; }
.layerswitch button { border: none; background: #fff; padding: 8px 12px; cursor: pointer; font-size: 12px; }
.layerswitch button.on { background: var(--primary); color: #fff; }
.maptools { position: absolute; right: 10px; bottom: 10px; z-index: 10; background: #fff; border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.2); overflow: hidden; display: flex; }
.maptools button { border: none; background: #fff; padding: 8px 12px; cursor: pointer; font-size: 12px; }
.maptools button.on { background: var(--primary); color: #fff; }
.tools { position: absolute; right: 10px; top: 10px; z-index: 10; background: #fff; border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.2); overflow: visible; display: flex; align-items: center; }
.tools button { border: none; background: #fff; padding: 8px 12px; cursor: pointer; font-size: 12px; }
.tools button.on { background: var(--primary); color: #fff; }
.tools > button:first-child { border-radius: 8px 0 0 8px; }
/* 地名搜索框 */
.search-wrap { position: relative; display: flex; align-items: center; background: #fff; border-radius: 0 8px 8px 0; }
.search-wrap button { padding: 6px 8px; border-radius: 6px; }
.search-wrap button:hover { background: #f1f5f9; }
.search-panel { display: none; position: absolute; top: calc(100% + 4px); right: 0; width: 264px; max-width: calc(100vw - 24px); background: #fff; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.2); padding: 8px; z-index: 120; text-align: left; }
.search-panel.show { display: block; }
.search-row { display: flex; gap: 6px; align-items: center; }
.search-row input { flex: 1; min-width: 0; border: 1px solid #e2e8f0; outline: none; font-size: 13px; padding: 6px 8px; border-radius: 6px; }
.search-row input:focus { border-color: var(--primary); }
.search-row button { border: none; background: #f1f5f9; padding: 6px 10px; cursor: pointer; font-size: 13px; }
.search-row button:hover { background: #e2e8f0; }
.search-results { width: 100%; max-height: 280px; overflow: auto; margin-top: 6px; display: none; }
.search-results.show { display: block; }
.sr-item { padding: 8px 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.sr-item:hover { background: #f1f5f9; }
.sr-item:last-child { border-bottom: none; }
.sr-item .nm { font-weight: 600; color: #1f2937; font-size: 13px; }
.sr-item .n { display: inline-block; min-width: 16px; text-align: center; color: #fff; background: var(--primary); border-radius: 4px; font-size: 11px; margin-right: 6px; padding: 0 2px; line-height: 16px; }
.sr-item .ad { color: var(--muted); font-size: 11px; margin-top: 2px; }
.sr-empty { padding: 12px 10px; color: var(--muted); font-size: 12px; }
.sr-foot { padding: 6px; border-top: 1px solid var(--line); }
.sr-clear { width: 100%; border: none; background: #f1f5f9; color: #64748b; padding: 6px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.sr-clear:hover { background: #e2e8f0; color: #334155; }
.measure-lbl { background: #2563eb; color: #fff; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 4px;
  white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
/* 遥控器图标 */
.rc-ic { color: #f97316; width: 30px; height: 30px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.3)); }
.rc-ic svg { width: 30px; height: 30px; }
.target-list { flex: 1; overflow: auto; min-height: 0; }
.target-item { padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 6px; cursor: pointer; }
.target-item:hover { border-color: var(--primary); }
.target-item.black { border-color: #dc2626; background: #fef2f2; }
.target-item.black:hover { border-color: #b91c1c; }
.target-item.whitelist { border-color: #0891b2; background: #ecfeff; }
.target-item.whitelist:hover { border-color: #0e7490; }
.target-item .row { display: flex; align-items: center; gap: 8px; }
.target-item .row2 { display: flex; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 5px; flex-wrap: wrap; }

/* ===== 地图标记 ===== */
.mk { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center; font-size: 15px; cursor: pointer; color: #fff; font-weight: 700; }
.mk-red { background: #ef4444; } .mk-blue { background: #2563eb; } .mk-green { background: #16a34a; }
.mk-gray { background: #9ca3af; } .mk-orange { background: #f97316; } .mk-dev { background: #334155; } .mk-white { background: #0891b2; }
.mk.off { opacity: .45; filter: grayscale(1); }
.mk-wrap { position: relative; }
.mk-lbl { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 400; color: #475569; background: rgba(255,255,255,.72); padding: 0 4px; border-radius: 3px;
  border: 1px solid rgba(100,116,139,.18); white-space: nowrap; margin-bottom: 3px; line-height: 1.5; letter-spacing: .3px; }
.mk-lbl .st { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-left: 4px; vertical-align: middle; }
.mk-lbl .st.on { background: #22c55e; } .mk-lbl .st.off { background: #94a3b8; }

/* =====侦测设备图标（方案2 · 信号塔，统一绿色） ===== */
.dev-tower { color: #3b82f6; }
.dev-tower svg { overflow: visible; }
.dev-tower .wave { stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; opacity: 0; }
.dev-tower .w1 { animation: dev-twave 2.2s ease-out infinite; }
.dev-tower .w2 { animation: dev-twave 2.2s ease-out infinite .55s; }
.dev-tower .w3 { animation: dev-twave 2.2s ease-out infinite 1.1s; }
.dev-tower .bulb { fill: currentColor; animation: dev-tblink 1.4s ease-in-out infinite; }
.dev-tower .body { fill: currentColor; }
.dev-tower.off { opacity: .5; filter: grayscale(1); }
.dev-tower.off .bulb { animation: none; }
@keyframes dev-twave { 0% { opacity: 0; transform: scale(.4); } 30% { opacity: .9; } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes dev-tblink { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* 车载设备（警车）图标 */
.dev-car { display: inline-block; }
.dev-car svg { display: block; }
.dev-car .car-body { fill: currentColor; }
.dev-car .car-wheel { fill: #1f2937; stroke: currentColor; stroke-width: 1.1; }
.dev-car .car-flash { fill: #ef4444; animation: dev-carflash .7s steps(2, start) infinite; }
.dev-car.off .car-flash { animation: none; }
@keyframes dev-carflash { 0%,100% { fill: #ef4444; } 50% { fill: #3b82f6; } }

/* 多旋翼无人机图标（半透明旋翼，醒目不遮挡） */
.drone-ic { width: 34px; height: 34px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.3)); }
.drone-ic svg { width: 34px; height: 34px; }
.drone-ic.red { color: #dc2626; } .drone-ic.blue { color: #2563eb; } .drone-ic.green { color: #16a34a; } .drone-ic.gray { color: #9ca3af; } .drone-ic.white { color: #0891b2; }

/* 实时目标计数徽章（着重显示） */
.count-badge { background: #dc2626; color: #fff; font-size: 20px; font-weight: 800; line-height: 1;
  padding: 6px 10px; border-radius: 10px; min-width: 30px; text-align: center; }

/* 实时目标列表项 */
.target-item .tag { font-size: 10px; padding: 1px 6px; }
.target-item .ti-top { display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; }
.target-item .ti-top b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 96px; }
.target-item .ti-mid { display: flex; gap: 8px; font-size: 11px; color: var(--muted); margin-top: 4px; flex-wrap: nowrap; }
.target-item .ti-mid span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.target-item .ti-mid span:first-child { flex-shrink: 0; }
.target-item .white-alias { color: #16a34a; font-weight: 600; }
.target-item .ti-btns { display: flex; gap: 5px; margin-top: 6px; }
.target-item .h-badge { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.target-item .h-badge .h-max { font-size: 10px; color: var(--muted); font-weight: 600; margin-left: 2px; }
/* 累计侦测次数（单独一行） */
.target-item .ti-visit { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); margin-top: 3px; }
.target-item .ti-visit .alias { color: #334155; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.target-item .ti-visit b { color: var(--primary); font-weight: 700; }
.target-item .ti-visit .ti-real { color: #059669; font-weight: 600; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
/* 侧栏收起按钮：桌面隐藏，仅移动端显示在“实时目标”数字旁 */
.side-collapse { display: none; }
.mini-btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 3px 9px; font-size: 12px; cursor: pointer; }
.mini-btn:hover { border-color: var(--primary); }
.mini-btn.drone { color: #dc2626; } .mini-btn.rc { color: #f97316; } .mini-btn.detail { color: var(--primary); font-weight: 600; }

/* 黑白名单左右并列 */
.bw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .bw-grid { grid-template-columns: 1fr; } }

/* 事件警情全屏 */
.ev-card { display: flex; flex-direction: column; height: calc(100vh - 84px); margin-bottom: 0; }
@media (max-width: 900px) { .ev-card { height: calc(100vh - 150px); } }

/* ===== 表单 ===== */
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.case-filter { display: flex; align-items: flex-end; gap: 6px; flex-wrap: wrap; padding: 10px; background: #eef2f7; border: 1px solid var(--line); border-radius: 10px; }
.case-search-card { padding: 0; background: transparent; box-shadow: none; border-radius: 0; margin-bottom: 10px; }
.case-table-card { padding: 0; margin-bottom: 0; }
.view.flexcol { display: flex; flex-direction: column; }
.view.flexcol .case-search-card { flex: 0 0 auto; }
.view.flexcol .case-table-card { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.view.flexcol .case-table-card .table-wrap { flex: 1; min-height: 0; max-height: none; overflow: hidden; }
.case-filter .cf { display: flex; flex-direction: column; }
.case-filter .cf label { font-size: 12px; font-weight: 700; color: #1f2937; margin-bottom: 4px; white-space: nowrap; }
.case-filter .cf input, .case-filter .cf select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; outline: none; background: #fff; transition: border-color .15s, box-shadow .15s; }
.case-filter .cf input:focus, .case-filter .cf select:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,.12); }
.case-filter .cf-btns { display: flex; gap: 6px; padding-bottom: 1px; }
.case-filter .cf-btns .btn { white-space: nowrap; }

/* ===== 空情处置：移动端友好（不影响 PC） ===== */
@media (max-width: 900px) {
  .case-filter .cf { flex: 1 1 calc(50% - 3px) !important; min-width: 0; }
  .case-filter .cf input, .case-filter .cf select { width: 100%; box-sizing: border-box; font-size: 16px; padding: 9px 8px; }
  .case-filter .cf-btns { flex: 1 1 100% !important; }
  .case-filter .cf-btns .btn { flex: 1; padding: 10px 8px; }
  .view.flexcol .case-table-card .table-wrap { overflow: auto; -webkit-overflow-scrolling: touch; }
  .case-table-card table { min-width: 840px; }
  .case-table-card th, .case-table-card td { padding: 11px 12px; }
  .pager button { padding: 9px 15px; font-size: 14px; }
}
.date-wrap { display: flex; align-items: center; gap: 5px; }
.date-wrap input { flex: 1; min-width: 0; }
.date-wrap input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .7; }
.over-tag { display: inline-block; font-size: 12px; line-height: 1.3; color: #dc2626; font-weight: 700; white-space: nowrap; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; outline: none; font-family: inherit; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }
.range2 { display: flex; align-items: center; gap: 6px; }
.range2 input { width: 50%; }
.chiprow { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.field.btns { display: flex; align-items: flex-end; }
.btngroup { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.btngroup .btn { white-space: nowrap; }

/* ===== 弹窗 ===== */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 100; display: flex;
  align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: 14px; width: 560px; max-width: 96vw; max-height: 88vh; display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 700; }
.modal-head .close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--muted); }
.modal-body { padding: 16px 18px; overflow: auto; }
.locblock { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.locblock.red { border-color: #fecaca; background: #fef2f2; }
.locblock.orange { border-color: #fed7aa; background: #fff7ed; }
.locblock .lhead { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 6px; }
.locrow { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 5px 0; flex-wrap: wrap; }
.locrow .lbl { color: var(--muted); flex: 0 0 auto; }
.navchips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.navchips a { font-size: 12px; padding: 4px 10px; border: 1px solid var(--primary); border-radius: 6px; color: var(--primary); }
.dl { display: grid; grid-template-columns: 90px 1fr; row-gap: 6px; font-size: 13px; }
.dl .k { color: var(--muted); }
.copybtn { font-size: 11px; padding: 2px 7px; border: 1px solid var(--line); background: #fff; border-radius: 5px; cursor: pointer; color: var(--primary); }
.copybtn:hover { border-color: var(--primary); }
.bj-dist { color: #dc2626; font-weight: 700; }
.hsr-dist { color: #ea580c; font-weight: 700; }
.warn-tag { color: #dc2626; font-weight: 700; font-size: 12px; }
.pb-warn { color: #dc2626; font-weight: 700; }
.section-title { font-weight: 700; font-size: 14px; margin: 14px 0 8px; padding-left: 8px; border-left: 3px solid var(--primary); }

/* ===== 回放 ===== */
.playbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.pb-btn { width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--primary); color: #fff;
  font-size: 16px; cursor: pointer; }
.pb-btn.stop { background: var(--warn); }
.speed button { border: 1px solid var(--line); background: #fff; padding: 4px 9px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.speed button.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.playbar input[type=range] { flex: 1; min-width: 120px; }
.playmap { position: relative; }
.pb-alt { position: absolute; top: 10px; left: 10px; z-index: 10; background: rgba(15,23,42,.78); color: #fff;
  border-radius: 8px; padding: 6px 12px; font-size: 12px; line-height: 1.5; pointer-events: none; }
.pb-modal-map { height: 340px; border-radius: 12px; overflow: hidden; position: relative; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* ===== 轨迹回放整页 ===== */
.pb-page { display: flex; flex-direction: column; height: calc(100vh - 56px); gap: 10px; padding: 12px; }
.pb-head { background: var(--card); border-radius: 12px; padding: 12px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.pb-title { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.pb-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.pb-meta .pb-maxalt { color: var(--danger); font-weight: 700; }
.pb-real { width: 100%; font-size: 12px; color: var(--muted); }
.pb-map-wrap { flex: 1; min-height: 0; position: relative; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.pb-map-wrap #pbMap { width: 100%; height: 100%; }
.pb-controls { background: var(--card); border-radius: 12px; padding: 10px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.pb-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.pb-org { color: var(--primary); font-weight: 600; }
.pb-flow-panel { flex: 0 0 auto; max-height: 32vh; overflow-y: auto; background: var(--card); border-radius: 12px; padding: 10px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.pb-flow-title { font-weight: 700; font-size: 13px; margin-bottom: 8px; color: var(--text); }
.flow-item { display: flex; gap: 10px; padding: 7px 0; }
.flow-item + .flow-item { border-top: 1px dashed var(--line); }
.flow-ic { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; background: #eff6ff; }
.flow-bd { flex: 1; min-width: 0; }
.flow-t { font-size: 13px; color: var(--text); overflow-wrap: break-word; }
.flow-m { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ===== AI ===== */
.ai-box { border: 1px dashed var(--primary); border-radius: 10px; padding: 14px; background: #eff6ff; white-space: pre-wrap;
  font-size: 13px; line-height: 1.7; min-height: 80px; }
.ai-ask { display: flex; gap: 8px; margin-top: 10px; }
.ai-ask input { flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; outline: none; }

/* ===== 后台 ===== */
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.admin-tabs button { border: 1px solid var(--line); background: #fff; padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.admin-tabs button.on { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== 底部导航（移动端） ===== */
.bottomnav { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: linear-gradient(90deg, #16273f 0%, #1e3a5c 50%, #16273f 100%); }
.bottomnav a { flex: 1; color: #94a3b8; text-align: center; padding: 8px 2px; font-size: 11px; display: flex;
  flex-direction: column; gap: 2px; align-items: center; }
.bottomnav a .ic { font-size: 18px; }
.bottomnav a.on { color: #fff; }

/* ===== 空状态 ===== */
.empty { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 13px; }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .rt-page { height: calc(100vh - 66px); padding: 0; gap: 0; }
  .rt-wrap { flex-direction: column; gap: 0; }
  .rt-map { flex: 1; min-height: 0; }
  .mapbox { flex: 1; height: auto; min-height: 0; border-radius: 0; }
  .rt-side { width: 100%; flex: 0 0 auto; max-height: 46vh; }
  .rt-side.collapsed { width: 100%; }
  .rt-side.collapsed .target-list { display: none; }
  .rt-side-card { flex: 1; min-height: 0; border-radius: 0; box-shadow: none; border-left: none; border-top: 1px solid var(--line); }
  .side-toggle { display: none; }
  .side-collapse { display: inline-flex; align-items: center; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 3px 8px; font-size: 11px; cursor: pointer; color: var(--muted); }
  .target-list { max-height: 46vh; }
  .topbar { display: none; }
  .topbar .nav { display: none; }
  .topbar .name { display: none; }
  .bottomnav { display: flex; }
  .bottomnav a { font-size: 10px; padding: 7px 2px; }
  .bottomnav a .ic { font-size: 20px; }
  .view { padding: 10px 10px 66px; }
  .view.full { padding: 0 0 66px; }
  .uname { max-width: 70px; }
  .dl { grid-template-columns: 76px 1fr; }
  /* 更友好的移动端操作 */
  .btn { padding: 10px 15px; }
  .btn.sm { padding: 8px 13px; font-size: 13px; }
  .btn.xs { padding: 7px 11px; font-size: 12px; }
  .mini-btn { padding: 6px 12px; font-size: 13px; }
  .field input, .field select { padding: 11px 10px; font-size: 15px; }
  .card { padding: 12px; }
  /* 弹窗全屏 */
  .modal-mask { padding: 0; }
  .modal { width: 100%; max-width: 100%; height: 100vh; max-height: 100vh; border-radius: 0; }
  .modal-body { flex: 1; }
  /* 轨迹回放整页适配 */
  .pb-page { height: calc(100vh - 50px); padding: 8px; gap: 8px; }
  .pb-head { padding: 10px; gap: 6px 10px; }
  .pb-map-wrap { min-height: 260px; }
  .playbar { gap: 6px; }
  .speed button { padding: 6px 10px; }
}
@media (max-width: 560px) {
  .filter-grid { grid-template-columns: 1fr; }
  .admin-tabs button { padding: 9px 12px; }
  .table-wrap { max-height: 55vh; }
}

/* ===== 数据提取·AI 模块 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat-grid .stat { background: var(--card); border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 14px 16px; }
.stat-grid .stat .n { font-size: 24px; font-weight: 700; color: var(--primary); }
.stat-grid .stat .l { font-size: 12px; color: var(--muted); margin-top: 4px; }

.bar-list { display: flex; flex-direction: column; gap: 8px; }
.bar-item { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.bar-item .bn { flex: 0 0 140px; text-align: right; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-item .bar { flex: 1; background: var(--bg); border-radius: 6px; height: 14px; overflow: hidden; }
.bar-item .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #60a5fa); border-radius: 6px; }
.bar-item .bc { flex: 0 0 40px; color: var(--muted); }

.mining-map { height: 380px; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 10px; }

.ai-box.md { white-space: normal; text-align: left; }
.ai-box.md .md-h { margin: 12px 0 6px; color: var(--text); }
.ai-box.md h1 { font-size: 18px; }
.ai-box.md h2 { font-size: 16px; }
.ai-box.md h3 { font-size: 14px; }
.ai-box.md p { margin: 6px 0; }
.ai-box.md .md-li { margin: 3px 0 3px 4px; }
.ai-box.md table.md-table { border-collapse: collapse; width: 100%; margin: 8px 0; }
.ai-box.md table.md-table td { border: 1px solid var(--line); padding: 6px 8px; font-size: 12px; }
.ai-box.md code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

@media (max-width: 560px) {
  .mining-map { height: 280px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .bar-item .bn { flex-basis: 96px; }
}

/* 数据提取·AI 紧凑操作栏 */
.mining-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mining-bar label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.mining-bar select, .mining-bar input[type="datetime-local"], .mining-bar input[type="text"], .mining-bar input[type="number"] {
  padding: 5px 6px; font-size: 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text);
}
.mining-bar input[type="datetime-local"] { width: 168px; }
.mining-bar select { max-width: 108px; }
.mining-bar input[type="file"] { font-size: 11px; max-width: 180px; }
.clickable { cursor: pointer; }
.clickable:hover td { background: var(--bg); }

/* 数据提取·AI 全屏布局（点位分布大屏地图） */
.mining-page { display: flex; flex-direction: column; height: calc(100vh - 42px); }
.mining-tabs { flex: 0 0 auto; display: flex; gap: 4px; padding: 6px 10px; background: var(--card);
  box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow-x: auto; scrollbar-width: none; }
.mining-tabs::-webkit-scrollbar { display: none; }
.mining-tabs button { border: 1px solid var(--line); background: #fff; padding: 4px 11px; border-radius: 7px;
  cursor: pointer; font-size: 12px; white-space: nowrap; }
.mining-tabs button.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.mining-body { flex: 1; min-height: 0; overflow: auto; padding: 10px; }
.mining-body.points { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
/* 点位分布：操作栏 + 全屏地图 */
.points-bar { flex: 0 0 auto; padding: 6px 10px; background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.points-map { flex: 1; min-height: 0; height: auto; position: relative; }
.points-map .mining-mapbox { width: 100%; height: 100%; }

@media (max-width: 900px) {
  .mining-page { height: calc(100vh - 66px); }
  .mining-body { padding: 8px; }
  .points-bar { padding: 5px 8px; }
}

/* ===== 态势总览·大屏（深色科技风） ===== */
.mining-body.dash { padding: 0; overflow: auto; background: #050b1e; }
.dash {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 2000;
  display: flex; flex-direction: column; overflow: hidden;
  color: #dbeafe; padding: 10px 14px 10px; animation: dashIn .5s ease;
  background:
    radial-gradient(1200px 520px at 12% -10%, rgba(34,211,238,.14), transparent 60%),
    radial-gradient(1000px 520px at 88% 0%, rgba(59,130,246,.14), transparent 60%),
    linear-gradient(rgba(34,211,238,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34,211,238,.035) 1px, transparent 1px),
    #050b1e;
  background-size: auto, auto, 42px 42px, 42px 42px, auto;
}
.dash::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(640px 440px at 18% 6%, rgba(34,211,238,.16), transparent 60%),
    radial-gradient(720px 520px at 84% 94%, rgba(59,130,246,.16), transparent 60%);
  animation: dashAurora 9s ease-in-out infinite;
}
.dash::after {
  content: ''; position: fixed; left: 0; right: 0; top: -160px; height: 160px; z-index: 999; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(34,211,238,.09), transparent);
  animation: dashScan 7s linear infinite;
}
@keyframes dashIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes dashAurora { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@keyframes dashScan { 0% { transform: translateY(0); } 100% { transform: translateY(calc(100vh + 160px)); } }
.dash-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.dash-title { display: flex; align-items: center; gap: 14px; }
.dash-logo { font-size: 32px; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
  border-radius: 14px; background: linear-gradient(135deg, rgba(34,211,238,.18), rgba(59,130,246,.18));
  border: 1px solid rgba(34,211,238,.4); box-shadow: 0 0 20px rgba(34,211,238,.25); }
.dash-title h1 { font-size: 22px; font-weight: 800; letter-spacing: 1px;
  background: linear-gradient(90deg, #e0f2fe, #7dd3fc, #22d3ee);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.dash-title p { font-size: 10px; letter-spacing: 3px; color: #5b7aa8; margin-top: 3px; }
.dash-head-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dash-exit { margin-left: 4px; font-size: 12px; color: #fca5a5; background: rgba(244,63,94,.12);
  border: 1px solid rgba(244,63,94,.4); border-radius: 8px; padding: 6px 12px; cursor: pointer; transition: all .2s; }
.dash-exit:hover { background: rgba(244,63,94,.25); color: #fff; box-shadow: 0 0 14px rgba(244,63,94,.5); }
.dash-stat-chip { font-size: 12px; color: #8fb0d8; border: 1px solid rgba(34,211,238,.25); border-radius: 8px; padding: 5px 10px; background: rgba(13,34,66,.6); }
.dash-stat-chip b { color: #22d3ee; font-variant-numeric: tabular-nums; }
.dash-stat-chip b.red { color: #f87171; } .dash-stat-chip b.cyan { color: #22d3ee; }
.dash-stat-chip i { font-style: normal; color: #5b7aa8; }
.dash-clock { font-size: 15px; font-weight: 700; color: #e0f2fe; letter-spacing: 1px; font-variant-numeric: tabular-nums; }

.dash-kpis { flex: 0 0 auto; display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; margin-bottom: 8px; }
.kpi { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 5px 10px 6px 12px; border-radius: 10px;
  background: linear-gradient(160deg, rgba(17,38,74,.85), rgba(9,20,44,.85));
  border: 1px solid rgba(56,130,246,.25); overflow: hidden; }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, #22d3ee, #3b82f6); box-shadow: 0 0 12px rgba(34,211,238,.6); }
.kpi.warn::before { background: linear-gradient(180deg, #f59e0b, #f97316); box-shadow: 0 0 12px rgba(245,158,11,.6); }
.kpi.danger::before { background: linear-gradient(180deg, #f43f5e, #fb7185); box-shadow: 0 0 12px rgba(244,63,94,.6); }
.kpi-ic { font-size: 20px; opacity: .9; }
.kpi b.num { font-size: 19px; font-weight: 800; line-height: 1; color: #e0f2fe;
  font-variant-numeric: tabular-nums; text-shadow: 0 0 14px rgba(34,211,238,.4); animation: dashGlow 3s ease-in-out infinite; }
.kpi span { font-size: 10px; color: #8fb0d8; margin-top: 1px; display: flex; align-items: baseline; gap: 3px; white-space: nowrap; overflow: hidden; }
.kpi em { font-style: normal; font-size: 9px; }
.kpi em.up { color: #f87171; } .kpi em.down { color: #34d399; } .kpi em.flat { color: #64748b; }
@keyframes dashGlow { 0%, 100% { text-shadow: 0 0 10px rgba(34,211,238,.35); } 50% { text-shadow: 0 0 22px rgba(34,211,238,.75); } }
.kpi-body em { font-style: normal; font-size: 11px; margin-top: 2px; }
.kpi-body em.up { color: #f87171; } .kpi-body em.down { color: #34d399; } .kpi-body em.flat { color: #64748b; }

.dash-main { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 1fr 1.55fr 1fr; gap: 10px; align-items: stretch; }
.dash-col-side { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; padding-right: 2px; }
.dash-col-center { min-height: 0; }
.dash-map-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.dash-map-panel .panel-bd { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.dash-map { flex: 1; min-height: 260px; border-radius: 8px; overflow: hidden; }
.dash-map-wrap { position: relative; }
.dash-real-summary { position: absolute; top: 10px; left: 10px; z-index: 120; max-width: 270px;
  background: rgba(6, 16, 34, .85); border: 1px solid rgba(34, 211, 238, .35); border-radius: 10px;
  padding: 10px 12px; box-shadow: 0 0 24px rgba(34, 211, 238, .25); }
.rs-hd { font-size: 12px; font-weight: 700; color: #22d3ee; margin-bottom: 8px; letter-spacing: .5px; }
.rs-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rs-item { text-align: center; }
.rs-item b { display: block; font-size: 20px; font-weight: 800; color: #e0f2fe; font-variant-numeric: tabular-nums; }
@keyframes violPulse {
  0%, 100% { transform: scale(1); text-shadow: 0 0 6px rgba(255,77,79,.45); }
  50% { transform: scale(1.14); text-shadow: 0 0 20px rgba(255,77,79,1), 0 0 34px rgba(255,77,79,.65); }
}
.rs-item.red b { color: #ff4d4f; font-size: 24px; animation: violPulse 1s ease-in-out infinite; }
.rs-item.red span { color: #fb7185; font-weight: 700; }
.rs-item span { font-size: 10px; color: #8fb0d8; }
.rs-line { margin-top: 8px; font-size: 11px; color: #9db8dd; }
.rs-line b { color: #e0f2fe; }
.rs-warn { margin-top: 6px; font-size: 11px; color: #fbbf24; }
.rs-bars { display: flex; flex-direction: column; gap: 5px; margin: 8px 0; }
.rs-lvl { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.rs-lvl-label { flex: 0 0 52px; color: #9db8dd; display: flex; align-items: center; gap: 5px; }
.rs-lvl-label .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.rs-lvl-track { flex: 1; height: 8px; background: rgba(255, 255, 255, .07); border-radius: 4px; overflow: hidden; }
.rs-lvl-track i { display: block; height: 100%; border-radius: 4px; }
.rs-lvl b { flex: 0 0 22px; text-align: right; color: #e0f2fe; font-variant-numeric: tabular-nums; }
.rs-rows { display: flex; flex-direction: column; }
.rs-row { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: #9db8dd; padding: 3px 0; border-bottom: 1px solid rgba(56, 130, 246, .1); }
.rs-row:last-child { border-bottom: none; }
.rs-row b { color: #e0f2fe; font-variant-numeric: tabular-nums; }
.dash-map-ctrl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dash-seg { display: flex; border: 1px solid rgba(34,211,238,.25); border-radius: 7px; overflow: hidden; }
.dash-seg button { border: none; background: transparent; color: #8fb0d8; font-size: 11px; padding: 3px 9px; cursor: pointer; }
.dash-seg button.on { background: rgba(34,211,238,.2); color: #22d3ee; }
.dash-days { display: flex; gap: 4px; }
.dash-days button { border: 1px solid rgba(34,211,238,.2); border-radius: 7px; background: transparent; color: #8fb0d8; font-size: 11px; padding: 3px 8px; cursor: pointer; }
.dash-days button.on { background: rgba(34,211,238,.2); color: #22d3ee; border-color: rgba(34,211,238,.5); }
.dash-map-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 9px; font-size: 11px; color: #9db8dd; }
.dash-map-legend .lg { width: 15px; height: 3px; border-radius: 2px; display: inline-block; margin-right: 5px; vertical-align: middle; }
.lg-bj { background: #dc2626; box-shadow: 0 0 6px rgba(220,38,38,.6); }
.lg-cd { background: #16a34a; box-shadow: 0 0 6px rgba(22,163,74,.6); }
.lg-hsr { background: repeating-linear-gradient(90deg, #dc2626 0 3px, #fff 3px 6px); }
.lg-air { background: #5eead4; box-shadow: 0 0 6px rgba(94,234,212,.6); }
.dash-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.dash-col-wide { }
.panel { background: linear-gradient(160deg, rgba(15,32,64,.8), rgba(8,18,40,.8));
  border: 1px solid rgba(56,130,246,.22); border-radius: 12px; padding: 10px 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,.35); }
.panel.grow { flex: 1; display: flex; flex-direction: column; }
.panel-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.panel-hd h2 { font-size: 14px; font-weight: 700; color: #cfe3ff; letter-spacing: .5px; }
.panel-hd span { font-size: 11px; color: #5b7aa8; letter-spacing: 1px; }
.panel-bd { min-width: 0; }
.dash-empty { color: #5b7aa8; font-size: 12px; text-align: center; padding: 18px 0; }

.dash-weather { display: flex; flex-direction: column; gap: 8px; }
.wx-item { padding: 5px 10px; border-radius: 10px; border: 1px solid rgba(56, 130, 246, .18); position: relative; overflow: hidden; }
.wx-sunny { background: radial-gradient(circle at 82% 18%, rgba(34, 211, 238, .30), rgba(8, 24, 50, .10) 70%); }
.wx-cloudy { background: linear-gradient(135deg, rgba(59, 130, 246, .16), rgba(34, 211, 238, .05)); }
.wx-overcast { background: linear-gradient(135deg, rgba(100, 116, 139, .22), rgba(100, 116, 139, .05)); }
.wx-rain { background: linear-gradient(135deg, rgba(59, 130, 246, .22), rgba(34, 211, 238, .08)); }
.wx-rain::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent, rgba(34, 211, 238, .28)); pointer-events: none; }
.wx-snow { background: linear-gradient(135deg, rgba(224, 242, 254, .20), rgba(148, 163, 184, .05)); }
.wx-thunder { background: linear-gradient(135deg, rgba(129, 140, 248, .22), rgba(99, 102, 241, .07)); }
.wx-fog { background: linear-gradient(135deg, rgba(148, 163, 184, .20), rgba(148, 163, 184, .05)); }
.wx-top { display: flex; align-items: baseline; justify-content: space-between; position: relative; z-index: 1; }
.wx-city { color: #8fb0d8; font-weight: 600; font-size: 12px; }
.wx-cond { color: #e0f2fe; font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.wx-cond .ic { font-size: 22px; line-height: 1; }
.wx-fly { flex: 0 0 auto; text-align: center; font-size: 16px; font-weight: 800; letter-spacing: 1px; white-space: nowrap; line-height: 1; transform: translateY(-0.75em); }
.wx-fly.ok { color: #4ade80; text-shadow: 0 0 10px rgba(74, 222, 128, .85), 0 0 22px rgba(74, 222, 128, .45); }
.wx-fly.good { color: #22d3ee; text-shadow: 0 0 10px rgba(34, 211, 238, .85), 0 0 22px rgba(34, 211, 238, .45); }
.wx-fly.warn { color: #fb923c; text-shadow: 0 0 10px rgba(251, 146, 60, .85), 0 0 22px rgba(251, 146, 60, .45); }
.wx-fly.no { color: #f87171; text-shadow: 0 0 10px rgba(248, 113, 113, .85), 0 0 22px rgba(248, 113, 113, .45); }
.wx-body { display: flex; align-items: center; gap: 10px; margin-top: 4px; position: relative; z-index: 1; }
.wx-left { flex: 1; display: flex; align-items: center; gap: 8px; }
.wx-right { flex: 1; display: flex; align-items: center; justify-content: flex-end; }
.wx-temp { font-size: 24px; font-weight: 800; color: #e0f2fe; font-variant-numeric: tabular-nums; line-height: 1; }
.wx-temp i { font-style: normal; font-size: 12px; color: #8fb0d8; font-weight: 600; }
.wx-meta { font-size: 11px; color: #8fb0d8; }
.wx-wind { display: flex; align-items: center; gap: 8px; }
.wx-compass { width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(34, 211, 238, .45); background: rgba(8, 24, 50, .55); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 10px rgba(34, 211, 238, .28); font-size: 17px; color: #22d3ee; flex: 0 0 auto; text-shadow: 0 0 8px rgba(34, 211, 238, .8); }
.wx-wind-txt { display: flex; flex-direction: column; line-height: 1.15; }
.wx-wind-txt b { color: #7dd3fc; font-size: 13px; font-weight: 700; }
.wx-wind-txt em { font-style: normal; color: #22d3ee; font-size: 14px; font-weight: 800; }

.dbar { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 12px; }
.dbar-l { flex: 0 0 76px; color: #9db8dd; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.dbar-track { flex: 1; height: 10px; background: rgba(34,211,238,.08); border-radius: 5px; overflow: hidden; }
.dbar-track i { display: block; height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, #3b82f6, #22d3ee); box-shadow: 0 0 8px rgba(34,211,238,.5); }
.dbar-v { flex: 0 0 34px; color: #22d3ee; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

.dash-donut-wrap { display: flex; align-items: center; gap: 16px; }
.donut { width: 90px; height: 90px; border-radius: 50%; flex: 0 0 auto; position: relative;
  box-shadow: 0 0 22px rgba(34,211,238,.25); }
.donut-hole { position: absolute; inset: 16px; border-radius: 50%; background: #08152a;
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; color: #22d3ee; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: #9db8dd; }
.donut-legend b { color: #e0f2fe; }
.donut-legend .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.real-vscroll { flex: 1; min-width: 0; height: 90px; overflow: hidden; border-left: 1px solid rgba(56,130,246,.15); padding-left: 36px; position: relative; }
.real-vscroll-track { will-change: transform; }
.real-name { font-size: 12px; color: #cfe3ff; line-height: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.real-name.hot { color: #f87171; font-weight: 700; }
.real-scroll-empty { color: #5b7aa8; font-size: 12px; white-space: normal; }
.dot.cyan { background: #22d3ee; } .dot.gray { background: #64748b; } .dot.dim { background: #334155; }

.dash-levels { display: flex; flex-direction: column; gap: 8px; }
.lvl { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.lvl-l { flex: 0 0 52px; color: #9db8dd; display: flex; align-items: center; }
.lvl-l .dot { width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.lvl-track { flex: 1; height: 8px; background: rgba(255,255,255,.06); border-radius: 4px; overflow: hidden; }
.lvl-track i { display: block; height: 100%; border-radius: 4px; }
.lvl-v { flex: 0 0 30px; text-align: right; color: #e0f2fe; font-weight: 700; font-variant-numeric: tabular-nums; }
.lvl-viol .lvl-v { color: #ff4d4f; font-weight: 800; animation: violPulse 1s ease-in-out infinite; }

.dash-vbars { display: flex; align-items: flex-end; gap: 4px; height: 130px; }
.vb { flex: 1; min-width: 0; background: linear-gradient(180deg, #22d3ee, #3b82f6); border-radius: 3px 3px 0 0;
  position: relative; transition: height .3s; box-shadow: 0 0 6px rgba(34,211,238,.35); }
.vb:hover { background: linear-gradient(180deg, #7dd3fc, #22d3ee); }
.vb-v { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 10px; color: #7dd3fc; }
.vbar-labels { display: flex; justify-content: space-between; font-size: 10px; color: #5b7aa8; margin-top: 6px; }

.heat-item { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 12px; }
.heat-no { flex: 0 0 18px; color: #f59e0b; font-weight: 800; }
.heat-coord { flex: 0 0 106px; color: #9db8dd; font-variant-numeric: tabular-nums; }
.heat-track { flex: 1; height: 10px; background: rgba(245,158,11,.08); border-radius: 5px; overflow: hidden; }
.heat-track i { display: block; height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, #f97316, #f59e0b); box-shadow: 0 0 8px rgba(245,158,11,.5); }
.heat-v { flex: 0 0 30px; color: #fbbf24; font-weight: 700; text-align: right; }

.rank-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid rgba(56,130,246,.1); font-size: 12px; }
.rank-item:last-child { border-bottom: none; }
.rank-no { flex: 0 0 22px; height: 22px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  background: rgba(56,130,246,.15); color: #8fb0d8; font-weight: 700; font-size: 11px; }
.rank-no.top { background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff; box-shadow: 0 0 10px rgba(245,158,11,.4); }
.rank-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rank-sn { color: #cfe3ff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-model { color: #5b7aa8; font-size: 11px; }
.rank-count { color: #22d3ee; font-weight: 700; font-variant-numeric: tabular-nums; }

.dash-ev-status { display: flex; gap: 8px; margin-bottom: 8px; }
.evs { flex: 1; text-align: center; padding: 6px 4px; border-radius: 8px; border: 1px solid rgba(56,130,246,.2); }
.evs b { display: block; font-size: 18px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.evs span { font-size: 10px; color: #8fb0d8; }
.evs.pending b { color: #fbbf24; } .evs.pending { background: rgba(245,158,11,.08); }
.evs.dispatched b { color: #60a5fa; } .evs.dispatched { background: rgba(59,130,246,.08); }
.evs.handled b { color: #34d399; } .evs.handled { background: rgba(52,211,153,.08); }
.dash-ev-types { display: flex; flex-wrap: wrap; gap: 6px; }
.evt { font-size: 10px; color: #9db8dd; background: rgba(56,130,246,.1); border: 1px solid rgba(56,130,246,.2); padding: 2px 8px; border-radius: 14px; }
.evt b { color: #f87171; }

.dash-feed { margin-top: 12px; }
.dash-events { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.dash-events-col { display: flex; flex-direction: column; gap: 6px; }
.dash-events-col .ev-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; }
.dash-events-col .ev-type { flex: 0 0 auto; }
.dash-events-col .ev-no { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.dash-events-col .ev-addr { flex: 0 0 auto; font-size: 10px; }
.dash-events-col .ev-status { flex: 0 0 auto; }
.ev-item { font-size: 11px; padding: 8px 10px; border-radius: 8px; background: rgba(56,130,246,.08); border: 1px solid rgba(56,130,246,.15); }
.ev-no { color: #60a5fa; font-weight: 700; display: block; }
.ev-dist { flex: 0 0 auto; font-size: 10px; color: #34d399; background: rgba(52,211,153,.12); border: 1px solid rgba(52,211,153,.22); border-radius: 4px; padding: 0 5px; line-height: 16px; white-space: nowrap; }
.ev-type { color: #f87171; display: block; margin-top: 3px; }
.ev-addr { color: #5b7aa8; display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-status { display: inline-block; margin-top: 4px; padding: 1px 7px; border-radius: 10px; font-size: 10px; }
.ev-status.pending { background: rgba(245,158,11,.15); color: #fbbf24; }
.ev-status.dispatched { background: rgba(59,130,246,.15); color: #60a5fa; }
.ev-status.handled { background: rgba(52,211,153,.15); color: #34d399; }
button.ev-status { border: none; cursor: pointer; font-family: inherit; }
button.ev-status:hover { opacity: .85; }

.dash-foot { flex: 0 0 auto; margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center;
  padding: 8px 14px; border-radius: 10px; border: 1px solid rgba(56,130,246,.22);
  background: linear-gradient(160deg, rgba(15,32,64,.8), rgba(8,18,40,.8)); }
.dash-foot span { font-size: 12px; color: #8fb0d8; }
.dash-foot b { color: #22d3ee; font-variant-numeric: tabular-nums; }

.dash-loading { position: fixed; inset: 0; z-index: 1999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: #5b7aa8; background: #050b1e; }
.dash-loading p { font-size: 13px; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 3px solid rgba(34,211,238,.15); border-top-color: #22d3ee; animation: dashspin 1s linear infinite; }
@keyframes dashspin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .dash { display: block; overflow-y: auto; overflow-x: hidden; padding: 0 10px 18px; }
  .dash-head {
    position: sticky; top: 0; z-index: 40;
    margin: 0 -10px 8px; padding: 8px 10px;
    background: rgba(5, 11, 30, .95); backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(34, 211, 238, .15);
    gap: 8px;
  }
  .dash-title { gap: 10px; }
  .dash-title .dash-logo { width: 34px; height: 34px; font-size: 20px; border-radius: 10px; }
  .dash-title h1 { font-size: 15px; letter-spacing: .5px; }
  .dash-title p { display: none; }
  .dash-head-right { gap: 6px; }
  .dash-stat-chip { font-size: 10px; padding: 3px 7px; }
  .dash-clock { font-size: 12px; }
  .dash-exit { font-size: 11px; padding: 4px 9px; margin-left: 0; }
  .dash-kpis { grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 8px; }
  .kpi { padding: 6px 10px 7px 12px; }
  .kpi b.num { font-size: 18px; }
  .dash-main { grid-template-columns: 1fr; gap: 8px; }
  .dash-col-side { overflow: visible; gap: 8px; }
  .dash-col-center { order: -1; }
  .dash-map-panel { flex: none; }
  .dash-map-panel .panel-bd { flex: none; }
  .dash-map { flex: none; height: 40vh; min-height: 220px; max-height: 340px; }
  .dash-map-ctrl { gap: 5px; }
  .dash-vbars { height: 110px; }
  .dash-foot { gap: 6px 14px; padding: 8px 10px; font-size: 11px; }
}
@media (max-width: 560px) {
  .dash { padding: 0 8px 14px; }
  .dash-head { margin: 0 -8px 8px; }
  .dash-title h1 { font-size: 14px; }
  .dash-clock { display: none; }
  .dash-stat-chip { display: none; }
  .rs-item b { font-size: 18px; }
  .dash-map { height: 36vh; min-height: 200px; }
}

/* ===== AI 对话助手 ===== */
.mining-body.chat { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.chat-page { flex: 1; min-height: 0; display: flex; }
.chat-side { width: 250px; flex: 0 0 auto; display: flex; flex-direction: column; background: var(--card); border-right: 1px solid var(--line); }
.chat-side-hd { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--text); }
.chat-side-btns { display: flex; gap: 6px; align-items: center; }
.chat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px; }
.chat-item { position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; cursor: pointer; margin-bottom: 6px; border: 1px solid var(--line); background: #fff; transition: all .15s ease; }
.ci-chk { flex: 0 0 auto; display: inline-flex; align-items: center; cursor: pointer; }
.ci-chk input { cursor: pointer; }
.ci-body { flex: 1; min-width: 0; }
.chat-item:hover { border-color: var(--primary); background: var(--bg); transform: translateX(2px); box-shadow: 0 2px 8px rgba(37,99,235,.08); }
.chat-item.on { background: #eff6ff; border-color: var(--primary); box-shadow: inset 3px 0 0 var(--primary); }
.ci-title { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 20px; }
.ci-gen { display: inline-block; font-size: 10px; color: var(--primary); background: #dbeafe; border-radius: 9px; padding: 0 6px; margin-left: 6px; vertical-align: 1px; animation: ciblink 1.2s ease-in-out infinite; }
.ci-gen-big { color: var(--primary); font-weight: 600; }
@keyframes ciblink { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
.ci-time { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.ci-del { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: none; background: transparent; color: #94a3b8; cursor: pointer; font-size: 13px; padding: 2px 4px; border-radius: 4px; }
.ci-del:hover { color: #dc2626; background: #fee2e2; }
.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.chat-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.chat-title { font-size: 15px; font-weight: 700; color: var(--text); }
.chat-actions { display: flex; gap: 6px; }
.chat-side-toggle { display: none; }
.chat-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; }
.msg { display: flex; gap: 10px; margin-bottom: 16px; }
.msg.user { flex-direction: row-reverse; }
.msg-av { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 17px; background: #eff6ff; border: 1px solid var(--line); }
.msg.user .msg-av { background: var(--primary); color: #fff; border-color: var(--primary); }
.msg-bd { max-width: 82%; min-width: 0; }
.msg.user .msg-bd { text-align: right; }
.msg-name { font-size: 11px; color: #94a3b8; margin-bottom: 4px; }
.msg.user .msg-name { text-align: right; }
.msg-content.md { display: inline-block; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 13px; line-height: 1.65; color: var(--text); max-width: 100%; overflow-wrap: break-word; }
.msg.user .msg-content.md { background: var(--primary); color: #fff; border-color: var(--primary); }
.msg-content.md p { margin: 5px 0; }
.msg-content.md h1 { font-size: 17px; margin: 10px 0 6px; }
.msg-content.md h2 { font-size: 15px; margin: 10px 0 6px; }
.msg-content.md h3 { font-size: 14px; margin: 8px 0 5px; }
.msg-content.md .md-li { margin: 3px 0 3px 4px; }
.msg-content.md table.md-table { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: 12px; }
.msg-content.md table.md-table td { border: 1px solid var(--line); padding: 5px 8px; }
.msg.user .msg-content.md table.md-table td { border-color: rgba(255,255,255,.3); }
.msg-content.md code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.msg.user .msg-content.md code { background: rgba(255,255,255,.2); }
.chat-quick { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px; background: var(--card); border-top: 1px solid var(--line); }
.chat-quick .chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 16px; padding: 5px 12px; font-size: 12px; cursor: pointer; transition: all .15s ease; }
.chat-quick .chip:hover { border-color: var(--primary); color: var(--primary); background: #eff6ff; transform: translateY(-1px); box-shadow: 0 2px 6px rgba(37,99,235,.12); }
.chip-ic { font-size: 13px; }
.chat-input { flex: 0 0 auto; display: flex; align-items: stretch; gap: 10px; padding: 12px 16px; background: var(--card); border-top: 1px solid var(--line); }
.chat-input textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14px; font-family: inherit; line-height: 1.6; min-height: 96px; max-height: 220px; outline: none; background: #fff; transition: border-color .18s ease, box-shadow .18s ease; }
.chat-input textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29, 78, 216, .12); }
.chat-send-col { display: flex; flex-direction: column; gap: 8px; }
.chat-send-col .btn { flex: 1; min-height: 44px; padding: 0 16px; font-size: 13px; border-radius: 9px; font-weight: 600; white-space: nowrap; transition: transform .12s ease, box-shadow .12s ease, background .15s ease; }
.chat-send-col .btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, .10); }
@media (max-width: 900px) {
  .chat-page { flex-direction: column; }
  .chat-side-toggle { display: inline-flex; }
  .chat-side { display: none; width: 100%; flex: 0 0 auto; max-height: 45vh; border-right: none; border-bottom: 1px solid var(--line); }
  .chat-page.side-open .chat-side { display: flex; }
  .chat-side-hd { padding: 8px 12px; }
  .chat-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; max-height: 30vh; }
  .chat-item { width: calc(50% - 4px); margin-bottom: 0; }
  .chat-hd { padding: 8px 10px; gap: 6px; }
  .chat-title { font-size: 13px; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chat-actions { gap: 4px; }
  .chat-body { padding: 10px; }
  .msg { gap: 8px; margin-bottom: 12px; }
  .msg-av { width: 28px; height: 28px; font-size: 14px; }
  .msg-bd { max-width: 88%; }
  .chat-quick { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 8px 10px; }
  .chat-quick::-webkit-scrollbar { display: none; }
  .chat-quick .chip { flex: 0 0 auto; white-space: nowrap; }
  .chat-input { padding: 10px; flex-wrap: wrap; }
  .chat-input textarea { flex: 1 1 100%; min-height: 64px; }
  .chat-send-col { flex: 1 1 100%; flex-direction: row; }
  .chat-send-col .btn { flex: 1; height: 40px; padding: 0 10px; font-size: 12px; }
}

/*隐藏高德地图 logo 与版权文字（手机端悬浮遮挡操作）*/
.amap-logo, .amap-copyright { display: none !important; }
