/* 港嘉打卡 CityWalk — 手机竖屏，全屏地图 + 悬浮控件 + 底部抽屉
   场景：夜晚街头单手持机边走边看。深色 chrome、金色夜行强调、地图是主角。 */

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #0f1216;
  --surface: #171d26;
  --surface-2: #202834;
  --line: #2b3441;
  --ink: #f3f5f7;
  --dim: #9aa5b1;
  --faint: #8a95a2; /* 曾 #6b7683，对比 3.7:1 不达 AA，提亮到 ~4.5:1（11-12px 小字可读） */
  --accent: #f5a623;
  /* 打卡标记（与 marks.js emoji 色一致） */
  --mark-heart: #e0245e;
  --mark-star: #f5c518;
  --mark-done: #2ec46b; /* 与自绘绿勾渐变中段同色（见 .mk-done） */
  --accent-ink: #211603;
  --primary: #1967d2; /* 曾 #2f80ed：白字对比 3.9:1 不达 AA，压深到 4.55:1 */
  --r-s: 10px;
  --r-m: 14px;
  --r-l: 20px;
  --shadow-1: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 10px 32px rgba(0, 0, 0, 0.5);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 160ms;
  --t-med: 260ms;
  /* 悬浮控件几何 */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bar-h: 44px;
  --chip-h: 38px;
  --top-cluster: calc(var(--safe-top) + 8px + var(--bar-h) + 8px + var(--chip-h));
  /* 底部两层搁架：低层=locate FAB/routeBar/簇chip，高层=route FAB/toast。
     曾经 toast 88px vs FAB 84px 差 4px 各写各的，基线不齐一眼假 */
  --shelf-low: calc(var(--safe-bottom) + 22px);
  --shelf-high: calc(var(--safe-bottom) + 84px);
  /* z 轴语义层级 */
  --z-scrim: 500;
  --z-chip: 700; /* 簇chip：地图之上、列表(800)/遮罩(1200)之下——盖层打开自然被盖 */
  --z-controls: 900;
  --z-list: 800;
  --z-fab: 950;
  --z-mask: 1200;
  --z-sheet: 1300;
  --z-lightbox: 1350;
  --z-toast: 1400;
}

html, body { height: 100%; overscroll-behavior: none; }

body {
  font-family: -apple-system, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  height: 100dvh;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
}

.hidden { display: none !important; }

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-s); }

.icon { width: 18px; height: 18px; flex: none; display: block; }

/* ---------- 全屏地图 ---------- */
#map {
  position: fixed;
  inset: 0;
  background: #ccd3da;
  z-index: 0;
}

/* 顶部渐隐 scrim：保证悬浮控件压在浅色瓦片上也清晰 */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(var(--top-cluster) + 40px);
  background: linear-gradient(to bottom, rgba(10, 13, 17, 0.55), rgba(10, 13, 17, 0));
  pointer-events: none;
  z-index: var(--z-scrim);
}

/* ---------- 悬浮顶栏 ---------- */
.topbar {
  position: fixed;
  top: calc(var(--safe-top) + 8px);
  left: 10px;
  right: 10px;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: var(--z-controls);
}

.brand {
  height: var(--bar-h);
  padding: 0 14px 0 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: rgba(19, 24, 31, 0.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-1);
  white-space: nowrap;
}
.brand::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(245, 166, 35, 0.7);
}
/* 品牌 pill 是「我的」入口：小箭头暗示可点 */
.brand-caret { width: 11px; height: 11px; color: var(--faint); margin: 1px 0 0 -1px; }
.brand:active { background: var(--surface-2); }

.seg {
  margin-left: auto;
  height: var(--bar-h);
  padding: 4px;
  gap: 2px;
  background: rgba(19, 24, 31, 0.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-1);
  display: flex;
  align-items: center;
}
.seg button {
  height: 100%;
  padding: 0 11px; /* 三城+自动共 4 按钮，13px 会在 390px 屏挤爆顶栏 */
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--dim);
  transition: background var(--t-fast), color var(--t-fast);
}
.seg button.active { background: var(--primary); color: #fff; font-weight: 600; }
.seg button.current { color: var(--accent); }
.seg button:active { transform: scale(0.96); }

.view-toggle {
  height: var(--bar-h);
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(19, 24, 31, 0.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-1);
  white-space: nowrap;
  transition: background var(--t-fast);
}
.view-toggle:active { background: var(--surface-2); }

/* ---------- 悬浮筛选 chips ---------- */
.chips {
  position: fixed;
  top: calc(var(--safe-top) + 8px + var(--bar-h) + 8px);
  left: 0;
  right: 0;
  height: var(--chip-h);
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 0 10px;
  overflow-x: auto;
  scrollbar-width: none;
  z-index: var(--z-controls);
  /* 右缘渐隐：暗示还有 chip 可横滑（收藏/去过 常在屏外） */
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 32px), transparent);
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  height: 34px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  background: rgba(19, 24, 31, 0.92);
  color: var(--ink);
  font-size: 13px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: var(--shadow-1);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.chip .n { font-size: 11px; color: var(--faint); font-weight: 600; font-variant-numeric: tabular-nums; }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chip.active .n { color: rgba(33, 22, 3, 0.65); }
.chip:disabled { opacity: 0.35; }
.chip:active:not(:disabled) { transform: scale(0.96); }

/* ---------- marker 标签 ---------- */
.poi-label {
  background: rgba(255, 255, 255, 0.95);
  border: 0;
  border-radius: 7px;
  box-shadow: 0 1px 5px rgba(15, 23, 32, 0.3);
  color: #1f2933;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 7px;
  white-space: nowrap;
  cursor: pointer;
}
.poi-label::before { display: none; }
.poi-label-night { background: rgba(255, 246, 224, 0.97); color: #6b4e00; }
/* 标记态：label 彩色描边（❤️红 / ⭐黄），去过整体淡出 */
.poi-label-heart { box-shadow: 0 0 0 1.5px var(--mark-heart), 0 1px 5px rgba(15, 23, 32, 0.3); }
.poi-label-star { box-shadow: 0 0 0 1.5px var(--mark-star), 0 1px 5px rgba(15, 23, 32, 0.3); }
.poi-label-done { opacity: 0.75; }
.labels-off .poi-label { display: none; }
/* 两级标签：z 14-15 只显热度 top-N + 收藏点（map.js poi-label-hot），z≥16 全显 */
.labels-hot-only .poi-label:not(.poi-label-hot) { display: none; }

/* 簇跳转胶囊：嘉兴 fitPois 总览（z<12）时给"市区/乌镇"两簇各一个可点的带名入口，
   否则总览是两坨无名点、底图第三方古镇反而全有名字 */
.cluster-badge {
  background: rgba(19, 24, 31, 0.94);
  border: 1px solid var(--accent);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transform: translate(-50%, -50%);
  display: inline-block;
}
.cluster-badge .n { color: var(--accent); margin-left: 3px; }
.leaflet-container:not(.z-overview) .cluster-badge-wrap { display: none; }

/* 用户蓝点 */
.user-dot {
  width: 16px;
  height: 16px;
  background: #4285f4;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.4), 0 1px 6px rgba(0, 0, 0, 0.4);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.45), 0 1px 6px rgba(0, 0, 0, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(66, 133, 244, 0.1), 0 1px 6px rgba(0, 0, 0, 0.4); }
}

/* ---------- 回到我 FAB ---------- */
.fab {
  position: fixed;
  right: 12px;
  bottom: var(--shelf-low);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(19, 24, 31, 0.95);
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: var(--shadow-2);
  z-index: var(--z-fab);
  transition: transform var(--t-fast), background var(--t-fast);
}
.fab:active { transform: scale(0.92); background: var(--surface-2); }
.fab .icon { width: 22px; height: 22px; }
.fab-route { bottom: var(--shelf-high); color: var(--accent); }
.fab-route.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
/* GPS 拒绝/失败的持久降级态：变暗 + 斜杠。toast 只活 3 秒，这个状态得一直可见 */
#locateBtn.no-gps { color: var(--faint); }
#locateBtn.no-gps::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--faint);
  box-shadow: 0 0 0 2.5px rgba(19, 24, 31, 0.95); /* 与底下图标之间垫出底色缝，斜杠不糊 */
  transform: rotate(-45deg);
}

/* ---------- 暴走路线 ---------- */
.route-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  border: 2px solid #fff;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}
.route-panel {
  position: fixed;
  right: 12px;
  bottom: calc(var(--safe-bottom) + 146px);
  z-index: var(--z-fab);
  background: rgba(19, 24, 31, 0.97);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--shadow-2);
  padding: 12px;
  width: 232px;
}
.rp-title { font-size: 13px; font-weight: 700; }
.rp-hint { display: block; font-size: 11px; color: var(--faint); font-weight: 400; margin: 3px 0 9px; }
.rp-options { display: flex; flex-direction: column; gap: 6px; }
.rp-opt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  transition: filter var(--t-fast);
}
.rp-opt:active { filter: brightness(1.2); }
.rp-opt .d { font-size: 11px; color: var(--dim); font-weight: 400; }
.route-bar {
  position: fixed;
  /* 左锚而非居中：居中时右缘会压到 locate FAB（390px 下重叠 16px+），
     ✕ 的 44px 热区叠在 FAB 上，夜里单手清路线必误触重新定位 */
  left: 12px;
  right: 76px;
  bottom: var(--shelf-low);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(24, 30, 38, 0.97);
  border: 1px solid var(--accent);
  color: var(--ink);
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 999px;
  z-index: var(--z-fab);
  box-shadow: var(--shadow-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.route-bar span { overflow: hidden; text-overflow: ellipsis; }
/* 两行结果：上行=站数/里程/步行，下行=游览+全程。单行在 390px 下必截"游览时长" */
#routeBarText { display: flex; flex-direction: column; min-width: 0; line-height: 1.45; }
#routeBarText b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.rb-sub { font-size: 11px; color: var(--dim); font-weight: 400; }
/* 清除按钮：视觉小圆（26px）不变，热区扩到 44px（负 margin 不撑高胶囊） */
.route-bar button {
  width: 44px;
  height: 44px;
  margin: -10px -14px -10px -4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--dim);
  flex: none;
}
.route-bar button .icon {
  width: 26px;
  height: 26px;
  padding: 7px;
  background: var(--surface-2);
  border-radius: 50%;
}

/* ---------- 列表面板 ---------- */
.list {
  position: fixed;
  inset: 0;
  z-index: var(--z-list);
  background: var(--bg);
  overflow-y: auto;
  /* 底部垫高：路线 FAB 悬浮在列表上，别让它压住最后一条的 🔥 值 */
  padding: calc(var(--top-cluster) + 14px) 12px calc(var(--safe-bottom) + 96px);
}
.list-empty { color: var(--faint); text-align: center; padding: 48px 0; }
.list-note { font-size: 11px; color: var(--faint); margin: 0 2px 8px; }

/* 列表搜索：吸顶在悬浮 chips 之下。top 必须是 0：滚动容器(.list)自带大 padding-top 时
   Chrome 的 sticky 偏移锚定内容盒——top:0 恰好钉在 padding 下缘（=chips 之下），
   写 calc(--top-cluster+8px) 反而会再往下压一整段（实测 +106px 叠在首条列表项上） */
.list-search {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 6px 0 14px;
  margin-bottom: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-1);
}
.list-search > .icon { width: 16px; height: 16px; color: var(--faint); }
.list-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: none;
  border: 0;
  outline: none;
  font: inherit;
  color: var(--ink);
}
.list-search input::placeholder { color: var(--faint); }
.list-search input::-webkit-search-cancel-button { display: none; } /* 自带 ✕ 太小，用右侧 44px 级按钮 */
.list-search button {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--dim);
  flex: none;
}
.list-search button .icon { width: 15px; height: 15px; }

.list-item {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--r-m);
  padding: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background var(--t-fast);
}
.list-item:active { background: var(--surface-2); }
.list-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.thumb {
  width: 76px;
  height: 76px;
  border-radius: var(--r-s);
  object-fit: cover;
  flex: none;
  background: var(--surface-2);
}
.thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  background: linear-gradient(150deg, var(--surface-2), #232f3d);
}
.thumb-empty .icon { width: 24px; height: 24px; opacity: 0.7; }

.li-main { flex: 1; min-width: 0; }
.li-title {
  font-size: 15px;
  font-weight: 650;
  display: flex;
  align-items: baseline;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.li-sub {
  font-size: 12px;
  color: var(--dim);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.li-sub b { color: var(--accent); font-weight: 700; }
.li-tags {
  margin-top: 4px;
  font-size: 11px;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.li-hot {
  flex: none;
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  align-self: flex-start;
  margin-top: 2px;
}
.night-badge { font-size: 12px; flex: none; }
.li-mark { font-size: 13px; flex: none; }
.list-item.item-done { opacity: 0.6; }

/* ---------- 底部详情抽屉 ---------- */
.sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 12, 0.5);
  z-index: var(--z-mask);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.sheet-mask.show { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 82vh; /* iOS <15.4 不认 dvh，先给 vh 兜底 */
  max-height: 82dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border-radius: var(--r-l) var(--r-l) 0 0;
  border-top: 1px solid var(--line);
  z-index: var(--z-sheet);
  padding: 8px 16px calc(var(--safe-bottom) + 18px);
  box-shadow: var(--shadow-2);
  transform: translateY(104%);
  visibility: hidden;
  transition: transform var(--t-med) var(--ease-out), visibility 0s linear var(--t-med);
}
.sheet.open {
  transform: translateY(0);
  visibility: visible;
  transition: transform var(--t-med) var(--ease-out);
}
.sheet:focus { outline: none; } /* dialog 容器收编程焦点（openSheet 移焦），不需要焦点框 */

.sheet-handle {
  width: 38px;
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  margin: 6px auto 12px;
}

.photo-wrap { position: relative; margin-bottom: 14px; }
.photo-wrap .photo-strip { margin-bottom: 0; }
.photo-count {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(10, 13, 17, 0.72);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.photo-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  border-radius: var(--r-m);
  margin-bottom: 14px;
  scrollbar-width: none;
}
.photo-strip::-webkit-scrollbar { display: none; }
.photo-strip img {
  height: 216px;
  min-width: 80%;
  object-fit: cover;
  border-radius: var(--r-m);
  scroll-snap-align: center;
  background: var(--surface-2);
}
.photo-placeholder {
  height: 150px;
  min-width: 100%;
  border-radius: var(--r-m);
  background: linear-gradient(150deg, var(--surface-2), #232f3d);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--dim);
  font-size: 13px;
}
.photo-placeholder .icon { width: 26px; height: 26px; color: var(--faint); }
.ph-sub { font-size: 11px; color: var(--faint); }

.sheet-title h2 { font-size: 20px; font-weight: 700; display: inline; letter-spacing: 0.005em; }
.title-en { color: var(--faint); font-size: 12px; margin-top: 3px; }
/* 韩文名：打车/问路给司机看的核心信息，字号大于英文名；user-select:all 一点全选即复制 */
.title-kr { color: var(--dim); font-size: 15px; margin-top: 4px; -webkit-user-select: all; user-select: all; }

/* ---------- 多日行程（面板入口 + 抽屉天卡片） ---------- */
.rp-hint2 { color: var(--faint); font-size: 11px; font-weight: 400; }
.rp-itins { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.rp-empty { color: var(--faint); font-size: 12px; padding: 4px 2px 8px; }
.iti-day { margin: 14px 0 0; padding: 12px; background: var(--surface-2); border-radius: var(--r-m); }
.iti-day-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.iti-day-head h3 { font-size: 14px; font-weight: 700; }
.iti-map-btn {
  flex: none; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: #1a1204; background: var(--accent);
}
.iti-map-btn:active { transform: scale(0.96); }
.iti-stop {
  display: flex; gap: 10px; width: 100%; text-align: left; padding: 8px 6px;
  border-radius: var(--r-s); align-items: flex-start;
}
.iti-stop:active { background: rgba(255, 255, 255, 0.05); }
.iti-n {
  flex: none; width: 20px; height: 20px; border-radius: 50%; margin-top: 1px;
  background: var(--accent); color: #1a1204; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.iti-body { font-size: 13px; line-height: 1.45; }
.iti-body b { font-weight: 600; }
.iti-slot { font-style: normal; color: var(--accent); font-size: 11px; margin-left: 6px; }
.iti-note { display: block; color: var(--dim); font-size: 12px; margin-top: 1px; }
.iti-meta { color: var(--dim); font-size: 12px; line-height: 1.5; margin-top: 6px; }
.iti-planb { color: #9fb8d8; }

/* 打卡标记：❤️最想去 / ⭐想去 / 绿勾已去过（互斥三选一，点当前态取消） */

/* 自绘绿勾：与 ❤️⭐ 同一套立体语言——实心粗笔画（占宽 22%）、圆头无边框、
   自上而下的绿色渐变（受光在上）、左上高光、右下柔和投影。Unicode 里没有等价字符
   （✅ 带绿框、✔️ 是扁平细线条），故用 data-URI 背景图：渐变 id 被隔离在图片文档内，
   多处注入（详情卡按钮 / 列表 / 地图 label）不会 id 冲突。尺寸走 em，跟随各处字号。 */
.mk-done {
  display: inline-block;
  width: 1.08em;
  height: 1.08em;
  vertical-align: -0.19em;
  flex: none;
  background: no-repeat center/contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='12' y1='3' x2='12' y2='21' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%2379EDA2'/%3E%3Cstop offset='.5' stop-color='%2324BE5C'/%3E%3Cstop offset='1' stop-color='%230A7B36'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.6 12.6 9.4 18.4 20.6 5.2' stroke='%23043F1D' stroke-opacity='.3' stroke-width='5.9' transform='translate(.3 1)'/%3E%3Cpath d='M3.6 12.6 9.4 18.4 20.6 5.2' stroke='url(%23g)' stroke-width='5.4'/%3E%3Cpath d='M11.9 13.2 17.3 6.9' stroke='%23fff' stroke-opacity='.45' stroke-width='1.4'/%3E%3C/g%3E%3C/svg%3E");
}

.mark-row { display: flex; gap: 8px; margin-top: 12px; }
.mark-btn {
  flex: 1;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--dim);
  border: 1px solid transparent;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.mark-btn:active { transform: scale(0.97); }
/* 打卡的高光一拍：选中态一次弹跳（reduced-motion 全局旁路会压到 0.01ms） */
.mark-btn.active { animation: mark-pop 280ms var(--ease-out); }
@keyframes mark-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
.mark-btn.mark-heart.active { background: rgba(224, 36, 94, 0.16); color: var(--mark-heart); border-color: var(--mark-heart); }
.mark-btn.mark-star.active { background: rgba(245, 197, 24, 0.14); color: var(--mark-star); border-color: var(--mark-star); }
.mark-btn.mark-done.active { background: rgba(46, 196, 107, 0.16); color: var(--mark-done); border-color: var(--mark-done); font-weight: 700; }
.sheet-meta { color: var(--dim); font-size: 13px; margin-top: 10px; font-variant-numeric: tabular-nums; }
.sheet-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.sheet-tags span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  background: var(--surface-2);
  border-radius: 6px;
  padding: 3px 9px;
  color: var(--dim);
}
/* 标签色点 = 地图 marker 分色（白描边同 marker 语言） */
.tag-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.65);
}
.sheet-hours {
  font-size: 13px;
  color: var(--accent);
  margin-top: 12px;
  font-weight: 500;
}
.sheet-intro { font-size: 14.5px; line-height: 1.7; margin-top: 10px; max-width: 68ch; }
.sheet-tips { list-style: none; margin-top: 10px; }
.sheet-tips li {
  font-size: 13px;
  line-height: 1.75;
  color: #ccd4dc;
  padding-left: 14px;
  position: relative;
}
.sheet-tips li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* 网友评价（来自小红书笔记与评论区的原文引用） */
.sheet-reviews { margin-top: 14px; }
.rev-title { font-size: 12px; color: var(--faint); margin-bottom: 8px; font-weight: 600; }
.review {
  position: relative;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 9px 12px 9px 26px;
  font-size: 13px;
  line-height: 1.65;
  color: #cfd6dd;
  margin-bottom: 6px;
}
.review::before {
  content: "\201C";
  position: absolute;
  left: 10px;
  top: 4px;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  font-family: Georgia, serif;
}

/* 小红书相关笔记列表 */
.sheet-notes { margin-top: 14px; }
.note-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  text-decoration: none;
  color: var(--ink);
  font-size: 13px;
  transition: filter var(--t-fast);
}
.note-link:active { filter: brightness(1.15); }
.nl-t {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nl-t::before { content: "📕 "; }
.nl-l { flex: none; color: var(--accent); font-size: 12px; font-variant-numeric: tabular-nums; }

.sheet-links { display: flex; gap: 8px; margin-top: 16px; }
.btn {
  flex: 1;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 8px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink);
  transition: filter var(--t-fast), transform var(--t-fast);
}
.btn:active { filter: brightness(1.15); transform: scale(0.98); }
/* 主 CTA 用品牌金（与 chips 选中态/营业时间/FAB 同一强调色），比蓝色更成体系 */
.btn-primary { flex: 1.6; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.sheet-source { font-size: 11px; color: var(--faint); margin-top: 14px; }

/* ---------- 「我的」面板（品牌 pill 入口，复用 sheet 抽屉） ---------- */
.me-city { margin-top: 16px; }
.me-city-head { display: flex; align-items: baseline; justify-content: space-between; }
.me-city-head h3 { font-size: 15px; font-weight: 700; }
.me-pct { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.me-bar {
  height: 6px;
  margin-top: 8px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}
.me-bar i {
  display: block;
  height: 100%;
  background: var(--mark-done);
  border-radius: 3px;
  /* 无过渡：面板每次打开都重建 innerHTML，width 过渡永远没有起点帧可动 */
}
.me-stats { display: flex; gap: 14px; margin-top: 8px; font-size: 13px; color: var(--dim); }
.me-hint { font-size: 13px; color: var(--dim); line-height: 1.7; margin-top: 14px; }
.legend { margin-top: 20px; }
.legend-row { display: flex; gap: 10px; margin-top: 9px; font-size: 13px; line-height: 1.6; color: var(--dim); }
.legend-row .lg-i { flex: none; width: 40px; text-align: center; color: var(--ink); }
/* tag 色图例：图标位一颗代表色点 + 正文里 12 色速查 */
.lg-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #e74c3c; /* DEFAULT_MARKER_COLOR */
  border: 2px solid rgba(255, 255, 255, 0.85);
  vertical-align: -1px;
}
.legend-tags { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 5px; }
.lg-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; white-space: nowrap; }
.lg-tag i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.65);
}

/* ---------- 双向簇 chip（Google Maps「搜索此区域」同款模式） ----------
   常驻左下，永远指向"整簇不在视野内"的分区（嘉兴 市区⇄乌镇 / 香港 市中心⇄外围），
   点了跳过去、moveend 重评后自动翻面或收起（app.js updateClusterChip，零计时器）。
   前身是「去乌镇 N 个」10 秒 toast——永久事实不该用最短命的组件传达。 */
.cluster-chip {
  position: fixed;
  left: 12px;
  bottom: var(--shelf-low);
  display: flex;
  align-items: center;
  gap: 5px;
  height: var(--chip-h);
  padding: 0 12px 0 15px;
  background: rgba(19, 24, 31, 0.94);
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  box-shadow: var(--shadow-1);
  z-index: var(--z-chip);
  animation: toast-in 240ms var(--ease-out);
  transition: transform var(--t-fast);
}
.cluster-chip:active { transform: scale(0.95); }
.cluster-chip .n { color: var(--accent); }
.cluster-chip .icon { width: 15px; height: 15px; color: var(--accent); margin-left: -1px; }

/* ---------- toast（左锚 snackbar：文本左、动作右，M3 解剖） ---------- */
.toast {
  position: fixed;
  left: 12px;
  bottom: var(--shelf-high);
  /* 左锚 + 内容自适应宽：短消息是药丸，长消息最多两行；上限让出右侧 FAB 列
     （routeBar 当年居中压 FAB 的教训，见 .route-bar 注释） */
  width: fit-content;
  max-width: min(calc(100vw - 88px), 420px);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(19, 24, 31, 0.9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  padding: 12px 16px;
  /* 23px ≈ 单行高度之半：单行自然成药丸（终于说上本 App 的设计语言）；
     两行时同值退化为大圆角矩形，与 --r-l 语言一致，无需 JS 量行数 */
  border-radius: 23px;
  z-index: var(--z-toast);
  box-shadow: var(--shadow-2);
  text-align: left;
  animation: toast-in 240ms var(--ease-out);
}
/* 退场 150ms（M3: 进场缓出、退场加速）。display:none 断头台式消失像故障 */
.toast.leaving { animation: toast-out 150ms cubic-bezier(0.4, 0, 1, 1) forwards; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(6px); }
}
.toast .t-msg { flex: 0 1 auto; min-width: 0; }
.toast button {
  flex: none;
  position: relative;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 13px;
  border-radius: 999px;
  padding: 7px 14px;
  /* 视觉小药丸（~33px）不撑高胶囊，热区由 ::before 扩到 ≥44px（routeBar ✕ 同款 idiom） */
  margin: -4px -6px -4px 0;
}
.toast button::before {
  content: "";
  position: absolute;
  inset: -8px;
}

/* ---------- 照片灯箱（sheet 之上、toast 之下） ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-lightbox);
  background: rgba(5, 8, 12, 0.96);
  animation: lb-in var(--t-fast) var(--ease-out);
}
@keyframes lb-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.lb-track {
  height: 100%;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.lb-track::-webkit-scrollbar { display: none; }
.lb-slide {
  flex: 0 0 100%;
  width: 100vw;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  scroll-snap-stop: always; /* 快速甩动也逐张停 */
}
.lb-slide img {
  max-width: 100vw;
  max-height: 100vh; /* iOS <15.4 dvh 兜底 */
  max-height: 100dvh;
  object-fit: contain;
}
.lb-top {
  position: absolute;
  top: calc(var(--safe-top) + 10px);
  left: 14px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none; /* 只有关闭按钮可点，不挡横滑 */
}
.lb-counter {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: rgba(10, 13, 17, 0.6);
  padding: 4px 10px;
  border-radius: 999px;
}
.lb-close {
  pointer-events: auto;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  border-radius: 50%;
  background: rgba(10, 13, 17, 0.6);
}
.lb-close .icon { width: 20px; height: 20px; }

/* ---------- Leaflet 控件 ---------- */
.leaflet-control-attribution {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 6px 0 0 0;
  color: #4b5763;
}
.leaflet-bottom.leaflet-right .leaflet-control-attribution { margin-right: 0; }

/* ---------- 窄屏（≤400px）：收紧顶栏，保三组控件一行 ---------- */
@media (max-width: 400px) {
  .view-toggle span { display: none; }
  .view-toggle { padding: 0 12px; }
  .brand { padding: 0 11px 0 10px; font-size: 13px; }
  .seg button { padding: 0 10px; font-size: 12.5px; }
}

/* 超窄屏（≤360px）：三城四按钮放不下时舍弃品牌名 */
@media (max-width: 360px) {
  .brand { display: none; }
  .seg { margin-left: 0; }
}

/* ---------- 晚间模式（18 点后 body.evening，app.js computeEveningMode） ----------
   chrome 随夜色沉一档、品牌金点亮起、浅色瓦片压暗——让"晚间模式"真的看得见。 */
body.evening::before {
  background: linear-gradient(to bottom, rgba(4, 6, 9, 0.72), rgba(4, 6, 9, 0));
}
body.evening .brand,
body.evening .seg,
body.evening .view-toggle,
body.evening .chip:not(.active) { background: rgba(11, 14, 19, 0.94); }
body.evening .fab { background: rgba(11, 14, 19, 0.96); }
/* toast/簇chip 同步沉一档：曾漏掉这层，夜里它们反而比邻居亮（impeccable 2026-08-02 P3） */
body.evening .toast { background: rgba(9, 12, 17, 0.88); }
body.evening .cluster-chip { background: rgba(11, 14, 19, 0.96); }
body.evening .brand::before {
  box-shadow: 0 0 4px rgba(245, 166, 35, 0.9), 0 0 14px rgba(245, 166, 35, 0.85);
}
/* 白天瓦片晚上刺眼：轻压亮度。只动瓦片层，marker/label 层不受影响 */
body.evening .leaflet-tile-pane { filter: brightness(0.84) saturate(0.96); }

/* ---------- 动效可及性 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .user-dot { animation: none; }
}
