:root {
  --ink: #17382e;
  --ink-2: #4b6a5f;
  --ink-3: #7d968c;
  --mint: #09af95;
  --mint-deep: #0d7d63;
  --card: #ffffff;
  --line: #e5eee8;
  --bg: #eef4ef;
  --shadow-s: 0 4px 13px rgba(24, 60, 48, 0.09);
  --shadow-m: 0 14px 34px rgba(23, 59, 48, 0.18);
  --shadow-l: 0 18px 46px rgba(23, 59, 48, 0.26);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft Yahei', sans-serif;
  color: var(--ink);
  background: #dfe8e2;
  display: flex; justify-content: center; align-items: center;
  overflow: hidden;
}
button { font: inherit; border: 0; background: none; cursor: pointer; color: inherit; }
input { font: inherit; }
.hidden { display: none !important; }

.phone {
  position: relative;
  width: min(100vw, 430px);
  height: min(100dvh, 910px);
  background: var(--bg);
  overflow: hidden;
  isolation: isolate;
  user-select: none;
}
@media (min-width: 470px) and (min-height: 940px) {
  .phone { height: 910px; border-radius: 34px; box-shadow: 0 26px 70px rgba(20, 55, 44, 0.28); }
}

/* ---------- 地图层 ---------- */
.mapLayer { position: absolute; inset: 0; z-index: 1; }
.mapLayer svg { width: 100%; height: 100%; display: block; }
.routeLayer { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.routeLayer svg { width: 100%; height: 100%; }
.shade {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, #f5faf6f2 0%, #f5faf6d9 15%, #f5faf633 27%, transparent 34%, transparent 58%, #eef6f0aa 100%);
}

/* ---------- 状态栏 & 顶部 ---------- */
.status {
  position: absolute; top: 16px; left: 24px; right: 24px; z-index: 20;
  display: flex; justify-content: space-between; font-size: 14px; font-weight: 800; letter-spacing: .2px;
}
.top { position: absolute; top: 48px; left: 16px; right: 16px; z-index: 21; }
.topRow { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.logo { font-size: 30px; font-weight: 950; letter-spacing: -2px; color: var(--ink); line-height: 1; }
.logo em { font-style: normal; color: var(--mint); }
.distanceBtn {
  background: #fff; border: 1px solid #edf1ef; border-radius: 15px;
  padding: 10px 12px; box-shadow: var(--shadow-s);
  font-size: 12px; font-weight: 800; display: flex; align-items: center; gap: 7px; min-height: 40px;
}
.distanceBtn .caret { font-size: 10px; color: var(--ink-3); }
.tabs { display: flex; gap: 8px; margin-top: 12px; }
.tab {
  border-radius: 30px; background: rgba(255, 255, 255, 0.92); color: #5b7a6d;
  padding: 11px 16px; font-weight: 850; font-size: 14px; box-shadow: var(--shadow-s); min-height: 42px;
}
.tab.active { background: #174f43; color: #fff; }
.tab .caret { font-size: 10px; opacity: .75; }

.dropdown {
  position: absolute; background: #fff; border-radius: 16px; padding: 7px;
  box-shadow: var(--shadow-m); z-index: 60; max-height: 340px; overflow: auto;
}
#themeMenu { top: 88px; left: 0; width: 210px; }
#rangeMenu { top: 44px; right: 0; width: 190px; }
.dropdown button {
  width: 100%; text-align: left; padding: 12px; border-radius: 10px;
  font-size: 13px; font-weight: 750; color: #35544b; min-height: 44px;
}
.dropdown button:hover, .dropdown button.on { background: #e9f7f1; }
.dropdown button.on { color: var(--mint-deep); }

.hint {
  position: absolute; top: 172px; left: 17px; z-index: 9;
  font-size: 10.5px; color: #8ba096; background: rgba(255,255,255,.62);
  padding: 4px 9px; border-radius: 10px; max-width: 190px; line-height: 1.4;
}

/* ---------- 地图控件 ---------- */
.mapCtrl { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 22; }
.mapCtrl button {
  width: 40px; height: 40px; background: #fff; border-radius: 13px;
  box-shadow: var(--shadow-s); font-size: 19px; color: #3a6155;
}

/* ---------- 出发点 ---------- */
.base {
  position: absolute; z-index: 8; transform: translate(-50%, -50%);
  width: 38px; height: 43px; cursor: pointer;
}
.base .drop {
  width: 38px; height: 43px; background: #3b94f7; border: 4px solid #fff;
  border-radius: 54% 54% 54% 8%; transform: rotate(-45deg);
  box-shadow: 0 4px 0 rgba(0,0,0,.06), 0 0 0 8px rgba(59,148,247,.18);
  display: grid; place-items: center; position: relative;
}
.base .drop span { transform: rotate(45deg); color: #fff; font-size: 17px; }
.base.pinnedBase .drop { background: #e2603f; box-shadow: 0 4px 0 rgba(0,0,0,.06), 0 0 0 8px rgba(226,96,63,.18); }
.base .pulse {
  position: absolute; width: 46px; height: 46px; border-radius: 50%;
  background: rgba(59,148,247,.22); animation: pulse 2.2s infinite ease-out; z-index: -1;
}
.base.pinnedBase .pulse { background: rgba(226,96,63,.22); }
@keyframes pulse { 0% { transform: scale(.6); opacity: .9 } 100% { transform: scale(2); opacity: 0 } }
.baseLabel {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  margin-top: 8px; font-size: 11px; font-weight: 900; color: #1f5f9e; white-space: nowrap;
  background: rgba(255,255,255,.9); padding: 2px 7px; border-radius: 9px; max-width: 150px;
  overflow: hidden; text-overflow: ellipsis; text-align: center;
}
.base.pinnedBase .baseLabel { color: #c0431f; }

/* ---------- POI 视频泡泡 ---------- */
.pins { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.pin {
  position: absolute; transform: translate(-50%, -50%); pointer-events: auto;
  display: block; cursor: pointer;
  transition: left .3s ease, top .3s ease;
}
.videoBox {
  position: relative; width: 46px; height: 82px; background: #9dc0ac;
  border: 2px solid #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 5px 15px rgba(33, 74, 58, .28);
  transition: width .32s ease, height .32s ease, border-radius .32s ease;
}
.pin.big .videoBox { width: 80px; height: 142px; border-radius: 16px; box-shadow: 0 10px 24px rgba(33, 74, 58, .38); }
.pin.big { z-index: 2; }
.catTag {
  position: absolute; top: 4px; left: 4px; padding: 3px 5px; border-radius: 7px;
  font-size: 8px; font-weight: 900; color: #fff; white-space: nowrap; z-index: 3;
  max-width: calc(100% - 8px); overflow: hidden; text-overflow: ellipsis;
}
.pin.big .catTag { font-size: 9px; padding: 4px 6px; }
.pinLabel {
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%) translateY(-2px);
  margin-top: 7px; color: #142a22; font-size: 12px; font-weight: 900; text-align: center;
  max-width: 132px; line-height: 1.25; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  -webkit-text-stroke: 3px #fff; paint-order: stroke fill;
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.pin.big .pinLabel { font-size: 13px; opacity: 1; transform: translateX(-50%) translateY(0); }
/* 贴近底部卡片时，地点名翻到泡泡上方，避免被卡片遮住 */
.pinLabel.label-up { top: auto; bottom: 100%; margin-top: 0; margin-bottom: 7px; }
.vClip {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block; z-index: 1; background: transparent;
}
.fullVideo .vClip { position: absolute; inset: 0; object-fit: cover; }
.videoArt { position: absolute; inset: 0; overflow: hidden; }
.videoArt .sky { position: absolute; inset: 0; }
.videoArt .sun {
  position: absolute; border-radius: 50%; background: #ffe8a3; box-shadow: 0 0 26px #ffe49e;
  animation: breathe 2.7s infinite alternate;
}
.videoArt .ground {
  position: absolute; left: -30%; right: -30%; height: 48%; bottom: -18%;
  border-radius: 50%; animation: floatbg 4s infinite alternate;
}
.videoArt .subject {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  filter: drop-shadow(0 5px 4px rgba(38, 84, 56, .18));
  animation: floatitem 3s infinite ease-in-out;
}
.videoArt .spark { position: absolute; animation: floatitem 2.4s infinite ease-in-out alternate; }
.progress { position: absolute; left: 3px; right: 3px; bottom: 4px; height: 2px; border-radius: 5px; background: rgba(255,255,255,.45); z-index: 3; }
.progress b { display: block; width: 0; height: 100%; background: #fff; border-radius: 5px; }
@keyframes floatitem { 0%,100% { transform: translate(-50%,-50%) translateY(4px) scale(1) } 50% { transform: translate(-50%,-50%) translateY(-6px) scale(1.07) } }
@keyframes floatbg { to { transform: translateX(-12%) rotate(5deg) } }
@keyframes breathe { to { opacity: .5; transform: scale(1.2) } }

.etaChip {
  position: absolute; z-index: 4; transform: translate(-50%, -50%);
  background: #123f37; color: #fff; border: 2px solid #fff; border-radius: 18px;
  padding: 5px 9px; white-space: nowrap; font-size: 11.5px; font-weight: 900;
  box-shadow: 0 3px 8px rgba(16, 56, 45, .18); letter-spacing: .2px;
}
.etaChip small { font-weight: 700; opacity: .8; }

/* ---------- 底部组合卡 ---------- */
.cards {
  position: absolute; bottom: 24px; left: 0; right: 0; z-index: 18;
  display: flex; gap: 11px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0 26px 6px; scrollbar-width: none; scroll-behavior: smooth;
}
.cards::-webkit-scrollbar { display: none; }
.card {
  flex: 0 0 calc(100% - 40px); scroll-snap-align: center;
  background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(12px);
  border: 1px solid #fff; border-radius: 24px; padding: 15px 15px 14px;
  box-shadow: var(--shadow-l); min-width: 0;
}
.card h2 { margin: 0 0 9px; font-size: 17px; line-height: 1.35; font-weight: 900; letter-spacing: -.3px; min-height: 46px; }
.cardTags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.ctag { font-size: 10px; font-weight: 850; border-radius: 7px; padding: 5px 7px; background: #e4f6ed; color: #0b8e73; }
.ctag:nth-child(2) { background: #fff1d9; color: #a16c20; }
.ctag:nth-child(3) { background: #e9ecff; color: #6361aa; }
.points { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.point {
  position: relative; min-width: 0; border: 1px solid #e4eee8; border-radius: 15px;
  background: #f7faf8; padding: 10px 10px 34px; min-height: 148px; text-align: left;
}
.point .phead { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 900; margin-bottom: 4px; }
.point .pname {
  font-size: 12px; font-weight: 900; line-height: 1.28; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.point .pcat { font-size: 9px; font-weight: 800; color: #6d8a7e; background: #eaf3ec; border-radius: 6px; padding: 2px 5px; }
.reason {
  background: #dff7e8; color: #146b50; border-radius: 9px; padding: 7px 8px;
  line-height: 1.42; font-size: 11px; font-weight: 750; min-height: 40px;
}
.facts { margin-top: 7px; font-size: 10px; color: #6a8177; line-height: 1.6; }
.facts .k { color: #96a89f; }
.swapBtn {
  position: absolute; left: 10px; bottom: 6px; font-size: 10px; font-weight: 800;
  color: #6b8a7d; background: #fff; border: 1px dashed #d6e5dc; border-radius: 8px;
  padding: 4px 6px; min-height: 24px;
}
.pinBtn {
  position: absolute; right: 8px; bottom: 5px; width: 34px; height: 32px;
  background: #fff; border: 1px solid #dcebe2; border-radius: 10px; display: grid; place-items: center;
}
/* 触摸热区扩展（可视尺寸不变，热区 ≥ 44px） */
.pinBtn::after, .swapBtn::after { content: ''; position: absolute; inset: -7px; }
.swapBtn { position: absolute; }
.pinBtn.set { background: #d3f5e3; border-color: #4ccba5; }
.cardActions { display: flex; gap: 9px; margin-top: 11px; }
.action { border-radius: 13px; padding: 11px 8px; font-size: 12px; font-weight: 850; background: #edf4ef; color: #385f50; min-height: 42px; }
.action.primary { flex: 1; background: var(--mint); color: #fff; }
.action.saved { background: #fff2d6; color: #a3701c; }

.emptyState {
  position: absolute; top: 42%; left: 8%; right: 8%; z-index: 19;
  background: #fffdfb; padding: 18px 16px; border-radius: 18px; text-align: center;
  font-size: 13px; color: #576e63; box-shadow: var(--shadow-m); line-height: 1.6;
}
.emptyState button {
  margin-top: 10px; background: var(--mint); color: #fff; border-radius: 12px;
  padding: 10px 16px; font-weight: 850; font-size: 12.5px; min-height: 42px;
}

.homebar { position: absolute; bottom: 9px; left: 50%; transform: translateX(-50%); width: 104px; height: 4px; background: #17372d; border-radius: 10px; z-index: 30; opacity: .85; }

/* ---------- 底部弹层 ---------- */
.overlay { position: absolute; inset: 0; background: rgba(16, 33, 27, .55); z-index: 40; display: flex; align-items: flex-end; }
.sheet { background: #fff; width: 100%; border-radius: 26px 26px 0 0; padding: 16px 18px 26px; box-shadow: 0 -8px 30px rgba(23, 39, 31, .18); max-height: 74%; overflow: auto; }
.sheetTop { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sheet h3 { margin: 0; font-size: 17.5px; font-weight: 900; }
.sheet .sub { font-size: 11px; color: #8ba096; margin-bottom: 8px; line-height: 1.5; }
.closeBtn { width: 34px; height: 34px; border-radius: 50%; background: #eef4ef; font-size: 20px; color: #486258; }
.sheet button.option {
  display: block; text-align: left; background: #f3f8f5; border-radius: 12px; padding: 13px;
  margin-top: 8px; width: 100%; color: #2d5144; font-weight: 800; font-size: 13px; min-height: 46px;
}
.sheet button.option.on { background: #e2f6ee; color: var(--mint-deep); box-shadow: inset 0 0 0 1.5px #4ccba5; }
.searchRow { display: flex; gap: 8px; margin: 10px 0 4px; }
.searchRow input {
  flex: 1; border: 1px solid #e2ece7; border-radius: 12px; padding: 11px 12px; font-size: 13px;
  background: #f7faf8; color: var(--ink); min-height: 44px; outline: none;
}
.sheet .note { font-size: 10.5px; color: #93a79d; margin-top: 10px; line-height: 1.6; }

.routeList { margin-top: 6px; }
.routeItem { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px dashed #e8efea; }
.routeItem:last-child { border-bottom: 0; }
.routeDot { width: 22px; height: 22px; border-radius: 50%; background: #e6f4ee; color: var(--mint-deep); font-size: 11px; font-weight: 900; display: grid; place-items: center; flex: 0 0 auto; }
.routeDot.base { background: #e8f1fd; color: #2f6fc4; }
.routeName { font-size: 13px; font-weight: 850; }
.routeMeta { font-size: 11px; color: #7d968c; margin-top: 2px; }

/* ---------- 全屏视频 ---------- */
.fullVideo { position: absolute; inset: 0; z-index: 50; overflow: hidden; background: #17323a; }
.fullVideo .videoArt { inset: 0; }
.fullVideo .videoArt .subject { font-size: 118px; }
.fullVideo .videoArt .sun { width: 92px; height: 92px; }
.vidTop {
  position: absolute; top: 46px; left: 18px; right: 18px; display: flex;
  justify-content: space-between; align-items: center; color: #fff; z-index: 3;
}
.vidTop .simBadge { font-size: 10.5px; font-weight: 800; background: rgba(0,0,0,.32); padding: 6px 10px; border-radius: 20px; }
.vidTop button { width: 38px; height: 38px; border-radius: 50%; background: rgba(0,0,0,.34); color: #fff; font-size: 20px; }
.vidInfo { position: absolute; bottom: 18px; left: 16px; right: 16px; color: #fff; z-index: 3; }
.creator { display: flex; align-items: center; gap: 9px; font-weight: 900; font-size: 14px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(120deg, #f9e4b0, #b3d6ed); border: 2px solid #fff; font-size: 19px;
}
.creator .friendTag { font-size: 10px; font-weight: 800; background: rgba(255,255,255,.22); padding: 3px 7px; border-radius: 10px; }
.description { margin: 10px 70px 12px 0; line-height: 1.5; font-size: 13px; text-shadow: 0 2px 5px rgba(0,0,0,.5); }
.poiSmall {
  display: flex; align-items: center; gap: 9px; background: rgba(255,255,255,.94);
  color: #26473c; border-radius: 14px; padding: 8px 10px; margin-right: 62px;
}
.poiSmall .thumb { width: 42px; height: 42px; border-radius: 10px; background: #dcead4; display: grid; place-items: center; font-size: 21px; flex: 0 0 auto; }
.poiSmall .nm { font-size: 12.5px; font-weight: 900; line-height: 1.3; }
.poiSmall .meta { font-size: 10px; color: #7c8f86; margin-top: 2px; }
.poiSmall .go { margin-left: auto; font-size: 18px; color: #8fa79b; }
.social { position: absolute; right: 14px; bottom: 120px; display: flex; flex-direction: column; gap: 17px; text-align: center; color: #fff; z-index: 3; }
.social button { color: #fff; font-size: 25px; text-shadow: 0 3px 5px rgba(0,0,0,.45); }
.social button.liked { color: #ff5a6e; }
.social label { display: block; font-size: 10px; font-weight: 800; margin-top: 2px; }
.vidProgress { position: absolute; bottom: 5px; left: 10px; right: 10px; height: 3px; background: rgba(255,255,255,.35); border-radius: 3px; z-index: 3; }
.vidProgress b { display: block; height: 100%; background: #fff; width: 0; border-radius: 3px; }
.vidWarn { position: absolute; top: 92px; left: 18px; font-size: 10px; color: rgba(255,255,255,.85); background: rgba(0,0,0,.28); padding: 5px 9px; border-radius: 12px; z-index: 3; }

/* ---------- Toast ---------- */
.toast {
  position: absolute; top: 196px; left: 50%; transform: translateX(-50%);
  background: rgba(23, 62, 51, .94); color: #fff; z-index: 70; border-radius: 20px;
  padding: 10px 14px; font-size: 12px; max-width: 86%; text-align: center; line-height: 1.45;
  box-shadow: var(--shadow-m); animation: toastIn .22s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(-6px) } }

/* ---------- 紧凑屏适配 ---------- */
@media (max-height: 830px), (max-width: 382px) {
  .videoBox { width: 42px; height: 75px; }
  .pin.big .videoBox { width: 72px; height: 128px; }
  .pinLabel { font-size: 11px; max-width: 106px; }
  .pin.big .pinLabel { font-size: 12px; max-width: 116px; }
  .etaChip { font-size: 11px; padding: 4px 8px; }
  .catTag { font-size: 7px; padding: 2px 4px; border-radius: 6px; }
  .pin.big .catTag { font-size: 8px; padding: 3px 5px; }
}
@media (max-height: 780px) {
  .cards { bottom: 16px; }
  .card { padding: 12px 12px 11px; border-radius: 20px; }
  .card h2 { font-size: 15.5px; min-height: 40px; margin-bottom: 7px; }
  .point { min-height: 118px; padding: 8px 8px 30px; }
  .reason { font-size: 10px; min-height: 34px; }
  .facts { font-size: 9px; }
  .hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001s !important; transition-duration: .001s !important; }
}
