/* 首页新布局样式 - 优化版 */

/* 导航链接 */
.nav-links {
    margin: 10px 0;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-light);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 6px 14px;
    border: 1px solid var(--primary);
    border-radius: 20px;
    transition: all 0.3s;
    background: rgba(0, 102, 204, 0.1);
}

.nav-link:hover {
    background: var(--primary);
    color: white;
    transform: translateX(4px);
}

/* 新主网格布局 - 充满屏幕 */
.main-grid-new {
    flex: 1;
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 15px;
    padding: 15px 20px;
    width: 100%;
    height: calc(100vh - 140px);
    min-height: 600px;
    box-sizing: border-box;
}

/* 左侧面板 - 紧靠左边 */
.panel-left-new {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
    overflow: hidden;
}

/* 中央面板 - 地图主体 */
.panel-center-new {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    overflow: hidden;
    min-width: 0;
}

.map-container-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    box-shadow: var(--shadow);
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.map-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-light);
    margin: 0;
}

.map-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}

.legend-label {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.legend-gradient {
    width: 80px;
    height: 6px;
    background: linear-gradient(90deg, #1a4d6d, #2980b9, #e74c3c, #c0392b);
    border-radius: 3px;
}

.map-area {
    flex: 1;
    min-height: 0;
}

/* 右侧面板 - 确保显示 */
.panel-right-new {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
    overflow: hidden;
}

/* 年度概览样式优化 */
.yearly-overview {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    box-shadow: var(--shadow);
}

.yearly-overview h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-light);
    margin: 0 0 12px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.overview-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.overview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.overview-item:hover {
    background: rgba(0, 102, 204, 0.15);
    border-left-color: var(--primary);
}

.overview-icon {
    font-size: 1.2rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 102, 204, 0.2);
    border-radius: 8px;
}

.overview-data {
    flex: 1;
}

.overview-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-light);
    font-family: 'Courier New', monospace;
}

.overview-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1px;
}

/* 年龄分布优化 */
.age-distribution {
    flex: 0 0 240px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    box-shadow: var(--shadow);
}

.age-distribution h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-light);
    margin: 0 0 10px 0;
}

/* 地区排名优化 */
.region-ranking {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.region-ranking h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-light);
    margin: 0 0 12px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    flex: 1;
    padding-right: 5px;
}

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

.ranking-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 2px;
}

.rank-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    transition: all 0.3s;
    font-size: 0.85rem;
}

.rank-item:hover {
    background: rgba(0, 102, 204, 0.2);
    transform: translateX(3px);
}

.rank-num {
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    margin-right: 8px;
    flex-shrink: 0;
}

.rank-country {
    flex: 1;
    font-size: 0.85rem;
}

.rank-value {
    font-weight: 600;
    color: var(--primary-light);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.rank-item.highlight {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.rank-item.highlight .rank-num {
    background: var(--accent);
}

/* 趋势图表优化 */
.trend-chart-card {
    flex: 0 0 200px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.trend-chart-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-light);
    margin: 0 0 10px 0;
}

/* 新闻滚动条 */
.news-ticker {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.2), rgba(0, 168, 204, 0.2));
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.ticker-label {
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.ticker-content {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}

.ticker-content span {
    display: inline-block;
    padding: 0 25px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    animation: ticker 25s linear infinite;
}

@keyframes ticker {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* 响应式布局 */
@media (max-width: 1400px) {
    .main-grid-new {
        grid-template-columns: 260px 1fr 260px;
    }
}

@media (max-width: 1200px) {
    .main-grid-new {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }
    
    .panel-left-new,
    .panel-right-new {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .age-distribution,
    .trend-chart-card {
        flex: none;
    }
}

@media (max-width: 768px) {
    .main-grid-new {
        padding: 10px;
        gap: 10px;
    }
    
    .panel-left-new,
    .panel-right-new {
        grid-template-columns: 1fr;
    }
}
/* 中国地图数据弹窗 */
.china-modal {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    border-radius: 12px;
}

.china-modal.active {
    display: flex;
}

.china-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.china-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.china-modal-close:hover {
    background: rgba(233, 69, 96, 0.9);
    transform: scale(1.1);
}

.china-modal-image {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

/* USA Modal Styles */
.usa-modal { display: none; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); z-index: 1000; align-items: center; justify-content: center; backdrop-filter: blur(4px); border-radius: 12px; }
.usa-modal.active { display: flex; }
.usa-modal-content { position: relative; background: white; border-radius: 12px; max-width: 90%; max-height: 90%; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.5); animation: modalSlideIn 0.3s ease; }
.usa-modal-close { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; background: rgba(0,0,0,0.6); color: white; border: none; border-radius: 50%; font-size: 1.4rem; cursor: pointer; z-index: 10; transition: all 0.3s; display: flex; align-items: center; justify-content: center; }
.usa-modal-close:hover { background: rgba(233,69,96,0.9); transform: scale(1.1); }
.usa-modal-image { display: block; max-width: 100%; max-height: 70vh; object-fit: contain; }
