/* 世界地图SVG样式表 - 版本 1.0.1 */
/* 更新时间: 2024-01-XX */

/* 世界地图容器样式 */
.world-map-section {
    margin: 20px 0;
    padding: 0px;
    background: #000000;
    border-radius: 12px;
    border: 1px solid #000000;
    color: #ffffff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 1);
}

.world-map-section h4 {
    margin-top: 0px;
    margin-bottom: 10px;
    font-size: 18px;
    background: #000000;
    color: #ffffff;
    text-align: center;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 1);
}

.world-map-container {
    display: flex;
    flex-direction: column;
    margin: 0px 0;
    padding: 0px;
    background: #000000;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    /* 响应式容器 */
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    position: relative;
    min-height: 400px;
    gap: 20px;
    align-items: stretch;
}



/* SVG地图样式 - 响应式设计 */
.datamap {
    width: 100%;
    height: auto;
    background: #000000;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
    /* 响应式SVG */
    min-height: 200px;
    transition: all 0.3s ease;
    transform-origin: center center;
    display: block;
    position: relative;
    cursor: pointer;
}



/* 国家路径样式 */
.datamaps-subunit {
    transition: all 0.3s ease;
    cursor: pointer;
    stroke: #ffffff;
    stroke-width: 0.5;
    stroke-opacity: 0.8;
}

.datamaps-subunit:hover {
    fill: #4a90e2 !important;
    stroke-width: 1;
    stroke-opacity: 1;
    transform: scale(1.02);
    filter: brightness(1.1);
}

.datamaps-subunit.active {
    fill: #ff6b6b !important;
    stroke-width: 2;
    stroke: #ffffff;
    animation: pulse 2s infinite;
}



/* 热力图活跃状态 */
.datamaps-subunit.heatmap-active {
    animation: heatmapPulse 3s ease-in-out infinite;
}

/* 动画效果 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}



@keyframes heatmapPulse {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.1); }
    100% { filter: brightness(1); }
}

/* 工具提示样式 */
.map-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    max-width: 200px;
    word-wrap: break-word;
    /* 响应式工具提示 */
    font-size: clamp(10px, 2vw, 12px);
    padding: clamp(6px, 1.5vw, 8px) clamp(8px, 2vw, 12px);
}

.map-tooltip.show {
    opacity: 1;
}



/* 热力图图例样式已删除 */

/* 排名表格样式 */
.top-countries-table {
    width: 100%;
    max-width: 600px;
    height: 300px;
    padding: 0px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
    overflow-y: auto;
    margin: 20px auto 0;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}


.top-countries-table h5 {
    color: white;
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 18px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.top-countries-table table {
    width: 100%;
    border-collapse: collapse;
    color: white;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.top-countries-table th {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: bold;
    color: #4a90e2;
}

.top-countries-table th:last-child {
    text-align: right;
}

.top-countries-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.top-countries-table td:last-child {
    text-align: right;
}

.top-countries-table tr:nth-child(1) {
    background: rgba(74, 144, 226, 0.15);
}

.top-countries-table tr:nth-child(2) {
    background: rgba(74, 144, 226, 0.1);
}

.top-countries-table tr:nth-child(3) {
    background: rgba(74, 144, 226, 0.05);
}

/* 响应式设计 - 桌面端 */
@media (min-width: 1200px) {
    .world-map-container {
        flex-direction: column;
    }
    
    .datamap {
        max-width: 100%;
        min-height: 400px;
    }
    
    .top-countries-table {
        max-width: 800px;
        height: 350px;
    }
    
    .world-map-section h4 {
        font-size: 20px;
    }
}

/* 响应式设计 - 平板端 */
@media (max-width: 1199px) and (min-width: 768px) {
    .world-map-container {
        flex-direction: column;
    }
    
    .datamap {
        min-height: 300px;
    }
    
    .top-countries-table {
        max-width: 600px;
        height: 300px;
    }
    
    .world-map-section h4 {
        font-size: 18px;
    }
}

/* 响应式设计 - 手机端 */
@media (max-width: 767px) {
    .world-map-section {
        margin: 15px 0;
        padding: 15px;
    }
    
    .world-map-container {
        padding: 10px;
        margin: 10px 0;
        flex-direction: column;
        align-items: center;
    }
    
    .datamap {
        width: 100%;
        min-height: 250px;
        transform: scale(0.9);
    }
    
    .top-countries-table {
        width: 100%;
        max-width: 100%;
        height: 250px;
        margin: 15px auto 0;
    }
    
    .world-map-section h4 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .map-controls {
        gap: 8px;
        margin-top: 10px;
    }
    
    .map-btn {
        padding: 6px 12px;
        font-size: 12px;
        gap: 4px;
    }
    
    /* 热力图图例已删除 */
    
    .top-countries-table {
        margin-top: 15px;
        padding: 10px;
    }
    
    .top-countries-table h5 {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .top-countries-table table {
        font-size: 12px;
    }
    
    .top-countries-table th,
    .top-countries-table td {
        padding: 8px 6px;
    }
    
    /* 手机端优化工具提示 */
    .map-tooltip {
        max-width: 150px;
        font-size: 11px;
        padding: 6px 8px;
    }
}

/* 响应式设计 - 小屏手机 */
@media (max-width: 480px) {
    .world-map-section {
        padding: 10px;
    }
    
    .world-map-container {
        padding: 8px;
        flex-direction: column;
        align-items: center;
    }
    
    .datamap {
        width: 100%;
        min-height: 200px;
        transform: scale(0.85);
    }
    
    .top-countries-table {
        width: 100%;
        max-width: 100%;
        height: 200px;
        margin: 10px auto 0;
    }
    
    .world-map-section h4 {
        background: #000000;
        font-size: 14px;
    }
    

    
    /* 小屏手机优化工具提示 */
    .map-tooltip {
        max-width: 120px;
        font-size: 10px;
        padding: 4px 6px;
    }
    
    /* 热力条已删除 */
    
    /* 热力图图例已删除 */
}

/* 横屏模式优化 */
@media (orientation: landscape) and (max-height: 600px) {
    .world-map-section {
        background: #000000;
        margin: 10px 0;
        padding: 10px;
    }
    
    .world-map-container {
        background: #000000;
        padding: 8px;
    }
    
    .datamap {
        min-height: 180px;
        transform: scale(0.8);
    }
    
    .top-countries-table {
        display: none;
    }
    
    .world-map-section h4 {
        background: #000000;
        font-size: 14px;
        margin-bottom: 8px;
    }
    

}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .datamaps-subunit {
        stroke-width: 0.25;
    }
    
    .datamaps-subunit:hover {
        stroke-width: 0.5;
    }
    
    .datamaps-subunit.active {
        stroke-width: 1;
    }
}

/* 深色主题支持 */
@media (prefers-color-scheme: dark) {
    .datamap {
        background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    }
}

/* 减少动画偏好设置 */
@media (prefers-reduced-motion: reduce) {
    .datamaps-subunit,
    .map-tooltip {
        transition: none;
        animation: none;
    }
    
    .datamaps-subunit:hover {
        transform: none;
    }
    
    .datamaps-subunit.active,
    .datamaps-subunit.heatmap-active {
        animation: none;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .datamaps-subunit {
        stroke: #000000;
        stroke-width: 1;
    }
    
    .datamaps-subunit:hover {
        stroke: #000000;
        stroke-width: 2;
    }
    
    .map-tooltip {
        background: #000000;
        border: 2px solid #ffffff;
    }
}