* { box-sizing: border-box; }

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --line: #e3e6ea;
  --line-soft: #eef0f3;
  --text: #1a1d21;
  --text-2: #5c6470;
  --text-3: #9aa2ad;
  --accent: #1d9e75;
  --accent-soft: #e6f5f0;
  --warn: #ba7517;
  --info: #185fa5;
  --radius: 10px;
}

html, body { margin: 0; padding: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 { margin: 0; font-weight: 600; }

/* ---------- topbar ---------- */
.topbar {
  flex: 0 0 auto;
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-mark {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--accent);
  position: relative;
  flex: 0 0 auto;
}
.brand-mark::after {
  content: "";
  position: absolute;
  left: 8px; top: 7px;
  width: 9px; height: 9px;
  border: 2px solid #fff;
  border-radius: 2px;
  transform: rotate(45deg);
}

.brand h1 { font-size: 15px; line-height: 1.2; }
.brand p { margin: 0; font-size: 12px; color: var(--text-3); line-height: 1.4; }

.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { border-color: var(--text-3); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-mini { height: 26px; padding: 0 8px; font-size: 12px; }

/* ---------- layout ---------- */
.layout {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
}

.panel {
  flex: 0 0 auto;
  width: var(--panel-w, 330px);
  min-width: 46px;
  max-width: 72vw;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 14px;
  position: relative;
}
/* 头部：标题 + 收起开关。flex:0 不被压缩 */
.panel-head {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.panel-title { font-size: 13px; font-weight: 600; color: var(--text-2); letter-spacing: .04em; }
/* 主体：占满剩余高度并在内部纵向滚动，避免整栏滚动把头部也滚走 */
.panel-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 2px; }
/* 拉伸手柄：贴在右侧边缝上，拖动改 .panel 宽度。绝对定位不进 flex 布局 */
.panel-resize {
  position: absolute; top: 0; right: -3px;
  width: 6px; height: 100%;
  cursor: col-resize; z-index: 5; background: transparent;
}
.panel-resize:hover, .panel-resize.dragging { background: var(--accent); opacity: .35; }
/* 收起为窄轨：只留开关按钮 */
.panel.collapsed { width: 46px; min-width: 46px; padding-left: 6px; padding-right: 6px; }
.panel.collapsed .panel-body { display: none; }
.panel.collapsed .panel-resize { display: none; }
.panel.collapsed .panel-head { justify-content: center; margin-bottom: 0; }
.panel.collapsed .panel-title { display: none; }
.panel-toggle {
  width: 24px; height: 24px; flex: 0 0 auto;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); color: var(--text-2);
  font-size: 14px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.panel-toggle:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* isolation:isolate 让 .map-wrap 成为独立层叠上下文——
 * 天地图内部面板自带 z-index:400（.tdt-map-pane），若与详情卡同处一个层叠上下文，
 * 卡片（z-index 30）会被地图整块盖住。隔离之后地图的 z-index 被锁在容器内，
 * 卡片的层级才有意义。 */
.map-wrap { flex: 1 1 auto; position: relative; min-width: 0; isolation: isolate; }
#map { width: 100%; height: 100%; }

/* ---------- form ---------- */
.block { margin-bottom: 16px; }

.lbl {
  display: block;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 6px;
  font-weight: 500;
}
.lbl b { color: var(--accent); font-weight: 600; }

.input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
.input:focus { outline: none; border-color: var(--accent); }

.range { width: 100%; accent-color: var(--accent); }

.check { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); margin-top: 6px; cursor: pointer; }

.hint { margin: 6px 0 0; font-size: 11.5px; color: var(--text-3); line-height: 1.5; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-scroll { max-height: 128px; overflow-y: auto; }

.chip {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  background: var(--surface);
  color: var(--text-2);
  user-select: none;
  white-space: nowrap;
}
.chip:hover { border-color: var(--text-3); }
/* 芯片用 span 实现 + tabindex，键盘 Tab 到时要能看见焦点，否则等于只有鼠标可用 */
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 500; }

.stat-row {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; border-top: 1px solid var(--line-soft);
  font-size: 13px; color: var(--text-2);
}
.stat-row b { color: var(--text); font-size: 15px; }

/* ---------- list ---------- */
.list { margin-top: 12px; border-top: 1px solid var(--line-soft); }

.item {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}
.item:hover { background: #fafbfc; }
.item.on { background: var(--accent-soft); }
.item-name { font-size: 13.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.item-meta { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.item-note { font-size: 11.5px; color: var(--text-2); margin-top: 4px; }

/* 列表分页：命中几千条时不一次铺完，滚到底部或点按钮再续 */
.list-more { display: block; width: 100%; height: 32px; margin: 10px 0 4px; font-size: 12.5px; }
.list-end { text-align: center; font-size: 11.5px; color: var(--text-3); padding: 12px 0 4px; }

.tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  background: #eef1f5;
  color: var(--text-2);
  font-weight: 400;
}
.tag.lv5 { background: #e6f5f0; color: #0f6e56; }
.tag.lv4 { background: #e8f1fb; color: #185fa5; }
.tag.lv3 { background: #f2f3f5; color: #5c6470; }
.tag.crowd-low { background: #e6f5f0; color: #0f6e56; }
.tag.crowd-mid { background: #fdf1dc; color: #854f0b; }
.tag.crowd-high { background: #fbe9e9; color: #a32d2d; }
.tag.none { background: #f2f3f5; color: var(--text-3); }

/* 底图切换（左上角，缩放控件下方）。
 * 位置是刻意选的：右上角是详情卡、左下角是视野提示、底部是 toast，都不冲突。
 * z-index 1040 与其余浮层同一档（>0 且在地图之上，见文件顶部关于 isolation 的说明）。
 *
 * 横排在左上角、紧贴地图顶边（top:10）。天地图自带的缩放控件默认也占这个位置
 * （它的 10px 偏移来自自身 margin:10px 0 0 10px，不是容器 padding），所以下面把缩放
 * 控件一并下推，让底图条浮在放大按钮上方。
 *
 * 下推量 55px = 顶部留白 10 + 底图条实测高 37 + 与缩放控件之间 8px 间隙。
 * 这是个跟着「底图条高度」走的魔法数：按钮字号/内边距一改，条高就变，这里要跟着调。
 * check_map.mjs 里有一条断言专盯这件事（要求底图条下沿 ≤ 放大按钮上沿），改坏了会被测出来。
 *
 * 选择器刻意写成三层：天地图自己的 CSS 是 .tdt-control-zoom{margin:10px 0 0 10px}，
 * 单类选择器特异性不够会压不住，三层（.map-wrap .tdt-top.tdt-left .tdt-control-zoom）
 * 稳赢，也就不需要 !important（那会让将来想再调的人无从下手）。 */
.map-layers {
  position: absolute;
  left: 10px; top: 10px;
  z-index: 1040;
  display: flex; flex-wrap: wrap; align-items: center; gap: 3px;
  max-width: min(430px, calc(100% - 20px));
  padding: 4px;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 2px 10px rgba(0,0,0,.10);
  -webkit-backdrop-filter: saturate(1.3) blur(4px);
  backdrop-filter: saturate(1.3) blur(4px);
}
/* 缩放控件下推，给左上角那条底图条让位（数值由来见 .map-layers 上方注释） */
.map-wrap .tdt-top.tdt-left .tdt-control-zoom { margin-top: 55px; }
/* 横排时它是行首标签，不是列表项，所以不加分隔线 */
.map-layers-label {
  font-size: 11.5px; color: var(--text-3);
  padding: 0 5px 0 3px; line-height: 1;
}
.map-layers button {
  font: inherit; font-size: 12.5px; line-height: 1;
  padding: 6px 9px;
  border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;     /* 「影像＋注记」不能被折成两行，否则条高会跳、把缩放控件顶歪 */
  transition: background .12s, color .12s;
}
.map-layers button:hover { background: var(--line-soft); color: var(--text); }
.map-layers button.on {
  background: var(--accent-soft); color: #12684e;
  border-color: #b6e2d4; font-weight: 600;
}
.map-layers button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- 地图浮层 ----------
 * z-index 统一抬到 1000+：天地图内部面板自带 z-index:400（.tdt-map-pane），
 * 浮层若低于它就会被地图整块盖住（详情卡曾经就是这样消失的）。 */
.map-badge {
  position: absolute;
  left: 50%; top: 14px;
  transform: translateX(-50%);
  background: rgba(26,29,33,.86);
  color: #fff;
  font-size: 12.5px;
  padding: 7px 14px;
  border-radius: 999px;
  z-index: 1100;
  pointer-events: none;
  max-width: 80%;
  text-align: center;
}

/* 图钉悬停小卡 */
.map-tip {
  position: absolute;
  z-index: 1050;
  max-width: 260px;
  padding: 7px 10px;
  background: rgba(26,29,33,.93);
  color: #fff;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 6px));
  box-shadow: 0 6px 18px rgba(0,0,0,.22);
}
.map-tip.below { transform: translate(-50%, 26px); }
.map-tip::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -4px;
  width: 8px; height: 8px;
  margin-left: -4px;
  background: rgba(26,29,33,.93);
  transform: rotate(45deg);
}
.map-tip.below::after { bottom: auto; top: -4px; }
.map-tip .tip-name { font-weight: 600; font-size: 12.5px; }
.map-tip .tip-meta { color: rgba(255,255,255,.72); margin-top: 2px; }
.map-tip .tip-meta .tag { margin-left: 4px; background: rgba(255,255,255,.16); color: #fff; }

/* 视野加载提示（左下角）：说明地图是按视野动态加载点位 */
.map-viewinfo {
  position: absolute;
  left: 12px; bottom: 12px;
  z-index: 1050;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,.93);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 11.5px;
  pointer-events: none;
  max-width: calc(100% - 24px);
}
.map-viewinfo.warn {
  background: #fdf6e7;
  border-color: #eccf95;
  color: #854f0b;
}

.detail, .cam-panel {
  position: absolute;
  right: 14px; top: 14px;
  width: 340px;
  max-height: calc(100% - 28px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
}

.detail-close {
  position: absolute;
  right: 8px; top: 6px;
  border: none; background: none;
  font-size: 20px; line-height: 1;
  color: var(--text-3);
  cursor: pointer;
  padding: 2px 6px;
}
.detail-close:hover { color: var(--text); }

.detail h3 { font-size: 16px; padding-right: 24px; }
.detail .sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.detail .row { margin-top: 10px; font-size: 13px; }
.detail .row .k { color: var(--text-3); font-size: 12px; display: block; }
.detail .quote {
  margin-top: 10px; padding: 8px 10px;
  background: #fafbfc; border-left: 3px solid var(--accent);
  font-size: 12.5px; color: var(--text-2);
}
.detail .actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* ---------- 信息卡：站外搜索链接组 ----------
 * 五个平台长得完全一样，只有左侧圆点的颜色区分——统一外形、靠色相辨认，
 * 比做成五种不同按钮更整齐。高度对齐 .btn-mini（26px），和卡片里的「路线规划」一排按钮同尺度。
 * a 元素默认不是 flex 容器，必须显式 display:flex，否则圆点与文字会基线错位。 */
/* 用等宽网格而不是 flex-wrap：五个入口在 340px 宽的卡片里一行放不下
 * （实测一行需要 363px，可用宽度只有 306px），flex-wrap 会排出「4 + 1」，
 * 最后一个 B站 孤零零占一行。改成网格后格子等宽、左对齐排成 3 + 2，
 * 卡片变宽时自动增列，不会出现宽窄不一的格子。 */
.detail .search-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 6px;
  margin-top: 6px;
}
.detail .k .kw { font-style: normal; color: var(--text-2); }
.detail .search-link {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  height: 26px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--text-2);
  font-size: 12px; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: border-color .12s, color .12s, background .12s;
}
.detail .search-link:hover {
  border-color: var(--accent); color: var(--accent); background: var(--accent-soft);
}
.detail .search-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.detail .search-link .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-3); flex: 0 0 auto;
}
/* 平台标识色（各家品牌色，仅作辨认用，不参与状态表达） */
.detail .search-link[data-p="bing"] .dot { background: #0a7d6b; }
.detail .search-link[data-p="amap"] .dot { background: #1677ff; }
.detail .search-link[data-p="xhs"] .dot { background: #ff2442; }
.detail .search-link[data-p="douyin"] .dot { background: #1a1a2e; }
.detail .search-link[data-p="bili"] .dot { background: #00a1d6; }

/* ---------- 选中点气泡（天地图 InfoWindow）----------
 * 官方样式偏「灰框 + 重投影」，这里覆盖成与全站一致的浅色圆角卡片。
 * 天地图的 CSS 是运行时注入的，出现在本文档之后，所以覆盖必须带 !important。 */
.tdt-infowindow-content-wrapper {
  padding: 0 !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  background: var(--surface) !important;
  box-shadow: 0 6px 22px rgba(20,22,26,.14) !important;
}
.tdt-infowindow-content {
  margin: 0 !important;
  width: auto !important;
  min-width: 194px;
  max-width: 268px;
}
.tdt-infowindow-tip-container { width: 30px !important; height: 13px !important; }
.tdt-infowindow-tip {
  width: 12px !important; height: 12px !important;
  padding: 0 !important; margin: -7px auto 0 !important;
  background: var(--surface) !important;
  border: none !important;
  box-shadow: 0 3px 8px rgba(20,22,26,.10) !important;
}
.tdt-infowindow-close-button {
  top: 2px !important; right: 4px !important;
  width: 20px !important; height: 20px !important;
  font-size: 16px !important; line-height: 18px !important;
  color: var(--text-3) !important;
  z-index: 2;
}
.map-bubble { padding: 10px 26px 10px 12px; }
.map-bubble-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.map-bubble-meta {
  margin-top: 4px; font-size: 11.5px; color: var(--text-3);
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.map-bubble-lv {
  padding: 1px 5px; border-radius: 4px; background: #e8f1fb; color: #185fa5;
}
.map-bubble-crowd { padding: 1px 5px; border-radius: 4px; }
.map-bubble-crowd.crowd-low { background: #e6f5f0; color: #0f6e56; }
.map-bubble-crowd.crowd-mid { background: #fdf1dc; color: #854f0b; }
.map-bubble-crowd.crowd-high { background: #fbe9e9; color: #a32d2d; }
.map-bubble-crowd.none { background: #f2f3f5; color: var(--text-3); }

.cam-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; font-weight: 600; margin-bottom: 10px;
}
.cam-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
}
.cam-item .t { font-size: 13px; font-weight: 500; }
.cam-item .m { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.cam-item video, .cam-item img {
  width: 100%; border-radius: 6px; margin-top: 8px; background: #000; display: block;
}

.toast {
  position: absolute;
  left: 50%; bottom: 24px;
  transform: translateX(-50%);
  background: rgba(26,29,33,.9);
  color: #fff;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 8px;
  z-index: 1300;
}

/* ---------- 地图未启用引导卡 ---------- */
/* z-index 必须低于详情卡（1000）：引导层是 inset:0 的整屏遮罩，若压在详情卡之上，
 * 「地图挂了」这种降级状态下点列表项就什么也看不到——而详情卡里的地址、标签、
 * 流量信号、站外搜索链接本来都不依赖地图，是能用的。 */
.map-hint {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(244,245,247,.86);
  z-index: 900; padding: 24px;
}
.map-hint-card {
  max-width: 460px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 20px 22px; box-shadow: 0 8px 30px rgba(20,22,26,.12);
}
.map-hint-card h3 { font-size: 16px; margin-bottom: 8px; }
.map-hint-card p { font-size: 13px; color: var(--text-2); line-height: 1.6; margin: 6px 0; }
.map-hint-card .map-hint-err { display: none; color: #c0392b; font-weight: 600; }
.map-hint-card .map-hint-sub { margin-top: 12px; font-weight: 600; color: var(--text); }
.map-hint-card ol { margin: 6px 0 0; padding-left: 20px; }
.map-hint-card li { font-size: 13px; color: var(--text-2); line-height: 1.7; }
.map-hint-card code {
  background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 12px;
}
.map-hint-card a { color: var(--accent); }
.map-hint-card .map-hint-note {
  margin-top: 10px; padding: 8px 10px; font-size: 12px; line-height: 1.6;
  background: var(--surface-2); border-left: 3px solid var(--accent); border-radius: 4px;
}
.map-hint-card .map-hint-diag {
  margin: 10px 0 0; padding: 8px 10px; max-height: 190px; overflow: auto;
  background: var(--surface-2); border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px; line-height: 1.6; color: var(--text-2);
  white-space: pre-wrap; word-break: break-all;
}
.map-hint-card .map-hint-actions {
  display: flex; gap: 8px; margin-top: 12px;
}
.map-hint-card .map-hint-actions .btn { text-decoration: none; }

/* modal（导入弹窗）已于 2026-09-16 随顶栏「导入」按钮一并移除，其样式同时删掉。
 * textarea.input 当时也只被导入弹窗用到，一并删除。 */

table.kv { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 8px; }
table.kv td { padding: 4px 2px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.kv td:first-child { color: var(--text-3); width: 92px; white-space: nowrap; }

.route-step { font-size: 12.5px; padding: 5px 0; border-bottom: 1px solid var(--line-soft); color: var(--text-2); }
.route-sum { font-size: 13px; margin: 8px 0; }
.route-sum b { color: var(--accent); font-size: 16px; }

/* ---------- hidden 显隐兜底 ----------
 * 作者样式里的 display 会覆盖 [hidden] 默认的 display:none，
 * 导致带 hidden 属性的元素无法隐藏（如详情卡、地图提示卡）。统一兜底。 */
[hidden] { display: none !important; }

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .panel { flex: 0 0 auto; width: auto; max-height: 42vh; border-right: none; border-bottom: 1px solid var(--line); }
  .panel-resize { display: none; }
  .map-wrap { flex: 1 1 auto; min-height: 58vh; }
  .detail, .cam-panel { width: calc(100% - 28px); }
}
