/* ============================================================
   WebGIS 轻量地图平台 — 样式表
   浅色主题为默认，深色主题通过 html[data-theme="dark"] 切换
   ============================================================ */

:root {
  --bg:            #f4f6f8;
  --bg-panel:      #ffffff;
  --bg-sub:        #eef1f5;
  --bg-hover:      #e8edf3;
  --bg-active:     #dbe7fb;
  --border:        #d8dee7;
  --border-soft:   #e8ecf1;
  --text:          #1f2937;
  --text-sub:      #64748b;
  --text-mute:     #94a3b8;
  --primary:       #2563eb;
  --primary-soft:  #dbeafe;
  --danger:        #dc2626;
  --danger-soft:   #fee2e2;
  --success:       #16a34a;
  --success-soft:  #dcfce7;
  --warn:          #d97706;
  --shadow:        0 1px 2px rgba(16,24,40,.06), 0 4px 12px rgba(16,24,40,.06);
  --shadow-lg:     0 8px 32px rgba(16,24,40,.16);
  --radius:        8px;
  --radius-sm:     6px;
  --topbar-h:      48px;
  --status-h:      26px;
  --side-w:        288px;
  --drawer-w:      360px;
  --font: "PingFang SC","Microsoft YaHei","Helvetica Neue",Helvetica,Arial,sans-serif;
}

html[data-theme="dark"] {
  --bg:            #0f1419;
  --bg-panel:      #161c24;
  --bg-sub:        #1c242e;
  --bg-hover:      #232c38;
  --bg-active:     #1e3a5f;
  --border:        #2a333f;
  --border-soft:   #222a34;
  --text:          #e5e9ef;
  --text-sub:      #9aa7b6;
  --text-mute:     #6b7787;
  --primary:       #3b82f6;
  --primary-soft:  #1e3a5f;
  --danger:        #ef4444;
  --danger-soft:   #4c1d1d;
  --success:       #22c55e;
  --success-soft:  #14361f;
  --warn:          #f59e0b;
  --shadow:        0 1px 2px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.35);
  --shadow-lg:     0 8px 32px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--text-sub); }
.tiny  { font-size: 11px; }
.pad   { padding: 10px 12px; }

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

/* ===================== 顶栏 ===================== */
.topbar {
  height: var(--topbar-h);
  flex: 0 0 var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 12px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.brand-logo {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, var(--primary), #60a5fa);
  color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 700;
}
.brand-name { font-weight: 700; font-size: 14px; letter-spacing: .3px; }
.brand-sub  { font-weight: 400; font-size: 11px; color: var(--text-mute); margin-left: 6px; }

.search-box { position: relative; flex: 0 0 260px; }
.search-ico { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font-size: 12px; opacity: .6; }
.search-box input {
  width: 100%; height: 30px; padding: 0 26px 0 26px;
  border: 1px solid var(--border); border-radius: 15px;
  background: var(--bg-sub); outline: none;
}
.search-box input:focus { border-color: var(--primary); background: var(--bg-panel); }
.search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; cursor: pointer; color: var(--text-mute);
  font-size: 15px; line-height: 1; padding: 2px 4px; border-radius: 50%;
}
.search-clear:hover { background: var(--bg-hover); color: var(--text); }
.search-result {
  position: absolute; top: 34px; left: 0; right: 0; min-width: 340px;
  max-height: 320px; overflow: auto;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 50; padding: 4px;
}
.sr-item { padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer; display: flex; gap: 8px; align-items: center; }
.sr-item:hover { background: var(--bg-hover); }
.sr-item .sr-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-item .sr-tag { font-size: 10px; padding: 1px 6px; border-radius: 9px; background: var(--bg-sub); color: var(--text-sub); }

.toolbar { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.toolbar::-webkit-scrollbar { display: none; }
.tool-group { display: flex; gap: 2px; }
.tool-sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; flex: 0 0 auto; }

.tbtn {
  display: flex; flex-direction: row; align-items: center; gap: 4px;
  height: 30px; padding: 0 9px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; cursor: pointer; white-space: nowrap;
  font-size: 12px; color: var(--text-sub);
}
.tbtn > span:last-child { font-size: 11.5px; }
.tbtn:hover  { background: var(--bg-hover); color: var(--text); }
.tbtn.active { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); font-weight: 600; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.ibtn {
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-panel); cursor: pointer; font-size: 14px;
}
.ibtn:hover { background: var(--bg-hover); }
.ibtn.active { background: var(--primary-soft); border-color: var(--primary); }
.sel {
  height: 30px; padding: 0 6px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-panel); cursor: pointer; max-width: 150px;
}
.sel.sm { height: 26px; font-size: 12px; flex: 1; min-width: 0; }

/* ===================== 主体 ===================== */
.main { flex: 1; display: flex; min-height: 0; position: relative; }

.sidebar {
  width: var(--side-w); flex: 0 0 var(--side-w);
  display: flex; flex-direction: column;
  background: var(--bg-panel); border-right: 1px solid var(--border);
  z-index: 20;
}
.side-tabs { display: flex; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.stab {
  flex: 1; height: 34px; border: 0; background: transparent; cursor: pointer;
  color: var(--text-sub); font-size: 12.5px; border-bottom: 2px solid transparent;
}
.stab:hover { color: var(--text); background: var(--bg-sub); }
.stab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.side-panel { display: none; flex: 1; flex-direction: column; min-height: 0; }
.side-panel.active { display: flex; }
.panel-tools { padding: 8px; border-bottom: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.panel-tools .row { display: flex; gap: 6px; align-items: center; }
.panel-tools .row.batch-tools {
  background: var(--primary-soft, rgba(37,99,235,.1));
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.batch-tools .btn { flex: 1; }

.btn {
  height: 26px; padding: 0 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-panel);
  cursor: pointer; font-size: 12px; white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); }
.btn.sm { height: 26px; font-size: 11.5px; padding: 0 8px; flex: 1; }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.block { width: 100%; }

.side-list { flex: 1; overflow-y: auto; padding: 6px; }
.side-list::-webkit-scrollbar { width: 8px; }
.side-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.pl-item {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 7px 8px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid transparent; margin-bottom: 3px;
}
.pl-item:hover { background: var(--bg-hover); }
.pl-item.selected { background: var(--bg-active); border-color: var(--primary); }
.pl-item.batch-sel { background: var(--primary-soft, rgba(37,99,235,.12)); border-color: var(--primary); }
.pl-cb { width: 15px; height: 15px; margin-top: 4px; flex: 0 0 auto; accent-color: var(--primary); cursor: pointer; }
.pl-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; flex: 0 0 auto; }
.pl-main { flex: 1; min-width: 0; }
.pl-name { font-weight: 600; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-meta { font-size: 11px; color: var(--text-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.chip {
  font-size: 10px; padding: 1px 6px; border-radius: 9px;
  background: var(--bg-sub); color: var(--text-sub); border: 1px solid var(--border-soft);
}
.chip.sel { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.pl-acts { display: flex; gap: 2px; opacity: 0; }
.pl-item:hover .pl-acts { opacity: 1; }
.mini {
  border: 0; background: transparent; cursor: pointer; width: 20px; height: 20px;
  border-radius: 4px; font-size: 12px; color: var(--text-sub); display: grid; place-items: center;
}
.mini:hover { background: var(--bg-sub); color: var(--text); }

.empty { text-align: center; color: var(--text-mute); font-size: 12px; padding: 28px 10px; line-height: 1.7; }

/* ===================== 地图 ===================== */
#mapWrap { flex: 1; position: relative; min-width: 0; }
#map { position: absolute; inset: 0; }
.maplibregl-ctrl-group { box-shadow: var(--shadow) !important; }

.map-float { position: absolute; display: flex; flex-direction: column; gap: 6px; z-index: 10; }
.map-float.tr { top: 10px; right: 10px; }
.map-float.br { bottom: 34px; right: 10px; }
.fbtn {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-panel);
  cursor: pointer; font-size: 14px; box-shadow: var(--shadow);
  display: grid; place-items: center;
}
.fbtn:hover { background: var(--bg-hover); }
.fbtn.active { background: var(--primary-soft); border-color: var(--primary); }
.fbtn.loading { pointer-events: none; opacity: .75; color: var(--primary); }
.fbtn.loading::before {
  content: ''; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--primary); border-top-color: transparent;
  animation: spin .8s linear infinite;
}
.fbtn.ok { background: #16a34a; color: #fff; border-color: #16a34a; animation: pulse .8s ease-out 2; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(22,163,74,.6); }
  70% { box-shadow: 0 0 0 8px rgba(22,163,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); }
}

.draw-hint {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  background: rgba(17,24,39,.86); color: #fff; padding: 5px 14px;
  border-radius: 14px; font-size: 12px; z-index: 12; pointer-events: none;
  box-shadow: var(--shadow);
}
.measure-box {
  position: absolute; left: 10px; bottom: 34px; z-index: 12;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 8px 10px; min-width: 170px; font-size: 12px; line-height: 1.7;
}
.measure-box b { color: var(--primary); }
.map-legend {
  position: absolute; left: 10px; top: 10px; z-index: 12;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 8px 10px; font-size: 11.5px;
}
.map-legend h4 { margin: 0 0 6px; font-size: 12px; }
.lg-row { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.lg-dot { width: 10px; height: 10px; border-radius: 50%; }

/* 地图光标 */
#map.tool-addpoint canvas, #map.tool-draw canvas, #map.tool-sel canvas { cursor: crosshair !important; }

/* ===================== 右侧抽屉 ===================== */
.drawer {
  width: var(--drawer-w); flex: 0 0 var(--drawer-w);
  display: flex; flex-direction: column;
  background: var(--bg-panel); border-left: 1px solid var(--border); z-index: 20;
}
.drawer-head {
  height: 34px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: 0 6px 0 12px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 13px;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 12px; }
.drawer-body::-webkit-scrollbar { width: 8px; }
.drawer-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.drawer-foot {
  flex: 0 0 auto; padding: 10px 12px; border-top: 1px solid var(--border);
  display: flex; gap: 8px;
}
.drawer-foot .btn { flex: 1; height: 30px; }

/* 表单 */
.field { margin-bottom: 12px; }
.field > label { display: block; font-size: 11.5px; color: var(--text-sub); margin-bottom: 4px; font-weight: 600; }
.field .inp, .field textarea, .field select {
  width: 100%; padding: 6px 8px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-sub); outline: none;
}
.field .inp:focus, .field textarea:focus { border-color: var(--primary); background: var(--bg-panel); }
.field textarea { min-height: 64px; resize: vertical; line-height: 1.6; }
.f2 { display: flex; gap: 8px; }
.f2 > div { flex: 1; }
.hint { font-size: 11px; color: var(--text-mute); margin-top: 3px; }

.icon-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.icon-opt {
  aspect-ratio: 1; display: grid; place-items: center; font-size: 15px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; background: var(--bg-sub);
}
.icon-opt.active { border-color: var(--primary); background: var(--primary-soft); }

.tag-edit { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.tag-edit .chip { display: inline-flex; align-items: center; gap: 4px; }
.tag-edit .chip b { cursor: pointer; font-weight: 400; }
.tag-edit input { width: 70px; border: 1px dashed var(--border); border-radius: 9px; padding: 1px 6px; background: transparent; outline: none; font-size: 11px; }

.att-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.att {
  position: relative; aspect-ratio: 1; border-radius: var(--radius-sm);
  overflow: hidden; border: 1px solid var(--border); background: var(--bg-sub);
}
.att img, .att video { width: 100%; height: 100%; object-fit: cover; }
.att .del {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; border: 0;
  cursor: pointer; font-size: 12px; line-height: 1; display: grid; place-items: center;
}
.att.add { display: grid; place-items: center; cursor: pointer; font-size: 20px; color: var(--text-mute); }
.att.add:hover { background: var(--bg-hover); color: var(--text); }

.kv { display: flex; gap: 6px; margin-bottom: 5px; }
.kv input { flex: 1; padding: 4px 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-sub); outline: none; font-size: 12px; }

.sec-title {
  font-size: 11.5px; font-weight: 700; color: var(--text-sub);
  margin: 16px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--border-soft);
  letter-spacing: .5px;
}
.sec-title:first-child { margin-top: 0; }

/* 图例/标签颜色选择 */
.swatches { display: flex; gap: 5px; flex-wrap: wrap; }
.sw { width: 20px; height: 20px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; }
.sw.active { border-color: var(--text); }

/* ===================== 状态栏 ===================== */
.statusbar {
  height: var(--status-h); flex: 0 0 var(--status-h);
  display: flex; align-items: center; gap: 8px; padding: 0 12px;
  background: var(--bg-panel); border-top: 1px solid var(--border);
  font-size: 11.5px; color: var(--text-sub); z-index: 30;
}
.st-item { font-variant-numeric: tabular-nums; }
.st-sep { width: 1px; height: 12px; background: var(--border); }
.st-grow { flex: 1; }
.st-msg { color: var(--primary); }

/* ===================== 弹窗 ===================== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.45);
  display: grid; place-items: center; z-index: 100; backdrop-filter: blur(2px);
}
.modal {
  background: var(--bg-panel); border-radius: 12px; box-shadow: var(--shadow-lg);
  width: 440px; max-width: calc(100vw - 32px); max-height: calc(100vh - 64px);
  display: flex; flex-direction: column; overflow: hidden;
}
.modal.wide { width: 640px; }
.modal-head {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; font-weight: 700;
}
.modal-body { padding: 16px; overflow-y: auto; }
.modal-foot { padding: 10px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
.modal-foot .btn { height: 30px; padding: 0 14px; flex: 0 0 auto; }

.menu-list { display: flex; flex-direction: column; gap: 4px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  cursor: pointer; background: var(--bg-sub);
}
.menu-item:hover { background: var(--bg-hover); border-color: var(--primary); }
.menu-item .mi-ico { font-size: 16px; width: 22px; text-align: center; }
.menu-item .mi-txt { flex: 1; }
.menu-item .mi-txt b { display: block; font-size: 12.5px; }
.menu-item .mi-txt span { font-size: 11px; color: var(--text-mute); }

.drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 22px; text-align: center; color: var(--text-mute); cursor: pointer;
}
.drop-zone:hover, .drop-zone.over { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

/* ===================== 右键菜单 ===================== */
.ctx-menu {
  position: fixed; z-index: 200; min-width: 150px;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 4px;
}
.ctx-item { padding: 6px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12.5px; display: flex; gap: 8px; }
.ctx-item:hover { background: var(--bg-hover); }
.ctx-item.danger { color: var(--danger); }
.ctx-sep { height: 1px; background: var(--border); margin: 3px 0; }

/* ===================== Toast ===================== */
.toast-root { position: fixed; bottom: 44px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: rgba(17,24,39,.92); color: #fff; padding: 7px 16px;
  border-radius: 16px; font-size: 12.5px; box-shadow: var(--shadow-lg);
  animation: toastIn .18s ease-out;
}
.toast.ok   { background: #15803d; }
.toast.err  { background: #b91c1c; }
.toast.warn { background: #b45309; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: none; } }

/* ===================== 弹窗（气泡）内容 ===================== */
.pop { min-width: 200px; max-width: 280px; font-family: var(--font); color: var(--text); }
.pop h5 { margin: 0 0 4px; font-size: 13px; }
.pop .pop-meta { font-size: 11px; color: var(--text-mute); margin-bottom: 6px; }
.pop .pop-desc { font-size: 12px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.pop .pop-imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 6px; }
.pop .pop-imgs img, .pop .pop-imgs video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
.pop .pop-acts { display: flex; gap: 6px; margin-top: 8px; }
.pop .pop-acts .btn { height: 24px; font-size: 11px; }
.maplibregl-popup-content { padding: 10px 12px; border-radius: var(--radius) !important; }

/* ===================== V23 标签设置[临时] 面板 ===================== */
.temp-pin {
  position: relative; width: 30px; height: 38px; pointer-events: auto;
  cursor: grab; filter: drop-shadow(0 3px 5px rgba(0,0,0,.35));
  transform-origin: 50% 100%;
}
.temp-pin:active { cursor: grabbing; }
.temp-pin-ico {
  position: absolute; left: 0; top: 0; width: 30px; height: 30px;
  border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-size: 15px; border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.15) inset;
}
.temp-pin-tail {
  position: absolute; left: 50%; top: 26px; transform: translateX(-50%);
  width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-top: 11px solid #e74c3c;
}
.temp-pin::after {
  content: ''; position: absolute; left: 50%; bottom: -2px; transform: translateX(-50%);
  width: 14px; height: 5px; border-radius: 50%; background: rgba(0,0,0,.25);
}

.temp-label-panel {
  position: absolute; right: 12px; top: 12px; width: 288px; z-index: 30;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
  font-size: 12.5px; color: var(--text);
  animation: tlIn .16s ease-out;
}
@keyframes tlIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.tl-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; background: var(--primary); color: #fff;
}
.tl-title { font-weight: 700; font-size: 13px; }
.tl-close {
  background: transparent; border: 0; color: #fff; font-size: 18px;
  line-height: 1; cursor: pointer; padding: 0 2px; opacity: .85;
}
.tl-close:hover { opacity: 1; }
.tl-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; max-height: 58vh; overflow-y: auto; }
.tl-row { display: flex; align-items: center; gap: 8px; }
.tl-row.col { flex-direction: column; align-items: stretch; gap: 4px; }
.tl-row > label { flex: 0 0 62px; font-size: 11.5px; color: var(--text-sub); font-weight: 600; }
.tl-name, .tl-sel, .tl-remark {
  flex: 1; min-width: 0; height: 27px; padding: 0 7px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-sub); color: var(--text); font-size: 12px; font-family: var(--font);
}
.tl-remark { height: auto; min-height: 52px; padding: 6px 7px; resize: vertical; line-height: 1.5; }
.tl-name:focus, .tl-sel:focus, .tl-remark:focus { outline: none; border-color: var(--primary); background: var(--bg-panel); }
.tl-coord { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; color: var(--text-sub); }
/* V24：经纬度可编辑输入框（支持直接粘贴坐标后回车定位） */
.tl-coord-input {
  flex: 1; min-width: 0; height: 27px; padding: 0 7px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-sub); color: var(--text);
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px;
}
.tl-coord-input:focus { outline: none; border-color: var(--primary); background: var(--bg-panel); }
.tl-coord-input.tl-coord-bad { border-color: var(--danger); background: var(--danger-soft); }
.tl-att-count { font-size: 11px; color: var(--text-mute); }
.tl-hint-inline { font-size: 11px; color: var(--text-mute); }
.tl-id { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 10.5px; color: var(--text-mute); word-break: break-all; }
.tl-icons { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.tl-icon-opt {
  display: grid; place-items: center; height: 24px; font-size: 13px; cursor: pointer;
  border: 1px solid var(--border-soft); border-radius: 5px; background: var(--bg-sub);
}
.tl-icon-opt:hover { border-color: var(--primary); }
.tl-icon-opt.active { border-color: var(--primary); background: var(--primary-soft); }
.tl-tip {
  font-size: 10.5px; line-height: 1.5; color: var(--text-mute);
  background: var(--bg-sub); border-radius: var(--radius-sm); padding: 6px 8px;
}
.tl-quick { display: flex; gap: 6px; padding: 0 12px 8px; }
.tl-quick .btn { flex: 1; height: 26px; font-size: 11.5px; }
.tl-foot {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 8px 12px; border-top: 1px solid var(--border); background: var(--bg-sub);
}
.tl-foot .btn { height: 28px; padding: 0 16px; }
@media (max-width: 780px) {
  .temp-label-panel { right: 8px; left: 8px; width: auto; top: auto; bottom: 8px; max-height: 62vh; }
  .tl-body { max-height: 40vh; }
}

/* ============================================================
   V24：搜索框经纬度 → 地图上的"虚拟临时点位"
   ============================================================ */
.virtual-pin { position: relative; width: 26px; height: 26px; pointer-events: none; }
.virtual-pin .vp-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--primary); background: rgba(37, 99, 235, .15);
  animation: vpPulse 1.6s ease-out infinite;
}
.virtual-pin .vp-dot {
  position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border-radius: 50%; background: var(--primary); border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
@keyframes vpPulse {
  0%   { transform: scale(.6);  opacity: .95; }
  70%  { transform: scale(1.4); opacity: .10; }
  100% { transform: scale(1.4); opacity: 0; }
}

.vp-body { min-width: 170px; }
.vp-title { font-size: 10.5px; color: var(--text-mute); margin-bottom: 2px; }
.vp-name { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; word-break: break-all; }
.vp-addr { font-size: 11px; color: var(--text-sub); margin-bottom: 3px; word-break: break-all; }
.vp-coord { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; font-weight: 600; color: var(--text); }
.vp-acts { display: flex; gap: 6px; margin-top: 8px; }
.vp-acts .btn { flex: 1; height: 26px; font-size: 11.5px; }

/* V25：地点搜索结果在地图上的"点位图"（图钉 + 名称气泡）
   注意：必须覆盖 V24 的 .virtual-pin{width:26px;height:26px}，否则 flex 会把名称标签压扁 */
.virtual-pin.search {
  position: absolute; top: 0; left: 0;      /* 与 maplibre .maplibregl-marker 保持一致 */
  width: max-content; height: auto;         /* 覆盖 V24 的 26×26，否则名称标签被压扁 */
  display: flex; flex-direction: column; align-items: center; pointer-events: none;
}
.virtual-pin.search .vp-label {
  flex: 0 0 auto; max-width: 170px; margin-bottom: 1px; padding: 2px 8px; border-radius: 10px;
  background: var(--primary); color: #fff; font-size: 11px; line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}
.virtual-pin.search .vp-emoji {
  flex: 0 0 auto; font-size: 26px; line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .45));
}

/* 搜索结果里的"坐标"条目 */
.sr-item.sr-coord .sr-name { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 600; font-size: 11.5px; }
.sr-acts { display: flex; gap: 4px; flex: 0 0 auto; }
.sr-acts .mini { font-size: 11px; padding: 0 8px; width: auto; height: 22px; }
.sr-acts .mini.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.sr-acts .mini.primary:hover { filter: brightness(1.08); }

/* ============================================================
   V25：地图内浮动「地点搜索」框（搜真实地点 → 定位 → 生成点位图）
   ============================================================ */
.gs-wrap {
  position: absolute; left: 10px; top: 10px; z-index: 12;
  width: 360px; max-width: calc(100% - 20px);
}
.gs-bar {
  display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 8px;
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s;
}
.gs-wrap:focus-within .gs-bar,
.gs-wrap.open .gs-bar { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.gs-ico { font-size: 14px; color: var(--text-mute); flex: 0 0 auto; }
#geoSearchInput {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size: 13px; color: var(--text); font-family: var(--font);
}
#geoSearchInput::placeholder { color: var(--text-mute); }
.gs-x {
  flex: 0 0 auto; border: 0; background: transparent; color: var(--text-mute);
  font-size: 16px; line-height: 1; padding: 2px 6px; border-radius: 50%; cursor: pointer;
}
.gs-x:hover { background: var(--bg-hover); color: var(--text); }
.gs-go {
  flex: 0 0 auto; height: 26px; padding: 0 12px; border: 0; border-radius: var(--radius-sm);
  background: var(--primary); color: #fff; font-size: 12px; cursor: pointer; font-family: var(--font);
}
.gs-go:hover { filter: brightness(1.08); }
.gs-go:disabled { opacity: .55; cursor: default; }
.gs-list {
  margin-top: 6px; max-height: 330px; overflow: auto; padding: 4px;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.gs-item {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 7px 8px; border-radius: var(--radius-sm); cursor: pointer;
}
.gs-item:hover, .gs-item.active { background: var(--bg-active); }
.gs-item .gs-pin { flex: 0 0 auto; font-size: 13px; line-height: 1.35; }
.gs-item .gs-txt { flex: 1; min-width: 0; }
.gs-item .gs-name {
  font-size: 12.5px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gs-item .gs-addr {
  font-size: 11px; color: var(--text-mute); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gs-item .gs-src {
  flex: 0 0 auto; align-self: center; font-size: 9.5px; padding: 1px 6px;
  border-radius: 9px; background: var(--bg-sub); color: var(--text-sub);
}
.gs-msg { padding: 10px; font-size: 12px; color: var(--text-sub); display: flex; align-items: center; gap: 4px; }
.gs-msg.err { color: var(--danger); }
.gs-link { color: var(--primary); cursor: pointer; text-decoration: underline; }
.gs-hint { padding: 6px 10px; font-size: 10.5px; color: var(--text-mute); border-top: 1px solid var(--border-soft); }
.gs-spin {
  display: inline-block; width: 12px; height: 12px; flex: 0 0 auto;
  border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%;
  animation: gsSpin .7s linear infinite;
}
@keyframes gsSpin { to { transform: rotate(360deg); } }

/* ===================== 响应式 ===================== */
@media (max-width: 1100px) {
  :root { --side-w: 240px; --drawer-w: 320px; }
  .tbtn > span:last-child { display: none; }
}
@media (max-width: 780px) {
  .search-box { flex: 0 0 150px; }
  .gs-wrap { width: calc(100% - 20px); }
  .sidebar { position: absolute; left: 0; top: 0; bottom: 0; z-index: 25; box-shadow: var(--shadow-lg); }
  .sidebar.collapsed { display: none; }
  .drawer { position: absolute; right: 0; top: 0; bottom: 0; z-index: 25; box-shadow: var(--shadow-lg); }
}
