:root {
  color-scheme: light;
  --bg: #c8c8c5;
  --ink: #111723;
  --muted: #586274;
  --panel: rgba(247, 249, 253, 0.96);
  --panel-line: rgba(17, 23, 35, 0.08);
  --accent: #1f7cff;
  --shadow: 0 28px 56px rgba(17, 23, 35, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

body.has-wechat-modal {
  overflow: hidden;
}

.map-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  padding: 10px 12px 0;
  background: transparent;
  pointer-events: none;
}

.map-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 10px 12px;
  border: 1px solid rgba(17, 23, 35, 0.08);
  border-radius: 24px;
  background: rgba(247, 249, 253, 0.92);
  box-shadow: 0 18px 36px rgba(17, 23, 35, 0.12);
  pointer-events: auto;
}

.map-topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.map-topbar__mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(17, 23, 35, 0.08);
  color: #2c241c;
  font-size: 1rem;
  font-weight: 800;
}

.map-topbar__mark.is-logo {
  padding: 6px;
}

.map-topbar__mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.map-topbar__copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.map-topbar__copy strong {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.1;
}

.map-topbar__hint {
  color: #cb2d21;
  font-size: 0.78rem;
  line-height: 1.3;
  font-weight: 700;
}

.map-topbar__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(17, 23, 35, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-weight: 700;
}

.map-topbar__link.is-primary {
  border-color: transparent;
  background: linear-gradient(135deg, #b76d38, #8b4718);
  color: #fff8f2;
  box-shadow: 0 12px 24px rgba(139, 71, 24, 0.22);
}

button,
input,
textarea,
select {
  font: inherit;
}

.map-page {
  width: 100%;
  overflow-x: hidden;
}

.map-frame {
  position: relative;
  width: 230vw;
  margin: 0;
  left: 50%;
  transform: translateX(-50%);
  max-width: none;
  background: var(--bg);
}

.map-image {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.hotspot-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.zone-label-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.zone-label-group {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: min(52vw, 320px);
}

.zone-label-group.has-note {
  flex-direction: column;
  align-items: flex-start;
}

.zone-label {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 24px rgba(17, 23, 35, 0.16);
  color: #162031;
  font-size: clamp(11px, 1.5vw, 14px);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.zone-label__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.zone-label__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.34);
}

.zone-label--note {
  color: #8b4718;
  font-size: clamp(9px, 1.1vw, 11px);
  font-weight: 800;
  line-height: 1.3;
  white-space: normal;
  word-break: break-all;
  max-width: min(24vw, 132px);
  padding: 6px 10px;
}

.zone-label-group.is-top-left,
.zone-label.is-top-left {
  transform: translate(-100%, -100%);
}

.zone-label-group.is-top-center,
.zone-label.is-top-center {
  transform: translate(-50%, -100%);
}

.zone-label-group.is-top-right,
.zone-label.is-top-right {
  transform: translate(0, -100%);
}

.zone-label-group.is-center-left,
.zone-label.is-center-left {
  transform: translate(-100%, -50%);
}

.zone-label-group.is-center-center,
.zone-label.is-center-center {
  transform: translate(-50%, -50%);
}

.zone-label-group.is-center-right,
.zone-label.is-center-right {
  transform: translate(0, -50%);
}

.zone-label-group.is-bottom-left,
.zone-label.is-bottom-left {
  transform: translate(-100%, 0);
}

.zone-label-group.is-bottom-center,
.zone-label.is-bottom-center {
  transform: translate(-50%, 0);
}

.zone-label-group.is-bottom-right,
.zone-label.is-bottom-right {
  transform: translate(0, 0);
}

.zone-label--green {
  color: #237445;
}

.zone-label--peach {
  color: #ba6a37;
}

.zone-label--purple {
  color: #7f4ab7;
}

.zone-label--orange {
  color: #b56a00;
}

.zone-label--yellow {
  color: #8d7214;
}

.zone-label--blue {
  color: #315db5;
}

.hotspot {
  position: absolute;
  padding: 0;
  border: 0;
  border-radius: var(--hotspot-radius, 8px);
  background: transparent;
  appearance: none;
  cursor: pointer;
  touch-action: manipulation;
  overflow: visible;
  isolation: isolate;
  will-change: transform, opacity;
}

.hotspot::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: inherit;
  border: 1.5px solid var(--hotspot-outline);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.18) inset,
    0 0 12px var(--hotspot-glow-soft),
    0 0 22px var(--hotspot-glow-soft);
  opacity: 0.58;
  animation: hotspot-pulse 1.8s ease-in-out infinite;
  animation-delay: var(--pulse-delay, 0s);
}

.hotspot::after {
  content: "";
  position: absolute;
  inset: -2px;
  border: 2px solid var(--hotspot-outline);
  border-radius: inherit;
  background: var(--hotspot-fill);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.22) inset,
    0 0 14px var(--hotspot-glow-soft),
    0 0 24px var(--hotspot-glow-strong);
  opacity: 0.88;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease,
    transform 160ms ease;
  animation: hotspot-glow 1.8s ease-in-out infinite;
  animation-delay: var(--pulse-delay, 0s);
}

.hotspot:focus-visible {
  outline: none;
}

.hotspot.is-disabled {
  cursor: default;
}

.hotspot.is-disabled::before,
.hotspot.is-disabled::after {
  animation: none;
  opacity: 0.42;
}

.hotspot.is-signed::before {
  animation: hotspot-pulse 1.12s ease-in-out infinite;
  border-color: rgba(255, 227, 227, 0.96);
  box-shadow:
    0 0 14px rgba(228, 58, 71, 0.34),
    0 0 26px rgba(228, 58, 71, 0.26);
}

.hotspot.is-signed::after {
  animation: hotspot-glow 1.12s ease-in-out infinite;
  border-color: rgba(211, 31, 46, 0.98);
  background: rgba(255, 95, 109, 0.34);
  box-shadow:
    0 0 0 1px rgba(255, 240, 240, 0.48) inset,
    0 0 14px rgba(228, 58, 71, 0.34),
    0 0 24px rgba(228, 58, 71, 0.28);
}

.hotspot.is-signed:focus-visible::after,
.hotspot.is-signed.is-active::after {
  border-color: rgba(200, 22, 39, 1);
  background: rgba(255, 82, 98, 0.4);
  box-shadow:
    0 0 0 1px rgba(255, 244, 244, 0.56) inset,
    0 0 0 4px rgba(255, 117, 129, 0.26),
    0 0 24px rgba(227, 48, 63, 0.48),
    0 0 34px rgba(227, 48, 63, 0.36);
}

.hotspot:focus-visible::after,
.hotspot.is-active::after {
  border-color: var(--hotspot-stroke);
  background: var(--hotspot-fill);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.52) inset,
    0 0 0 4px var(--hotspot-glow-soft),
    0 0 24px var(--hotspot-glow-strong),
    0 0 36px var(--hotspot-glow-strong);
  opacity: 1;
  transform: scale(1.1);
}

.hotspot--green {
  --hotspot-stroke: rgba(38, 162, 79, 0.95);
  --hotspot-outline: rgba(202, 255, 216, 0.9);
  --hotspot-fill: rgba(98, 233, 127, 0.3);
  --hotspot-glow-soft: rgba(98, 233, 127, 0.42);
  --hotspot-glow-strong: rgba(98, 233, 127, 0.82);
}

.hotspot--peach {
  --hotspot-stroke: rgba(227, 136, 94, 0.95);
  --hotspot-outline: rgba(255, 230, 217, 0.92);
  --hotspot-fill: rgba(255, 183, 144, 0.32);
  --hotspot-glow-soft: rgba(255, 183, 144, 0.44);
  --hotspot-glow-strong: rgba(255, 183, 144, 0.82);
}

.hotspot--purple {
  --hotspot-stroke: rgba(154, 100, 205, 0.96);
  --hotspot-outline: rgba(239, 225, 255, 0.92);
  --hotspot-fill: rgba(202, 150, 233, 0.3);
  --hotspot-glow-soft: rgba(202, 150, 233, 0.42);
  --hotspot-glow-strong: rgba(202, 150, 233, 0.82);
}

.hotspot--orange {
  --hotspot-stroke: rgba(220, 137, 0, 0.96);
  --hotspot-outline: rgba(255, 236, 205, 0.92);
  --hotspot-fill: rgba(255, 196, 89, 0.32);
  --hotspot-glow-soft: rgba(255, 196, 89, 0.44);
  --hotspot-glow-strong: rgba(255, 196, 89, 0.84);
}

.hotspot--yellow {
  --hotspot-stroke: rgba(186, 152, 42, 0.96);
  --hotspot-outline: rgba(255, 243, 198, 0.92);
  --hotspot-fill: rgba(255, 222, 126, 0.28);
  --hotspot-glow-soft: rgba(255, 222, 126, 0.42);
  --hotspot-glow-strong: rgba(255, 222, 126, 0.78);
}

.hotspot--blue {
  --hotspot-stroke: rgba(74, 124, 214, 0.96);
  --hotspot-outline: rgba(222, 236, 255, 0.92);
  --hotspot-fill: rgba(143, 181, 245, 0.28);
  --hotspot-glow-soft: rgba(143, 181, 245, 0.42);
  --hotspot-glow-strong: rgba(143, 181, 245, 0.8);
}

@keyframes hotspot-pulse {
  0%,
  100% {
    opacity: 0.44;
    transform: scale(0.98);
  }

  50% {
    opacity: 0.98;
    transform: scale(1.14);
  }
}

@keyframes hotspot-glow {
  0%,
  100% {
    opacity: 0.78;
    transform: scale(1);
  }

  50% {
    opacity: 0.92;
    transform: scale(1.08);
  }
}

.stall-card {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 40;
  width: min(430px, calc(100vw - 14px));
  max-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px);
  overflow: hidden;
  padding: 6px 12px calc(12px + env(safe-area-inset-bottom));
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-50%, calc(100% + 24px), 0);
  transition:
    opacity 180ms ease,
    transform 220ms ease;
  overscroll-behavior: contain;
}

.stall-card.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(-50%, 0, 0);
}

.stall-card__grabber {
  width: 44px;
  height: 5px;
  margin: 3px auto 8px;
  border-radius: 999px;
  background: rgba(96, 106, 120, 0.24);
}

.stall-card__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stall-card__badge {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(31, 124, 255, 0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.stall-card__close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(220, 225, 233, 0.92);
  color: #3b4554;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.stall-card__title {
  margin: 8px 0 4px;
  font-size: 20px;
  line-height: 1.1;
}

.stall-card__subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.stall-card__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.stall-card__item {
  padding: 10px 9px;
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  background: rgba(237, 240, 245, 0.82);
}

.stall-card__item.is-signed {
  border-color: rgba(220, 53, 69, 0.28);
  background: linear-gradient(180deg, rgba(255, 241, 242, 0.96) 0%, rgba(255, 231, 234, 0.92) 100%);
  box-shadow: 0 10px 24px rgba(220, 53, 69, 0.12);
}

.stall-card__item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.stall-card__item strong {
  display: block;
  margin-top: 5px;
  font-size: 14px;
  line-height: 1.25;
  word-break: break-word;
}

.stall-card__item.is-signed strong {
  color: #c21f32;
}

.stall-card__meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(248, 233, 187, 0.62) 0%, rgba(244, 235, 204, 0.82) 100%);
  color: #2b240a;
  font-size: 11px;
}

.stall-card__meta div {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stall-card__meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stall-card__meta-row--contact {
  flex-wrap: wrap;
}

.stall-card__meta strong {
  font-weight: 700;
}

.stall-card__wechat-button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(62, 120, 234, 0.14);
  color: #2f68d5;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.stall-card__features {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.stall-card__features li {
  padding: 7px 10px;
  border: 1px solid rgba(17, 23, 35, 0.08);
  border-radius: 999px;
  background: rgba(245, 247, 251, 0.96);
  font-size: 12px;
  line-height: 1.25;
}

.stall-card__note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.stall-card__button {
  margin-top: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(90deg, #3e78ea 0%, #52abee 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.stall-card__button:disabled {
  background: linear-gradient(90deg, #a7b6d4 0%, #b7c8dc 100%);
  cursor: default;
}

.stall-card__button.is-signed:disabled {
  background: linear-gradient(90deg, #d93246 0%, #f05769 100%);
  color: #fff7f8;
  box-shadow: 0 14px 32px rgba(217, 50, 70, 0.24);
}

.wechat-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.wechat-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(17, 23, 35, 0.42);
}

.wechat-modal__dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  gap: 14px;
  width: min(360px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow-y: auto;
  padding: 22px 18px 20px;
  border-radius: 24px;
  background: rgba(251, 252, 255, 0.98);
  box-shadow: 0 24px 48px rgba(17, 23, 35, 0.24);
  transform: translate(-50%, -50%);
}

.wechat-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(17, 23, 35, 0.08);
  color: #3b4554;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.wechat-modal__title {
  margin: 0;
  padding-right: 40px;
  font-size: 20px;
  line-height: 1.2;
}

.wechat-modal__image {
  display: block;
  width: min(100%, 280px);
  max-height: min(62vh, 420px);
  height: auto;
  margin: 0 auto;
  border-radius: 18px;
  background: #fff;
  object-fit: contain;
}

.wechat-modal__note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

@media (min-width: 768px) {
  .map-frame {
    width: min(720px, 100vw);
    margin: 0 auto;
    left: auto;
    transform: none;
  }

  .stall-card {
    width: min(440px, calc(100vw - 28px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .hotspot::before,
  .hotspot::after {
    animation: none;
  }
}

@media (max-width: 640px) {
  .map-topbar {
    padding: 10px 10px 0;
  }

  .map-topbar__inner {
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
  }

  .map-topbar__brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  .map-topbar__link {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.92rem;
  }
}
