/* 摘自参考站 style.css，仅保留距离徽章 + 弹窗地图相关规则 */


.hero-distance-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.48rem 0.8rem 0.48rem 0.5rem;
    border-radius: 14px;
    background: rgba(32, 36, 38, 0.72);
    color: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}


.hero-distance-button {
    cursor: pointer;
    appearance: none;
    transition: transform 0.28s ease, box-shadow 0.28s ease, background 0.28s ease;
}


.hero-distance-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    background: rgba(23, 27, 30, 0.82);
}


.hero-distance-button:focus-visible {
    outline: 2px solid rgba(255, 184, 202, 0.95);
    outline-offset: 3px;
}


.hero-distance-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 1.05rem;
}


.hero-distance-badge strong {
    color: #ffffff;
    font-size: 1.14rem;
    letter-spacing: 0.02em;
}


.hero-distance-badge em {
    color: rgba(255, 255, 255, 0.72);
    font-style: normal;
    font-weight: 700;
}


.distance-map-open {
    overflow: hidden;
}


.distance-map-modal {
    position: fixed;
    inset: 0;
    z-index: 1400;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}


.distance-map-modal.active {
    opacity: 1;
    pointer-events: auto;
}


.distance-map-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 45%, rgba(255, 91, 149, 0.18), transparent 30%),
        rgba(4, 10, 17, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}


.distance-map-shell {
    position: absolute;
    inset: 0;
    padding: 2rem;
}


.distance-map-close {
    position: absolute;
    top: 1.65rem;
    right: 1.65rem;
    z-index: 4;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}


.distance-map-stage {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 32px;
    background:
        radial-gradient(circle at 52% 48%, rgba(255, 97, 148, 0.16), transparent 24%),
        linear-gradient(180deg, #edf4fb 0%, #dfeaf6 100%);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
}


.distance-map-canvas,
.distance-map-panel,
.distance-map-caption {
    position: absolute;
}


.distance-map-glow {
    position: absolute;
    width: 24vw;
    height: 24vw;
    min-width: 240px;
    min-height: 240px;
    border-radius: 50%;
    filter: blur(34px);
    opacity: 0.32;
}


.distance-map-glow-left {
    left: 8%;
    bottom: 12%;
    background: rgba(95, 196, 255, 0.18);
}


.distance-map-glow-right {
    right: 8%;
    top: 16%;
    background: rgba(255, 97, 148, 0.18);
}


.distance-map-panel {
    top: 1.2rem;
    left: 50%;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    transform: translateX(-50%);
    padding: 1rem 1.35rem;
    border-radius: 999px;
    background: rgba(9, 14, 21, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
    color: #f8fafc;
}


.distance-map-person {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}


.distance-map-avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}


.distance-map-meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}


.distance-map-meta-right {
    text-align: right;
}


.distance-map-name {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
}


.distance-map-place {
    font-size: 0.82rem;
    color: rgba(226, 232, 240, 0.72);
}


.distance-map-center {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.4rem;
}


.distance-map-center-icon {
    color: #f8fafc;
    font-size: 1rem;
}


.distance-map-km {
    font-size: 1.9rem;
    line-height: 1;
    letter-spacing: 0.04em;
}


.distance-map-unit {
    font-size: 0.85rem;
    color: rgba(226, 232, 240, 0.72);
}


.distance-map-canvas {
    inset: 0;
    z-index: 1;
    overflow: hidden;
}


/* 地图本体：拖动只移动 .distance-map-move 这一层，瓦片不再逐帧重建 */
.distance-tile-map {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    cursor: grab;
}


.distance-tile-map.is-dragging {
    cursor: grabbing;
}


.distance-map-move {
    position: absolute;
    inset: 0;
    will-change: transform;
}


.distance-tile-layer {
    position: absolute;
    inset: 0;
    transition: opacity 0.18s ease;
}


/* 新一层瓦片先透明着，等前几张图落地再显出来，缩放时不闪白 */
.distance-tile-layer.is-loading {
    opacity: 0;
}


.distance-route-svg {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 2;
    pointer-events: none;
    overflow: visible;
}


.distance-map-loading {
    position: absolute;
    align-items: center;
    inset: 0;
    z-index: 2;
    display: flex;
    justify-content: center;
    background: linear-gradient(180deg, rgba(237, 244, 251, 0.55), rgba(223, 234, 246, 0.26));
    color: #334155;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    backdrop-filter: blur(3px);
    transition: opacity 0.28s ease, visibility 0.28s ease;
}


.distance-map-loading.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}


.distance-map-tile {
    position: absolute;
    width: 256px;
    height: 256px;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}


.distance-fast-route-shadow,
.distance-fast-route {
    fill: none;
    stroke-linecap: round;
}


.distance-fast-route-shadow {
    stroke: rgba(255, 63, 143, 0.22);
    stroke-width: 26;
    filter: blur(5px);
}


.distance-fast-route {
    stroke: url(#distanceFastRoute);
    stroke-width: 6;
    stroke-dasharray: 16 14;
    filter: drop-shadow(0 10px 18px rgba(255, 63, 143, 0.28));
    animation: distanceRouteDash 4.8s linear infinite;
}


.distance-fast-node {
    fill: #ff5b91;
    stroke: rgba(255, 255, 255, 0.92);
    stroke-width: 5;
    filter: drop-shadow(0 8px 18px rgba(255, 63, 143, 0.34));
}


.distance-fast-node-end {
    fill: #8b5cf6;
}


.distance-fast-heart {
    fill: #ff4d91;
    font-size: 25px;
    text-anchor: middle;
    dominant-baseline: middle;
    animation: distanceMapHeartPulse 2.6s ease-in-out infinite;
}


.distance-fast-heart:nth-child(2n) {
    fill: #8b5cf6;
    font-size: 20px;
}


.distance-fast-heart:nth-child(3n) {
    fill: #ffcf56;
    font-size: 17px;
}


.distance-map-marker {
    position: absolute;
    z-index: 4;
    width: 0;
    height: 0;
    transform: translate(0, 0);
    pointer-events: none;
}


.distance-map-marker::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 1px;
    height: 54px;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.08), rgba(17, 24, 39, 0.28));
    transform-origin: bottom;
}


.distance-map-marker-left::before {
    transform: translate(-18px, -52px) rotate(-18deg);
}


.distance-map-marker-right::before {
    transform: translate(18px, -52px) rotate(18deg);
}


.distance-map-pin {
    position: absolute;
    left: 0;
    top: 0;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #ff4f8f;
    box-shadow:
        0 0 0 5px rgba(255, 79, 143, 0.18),
        0 10px 22px rgba(255, 79, 143, 0.28);
    transform: translate(-50%, -50%);
}


.distance-map-pin::after {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: inherit;
    background: #ffffff;
}


.distance-map-marker-right .distance-map-pin {
    background: #8b5cf6;
    box-shadow:
        0 0 0 5px rgba(139, 92, 246, 0.18),
        0 10px 22px rgba(139, 92, 246, 0.26);
}


.distance-map-marker-avatar {
    position: absolute;
    top: -104px;
    width: 76px;
    height: 76px;
    display: block;
    padding: 4px;
    border-radius: 999px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(255, 205, 223, 0.95));
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.9),
        0 16px 38px rgba(15, 23, 42, 0.24);
}


.distance-map-marker-left .distance-map-marker-avatar {
    left: -78px;
}


.distance-map-marker-right .distance-map-marker-avatar {
    left: 2px;
}


.distance-map-marker-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 999px;
    object-fit: cover;
}


.distance-map-marker strong {
    position: absolute;
    top: -26px;
    max-width: 8em;
    padding: 0.38rem 0.76rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.88);
    color: #fff;
    font-size: 0.82rem;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
}


.distance-map-marker-left strong {
    left: -72px;
    transform: translateX(-50%);
}


.distance-map-marker-right strong {
    left: 78px;
    transform: translateX(-50%);
}


.distance-map-controls {
    position: absolute;
    right: 1.2rem;
    top: 50%;
    z-index: 5;
    display: grid;
    gap: 0.4rem;
    padding: 0.42rem;
    border-radius: 18px;
    background: rgba(17, 24, 39, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.24);
    backdrop-filter: blur(12px);
    transform: translateY(-50%);
}


.distance-map-controls button {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1;
    transition: background 0.2s ease, transform 0.2s ease;
}


.distance-map-controls button span {
    transform: translateY(-1px);
}


.distance-map-controls button:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}


.distance-map-controls button:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.86);
    outline-offset: 2px;
}


.distance-map-attribution {
    position: absolute;
    right: 1.2rem;
    bottom: 1.1rem;
    z-index: 4;
    padding: 0.42rem 0.72rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.68);
    color: rgba(71, 85, 105, 0.72);
    font-size: 0.78rem;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.16);
    backdrop-filter: blur(8px);
}


.distance-map-caption {
    left: 2rem;
    bottom: 1.7rem;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.8rem 1rem;
    border-radius: 18px;
    background: rgba(9, 14, 21, 0.58);
    backdrop-filter: blur(10px);
    color: #f8fafc;
}


.distance-map-caption strong {
    font-size: 2rem;
    line-height: 1;
}


.distance-map-caption span {
    font-size: 0.95rem;
    color: rgba(226, 232, 240, 0.72);
}


@media (prefers-reduced-motion: reduce) {
    .distance-leaflet-heart-icon span {
        animation: none;
    }

    .distance-fast-route,
    .distance-fast-heart {
        animation: none;
    }

    .hero-distance-button {
        transition: none;
    }
}


@media (max-width: 640px) {
    .distance-map-marker-avatar {
        width: 58px;
        height: 58px;
        top: -82px;
    }

    .distance-map-marker strong {
        max-width: 6.8em;
        font-size: 0.72rem;
        top: -20px;
    }

    .distance-map-marker-left .distance-map-marker-avatar {
        left: -56px;
    }

    .distance-map-marker-right .distance-map-marker-avatar {
        left: -2px;
    }

    .distance-map-marker-left strong {
        left: -52px;
    }

    .distance-map-marker-right strong {
        left: 58px;
    }

    .distance-map-marker::before {
        height: 40px;
    }

    .distance-map-marker-left::before {
        transform: translate(-12px, -38px) rotate(-17deg);
    }

    .distance-map-marker-right::before {
        transform: translate(12px, -38px) rotate(17deg);
    }

    .distance-map-controls {
        top: auto;
        right: 0.8rem;
        bottom: 3.1rem;
        grid-auto-flow: column;
        grid-template-columns: repeat(3, 1fr);
        transform: none;
    }

    .distance-map-controls button {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .distance-map-attribution {
        right: 0.8rem;
        bottom: 0.75rem;
        font-size: 0.68rem;
    }
}


/* ── Hero Carousel responsive ──────────────────────────── */
@media (max-width: 640px) {
    .main-header-hero {
        height: 85vh;
        min-height: 460px;
    }

    .hero-couple {
        gap: 1.8rem;
    }

    .hero-distance-badge {
        gap: 0.34rem;
        padding: 0.4rem 0.65rem 0.4rem 0.42rem;
        border-radius: 12px;
        font-size: 0.86rem;
    }

    .hero-distance-icon {
        width: 32px;
        height: 32px;
        border-radius: 10px;
        font-size: 0.9rem;
    }

    .hero-distance-badge strong {
        font-size: 0.98rem;
    }

    .distance-map-shell {
        padding: 0.9rem;
    }

    .distance-map-stage {
        border-radius: 24px;
    }

    .distance-map-close {
        top: 0.9rem;
        right: 0.9rem;
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }

    .distance-map-panel {
        top: 0.8rem;
        width: calc(100% - 4.2rem);
        gap: 0.75rem;
        padding: 0.8rem 0.95rem;
        border-radius: 24px;
    }

    .distance-map-avatar {
        width: 44px;
        height: 44px;
    }

    .distance-map-name {
        font-size: 1rem;
    }

    .distance-map-place {
        font-size: 0.72rem;
    }

    .distance-map-km {
        font-size: 1.3rem;
    }

    .distance-map-loading {
        font-size: 0.78rem;
    }

    .distance-map-caption {
        left: 1rem;
        bottom: 1rem;
        padding: 0.7rem 0.85rem;
    }

    .distance-map-caption strong {
        font-size: 1.4rem;
    }

    .distance-map-caption span {
        font-size: 0.8rem;
    }

    .hero-avatar-ring {
        width: 96px;
        height: 96px;
    }

    .hero-avatar-name {
        font-size: 0.88rem;
    }

    .hero-heart-icon {
        font-size: 1.8rem;
    }

    .hero-days-num {
        font-size: 1.2rem;
    }

    .hero-tagline {
        font-size: 0.8rem;
        letter-spacing: 0.06em;
    }

    .hero-dots {
        bottom: 5.5rem;
    }
}