.guilin-route {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid #cce5d5;
  border-radius: 11px;
  background: #e5f6d6;
  color: #10143c;
}

.guilin-route-frame {
  position: relative;
  aspect-ratio: 4 / 1;
  min-height: 182px;
  isolation: isolate;
  background: #e5f6d6 url("/assets/guilin-dashboard/route-terrain.webp") center 62% / cover no-repeat;
  --route-rail: #003bd9;
  --route-flight: #2578ff;
  --route-road: #5e6b77;
  --route-water: #00a6ce;
  --route-extension: #8434bd;
  font-size: clamp(10px, .86vw, 13px);
}

.guilin-route-frame :is(ol, ul) { list-style: none; margin: 0; padding: 0; }
.guilin-route-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.guilin-route-lines path { fill: none; stroke-linecap: round; stroke-width: 3; vector-effect: non-scaling-stroke; }
.guilin-route-rail { stroke: var(--route-rail); stroke-dasharray: 6 4; }
.guilin-route-flight { stroke: var(--route-flight); stroke-dasharray: 1 6; }
.guilin-route-road { stroke: var(--route-road); }
.guilin-route-lines .guilin-route-water { stroke: var(--route-water); stroke-width: 5; }
.guilin-route-extension { stroke: var(--route-extension); stroke-dasharray: 5 4; }
.guilin-route-nodes { fill: #fff; stroke: var(--route-rail); stroke-width: 2; }

.guilin-route-stop, .guilin-route-options, .guilin-route .guilin-route-key {
  position: absolute;
  padding: .44em .72em;
  line-height: 1.06;
  border: 1px solid #ffffffdf;
  background: #fffffff3;
  border-radius: 8px;
  box-shadow: 0 1px 3px #1c3b441b;
}

.guilin-route-stop { left: var(--x); top: var(--y); background: var(--stop, white); color: var(--label, #111347); }
.guilin-route-stop span { display: block; font-size: .85em; }
.guilin-route-stop strong { font-weight: 800; }
.route-start { --x: 3%; --y: 72%; --stop: #006cf0; --label: white; min-width: 12%; text-align: center; }
.route-north { --x: 30%; --y: 8%; }
.route-central { --x: 32.5%; --y: 22%; }
.route-west { --x: 29.5%; --y: 36%; }
:is(.route-north,.route-central,.route-west) { --stop: #075adf; --label: #fff; border-radius: 999px; }
.route-city { --x: 46.5%; --y: 26%; --stop: #f1fff1; text-align: center; }
.route-river { --x: 55%; --y: 42%; --stop: #0067da; --label: white; }
.route-xingping { --x: 67%; --y: 30%; --stop: #ffebf5; }
.route-yangshuo { --x: 54%; --y: 76%; --stop: #f4fff0; }
.route-yulong { --x: 68%; --y: 73%; --stop: #087531; --label: white; }
.route-longji { --x: 80%; --y: 7%; --stop: #f5e9ff; }

.guilin-route-options { left: 2%; top: 18%; margin: 0; line-height: 1.5; }
.guilin-route .guilin-route-key { right: 1%; bottom: 8%; display: grid; gap: .3em; padding: .52em .64em; font-size: .88em; }
.guilin-route-key li { display: flex; align-items: center; gap: .5em; }
.guilin-route-key li::before { width: 1.7em; border-top: 2px solid var(--key); content: ""; }
.guilin-route-key :is(.key-rail,.key-flight,.key-extension)::before { border-top-style: dashed; }
.key-rail { --key: var(--route-rail); }
.key-flight { --key: var(--route-flight); }
.key-road { --key: var(--route-road); }
.key-water { --key: var(--route-water); }
.key-extension { --key: var(--route-extension); }
.guilin-route figcaption { position: absolute; bottom: 1px; right: 7px; color: #23464b; background: #ebf9e9f0; padding-inline: 3px; font-size: 9px; line-height: 1.2; }

@media (max-width: 680px) {
  .guilin-route-frame { aspect-ratio: auto; padding: 8px; }
  .guilin-route-lines { display: none; }
  .guilin-route-options { position: static; width: fit-content; margin-bottom: 7px; }
  .guilin-route-frame .guilin-route-stops { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .guilin-route-stop { position: static; display: flex; flex-direction: column; justify-content: center; border-radius: 6px; text-align: left; }
  .route-start { grid-column: 1 / -1; }
  .guilin-route .guilin-route-key { position: static; display: flex; flex-wrap: wrap; margin-top: 7px; gap: 5px 9px; }
  .guilin-route figcaption { position: static; text-align: right; padding: 0 8px 4px; background: transparent; }
}
