/* 可爱风美食地图：奶油桃色 + 薄荷绿，圆滚滚的标记 */
:root {
  --peach: #ff8a7a;
  --peach-soft: #ffe3dc;
  --mint: #6fcfb0;
  --mint-soft: #dff6ee;
  --cream: #fffaf3;
  --ink: #4a3a3f;
  --ink-soft: #8a7a80;
  --line: #f1e2da;
  --shadow: 0 6px 18px rgba(120, 70, 60, .18);
  --font-cute: "ZCOOL KuaiLe", "Fredoka", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Nunito", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--font-body); color: var(--ink); background: var(--cream); overflow: hidden; }
button { font-family: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; }

#map { position: fixed; inset: 0; background: #fdf1e8; }
/* 让地图底图变得粉嫩一点 */
.leaflet-tile-pane { filter: saturate(1.35) hue-rotate(-8deg) brightness(1.04) contrast(.95); }
.leaflet-container { font-family: var(--font-body); }
.leaflet-control-attribution { font-size: 10px; background: rgba(255,250,243,.8) !important; border-radius: 8px 0 0 0; }

/* 顶部 */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000; pointer-events: none;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 10px;
}
.topbar > * { pointer-events: auto; }
.brand-row { display: flex; gap: 10px; align-items: center; }
.logo {
  font-family: var(--font-cute); font-size: 22px; background: #fff; padding: 8px 14px; border-radius: 20px;
  box-shadow: var(--shadow); white-space: nowrap; color: var(--peach); border: 2px solid var(--peach-soft);
}
.logo span { color: var(--mint); }
.search { flex: 1; min-width: 0; position: relative; }
.search input {
  width: 100%; border: 2px solid var(--peach-soft); background: #fff; border-radius: 20px; padding: 11px 14px 11px 38px;
  font: inherit; font-size: 15px; color: var(--ink); box-shadow: var(--shadow);
}
.search::before { content: "🔍"; position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 15px; }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border-radius: 16px; box-shadow: var(--shadow);
  overflow: hidden; max-height: 50vh; overflow-y: auto;
}
.search-results button {
  display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 14px; font-size: 14px; color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.search-results button:hover { background: var(--peach-soft); }
.search-results .hint { padding: 10px 14px; font-size: 13px; color: var(--ink-soft); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 2px solid #fff; background: rgba(255,255,255,.92); border-radius: 999px; padding: 6px 13px; font-size: 14px;
  box-shadow: 0 3px 10px rgba(120,70,60,.12); color: var(--ink); font-weight: 700;
}
.chip.on { background: var(--peach); color: #fff; border-color: var(--peach); }

/* 浮动按钮 */
.fabs {
  position: fixed; z-index: 1000; right: max(14px, env(safe-area-inset-right, 0px));
  bottom: calc(env(safe-area-inset-bottom, 0px) + 22px); display: flex; flex-direction: column; gap: 12px; align-items: flex-end;
  transition: bottom .3s ease;
}
@media (max-width: 759px) { body.sheet-open .fabs { display: none; } }
.fab {
  border: 0; border-radius: 999px; box-shadow: var(--shadow); background: #fff; font-size: 15px; font-weight: 800; color: var(--ink);
  padding: 12px 16px; display: flex; align-items: center; gap: 6px;
}
.fab.round { width: 50px; height: 50px; justify-content: center; padding: 0; font-size: 22px; }
.fab.primary { background: var(--mint); color: #fff; }
.fab.list { background: var(--peach); color: #fff; }

/* 地图标记 */
.pin { position: relative; width: 46px; height: 54px; }
.pin .bubble {
  position: absolute; left: 0; top: 0; width: 46px; height: 46px; border-radius: 50% 50% 50% 8px; transform: rotate(-45deg);
  background: #fff; border: 3px solid var(--peach); box-shadow: 0 5px 12px rgba(120,70,60,.28);
  display: grid; place-items: center; animation: pop .45s cubic-bezier(.3,1.6,.5,1) both;
}
.pin .bubble span { transform: rotate(45deg); font-size: 22px; line-height: 1; }
.pin.cat-cafe .bubble { border-color: #c9a27c; }
.pin.cat-noodle .bubble { border-color: #f5b942; }
.pin.cat-street .bubble { border-color: #f2789f; }
.pin.cat-dimsum .bubble { border-color: var(--mint); }
.pin.cat-local .bubble { border-color: var(--peach); }
.pin.active .bubble { background: var(--peach-soft); transform: rotate(-45deg) scale(1.15); }
.pin .tag {
  position: absolute; top: 50px; left: 50%; transform: translateX(-50%); white-space: nowrap; background: #fff; color: var(--ink);
  font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,.12);
  max-width: 120px; overflow: hidden; text-overflow: ellipsis;
}
@keyframes pop { from { transform: rotate(-45deg) scale(0); } to { transform: rotate(-45deg) scale(1); } }

.me { width: 26px; height: 26px; position: relative; }
.me .dot { position: absolute; inset: 5px; background: #5aa9ff; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.me .ring { position: absolute; inset: 0; border-radius: 50%; background: rgba(90,169,255,.35); animation: pulse 1.8s ease-out infinite; }
.me .label {
  position: absolute; top: -26px; left: 50%; transform: translateX(-50%); background: #5aa9ff; color: #fff; font-size: 11px; font-weight: 800;
  padding: 2px 8px; border-radius: 10px; white-space: nowrap;
}
@keyframes pulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(2.4); opacity: 0; } }

/* 底部卡片 */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100; background: #fff; border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 30px rgba(120,70,60,.2); max-height: 78vh; overflow-y: auto;
  padding: 10px max(18px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 20px) max(18px, env(safe-area-inset-left, 0px));
  transform: translateY(105%); transition: transform .32s cubic-bezier(.2,.9,.3,1);
}
.sheet.open { transform: translateY(0); }
@media (min-width: 760px) {
  .sheet { left: 16px; right: auto; width: 400px; bottom: 16px; border-radius: 24px; max-height: calc(100% - 150px); }
}
.grabber { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 10px; }
.sheet-close { position: absolute; top: 12px; right: 14px; border: 0; background: var(--peach-soft); color: var(--peach); width: 32px; height: 32px; border-radius: 50%; font-size: 16px; font-weight: 900; }
.sheet h2 { font-family: var(--font-cute); font-weight: 400; font-size: 24px; margin: 4px 40px 4px 0; text-wrap: balance; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.pill { background: var(--mint-soft); color: #2e8a6d; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; }
.pill.peach { background: var(--peach-soft); color: #d65a48; }
.pill.grey { background: #f3eeec; color: var(--ink-soft); }
.facts { display: grid; gap: 8px; margin: 0 0 14px; }
.fact { display: grid; grid-template-columns: 26px 1fr; gap: 6px; font-size: 14px; line-height: 1.45; }
.note { background: var(--cream); border-radius: 14px; padding: 10px 12px; font-size: 14px; line-height: 1.5; margin-bottom: 14px; }
.section-title { font-family: var(--font-cute); font-size: 17px; margin: 6px 0 8px; }
.links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.links a {
  text-decoration: none; text-align: center; border-radius: 14px; padding: 10px 4px; font-weight: 800; font-size: 13px; color: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.links a b { font-size: 18px; }
.l-xhs { background: #ff4d5e; } .l-ig { background: linear-gradient(135deg, #f9a03f, #e1306c 55%, #8a3ab9); } .l-tiktok { background: #222; }
.l-yt { background: #ff2a2a; } .l-fb { background: #1877f2; } .l-other { background: var(--ink-soft); }
.go {
  display: block; text-align: center; text-decoration: none; background: var(--mint); color: #fff; font-weight: 900; font-size: 15px;
  border-radius: 16px; padding: 13px; box-shadow: 0 4px 0 #4fae90;
}
.sample-note { font-size: 12px; color: var(--ink-soft); margin-top: 12px; }

/* 附近列表 */
.near-item {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; width: 100%; text-align: left;
  border: 0; background: none; padding: 10px 4px; border-bottom: 1px solid var(--line); color: var(--ink);
}
.near-item .em { width: 44px; height: 44px; border-radius: 14px; background: var(--peach-soft); display: grid; place-items: center; font-size: 22px; }
.near-item .nm { font-weight: 800; font-size: 15px; }
.near-item .sub { font-size: 12px; color: var(--ink-soft); }
.near-item .km { font-size: 12px; font-weight: 800; color: var(--peach); font-variant-numeric: tabular-nums; }

/* 表单 */
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 5px; font-size: 13px; font-weight: 800; }
.form input, .form select, .form textarea {
  font: inherit; font-size: 15px; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; color: var(--ink); background: #fff; width: 100%;
}
.form textarea { min-height: 70px; resize: vertical; }
.form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form .loc { background: var(--mint-soft); border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.5; }
.btn { border: 0; border-radius: 14px; padding: 12px; font-weight: 900; font-size: 15px; background: var(--peach); color: #fff; box-shadow: 0 4px 0 #e06a5a; }
.btn.ghost { background: var(--peach-soft); color: #d65a48; box-shadow: none; }
.done { text-align: center; padding: 20px 0; }
.done .big { font-size: 56px; }

.toast {
  position: fixed; top: calc(env(safe-area-inset-top, 0px) + 120px); left: 50%; transform: translateX(-50%); z-index: 1200;
  background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 700; box-shadow: var(--shadow);
  max-width: calc(100% - 32px); text-align: center;
}
.pick-banner {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -100%); z-index: 1050; pointer-events: none; font-size: 40px;
}
.pick-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1150; background: #fff; border-radius: 24px 24px 0 0; box-shadow: var(--shadow);
  padding: 16px max(18px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 16px) max(18px, env(safe-area-inset-left, 0px));
  display: grid; gap: 10px; text-align: center; font-weight: 800;
}
.pick-bar .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.tile-warn { pointer-events: none; position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 900; background: #fff; border-radius: 18px;
  padding: 16px 18px; box-shadow: var(--shadow); text-align: center; font-weight: 700; line-height: 1.6; width: min(320px, calc(100% - 32px)); }

/* 格子 */
.grid-cell { box-sizing: border-box; border-right: 1px dashed rgba(255,138,122,.35); border-bottom: 1px dashed rgba(255,138,122,.35); }
.food-cell { fill: #ff8a7a; fill-opacity: .14; stroke: #ff8a7a; stroke-opacity: .6; stroke-dasharray: 5 4; }
.cell-badge {
  width: 96px; height: 56px; border: 3px solid #fff; border-radius: 18px; background: var(--peach); color: #fff;
  box-shadow: 0 6px 14px rgba(120,70,60,.28); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-family: var(--font-body); animation: badgePop .4s cubic-bezier(.3,1.6,.5,1) both; cursor: pointer; padding: 0;
}
.cell-badge:hover { transform: scale(1.06); }
.cell-badge .ce { font-size: 18px; line-height: 1.1; letter-spacing: 1px; }
.cell-badge b { font-size: 13px; font-weight: 900; }
@keyframes badgePop { from { transform: scale(0); } to { transform: scale(1); } }
.zoom-cell { border: 0; cursor: pointer; font-family: inherit; }

/* 分享列表 */
.section-title small { font-family: var(--font-body); font-size: 13px; color: var(--ink-soft); }
.posts { display: grid; gap: 8px; margin-bottom: 14px; }
.post {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; text-decoration: none; color: var(--ink);
  background: var(--cream); border-radius: 14px; padding: 9px 12px;
}
.post:hover { background: var(--peach-soft); }
.post-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; color: #fff; }
.post-text { display: grid; gap: 1px; min-width: 0; }
.post-plat { font-size: 11px; font-weight: 900; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }
.post-title { font-size: 14px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-by { font-size: 12px; color: var(--ink-soft); }
.post-go { color: var(--peach); font-weight: 900; }
.yt-post { grid-template-columns: 1fr; padding: 8px; }
.yt-thumb { position: relative; border: 0; padding: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 16/9; background: #000; width: 100%; max-width: 100%; }
.yt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-thumb .play { position: absolute; inset: 0; margin: auto; width: 56px; height: 40px; border-radius: 12px; background: #ff2a2a; color: #fff; display: grid; place-items: center; font-size: 18px; }
.yt-frame { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 10px; display: block; }
.yt-post .post-plat { color: #fff; padding: 2px 8px; border-radius: 8px; justify-self: start; }
