/* ============================================================
 * 北疆金秋9日环线 · 样式
 * ============================================================ */
:root {
  --bg: #f3f1ec;
  --panel: #ffffff;
  --ink: #1d2430;
  --ink-2: #4d5766;
  --ink-3: #8b93a1;
  --line: #e3ded5;
  --dark: #1b2230;
  --dark-2: #232c3d;
  --accent: #e0604b;
  --gold: #f2a03d;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28, 34, 46, .06), 0 8px 24px rgba(28, 34, 46, .07);
}

* { box-sizing: border-box; }

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

body {
  display: flex;
  flex-direction: column;
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 16px 24px;
  background: linear-gradient(118deg, #1b2230 0%, #2a3547 58%, #4a3b2e 100%);
  color: #fff;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 14px; min-width: 320px; }

.brand-mark {
  width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center;
  font-size: 20px; font-weight: 800; color: #1b2230;
  background: linear-gradient(140deg, var(--gold), #ffd479);
  box-shadow: 0 6px 18px rgba(242, 160, 61, .3);
}

.brand h1 { margin: 0; font-size: 20px; letter-spacing: .6px; font-weight: 700; }
.brand .sub { margin: 2px 0 0; font-size: 12.5px; color: #b7c0cf; }

.stats { display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; }

.stat {
  min-width: 104px;
  padding: 8px 14px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .075);
  border: 1px solid rgba(255, 255, 255, .09);
}
.stat b { display: block; font-size: 19px; font-weight: 700; line-height: 1.2; }
.stat span { font-size: 11.5px; color: #a9b3c2; }
.stat-wide { min-width: 260px; }
.stat-wide i { font-style: normal; font-size: 12px; color: #b7c0cf; }

/* ---------------- 工具条 ---------------- */
.toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.tabs { display: flex; gap: 4px; background: #f0ede7; padding: 3px; border-radius: 11px; }
.tabs button {
  border: 0; background: transparent; cursor: pointer;
  padding: 7px 16px; border-radius: 8px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  font-family: inherit; transition: .16s;
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(28,34,46,.12); }

.actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }

button, select {
  font-family: inherit;
  font-size: 13px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-2);
  padding: 7px 13px;
  cursor: pointer;
  transition: .16s;
}
button:hover, select:hover { border-color: #cfc8bc; color: var(--ink); }
button.primary { background: var(--dark); color: #fff; border-color: var(--dark); }
button.primary:hover { background: #2b3547; color: #fff; }
button.ghost { background: transparent; }
button.playing { background: var(--accent); border-color: var(--accent); color: #fff; }

.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; user-select: none; }
.chk input { accent-color: var(--dark); }

/* ---------------- 视图 ---------------- */
main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.view { display: none; flex: 1; min-height: 0; }
.view.show { display: flex; }

#view-table.show, #view-prep.show { display: block; overflow: auto; padding: 20px; }

/* ---------------- 侧栏 ---------------- */
.sidebar {
  width: 384px; flex: none;
  display: flex; flex-direction: column;
  background: var(--panel);
  border-right: 1px solid var(--line);
  min-height: 0;
}

.side-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfaf8;
}
.side-head .src { font-size: 12px; color: var(--ink-3); display: flex; gap: 6px; align-items: baseline; }
.side-head .src b { color: var(--ink-2); font-weight: 600; }
.side-head .hint { margin: 6px 0 0; font-size: 11.5px; color: var(--ink-3); }

.pending-box { display: none; }
.pending-box.show {
  display: block;
  margin: 12px;
  padding: 12px;
  border-radius: 11px;
  background: #fff8ec;
  border: 1px solid #f0d9ae;
}
.pending-title { font-size: 12.5px; color: #8a6320; margin-bottom: 8px; }
.pending-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pending-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 5px 10px;
  background: #fff; border-color: #ecd5a8; color: #7d5a1c;
}
.pending-item span { font-size: 10.5px; color: #b09468; }

.day-list { flex: 1; overflow-y: auto; padding: 12px; }

.day-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  margin-bottom: 12px;
  overflow: hidden;
  transition: .18s;
  box-shadow: 0 1px 2px rgba(28, 34, 46, .04);
}
.day-card:hover { box-shadow: var(--shadow); border-color: #d6cfc3; }
.day-card.is-hidden { opacity: .42; }

.day-head {
  position: relative;
  padding: 12px 14px 12px 17px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 12%, #fff) 0%, #fff 62%);
  border-left: 4px solid var(--c);
  cursor: pointer;
}
.day-head-main { display: flex; align-items: baseline; gap: 8px; }
.day-chip {
  font-size: 12px; font-weight: 800; color: #fff;
  background: var(--c); border-radius: 6px; padding: 2px 8px; letter-spacing: .3px;
}
.day-date { font-size: 12px; color: var(--ink-3); }
.day-title { margin-top: 7px; font-size: 13.5px; font-weight: 600; line-height: 1.45; padding-right: 52px; }
.day-meta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  font-size: 11px; padding: 2px 8px; border-radius: 20px;
  background: #f2efe9; color: var(--ink-2); border: 1px solid #e6e1d8;
}
.tag-live { background: #eef6f0; color: #2f7a4d; border-color: #cfe7d9; }
.tag-warn { background: #fdf1e8; color: #a2582a; border-color: #f3dcc8; }

.day-toggle {
  position: absolute; top: 11px; right: 12px;
  font-size: 11.5px; padding: 4px 9px; border-radius: 7px;
  background: #fff; color: var(--ink-3);
}

.day-stay {
  padding: 9px 14px 9px 17px;
  font-size: 12.5px; color: var(--ink-2);
  background: #fbfaf8;
  border-top: 1px solid var(--line);
}

.day-tips { margin: 0; padding: 10px 16px 2px 30px; }
.day-tips li { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }

.pt-list { list-style: none; margin: 0; padding: 8px 8px 12px; }

.pt {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 7px 9px; border-radius: 9px; cursor: pointer; transition: .14s;
}
.pt:hover { background: #f7f5f1; }
.pt.is-active { background: #eef2f8; box-shadow: inset 0 0 0 1px #d5dfee; }

.pt-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--c); margin-top: 5px; flex: none;
  box-shadow: 0 0 0 2.5px color-mix(in srgb, var(--c) 22%, transparent);
}
.pt-body { flex: 1; min-width: 0; }
.pt-name { display: block; font-size: 13px; font-weight: 500; }
.pt-note { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.pt-type { font-size: 11px; color: var(--ink-3); flex: none; padding-top: 2px; }
.pt-nomatch .pt-dot { background: transparent; border: 2px dashed #d9a15b; box-shadow: none; }
.pt-nomatch .pt-type { color: #b8792c; font-weight: 600; }

.legend { padding: 12px 16px 16px; border-top: 1px solid var(--line); }
.legend-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.legend h4 { margin: 0; font-size: 11.5px; color: var(--ink-3); font-weight: 600; letter-spacing: .5px; }
.legend-btns { display: flex; gap: 6px; }
.legend-btns button {
  font-size: 11px; font-weight: 500; line-height: 1;
  padding: 5px 10px; border-radius: 20px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
}
.legend-btns button:hover { border-color: #cfc7ba; color: var(--ink); background: #f7f5f1; }
.legend-btns button:active { transform: translateY(1px); }

.legend-items { display: flex; flex-wrap: wrap; gap: 5px 7px; }
.legend-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--ink-2);
  padding: 3px 9px 3px 7px; border-radius: 20px;
  border: 1px solid transparent; background: #f6f4f0;
}
.legend-item i { width: 12px; height: 4px; border-radius: 3px; display: inline-block; flex: none; }
button.legend-item { cursor: pointer; font-family: inherit; text-align: left; }
button.legend-item:hover { border-color: #d6cfc3; color: var(--ink); background: #f2efe9; }
button.legend-item.is-off { opacity: .42; }
button.legend-item.is-off i {
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .95) 0 2px, transparent 2px 5px);
}
.legend-static { background: transparent; padding-left: 0; cursor: default; }
.legend-item i.legend-hotel {
  width: 13px; height: 13px; border-radius: 4px;
  background: var(--ink-3); position: relative;
}
.legend-item i.legend-hotel::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 5px; height: 5px; transform: translate(-50%, -50%);
  background: #fff; border-radius: 1px;
}

/* ---------------- 地图 ---------------- */
.map-wrap { position: relative; flex: 1; min-width: 0; }
#map { position: absolute; inset: 0; background: #eae6df; }
#map.picking { cursor: crosshair; }
#map.picking::after {
  content: '点击地图以定位该行程点';
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 900; padding: 8px 16px; border-radius: 20px;
  background: rgba(27, 34, 48, .92); color: #fff; font-size: 12.5px;
}

.leaflet-container { font-family: inherit; }

/* 行程点标记 */
.poi-wrap { background: none; border: 0; }

.poi-marker {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--c);
  border: 2.5px solid #fff;
  display: grid; place-items: center;
  box-shadow: 0 2px 7px rgba(20, 26, 36, .38);
  color: #fff; font-size: 12px; font-weight: 700;
  transition: transform .16s;
}
.poi-marker:hover { transform: scale(1.16); }
.poi-marker.is-start, .poi-marker.is-end { width: 34px; height: 34px; margin: -2px; font-size: 12.5px; }
.poi-marker.is-start { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .55), 0 2px 8px rgba(20,26,36,.4); }
.poi-marker.is-end { border-style: dashed; }

.poi-wrap.is-active .poi-marker {
  transform: scale(1.32);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, .8), 0 0 0 9px rgba(224, 96, 75, .35);
}

/* 住宿点专用标记：水滴形钉 + 白色房屋，与序号圆点区分 */
.poi-hotel {
  line-height: 0;
  filter: drop-shadow(0 2px 3px rgba(20, 26, 36, .38));
  transition: transform .16s;
}
.poi-hotel svg { display: block; overflow: visible; }
.poi-hotel .pin-body { fill: var(--c); stroke: #fff; stroke-width: 1.7; stroke-linejoin: round; }
.poi-hotel .pin-glyph { fill: #fff; }
.poi-hotel:hover { transform: scale(1.12); }
.poi-wrap.is-active .poi-hotel {
  transform: scale(1.3);
  filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 9px rgba(224, 96, 75, .75));
}

.ref-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--c); border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(20, 26, 36, .3);
  opacity: .9;
}

.route-arrow {
  width: 14px; height: 14px; line-height: 14px; text-align: center;
  font-size: 11px; color: var(--c);
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 2px #fff;
  transform-origin: 50% 50%;
}

.play-dot {
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 3px solid var(--accent);
  box-shadow: 0 0 0 6px rgba(224, 96, 75, .25);
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 5px rgba(224, 96, 75, .3); }
  50% { box-shadow: 0 0 0 11px rgba(224, 96, 75, .08); }
}

.poi-tip {
  background: rgba(24, 30, 41, .93);
  border: 0; color: #fff; font-size: 11.5px;
  padding: 3px 8px; border-radius: 6px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .25);
}
.poi-tip::before { display: none; }

.tt-meta { color: #a9b3c2; }

/* 弹窗 */
.leaflet-popup-content-wrapper { border-radius: 12px; box-shadow: 0 8px 26px rgba(20, 26, 36, .22); padding: 0; }
.leaflet-popup-content { margin: 0; width: auto !important; }
.pop { padding: 12px 14px 13px; min-width: 210px; }
.pop-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pop-day { font-size: 11px; font-weight: 700; color: #fff; background: var(--c); padding: 2px 8px; border-radius: 6px; }
.pop-type { font-size: 11px; color: var(--ink-3); }
.pop-name { font-size: 15px; font-weight: 700; line-height: 1.35; }
.pop-note { margin-top: 5px; font-size: 12.5px; color: var(--ink-2); }
.pop-coord { margin-top: 8px; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pop-btn { margin-top: 10px; width: 100%; font-size: 12px; padding: 6px; }

/* 载入遮罩 */
.loading {
  position: absolute; inset: 0; z-index: 950;
  display: none; align-items: center; justify-content: center; gap: 12px;
  background: rgba(247, 245, 241, .74);
  backdrop-filter: blur(3px);
  font-size: 13px; color: var(--ink-2); font-weight: 500;
}
.loading.show { display: flex; }
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid #d8d2c7; border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 表格 / 面板 ---------------- */
.scroll { max-width: 1500px; margin: 0 auto; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 18px;
  margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(28, 34, 46, .04);
}
.panel h3 {
  margin: 0 0 12px; font-size: 14px; font-weight: 700;
  padding-left: 10px; border-left: 3px solid var(--gold);
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 18px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th {
  text-align: left; padding: 8px 10px; font-weight: 600; color: var(--ink-3);
  border-bottom: 1.5px solid var(--line); font-size: 11.5px; white-space: nowrap;
}
.tbl td { padding: 9px 10px; border-bottom: 1px solid #f0ede8; vertical-align: top; }
.tbl tbody tr:hover { background: #fbfaf8; }
.tbl .dim { color: var(--ink-3); }
.tbl .nowrap { white-space: nowrap; }

.tbl-trip .rt { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.rt-node {
  background: #f4f1eb; border: 1px solid #e6e1d8;
  border-radius: 7px; padding: 2px 8px; font-size: 12px; white-space: nowrap;
}
.rt-node.warn { background: #fff6e9; border-color: #f0d9ae; color: #a06a1e; }
.rt-arrow { color: var(--ink-3); font-size: 11px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 6px; }

.ck-group { margin-bottom: 14px; }
.ck-group h4 { margin: 0 0 7px; font-size: 12.5px; color: var(--ink-2); }
.ck-items { display: flex; flex-wrap: wrap; gap: 6px; }
.ck { font-size: 12px; padding: 3px 10px; border-radius: 20px; background: #f4f1eb; color: var(--ink-2); }

.alerts { margin: 0; padding-left: 18px; }
.alerts li { font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px; line-height: 1.55; }

/* ---------------- 提示条 ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  z-index: 2000;
  padding: 11px 20px; border-radius: 11px;
  background: rgba(27, 34, 48, .95); color: #fff;
  font-size: 13px; box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
  opacity: 0; pointer-events: none; transition: .22s;
  max-width: 78vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.warn { background: #a8492f; }

/* ---------------- 移动端专用元素（桌面隐藏） ---------------- */
.sheet-grip, .sheet-head, .sheet-backdrop, .sheet-fab, .more-btn { display: none; }
.more-btn .caret {
  width: 0; height: 0; margin-left: 6px;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid currentColor; transition: transform .2s;
}

/* 触摸设备：去掉点击高亮，缩短点击响应 */
button, select, .chk, .pt, .legend-item, .day-head { touch-action: manipulation; }
button { -webkit-tap-highlight-color: transparent; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .sidebar { width: 320px; }
  .stats { width: 100%; margin-left: 0; }
  .stat-wide { display: none; }
}

/* ============================================================
 * 手机优先：地图铺满整屏，行程列表收进底部抽屉
 * ============================================================ */
@media (max-width: 820px) {
  html { -webkit-text-size-adjust: 100%; }
  html, body { height: 100vh; height: 100dvh; }
  body { overflow: hidden; overscroll-behavior: none; }

  /* ---------- 顶栏：只留品牌一行，把地图留给屏幕 ---------- */
  .topbar { padding: 10px 12px; gap: 9px; }
  .brand { min-width: 0; gap: 10px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 15px; }
  .brand h1 { font-size: 16.5px; letter-spacing: .3px; }
  .brand .sub {
    margin-top: 1px; font-size: 11px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  /* 统计数据移入抽屉抬头，避免占用地图高度 */
  .stats { display: none; }

  /* ---------- 工具条：分段标签 +「更多」折叠操作条 ---------- */
  .toolbar { padding: 8px 12px 9px; gap: 8px; }
  .tabs { flex: 1 1 auto; padding: 3px; }
  .tabs button { flex: 1; padding: 10px 0; font-size: 13.5px; }

  .more-btn {
    display: inline-flex; align-items: center; justify-content: center;
    flex: none; min-height: 46px; padding: 0 14px; border-radius: 11px;
    font-weight: 600; color: var(--ink-2);
  }
  .toolbar.actions-open .more-btn { color: var(--ink); border-color: #cfc8bc; }
  .toolbar.actions-open .more-btn .caret { transform: rotate(180deg); }

  .actions {
    display: none;
    flex: 1 1 100%; margin-left: 0; gap: 7px; flex-wrap: nowrap;
    overflow-x: auto; padding-bottom: 2px;
    scrollbar-width: none; overscroll-behavior-x: contain;
  }
  .toolbar.actions-open .actions { display: flex; }
  .actions::-webkit-scrollbar { display: none; }
  .actions > * { flex: none; }

  button, select { min-height: 40px; padding: 9px 13px; font-size: 13.5px; }
  select { font-size: 16px; padding-top: 6px; padding-bottom: 6px; }
  .chk {
    min-height: 40px; padding: 0 12px;
    border: 1px solid var(--line); border-radius: 9px; background: var(--panel);
  }
  .chk input { width: 17px; height: 17px; }

  /* ---------- 地图铺满整屏 ---------- */
  #view-map { position: relative; overflow: hidden; }
  #view-map.show { display: block; }
  .map-wrap { position: absolute; inset: 0; height: auto; }

  /* ---------- 底部行程抽屉 ---------- */
  .sidebar {
    position: fixed; left: 0; right: 0; top: auto; bottom: 0;
    width: auto; height: 88vh; height: 88dvh; max-height: 88dvh;
    z-index: 1200;
    border: 0; border-top: 1px solid var(--line);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -14px 44px rgba(20, 26, 36, .24);
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.32, .72, 0, 1);
    padding-bottom: env(safe-area-inset-bottom);
    will-change: transform;
  }
  body.sheet-open .sidebar { transform: translateY(0); }

  .sheet-grip {
    display: flex; align-items: center; justify-content: center;
    flex: none; padding: 9px 0 3px; cursor: grab;
  }
  .sheet-grip span { width: 44px; height: 4px; border-radius: 3px; background: #d9d3c8; }

  .sheet-head {
    display: block;
    flex: none; padding: 2px 14px 10px;
    border-bottom: 1px solid var(--line);
  }
  .sheet-head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .sheet-head b { font-size: 15px; }
  .sheet-sub {
    display: block; margin-top: 3px;
    font-size: 11.5px; line-height: 1.4; color: var(--ink-3);
  }
  .sheet-close { flex: none; min-height: 32px; padding: 5px 13px; border-radius: 20px; font-size: 12.5px; }

  .side-head { padding: 10px 14px; }
  .side-head .hint {
    font-size: 11px; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }

  .day-list { padding: 10px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .day-card { margin-bottom: 10px; }
  .day-head { padding: 13px 14px 13px 16px; }
  .day-title { padding-right: 58px; font-size: 13.5px; }
  .day-toggle { top: 12px; right: 11px; min-height: 30px; padding: 6px 11px; font-size: 12px; }
  .pt { padding: 11px 10px; }
  .pt-name { font-size: 13.5px; }
  .pt-note { font-size: 11.5px; }
  .day-tips li { font-size: 12.5px; }
  .pending-item { min-height: 34px; font-size: 12.5px; }

  .legend {
    flex: none; padding: 10px 14px 12px;
    max-height: 30vh; max-height: 30dvh; overflow-y: auto;
    -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  }
  .legend-items { gap: 6px 7px; }
  .legend-item { min-height: 32px; padding: 5px 11px 5px 8px; font-size: 12px; }
  .legend-btns button { min-height: 32px; padding: 6px 12px; font-size: 12px; }

  /* ---------- 地图控件适配手指 ---------- */
  /* leaflet-touch 前缀用于压过 leaflet.css 的 30px 触摸尺寸 */
  .leaflet-control-zoom a,
  .leaflet-touch .leaflet-bar a.leaflet-control-zoom-in,
  .leaflet-touch .leaflet-bar a.leaflet-control-zoom-out {
    width: 44px; height: 44px; line-height: 44px; font-size: 22px; font-weight: 400;
  }
  .leaflet-bottom.leaflet-right .leaflet-control-zoom { margin-bottom: 84px; }
  .leaflet-control-attribution { font-size: 10px; max-width: 58vw; }
  .leaflet-bottom .leaflet-control-attribution { margin-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .leaflet-control-scale { font-size: 10px; }
  .poi-marker { width: 32px; height: 32px; font-size: 12.5px; }
  .poi-marker.is-start, .poi-marker.is-end { width: 36px; height: 36px; }
  .pop { min-width: 0; max-width: 74vw; }
  #map.picking::after { top: 10px; padding: 7px 14px; font-size: 12px; }
  .loading { font-size: 12.5px; }

  /* ---------- 抽屉入口悬浮按钮 ---------- */
  .sheet-fab {
    display: inline-flex; align-items: center; gap: 8px;
    position: absolute; right: 10px; bottom: calc(30px + env(safe-area-inset-bottom)); z-index: 1001;
    min-height: 44px; padding: 0 15px; border-radius: 22px;
    background: var(--dark); border-color: var(--dark); color: #fff;
    font-size: 13px; font-weight: 600;
    box-shadow: 0 6px 20px rgba(20, 26, 36, .32);
  }
  .sheet-fab:hover { color: #fff; background: #2b3547; }
  .sheet-fab:active { transform: translateY(1px); }
  .fab-bars { display: inline-flex; flex-direction: column; gap: 3px; }
  .fab-bars i { display: block; width: 14px; height: 2px; border-radius: 2px; background: currentColor; }

  .sheet-backdrop {
    display: block; position: fixed; inset: 0; z-index: 1100;
    background: rgba(20, 26, 36, .38);
    opacity: 0; pointer-events: none; transition: opacity .3s;
  }
  body.sheet-open .sheet-backdrop { opacity: 1; pointer-events: auto; }

  /* 提示条避开面板 */
  .toast { max-width: 88vw; bottom: calc(20px + env(safe-area-inset-bottom)); }
  body.sheet-open .toast { bottom: auto; top: calc(12px + env(safe-area-inset-top)); }

  /* ---------- 表格转卡片 ---------- */
  #view-table.show, #view-prep.show { padding: 12px; }
  .scroll { max-width: none; }
  .panel { padding: 13px 14px 15px; margin-bottom: 13px; }
  .panel h3 { font-size: 13.5px; }
  .grid-2 { grid-template-columns: 1fr; gap: 13px; }

  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl thead { display: none; }
  .tbl tbody tr {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: 12px; padding: 11px 13px; margin-bottom: 10px;
  }
  .tbl tbody tr:hover { background: var(--panel); }
  .tbl td { border: 0; padding: 0 0 8px; font-size: 13px; }
  .tbl td:last-child { padding-bottom: 0; }
  .tbl td[data-th]::before {
    content: attr(data-th); display: block;
    font-size: 10.5px; letter-spacing: .4px; color: var(--ink-3); margin-bottom: 3px;
  }
  .tbl-trip .rt { gap: 5px 6px; }
  .rt-node { font-size: 12.5px; padding: 3px 9px; }
  .ck { font-size: 12.5px; padding: 5px 11px; }
  .alerts li { font-size: 13px; }
}
