/* ============================================================
   小红花打卡 · 高级极简 · 温暖明亮（公益项目）
   底色 #FFFBED · 三端统一设计语言
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* —— 色彩系统 —— */
  --bg:          #FFFBED;   /* 暖米白主底色 */
  --bg-soft:     #FBF6E6;   /* 略深底色（分区） */
  --card:        #FFFFFF;   /* 卡片白底 */
  --card-soft:   rgba(255, 255, 255, 0.88);  /* 半透卡片 */
  --text:        #3A2E2A;   /* 深暖棕主文字（清晰不刺眼） */
  --text-sub:    #7A6E68;   /* 辅助文字 */
  --text-dim:    #B5ABA5;   /* 占位/禁用 */
  --border:      #F0E9D8;   /* 暖边框 */
  --border-soft: rgba(58, 46, 42, 0.08);
  --primary:     #E63946;   /* 花瓣红（品牌色） */
  --primary-soft:rgba(230, 57, 70, 0.10);
  --primary-dark:#C1272D;
  --accent:      #F6A623;   /* 暖橙（公益温暖） */
  --accent-soft: rgba(246, 166, 35, 0.14);
  --blue:        #4A90D9;   /* 路线蓝 */
  --green:       #5BAA5B;   /* 公益绿 */
  --shadow-sm:   0 2px 8px rgba(58, 46, 42, 0.06);
  --shadow:      0 4px 20px rgba(58, 46, 42, 0.08);
  --shadow-lg:   0 12px 40px rgba(58, 46, 42, 0.12);
  --radius:      16px;
  --radius-sm:   12px;
  --radius-lg:   24px;
  --serif:       "Cormorant Garamond", "Noto Serif SC", "Songti SC", serif;
  --sans:        -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --panel-bg:    rgba(255, 255, 255, 0.92);
  --item-bg:     #FAF4E6;
  --item-hover:  #F5EDD8;
  --popup-bg:   #fff;
  --popup-text: #3A2E2A;
}

html, body {
  height: 100%;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; background: var(--bg); }

/* ============================================================
   顶部栏 — PC/平板
   ============================================================ */
#topbar {
  display: flex; align-items: center; gap: 20px;
  padding: 14px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  z-index: 1100;
  flex-wrap: nowrap;
  position: relative;
}

.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; background: transparent; border: none; box-shadow: none; padding: 0; }
.logo { line-height: 1; filter: drop-shadow(0 2px 6px rgba(230,57,70,.18)); animation: logoFloat 3s ease-in-out infinite; }
.logo img { width: 48px; height: 48px; object-fit: contain; display: block; }
.brand-badge {
  /* 桌面端固定在顶栏最右侧 */
  position: absolute; right: 24px; top: 50%; transform: translateY(-50%);
  height: 24px; width: auto; object-fit: contain; display: block;
}
@keyframes logoFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

.brand-text h1 {
  font-family: var(--serif);
  font-size: 22px; font-weight: 700; letter-spacing: .5px;
  color: var(--text);
  line-height: 1.2;
}
.brand-text p { font-size: 11px; color: var(--text-sub); line-height: 1.2; letter-spacing: .3px; }

.controls { display: flex; gap: 8px; flex: 1; justify-content: center; }
.select-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 3px 10px;
  transition: all .2s ease;
}
.select-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.select-wrap label { font-size: 11px; color: var(--text-sub); white-space: nowrap; font-weight: 600; }
.select-wrap select {
  border: none; background: transparent;
  font-size: 12px; color: var(--text); font-weight: 600;
  outline: none; cursor: pointer; padding: 2px 2px;
  min-width: 90px; max-width: 140px;
  font-family: var(--sans);
}
.select-wrap select:disabled { color: var(--text-dim); cursor: not-allowed; }

.top-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.btn-plain {
  border: 1px solid var(--border); background: var(--card);
  color: var(--text-sub); padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all .2s;
}
.btn-plain:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
/* 图标按钮（刷新等） */
.btn-icon {
  width: 36px; height: 36px; border: none; background: var(--card); color: var(--primary);
  border-radius: 50%; box-shadow: var(--shadow-sm); cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.btn-icon:hover { background: var(--primary); color: #fff; transform: rotate(180deg) scale(1.08); }
.btn-icon:active { transform: rotate(180deg) scale(.95); }

/* 地图左上角：重置筛选按钮（浮在地图容器内）
   z-index 需高于腾讯地图 DOM 覆盖层(1000)与路线标记(≈1050)，否则会被透明事件层挡住点击 */
.map-reset-wrap { position: absolute; top: 14px; left: 14px; z-index: 1200; }
.map-reset-btn {
  width: 38px; height: 38px; border: none; background: var(--primary); color: #fff;
  border-radius: 50%; box-shadow: 0 4px 14px rgba(230, 57, 70, .35); cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease, box-shadow .2s ease;
}
.map-reset-btn:hover { transform: rotate(180deg) scale(1.06); box-shadow: 0 6px 18px rgba(230, 57, 70, .45); }
.map-reset-btn:active { transform: rotate(180deg) scale(.95); }

/* 地图风格固定为清爽（滤镜只作用于底图画布；标记/弹窗为 DOM 元素不受影响） */
#map.map-fresh canvas { filter: saturate(.6) brightness(1.05) contrast(.96); }

/* ============================================================
   主区域
   ============================================================ */
#main { flex: 1; display: flex; position: relative; min-height: 0; background: var(--bg); }
#map { flex: 1; height: 100%; z-index: 1; background: var(--bg-soft); }

/* ============================================================
   左侧面板 — PC/平板
   ============================================================ */
#panel {
  width: 340px; min-width: 300px;
  background: var(--panel-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  z-index: 1000;
  transition: width .35s ease, min-width .35s ease, opacity .25s ease;
}
#panel.collapsed {
  width: 0 !important; min-width: 0 !important;
  opacity: 0; pointer-events: none; border-right-color: transparent;
}

.side-toggle {
  /* left = 侧栏宽340 - 半个按钮24：把手中心压在侧栏右缘 */
  position: absolute; left: 328px; top: 50%;
  transform: translateY(-50%); z-index: 1001;
  width: 24px; height: 60px; padding: 0;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--card); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(58, 46, 42, .15);
  transition: left .35s ease, background .2s ease, color .2s ease;
}
.side-toggle svg { display: block; transition: transform .3s ease; }
.side-toggle:hover { background: var(--primary); color: #fff; }
.side-toggle.active { left: -12px; }  /* 收起后半截露在屏幕左缘 */
.side-toggle.active svg { transform: rotate(180deg); }

.panel-section { padding: 11px 18px; border-bottom: 1px solid var(--border-soft); }
.panel-title {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--serif); font-size: 13px; font-weight: 700;
  color: var(--text); margin-bottom: 8px; letter-spacing: .3px;
}
.badge { background: var(--bg-soft); color: var(--text-sub); border-radius: 20px; padding: 3px 12px; font-size: 12px; font-weight: 600; }
.badge.accent { background: var(--primary); color: #fff; }

.brand-filter select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; background: var(--bg-soft); color: var(--text); outline: none;
  margin-bottom: 10px; cursor: pointer; font-family: var(--sans);
}
.brand-filter select:focus { border-color: var(--primary); }

.point-list { list-style: none; max-height: calc(100vh - 440px); min-height: 120px; overflow-y: auto; }
.point-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 6px;
  background: var(--item-bg); border-radius: var(--radius-sm);
  cursor: pointer; transition: all .2s ease;
  border-left: 3px solid transparent;
}
.point-list li:hover { background: var(--item-hover); transform: translateX(3px); }
.point-list li.active { background: var(--card); border-left-color: var(--primary); box-shadow: var(--shadow-sm); }
.pl-marker {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff; flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.pl-marker.real {
  background: url('../小红花 拷贝.png') center/contain no-repeat;
  color: var(--primary);  /* 文字用小红花红 */
  border-radius: 0;
  box-shadow: none;
}
.pl-marker.area { background: linear-gradient(135deg, #7BB5E8, var(--blue)); }
.pl-info { flex: 1; min-width: 0; }
.pl-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-brand { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-store { font-size: 11px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-cat { display: inline-block; font-size: 10px; font-weight: 700; line-height: 1; padding: 2px 6px; border-radius: 8px; white-space: nowrap; flex-shrink: 0; margin-left: 2px; }
.pl-count { font-size: 11px; color: var(--accent); font-weight: 700; flex-shrink: 0; }
.empty-tip { text-align: center; color: var(--text-sub); font-size: 13px; padding: 24px 8px; }

/* ============================================================
   出行方式选择
   ============================================================ */
.route-mode-wrap { padding: 4px 0 12px; border-bottom: 1px dashed var(--border-soft); margin-bottom: 10px; }
.route-mode-title { font-size: 11px; color: var(--text-sub); margin-bottom: 7px; letter-spacing: .3px; font-weight: 600; }
.route-mode-tabs { display: flex; gap: 6px; }
.rm-btn {
  flex: 1; padding: 10px 6px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--card); cursor: pointer; transition: all .2s;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-family: var(--sans);
}
.rm-icon { font-size: 18px; line-height: 1; }
.rm-label { font-size: 12px; color: var(--text-sub); font-weight: 600; }
.rm-btn:hover { border-color: var(--primary); background: var(--primary-soft); }
.rm-btn.active {
  border-color: var(--primary); background: var(--primary-soft);
  box-shadow: 0 1px 8px rgba(230,57,70,.15);
}
.rm-btn.active .rm-label { color: var(--primary-dark); }

/* ============================================================
   路线
   ============================================================ */
.route-info {
  font-size: 12px; color: var(--text-sub);
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 12px;
  line-height: 1.7; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 6px;
}
.route-info b { color: var(--primary); font-weight: 700; }
.route-info .rt-text { flex: 1; min-width: 120px; }
.mode-toggle { display: inline-flex; gap: 2px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; padding: 2px; flex-shrink: 0; }
.mode-btn { border: none; background: transparent; color: var(--text-sub); font-size: 11px; padding: 4px 9px; border-radius: 6px; cursor: pointer; transition: all .15s; font-weight: 600; }
.mode-btn.active { background: var(--primary); color: #fff; font-weight: 600; }
.route-loading { color: var(--text-sub); }
.route-loading::after { content: ''; display: inline-block; width: 8px; text-align: left; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0%{content:''} 25%{content:'.'} 50%{content:'..'} 75%{content:'...'} 100%{content:'....'} }
.route-list { list-style: none; counter-reset: route; max-height: none; overflow-y: auto; padding: 0; margin: 0; }

/* ===== 多路线分组（侧栏 / 移动端通用） ===== */
.rt-group { margin-bottom: 14px; }
.rt-group-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 4px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 6px;
}
.rt-group-title { display: flex; align-items: center; gap: 8px; }
.rt-dot {
  width: 12px; height: 12px; border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
  flex-shrink: 0;
}
.rt-group-name { font-family: var(--serif); font-size: 15px; font-weight: 800; color: var(--text); letter-spacing: .3px; }
.rt-group-count { font-size: 11px; font-weight: 700; color: var(--text-sub); background: var(--bg-soft); padding: 2px 10px; border-radius: 20px; }
.rt-group-dist { font-size: 11px; font-weight: 700; color: var(--accent); background: rgba(230,57,70,.08); padding: 2px 8px; border-radius: 20px; margin-left: 4px; }
.rt-group-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.rt-group-info { font-size: 11px; color: var(--text-sub); font-weight: 600; }
.rt-status { font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 700; }
.rt-status.rt-loading { color: var(--accent); background: var(--accent-soft); animation: blink 1.2s ease-in-out infinite; }
.rt-status.rt-ok { color: #27ae60; background: rgba(39,174,96,0.12); }
.rt-status.rt-warn { color: #e67e22; background: rgba(230,126,34,0.12); }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

.rt-group-list {
  list-style: none; padding: 0 0 0 6px; margin: 0;
  border-radius: 10px;
  background: transparent;
}

/* 地图 APP 风格路线列表 —— 垂直时间线，简洁易懂 */
.route-list .rt-row { display: flex; align-items: stretch; gap: 10px; padding: 6px 10px; cursor: pointer; transition: background .2s; border-radius: var(--radius-sm); }
.route-list .rt-row:hover { background: var(--item-hover); }
.route-list .rt-col-marker { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; width: 26px; }
.route-list .rt-marker { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--primary)); color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 5px rgba(230,57,70,.25); flex-shrink: 0; }
.route-list .rt-marker.start { background: linear-gradient(135deg, #27ae60, #2ecc71); box-shadow: 0 2px 5px rgba(39,174,96,.3); }
.route-list .rt-marker.end { background: linear-gradient(135deg, #e74c3c, #c0392b); box-shadow: 0 2px 5px rgba(231,76,60,.3); }
.route-list .rt-connector { width: 2px; flex: 1; min-height: 14px; background: linear-gradient(180deg, var(--primary) 0%, var(--border) 100%); margin: 2px 0; }
.route-list .rt-row.rt-end .rt-connector { display: none; }
.route-list .rt-content { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 2px 0; }
.route-list .rt-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-list .rt-name small { color: var(--text-sub); font-weight: 400; font-size: 11px; }
.route-list .rt-store { font-size: 11px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.route-list .rt-label { font-size: 10px; color: var(--text-sub); margin-top: 1px; }
.route-list .rt-row.rt-start .rt-label { color: #27ae60; font-weight: 600; }
.route-list .rt-row.rt-end .rt-label { color: #e74c3c; font-weight: 600; }
.route-list .rt-dist { font-size: 11px; color: var(--text-sub); white-space: nowrap; font-weight: 500; align-self: center; flex-shrink: 0; }
.route-list .rt-end-flag { color: #27ae60; font-weight: 700; }

/* ---------- 公交步骤详情 ---------- */
.rt-step-block { padding-left: 48px; padding-bottom: 12px; }
.rt-step-list { display: flex; flex-direction: column; gap: 6px; }
.rt-step-item {
  display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px;
  font-size: 12px; line-height: 1.5;
}
.rt-step-icon { font-size: 15px; line-height: 1.2; flex-shrink: 0; }
.rt-step-text { flex: 1; color: var(--text); font-weight: 500; }
.rt-step-meta { color: var(--text-sub); font-size: 11px; font-weight: 600; white-space: nowrap; flex-shrink: 0; align-self: center; }
.rt-step-walk .rt-step-icon { font-size: 14px; }
.rt-step-walk .rt-step-text { color: #5D6A73; }
.rt-step-subway { background: #EEF2FF; border-color: #4361EE33; }
.rt-step-subway .rt-step-text { color: #4361EE; }
.rt-step-bus { background: #FFF7ED; border-color: #F4A26133; }
.rt-step-bus .rt-step-text { color: #B6721E; }

/* ============================================================
   图例
   ============================================================ */
.legend { display: flex; flex-direction: column; gap: 8px; }
.legend-item { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-sub); }
.leg-flower { width: 18px; height: 18px; object-fit: contain; vertical-align: middle; flex-shrink: 0; }
.leg-flower.faded { opacity: 0.6; filter: saturate(0.7); }
.leg-line { width: 26px; height: 0; border-top: 2px dashed var(--text-dim); flex-shrink: 0; }
.leg-line.solid { border-top: 3px dashed var(--primary); }
.leg-cat { display: inline-block; font-size: 11px; font-weight: 700; line-height: 1; padding: 3px 8px; border-radius: 10px; border-width: 1px; border-style: solid; }
.legend-cats { flex-direction: column; gap: 6px; }

/* ============================================================
   空状态
   ============================================================ */
.empty-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 500; pointer-events: none; }
.empty-card {
  background: var(--card); backdrop-filter: blur(12px);
  border-radius: var(--radius-lg); padding: 40px 48px;
  text-align: center; box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-soft); max-width: 420px;
  animation: cardIn .4s ease;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
.empty-icon { font-size: 52px; margin-bottom: 12px; animation: logoFloat 3s ease-in-out infinite; }
img.empty-icon { width: 84px; height: 84px; object-fit: contain; }
.empty-card h2 { font-family: var(--serif); font-size: 22px; margin-bottom: 12px; color: var(--text); font-weight: 700; letter-spacing: .5px; }
.empty-card p { font-size: 14px; line-height: 2; color: var(--text-sub); }
.empty-card b { color: var(--primary); font-weight: 700; }

/* ============================================================
   地图标记
   ============================================================ */
.marker-pin { position: relative; display: flex; align-items: center; justify-content: center; filter: drop-shadow(0 3px 4px rgba(0,0,0,.35)); transition: transform .2s ease; }
.marker-pin:hover { z-index: 9999; }
.marker-pin:hover .pin { transform: scale(1.15); }
.marker-pin .pin {
  width: 36px; height: 36px;
  position: relative; display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease;
}
.marker-pin .pin .pin-icon {
  width: 36px; height: 36px;
  object-fit: contain;
  display: block;
}
.marker-pin .pin .pin-num {
  position: absolute; top: -6px; right: -6px;
  background: var(--accent, #E63946); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; box-shadow: 0 1px 3px rgba(0,0,0,.3);
  border: 1.5px solid #fff; z-index: 2;
}
/* 同位置叠店角标：在花的左下角显示 +N（右上被 pin-num 占用）*/
.marker-pin .pin .pin-stack {
  position: absolute; bottom: -4px; left: -6px;
  background: linear-gradient(135deg, #10B981, #059669);
  color: #fff; font-size: 10px; font-weight: 800; line-height: 1;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; box-shadow: 0 1px 3px rgba(0,0,0,.3);
  border: 1.5px solid #fff; z-index: 3;
  letter-spacing: -0.5px;
}
.marker-pin .pin span {
  font-size: 12px; font-weight: 800; color: #fff;
  text-shadow: 0 0 3px rgba(0,0,0,.85), 0 1px 2px rgba(0,0,0,.6);
  line-height: 1; position: relative; z-index: 2;
}
.marker-pin .pin-label {
  position: absolute; left: 32px; top: 50%;
  transform: translateY(-50%); white-space: nowrap;
  background: rgba(255,255,255,.95); color: var(--text);
  padding: 3px 9px; border-radius: 10px;
  font-size: 11px; font-weight: 700; line-height: 1.4;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
  border: 1px solid var(--border-soft);
  pointer-events: none; z-index: 10;
}
.marker-pin .pin-label em { font-style: normal; color: var(--accent); margin-left: 4px; font-size: 10px; }
/* 活动类型徽章（地图标记下方） */
.marker-pin .pin-cat {
  position: absolute; left: 50%; top: 40px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 10px; font-weight: 700; line-height: 1;
  padding: 2px 6px; border-radius: 8px;
  pointer-events: none; z-index: 10;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.marker-pin.area .pin { opacity: 0.65; filter: saturate(0.7); }
.marker-pin.area .pin-label { opacity: 0.85; }
.marker-pin.route .pin { filter: drop-shadow(0 0 5px rgba(230,57,70,.65)); }
.marker-pin.finish .pin::after { content: '🏁'; position: absolute; top: -10px; right: -10px; font-size: 14px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.marker-pin.pulse::before {
  content: ''; position: absolute; inset: 0;
  background: url('../小红花.png') no-repeat center / contain;
  animation: pinPulse 1.6s ease-out infinite; z-index: -1;
}
@keyframes pinPulse { 0% { transform: scale(1); opacity: .55; } 70% { transform: scale(1.9); opacity: 0; } 100% { transform: scale(1.9); opacity: 0; } }
.way-dot { width: 22px; height: 22px; background: linear-gradient(135deg, #7DCC7D, var(--green)); border: 2.5px solid #fff; border-radius: 50%; font-size: 11px; font-weight: 800; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,.35); }

/* 路线线 */
.route-glow { animation: none; }
.route-line { stroke-dasharray: none; animation: none; }

/* ============================================================
   弹窗
   ============================================================ */
.leaflet-popup-content-wrapper {
  background: var(--popup-bg); color: var(--popup-text);
  border-radius: 14px; box-shadow: 0 8px 30px rgba(58,46,42,.18);
  border: 1px solid var(--border-soft);
}
.leaflet-popup-tip { background: var(--popup-bg); border: 1px solid var(--border-soft); }
.leaflet-popup-content { margin: 12px 16px; line-height: 1.6; }
.popup-title { font-weight: 800; font-size: 14px; color: var(--primary); margin-bottom: 2px; }
.popup-sub { font-size: 12px; color: var(--text-sub); }
.popup-addr { font-size: 12px; color: var(--popup-text); margin-top: 4px; }
.popup-tags { margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.popup-cat { display: inline-block; font-size: 11px; font-weight: 700; line-height: 1; padding: 3px 8px; border-radius: 10px; }
.popup-count { display: inline-block; background: var(--bg-soft); color: var(--accent); border: 1px solid var(--border); border-radius: 20px; padding: 2px 10px; font-size: 11px; font-weight: 700; }
.popup-hint { margin-top: 6px; font-size: 11px; color: #9a8f8a; }
/* 导航方式选择面板（腾讯/高德/百度） */
.nav-sheet { position: fixed; inset: 0; z-index: 3000; }
.nav-sheet .ns-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .35); }
.nav-sheet .ns-panel {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 420px;
  background: var(--card); border-radius: 18px 18px 0 0;
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -6px 24px rgba(0, 0, 0, .18);
}
.nav-sheet .ns-title { font-size: 13px; font-weight: 700; color: var(--text-sub); text-align: center; margin-bottom: 8px; }
.nav-sheet .ns-opt {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 13px 12px; border: none; background: transparent;
  font-size: 15px; font-weight: 600; color: var(--text);
  border-bottom: 1px solid var(--border-soft); cursor: pointer; text-align: left;
}
.nav-sheet .ns-opt:hover { background: var(--primary-soft); color: var(--primary); }
.nav-sheet .ns-ico { font-size: 18px; }
.nav-sheet .ns-cancel {
  width: 100%; margin-top: 8px; padding: 12px;
  border: none; background: var(--bg-soft); border-radius: 12px;
  font-size: 14px; font-weight: 700; color: var(--text-sub); cursor: pointer;
}
/* 轻提示条（定位结果说明等，自动消失） */
.toast-tip {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(8px);
  background: rgba(58, 46, 42, .92); color: #fff; font-size: 13px;
  padding: 10px 16px; border-radius: 12px; z-index: 3000;
  opacity: 0; transition: opacity .3s ease, transform .3s ease;
  max-width: 82vw; text-align: center; line-height: 1.5; pointer-events: none;
}
.toast-tip.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   地图控件 — PC
   ============================================================ */
.leaflet-control-zoom { border: none !important; box-shadow: var(--shadow-sm) !important; border-radius: var(--radius-sm) !important; overflow: hidden; }
.leaflet-control-zoom a { background: var(--card) !important; color: var(--text) !important; border: none !important; width: 36px !important; height: 36px !important; line-height: 36px !important; font-size: 18px !important; }
.leaflet-control-zoom a:hover { background: var(--primary) !important; color: #fff !important; }
.leaflet-control-zoom a:first-child { border-bottom: 1px solid var(--border) !important; }
.leaflet-control-locate-btn .locate-btn {
  width: 36px; height: 36px; background: var(--card); color: var(--primary);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 17px; border: none; margin-top: 8px;
  transition: all .2s;
}
.leaflet-control-locate-btn .locate-btn:hover { background: var(--primary); color: #fff; transform: scale(1.08); }
.leaflet-control-locate-btn .locate-btn.locating { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* 定位按钮（缩放控件下方，胶囊形带文字，醒目易发现；定位/尺寸由 JS 内联维护） */
.bmap-locate-wrap { z-index: 2000; }
.bmap-locate-wrap .locate-btn {
  height: 42px; padding: 0 16px; background: var(--card); color: var(--primary);
  border-radius: 21px; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center; gap: 7px;
  cursor: pointer; font-size: 13px; font-weight: 700; border: none; transition: all .2s;
}
.bmap-locate-wrap .locate-btn:hover { background: var(--primary); color: #fff; transform: scale(1.05); }
.bmap-locate-wrap .locate-btn.locating { color: var(--text-sub); pointer-events: none; }
.bmap-locate-wrap .locate-btn.locating svg { animation: spin 1s linear infinite; }
.bmap-locate-wrap .locate-btn.ok { background: #2a9d5c; color: #fff; }

/* 腾讯地图缩放控件（右下角） */
.tmap-zoom-control {
  position: absolute; bottom: 90px; right: 16px; z-index: 2000;
  display: flex; flex-direction: column; border-radius: var(--radius-sm);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.tmap-zoom-control button {
  width: 36px; height: 36px; background: var(--card); color: var(--text);
  border: none; cursor: pointer; font-size: 18px; font-weight: 600;
  transition: all .2s; line-height: 36px;
}
.tmap-zoom-control button:first-child { border-bottom: 1px solid var(--border); }
.tmap-zoom-control button:hover { background: var(--primary); color: #fff; }

/* 腾讯地图信息窗口样式覆盖 */
.tmap-info-window { background: #fff !important; border-radius: var(--radius-sm) !important; box-shadow: var(--shadow-md) !important; }
.tmap-info-window-content { padding: 12px 16px !important; font-family: var(--sans) !important; }

.user-dot { width: 14px; height: 14px; background: var(--blue); border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 4px rgba(74,144,217,.35); }
.user-dot::before { content:''; position:absolute; inset:-6px; border-radius:50%; border: 2px solid rgba(74,144,217,.5); animation: userPulse 1.8s ease-out infinite; }
@keyframes userPulse { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.8); opacity: 0; } }

/* ============================================================
   移动端底部面板（默认隐藏）
   ============================================================ */
#mobileBar { display: none; }

/* ============================================================
   响应式 · 平板 (768-1100px)
   ============================================================ */
@media (max-width: 1100px) {
  #panel { width: 300px; min-width: 260px; }
  .side-toggle { left: 288px; }
  #topbar { padding: 12px 18px; gap: 14px; }
  .brand-text h1 { font-size: 20px; }
}

/* ============================================================
   响应式 · 手机 (<=900px) — 浮岛式温暖明亮
   ============================================================ */
@media (max-width: 900px) {
  /* 手机端整体重置 */
  #app { height: 100dvh; background: var(--bg); }

  /* === 顶栏：浮岛式（避开摄像头/刘海区域） === */
  #topbar {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: calc(env(safe-area-inset-top, 0px) + 28px) 14px 18px;
    background: linear-gradient(180deg, rgba(255, 251, 237, 0.96) 0%, rgba(255, 251, 237, 0.82) 65%, rgba(255, 251, 237, 0) 100%);
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* 第一行：LOGO（无背景框，纯图标，左对齐） */
  .brand {
    display: flex; align-items: center; justify-content: flex-start; gap: 12px;
    width: 100%;
    padding: 0 4px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
  }
  .brand-text h1 {
    font-family: var(--serif);
    font-weight: 700;
    font-size: 22px;
    letter-spacing: .5px;
    color: var(--text);
    line-height: 1.1;
  }
  .brand-text p { display: none; }
  .logo img { width: 64px; height: 64px; filter: drop-shadow(0 2px 8px rgba(230, 57, 70, 0.25)); }
  .brand-badge { height: 16px !important; margin-left: auto !important; align-self: flex-end !important; position: static !important; transform: none !important; }
  /* 移动端：重置按钮位于浮岛顶栏下方的地图左上角 */
  .map-reset-wrap { top: calc(env(safe-area-inset-top, 0px) + 168px); left: 12px; }

  /* 移动端：定位按钮保留"我的位置"文字，贴地图右下角（底部间距由 JS 按面板高度计算） */
  .bmap-locate-wrap { right: 12px; }
  .bmap-locate-wrap .locate-btn { height: 40px; padding: 0 13px; border-radius: 20px; gap: 5px; }
  .bmap-locate-wrap .locate-btn svg { width: 16px; height: 16px; }

  /* 移动端：缩放控件（fixed 定位挂在 body，底部间距由 JS 按面板高度计算） */
  .tmap-zoom-control { right: 12px !important; }

  .top-actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
  }
  .btn-plain {
    background: var(--primary-soft);
    border: 1px solid var(--border-soft);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
  }

  /* 第二行：省份/城市/区域紧凑横排 */
  .controls {
    order: 0;
    width: 100%;
    gap: 6px;
    justify-content: stretch;
    flex-wrap: nowrap;
  }
  .select-wrap {
    flex: 1 1 0;
    min-width: 0;
    padding: 6px 10px;
    background: var(--card-soft);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--border-soft);
  }
  .select-wrap label { font-size: 11px; }
  .select-wrap select { font-size: 13px; min-width: 0; max-width: none; padding: 4px 2px; }
  .select-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft), 0 4px 14px rgba(230, 57, 70, 0.12);
  }
  .select-wrap select:disabled { color: var(--text-dim); }

  /* === 主区域 === */
  #main { flex-direction: column; background: var(--bg); }
  #map { flex: 1; background: var(--bg-soft); }

  /* 手机端隐藏 PC 侧栏与浮动按钮 */
  #panel { display: none; }
  .side-toggle { display: none !important; }

  /* === 底部 mobileBar === */
  #mobileBar {
    position: relative;
    display: flex;
    flex-direction: column;
    z-index: 1200;
    background: var(--card-soft);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-top: 1px solid var(--border-soft);
    border-radius: 26px 26px 0 0;
    box-shadow: 0 -8px 32px rgba(230, 57, 70, 0.08), 0 -2px 8px rgba(58, 46, 42, 0.04);
    max-height: 54%;
    padding: 0 18px calc(env(safe-area-inset-bottom, 0px) + 16px);
    transition: max-height .4s cubic-bezier(.4,0,.2,1), transform .4s cubic-bezier(.4,0,.2,1);
  }
  /* 收起：蝴蝶结把手 + 点位/路线标签行保持可见，仅隐藏内容面板 */
  #mobileBar.collapsed { max-height: 92px; padding-bottom: 8px; }
  #mobileBar.collapsed .mb-panel { display: none; }

  /* 圆头矩形把手（收起/展开底部面板，箭头随状态翻转） */
  .mb-handle {
    position: absolute;
    top: -12px; left: 50%;
    transform: translateX(-50%);
    z-index: 1201;
    width: 64px; height: 24px; padding: 0;
    border: 1px solid var(--border-soft); border-radius: 12px;
    background: var(--card);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-sub);
    box-shadow: 0 2px 8px rgba(58, 46, 42, 0.15);
    transition: transform .2s;
  }
  .mb-handle svg { display: block; transition: transform .3s ease; }
  #mobileBar.collapsed .mb-handle svg { transform: rotate(180deg); }
  .mb-handle:active { transform: translateX(-50%) scale(.94); }

  /* 刷新按钮 —— 手机端已移除（用户要求） */
  .top-actions { display: none !important; }

  /* tabs */
  .mb-tabs {
    display: flex;
    padding: 14px 0 10px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 4px;
  }
  .mb-tab {
    flex: 1; padding: 8px 0;
    border: none; background: transparent;
    font-family: var(--serif); font-size: 18px; font-weight: 800;
    color: var(--text-dim); cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color .25s, border-color .25s; letter-spacing: .3px;
  }
  .mb-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
  .mb-tab span {
    display: inline-block; min-width: 20px;
    background: var(--primary-soft); color: var(--primary);
    border-radius: 999px; font-size: 12px; font-family: var(--sans);
    font-weight: 800; padding: 2px 8px; margin-left: 4px; vertical-align: middle;
  }

  /* 内容面板 */
  .mb-panel {
    overflow-y: auto; flex: 1;
    padding: 16px 4px 4px;
    color: var(--text);
    -webkit-overflow-scrolling: touch;
  }
  .mb-panel .panel-section { border: none; padding: 0; }
  .mb-panel .panel-title { color: var(--text); margin-bottom: 12px; }
  .mb-panel .panel-title span:first-child { font-family: var(--serif); font-size: 17px; font-weight: 800; }
  .mb-panel .brand-filter { padding: 0 0 12px; }
  .mb-panel .brand-filter select {
    width: 100%; height: 42px; padding: 0 12px;
    border: 1px solid var(--border-soft); border-radius: 12px;
    background: var(--card); color: var(--text); font-size: 14px; font-weight: 600;
  }
  .mb-panel .point-list, .mb-panel .route-list { max-height: none; margin: 0; }
  .mb-panel .point-list li { padding: 14px 16px; margin-bottom: 8px; background: var(--primary-soft); border: 1px solid var(--border-soft); border-radius: 14px; color: var(--text); font-size: 15px; font-weight: 600; transition: all .25s ease; }
  .mb-panel .point-list li:hover { background: rgba(230, 57, 70, 0.14); border-color: var(--primary); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(230, 57, 70, 0.12); }
  /* 移动端路线列表 —— 地图 APP 风格垂直时间线 */
  .mb-panel .route-list .rt-row { padding: 10px 12px; }
  .mb-panel .route-list .rt-row:hover { background: rgba(230, 57, 70, 0.10); transform: none; box-shadow: none; }
  .mb-panel .route-list .rt-marker { width: 30px; height: 30px; font-size: 13px; }
  .mb-panel .route-list .rt-col-marker { width: 30px; }
  .mb-panel .route-list .rt-connector { min-height: 20px; }
  .mb-panel .route-list .rt-name { font-size: 15px; font-weight: 700; }
  .mb-panel .route-list .rt-name small { font-size: 12px; }
  .mb-panel .route-list .rt-label { font-size: 11px; }
  .mb-panel .route-list .rt-dist { font-size: 13px; color: var(--primary); font-weight: 700; }
  .mb-panel .route-list .rt-end-flag { color: #27ae60; }
  .mb-panel .badge { background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-soft); font-weight: 700; }
  .mb-panel .badge.accent { background: var(--primary); color: #fff; border-color: var(--primary); }
  .mb-panel .route-info {
    background: linear-gradient(90deg, var(--primary-soft) 0%, var(--accent-soft) 100%);
    border-left: 3px solid var(--primary);
    padding: 12px 14px; border-radius: 4px 14px 14px 4px;
    margin-bottom: 12px; color: var(--text); font-size: 13px; line-height: 1.7; font-weight: 500;
    flex-direction: column; align-items: flex-start; gap: 8px;
  }
  .mb-panel .route-info b { color: var(--primary); font-weight: 800; }
  /* 手机端模式切换按钮（步行）—— 放在路线信息上方，靠左对齐 */
  .mb-panel .mode-toggle { display: inline-flex !important; width: 100%; justify-content: flex-start; }
  .mb-panel .mode-btn { font-size: 13px !important; padding: 6px 14px !important; }

  /* 空状态卡 */
  .empty-card {
    margin: 0 16px;
    padding: 28px 24px;
    background: var(--card-soft);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-radius: 22px;
    border: 1px solid var(--border-soft);
    color: var(--text);
    box-shadow: 0 8px 32px rgba(230, 57, 70, 0.1), 0 2px 6px rgba(58, 46, 42, 0.04);
  }
  .empty-card .empty-icon { font-size: 44px; margin-bottom: 10px; filter: drop-shadow(0 4px 16px rgba(230, 57, 70, 0.25)); }
  .empty-card h2 { font-family: var(--serif); font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 12px; letter-spacing: .5px; }
  .empty-card p { font-size: 14px; color: var(--text-sub); line-height: 1.85; font-weight: 500; }
  .empty-card p b { color: var(--primary); font-weight: 800; }

  /* Leaflet 控件：简洁小尺寸 */
  .leaflet-bar { border: none !important; box-shadow: 0 2px 8px rgba(58,46,42,.08) !important; }
  .leaflet-control-zoom { margin: 14px !important; border-radius: 12px !important; overflow: hidden !important; }
  .leaflet-control-zoom a {
    background: rgba(255,255,255,.92); color: var(--text);
    border: 1px solid var(--border-soft); border-bottom: none;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    font-weight: 600; font-size: 15px;
    width: 32px; height: 32px; line-height: 32px;
    transition: all .2s ease;
  }
  .leaflet-control-zoom a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
  .leaflet-control-locate-btn .locate-btn {
    background: rgba(255,255,255,.92); color: var(--primary);
    border: 1px solid var(--border-soft);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    width: 32px; height: 32px; border-radius: 12px; font-size: 16px;
    box-shadow: 0 2px 8px rgba(58,46,42,.08);
  }
  .leaflet-control-locate-btn .locate-btn:hover { background: var(--primary); color: #fff; }
}

@media (max-width: 480px) {
  .brand-text h1 { font-size: 19px; }
  .logo img { width: 30px; height: 30px; }
  .select-wrap select { font-size: 13px; }
  /* 窄屏下 4 个下拉框改为 2×2，避免"北京（118点）"等长文本被截断 */
  .controls { flex-wrap: wrap; }
  .select-wrap { flex: 1 1 42%; }
}

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--text-dim); border-radius: 3px; opacity: .5; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }
::-webkit-scrollbar-track { background: transparent; }

/* 就近点位（定位授权后展示） */
.nearby-box { display: none; }  /* “离你最近”卡片已按用户要求移除，保留类名占位 */

/* 弹窗内导航按钮 */
.popup-nav {
  display: inline-block; margin-top: 8px; padding: 6px 16px;
  background: var(--primary); color: #fff; border-radius: 999px;
  font-size: 12px; font-weight: 700; text-decoration: none;
}
.popup-nav:hover { opacity: .85; }
