:root {
  --map-panel: #f7fafc;
  --map-shadow: 0 22px 60px rgba(18, 58, 91, .11);
}

.primary-nav > a[aria-current="page"] {
  color: var(--brand-dark);
}

.primary-nav > a[aria-current="page"]::after {
  transform: scaleX(1);
}

.map-heading {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 82% 16%, rgba(0, 160, 233, .14), transparent 28%),
    linear-gradient(135deg, #f7fbfd, #edf6fa 54%, #f8fbfd);
}

.map-heading::after {
  content: "";
  position: absolute;
  right: 8%;
  bottom: -95px;
  width: 330px;
  height: 190px;
  border: 1px solid rgba(0, 160, 233, .13);
  border-radius: 50%;
  transform: rotate(-12deg);
  pointer-events: none;
}

.map-heading__inner {
  min-height: 208px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  align-items: end;
  gap: 50px;
  padding-top: 44px;
  padding-bottom: 38px;
}

.map-heading .eyebrow {
  margin-bottom: 12px;
}

.map-heading h1 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: clamp(32px, 4vw, 54px);
  font-weight: 680;
  line-height: 1.12;
  letter-spacing: -.045em;
}

.map-heading__inner > div > p:last-child {
  max-width: 690px;
  margin: 0;
  color: var(--body);
  font-size: 15px;
  line-height: 1.8;
}

.map-data-note {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 6px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, .88);
  border-radius: 15px;
  color: #557183;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 12px 30px rgba(27, 77, 104, .07);
  backdrop-filter: blur(12px);
  font-size: 12px;
  line-height: 1.7;
}

.map-data-note span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-size: 11px;
}

.map-workspace {
  width: min(1440px, calc(100% - 40px));
  margin: 24px auto 64px;
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.map-sidebar,
.map-stage {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.map-sidebar {
  overflow: hidden;
}

.map-filters {
  padding: 24px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(239, 248, 252, .76), transparent 46%),
    #fff;
}

.filter-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.filter-heading p,
.result-summary p {
  margin: 0 0 4px;
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .15em;
}

.filter-heading h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -.02em;
}

.filter-reset,
#show-all-results {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  color: #607b8e;
  background: rgba(255, 255, 255, .86);
  font-size: 12px;
  cursor: pointer;
}

.filter-reset:hover,
.filter-reset:focus-visible,
#show-all-results:hover,
#show-all-results:focus-visible {
  color: var(--brand-dark);
  border-color: rgba(0, 160, 233, .46);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 12px;
}

.filter-grid label {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.filter-grid label:nth-child(3),
.filter-grid label:nth-child(4),
.filter-grid label:nth-child(5),
.filter-grid label:nth-child(6),
.filter-grid label:nth-child(7) {
  grid-column: 1 / -1;
}

.filter-grid label > span {
  color: #627b8c;
  font-size: 11px;
  font-weight: 620;
}

.filter-grid select {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  color: var(--ink);
  background:
    linear-gradient(45deg, transparent 50%, #6f8797 50%) calc(100% - 17px) 18px / 5px 5px no-repeat,
    linear-gradient(135deg, #6f8797 50%, transparent 50%) calc(100% - 12px) 18px / 5px 5px no-repeat,
    #fff;
  appearance: none;
  font-size: 13px;
  cursor: pointer;
}

.filter-grid select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 160, 233, .12);
}

.map-submit {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 18px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 12px 25px rgba(0, 121, 182, .2);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.map-submit:hover {
  box-shadow: 0 16px 30px rgba(0, 121, 182, .25);
  transform: translateY(-1px);
}

.map-submit svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.result-summary {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
}

.result-summary strong {
  color: var(--ink);
  font-size: 18px;
}

.map-result-state {
  display: none;
  margin: 18px 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #667f90;
  background: var(--surface-blue);
  font-size: 12px;
  line-height: 1.7;
}

.map-result-state:not(:empty) {
  display: block;
}

.map-results {
  max-height: 500px;
  overflow: auto;
  padding: 8px 14px 18px;
  overscroll-behavior: contain;
}

.map-result-card {
  position: relative;
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 14px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: #fff;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.map-result-card:hover,
.map-result-card:focus-within,
.map-result-card.is-active {
  border-color: rgba(0, 160, 233, .25);
  background: #f5fbfe;
  transform: translateY(-1px);
}

.map-result-card__media {
  position: relative;
  min-height: 84px;
  overflow: hidden;
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(0, 160, 233, .18), rgba(18, 58, 91, .05)),
    #e9f3f8;
}

.map-result-card__media::before,
.map-result-card__media::after {
  content: "";
  position: absolute;
  bottom: 13px;
  width: 30px;
  border: 1px solid rgba(31, 103, 143, .24);
  background: rgba(255, 255, 255, .56);
}

.map-result-card__media::before {
  left: 22px;
  height: 45px;
}

.map-result-card__media::after {
  right: 19px;
  height: 60px;
}

.map-result-card__media img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 84px;
  object-fit: cover;
}

.map-result-card__body {
  min-width: 0;
  align-self: center;
}

.map-result-card__body h3 {
  margin: 0 0 7px;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-result-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-bottom: 7px;
  color: #668092;
  font-size: 11px;
}

.map-result-card__meta strong {
  color: #ec725d;
  font-size: 14px;
}

.map-result-card__address {
  margin: 0;
  overflow: hidden;
  color: #5d7688;
  font-size: 11px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-result-card__link {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
}

.map-stage {
  position: sticky;
  top: 96px;
  overflow: hidden;
}

.map-stage__toolbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
}

.map-stage__toolbar .section-kicker {
  margin: 0 0 4px;
  font-size: 11px;
}

.map-stage__toolbar h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
}

.map-legend {
  color: #5d7688;
  font-size: 11px;
}

.map-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.map-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(0, 160, 233, .12);
}

.map-canvas {
  position: relative;
  height: 690px;
  overflow: hidden;
  background: #edf4f7;
}

.map-live {
  position: absolute;
  z-index: 2;
  inset: 0;
}

.map-canvas .BMap_mask,
.map-canvas .BMap_mapPane,
.map-canvas .BMap_labelPane,
.map-canvas .BMap_markerPane,
.map-canvas .BMap_floatPane {
  z-index: 3;
}

.map-fallback {
  position: absolute;
  z-index: 1;
  inset: 0;
  opacity: 1;
  transition: opacity .35s ease;
}

.map-fallback > svg {
  width: 100%;
  height: 100%;
}

.map-fallback__water {
  fill: #dbeef5;
}

.map-fallback__blocks {
  fill: #fff;
  stroke: #d5e2e8;
  stroke-width: 2;
}

.map-fallback__roads {
  fill: none;
  stroke: #fff;
  stroke-width: 24;
}

.map-fallback__roads path + path {
  stroke-width: 13;
}

.map-canvas.is-live .map-fallback {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.fallback-markers {
  position: absolute;
  inset: 0;
}

.fallback-marker {
  position: absolute;
  min-width: 74px;
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 7px 12px;
  border: 2px solid #fff;
  border-radius: 13px 13px 13px 3px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 12px 24px rgba(18, 58, 91, .23);
  transform: translate(-50%, -100%);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.fallback-marker span {
  display: block;
  font-size: 9px;
  font-weight: 500;
  opacity: .82;
}

.map-message {
  position: absolute;
  z-index: 5;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100% - 36px));
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 10px;
  color: #5e7788;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 10px 25px rgba(18, 58, 91, .1);
  backdrop-filter: blur(10px);
  font-size: 11px;
  line-height: 1.55;
}

.map-canvas.is-live .map-message:empty {
  display: none;
}

.hb-baidu-count {
  min-width: 34px;
  height: 25px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  border: 2px solid #fff;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, #00a0e9, #0069a8);
  box-shadow: 0 7px 18px rgba(18, 58, 91, .25);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .map-workspace {
    grid-template-columns: 360px minmax(0, 1fr);
  }

  .map-canvas {
    height: 650px;
  }
}

@media (max-width: 900px) {
  .map-heading__inner {
    min-height: 230px;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 22px;
  }

  .map-data-note {
    max-width: 560px;
    margin: 0;
  }

  .map-workspace {
    display: flex;
    flex-direction: column;
    width: min(760px, calc(100% - 28px));
    gap: 16px;
    margin-top: 18px;
  }

  .map-sidebar {
    display: contents;
  }

  .map-filters,
  .result-summary,
  .map-result-state,
  .map-results,
  .map-stage {
    width: 100%;
  }

  .map-filters {
    order: 1;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
  }

  .map-stage {
    position: relative;
    top: auto;
    order: 2;
  }

  .result-summary {
    order: 3;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
  }

  .map-result-state {
    order: 4;
    margin: 0;
  }

  .map-results {
    order: 5;
    max-height: none;
    padding: 0;
  }

  .map-result-card {
    border-color: var(--line);
    box-shadow: 0 8px 24px rgba(18, 58, 91, .06);
  }

  .map-canvas {
    height: 500px;
  }
}

@media (max-width: 580px) {
  .map-heading__inner {
    width: calc(100% - 30px);
    min-height: 224px;
    padding-top: 34px;
    padding-bottom: 30px;
  }

  .map-heading h1 {
    font-size: 33px;
  }

  .map-heading__inner > div > p:last-child {
    font-size: 13px;
  }

  .map-data-note {
    padding: 13px 14px;
  }

  .map-workspace {
    width: calc(100% - 24px);
    margin-bottom: 44px;
  }

  .map-filters {
    padding: 20px 16px;
  }

  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-grid label,
  .filter-grid label:nth-child(n) {
    grid-column: auto;
  }

  .filter-grid label:first-child,
  .filter-grid label:nth-child(2) {
    grid-column: auto;
  }

  .filter-grid label:nth-child(3),
  .filter-grid label:nth-child(4),
  .filter-grid label:nth-child(7) {
    grid-column: 1 / -1;
  }

  .filter-reset,
  #show-all-results {
    min-height: 40px;
  }

  .map-stage__toolbar {
    min-height: 72px;
    padding: 12px 15px;
  }

  .map-stage__toolbar h2 {
    font-size: 17px;
  }

  .map-legend {
    font-size: 9px;
  }

  .map-canvas {
    height: 390px;
  }

  .map-result-card {
    grid-template-columns: 92px minmax(0, 1fr);
    padding: 8px;
  }

  .map-result-card__media,
  .map-result-card__media img {
    min-height: 78px;
  }
}

@media (max-width: 370px) {
  .map-legend {
    display: none;
  }

  .map-result-card {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-submit,
  .map-result-card,
  .map-fallback {
    transition: none;
  }
}
