:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #e6e8ec;
  --brand: #e4572e;
  --brand-2: #2e86de;
  --accent: #00b894;
  --warn: #f9ca24;
  --shadow: 0 2px 10px rgba(20, 25, 40, .08);
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--bg);
  display: flex; flex-direction: column;
}
/* Topbar */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; background: var(--panel);
  border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  z-index: 20;
}
.brand { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 18px; letter-spacing: .5px; flex-shrink: 0; min-width: 0; }
.brand .b-txt { white-space: nowrap; }
.brand .sub { font-size: 11px; color: #fff; background: var(--brand); padding: 2px 6px; border-radius: 6px; margin-left: 0; vertical-align: middle; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.actions button {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  height: 34px; display: inline-flex; align-items: center; gap: 5px;
  padding: 0 13px; border-radius: 9px; cursor: pointer; font-size: 13px; transition: .15s;
}
.actions button .ic { line-height: 1; font-size: 15px; }
.actions button .lbl { white-space: nowrap; }
.actions button:hover { border-color: var(--brand); color: var(--brand); }
.actions button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
/* 状态徽标（腾讯地图GCJ-02 / 坐标投影预览）按 Mo 要求隐藏，不占顶部栏宽度 */
.mode-badge { display: none; font-size: 12px; color: var(--muted); }
  .mode-badge.tencent { color: var(--accent); }
  .mode-badge.fallback { color: #b7791f; }
  /* 汉堡按钮：移动端抽屉开关，桌面隐藏 */
  .icon-btn {
    display: none; /* 桌面默认隐藏，仅 ≤760px 显示 */
    width: 38px; height: 34px; flex: 0 0 auto;
    border: 1px solid var(--line); background: #fff; color: var(--ink);
    border-radius: 9px; cursor: pointer; font-size: 18px; line-height: 1;
    align-items: center; justify-content: center; transition: .15s;
  }
  .icon-btn:active { background: #f0f1f4; }
  /* 抽屉遮罩 */
  .scrim {
    position: absolute; inset: 0; background: rgba(20, 25, 40, .38);
    z-index: 12; display: none;
  }

/* Layout */
.layout { flex: 1; display: flex; min-height: 0; }
.sidebar {
  width: 340px; min-width: 340px; background: var(--panel);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0;
}
.filter-panel { padding: 10px 12px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.filter-panel.collapsed { overflow: visible; }
.filter-panel.collapsed .filter-body { display: none; }
.filter-head { display: flex; align-items: center; justify-content: space-between; cursor: pointer; user-select: none; }
.filter-title { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 600; color: var(--ink); }
.filter-badge {
  display: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: 11px; align-items: center; justify-content: center;
}
.filter-toggle {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  font-size: 13px; line-height: 1; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; transition: .15s;
}
.filter-toggle:hover { border-color: var(--brand); color: var(--brand); }
.filter-chips { display: none; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fchip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 14px;
  padding: 3px 6px 3px 10px; background: #eef0f3; border: 1px solid var(--line);
  border-radius: 999px; cursor: pointer; color: var(--ink);
}
.fchip:hover { border-color: var(--brand); }
.fchip .x { color: var(--muted); font-weight: 700; font-size: 13px; }
.fchip:hover .x { color: var(--brand); }
.filter-body { margin-top: 8px; }
.field { margin-bottom: 8px; }
.field label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.field input[type=text], .field select {
  width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: #fff;
}
.filter-reset-row { margin-top: 6px; text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px;
  cursor: pointer; user-select: none; background: #fff;
}
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
/* 分段 TAB 控件（范围 / 距离 / 状态 由下拉改为点击切换） */
.seg { display: flex; gap: 4px; background: #eef0f3; padding: 4px; border-radius: 10px; }
.seg button {
  flex: 1 1 0; min-width: 0; border: none; background: transparent; padding: 7px 3px;
  font-size: 12px; color: var(--muted); border-radius: 7px; cursor: pointer;
  transition: background .15s, color .15s; white-space: normal; overflow: visible; line-height: 1.2;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20,25,40,.14); font-weight: 600; }
.row2 { display: flex; gap: 8px; }
.row2 .field { flex: 1; }
.list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 10px; }
/* 路线面板：页面级浮层（fixed）· WEB=地图右上浮层；手机=底部抽屉（与详情抽屉同范式） */
.route-panel {
  position: fixed; top: 66px; right: 16px;
  width: 300px; max-width: calc(100vw - 32px);
  max-height: calc(100vh - 82px);
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(20, 25, 40, .16);
  z-index: 1000;
  /* 默认收起：用 class 控制显隐，彻底规避 display 覆盖 [hidden] 的旧 bug */
  opacity: 0; transform: translateX(120%);
  visibility: hidden; pointer-events: none;
  transition: opacity .26s cubic-bezier(.2, 0, 0, 1),
              transform .26s cubic-bezier(.34, 1.3, .64, 1),
              visibility .26s;
}
/* 路线底部抽屉拖拽条：仅手机端显示 */
.rs-handle { display: none; width: 40px; height: 4px; border-radius: 999px; background: #d8dce3; margin: 9px auto 4px; flex: 0 0 auto; cursor: pointer; }
.route-panel.open {
  opacity: 1; transform: none; visibility: visible; pointer-events: auto;
}
.route-head { display: flex; align-items: center; justify-content: space-between; font-size: 15px; font-weight: 600; }
.route-head b { color: var(--brand); margin-left: 3px; font-size: 14px; }
.link-btn { border: none; background: transparent; color: var(--muted); font-size: 14px; cursor: pointer; padding: 3px 8px; border-radius: 7px; transition: .15s; }
.link-btn:hover { color: #fff; background: var(--brand); }
.route-stops { overflow-y: auto; display: flex; flex-direction: column; gap: 7px; padding-right: 2px; }
.route-stops::-webkit-scrollbar { width: 6px; }
.route-stops::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, .12); border-radius: 3px; }
.route-stop { display: flex; align-items: center; gap: 9px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 15px; transition: box-shadow .15s, border-color .15s; }
.route-stop:hover { border-color: var(--brand); box-shadow: 0 2px 8px rgba(228, 87, 46, .12); }
.rs-idx { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), #f08a5d); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(228, 87, 46, .4); }
.rs-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.rs-del { flex: 0 0 auto; width: 22px; height: 22px; border: none; background: #f3f4f6; color: var(--muted); font-size: 15px; line-height: 1; border-radius: 6px; cursor: pointer; transition: .15s; }
.rs-del:hover { background: #ffe3dc; color: var(--brand); }
.route-empty { font-size: 14px; color: var(--muted); text-align: center; padding: 10px 8px; line-height: 1.5; }
.route-go { border: none; background: linear-gradient(135deg, var(--brand), #f0744e); color: #fff; font-size: 16px; font-weight: 600; height: 42px; border-radius: 11px; cursor: pointer; transition: .15s; box-shadow: 0 4px 14px rgba(228, 87, 46, .28); }
.route-go:hover { filter: brightness(1.04); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(228, 87, 46, .34); }
.route-go:active { transform: translateY(0) scale(.99); }
.op-addroute { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 8px; padding: 5px 10px; font-size: 14px; cursor: pointer; }
.op-addroute:hover { border-color: var(--brand); color: var(--brand); }
.op-addroute.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.iw-card .ops button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.card {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px;
  cursor: pointer; transition: .15s; background: #fff;
}
.card:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.card.active { border-color: var(--brand); box-shadow: var(--shadow); }
.card .t { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.card .m { font-size: 13px; color: var(--muted); line-height: 1.5; }
.card .tags { margin-top: 5px; display: flex; gap: 5px; flex-wrap: wrap; }
.tag { font-size: 13px; padding: 2px 7px; border-radius: 6px; background: #f0f1f4; color: #4b5563; }
.tag.exh { background: #fde8e1; color: var(--brand); }
.tag.act { background: #e3f0fd; color: var(--brand-2); }
.tag.status-在展 { background: #e3f7ee; color: #1a9e6f; }
.tag.status-即将 { background: #fff3d6; color: #b7791f; }
.tag.status-已结束 { background: #f0f1f4; color: #9aa1ab; }
.tag.status-长期 { background: #eef0ff; color: #5b63c4; }
.tag.status-待确认 { background: #f3f0ff; color: #8b7bd8; }
.tag.atype { background: #eef7f0; color: #3f8f6b; border: 1px dashed #bfe0cc; }
.tag.dist { background: #fff0eb; color: var(--brand); font-weight: 600; }
/* 费用标签：免费 / 付费（标准价格 ¥XX） / 待核实 */
.tag.fee-free { background: #e3f7ee; color: #1a9e6f; font-weight: 600; }
.tag.fee-paid { background: #fdeede; color: #d97706; font-weight: 600; }
.tag.fee-unknown { background: #f0f1f4; color: #9aa1ab; }
/* 地图起点标签（腾讯地图 Label 内容） */
.map-origin-label {
  background: #00b894; color: #fff; font-size: 12px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px; white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,.25); border: 1.5px solid #fff;
}
.hint { font-size: 13px; color: #9aa1ab; margin-top: 4px; line-height: 1.4; }
.card .ops { margin-top: 6px; display: flex; gap: 5px; }
.card .ops button {
  flex: 1; font-size: 13px; padding: 4px 0; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; color: var(--ink);
}
.card .ops button:hover { border-color: var(--brand); color: var(--brand); }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 16px; }

/* 列表双栏（可看 / 已打卡）切换 */
.list-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); background: var(--panel); flex: 0 0 auto; }
.list-tabs { display: flex; gap: 6px; background: #f0f1f4; padding: 4px; border-radius: 10px; }
.list-tab {
  flex: 1; border: none; background: transparent; cursor: pointer;
  font-size: 16px; font-weight: 600; color: var(--muted);
  padding: 7px 0; border-radius: 7px; transition: .15s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.list-tab .cnt {
  font-size: 11px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: rgba(0,0,0,.08); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.list-tab.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20,25,40,.12); }
.list-tab.on .cnt { background: var(--brand); color: #fff; }
/* 卡片「已去」切换 */
.card .visit-toggle {
  font-size: 13px; font-weight: 600;
  padding: 4px 0; border-radius: 7px; cursor: pointer; transition: .15s;
  border: 1px solid var(--accent); background: rgba(0,184,148,.08); color: var(--accent);
}
.card .visit-toggle:hover { background: rgba(0,184,148,.16); }
.card .visit-toggle.done { border-color: var(--line); background: #f7f8fa; color: var(--muted); }
.card .visit-toggle:active { transform: scale(.99); }
/* 火焰热度徽标（卡片标题 / 弹窗 tags 内联）：金火=热度，flex 对齐 */
.flames { display: inline-flex; align-items: center; gap: 1px; vertical-align: middle; margin-left: 5px; }
.flame { width: 14px; height: 14px; display: block; }
/* 高热开关按钮 */
.btn-hot {
  width: 100%; margin-top: 2px; border: 1px solid var(--line); background: #fff;
  color: var(--muted); height: 32px; border-radius: 9px; cursor: pointer;
  font-size: 16px; transition: .15s;
}
.btn-hot.on { background: #fff3e0; color: #e8590c; border-color: #ff922b; font-weight: 600; }
.btn-hot:hover { border-color: #ff922b; }

/* 确认弹窗（防误触） */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20,25,40,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-mask.show { opacity: 1; pointer-events: auto; }
.modal {
  background: #fff; border-radius: 14px; padding: 22px 20px 18px;
  width: 300px; max-width: 86vw; box-shadow: 0 20px 60px rgba(0,0,0,.22);
  transform: scale(.96); transition: transform .2s cubic-bezier(.2,0,0,1);
}
.modal-mask.show .modal { transform: scale(1); }
.modal .mtitle { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.modal .mmsg { font-size: 16px; color: var(--muted); line-height: 1.6; margin-bottom: 18px; white-space: pre-line; }
.modal .mactions { display: flex; gap: 10px; }
.modal .mactions button {
  flex: 1; height: 42px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-size: 16px; color: var(--ink); transition: .15s;
}
.modal .mactions button.yes { background: var(--brand); color: #fff; border-color: var(--brand); }
.modal .mactions button:active { transform: scale(.98); }

/* Map */
.map-wrap { position: relative; flex: 1; min-width: 0; isolation: isolate; overflow: hidden; }

/* 地图图例：展览=红 / 活动=蓝 / 混合=红蓝对半 */
.map-legend { position: absolute; left: 12px; bottom: 12px; z-index: 50; display: flex; gap: 13px; align-items: center; background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; box-shadow: 0 2px 8px rgba(20,25,40,.12); font-size: 13px; color: #4b5563; backdrop-filter: blur(2px); }
.lg-item { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.lg-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.08); flex: 0 0 auto; }
.lg-exh { background: #e4572e; }
.lg-act { background: #2e86de; }
.lg-mix { background: linear-gradient(90deg, #2e86de 0 50%, #e4572e 50% 100%); }
@media (max-width: 760px) { .map-legend { left: auto; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); padding: 6px 9px; gap: 9px; font-size: 12px; } }
#map, #canvasMap { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
#canvasMap { background: #eef1f5; }
.banner {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  background: #fff7e6; color: #92591f; border: 1px solid #ffe1a8;
  padding: 8px 14px; border-radius: 10px; font-size: 12px; box-shadow: var(--shadow);
  z-index: 10; max-width: 90%;
}
.toast {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: rgba(31,36,48,.92); color: #fff; padding: 9px 16px; border-radius: 10px;
  font-size: 13px; z-index: 30; opacity: 0; transition: opacity .25s; pointer-events: none;
}
.toast.show { opacity: 1; }

/* InfoWindow (tencent) content */
.iw { font-size: 13px; width: 240px; max-width: 240px; box-sizing: border-box; }
.iw .t { font-weight: 700; margin-bottom: 4px; word-break: break-word; }
.iw .m { color: #555; margin-bottom: 8px; line-height: 1.5; word-break: break-word; }
.iw .ops { display: flex; gap: 6px; flex-wrap: wrap; }
.iw .ops button { flex: 1 1 auto; font-size: 15px; padding: 5px 8px; border-radius: 6px; border: 1px solid #ccc; background: #fff; cursor: pointer; }
/* 场馆聚合弹窗（一个 marker 显示该馆全部展览/活动卡片） */
.iw-group {
  width: 268px; max-width: 90vw; box-sizing: border-box;
  background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 10px 30px rgba(20, 25, 40, .18);
  display: flex; flex-direction: column; max-height: 340px;
}
/* 自绘浮层容器：位于 marker 层之中、z-index 高于普通 marker（卡片可读），仅被「当前指向的 marker」压在下面（图标浮于卡片之上）；箭头指向 marker */
.map-popup { position: absolute; width: 268px; max-width: 86vw; z-index: 100; transition: opacity .2s ease; opacity: 1; }
.map-popup::after {
  content: ""; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%);
  width: 0; height: 0; border-left: 9px solid transparent; border-right: 9px solid transparent;
  border-top: 10px solid #fff; filter: drop-shadow(0 4px 3px rgba(20, 25, 40, .12));
}
/* marker 靠顶、浮层翻到下方时：箭头朝上 */
.map-popup.below::after {
  bottom: auto; top: -9px; border-top: none;
  border-bottom: 10px solid #fff; filter: drop-shadow(0 -4px 3px rgba(20, 25, 40, .12));
}
/* 场馆名称头部：常驻（不随卡片滚动），右侧关闭按钮 */
.iw-ghead {
  position: sticky; top: 0; z-index: 3; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 12px; background: linear-gradient(135deg, #ffffff, #fbfbfd);
  border-bottom: 1px solid #eef0f4;
}
.iw-title { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 700; color: #2b2f38; min-width: 0; flex: 1 1 auto; }
.iw-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.iw-count {
  flex: 0 0 auto; font-size: 11px; font-weight: 700; color: #fff;
  background: var(--brand); border-radius: 999px; padding: 1px 8px;
}
.iw-close {
  flex: 0 0 auto; position: relative; z-index: 1; width: 26px; height: 26px; border: none; border-radius: 8px;
  background: #f1f2f5; color: #8a909c; font-size: 18px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: .15s;
}
.iw-close:hover { background: #ffe3da; color: var(--brand); }
.iw-body { padding: 2px 12px 10px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.iw-card { padding: 11px 0; border-bottom: 1px solid #f2f3f6; }
.iw-card:last-child { border-bottom: none; }
/* 一栋楼多机构：建筑级卡片内按画廊分节 */
.iw-venue { padding-top: 4px; }
.iw-venue + .iw-venue { border-top: 1px dashed #e6e8ec; margin-top: 4px; }
.iw-venue-head { display: flex; align-items: center; gap: 6px; padding: 7px 0 3px; }
.iw-vname { font-size: 15px; font-weight: 700; color: #2b2f38; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 0; }
.iw-vcount { flex: 0 0 auto; font-size: 11px; font-weight: 700; color: #5b6573; background: #eef0f3; border-radius: 999px; padding: 1px 8px; }
.iw-card .t { font-weight: 700; font-size: 16px; color: #1f232b; margin-bottom: 4px; word-break: break-word; }
.iw-card .m { color: #6b7280; font-size: 15px; line-height: 1.55; margin-bottom: 8px; word-break: break-word; }
.iw-card .tags { margin: 6px 0 9px; display: flex; gap: 6px; flex-wrap: wrap; }
.iw-card .ops { display: flex; gap: 6px; }
.iw-card .ops button {
  flex: 1 1 auto; font-size: 15px; padding: 6px 8px; border-radius: 8px;
  border: 1px solid #e6e8ec; background: #fff; color: #454b56; cursor: pointer; transition: .15s;
}
.iw-card .ops button:hover { border-color: var(--brand); color: var(--brand); }
.iw-card .ops button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
/* canvas 降级模式的浮层卡片容器 */
.canvas-popup {
  position: absolute; z-index: 18; display: none; width: 268px; max-width: 86vw;
  filter: drop-shadow(0 10px 30px rgba(20, 25, 40, .18));
}

/* ===== 响应式：移动端抽屉式 ===== */
@media (min-width: 761px) {
  .icon-btn { display: none !important; }
  .scrim { display: none !important; }
}
@media (max-width: 760px) {
  .icon-btn { display: inline-flex; }
  /* 窄屏顶部：按钮组强制单行、压缩，避免被挤成两排撑高头部（padding 与 WEB 统一用基础值） */
  .topbar .brand { font-size: 15px; }
  .actions { flex: 1 1 auto; justify-content: flex-end; flex-wrap: nowrap; gap: 6px; }
  .actions button { height: 32px; padding: 0 9px; font-size: 12px; gap: 4px; border-radius: 8px; }
  .actions button .ic { font-size: 14px; }
  .sidebar {
    position: absolute; top: 49px; left: 0; bottom: 0;
    width: 86%; max-width: 340px; min-width: 0; height: auto;
    z-index: 15; background: var(--panel); border-right: 1px solid var(--line);
    box-shadow: 2px 0 18px rgba(20, 25, 40, .20);
    transform: translateX(-100%); transition: transform .25s ease;
  }
  .layout.drawer .sidebar { transform: translateX(0); }
  .layout.drawer .scrim { display: block; }
  /* 触控优化：输入框/下拉字号统一 13px，与桌面一致 */
  .seg button { padding: 9px 3px; }
  .card { padding: 10px; }
  .iw, .iw-group { max-width: 80vw; }
  .iw { width: auto; }
  /* 路线面板：手机端改为底部抽屉（与详情抽屉同范式），复用 detailScrim 遮罩、半屏可见地图 */
  .route-panel {
    top: auto; left: 0; right: 0; bottom: 0;
    width: auto; max-width: none;
    max-height: 62vh;
    background: #fff;
    -webkit-backdrop-filter: none; backdrop-filter: none;
    border: none;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, .18);
    transform: translateY(100%);
    z-index: 56;
  }
  .route-panel.open { transform: translateY(0); }
  .route-panel .rs-handle { display: block; }
}
/* 极窄屏（≤420px，如 iPhone SE / 小屏 Android）：顶部按钮转图标化，保证单行不溢出 */
@media (max-width: 420px) {
  .brand .sub { display: none; }
  .actions button .lbl { display: none; }
  .actions button { padding: 0 9px; }
  .mode-badge { display: none; }
}

/* ===================== 用户系统（Phase 1 · 提质 + 响应式）===================== */
/* 顶栏登录按钮（登录后高亮）*/
.actions button#btnAuth.logged { border-color: var(--brand-2); color: var(--brand-2); background: #eef5ff; }
.actions button#btnAuth.logged:hover { background: #e3eefe; }

/* 用户下拉菜单（圆角卡片化）*/
.user-menu {
  display: none; position: absolute; top: calc(100% + 8px); right: 12px; z-index: 30;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(20, 25, 40, .16); min-width: 150px; overflow: hidden;
  flex-direction: column; padding: 6px;
}
.user-menu.show { display: flex; }
.user-menu button {
  border: none; background: #fff; color: var(--ink); text-align: left;
  padding: 11px 12px; font-size: 14px; border-radius: 8px; cursor: pointer; width: 100%; transition: .15s;
}
.user-menu button:hover { background: #f4f6f9; }

/* 登录 / 注册遮罩 */
.auth-mask {
  position: fixed; inset: 0; background: rgba(20, 25, 40, .42);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  z-index: 60; display: none; align-items: center; justify-content: center; padding: 16px;
}
.auth-mask.show { display: flex; }

/* 品牌头部 */
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.auth-logo {
  width: 44px; height: 44px; border-radius: 13px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: flex; align-items: center; justify-content: center; font-size: 23px;
  box-shadow: 0 5px 14px rgba(228, 87, 46, .28);
}
.auth-brand-txt { display: flex; flex-direction: column; line-height: 1.32; }
.auth-brand-txt b { font-size: 16px; color: var(--ink); letter-spacing: .3px; }
.auth-brand-txt span { font-size: 12px; color: var(--muted); }

.auth-modal {
  width: 360px; max-width: 100%; background: #fff; border-radius: 18px; padding: 22px 22px 18px;
  box-shadow: 0 18px 52px rgba(20, 25, 40, .26); position: relative;
  animation: authPop .22s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes authPop { from { transform: translateY(10px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.auth-close {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: none; background: transparent;
  border-radius: 50%; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: .15s;
}
.auth-close:hover { background: #f1f3f6; color: var(--ink); }
.auth-title { font-size: 21px; font-weight: 700; color: var(--ink); margin: 2px 0 4px; }
.auth-sub { font-size: 13px; color: var(--muted); margin: 0 0 16px; }
.auth-modal .field { margin-bottom: 12px; }
.auth-modal .field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.auth-modal .field input {
  width: 100%; height: 46px; padding: 0 13px; border: 1.5px solid var(--line); border-radius: 11px;
  font-size: 15px; background: #fff; transition: border-color .15s, box-shadow .15s;
}
.auth-modal .field input:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(46, 134, 222, .16); }
.auth-err { color: #e03131; font-size: 13px; min-height: 18px; margin: 2px 0 8px; }
.auth-err.shake { animation: authShake .32s ease; }
@keyframes authShake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.auth-submit {
  width: 100%; height: 48px; border: none; border-radius: 12px; cursor: pointer;
  background: var(--brand-2); color: #fff; font-size: 15px; font-weight: 600; transition: .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.auth-submit:hover { filter: brightness(1.05); transform: translateY(-1px); }
.auth-submit:active { transform: translateY(0); }
.auth-submit:disabled { opacity: .75; cursor: default; transform: none; }
.auth-submit .spin {
  width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff;
  border-radius: 50%; animation: authSpin .7s linear infinite;
}
@keyframes authSpin { to { transform: rotate(360deg); } }
.auth-switch {
  width: 100%; margin-top: 10px; border: none; background: transparent; color: var(--brand-2);
  font-size: 13px; cursor: pointer; padding: 9px; border-radius: 9px; transition: .15s;
}
.auth-switch:hover { background: #f2f7ff; }
.auth-links { text-align: center; margin-top: 8px; font-size: 12px; color: var(--muted); }
.auth-links a { color: var(--muted); text-decoration: none; }
.auth-links a:hover { color: var(--brand-2); text-decoration: underline; }

/* 我的打卡面板（右侧浮层 / 移动端全宽）*/
.my-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: 320px; max-width: 86vw; z-index: 18;
  background: var(--panel); border-left: 1px solid var(--line); box-shadow: -6px 0 20px rgba(20, 25, 40, .08);
  transform: translateX(100%); transition: transform .22s ease; display: flex; flex-direction: column;
}
.my-panel.open { transform: translateX(0); }
.my-head {
  display: flex; align-items: center; justify-content: space-between; padding: 13px 16px;
  border-bottom: 1px solid var(--line); font-size: 16px; font-weight: 600;
}
.my-stats { padding: 9px 16px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); }
.my-stats b { color: var(--brand-2); font-size: 15px; }
.my-list { flex: 1; overflow-y: auto; padding: 10px; }
.my-empty { padding: 28px 18px; color: var(--muted); font-size: 14px; text-align: center; }
.my-item {
  display: flex; align-items: center; gap: 8px; padding: 11px; border: 1px solid var(--line);
  border-radius: 11px; margin-bottom: 8px; flex-wrap: wrap;
}
.my-i-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-i-meta { font-size: 12px; color: var(--muted); width: 100%; }
.my-i-remove {
  border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 9px;
  font-size: 12px; padding: 6px 10px; cursor: pointer; transition: .15s;
}
.my-i-remove:hover { border-color: var(--brand); color: var(--brand); }

/* 登录 / 我的打卡 · 响应式 */
@media (max-width: 760px) {
  .auth-mask { align-items: flex-end; padding: 0; }
  .auth-modal {
    width: 100%; max-width: 100%; border-radius: 22px 22px 0 0;
    padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
    animation: authSheet .3s cubic-bezier(.2, 0, 0, 1);
  }
  @keyframes authSheet { from { transform: translateY(100%); } to { transform: none; } }
  .auth-logo { width: 40px; height: 40px; font-size: 20px; }
  .auth-close { top: 14px; right: 14px; width: 36px; height: 36px; }
  .my-panel { width: 100%; max-width: 100%; }
}
@media (max-width: 420px) {
  .auth-modal { padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .auth-title { font-size: 19px; }
  .auth-modal .field input { height: 46px; font-size: 15px; }
  .auth-submit { height: 48px; }
  .user-menu { right: 8px; min-width: 140px; }
}

/* ---------- 导航三选一弹层 ---------- */
.nav-mask {
  position: fixed; inset: 0; background: rgba(20, 25, 40, .42);
  display: none; align-items: center; justify-content: center;
  z-index: 1200; padding: 16px;
}
.nav-mask.open { display: flex; animation: navFade .18s ease; }
@keyframes navFade { from { opacity: 0; } to { opacity: 1; } }
.nav-modal {
  width: 320px; max-width: 100%; background: var(--panel); border-radius: 16px;
  box-shadow: 0 12px 40px rgba(20, 25, 40, .28); padding: 18px; animation: navPop .2s ease;
}
@keyframes navPop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.nav-title { font-size: 17px; font-weight: 700; color: var(--ink); text-align: center; }
.nav-sub { font-size: 12px; color: var(--muted); text-align: center; margin: 4px 0 12px; line-height: 1.4; word-break: break-all; }
.nav-opts { display: flex; flex-direction: column; gap: 10px; }
.nav-opt {
  display: flex; align-items: center; gap: 12px; border: 1px solid var(--line);
  background: #fff; border-radius: 12px; padding: 12px 14px; cursor: pointer;
  transition: .15s; text-align: left;
}
.nav-opt:hover { border-color: var(--brand); box-shadow: 0 3px 12px rgba(228, 87, 46, .14); transform: translateY(-1px); }
.nav-opt .n-ic { font-size: 22px; line-height: 1; }
.nav-opt .n-tx { display: flex; flex-direction: column; }
.nav-opt .n-tx b { font-size: 15px; color: var(--ink); font-weight: 600; }
.nav-opt .n-tx small { font-size: 11px; color: var(--muted); margin-top: 2px; }
.nav-opt.nav-tencent { border-left: 4px solid #1aad19; }
.nav-opt.nav-amap { border-left: 4px solid #1b87ff; }
.nav-opt.nav-baidu { border-left: 4px solid #2932e1; }
.nav-cancel {
  width: 100%; margin-top: 12px; border: none; background: #f3f4f6; color: var(--muted);
  font-size: 15px; height: 40px; border-radius: 11px; cursor: pointer; transition: .15s;
}
.nav-cancel:hover { background: #e9ebee; color: var(--ink); }
@media (max-width: 420px) {
  .nav-modal { width: 100%; }
}


/* ===== 详情底部抽屉（移动端：替代地图内卡片浮层，保证关闭/路线/导航/打卡按钮可见可点）===== */
.detail-scrim { position: fixed; inset: 0; background: rgba(18,22,33,.4); z-index: 54; opacity: 0; visibility: hidden; transition: opacity .25s ease; }
.detail-scrim.show { opacity: 1; visibility: visible; }
.detail-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; background: #fff; border-radius: 18px 18px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.18); transform: translateY(100%); transition: transform .28s cubic-bezier(.2,0,0,1); max-height: 82vh; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }
.detail-sheet.open { transform: translateY(0); }
.ds-handle { width: 40px; height: 4px; border-radius: 999px; background: #d8dce3; margin: 9px auto 2px; flex: 0 0 auto; cursor: pointer; }
.ds-body { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 4px 14px 18px; }
.detail-sheet button { touch-action: manipulation; }
.detail-sheet .iw-group { width: 100%; max-width: 100%; box-shadow: none; max-height: none; border-radius: 0; }
.detail-sheet .iw-body { overflow: visible; padding: 2px 0 6px; }
.detail-sheet .iw-ghead { border-radius: 0; }
@media (min-width: 761px) { .detail-scrim { display: none !important; } .detail-sheet { display: none !important; } }
