/* ==========================================================================
   开源地图服务 —— 样式表
   浅色主题，干净克制，贴合地图应用的信息层级
   ========================================================================== */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #e3e6ea;
  --border-strong: #cfd4da;
  --text: #1c2024;
  --text-2: #5b6470;
  --text-3: #8a929c;
  --brand: #1f6feb;
  --brand-dark: #1858bd;
  --brand-soft: #e8f1fe;
  --accent: #d33a2c;
  --success: #12805c;
  --warn: #b8730a;
  --danger: #c0392b;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.1);
  --shadow-lg: 0 8px 28px rgba(16, 24, 40, 0.14);
  --radius: 8px;
  --radius-lg: 12px;
  --topbar-h: 76px;
  --sidebar-w: 348px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

#app { display: flex; flex-direction: column; height: 100vh; }

/* ---------- 顶栏 ---------- */
.topbar {
  height: var(--topbar-h);
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start; /* 搜索框与右侧按钮以顶线对齐；模式 chips 挂在搜索框下方 */
  gap: 20px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  z-index: 30;
  height: 90px;
}

.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; padding-top: 19px; }
.brand-dot {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, var(--brand), #4f9dff);
  box-shadow: 0 2px 6px rgba(31, 111, 235, 0.35);
  position: relative;
}
.brand-dot::after {
  content: ""; position: absolute; inset: 7px;
  border: 1.5px solid rgba(255,255,255,0.9); border-radius: 2px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; letter-spacing: .2px; }
.brand-text small { font-size: 11px; color: var(--text-3); }

/* 搜索区 */
.search-wrap { flex: 1 1 auto; max-width: 620px; position: relative; padding-top: 15px; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.search-box:focus-within {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.search-icon { width: 16px; height: 16px; color: var(--text-3); flex: 0 0 auto; }
.search-box input {
  flex: 1 1 auto; border: none; outline: none; background: transparent;
  font-size: 14px; font-family: inherit; color: var(--text);
}
.search-box input::placeholder { color: var(--text-3); }

.icon-btn {
  border: none; background: transparent; cursor: pointer;
  color: var(--text-3); font-size: 18px; line-height: 1;
  width: 22px; height: 22px; border-radius: 4px;
  display: grid; place-items: center;
  transition: background .12s, color .12s;
}
.icon-btn:hover { background: #eef0f3; color: var(--text); }

/* 搜索模式 */
.search-modes { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.mode-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 11px; font-family: inherit;
  padding: 2px 9px; border-radius: 20px; cursor: pointer;
  transition: all .12s;
}
.mode-chip:hover { border-color: var(--border-strong); color: var(--text); }
.mode-chip.active {
  background: var(--brand-soft); border-color: #b6d3fb; color: var(--brand-dark); font-weight: 600;
}
.mode-chip.tool-chip { color: var(--brand-dark); border-color: #c4d9f7; }
.mode-chip.tool-chip:hover { background: var(--brand-soft); }
.mode-chip.tool-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.mode-sep { width: 1px; height: 14px; background: var(--border-strong); margin: 0 2px; }

/* 搜索联想 */
.suggest-list {
  position: absolute; top: 46px; left: 0; right: 0;
  margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: 320px; overflow-y: auto; z-index: 40;
}
.suggest-list li {
  padding: 7px 10px; border-radius: 6px; cursor: pointer;
  display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
}
.suggest-list li:hover, .suggest-list li.active { background: var(--brand-soft); }
.suggest-list .s-name { font-size: 13px; }
.suggest-list .s-meta { font-size: 11px; color: var(--text-3); white-space: nowrap; }
/* 搜索历史：单条删除 / 清空 */
.suggest-list .s-del {
  border: none; background: none; color: var(--text-3);
  font-size: 14px; line-height: 1; cursor: pointer; padding: 2px 4px;
  border-radius: 4px;
}
.suggest-list .s-del:hover { color: var(--danger, #d85a30); background: var(--surface-2); }
.suggest-list .s-clear {
  justify-content: center; font-size: 12px; color: var(--text-3);
  border-top: 1px solid var(--border); border-radius: 0; margin-top: 2px;
}
.suggest-list .s-clear:hover { color: var(--danger, #d85a30); background: none; }

/* 顶栏按钮 */
.topbar-actions { display: flex; gap: 8px; flex: 0 0 auto; padding-top: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 13px; font-family: inherit; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: all .15s;
}
.btn-ico { width: 15px; height: 15px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(31,111,235,.3); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { background: var(--surface); color: var(--text-2); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- 布局 ---------- */
.layout { flex: 1 1 auto; display: flex; min-height: 0; }
.map-area { flex: 1 1 auto; position: relative; min-width: 0; }
.map {
  position: absolute;
  inset: 0;
  background: #eaecef;
}

/* 只有切到侧栏「标注」面板时才给图钉光标 —— 光标是「点下去会发生什么」的承诺，
   在「图层」「关于」等面板下还显示图钉就是在骗人（那里点击不会落点）。 */
.map--add-marker {
  cursor:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='38'%3E%3Cpath d='M14 1.6C7.6 1.6 2.4 6.8 2.4 13.2c0 8.4 11.6 22.2 11.6 22.2s11.6-13.8 11.6-22.2c0-6.4-5.2-11.6-11.6-11.6z' fill='%23e5484d' stroke='%23ffffff' stroke-width='2.4'/%3E%3Ccircle cx='14' cy='13.2' r='4.4' fill='%23ffffff'/%3E%3C/svg%3E")
      14 37,
    crosshair;
}

/* 状态提示条：光标只说明「形状」，这句把「后果」说清楚。
   鼠标移出地图或拖动时自动隐藏，避免长期占用视野。 */
.map-hint {
  position: absolute;
  z-index: 10;
  left: 50%;
  bottom: 52px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(30, 35, 48, 0.92);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.14s ease;
}
.map-hint.show { opacity: 1 }
.map-hint svg { width: 13px; height: 13px; flex: none; opacity: 0.9 }
.map-hint b { font-weight: 600 }

/* 地图悬浮层 */
.map-overlay { position: absolute; z-index: 10; pointer-events: none; }
.map-overlay > * { pointer-events: auto; }
.map-overlay--tl { top: 12px; left: 12px; display: flex; gap: 6px; }
.map-overlay--tr { top: 12px; right: 12px; }
.map-overlay--bl { bottom: 42px; left: 12px; }

.pill {
  background: rgba(255,255,255,.94);
  border: 1px solid var(--border);
  border-radius: 6px; padding: 3px 9px;
  font-size: 11px; font-family: var(--mono);
  color: var(--text-2); backdrop-filter: blur(6px);
  box-shadow: var(--shadow-sm);
}
.pill--muted { color: var(--text-3); }

.layer-switch {
  display: flex; background: rgba(255,255,255,.94);
  border: 1px solid var(--border); border-radius: 7px;
  padding: 2px; gap: 2px; backdrop-filter: blur(6px);
  box-shadow: var(--shadow-sm);
}
.layer-btn {
  border: none; background: transparent; cursor: pointer;
  font-size: 12px; font-family: inherit; color: var(--text-2);
  padding: 4px 11px; border-radius: 5px; transition: all .12s;
}
.layer-btn:hover { background: #eef0f3; }
.layer-btn.active { background: var(--brand); color: #fff; font-weight: 500; }

/* 结果浮层 */
.result-panel {
  width: 340px; max-height: 46vh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.result-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--text-2);
  background: var(--surface-2);
}
.result-list { margin: 0; padding: 4px; list-style: none; overflow-y: auto; }
.result-list li {
  padding: 8px 10px; border-radius: 6px; cursor: pointer;
  border-left: 3px solid transparent; transition: all .12s;
}
.result-list li:hover { background: var(--brand-soft); border-left-color: var(--brand); }
.result-list .r-name { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.result-list .r-addr { font-size: 11px; color: var(--text-3); line-height: 1.45; }
.result-list .r-tag {
  display: inline-block; margin-top: 3px; padding: 1px 6px;
  font-size: 10px; border-radius: 3px;
  background: #eef0f3; color: var(--text-2); font-family: var(--mono);
}
.result-list .r-tag.local { background: #fdf0e3; color: var(--warn); }
.result-list .r-tag.nominatim { background: #e6f5ef; color: var(--success); }

/* 状态栏 */
/* --------------------------------------------------------------------------
   路线规划面板
   面板宽度刻意压到 320：再宽就会挡住左边的缩放控件与署名，路线结果还要往下堆
   -------------------------------------------------------------------------- */
.tl-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.pill-row { display: flex; gap: 6px; }

.route-panel {
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 10px;
  font-size: 13px;
}
.route-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.route-head strong { font-size: 13px; }
.route-badge {
  margin-left: auto;
  font-size: 11px;
  color: var(--success);
  background: rgba(18, 128, 92, 0.1);
  border-radius: 999px;
  padding: 1px 7px;
}
.route-head .icon-btn { margin-left: 4px; }

.route-io {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
}
.route-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}
.route-dot--start { background: var(--success); box-shadow: 0 0 0 3px rgba(18, 128, 92, 0.16); }
.route-dot--end { background: var(--accent); box-shadow: 0 0 0 3px rgba(211, 58, 44, 0.16); }
.route-input-wrap { position: relative; flex: 1; min-width: 0; }
.route-input-wrap input {
  width: 100%;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
}
.route-input-wrap input:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.route-pick { width: 30px; height: 30px; flex: none; }

.route-suggest {
  position: absolute;
  top: 35px;
  left: 0;
  right: 0;
  max-height: 216px;
  overflow: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 20;
}
.route-suggest li {
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.35;
}
.route-suggest li:hover { background: var(--brand-soft); }
.route-suggest .rs-name { color: var(--text); }
.route-suggest .rs-sub { color: var(--text-3); font-size: 11.5px; }

.route-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}
.route-mini {
  height: 26px;
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}
.route-mini:hover { border-color: var(--brand); color: var(--brand); }
.route-profiles { display: flex; gap: 4px; margin-left: auto; }
.rp-chip {
  height: 26px;
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}
.rp-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.route-go { width: 100%; height: 34px; justify-content: center; }
.route-go[disabled] { opacity: 0.6; cursor: default; }

.route-result {
  margin-top: 9px;
  border-top: 1px dashed var(--border);
  padding-top: 9px;
  max-height: 300px;
  overflow: auto;
}
.route-summary { display: flex; align-items: baseline; gap: 10px; }
.route-summary .rs-dist { font-size: 19px; font-weight: 700; color: var(--brand); }
.route-summary .rs-dur { color: var(--text-2); }
.route-meta {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.5;
}
.route-meta .rm-warn { color: var(--warn); }
.route-steps { margin: 8px 0 0; padding: 0; list-style: none; }
.route-steps li {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 0;
  border-top: 1px solid var(--surface-2);
  font-size: 12.5px;
}
.route-steps .rs-bar {
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--brand);
  flex: none;
  opacity: 0.75;
}
.route-steps .rs-txt { flex: 1; color: var(--text); }
.route-steps .rs-len { color: var(--text-3); font-size: 11.5px; }
.route-error { color: var(--danger); font-size: 12.5px; line-height: 1.5; }
.route-empty { color: var(--text-3); font-size: 12px; line-height: 1.6; }

/* ---------------------------------------------------------------- 测距 */
.measure-panel { width: 260px; }
.measure-total {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0 8px;
  border-bottom: 1px solid var(--surface-2);
}
.measure-total .mt-label { font-size: 12px; color: var(--text-3); }
.measure-total .mt-value { font-size: 20px; font-weight: 700; color: var(--accent); }
.measure-hint {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-3);
}
.measure-panel .route-actions { margin-top: 8px; }

/* 顶点上的累计距离标签：整块可点（× 直接删掉这个点） */
.ms-vertex {
  display: flex;
  align-items: center;
  gap: 3px;
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(211, 58, 44, 0.4);
  border-radius: 4px;
  padding: 1px 3px 1px 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  user-select: none;
}
.ms-vertex-del {
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  border-radius: 3px;
}
.ms-vertex-del:hover { background: rgba(211, 58, 44, 0.12); color: var(--danger); }

/* 测距模式下光标用十字，且不再显示「点此加标注」的图钉 */
.map--measuring { cursor: crosshair; }
.map--measuring.map--add-marker { cursor: crosshair; }


.statusbar {
  position: absolute; bottom: 0; left: 0; right: 0; height: 28px;
  display: flex; align-items: center; gap: 8px; padding: 0 12px;
  background: rgba(255,255,255,.93); border-top: 1px solid var(--border);
  font-size: 11px; font-family: var(--mono); color: var(--text-2);
  backdrop-filter: blur(6px); z-index: 10;
}
.statusbar .sep { color: var(--border-strong); }
.statusbar .ok { color: var(--success); }
.statusbar .warn { color: var(--warn); }

/* ---------- 侧栏 ---------- */
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: var(--surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; min-height: 0;
  transition: margin-right .22s ease;
}
.sidebar.collapsed { margin-right: calc(-1 * var(--sidebar-w)); }

.tabs { display: flex; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.tab {
  flex: 1 1 0; border: none; background: transparent; cursor: pointer;
  padding: 11px 4px; font-size: 12.5px; font-family: inherit;
  color: var(--text-3); font-weight: 500;
  border-bottom: 2px solid transparent; transition: all .14s;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

.panel { display: none; padding: 14px; overflow-y: auto; flex: 1 1 auto; }
.panel.active { display: block; }

.panel-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--text-3);
  margin: 18px 0 8px;
}
.panel-title:first-child { margin-top: 0; }
.panel-hint { font-size: 12px; color: var(--text-3); line-height: 1.6; margin: 0 0 12px; }
.panel-hint code {
  font-family: var(--mono); font-size: 11px;
  background: #eef0f3; padding: 1px 4px; border-radius: 3px;
}

/* 底图列表 */
.basemap-list { display: flex; flex-direction: column; gap: 7px; }
.basemap-item {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 9px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
  transition: all .14s; background: var(--surface);
}
.basemap-item:hover { border-color: var(--border-strong); background: var(--surface-2); }
.basemap-item.active { border-color: var(--brand); background: var(--brand-soft); }
.basemap-item input { margin-top: 2px; accent-color: var(--brand); flex: 0 0 auto; }
.bm-body { flex: 1 1 auto; min-width: 0; }
.bm-name { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.bm-desc { font-size: 11px; color: var(--text-3); line-height: 1.5; }
.bm-attrib {
  font-size: 10px; color: var(--text-3); margin-top: 3px;
  font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 开关行 */
.switch-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 2px; font-size: 13px; cursor: pointer; color: var(--text-2);
}
.switch-row input { accent-color: var(--brand); width: 15px; height: 15px; }
.switch-row:hover { color: var(--text); }

/* KV 列表 */
.kv-list { display: flex; flex-direction: column; gap: 5px; }
.kv-row {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 12px; padding: 5px 8px; border-radius: 5px; background: var(--surface-2);
}
.kv-row .k { color: var(--text-3); }
.kv-row .v { font-family: var(--mono); font-size: 11px; color: var(--text); text-align: right; }
.kv-row .v.ok { color: var(--success); }
.kv-row .v.warn { color: var(--warn); }

/* 表单 */
.field { margin-bottom: 11px; }
.field label {
  display: block; font-size: 11.5px; color: var(--text-3);
  margin-bottom: 4px; font-weight: 500;
}
.field input, .field select {
  width: 100%; height: 34px; padding: 0 9px;
  border: 1px solid var(--border-strong); border-radius: 6px;
  font-size: 13px; font-family: var(--mono); color: var(--text);
  background: var(--surface); outline: none; transition: all .14s;
}
.field select { font-family: var(--font); }
.field input:focus, .field select:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.field input[type="color"] { padding: 3px; cursor: pointer; }
.btn-row { display: flex; gap: 8px; margin: 12px 0; }
.btn-row .btn { flex: 0 0 auto; }
.btn-row .btn-block { flex: 1 1 auto; }

/* 坐标转换结果 */
.coord-result { display: flex; flex-direction: column; gap: 6px; }
.cr-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 10px; background: var(--surface-2);
}
.cr-card.source { background: var(--brand-soft); border-color: #b6d3fb; }
.cr-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 3px;
}
.cr-name { font-size: 12px; font-weight: 600; color: var(--text); }
.cr-badge {
  font-size: 10px; font-family: var(--mono); color: var(--text-3);
  background: var(--surface); padding: 1px 5px; border-radius: 3px;
  border: 1px solid var(--border);
}
.cr-val {
  font-family: var(--mono); font-size: 11.5px; color: var(--text-2);
  word-break: break-all; line-height: 1.5;
}
.cr-offset { font-size: 10.5px; color: var(--warn); font-family: var(--mono); margin-top: 2px; }
.cr-desc { font-size: 10.5px; color: var(--text-3); margin-top: 3px; line-height: 1.5; }

.crs-doc { display: flex; flex-direction: column; gap: 6px; }
.crs-doc-item {
  font-size: 11.5px; line-height: 1.6; color: var(--text-2);
  padding: 7px 9px; background: var(--surface-2); border-radius: 6px;
}
.crs-doc-item b { color: var(--text); font-family: var(--mono); font-size: 11px; }

/* 标注列表 */
.marker-list { display: flex; flex-direction: column; gap: 6px; }
.marker-item {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 8px 9px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface);
  transition: all .14s;
}
.marker-item:hover { border-color: var(--border-strong); background: var(--surface-2); }
.mk-swatch {
  width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; margin-top: 3px;
  box-shadow: 0 0 0 2px rgba(0,0,0,.06);
}
.mk-body { flex: 1 1 auto; min-width: 0; }
.mk-name { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.mk-coord { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); }
.mk-actions { display: flex; gap: 3px; flex: 0 0 auto; }
.mk-btn {
  border: none; background: transparent; cursor: pointer;
  color: var(--text-3); padding: 3px; border-radius: 4px;
  display: grid; place-items: center; transition: all .12s;
}
.mk-btn:hover { background: #eef0f3; color: var(--brand); }
.mk-btn.danger:hover { color: var(--danger); }
.mk-btn svg { width: 13px; height: 13px; }

/* 关于面板 */
.about-block {
  font-size: 12px; line-height: 1.75; color: var(--text-2);
  background: var(--surface-2); padding: 10px 12px; border-radius: var(--radius);
}
.about-block p { margin: 0 0 6px; }
.about-block p:last-child { margin-bottom: 0; }
.about-block code {
  font-family: var(--mono); font-size: 11px;
  background: #e8ebee; padding: 1px 4px; border-radius: 3px;
}

.feature-table { display: flex; flex-direction: column; gap: 5px; }
.ft-row {
  display: flex; gap: 9px; font-size: 11.5px; line-height: 1.6;
  padding: 7px 9px; background: var(--surface-2); border-radius: 6px;
}
.ft-k {
  flex: 0 0 42px; font-weight: 600; color: var(--brand-dark);
}
.ft-v { color: var(--text-2); }

.api-links { display: flex; flex-direction: column; gap: 4px; }
.api-links a {
  font-family: var(--mono); font-size: 11px;
  color: var(--brand); text-decoration: none;
  padding: 6px 9px; background: var(--surface-2);
  border-radius: 5px; border: 1px solid var(--border);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: all .12s;
}
.api-links a:hover { background: var(--brand-soft); border-color: #b6d3fb; }

.loading-inline { font-size: 12px; color: var(--text-3); padding: 8px 2px; }
.hidden { display: none !important; }

/* ---------- 地图弹窗 ---------- */
.ol-popup {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  min-width: 230px; max-width: 320px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 12px 14px 13px;
}
.ol-popup::after {
  content: ""; position: absolute; top: 100%; left: 50%; margin-left: -7px;
  border: 7px solid transparent; border-top-color: var(--surface);
}
.popup-close {
  position: absolute; top: 7px; right: 8px;
  border: none; background: transparent; cursor: pointer;
  font-size: 17px; line-height: 1; color: var(--text-3);
  width: 20px; height: 20px; border-radius: 4px;
}
.popup-close:hover { background: #eef0f3; color: var(--text); }
.popup-inner { font-size: 12.5px; line-height: 1.65; }
.popup-title { font-size: 14px; font-weight: 600; margin-bottom: 5px; padding-right: 18px; }
.popup-row { display: flex; gap: 7px; color: var(--text-2); }
.popup-row .pk { color: var(--text-3); flex: 0 0 auto; }
.popup-row .pv { font-family: var(--mono); font-size: 11px; word-break: break-all; }
.popup-actions { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.popup-btn {
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-2); font-size: 11px; font-family: inherit;
  padding: 3px 9px; border-radius: 5px; cursor: pointer; transition: all .12s;
}
.popup-btn:hover { background: var(--brand-soft); border-color: #b6d3fb; color: var(--brand-dark); }
.popup-loading { color: var(--text-3); font-size: 11.5px; }

/* 认证商户弹窗：「认证」角标 + 数据来源说明 */
.popup-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--success-soft, #e6f5ef);
  color: #0f6b4c;
  border: 1px solid #bfe5d6;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 17px;
  vertical-align: 1px;
}
.popup-note {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed var(--border);
  color: var(--text-3);
  font-size: 11px;
}

/* 自定义标注图标（用 CSS 绘制，避免额外图片依赖） */
.marker-pin {
  width: 22px; height: 22px; cursor: pointer;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.3));
}
.marker-pin svg { width: 100%; height: 100%; display: block; }

/* OL 控件微调 */
.ol-zoom { top: auto !important; bottom: 42px !important; right: 12px !important; left: auto !important; }
.ol-control button {
  background: rgba(255,255,255,.95) !important;
  color: var(--text-2) !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  width: 28px !important; height: 28px !important;
  font-size: 15px !important; font-weight: 400 !important;
  box-shadow: var(--shadow-sm);
  margin: 2px !important;
}
.ol-control button:hover { background: #f2f4f6 !important; color: var(--text) !important; }
.ol-scale-line {
  background: rgba(255,255,255,.9) !important;
  border-radius: 5px !important; padding: 2px 6px !important;
  bottom: 34px !important; left: 12px !important;
}
.ol-scale-line-inner {
  border: 1px solid var(--text-2) !important;
  border-top: none !important;
  color: var(--text-2) !important;
  font-size: 10px !important; font-family: var(--mono) !important;
}
.ol-attribution {
  bottom: 30px !important; right: 12px !important;
  background: rgba(255,255,255,.88) !important;
  border-radius: 5px !important; font-size: 10px !important;
  max-width: 46% !important;
}
.ol-attribution ul { font-size: 10px !important; color: var(--text-3); }
.ol-attribution button { width: 18px !important; height: 18px !important; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d3d8de; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #bcc3cb; }

/* 窄屏适配 */
@media (max-width: 900px) {
  .brand-text small { display: none; }
  .search-modes { display: none; }
  .sidebar { position: absolute; right: 0; top: var(--topbar-h); bottom: 0; z-index: 25; box-shadow: var(--shadow-lg); }
}
