:root {
  color: #222;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
  --brand: #14b2b5;
  --shadow: 0 8px 30px rgba(28, 48, 58, 0.14);
}

* { box-sizing: border-box; }
html, body, .page-shell { width: 100%; height: 100%; margin: 0; overflow: hidden; }
button, a { font: inherit; -webkit-tap-highlight-color: transparent; }
.page-shell { position: relative; background: #edf1f2; }
.map { position: absolute; inset: 0; }

.map-header {
  position: absolute;
  z-index: 20;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}

.floating-button {
  border: 0;
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.map-header button { pointer-events: auto; }
.location-button {
  min-width: 142px;
  height: 52px;
  padding: 0 15px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #555;
  cursor: pointer;
}
.location-button svg { width: 23px; height: 23px; fill: none; stroke: var(--brand); stroke-width: 2; }
.location-button span:not(.chevron) { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chevron { margin-left: auto; color: #999; font-size: 24px; transform: rotate(90deg); }

.recenter-button {
  position: absolute;
  z-index: 10;
  right: 16px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.recenter-button svg { width: 24px; height: 24px; fill: none; stroke: #555; stroke-width: 2; }

/* 高德控件与当前位置按钮形成稳定的右下角纵向控件组 */
.amap-toolbar {
  right: 16px !important;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 112px) !important;
}
.amap-scalecontrol {
  left: 12px !important;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 24px) !important;
}

@media (max-width: 480px) {
  .recenter-button {
    right: 14px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  }
  .amap-toolbar {
    right: 14px !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 108px) !important;
  }
}

.current-location { width: 24px; height: 24px; padding: 6px; border-radius: 50%; background: rgba(20,178,181,.22); }
.current-location span { display: block; width: 12px; height: 12px; border: 2px solid white; border-radius: 50%; background: var(--brand); box-shadow: 0 1px 5px rgba(0,0,0,.25); }

.store-marker {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 52px;
  height: 58px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.store-marker img {
  display: block;
  width: 35px;
  height: 43px;
  object-fit: contain;
  filter: drop-shadow(0 4px 5px rgba(22,44,55,.26));
  pointer-events: none;
}

.cluster-marker {
  display: grid;
  place-items: center;
  padding: 0;
  border: 3px solid rgba(255,255,255,.94);
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 4px 14px rgba(20,91,96,.3);
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.loading {
  position: absolute;
  z-index: 40;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 10px;
  background: rgba(24,34,38,.82);
  color: white;
  font-size: 14px;
  transition: opacity .2s;
}
.loading.hidden { opacity: 0; pointer-events: none; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.35); border-top-color: white; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: absolute;
  z-index: 60;
  left: 50%; bottom: 90px;
  max-width: calc(100% - 40px);
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(25,30,32,.88);
  color: white;
  font-size: 13px;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: .2s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.sheet-mask { position: absolute; z-index: 29; inset: 0; background: rgba(0,0,0,.18); }
.store-sheet {
  position: absolute;
  z-index: 30;
  left: 0; right: 0; bottom: 0;
  padding: 10px 20px calc(env(safe-area-inset-bottom, 0px) + 16px);
  border-radius: 18px 18px 0 0;
  background: white;
  box-shadow: 0 -8px 35px rgba(26,47,56,.15);
  transform: translateY(105%);
  transition: transform .28s ease;
}
.store-sheet.open { transform: translateY(0); }
.sheet-handle { width: 38px; height: 4px; margin: 0 auto 16px; border-radius: 4px; background: #d9dee0; }
.close-button { position: absolute; right: 13px; top: 12px; width: 36px; height: 36px; border: 0; background: transparent; color: #999; font-size: 25px; cursor: pointer; }
.store-sheet h1 { margin: 0 36px 8px 0; font-size: 18px; font-weight: 600; line-height: 1.45; }
.store-details { margin: 0; }
.store-details div { padding: 12px 0; border-bottom: 1px solid #edf0f1; }
.store-details dt { margin-bottom: 5px; color: #888; font-size: 13px; }
.store-details dd { margin: 0; color: #333; font-size: 15px; line-height: 1.45; }
.sheet-actions { display: flex; margin-top: 16px; }
.action-button {
  flex: 1;
  height: 48px;
  border: 0;
  background: white;
  color: var(--brand);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
}
.action-button + .action-button { border-left: 1px solid #edf0f1; }
.action-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.action-button.disabled { color: #aaa; }

@media (min-width: 760px) {
  .store-sheet { left: 50%; right: auto; bottom: 24px; width: 440px; border-radius: 18px; transform: translate(-50%, calc(105% + 24px)); }
  .store-sheet.open { transform: translate(-50%, 0); }
}
