:root {
    --green: #13b942;
    --green-2: #62c94e;
    --green-dark: #0a9f34;
    --text: #292d30;
    --muted: #737a80;
    --soft: #f5f6f5;
    --line: #e7e9e7;
    --shadow: 0 18px 55px rgba(24, 66, 35, 0.12);
}

.page {
    min-height: 100vh;
    padding: 34px 48px 40px;
    background:
        radial-gradient(circle at 77% 12%, rgba(19, 185, 66, .035), transparent 27%),
        #fff;
}

.topbar {
    max-width: 1500px;
    margin: 0 auto 38px;
    display: flex;
    justify-content: flex-end;
    font-size: 14px;
    color: #1f2527;
}

.topbar a {
    color: var(--green);
    text-decoration: none;
}

.shell {
    width: min(1500px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(360px, 440px) minmax(0, 1fr);
    gap: 56px;
    align-items: start;
}

.panel {
    min-width: 0;
}

.tabs {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 34px;
    flex-wrap: wrap;
}

.tab {
    height: 40px;
    min-width: 98px;
    border: 1px solid #e2e5e2;
    border-radius: 999px;
    padding: 0 18px;
    background: #fff;
    color: #3b4042;
    font-size: 14px;
    cursor: pointer;
    transition: .22s ease;
}

.tab:hover {
    transform: translateY(-1px);
    border-color: #bedfc4;
}

.tab.active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--green) 0%, #35c44f 100%);
    box-shadow: 0 8px 22px rgba(19, 185, 66, .18);
}

.location-list {
    display: grid;
    gap: 10px;
}

.location-card {
    border-radius: 26px;
    overflow: hidden;
    background: var(--soft);
    transition: .25s ease;
    border: 1px solid transparent;
}

.location-card:not(.active):hover {
    border-color: #dcebdd;
    transform: translateY(-1px);
}

.location-card.active {
    color: #fff;
    background: linear-gradient(135deg, #09b83f 0%, #69c94d 100%);
    box-shadow: var(--shadow);
}

.card-head {
    width: 100%;
    min-height: 58px;
    border: 0;
    padding: 0 18px 0 26px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    color: inherit;
    text-align: left;
}

.location-card.active .card-head {
    min-height: 66px;
}

.country {
    font-size: 18px;
    font-weight: 650;
    letter-spacing: .01em;
}

.location-card.active .country {
    font-size: 22px;
}

.chev {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    background: #fff;
    color: #343a3c;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .03);
    transition: .25s ease;
}

.location-card.active .chev {
    background: rgba(255, 255, 255, .16);
    color: #fff;
    transform: rotate(90deg);
}

.chev svg {
    width: 18px;
    height: 18px;
}

.card-body {
    display: none;
    padding: 0 26px 24px;
    line-height: 1.65;
    font-size: 15px;
}

.location-card.active .card-body {
    display: block;
}

.detail-line {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 5px 0;
}

.detail-line .ico {
    width: 16px;
    flex: 0 0 16px;
    margin-top: 4px;
    display: inline-grid;
    place-items: center;
}

.detail-line a {
    color: inherit;
    text-decoration: none;
}

#map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #fafbfa;
    isolation: isolate;
}

.map-hint {
    position: absolute;
    left: 18px;
    bottom: 18px;
    z-index: 700;
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 9px 13px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, .05);
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(32, 55, 39, .08);
    color: #657069;
    font-size: 12px;
    pointer-events: none;
}

.map-back {
    position: absolute;
    left: 18px;
    top: 18px;
    z-index: 760;
    height: 42px;
    padding: 0 16px 0 12px;
    border: 1px solid rgba(14, 104, 38, .10);
    border-radius: 999px;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 28px rgba(27, 66, 38, .14);
    color: #26322a;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.map-back:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(27, 66, 38, .18);
}

.map-back:active {
    transform: translateY(0);
}

.map-back svg {
    width: 17px;
    height: 17px;
}

.route-panel {
    position: absolute;
    right: 18px;
    bottom: 18px;
    z-index: 720;
    width: min(330px, calc(100% - 36px));
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
    border-radius: 18px;
    padding: 14px 16px;
    box-shadow: 0 16px 40px rgba(27, 66, 38, .15);
    border: 1px solid rgba(16, 115, 44, .08);
    display: none;
}

.route-panel.show {
    display: block;
}

.route-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 6px;
}

.route-meta {
    color: #637068;
    font-size: 12px;
    line-height: 1.6;
}

.route-close {
    position: absolute;
    right: 10px;
    top: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 0;
    background: #f0f4f1;
    cursor: pointer;
    color: #4d5751;
}


/*
* Leaflet critical layout fallback.
* 解决某些部署/浏览器环境中外部 leaflet.css 未加载时，瓦片图片按普通 <img> 排版，
* 导致地图只在中间出现 2×2/2×N 瓦片的情况。这里把地图渲染必需样式内置到组件。
*/
.leaflet-container {
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    background: #ddd;
    outline-offset: 1px;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane>svg,
.leaflet-pane>canvas,
.leaflet-zoom-box {
    position: absolute;
    left: 0;
    top: 0;
}

.leaflet-container {
    position: relative;
}

.leaflet-map-pane {
    z-index: 200;
}

.leaflet-tile-pane {
    z-index: 200;
}

.leaflet-overlay-pane {
    z-index: 400;
}

.leaflet-shadow-pane {
    z-index: 500;
}

.leaflet-marker-pane {
    z-index: 600;
}

.leaflet-tooltip-pane {
    z-index: 650;
}

.leaflet-popup-pane {
    z-index: 700;
}

.leaflet-map-pane canvas {
    z-index: 100;
}

.leaflet-map-pane svg {
    z-index: 200;
}

.leaflet-tile {
    width: 256px;
    height: 256px;
    visibility: hidden;
    user-select: none;
    -webkit-user-drag: none;
    max-width: none !important;
    max-height: none !important;
}

.leaflet-tile-loaded {
    visibility: inherit;
}

.leaflet-zoom-animated {
    transform-origin: 0 0;
}

.leaflet-zoom-hide {
    visibility: hidden;
}

.leaflet-marker-icon,
.leaflet-marker-shadow {
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    max-width: none !important;
    max-height: none !important;
}

.leaflet-container .leaflet-overlay-pane svg,
.leaflet-container .leaflet-marker-pane img,
.leaflet-container .leaflet-shadow-pane img,
.leaflet-container .leaflet-tile-pane img,
.leaflet-container img.leaflet-image-layer,
.leaflet-container .leaflet-tile {
    max-width: none !important;
    max-height: none !important;
}

.leaflet-control {
    position: relative;
    z-index: 800;
    pointer-events: auto;
}

.leaflet-top,
.leaflet-bottom {
    position: absolute;
    z-index: 1000;
    pointer-events: none;
}

.leaflet-top {
    top: 0;
}

.leaflet-right {
    right: 0;
}

.leaflet-bottom {
    bottom: 0;
}

.leaflet-left {
    left: 0;
}

.leaflet-control {
    float: left;
    clear: both;
}

.leaflet-right .leaflet-control {
    float: right;
}

.leaflet-top .leaflet-control {
    margin-top: 10px;
}

.leaflet-bottom .leaflet-control {
    margin-bottom: 10px;
}

.leaflet-left .leaflet-control {
    margin-left: 10px;
}

.leaflet-right .leaflet-control {
    margin-right: 10px;
}

.leaflet-control-zoom a {
    display: block;
    text-align: center;
    text-decoration: none;
    background: #fff;
    width: 26px;
    height: 26px;
    line-height: 26px;
}

.leaflet-popup {
    position: absolute;
    text-align: center;
    margin-bottom: 20px;
}

.leaflet-popup-content-wrapper {
    padding: 1px;
    text-align: left;
}

.leaflet-popup-content {
    line-height: 1.3;
    font-size: 13px;
    min-height: 1px;
}

.leaflet-popup-tip-container {
    width: 40px;
    height: 20px;
    position: absolute;
    left: 50%;
    margin-top: -1px;
    margin-left: -20px;
    overflow: hidden;
    pointer-events: none;
}

.leaflet-popup-tip {
    width: 17px;
    height: 17px;
    padding: 1px;
    margin: -10px auto 0;
    pointer-events: auto;
    transform: rotate(45deg);
    background: white;
    box-shadow: 3px 3px 14px rgba(0, 0, 0, .15);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: #fff;
    color: #333;
}

.leaflet-popup-close-button {
    position: absolute;
    top: 0;
    right: 0;
    border: none;
    text-align: center;
    width: 24px;
    height: 24px;
    font: 20px/24px Tahoma, Verdana, sans-serif;
    color: #757575;
    text-decoration: none;
    background: transparent;
    cursor: pointer;
}

.leaflet-tooltip {
    position: absolute;
    padding: 6px;
    background: #fff;
    border: 1px solid #fff;
    border-radius: 3px;
    color: #222;
    white-space: nowrap;
    user-select: none;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}

/* Leaflet restyle */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 8px 28px rgba(26, 60, 35, .14) !important;
    border-radius: 14px !important;
    overflow: hidden;
}

.leaflet-control-zoom a {
    border: 0 !important;
    width: 38px !important;
    height: 38px !important;
    line-height: 38px !important;
    color: #374039 !important;
}

.leaflet-popup-content-wrapper {
    border-radius: 18px;
    box-shadow: 0 20px 55px rgba(24, 65, 34, .19);
}

.leaflet-popup-content {
    margin: 0;
    min-width: 280px;
}

.leaflet-popup-tip {
    box-shadow: none;
}

.popup {
    padding: 18px;
}

.popup-kicker {
    color: var(--green-dark);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    margin-bottom: 6px;
}

.popup h3 {
    margin: 0 0 10px;
    font-size: 18px;
}

.popup p {
    margin: 5px 0;
    color: #5f6963;
    font-size: 13px;
    line-height: 1.55;
}

.popup-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 13px;
}

.popup-actions button {
    border: 0;
    border-radius: 10px;
    padding: 10px 9px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 650;
    transition: .2s ease;
}

.popup-actions button:hover {
    transform: translateY(-1px);
}

.btn-light {
    background: #f2f5f3;
    color: #35423a;
}

.btn-green {
    background: var(--green);
    color: #fff;
}

.btn-wide {
    grid-column: 1 / -1;
}

.pin-wrap {
    width: 36px;
    height: 36px;
    position: relative;
    display: grid;
    place-items: center;
}

.pin-core {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #fff;
    border: 5px solid var(--green);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .02);
    position: relative;
    z-index: 2;
}

.pin-pulse {
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: rgba(19, 185, 66, .22);
    animation: pulse 2s infinite ease-out;
}

.pin-wrap.primary .pin-pulse {
    inset: 0;
    background: rgba(19, 185, 66, .28);
}

@keyframes pulse {
    0% {
        transform: scale(.45);
        opacity: .9;
    }

    80%,
    100% {
        transform: scale(1.15);
        opacity: 0;
    }
}

.empty-state {
    padding: 34px 22px;
    border-radius: 24px;
    background: #f7f8f7;
    border: 1px dashed #dfe5df;
    color: #7a837d;
    text-align: center;
    line-height: 1.7;
    font-size: 14px;
}

@media (max-width: 1050px) {
    .page {
        padding: 24px 24px 36px;
    }

    .shell {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .map-panel {
        height: 560px;
        order: 2;
    }

    .panel {
        order: 1;
    }

    .tabs {
        margin-bottom: 18px;
    }
}

@media (max-width: 620px) {
    .page {
        padding: 16px 14px 26px;
    }

    .topbar {
        margin-bottom: 18px;
    }

    .map-panel {
        height: 500px;
        border-radius: 20px;
    }

    .country {
        font-size: 16px;
    }

    .location-card.active .country {
        font-size: 20px;
    }

    .popup-actions {
        grid-template-columns: 1fr;
    }

    .btn-wide {
        grid-column: auto;
    }

    .map-hint {
        display: none;
    }
}