/* ==========================================================================
   TMP 实时遥测地图工作台（复刻 EVM 后台现代设计系统 + 实时车速 km/h）
   ========================================================================== */
:root {
  --bg: #f3f5f9;
  --bg-soft: #eaeff6;
  --card: #ffffff;
  --card-2: #f8fafc;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #8391a7;
  --line: #e2e8f0;
  --line-2: #eef2f7;
  --brand: #2563eb;
  --brand-2: #3b82f6;
  --brand-soft: #eff6ff;
  --brand-ink: #1d4ed8;
  --ok: #10b981;
  --ok-soft: #ecfdf5;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --bad: #ef4444;
  --bad-soft: #fef2f2;
  --purple: #7c3aed;
  --purple-soft: #f5f3ff;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .03);
  --shadow-2: 0 6px 20px rgba(15, 23, 42, .07);
  --shadow-3: 0 16px 40px rgba(15, 23, 42, .14);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

html[data-theme="dark"] {
  --bg: #0b0f17;
  --bg-soft: #111827;
  --card: #131a26;
  --card-2: #182131;
  --ink: #eef2f7;
  --ink-2: #94a3b8;
  --ink-3: #64748b;
  --line: #232e42;
  --line-2: #1b2436;
  --brand: #3b82f6;
  --brand-2: #60a5fa;
  --brand-soft: rgba(59, 130, 246, .16);
  --brand-ink: #93c5fd;
  --ok: #22c55e;
  --ok-soft: rgba(34, 197, 94, .14);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, .15);
  --bad: #f87171;
  --bad-soft: rgba(248, 113, 113, .15);
  --purple: #a78bfa;
  --purple-soft: rgba(167, 139, 250, .14);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, .42);
  --shadow-3: 0 18px 44px rgba(0, 0, 0, .58);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 13.5px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
svg { width: 15px; height: 15px; flex-shrink: 0; }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--ink-3) 35%, transparent);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-track { background: transparent; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--ink);
  font-size: 12px;
  font-weight: 560;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: .14s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-3); padding: 0 6px; height: 26px; }
.btn.ghost:hover { background: var(--card-2); color: var(--ink); border-color: transparent; }

/* ---------------- 主工作台壳 ---------------- */
.map-shell {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #e2e4e8;
}

.map-side {
  width: 280px;
  flex: 0 0 280px;
  background: var(--card);
  color: var(--ink);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 15;
  overflow: hidden;
  transition: width .22s cubic-bezier(.2, .8, .3, 1), flex-basis .22s cubic-bezier(.2, .8, .3, 1), transform .22s;
  box-shadow: 2px 0 14px rgba(15, 23, 42, .05);
}
.map-side.folded { width: 0; flex-basis: 0; border-right: 0; box-shadow: none; }

.map-side-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2px;
  flex-shrink: 0;
}
.map-side-title svg {
  width: 16px;
  height: 16px;
  color: var(--brand);
  flex-shrink: 0;
}

.map-timebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--card-2);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.map-timebar .lbl {
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}
.map-timebar .lbl svg { color: var(--brand); }
.map-timebar .val {
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .2px;
}

.map-side-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 10px 18px;
}

.map-layer-seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  background: var(--bg);
  padding: 3px;
  border-radius: 9px;
  border: 1px solid var(--line);
  margin-bottom: 12px;
}
.map-layer-btn {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  padding: 6px 4px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: .15s;
  text-align: center;
}
.map-layer-btn:hover { color: var(--ink); }
.map-layer-btn.on { background: var(--card); color: var(--brand); box-shadow: var(--shadow-1); }

.map-sec { margin-bottom: 14px; }
.map-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: .5px;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
}
.map-sec-head .left { display: flex; align-items: center; gap: 6px; }
.map-sec-head .right-meta { display: inline-flex; align-items: center; gap: 6px; }
.map-sec-head em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--brand);
  font-weight: 700;
}
.map-sec-head .chev { transition: transform .18s; opacity: .7; }
.map-sec.closed .map-sec-head .chev { transform: rotate(-90deg); }
.map-sec.closed .map-sec-body { display: none; }

.map-empty-hint {
  padding: 10px 8px;
  color: var(--ink-3);
  font-size: 12px;
  text-align: center;
}

.map-sub-label {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-bottom: 4px;
}

/* 车辆车速列表行 */
.map-veh-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 9px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.5px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  border: 1px solid transparent;
  margin-bottom: 3px;
  transition: background .12s, border-color .12s;
}
.map-veh-row:hover { background: var(--card-2); }
.map-veh-row.on {
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 32%, transparent);
}
.map-veh-info { flex: 1; min-width: 0; }
.map-veh-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  line-height: 1.3;
}
.map-veh-row.on .map-veh-name { color: var(--brand-ink); }
.map-veh-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--ink-3);
  font-family: var(--mono);
}

.spd-pill {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.spd-pill.idle { background: var(--line-2); color: var(--ink-3); }
.spd-pill.cruise { background: var(--ok-soft); color: var(--ok); }
.spd-pill.fast { background: var(--warn-soft); color: var(--warn); }
.spd-pill.rapid { background: var(--bad-soft); color: var(--bad); }

/* 服务器行 */
.map-srv-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.5px;
  transition: background .12s, border-color .12s;
  user-select: none;
  margin-bottom: 3px;
  border: 1px solid transparent;
}
.map-srv-row:hover { background: var(--card-2); }
.map-srv-row.on {
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 30%, transparent);
}
.map-srv-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.map-srv-info { flex: 1; min-width: 0; }
.map-srv-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-weight: 560;
  line-height: 1.3;
}
.map-srv-row.on .map-srv-name { color: var(--brand-ink); font-weight: 650; }
.map-srv-bar { height: 3px; border-radius: 2px; background: var(--line-2); margin-top: 4px; overflow: hidden; }
.map-srv-bar i { display: block; height: 100%; border-radius: 2px; background: var(--brand); }
.map-srv-cnt {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.map-srv-row.on .map-srv-cnt { color: var(--brand-ink); }
.map-srv-div { height: 1px; background: var(--line-2); margin: 7px 4px; }

/* 快捷传送 & 热点 */
.map-chip-grid { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.map-loc-chip {
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--ink-2);
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 550;
  cursor: pointer;
  transition: .14s;
}
.map-loc-chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

.map-hot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  margin-bottom: 2px;
  color: var(--ink);
  transition: background .12s;
}
.map-hot-row:hover { background: var(--card-2); }
.map-hot-badge { font-family: var(--mono); font-size: 11px; font-weight: 650; padding: 1px 7px; border-radius: 10px; }
.map-hot-badge.hi { background: var(--bad-soft); color: var(--bad); }
.map-hot-badge.md { background: var(--warn-soft); color: var(--warn); }
.map-hot-badge.lo { background: var(--ok-soft); color: var(--ok); }

/* 开关与底图风格 */
.map-set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 4px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}
.map-set-row:hover { color: var(--ink); }
input.sw[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 34px;
  height: 19px;
  flex: 0 0 34px;
  border-radius: 12px;
  border: 0;
  background: var(--line);
  position: relative;
  cursor: pointer;
  transition: .18s;
}
input.sw[type="checkbox"]::after {
  content: "";
  position: absolute;
  left: 2.5px;
  top: 2.5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: transform .18s;
}
input.sw[type="checkbox"]:checked { background: var(--brand); }
input.sw[type="checkbox"]:checked::after { transform: translateX(15px); }

.map-theme-pills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; margin: 4px 0 8px; }
.map-theme-pill {
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--ink-2);
  border-radius: 7px;
  padding: 5px 4px;
  font-size: 11.5px;
  cursor: pointer;
  text-align: center;
  font-weight: 550;
  transition: .14s;
}
.map-theme-pill:hover { border-color: var(--brand); color: var(--brand); }
.map-theme-pill.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

.map-custom-colors {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin: 0 0 10px;
  padding: 8px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: var(--card-2);
}
.map-color-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 7px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 11.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.map-color-chip:hover { border-color: var(--brand); color: var(--ink); }
.map-color-chip input[type="color"] {
  width: 24px;
  height: 18px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}
.map-color-reset {
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--ink-3);
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 550;
  cursor: pointer;
  transition: .14s;
}
.map-color-reset:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* 车速榜状态筛选 & 显示滑块 */
.map-speed-filter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 7px;
}
.spd-ft-btn {
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--ink-2);
  border-radius: 6px;
  padding: 3px 2px;
  font-size: 11px;
  font-weight: 550;
  cursor: pointer;
  transition: .13s;
}
.spd-ft-btn:hover { border-color: var(--brand); color: var(--brand); }
.spd-ft-btn.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); font-weight: 650; }

.map-range-row {
  padding: 6px 4px 2px;
}
.map-range-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-2);
  margin-bottom: 4px;
}
.map-range-head output {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}
.map-range {
  width: 100%;
  accent-color: var(--brand);
  cursor: pointer;
}

/* 左下角动态比例尺 & 轻提示 Toast */
.map-scale-bar {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 14;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 5px 10px 6px;
  border-radius: 8px;
  pointer-events: none;
}
.map-scale-bar span {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-2);
  line-height: 1;
}
.map-scale-bar i {
  display: block;
  width: 68px;
  height: 5px;
  border: 1.5px solid var(--ink-2);
  border-top: 0;
}

.map-toast {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, 10px);
  z-index: 30;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.map-toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 增强详情浮卡：头像、VTC 徽章、速度波形、统计条 */
.ins-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.ins-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  flex: 0 0 38px;
  border: 1px solid var(--line);
  background: var(--card-2);
}
.ins-avatar-fallback {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex: 0 0 38px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 700;
  font-size: 15px;
  border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
}
.ins-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.ins-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--ink-2);
}
.ins-badge.vtc {
  background: var(--purple-soft);
  border-color: color-mix(in srgb, var(--purple) 28%, transparent);
  color: var(--purple);
}
.ins-badge.vtc:hover { text-decoration: underline; }
.ins-badge.role {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 30%, transparent);
  color: var(--warn);
}
.ins-copy-btn {
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.ins-copy-btn:hover { color: var(--brand); text-decoration: underline; }

.ins-vtc-card {
  background: var(--card-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 9px 11px;
  margin-bottom: 10px;
}
.ins-vtc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ins-vtc-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: .3px;
}
.ins-vtc-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--purple-soft);
  color: var(--purple);
}
.ins-vtc-name {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.35;
  word-break: break-word;
}
.ins-vtc-name:hover { color: var(--brand); text-decoration: underline; }
.ins-roles-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}
.ins-role-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  max-width: 100%;
}
.ins-role-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 7px;
}
.ins-role-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ins-vtc-empty {
  font-size: 12px;
  color: var(--ink-3);
}
.map-inspector-ops {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

/* ---------------- 画布区域与悬浮玻璃控件 ---------------- */
.map-stage {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}
#mapCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}

.map-top-bar {
  position: absolute;
  left: 14px;
  top: 14px;
  right: 14px;
  z-index: 16;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}
.map-glass {
  pointer-events: auto;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  box-shadow: 0 4px 18px rgba(15, 23, 42, .11);
  color: var(--ink);
}
.map-fold-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .14s;
}
.map-fold-btn:hover { border-color: var(--brand); color: var(--brand); }

.map-search-wrap {
  position: relative;
  width: 300px;
  max-width: calc(100vw - 140px);
  pointer-events: auto;
}
.map-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--ink-3);
}
.map-search-box input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  height: 34px;
  padding: 0;
  font-size: 13px;
  color: var(--ink);
}
.map-search-box input::-webkit-search-cancel-button { display: none; }

.map-search-drop {
  position: absolute;
  left: 0;
  right: 0;
  top: 44px;
  border-radius: 11px;
  padding: 6px;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  z-index: 22;
}
.map-search-drop.on { display: block; }
.map-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12.5px;
  transition: background .12s;
}
.map-search-item:hover { background: var(--brand-soft); }
.map-search-item .t { color: var(--ink); font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-search-item .m { color: var(--ink-3); font-size: 11px; font-family: var(--mono); flex-shrink: 0; }
.map-tag {
  display: inline-block;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 650;
  margin-right: 6px;
  vertical-align: middle;
}
.map-tag.city { background: var(--brand-soft); color: var(--brand-ink); }
.map-tag.country { background: var(--purple-soft); color: var(--purple); }
.map-tag.player { background: var(--ok-soft); color: var(--ok); }

.map-status-pills {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.map-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 550;
}
.map-pill b { font-family: var(--mono); font-weight: 700; }
.map-pill .muted { color: var(--ink-3); }
.map-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.map-pill.warn .dot { background: var(--warn); }
.map-pill.err .dot { background: var(--bad); }

.map-fab-group {
  position: absolute;
  right: 14px;
  bottom: 16px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  border-radius: 11px;
  overflow: hidden;
}
.map-fab {
  width: 36px;
  height: 36px;
  border: 0;
  border-bottom: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .13s;
}
.map-fab:last-child { border-bottom: 0; }
.map-fab:hover { background: var(--brand-soft); color: var(--brand); }

.map-bottom-hud {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 14;
  display: flex;
  align-items: center;
  gap: 6px;
}
.map-hud-chip {
  font-size: 11px;
  font-family: var(--mono);
  padding: 4px 9px;
  border-radius: 8px;
  color: var(--ink-2);
}

.map-tip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 23, 42, .94);
  color: #f8fafc;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  opacity: 0;
  transition: opacity .1s;
  white-space: nowrap;
  z-index: 25;
  transform: translate(-50%, -135%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
}
.map-tip .sub {
  font-size: 11px;
  color: #94a3b8;
  font-family: var(--mono);
  margin-top: 2px;
}

/* 详情与车速仪表浮卡 */
.map-inspector {
  position: absolute;
  right: 62px;
  bottom: 16px;
  width: 312px;
  max-width: calc(100% - 80px);
  border-radius: 14px;
  padding: 14px 16px;
  z-index: 18;
  display: none;
}
.map-inspector.on { display: block; }
.map-inspector-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.map-inspector-name { font-size: 15px; font-weight: 700; color: var(--ink); word-break: break-word; }
.map-inspector-meta { font-size: 11.5px; color: var(--ink-3); font-family: var(--mono); margin-top: 2px; }

.ins-speed-box {
  background: var(--card-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.ins-speed-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.ins-speed-num {
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.ins-speed-num strong {
  font-family: var(--mono);
  font-size: 32px;
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.ins-speed-num span {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}
.ins-speed-bar {
  margin-top: 8px;
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.ins-speed-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981 0%, #2563eb 55%, #f59e0b 78%, #ef4444 100%);
  transition: width .16s linear;
}

.map-inspector-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 11.5px;
  background: var(--card-2);
  border: 1px solid var(--line-2);
  border-radius: 9px;
  padding: 9px 10px;
  margin-bottom: 12px;
}
.map-inspector-grid span { color: var(--ink-3); display: block; font-size: 10.5px; }
.map-inspector-grid b { color: var(--ink); font-family: var(--mono); font-size: 12px; }

.map-inspector-ops { display: flex; gap: 6px; }
.map-inspector-ops .btn { flex: 1; }

/* OAuth 鉴权弹窗 */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, .72);
  backdrop-filter: blur(10px);
}
.auth-overlay[hidden] { display: none; }
.auth-card {
  max-width: 410px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  text-align: center;
  box-shadow: var(--shadow-3);
}
.auth-kicker { margin: 0 0 8px; color: var(--brand); font-size: 12px; font-weight: 700; }
.auth-card h2 { margin: 0 0 10px; font-size: 18px; }
.auth-card p { margin: 0 0 18px; color: var(--ink-2); font-size: 13px; }
.auth-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 20px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

@media (max-width: 820px) {
  .map-side { position: absolute; left: 0; top: 0; bottom: 0; z-index: 25; }
  .map-side.folded { transform: translateX(-100%); width: 280px; }
  .map-search-wrap { width: 205px; }
  .map-pill.hide-sm { display: none; }
}
