.visitor-globe-card {
    --visitor-ink: #16333a;
    --visitor-muted: #6f8187;
    --visitor-earth: #2b7773;
    --visitor-earth-dark: #205e5b;
    --visitor-line: #dee2e6;
    --visitor-coral: #ee7b82;
    --visitor-orange: #f18a4a;
    --visitor-peach: #f4b181;
    --visitor-surface: rgba(255, 255, 255, 0.91);
    overflow: hidden;
    color: var(--visitor-ink);
}

.visitor-globe-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 0;
}

.visitor-globe-header h6,
.visitor-globe-header h6 i {
    color: #000;
}

.visitor-globe-header p {
    color: var(--visitor-muted);
    font-size: 0.9rem;
}

.visitor-data-badge {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.42rem;
    padding: 0.28rem 0.65rem;
    border: 1px solid #dee2e6;
    border-radius: 999px;
    color: var(--visitor-muted);
    background: #f8fbfa;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.visitor-data-dot {
    width: 0.46rem;
    height: 0.46rem;
    border-radius: 50%;
    background: #a8b5b7;
}

.visitor-data-badge.is-live .visitor-data-dot {
    background: #45aa7a;
    box-shadow: 0 0 0 4px rgba(69, 170, 122, 0.12);
}

.visitor-data-badge.is-preview .visitor-data-dot {
    background: var(--visitor-orange);
    box-shadow: 0 0 0 4px rgba(241, 138, 74, 0.12);
}

.visitor-globe-stage {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(285px, 0.72fr);
    gap: clamp(1.25rem, 3.2vw, 3rem);
    align-items: center;
    min-height: 220px;
    padding: clamp(1.25rem, 3.4vw, 2.6rem);
    background: #ffffff;
}

.visitor-globe-visual {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 550px;
    align-items: center;
    justify-content: center;
}

.visitor-globe-canvas {
    width: 100%;
    min-height: 520px;
    cursor: grab;
}

.visitor-globe-canvas:active {
    cursor: grabbing;
}

.visitor-globe-canvas canvas {
    display: block;
    max-width: 100%;
    margin: 0 auto;
}

.visitor-globe-loading {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    color: var(--visitor-muted);
    background: rgba(244, 249, 248, 0.68);
    font-size: 0.9rem;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.visitor-globe-loading.is-hidden {
    visibility: hidden;
    opacity: 0;
}

.visitor-loading-ring {
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid var(--visitor-line);
    border-top-color: var(--visitor-earth);
    border-radius: 50%;
    animation: visitor-spin 0.8s linear infinite;
}

@keyframes visitor-spin {
    to {
        transform: rotate(360deg);
    }
}

.visitor-summary-card {
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 3;
    width: min(100%, 390px);
    padding: 1rem 1.2rem 0.9rem;
    border: 1px solid #dee2e6;
    border-radius: 1rem;
    background: var(--visitor-surface);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
}

.visitor-summary-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.visitor-summary-stat {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    white-space: nowrap;
}

.visitor-summary-stat strong {
    color: var(--visitor-ink);
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.04em;
}

.visitor-summary-stat > span {
    color: #26383d;
    font-size: 0.92rem;
    font-weight: 700;
}

.visitor-summary-divider {
    width: 1px;
    height: 3.2rem;
    background: var(--visitor-line);
}

.visitor-country-line {
    margin: 0.7rem 0 0;
    overflow: hidden;
    color: var(--visitor-muted);
    font-size: 0.86rem;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.visitor-location-panel {
    width: 100%;
    min-width: 0;
    max-height: 490px;
    padding: 1.15rem 1.2rem;
    overflow: hidden;
    border: 1px solid #dee2e6;
    border-radius: 1rem;
    background: var(--visitor-surface);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.09);
    backdrop-filter: blur(10px);
}

.visitor-tabs {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.2rem 0 0.8rem;
    border-bottom: 1px solid #e5e7ea;
}

.visitor-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    padding: 0;
    border: 0;
    color: #7f9094;
    background: transparent;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: color 0.2s ease;
}

.visitor-tab:hover,
.visitor-tab:focus,
.visitor-tab.is-active {
    color: var(--visitor-ink);
    outline: none;
}

.visitor-tab:focus-visible {
    border-radius: 0.25rem;
    box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.2);
}

.visitor-tab-rule {
    flex: 1 1 auto;
    height: 1px;
    background: var(--visitor-line);
}

.visitor-current-count {
    display: inline-flex;
    min-width: 1.25rem;
    height: 1.25rem;
    align-items: center;
    justify-content: center;
    padding: 0 0.28rem;
    border-radius: 999px;
    color: #fff;
    background: var(--visitor-coral);
    font-size: 0.66rem;
    letter-spacing: 0;
}

.visitor-location-list {
    max-height: 395px;
    padding-top: 0.5rem;
    overflow-y: auto;
    scrollbar-color: #cfd4da transparent;
    scrollbar-width: thin;
}

.visitor-location-item {
    display: grid;
    grid-template-columns: 0.72rem minmax(0, 1fr);
    gap: 0.72rem;
    align-items: start;
    padding: 0.72rem 0.15rem;
}

.visitor-location-marker {
    width: 0.64rem;
    height: 0.64rem;
    margin-top: 0.25rem;
    border-radius: 50%;
    background: var(--visitor-marker-color, var(--visitor-orange));
    box-shadow: 0 0 0 7px color-mix(in srgb, var(--visitor-marker-color, var(--visitor-orange)) 14%, transparent);
}

.visitor-location-copy {
    min-width: 0;
}

.visitor-location-name {
    margin: 0;
    color: #203137;
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.22;
}

.visitor-location-meta {
    margin: 0.25rem 0 0;
    color: var(--visitor-muted);
    font-size: 0.76rem;
}

.visitor-empty {
    display: flex;
    min-height: 12rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 1rem;
    color: var(--visitor-muted);
    text-align: center;
}

.visitor-empty i {
    color: #a9c3c0;
    font-size: 1.35rem;
}

.visitor-noscript {
    padding: 1rem;
    color: #8a4b34;
    background: #fff3ed;
    text-align: center;
}

@media (max-width: 991.98px) {
    .visitor-globe-stage {
        grid-template-columns: 1fr;
    }

    .visitor-location-panel {
        max-width: 590px;
        margin: 0 auto;
    }
}

@media (max-width: 575.98px) {
    .visitor-globe-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .visitor-globe-stage {
        gap: 1.5rem;
        min-height: 0;
        padding: 1rem 0.75rem 1.35rem;
    }

    .visitor-globe-visual {
        min-height: 470px;
    }

    .visitor-globe-canvas {
        min-height: 380px;
    }

    .visitor-globe-canvas canvas {
        position: relative;
        left: 50%;
        margin: 0;
        transform: translateX(-50%);
    }

    .visitor-summary-card {
        left: 50%;
        width: calc(100% - 0.5rem);
        transform: translateX(-50%);
    }

    .visitor-summary-numbers {
        gap: 0.65rem;
    }

    .visitor-summary-stat {
        gap: 0.35rem;
    }

    .visitor-summary-stat strong {
        font-size: 1.5rem;
    }

    .visitor-summary-stat > span {
        font-size: 0.78rem;
    }

    .visitor-summary-divider {
        height: 2.4rem;
    }

    .visitor-location-panel {
        padding: 1rem 0.9rem;
    }

    .visitor-tab {
        font-size: 0.72rem;
        letter-spacing: 0.05em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .visitor-loading-ring {
        animation: none;
    }
}

@media (min-width: 992px) {
    /* Keep the outer stage compact while scaling its contents independently. */
    .visitor-globe-stage {
        height: 280px;
        min-height: 280px;
        padding: 1rem 1.25rem;
        gap: 2rem;
        overflow: hidden;
    }

    .visitor-globe-visual {
        height: 288px;
        min-height: 288px;
        transform: none;
    }

    .visitor-globe-canvas {
        height: 240px;
        min-height: 240px;
        transform: translate(150px, -28px);
    }

    .visitor-summary-card {
        bottom: 34px;
        width: min(100%, 315px);
        padding: 0.65rem 0.85rem 0.6rem;
    }

    .visitor-location-panel {
        width: min(100%, 420px);
        max-height: 264px;
        justify-self: center;
        padding: 0.8rem 0.9rem;
        transform: translateY(-22px);
    }

    .visitor-location-list {
        max-height: 190px;
        padding-top: 0.3rem;
    }

    .visitor-location-item {
        padding: 0.48rem 0.1rem;
    }

    /* 标题与说明 */
    .visitor-globe-header h6 {
        font-size: 1rem;
    }

    .visitor-globe-header p {
        font-size: 0.78rem;
    }

    .visitor-data-badge {
        font-size: 0.66rem;
    }

    /* 7、6 等统计数字 */
    .visitor-summary-stat strong {
        font-size: 1.55rem;
    }

    /* Total visits、Places */
    .visitor-summary-stat > span {
        font-size: 0.76rem;
    }

    /* Countries: ... */
    .visitor-country-line {
        font-size: 0.72rem;
    }

    /* Past Visitors、Current */
    .visitor-tab {
        font-size: 0.7rem;
    }

    /* Current 后面的数字 */
    .visitor-current-count {
        font-size: 0.56rem;
    }

    /* Japan, Tokyo... 等地点 */
    .visitor-location-name {
        font-size: 0.82rem;
    }

    /* Last seen... */
    .visitor-location-meta {
        font-size: 0.66rem;
    }
}
