/* 村口生活 · 用户端探索地图（布局专属，token 来自 theme.css）
   地图为主体，浅色统一控件，选中商户底部可收起信息面板。 */

.phone { width: 100%; max-width: 560px; height: 100vh; height: 100dvh; min-height: 600px; margin: auto; display: grid; grid-template-rows: auto minmax(300px, 1fr) auto; background: var(--paper); overflow: hidden; position: relative; }

/* 顶部（浅色，统一控件） */
.top { background: var(--card); border-bottom: 1px solid var(--line); padding: 12px 14px 0; z-index: 500; }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 18px; font-weight: 800; color: var(--ink); }
.brand small { display: block; font-weight: 400; font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.seal { display: grid; place-items: center; width: 34px; height: 38px; background: var(--accent); color: var(--on-accent); border-radius: 9px 9px 13px 4px; font-size: 22px; font-weight: 800; flex-shrink: 0; }
.overview { border: 1px solid var(--line-strong); background: var(--card); border-radius: 999px; padding: 8px 12px; font-size: 12px; color: var(--ink-2); }
.locate-btn { border: 1px solid var(--line-strong); background: var(--card); border-radius: 999px; padding: 8px 12px; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.search-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 12px; }
.search input { width: 100%; height: 40px; min-width: 0; background: transparent; color: var(--ink); border: 0; outline: 0; font-size: 15px; }
.search input::placeholder { color: var(--placeholder); }
.search > span:last-child { font-size: 20px; color: var(--ink-3); }
.filter-entry { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line-strong); background: var(--card); border-radius: 999px; padding: 8px 13px; font-size: 13px; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
#filter-dot { color: var(--accent-strong); font-size: 12px; }

/* 地图主体 */
.map-stage { position: relative; isolation: isolate; overflow: hidden; min-height: 0; }
#map { height: 100%; width: 100%; background: var(--bg-2); }
#amap { position: absolute; inset: 0; height: 100%; width: 100%; background: var(--bg-2); visibility: hidden; }
.map-stage.show-real #map { visibility: hidden; }
.map-stage.show-real #amap { visibility: visible; }
.leaflet-image-layer { image-rendering: pixelated; }
.map-hud { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 450; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; pointer-events: none; }
.passport, .mode { pointer-events: auto; background: var(--card); border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm); border-radius: 12px; }
.passport { display: flex; align-items: center; gap: 7px; padding: 7px 10px; }
.passport b { font-size: 18px; color: var(--accent-strong); }
.passport span { font-size: 11px; color: var(--ink-2); }
.passport strong { font-size: 11px; display: block; margin-top: 2px; color: var(--ink); }
.mode { display: flex; padding: 3px; gap: 2px; }
.mode button { padding: 8px 7px; background: transparent; font-size: 11px; border-radius: 10px; white-space: nowrap; color: var(--ink-2); }
.mode button[aria-pressed="true"] { background: var(--charcoal); color: var(--on-charcoal); font-weight: 600; }
.map-note { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; padding: 4px 6px; z-index: 450; pointer-events: none; font-size: 10px; background: rgba(255,254,250,.85); color: var(--ink-3); }
.leaflet-control-zoom { border: 1px solid var(--line-strong) !important; box-shadow: var(--shadow-sm) !important; margin-bottom: 56px !important; }
.leaflet-control-zoom a { background: var(--card) !important; color: var(--ink) !important; width: 34px !important; height: 34px !important; line-height: 34px !important; }
.leaflet-control-attribution { font-size: 9px !important; background: rgba(255,254,250,.85) !important; }

/* 标记（地理锚点准确，选中态杏橙） */
.village-pin { border: 0; background: transparent; }
.village-pin span { display: block; width: 66px; text-align: center; white-space: nowrap; background: var(--card); border: 1px solid var(--line-strong); padding: 3px 7px; color: var(--ink); font-weight: 700; font-size: 12px; border-radius: 10px; }
.shop-pin { border: 0 !important; background: transparent !important; }
.shop-pin .pin-face { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--charcoal); color: #fff; font-weight: 700; font-size: 14px; box-shadow: var(--shadow-sm); }
.shop-pin .pin-face i { font-style: normal; margin-left: 1px; }
.shop-pin.selected .pin-face { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* 底部面板（列表 + 选中商户信息） */
.sheet { position: relative; z-index: 500; background: var(--card); border-top: 1px solid var(--line); padding: 10px 14px; padding-bottom: max(10px, calc(env(safe-area-inset-bottom) + 60px)); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.goto-list { font-size: 12px; color: var(--accent-strong); text-decoration: none; margin-left: auto; margin-right: 10px; font-weight: 600; }
.sheet h1 { font-size: 16px; margin: 0; font-weight: 800; }
.sheet-head button { font-size: 12px; background: transparent; color: var(--accent-strong); padding: 6px 0 6px 8px; }
.sheet-head button span { display: inline-block; background: var(--accent-soft); color: var(--accent-strong); padding: 1px 7px; border-radius: 999px; margin-left: 4px; }
.summary { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 1px dashed var(--line-strong); background: var(--bg); border-radius: 12px; padding: 11px 14px; margin-top: 8px; font-size: 13px; color: var(--ink-2); text-align: left; }
.summary-chev { color: var(--ink-3); font-size: 14px; }
.filters { display: flex; gap: 5px; overflow: auto; scrollbar-width: none; padding: 8px 0; }
.filters button { flex-shrink: 0; border: 1px solid var(--line-strong); background: var(--card); padding: 7px 12px; font-size: 13px; border-radius: 999px; color: var(--ink-2); }
.filters button[aria-pressed="true"] { background: var(--charcoal); border-color: var(--charcoal); color: var(--on-charcoal); }

/* 选中商户信息面板（可收起） */
#info .info-head { display: flex; align-items: center; gap: 10px; }
.info-photo { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; flex-shrink: 0; background: var(--bg-2); display: grid; place-items: center; color: var(--ink-3); font-size: 12px; font-weight: 700; }
.info-title { flex: 1; min-width: 0; }
.store-name { font-size: 16px; font-weight: 800; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-meta { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.info-collapse { border: 0; background: transparent; font-size: 18px; color: var(--ink-3); min-width: 40px; min-height: 40px; }
.info-back { border: 0; background: var(--bg-2); border-radius: 10px; font-size: 16px; color: var(--ink-2); min-width: 36px; min-height: 36px; flex-shrink: 0; }
.info-body { margin-top: 10px; }
#info.collapsed .info-body { display: none; }
.store-desc { font-size: 12px; color: var(--ink-3); margin: 0 0 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.stamp { font-size: 11px; background: var(--accent-soft); color: var(--accent-strong); border: 0; padding: 6px 10px; border-radius: 999px; margin-bottom: 8px; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.actions .btn { min-height: 44px; font-size: 14px; padding: 0 6px; }

/* 门店列表（可展开，覆盖在地图上） */
.store-list { position: absolute; bottom: 100%; left: 10px; right: 10px; max-height: min(42dvh, 320px); overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px 16px 0 0; padding: 6px; box-shadow: 0 -5px 18px rgba(38,38,34,.08); }
.store-row { display: flex; align-items: center; text-align: left; gap: 10px; width: 100%; background: transparent; border-radius: 12px; border: 0; padding: 10px; }
.store-row[aria-pressed="true"] { background: var(--accent-soft); }
.store-symbol { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--bg-2); color: var(--ink-2); font-size: 14px; font-weight: 700; flex-shrink: 0; }
.store-row strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-row small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 1px; }
.store-row > span:last-child { margin-left: auto; font-size: 12px; color: var(--ink-2); white-space: nowrap; }

/* 停车盒 */
.parking-box { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.parking-box h3 { font-size: 13px; margin: 0 0 6px; }
.parking-item { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.parking-item:last-child { border-bottom: 0; }
.parking-item small { color: var(--ink-3); }
.parking-item a { color: var(--accent-strong); font-weight: 600; text-decoration: none; white-space: nowrap; }

.empty { color: var(--ink-3); font-size: 13px; text-align: center; padding: 16px; }

.phone > * { min-width: 0; }

@media (min-width: 600px) {
  .phone { margin: 16px auto; height: calc(100dvh - 32px); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-md); }
}
@media (max-width: 360px) {
  .top { padding-left: 12px; padding-right: 12px; }
  .sheet { padding-left: 12px; padding-right: 12px; }
  .passport { gap: 4px; padding: 5px 7px; }
  .mode button { font-size: 11px; padding: 8px 6px; }
  .brand { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
  .leaflet-zoom-animated { transition: none !important; }
}

/* 筛选弹层 */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(38,38,34,.4); z-index: 900; display: flex; align-items: flex-end; justify-content: center; }
.fsheet { width: 100%; max-width: 560px; background: var(--card); border-radius: 20px 20px 0 0; max-height: 70vh; display: flex; flex-direction: column; animation: fsheet-up .18s ease; }
@keyframes fsheet-up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.fsheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; }
.fsheet-head h2 { margin: 0; font-size: 17px; }
.fsheet-close { border: 0; background: transparent; font-size: 22px; color: var(--ink-2); min-width: 44px; min-height: 44px; }
.fsheet-body { padding: 4px 16px 20px; overflow: auto; }
.f-label { margin: 12px 0 8px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .chip { border: 1px solid var(--line-strong); background: var(--card); color: var(--ink-2); border-radius: 999px; min-height: 44px; padding: 0 16px; font-size: 14px; font-weight: 600; }
.chips .chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-strong); }

/* 地图加载/重试卡片固定在地图内部，避免被画布和底部列表覆盖。 */
#map-loading:not([hidden]) { position:absolute; z-index:480; top:42%; left:50%; transform:translate(-50%,-50%); width:max-content; max-width:calc(100% - 40px); padding:16px; border:1px solid var(--line); border-radius:14px; background:var(--card); box-shadow:var(--shadow-sm); text-align:center; }
#map-loading-text { display:block; }
#map-retry:not([hidden]) { display:block; margin:12px auto 0; min-height:44px; padding:8px 24px; border:0; border-radius:10px; background:var(--accent, #efa56f); color:var(--ink); font:inherit; cursor:pointer; }

/* 地图锚点先展示信息；门店照片/名称作为明确的详情入口。 */
.info-merchant { display:flex; align-items:center; gap:10px; flex:1; min-width:0; color:inherit; text-decoration:none; min-height:48px; }
.info-merchant.info-title { display:block; }
.info-merchant:focus-visible { outline:2px solid var(--accent-strong); outline-offset:3px; border-radius:8px; }
.info-detail-hint { font-size:12px; color:var(--ink-3); font-weight:400; white-space:nowrap; }
