/*!
 * monitor.css —— 静静追踪 v2.0 监控页
 *  玻璃顶栏 + 卡片面板 + 浮动选中卡 + Apple Maps 风格 marker
 */
:root {
  --bg: #f4f6f9;
  --bg-deep: #0b1220;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-solid: #ffffff;
  --ink: #1f2733;
  --ink-2: #3b4756;
  --sub: #6b7686;
  --line: rgba(20, 30, 50, 0.08);
  --line-strong: rgba(20, 30, 50, 0.14);
  --accent: #2e7dff;
  --accent-2: #5b8def;
  --on: #22c55e;
  --off: #9aa3af;
  --warn: #f59e0b;
  --danger: #ef4444;
  --shadow-sm: 0 1px 2px rgba(20, 30, 50, 0.06);
  --shadow-md: 0 6px 20px rgba(20, 30, 50, 0.12);
  --shadow-lg: 0 12px 32px rgba(20, 30, 50, 0.18);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --topbar-h: 56px;
  --z-top: 700;
  --z-panel: 600;
  --z-card: 650;
  --z-marker: 500;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
#app { position: fixed; inset: 0; display: flex; flex-direction: column; }

/* ===== 顶部玻璃栏 ===== */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 16px;
  background: var(--panel);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  z-index: var(--z-top);
  user-select: none;
}
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand .logo { font-size: 18px; line-height: 1; }
.brand .brand-name { font-weight: 700; font-size: 16px; color: var(--ink); letter-spacing: 0.5px; }
.brand .brand-sub { font-size: 12px; color: var(--sub); }

.stats { display: flex; align-items: center; gap: 14px; margin-left: 8px; }
.stat { display: flex; align-items: baseline; gap: 6px; }
.stat .num { font-weight: 700; font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat .lbl { font-size: 13px; color: var(--ink); font-weight: 600; }   /* 1.9.32：「在线」两字加亮加大，不再被忽略 */
.stat.sep { padding-left: 14px; border-left: 1px solid var(--line-strong); }

.actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--panel-solid); color: var(--ink); font-size: 13px;
  font-family: inherit; cursor: pointer; transition: all .15s ease;
  box-shadow: var(--shadow-sm);
}
.btn:hover { border-color: var(--accent); color: var(--accent); background: #fff; }
.btn:active { transform: translateY(1px); }
.btn .ic { font-size: 14px; line-height: 1; }
.btn.hidden { display: none; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-2); color: #fff; border-color: var(--accent-2); }

.select-wrap {
  position: relative;
  display: inline-flex; align-items: center;
}
.select-wrap select {
  appearance: none; -webkit-appearance: none;
  padding: 6px 28px 6px 12px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--panel-solid); color: var(--ink);
  font-size: 13px; font-family: inherit; cursor: pointer; outline: none;
  box-shadow: var(--shadow-sm);
}
.select-wrap select:hover { border-color: var(--accent); }
.select-wrap::after {
  content: "▾"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  pointer-events: none; color: var(--sub); font-size: 11px;
}

.icon-btn {
  width: 28px; height: 28px; border: none; border-radius: 8px;
  background: transparent; color: var(--sub); cursor: pointer;
  font-size: 14px; line-height: 1; transition: all .15s;
}
.icon-btn:hover { background: rgba(20,30,50,.06); color: var(--ink); }

/* ===== 地图主体 ===== */
#map { position: absolute; inset: var(--topbar-h) 0 0 0; background: #dfe6ee; }
.leaflet-container { background: #dfe6ee; font-family: inherit; }

/* 缩放控件位置 */
.leaflet-bottom.leaflet-right { bottom: 16px; right: 16px; }
.leaflet-control-zoom a {
  background: var(--panel-solid); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 8px !important;
  box-shadow: var(--shadow-sm); font-weight: 600;
}
.leaflet-control-zoom a:hover { background: #fff; color: var(--accent); border-color: var(--accent); }
.leaflet-control-attribution {
  background: rgba(255,255,255,.7) !important; border-radius: 6px;
  font-size: 10px !important; padding: 2px 6px !important;
}

/* ===== marker（Apple Maps 风格） ===== */
.pin-wrap { background: none !important; border: none !important; }
.pin {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 4px;
  background: rgba(255,255,255,0.94);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  transform: translate(-50%, -100%);
  white-space: nowrap;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.pin:hover { transform: translate(-50%, -100%) scale(1.05); box-shadow: 0 4px 12px rgba(0,0,0,.24); }
.pin .dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(46,125,255,0.3);
  flex: 0 0 auto;
}
.pin.off .dot { background: var(--off); box-shadow: 0 0 0 2px rgba(154,163,175,0.3); }
.pin.android .dot { background: var(--accent); box-shadow: 0 0 0 2px rgba(46,125,255,0.3); }
.pin.web .dot { background: #0ea5e9; box-shadow: 0 0 0 2px rgba(14,165,233,0.3); }
.pin.miniprogram .dot { background: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,0.3); }
.pin .nm { font-size: 12px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.pin .plt { font-style: normal; font-size: 10px; padding: 1px 5px; border-radius: 6px; background: #eef3fb; color: #3b6fb0; }
.pin.android .plt { background: #e8f0ff; color: #2e7dff; }
.pin.web .plt { background: #e0f2fe; color: #0369a1; }
.pin.miniprogram .plt { background: #fef3c7; color: #b45309; }
.pin.off .nm { color: var(--sub); }
.pin.off .plt { background: #f1f3f6; color: var(--sub); }

.pin.sel {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(46,125,255,0.25), 0 4px 16px rgba(46,125,255,0.4);
  z-index: 1000;
}
.pin.sel .nm { color: #fff; }
.pin.sel.webkit .dot,
.pin.sel .dot { background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,0.4); }
.pin.sel .plt { background: rgba(255,255,255,0.25); color: #fff; }

/* pulse 动画（选中 marker） */
@keyframes pin-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(46,125,255,0.55); }
  70%  { box-shadow: 0 0 0 16px rgba(46,125,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,125,255,0); }
}
.pin.sel { animation: pin-pulse 1.8s ease-out infinite; }

/* ===== 右侧设备面板 ===== */
#panel {
  position: fixed; top: calc(var(--topbar-h) + 12px); right: 12px;
  width: 296px; max-height: calc(100vh - var(--topbar-h) - 24px);
  background: var(--panel);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  z-index: var(--z-panel);
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: transform .25s ease, width .25s ease;
}
#panel.collapsed { transform: translateX(calc(100% + 12px)); }

.panel-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.ph-title { font-weight: 700; font-size: 14px; }
.ph-count { font-size: 12px; color: var(--sub); margin-left: auto; }
.ph-count span { font-weight: 700; color: var(--ink); }

.panel-search { padding: 8px 12px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.panel-search input {
  width: 100%; padding: 7px 10px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--panel-solid); font-size: 13px; font-family: inherit;
  outline: none; transition: border-color .15s;
}
.panel-search input:focus { border-color: var(--accent); }

.panel-group { display: flex; flex-direction: column; min-height: 0; }
.panel-group + .panel-group { border-top: 1px solid var(--line); }
.pg-head {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; font-size: 11px; font-weight: 700; color: var(--sub);
  text-transform: uppercase; letter-spacing: 0.6px;
  background: rgba(20,30,50,0.02); flex: 0 0 auto;
}
.pg-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--off); }
.pg-dot.on { background: var(--on); }
.pg-head span#onCount2, .pg-head span#offCount2 {
  font-weight: 700; color: var(--ink); margin-left: auto;
}

.dev-list { list-style: none; margin: 0; padding: 6px 8px; overflow-y: auto; flex: 1 1 auto; max-height: 32vh; }
.dev-list:empty::after {
  content: "暂无"; display: block; padding: 10px 14px; font-size: 12px; color: var(--sub);
}

#panel .dev-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 10px;
  cursor: pointer; margin-bottom: 2px;
  transition: background .12s;
  position: relative;
}
#panel .dev-list li::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  border-radius: 2px; background: transparent; transition: background .15s;
}
#panel .dev-list li:hover { background: rgba(46,125,255,0.06); }
#panel .dev-list li.sel { background: rgba(46,125,255,0.10); }
#panel .dev-list li.sel::before { background: var(--accent); }
#panel .dev-list li.android.sel::before { background: var(--accent); }
#panel .dev-list li.web.sel::before { background: #0ea5e9; }
#panel .dev-list li.miniprogram.sel::before { background: #f59e0b; }
#panel .dev-list li.off { opacity: 0.6; }
#panel .dev-list li.off::before { background: var(--off); }

.dl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--on); flex: 0 0 auto; }
.dl-dot.off { background: var(--off); }
.dl-dot.android { background: var(--accent); }
.dl-dot.web { background: #0ea5e9; }
.dl-dot.miniprogram { background: #f59e0b; }

.dl-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dl-name { font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11px; color: var(--sub); font-variant-numeric: tabular-nums; }
.dl-meta .sep { color: var(--line-strong); }
.dl-platform { font-size: 10px; padding: 1px 5px; border-radius: 5px; font-style: normal; }
.dl-platform.android { background: #e8f0ff; color: #2e7dff; }
.dl-platform.web { background: #e0f2fe; color: #0369a1; }
.dl-platform.miniprogram { background: #fef3c7; color: #b45309; }

.panel-tip {
  padding: 8px 14px; font-size: 11px; color: var(--sub);
  border-top: 1px solid var(--line); background: rgba(20,30,50,0.02);
  flex: 0 0 auto;
}

/* ===== 浮动选中卡（右下） ===== */
#deviceCard {
  position: fixed; right: 16px; bottom: 24px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-card);
  display: flex; align-items: stretch;
  max-width: 340px;
  transition: opacity .18s ease, transform .18s ease;
}
#deviceCard.hidden { opacity: 0; pointer-events: none; transform: translateY(8px); }
.dc-pin {
  width: 6px; flex: 0 0 auto; background: var(--accent);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.dc-pin.android { background: var(--accent); }
.dc-pin.web { background: #0ea5e9; }
.dc-pin.miniprogram { background: #f59e0b; }
.dc-pin.off { background: var(--off); }

.dc-body { padding: 10px 14px; flex: 1; min-width: 0; }
.dc-row1 { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.dc-name { font-weight: 700; font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-plt { font-size: 10px; padding: 1px 5px; border-radius: 5px; background: #eef3fb; color: #3b6fb0; font-style: normal; }
.dc-plt.android { background: #e8f0ff; color: #2e7dff; }
.dc-plt.web { background: #e0f2fe; color: #0369a1; }
.dc-plt.miniprogram { background: #fef3c7; color: #b45309; }
.dc-state { margin-left: auto; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #e8f8ee; color: #047857; font-weight: 600; }
.dc-state.off { background: #f1f3f6; color: var(--sub); }

.dc-row2 { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--sub); margin-bottom: 8px; }
.dc-row2 em { font-style: normal; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.dc-row3 { display: flex; gap: 6px; }
.dc-btn {
  flex: 1; padding: 6px 8px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--panel-solid); color: var(--ink);
  font-size: 12px; font-family: inherit; cursor: pointer;
  transition: all .12s;
}
.dc-btn:hover { border-color: var(--accent); color: var(--accent); }
.dc-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== Leaflet popup 卡片化 ===== */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-md) !important;
  padding: 0 !important;
  background: var(--panel-solid);
}
.leaflet-popup-content { margin: 12px 14px !important; font-family: inherit; font-size: 13px; line-height: 1.6; color: var(--ink); }
.leaflet-popup-tip { background: var(--panel-solid) !important; box-shadow: var(--shadow-sm); }
.popup-title { font-weight: 700; font-size: 14px; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.popup-row { display: flex; gap: 10px; font-size: 12px; color: var(--sub); }
.popup-row em { font-style: normal; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ===== 响应式 ===== */
@media (max-width: 720px) {
  #topbar { gap: 8px; padding: 0 10px; height: 52px; }
  :root { --topbar-h: 52px; }
  .brand .brand-sub { display: none; }
  .stats { gap: 8px; }
  .stat .lbl { display: none; }
  .stat.sep { padding-left: 8px; }
  .actions .btn .txt { display: none; }
  .actions .btn { padding: 6px 10px; }
  .select-wrap select { padding: 6px 22px 6px 10px; font-size: 12px; }
  #panel {
    top: auto; bottom: 10px; right: 10px; left: 10px; width: auto;
    max-height: 50vh;
  }
  #deviceCard { right: 12px; left: 12px; bottom: 12px; max-width: none; }
  .dc-pin { display: none; }
  .dev-list { max-height: 26vh; }
}

/* ===== 暗色底图（cartodark）增强标题栏对比 ===== */
.leaflet-container.dark .pin { background: rgba(20, 28, 44, 0.92); }
.leaflet-container.dark .pin .nm { color: #f0f4fa; }
.leaflet-container.dark .pin.off .nm { color: #8a96a8; }
.leaflet-container.dark .pin .spd { color: #7db3ff; }

/* ===== 时速徽章（marker 内） ===== */
.pin .spd {
  font-style: normal; font-size: 10px; font-weight: 700;
  padding: 1px 5px; border-radius: 6px;
  background: rgba(46, 125, 255, 0.12); color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.pin.sel .spd { background: rgba(255, 255, 255, 0.25); color: #fff; }

/* ===== 设备列表删除按钮 ===== */
.dl-del {
  flex: 0 0 auto; width: 22px; height: 22px;
  border: none; border-radius: 6px;
  background: transparent; color: var(--sub);
  font-size: 12px; line-height: 1; cursor: pointer;
  transition: all .12s;
  opacity: 0;
}
#panel .dev-list li:hover .dl-del { opacity: 1; }
.dl-del:hover { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.dl-del.confirm { opacity: 1; background: var(--danger); color: #fff; width: auto; padding: 0 8px; font-size: 11px; }
html[data-theme="dark"] .dl-del:hover { background: rgba(239, 68, 68, 0.25); }

/* ===== 主题切换按钮 ===== */
#themeBtn.theme { width: 34px; height: 30px; }
#themeBtn.theme .ic { font-size: 15px; }

/* ===== 暗色主题（UI 暗色；地图底图不随主题变暗） ===== */
html[data-theme="dark"] {
  --bg: #0b1220;
  --panel: rgba(17, 24, 39, 0.92);
  --panel-solid: #111827;
  --ink: #e5eaf3;
  --ink-2: #c7d0dd;
  --sub: #8a96a8;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55);
}
html[data-theme="dark"] #topbar { border-bottom-color: var(--line); }
html[data-theme="dark"] .btn,
html[data-theme="dark"] .select-wrap select,
html[data-theme="dark"] .panel-search input { background: #1a2233; border-color: var(--line-strong); color: var(--ink); }
html[data-theme="dark"] .btn:hover { background: #1f2a40; }
html[data-theme="dark"] .select-wrap select option { background: #111827; color: var(--ink); }
html[data-theme="dark"] #panel .dev-list li:hover { background: rgba(255, 255, 255, 0.05); }
html[data-theme="dark"] #panel .dev-list li.sel { background: rgba(46, 125, 255, 0.18); }
html[data-theme="dark"] .pg-head { background: rgba(255, 255, 255, 0.03); }
html[data-theme="dark"] .panel-tip { background: rgba(255, 255, 255, 0.03); }
html[data-theme="dark"] .dl-platform.android { background: rgba(46, 125, 255, 0.2); color: #7db3ff; }
html[data-theme="dark"] .dl-platform.web { background: rgba(14, 165, 233, 0.2); color: #6cc8f5; }
html[data-theme="dark"] .dl-platform.miniprogram { background: rgba(245, 158, 11, 0.2); color: #f5c15f; }
html[data-theme="dark"] .leaflet-control-zoom a { background: #1a2233; color: var(--ink); border-color: var(--line-strong); }
html[data-theme="dark"] .leaflet-control-zoom a:hover { background: #1f2a40; color: #7db3ff; }
html[data-theme="dark"] .dc-btn { background: #1a2233; border-color: var(--line-strong); color: var(--ink); }
html[data-theme="dark"] .dc-btn:hover { border-color: var(--accent); color: var(--accent); }
html[data-theme="dark"] .dc-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
html[data-theme="dark"] .dc-state.off { background: #1a2233; color: var(--sub); }
html[data-theme="dark"] .leaflet-popup-content-wrapper { background: var(--panel-solid); color: var(--ink); }
html[data-theme="dark"] .leaflet-popup-tip { background: var(--panel-solid); }

/* ===== 手机竖屏专门适配（portrait） ===== */
@media (orientation: portrait) and (max-width: 720px) {
  /* marker 更紧凑，减少遮挡 */
  .pin { padding: 2px 8px 2px 3px; }
  .pin .nm { font-size: 11px; }
  .pin .spd { display: none; }          /* 竖屏 marker 上不显示时速（列表/选中卡有） */
  .pin .plt { display: none; }
  /* 面板默认折叠为小横条（点击展开） */
  #panel { max-height: 42vh; }
  #deviceCard .dc-row2 { gap: 8px; font-size: 11px; }
  /* 缩放控件缩小 */
  .leaflet-control-zoom a { width: 28px; height: 28px; line-height: 26px !important; font-size: 15px !important; }
}

/* ===== 面板手柄（收起/呼出） ===== */
.panel-handle {
  display: none;
  align-items: center; justify-content: center; gap: 8px;
  padding: 7px 0 5px;
  cursor: pointer; user-select: none;
  background: rgba(20,30,50,.03);
  border-bottom: 1px solid var(--line);
}
.panel-handle .grip {
  width: 40px; height: 4px; border-radius: 3px;
  background: var(--line-strong);
}
.panel-handle .handle-label {
  font-size: 12px; font-weight: 700; color: var(--sub);
}
.panel-handle .handle-label em { font-style: normal; color: var(--accent); }
html[data-theme="dark"] .panel-handle { background: rgba(255,255,255,.03); }

/* ===== 面板呼出按钮（移动端 collapsed 时） ===== */
#panelFloat {
  position: fixed; right: 14px; bottom: 64px;   /* 避开 Leaflet attribution（bottom:16 right:16, z 800） */
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--panel-solid); color: var(--ink);
  font-size: 13px; font-weight: 600; font-family: inherit;
  box-shadow: var(--shadow-lg); cursor: pointer; z-index: 900;  /* 高于 leaflet control 800 */
  transition: opacity .18s, transform .18s;
}
#panelFloat .pf-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--on); }
#panelFloat em { font-style: normal; color: var(--accent); }
#panelFloat.hidden { display: none; }

/* ===== 手机竖屏强适配 v2（覆盖 portrait 基础版） ===== */
@media (orientation: portrait) and (max-width: 720px) {
  /* 顶栏：字号收缩防溢出 */
  #topbar { padding: 0 6px; gap: 6px; }
  .brand { gap: 4px; }
  .brand .logo { font-size: 14px; }
  .brand .brand-name { font-size: 13px; letter-spacing: 0; }
  .stats { gap: 4px; margin-left: 0; }
  .stat .num { font-size: 13px; }
  .stat.sep { padding-left: 6px; }
  .actions { gap: 4px; }
  .actions .btn { padding: 5px 8px; }
  .actions .btn .ic { font-size: 13px; }
  .select-wrap select { font-size: 11px; padding: 5px 18px 5px 8px; max-width: 92px; }
  #themeBtn.theme { width: 28px; height: 26px; }

  /* 面板：显示手柄；内部滚动修复（每个分组各自滚动） */
  .panel-handle { display: flex; }
  #panel {
    top: auto; bottom: 0; right: 0; left: 0; width: auto;
    max-height: 52vh; border-radius: 14px 14px 0 0;
    box-shadow: 0 -6px 24px rgba(20,30,50,.18);
  }
  #panel.collapsed { transform: translateY(calc(100% + 4px)); }
  #panel .panel-group { flex: 1 1 50%; min-height: 0; }
  #panel .dev-list { flex: 1 1 auto; max-height: none; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  #panel .panel-search input { font-size: 12px; padding: 6px 9px; }

  /* 删除按钮：手机端常显（无 hover） */
  .dl-del { opacity: 1; width: 24px; height: 24px; }
  #panel .dev-list li .dl-meta { gap: 4px; font-size: 10px; }

  /* 呼出按钮在面板收起时显示 */
  #panel.collapsed ~ #panelFloat { display: inline-flex; }
  #panelFloat { display: none; }
}

/* ===== marker 科技感配色 v2（覆盖 1.9.12 基础样式） ===== */
.pin {
  background: rgba(13, 20, 36, 0.88);          /* 深蓝黑玻璃 */
  border: 1px solid rgba(56, 189, 248, 0.55);  /* 青色霓虹描边 */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.30),
              0 0 0 1px rgba(56, 189, 248, 0.12),
              0 0 10px rgba(56, 189, 248, 0.18);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.pin .nm { color: #eaf6ff; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.pin .dot {
  border: 2px solid rgba(255,255,255,.85);
  background: #22d3ee;
  box-shadow: 0 0 6px rgba(34,211,238,.9), 0 0 12px rgba(34,211,238,.5);
}
.pin.web .dot { background: #a78bfa; box-shadow: 0 0 6px rgba(167,139,250,.9), 0 0 12px rgba(167,139,250,.5); }
.pin.miniprogram .dot { background: #fbbf24; box-shadow: 0 0 6px rgba(251,191,36,.9), 0 0 12px rgba(251,191,36,.5); }
.pin.off {
  background: rgba(30, 41, 59, 0.55);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: none;
}
.pin.off .dot { background: #64748b; box-shadow: none; }
.pin.off .nm { color: #94a3b8; text-shadow: none; }

/* 平台标签科技感 */
.pin .plt { background: rgba(34, 211, 238, 0.16); color: #67e8f9; border: 1px solid rgba(34,211,238,.3); }
.pin.web .plt { background: rgba(167,139,250,.16); color: #c4b5fd; border-color: rgba(167,139,250,.3); }
.pin.miniprogram .plt { background: rgba(251,191,36,.16); color: #fcd34d; border-color: rgba(251,191,36,.3); }
.pin.off .plt { background: rgba(148,163,184,.12); color: #94a3b8; border-color: rgba(148,163,184,.2); }

/* 选中：蓝紫渐变 + 霓虹外发光 */
.pin.sel {
  background: linear-gradient(135deg, #0ea5e9, #7c3aed);
  border-color: rgba(255,255,255,.85);
  box-shadow: 0 0 0 4px rgba(56,189,248,.22),
              0 4px 22px rgba(124,58,237,.55),
              0 0 24px rgba(56,189,248,.35);
}
.pin.sel .nm { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.35); }
.pin.sel .dot { background: #fff; box-shadow: 0 0 8px rgba(255,255,255,.95), 0 0 16px rgba(255,255,255,.5); }
.pin.sel .plt { background: rgba(255,255,255,.22); color: #fff; border-color: rgba(255,255,255,.4); }
.pin.sel .spd { background: rgba(255,255,255,.22); color: #fff; }

/* 选中 pulse（霓虹扩散） */
@keyframes pin-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(56,189,248,.55), 0 4px 22px rgba(124,58,237,.55), 0 0 24px rgba(56,189,248,.35); }
  70%  { box-shadow: 0 0 0 18px rgba(56,189,248,0), 0 4px 22px rgba(124,58,237,.55), 0 0 24px rgba(56,189,248,.35); }
  100% { box-shadow: 0 0 0 0 rgba(56,189,248,0), 0 4px 22px rgba(124,58,237,.55), 0 0 24px rgba(56,189,248,.35); }
}
.pin.sel { animation: pin-pulse 1.8s ease-out infinite; }

/* 时速徽章适配科技感 */
.pin .spd { background: rgba(34, 211, 238, 0.16); color: #67e8f9; }

/* 暗色底图（cartodark）下 marker 白字更亮 */
.leaflet-container.dark .pin { border-color: rgba(255,255,255,.4); }
.leaflet-container.dark .pin .nm { color: #fff; }

/* ===== 1.9.15：顶部数字绿色发光 + 全览中文按钮 ===== */
.stat .num {
  color: #2eea8f;
  text-shadow: 0 0 5px rgba(46, 234, 143, 0.95),
               0 0 12px rgba(46, 234, 143, 0.55),
               0 0 22px rgba(46, 234, 143, 0.3);
}
html[data-theme="dark"] .stat .num {
  color: #34f5a1;
  text-shadow: 0 0 6px rgba(52, 245, 161, 1),
               0 0 14px rgba(52, 245, 161, 0.6),
               0 0 26px rgba(52, 245, 161, 0.35);
}
/* 全览按钮：纯中文文字，去掉图标残留 */
#fitBtn { min-width: 48px; justify-content: center; }
#fitBtn .ic { display: none; }

/* ===== 1.9.16：路网/卫星切换按钮（发光字质感） ===== */
#basemapToggle.basemap-glow {
  color: #2eea8f;
  text-shadow: 0 0 6px rgba(46, 234, 143, 0.9),
               0 0 12px rgba(46, 234, 143, 0.5);
  border-color: rgba(46, 234, 143, 0.4);
  min-width: 52px; justify-content: center;
}
#basemapToggle.basemap-glow:hover {
  border-color: rgba(46, 234, 143, 0.85);
  box-shadow: 0 0 12px rgba(46, 234, 143, 0.3);
  color: #34f5a1;
}

/* ===== marker v3：圆形头像 + 方向箭头外圈 + 悬浮标签 ===== */
.pin-wrap2 { background: none !important; border: none !important; }
/* 1.9.31：固定容器高度 86px + 头像底部对齐 → 头像中心位置可预测（= 坐标点 = 精度圈圆心） */
.pt { display: flex; flex-direction: column; align-items: center; height: 86px; box-sizing: border-box; }
.pt-ava { margin-top: auto; }   /* 1.9.31：头像底部对齐容器底部 → 中心 y 恒为 86-19=67px */
.pt-ava {
  position: relative; width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #7c3aed);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35),
              0 0 14px rgba(56, 189, 248, 0.4),
              0 2px 8px rgba(0, 0, 0, 0.3);
  display: flex; align-items: center; justify-content: center;
  overflow: visible; flex: 0 0 auto;
}
.pt-ava .ava-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.pt-ava .ava-emoji { font-size: 20px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.pt-ring {
  position: absolute; inset: -4px; border-radius: 50%;
  border: 1.5px dashed rgba(103, 232, 249, 0.7);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.25) inset;
  pointer-events: none;
}
.pt-arrow {
  position: absolute; top: -4px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 8px solid #67e8f9;
  filter: drop-shadow(0 0 3px rgba(103, 232, 249, 0.9));
}
.pt-label {
  display: flex; flex-direction: column; gap: 1px;
  background: rgba(13, 20, 36, 0.88);
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 8px; padding: 3px 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), 0 0 8px rgba(56, 189, 248, 0.15);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  white-space: nowrap;
}
.pt-nm { font-size: 12px; font-weight: 700; color: #eaf6ff; line-height: 1.2; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.pt-sub { font-size: 10px; color: #8fd8ff; font-variant-numeric: tabular-nums; line-height: 1.2; }
.pt-spd { font-size: 10px; color: #67e8f9; font-weight: 700; line-height: 1.2; }

/* 离线 */
.pt.off .pt-ava { background: #334155; border-color: #64748b; box-shadow: none; }
.pt.off .pt-ring { border-color: rgba(148, 163, 184, 0.4); }
.pt.off .pt-arrow { border-top-color: #64748b; filter: none; }
.pt.off .pt-label { background: rgba(30, 41, 59, 0.6); border-color: rgba(148, 163, 184, 0.3); }
.pt.off .pt-nm { color: #94a3b8; text-shadow: none; }
.pt.off .pt-sub { color: #94a3b8; }
.pt.off .pt-spd { display: none; }

/* 选中 */
.pt.sel .pt-ava {
  border-color: #fff;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.3),
              0 0 20px rgba(56, 189, 248, 0.6),
              0 4px 16px rgba(0, 0, 0, 0.4);
}
.pt.sel .pt-label {
  background: linear-gradient(135deg, #0ea5e9, #7c3aed);
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25), 0 4px 14px rgba(124, 58, 237, 0.5);
}
.pt.sel .pt-nm { color: #fff; }
.pt.sel .pt-sub { color: rgba(255, 255, 255, 0.85); }
.pt.sel .pt-spd { color: #fff; }
@keyframes pt-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.5), 0 0 20px rgba(56, 189, 248, 0.6), 0 4px 16px rgba(0,0,0,0.4); }
  70%  { box-shadow: 0 0 0 16px rgba(56, 189, 248, 0), 0 0 20px rgba(56, 189, 248, 0.6), 0 4px 16px rgba(0,0,0,0.4); }
  100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0), 0 0 20px rgba(56, 189, 248, 0.6), 0 4px 16px rgba(0,0,0,0.4); }
}
.pt.sel .pt-ava { animation: pt-pulse 1.8s ease-out infinite; }

/* 竖屏：标签紧凑（保留刷新时间+时速，字号缩小） */
@media (orientation: portrait) and (max-width: 720px) {
  .pt-label { padding: 2px 6px; }
  .pt-sub { font-size: 9px; }
  .pt-spd { font-size: 9px; }
  .pt-ava { width: 34px; height: 34px; }
  .pt-ava .ava-emoji { font-size: 17px; }
}

/* 1.9.23：轨迹暂禁用，隐藏按钮 */
#dcTrail { display: none !important; }
