figure.hz-route {
  container-type: inline-size;
  position: relative;
  margin: 0;
  color: #101544;
  background: #a8e3db;
  border: 1px solid #b6dcec;
  border-radius: 10px;
  overflow: hidden;
}

.hz-map-frame {
  --hz-map-rail: #7515cc;
  --hz-map-local: #bf4900;
  --hz-map-other: #65747f;
  position: relative;
  font-size: clamp(.65rem, 1.35cqi, .83rem);
}

.hz-map-surface {
  position: relative;
  width: 100%;
  aspect-ratio: 1000 / 340;
  min-height: 262px;
  background: linear-gradient(120deg, #f2ffd92e, #efffb750), #c8edab url("/assets/guilin-dashboard/route-terrain.webp") 50% 40% / cover no-repeat;
}

.hz-map-summary {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.hz-map-scroll:focus-visible { outline: 2px solid #005ec3; outline-offset: -2px; }
.hz-map-swipe { display: none; }

.hz-map-drawing {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hz-map-shore {
  fill: url("#hz-map-water");
  stroke: #effcc6;
  stroke-width: 4px;
}

.hz-map-islands {
  fill: #ddf5b5;
  stroke: #ecfff0;
  stroke-width: 1.5px;
}

.hz-map-ripples {
  fill: none;
  stroke: #d6fbff;
  stroke-width: 2px;
  stroke-linecap: round;
  opacity: .7;
}

.hz-map-tracks path {
  fill: none;
  stroke-width: 2.8px;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 1px 0 #fff) drop-shadow(0 -1px 0 #fff);
}

.hz-map-tracks .hz-map-rail { stroke: var(--hz-map-rail); }
.hz-map-tracks .hz-map-local { stroke: var(--hz-map-local); }
.hz-map-tracks .hz-map-other { stroke: var(--hz-map-other); stroke-dasharray: 5px 4px; }
.hz-map-points { fill: white; stroke: #161d3b; stroke-width: 2.5px; }

.hz-route .hz-map-places,
.hz-route .hz-map-legend {
  margin: 0;
  list-style: none;
}

.hz-route .hz-map-places { padding: 0; }

.hz-map-place {
  --pin-size: 2em;
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: flex;
  align-items: center;
  width: max-content;
  max-width: min(18%, calc(100% - var(--x) + .75em));
  transform: translate(calc(-.5 * var(--pin-size)), -50%);
  z-index: 1;
}

.hz-place-shenzhen { --x: 3.9%; --y: 66.5%; }
.hz-place-huiyang { --x: 26.2%; --y: 45.6%; }
.hz-place-north { --x: 41.3%; --y: 15%; }
.hz-place-west-lake { --x: 43.4%; --y: 28.2%; max-width: 22%; }
.hz-place-south { --x: 45.3%; --y: 47.1%; }
.hz-place-huidong { --x: 59.8%; --y: 42.1%; }
.hz-place-huidong-south { --x: 71.7%; --y: 60%; }
.hz-place-xunliao { --x: 62.5%; --y: 75%; }
.hz-place-double-moon { --x: 84.5%; --y: 76.2%; }

.hz-route .hz-map-area {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 34px;
  scroll-margin-inline: 8px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}

.hz-map-area .hz-map-label > strong {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.hz-map-area:hover .hz-map-label {
  box-shadow: 0 0 0 2px var(--hz-pin, var(--hz-map-rail)), 0 2px 7px #263d4955;
}

.hz-route .hz-map-area:focus-visible {
  outline: 3px solid #004b9f;
  outline-offset: 3px;
}

.hz-map-pin {
  display: grid;
  place-items: center;
  border: 1.5px solid white;
  border-radius: 50%;
  width: var(--pin-size);
  aspect-ratio: 1;
  flex: 0 0 auto;
  z-index: 1;
  color: white;
  background: var(--hz-pin, var(--hz-map-rail));
  box-shadow: 0 1px 4px #20154756;
}

.hz-map-pin svg { width: 1.25em; height: 1.25em; }
.hz-place-city { --pin-size: 2.6em; --hz-pin: #006bd2; }
.hz-place-lake { --pin-size: 2.6em; --hz-pin: #087da3; --hz-label: #d9f7ff; }
.hz-place-beach { --pin-size: 2.6em; --hz-pin: #d85e00; --hz-label: #b84b00; --hz-label-text: #fff; }

.hz-map-label {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: .35em .45em .36em .76em;
  margin-left: -.45em;
  background: var(--hz-label, #fffffff4);
  color: var(--hz-label-text, #101544);
  line-height: 1.13;
  box-shadow: 0 1px 5px #263d4938;
  border: 1px solid #fff;
  border-radius: 7px;
}

.hz-map-label > b { font-family: system-ui, sans-serif; }
.hz-map-label > small { color: inherit; font-size: .78em; }
.hz-place-huiyang .hz-map-label { max-width: 8.6em; }

.hz-route .hz-map-legend,
.hz-route .hz-map-notice,
.hz-route figcaption {
  box-sizing: border-box;
  position: absolute;
  background: #fffffff5;
  border: 1px solid #8ebcd4;
  border-radius: 8px;
  box-shadow: 0 1px 5px #28536724;
}

.hz-route .hz-map-legend {
  display: grid;
  gap: .4em;
  top: 3%;
  left: 1.65%;
  padding: .65em .8em;
  font-size: .93em;
  line-height: 1.2;
  z-index: 2;
  font-size: clamp(.61rem, 1.35cqi, .83rem);
}

.hz-map-legend li {
  display: flex;
  align-items: center;
  gap: .65em;
}

.hz-map-legend li::before {
  content: "";
  display: block;
  width: 2.4em;
  border-top: 2px solid var(--hz-key, #161d3b);
}

.hz-key-rail { --hz-key: var(--hz-map-rail); }
.hz-key-local { --hz-key: var(--hz-map-local); }
.hz-key-other { --hz-key: var(--hz-map-other); }
.hz-map-legend .hz-key-other::before { border-top-style: dashed; }
.hz-map-legend .hz-key-station::before {
  box-sizing: border-box;
  width: .85em;
  height: .85em;
  border: 2px solid #161d3b;
  border-radius: 50%;
  margin-inline: .775em;
}

.hz-route .hz-map-notice {
  right: 1%;
  top: 2.5%;
  width: 23.5%;
  padding: .62em .68em;
  background: #fff5edfa;
  border-color: #efb1a5;
  font-size: .92em;
  line-height: 1.2;
  z-index: 2;
}

.hz-map-notice > strong,
.hz-route figcaption {
  display: flex;
  gap: .48em;
  align-items: center;
}

.hz-map-notice > strong {
  color: #a21417;
  font-size: 1.12em;
}

.hz-map-notice svg,
.hz-route figcaption svg {
  width: 1.35em;
  height: 1.35em;
  flex: none;
}

.hz-route .hz-map-notice ul {
  list-style: disc;
  padding-left: 1.08em;
  margin: .45em 0 .35em;
}

.hz-map-notice li + li { margin-top: .35em; }
.hz-map-notice li::marker { color: #a21417; }
.hz-map-notice a { color: #a21417; text-decoration: underline; }
.hz-route figcaption {
  bottom: 2.7%;
  left: 1.65%;
  max-width: 80%;
  font-size: clamp(.65rem, 1.35cqi, .83rem);
  margin: 0;
  padding: .42em .68em;
  line-height: 1.2;
}

.hz-route figcaption svg, .hz-route figcaption a { color: #005ec3; }
.hz-route a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

@container (max-width: 720px) {
  .hz-map-frame {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
    font-size: .8rem;
  }

  .hz-map-scroll {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-color: #548fba #e0f4fa;
    border: 1px solid #8ebcd4;
    border-radius: 7px;
  }

  .hz-map-surface {
    min-width: 750px;
    font-size: .65rem;
  }

  .hz-map-swipe {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
    padding: 0 3px;
    color: #12476e;
    font-size: .93em;
    font-weight: 700;
  }

  .hz-route .hz-map-legend {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: .58em;
  }

  .hz-route .hz-map-notice,
  .hz-route figcaption {
    position: static;
    max-width: none;
    width: auto;
    font-size: .8rem;
    padding: .6em;
  }

  .hz-route figcaption { margin: 0 8px 8px; }
}
