:root {
  --bg: rgba(15, 23, 42, 0.82);
  --bg2: rgba(30, 41, 59, 0.92);
  --line: rgba(255, 255, 255, 0.14);
  --txt: #f1f5f9;
  --muted: rgba(255, 255, 255, 0.55);
  --accent: #1677ff;
  --danger: #ff4d4f;
}
* { box-sizing: border-box; }
/* 保证 hidden 属性始终生效（修复 display 覆盖导致元素常显的 bug） */
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; }
#map { position: absolute; inset: 0; }
.leaflet-container { font-family: inherit; background: #0b1220; }

/* ===== 加载界面 ===== */
#loading-screen {
  position: fixed; inset: 0; z-index: 3000;
  background: radial-gradient(1200px 600px at 20% -10%, #16233f 0%, #0b1220 55%) fixed, #0b1220;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  color: var(--txt); transition: opacity 0.45s ease;
}
#loading-screen.out { opacity: 0; pointer-events: none; }
.ls-logo { font-size: 30px; font-weight: 700; letter-spacing: 3px; }
.ls-sub { font-size: 13px; color: var(--muted); }
.ls-spinner {
  width: 34px; height: 34px; border-radius: 50%; margin-top: 6px;
  border: 3px solid rgba(255, 255, 255, 0.15); border-top-color: var(--accent);
  animation: ls-spin 0.9s linear infinite;
}
@keyframes ls-spin { to { transform: rotate(360deg); } }
#ls-text { font-size: 12.5px; color: rgba(255, 255, 255, 0.65); }

.tools { display: flex; gap: 6px; flex-wrap: wrap; }
.tool {
  background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line); color: var(--txt);
  border-radius: 9px; padding: 6px 12px; font-size: 13px; cursor: pointer; transition: all 0.15s;
}
.tool:hover { background: rgba(255, 255, 255, 0.18); }
.tool.active { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.35); }
.tool.danger:hover { background: var(--danger); border-color: var(--danger); }
.tool.recording { background: #c62828; border-color: #c62828; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }

/* ===== 路线搜索（左上角） ===== */
#search-box { position: absolute; top: 12px; left: 12px; z-index: 1350; width: 260px; }
.search-row { display: flex; gap: 6px; }
.search-row input { flex: 1; min-width: 0; }
#btn-hot {
  flex-shrink: 0; font-size: 12.5px; font-weight: 600; cursor: pointer;
  padding: 0 12px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.1); color: var(--txt);
}
#btn-hot:hover { background: rgba(255, 255, 255, 0.18); }
#btn-hot.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.sr-head { padding: 9px 14px 4px; font-size: 12px; font-weight: 700; color: var(--accent); }
.sr-stars { display: flex; gap: 5px; padding: 6px 14px 2px; flex-wrap: wrap; }
.sr-stars .sr-star {
  font-size: 11.5px; padding: 3px 9px; cursor: pointer; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.08); color: var(--muted);
}
.sr-stars .sr-star.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
#search-input {
  width: 100%; background: var(--bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); color: var(--txt); border-radius: 12px;
  padding: 10px 14px; font-size: 13.5px; outline: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
#search-input:focus { border-color: var(--accent); }
#search-input::placeholder { color: var(--muted); }

/* ===== 论坛入口（右上角） ===== */
#forum-btn {
  position: absolute; top: 12px; right: 12px; z-index: 1200;
  background: var(--accent); border: 1px solid var(--accent); color: #fff;
  border-radius: 999px; padding: 9px 16px; font-size: 13px; font-weight: 600;
  text-decoration: none; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transition: all 0.15s;
}
#forum-btn:hover { background: #2f88ff; transform: translateY(-1px); }

/* ===== 登录按钮（手机：左上角；电脑：左下角） ===== */
#btn-login {
  position: absolute; z-index: 1200;
  background: var(--accent); border: 1px solid var(--accent); color: #fff;
  border-radius: 999px; padding: 9px 16px; font-size: 12.5px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); transition: all 0.15s;
  max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#btn-login:hover { background: #2f88ff; }
#btn-login { left: 132px; bottom: 14px; } /* 电脑：左下角（编辑按钮右侧） */

/* ===== 个人信息弹窗（登录后点名字） ===== */
#profile-pop {
  position: absolute; left: 132px; bottom: 58px; z-index: 1300;
  width: 244px; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  color: var(--txt); font-size: 12.5px;
}
.pp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pp-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #1677ff, #722ed1); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700;
  flex-shrink: 0; overflow: hidden;
}
.pp-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.pp-nick { font-size: 14px; font-weight: 700; }
.pp-user { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.pp-row { display: flex; padding: 6px 0; border-top: 1px dashed rgba(255, 255, 255, 0.08); }
.pp-row:first-of-type { border-top: none; }
.pp-k { width: 58px; color: var(--muted); flex-shrink: 0; }
.pp-btns { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
#pp-go-me { color: #7cb3ff; text-decoration: none; font-size: 12.5px; }
#pp-go-me:hover { text-decoration: underline; }
#pp-logout {
  background: transparent; border: 1px solid rgba(255, 77, 79, 0.5); color: #ff7875;
  border-radius: 999px; padding: 6px 14px; font-size: 12px; cursor: pointer;
}
#pp-logout:hover { background: rgba(255, 77, 79, 0.15); }

/* ===== 登录弹窗 ===== */
#login-mask {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(2, 6, 17, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
}
.login-box {
  width: min(360px, 90vw); background: var(--bg2); border: 1px solid var(--line);
  border-radius: 16px; padding: 22px 24px; box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
  color: var(--txt);
  max-height: calc(100vh - 56px); overflow-y: auto; /* 移动端键盘弹出时可滚动 */
}
.login-box h3 { margin: 0 0 6px; font-size: 16px; }
.login-tip { margin: 0 0 14px; font-size: 12px; color: var(--muted); }
.login-box input {
  width: 100%; background: rgba(255, 255, 255, 0.09); border: 1px solid var(--line); color: var(--txt);
  border-radius: 10px; padding: 10px 12px; font-size: 13.5px; outline: none;
}
.login-box input:focus { border-color: var(--accent); }
.lg-code-row { display: flex; gap: 8px; margin-top: 10px; }
.lg-code-row input { flex: 1; }
.lg-code-row .pill-btn { white-space: nowrap; }
.lg-code-row .pill-btn:disabled { opacity: 0.5; cursor: default; }
#lg-nick { margin-top: 10px; }
#lg-pwd-view input, #lg-sms-view input, #lg-reg-view input { margin-top: 10px; }
.login-btns { display: flex; gap: 8px; margin-top: 14px; }
.lg-toggle {
  margin-top: 14px; text-align: center; font-size: 12.5px; color: var(--muted);
}
.lg-toggle a {
  color: #7cb3ff; cursor: pointer; text-decoration: none; margin: 0 4px;
}
.lg-toggle a:hover { text-decoration: underline; }
.lg-sep { color: var(--muted); opacity: 0.5; }
.lg-seg { display: flex; gap: 6px; margin-top: 10px; }
.lg-seg .seg {
  flex: 1; background: rgba(255, 255, 255, 0.09); border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 8px 0; font-size: 12.5px; cursor: pointer; transition: all 0.15s;
}
.lg-seg .seg:hover { background: rgba(255, 255, 255, 0.15); }
.lg-seg .seg.on { background: rgba(22, 119, 255, 0.18); border-color: var(--accent); color: var(--txt); }

/* ===== 上传路线弹窗 ===== */
#upload-mask {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(2, 6, 17, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
}
#upload-mask .login-box { width: min(380px, 92vw); }
#up-name { margin-top: 10px; }
.up-file-input {
  flex: 1; background: rgba(255, 255, 255, 0.09); border: 1px solid var(--line); color: var(--txt);
  border-radius: 10px; padding: 9px 12px; font-size: 12.5px; outline: none;
}
.up-file-input::file-selector-button {
  background: rgba(255, 255, 255, 0.12); border: 1px solid var(--line); color: var(--txt);
  border-radius: 8px; padding: 5px 12px; font-size: 12px; cursor: pointer; margin-right: 8px;
}
.up-file-input::file-selector-button:hover { background: rgba(255, 255, 255, 0.2); }
.pill-btn {
  background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line); color: var(--txt);
  border-radius: 999px; padding: 9px 15px; font-size: 12.5px; cursor: pointer; transition: all 0.15s;
}
.pill-btn:hover { background: rgba(255, 255, 255, 0.18); }
.pill-btn.primary { background: var(--accent); border-color: var(--accent); font-weight: 600; }
.pill-btn.primary:hover { background: #2f88ff; }
.login-btns .pill-btn { flex: 1; }

/* ===== 定位按钮（右侧中部） ===== */
#btn-locate {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%); z-index: 1200;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line); color: var(--txt); font-size: 17px; line-height: 1;
  cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
}
#btn-locate:hover { background: rgba(255, 255, 255, 0.16); }
#btn-locate.locating { color: var(--accent); animation: pulse 1.2s infinite; }
#search-results {
  margin-top: 6px; background: var(--bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); max-height: 300px; overflow-y: auto;
  color: var(--txt);
}
#search-sort { display: flex; gap: 6px; padding: 8px 0 0; }
#search-sort button {
  flex: 1; font-size: 12px; padding: 5px 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}
#search-sort button.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.sr-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.sr-item:last-child { border-bottom: none; }
.sr-item:hover { background: rgba(255, 255, 255, 0.1); }
.sr-item .sr-name { font-size: 13.5px; font-weight: 600; }
.sr-item .sr-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.sr-empty { padding: 12px 14px; font-size: 12.5px; color: var(--muted); }

/* ===== 编辑工具卡（左下角，点击"编辑路线"展开，默认隐藏） ===== */
.tool.toggle { background: var(--accent); border-color: var(--accent); font-weight: 600; }
.tool.toggle:hover { background: #2f88ff; }
.float-toggle {
  position: absolute; left: 12px; bottom: 14px; z-index: 1200;
  padding: 10px 20px; font-size: 13.5px; border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
#tools-panel {
  position: absolute; left: 12px; bottom: 64px; z-index: 1200;
  display: none; flex-direction: column; gap: 6px;
  background: var(--bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 12px; padding: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
body.edit-open #tools-panel { display: flex; }
body.edit-open #layer-switch { bottom: 312px; }

/* ===== 右侧面板 ===== */
#panel {
  position: absolute; top: 76px; right: 12px; z-index: 1200;
  width: 345px; max-height: calc(100vh - 96px); overflow: hidden;
  background: var(--bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 14px; color: var(--txt);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s ease;
}
#panel.collapsed { transform: translateX(calc(100% + 20px)); }
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; font-size: 14px; font-weight: 600; border-bottom: 1px solid var(--line);
}
.ref-note {
  font-size: 10.5px; font-weight: 400; color: var(--muted); opacity: 0.8; margin-right: auto; margin-left: 8px;
  white-space: nowrap;
}
.x { background: transparent; border: none; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; }
.x:hover { color: #fff; }
#panel-empty { padding: 28px 18px; font-size: 13px; color: var(--muted); line-height: 1.8; }
#panel-body { padding: 12px 14px; overflow-y: auto; height: calc(100vh - 168px); }
.route-switch {
  width: 100%; background: rgba(255, 255, 255, 0.09); border: 1px solid var(--line); color: var(--txt);
  border-radius: 9px; padding: 9px 10px; font-size: 13px; margin-bottom: 8px; outline: none; cursor: pointer;
}
.route-switch option { background: #1e293b; color: #fff; }
.mk-toggle {
  width: 100%; background: rgba(255, 255, 255, 0.09); border: 1px solid var(--line); color: var(--txt);
  border-radius: 9px; padding: 9px 10px; font-size: 13px; margin-bottom: 8px; cursor: pointer; outline: none;
}
.mk-toggle:hover { background: rgba(255, 255, 255, 0.16); }
.route-name {
  width: 100%; background: rgba(255, 255, 255, 0.09); border: 1px solid var(--line); color: var(--txt);
  border-radius: 9px; padding: 9px 10px; font-size: 14px; outline: none;
}
.route-name:focus { border-color: var(--accent); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.stat { background: rgba(255, 255, 255, 0.07); border-radius: 10px; padding: 9px 10px; }
.stat b { display: block; font-size: 16px; font-weight: 700; }
.stat span { font-size: 11px; color: var(--muted); }
.profile-wrap { background: rgba(255, 255, 255, 0.06); border-radius: 10px; padding: 8px; position: relative; }
#profile { width: 100%; height: 150px; display: block; }
#profile .gline { stroke: rgba(255, 255, 255, 0.12); stroke-width: 1; }
#profile .glabel { fill: rgba(255, 255, 255, 0.45); font-size: 9px; }
#profile .area { fill: rgba(22, 119, 255, 0.28); }
#profile .pline { fill: none; stroke: #4ea1ff; stroke-width: 2; }
#profile .ph { fill: rgba(255, 255, 255, 0.4); font-size: 11px; }
#profile .vline { stroke: #fff; stroke-width: 1; stroke-dasharray: 3 3; }
#profile .hdot { fill: #ff4d4f; stroke: #fff; stroke-width: 1.5; }
.profile-info { position: absolute; top: 12px; left: 42px; font-size: 11px; color: #cfe3ff; pointer-events: none; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.actions button {
  flex: 1 1 90px; background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line); color: var(--txt);
  border-radius: 9px; padding: 8px 4px; font-size: 12.5px; cursor: pointer; transition: all 0.15s;
  white-space: nowrap; min-width: 0; /* 防止按钮文字挤压重叠 */
}
.actions button:hover { background: rgba(255, 255, 255, 0.2); }
.actions button.primary { background: var(--accent); border-color: var(--accent); font-weight: 600; }
.actions button.danger:hover { background: var(--danger); border-color: var(--danger); }

/* ===== 面板内嵌发帖框 ===== */
.post-box {
  margin-top: 12px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px;
}
.post-head { font-size: 13px; font-weight: 600; margin-bottom: 8px; color: #cfe3ff; }
.post-box input, .post-box textarea {
  width: 100%; background: rgba(255, 255, 255, 0.09); border: 1px solid var(--line); color: var(--txt);
  border-radius: 8px; padding: 8px 10px; font-size: 13px; outline: none; box-sizing: border-box;
}
.post-box input { margin-bottom: 8px; }
.post-box textarea { min-height: 90px; resize: vertical; }
.post-btns { display: flex; gap: 8px; margin-top: 8px; }
.post-btns button {
  flex: 1; background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line); color: var(--txt);
  border-radius: 8px; padding: 8px; font-size: 13px; cursor: pointer;
}
.post-btns button.primary { background: var(--accent); border-color: var(--accent); font-weight: 600; }

/* ===== 面板内相关讨论 ===== */
.rd-box { margin-top: 12px; }
.rd-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; margin-bottom: 8px;
}
.rd-cnt { font-size: 11px; color: var(--muted); font-weight: 400; }
.rd-goto, #rd-goto { margin-left: auto; font-size: 12px; color: #7cb3ff; text-decoration: none; font-weight: 400; }
.rd-goto:hover, #rd-goto:hover { text-decoration: underline; }
.rd-item {
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 11px; margin-bottom: 7px; cursor: pointer; transition: background 0.15s;
}
.rd-item:hover { background: rgba(255, 255, 255, 0.12); }
.rd-title { font-size: 13px; font-weight: 600; }
.rd-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.rd-empty { font-size: 12px; color: var(--muted); line-height: 1.7; }
.rd-toggle {
  width: 100%; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); color: var(--txt);
  border-radius: 8px; padding: 7px; font-size: 12.5px; cursor: pointer; margin-top: 2px;
}
.rd-toggle:hover { background: rgba(255, 255, 255, 0.14); }

/* ===== 绘制浮动工具 ===== */
#draft-tools {
  position: absolute; right: 18px; bottom: 64px; z-index: 1200;
  display: flex; flex-direction: column; gap: 6px;
}
.dt {
  background: var(--bg2); border: 1px solid var(--line); color: var(--txt);
  border-radius: 10px; padding: 8px 14px; font-size: 13px; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
.dt:hover { background: rgba(255, 255, 255, 0.15); }
.dt.primary { background: var(--accent); border-color: var(--accent); font-weight: 600; }

/* ===== 图层切换 ===== */
#layer-switch {
  position: absolute; left: 12px; bottom: 70px; z-index: 1200;
  display: flex; flex-direction: column; gap: 6px;
}
.ls-toggle {
  align-self: flex-start;
  background: var(--bg); backdrop-filter: blur(8px); border: 1px solid var(--line); color: var(--txt);
  border-radius: 999px; padding: 7px 14px; font-size: 12.5px; cursor: pointer; transition: all 0.15s;
}
.ls-toggle:hover { background: rgba(255, 255, 255, 0.16); }
.ls-body { display: flex; flex-direction: column; gap: 6px; }
#layer-switch.collapsed .ls-body { display: none; }
.ls-btn {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg); backdrop-filter: blur(8px); border: 1px solid var(--line); color: var(--txt);
  border-radius: 999px; padding: 6px 12px; font-size: 12px; cursor: pointer; transition: all 0.15s;
}
.ls-btn:hover { background: rgba(255, 255, 255, 0.16); }
.ls-btn.active { background: var(--accent); border-color: var(--accent); }
.ls-sep { height: 1px; background: rgba(255, 255, 255, 0.16); margin: 2px 10px; }

/* ===== 标记点 ===== */
.wp-wrap { background: transparent; border: none; }
.wp-inner {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  background: rgba(15, 23, 42, 0.88); border: 2.5px solid var(--c, #8c8c8c);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.wp-ele {
  margin-top: 3px; text-align: center; font-size: 10px; font-weight: 700; color: #fff;
  background: rgba(180, 60, 20, 0.92); border-radius: 999px; padding: 1px 5px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); white-space: nowrap;
}
.wp-ele-line { margin-top: 6px; font-size: 12px; color: var(--muted); }
.edit-handle { background: transparent; border: none; }
.edit-handle .eh {
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 3px solid var(--accent);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.6); cursor: move;
}
.wp-edit { display: flex; flex-direction: column; gap: 6px; min-width: 160px; }
.wp-edit input, .wp-edit select {
  background: #1e293b; border: 1px solid rgba(255, 255, 255, 0.2); color: #fff;
  border-radius: 7px; padding: 7px 8px; font-size: 13px; outline: none;
}
.leaflet-popup-content-wrapper { background: rgba(15, 23, 42, 0.95); color: #fff; border-radius: 12px; }
.leaflet-popup-tip { background: rgba(15, 23, 42, 0.95); }

/* ===== 标记点聚合箭头 ===== */
.wg-wrap { background: transparent; border: none; }
.wg-arrow { display: flex; flex-direction: column; align-items: center; }
.wg-badge {
  background: linear-gradient(135deg, #ff6a5e, #d4380d);
  color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap;
  padding: 7px 16px; border-radius: 999px; cursor: pointer;
  border: 2px solid #fff; box-shadow: 0 5px 16px rgba(0, 0, 0, 0.45);
}
.wg-badge:hover { filter: brightness(1.1); }
.wg-tip {
  width: 0; height: 0; margin-top: -2px;
  border-left: 9px solid transparent; border-right: 9px solid transparent;
  border-top: 12px solid #d4380d;
}

/* ===== 广告位（路线详情面板底部） ===== */.ad-slot {
  margin-top: 12px; border: 1px dashed rgba(255, 255, 255, 0.22); border-radius: 10px;
  padding: 10px 12px; font-size: 12.5px; color: var(--muted);
  background: rgba(255, 255, 255, 0.04); line-height: 1.7;
}
.ad-tag {
  display: inline-block; font-size: 10px; color: var(--muted); border: 1px solid var(--line);
  border-radius: 4px; padding: 0 5px; margin-right: 8px; vertical-align: 1px;
}
.ad-slot a.ad-inner { color: var(--txt); text-decoration: none; }
.ad-slot a.ad-inner:hover { color: var(--accent); text-decoration: underline; }

/* ===== 上传标记弹窗 ===== */
#marker-mask textarea {
  width: 100%; margin-top: 10px; min-height: 90px; background: rgba(255, 255, 255, 0.09);
  border: 1px solid var(--line); color: var(--txt); border-radius: 10px; padding: 10px 12px;
  font-size: 13px; outline: none; font-family: inherit; resize: vertical; box-sizing: border-box;
}
#marker-mask textarea:focus { border-color: var(--accent); }
.umk { background: transparent; border: none; }

/* ===== 标记选点确认条 ===== */
#mk-point-bar {
  position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); z-index: 1300;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  font-size: 12px; color: var(--txt); max-width: 92vw;
}
.mk-point-loc { color: var(--muted); font-family: monospace; font-size: 11px; }
@media (max-width: 760px) {
  #mk-point-bar { bottom: calc(56px + env(safe-area-inset-bottom, 0px)); border-radius: 14px; }
}

/* ===== 记录状态 / 提示 / Toast ===== */
#rec-status {
  position: absolute; top: 84px; left: 50%; transform: translateX(-50%); z-index: 1200;
  background: rgba(198, 40, 40, 0.92); color: #fff; font-size: 13px;
  padding: 8px 18px; border-radius: 999px; box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
#load-status {
  position: absolute; top: 56px; left: 50%; transform: translateX(-50%); z-index: 1200;
  background: rgba(22, 119, 255, 0.92); color: #fff; font-size: 13px;
  padding: 8px 18px; border-radius: 999px; box-shadow: 0 4px 14px rgba(0,0,0,.35);
  white-space: nowrap;
}
#hint {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 1100;
  background: rgba(15, 23, 42, 0.72); color: rgba(255, 255, 255, 0.82); font-size: 12px;
  padding: 7px 18px; border-radius: 999px; pointer-events: none; white-space: nowrap;
}
#toast {
  position: absolute; top: 86px; left: 50%; transform: translateX(-50%); z-index: 3200;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.toast-item {
  background: rgba(15, 23, 42, 0.94); color: #fff; font-size: 13px;
  padding: 9px 18px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  animation: fadeIn 0.25s ease; border: 1px solid var(--line); max-width: 80vw;
}
.toast-item.out { opacity: 0; transition: opacity 0.3s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } }

/* ===== 移动端（手机） ===== */
@media (max-width: 760px) {
  /* 搜索框：顶部通栏，紧贴论坛按钮左侧 */
  #search-box { top: 10px; left: 10px; right: 10px; width: auto; }
  #search-input { padding: 11px 13px; font-size: 14px; border-radius: 11px; }
  #search-results { max-height: 42vh; }

  /* 论坛按钮：紧凑 */
  #forum-btn { top: 10px; right: 10px; padding: 10px 14px; font-size: 12.5px; }

  /* 详情面板：底部抽屉（全宽、圆角、不超过屏幕 1/3，内容可滚动） */
  #panel {
    left: 8px; right: 8px; top: auto;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    width: auto; max-height: 33vh;
    border-radius: 16px 16px 12px 12px;
  }
  #panel.collapsed { transform: translateY(calc(100% + 28px)); }
  .panel-head { padding: 14px 14px 10px; font-size: 14.5px; }
  .x { font-size: 22px; padding: 2px 6px; }
  #panel-empty { padding: 22px 16px; font-size: 13px; }
  #panel-body {
    height: auto;
    max-height: calc(33vh - 52px - env(safe-area-inset-bottom, 0px));
    padding: 12px 14px calc(16px + env(safe-area-inset-bottom, 0px));
  }

  /* 工具按钮：加大触摸目标 */
  .tool { padding: 10px 13px; font-size: 12.5px; border-radius: 10px; }
  /* 编辑按钮：左上角（搜索框下方，图层按钮右侧） */
  .float-toggle {
    left: 88px; top: 58px; bottom: auto;
    padding: 11px 18px; font-size: 13px;
  }
  /* 登录按钮：左上角（编辑按钮右侧） */
  #btn-login { left: 188px; top: 58px; bottom: auto; padding: 11px 16px; font-size: 12.5px; }
  #tools-panel {
    left: 10px; top: 100px; bottom: auto;
    max-width: calc(100vw - 20px);
  }
  /* 编辑工具展开时隐藏图层切换（左上角空间不足，编辑完自动恢复） */
  body.edit-open #layer-switch { display: none; }

  /* 图层切换：左上角（搜索框下方） */
  #layer-switch {
    left: 10px; top: 58px; bottom: auto;
    gap: 5px; align-items: flex-start;
  }
  .ls-btn, .ls-toggle { padding: 8px 13px; font-size: 11.5px; }

  /* 操作按钮：两列（精确 50% 避免重叠） */
  .actions button { flex: 1 1 calc(50% - 4px); padding: 10px 4px; font-size: 12.5px; }

  /* 标记点聚合箭头：缩小避免遮挡 */
  .wg-badge { font-size: 12px; padding: 6px 13px; }

  /* 个人信息弹窗：移动端放左上角搜索框下方 */
  #profile-pop { left: 10px; bottom: auto; top: 102px; }

  /* 绘制浮动工具：右下角 */
  #draft-tools { right: 12px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
  .dt { padding: 10px 16px; font-size: 13px; }

  /* 状态条位置下移（搜索框通栏后避免重叠） */
  #load-status { top: 64px; max-width: calc(100vw - 20px); white-space: normal; }
  #rec-status { top: 108px; }
  #toast { top: 118px; }
  .toast-item { font-size: 12.5px; }

  /* 面板内关键统计：一行 4 项紧凑显示（首屏不滚动可见） */
  .stats { grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 6px 0; }
  .stat { padding: 4px 2px; text-align: center; }
  .stat b { font-size: 12px; }
  .stat span { font-size: 10px; }
  /* 海拔剖面折叠按钮 */
  .profile-toggle { margin-bottom: 6px; padding: 8px; font-size: 12.5px; }
  .route-name { padding: 7px 10px; font-size: 13.5px; }
  .actions { margin-top: 6px; gap: 6px; }
  .actions button { flex: 1 1 30%; padding: 7px 2px; font-size: 12px; }
}
