/* ==================== 全球访客 3D 地球 ==================== */

.earth-page {
    background: #02040a;
    color: #e6edf3;
}

.earth-page .navbar {
    background: rgba(2, 4, 10, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(46, 91, 255, 0.2);
}

/* 主舞台 */
.earth-stage {
    position: relative;
    height: 92vh;
    min-height: 560px;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #0a1030 0%, #05081a 55%, #02040a 100%);
}

.earth-stage #earthCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* 星空粒子背景 */
.earth-stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.earth-stars .star {
    position: absolute;
    border-radius: 50%;
    background: #fff;
    animation: starTwinkle 3s ease-in-out infinite;
}

@keyframes starTwinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

/* 加载状态 */
.earth-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: rgba(230, 237, 243, 0.7);
    font-size: 14px;
    letter-spacing: 2px;
    text-align: center;
}

.earth-loading.hidden {
    display: none;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(46, 91, 255, 0.2);
    border-top-color: #2e5bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 数据面板 */
.earth-panel {
    position: absolute;
    top: 110px;
    left: 24px;
    z-index: 4;
    background: rgba(8, 12, 28, 0.75);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(46, 91, 255, 0.25);
    border-radius: 16px;
    padding: 20px 24px;
    max-width: 320px;
    box-shadow: 0 0 40px rgba(46, 91, 255, 0.15);
}

.earth-panel-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #5b8cff, #00d9ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.earth-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

.earth-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.earth-stat .stat-num {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 20px rgba(46, 91, 255, 0.5);
}

.earth-stat .stat-label {
    font-size: 12px;
    color: rgba(230, 237, 243, 0.55);
    white-space: nowrap;
}

.earth-hint {
    font-size: 12px;
    color: rgba(230, 237, 243, 0.45);
    line-height: 1.7;
}

/* 访客列表面板 */
.earth-list {
    position: absolute;
    right: 24px;
    top: 110px;
    z-index: 4;
    width: 260px;
    background: rgba(8, 12, 28, 0.75);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(46, 91, 255, 0.2);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(46, 91, 255, 0.12);
}

.earth-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(230, 237, 243, 0.85);
    border-bottom: 1px solid rgba(46, 91, 255, 0.15);
}

.earth-list-toggle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(46, 91, 255, 0.4);
    background: transparent;
    color: #5b8cff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.earth-list-toggle:hover {
    background: rgba(46, 91, 255, 0.2);
}

.earth-list.collapsed .earth-list-body {
    display: none;
}

.earth-list-body {
    list-style: none;
    max-height: 280px;
    overflow-y: auto;
    padding: 8px 0;
}

.earth-list-body::-webkit-scrollbar {
    width: 4px;
}

.earth-list-body::-webkit-scrollbar-thumb {
    background: rgba(46, 91, 255, 0.4);
    border-radius: 2px;
}

.earth-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 18px;
    font-size: 13px;
    transition: background 0.2s ease;
}

.earth-list-item:hover {
    background: rgba(46, 91, 255, 0.1);
}

.earth-list-item .loc {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(230, 237, 243, 0.8);
}

.earth-list-item .loc .flag {
    font-size: 16px;
}

.earth-list-item .count {
    color: #5b8cff;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.earth-list-empty {
    padding: 20px;
    text-align: center;
    color: rgba(230, 237, 243, 0.4);
    font-size: 13px;
}

/* 说明区 */
.earth-about {
    padding: var(--space-2xl) 0;
    background: #05081a;
}

.earth-about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-md);
}

.earth-about-card {
    background: rgba(13, 19, 40, 0.8);
    border: 1px solid rgba(46, 91, 255, 0.15);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
}

.earth-about-card:hover {
    border-color: rgba(46, 91, 255, 0.5);
    box-shadow: 0 0 30px rgba(46, 91, 255, 0.15);
    transform: translateY(-3px);
}

.earth-about-card h3 {
    font-size: 17px;
    color: #5b8cff;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.earth-about-card p {
    font-size: 14px;
    color: rgba(230, 237, 243, 0.65);
    line-height: 1.8;
}

/* 响应式 */
@media (max-width: 768px) {
    .earth-stage {
        height: 88vh;
    }

    .earth-panel {
        left: 12px;
        right: 12px;
        top: auto;
        bottom: 16px;
        max-width: none;
        padding: 14px 18px;
    }

    .earth-panel-title {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .earth-stats {
        gap: 16px;
    }

    .earth-stat .stat-num {
        font-size: 20px;
    }

    .earth-list {
        right: 12px;
        top: 90px;
        width: 200px;
    }

    .earth-hint {
        display: none;
    }
}
