/* ========================================
   Data Page Styles
   ======================================== */

/* Hero Section */
.data-hero {
    padding: calc(var(--header-height) + 60px) 0 40px;
    background: #ffffff;
    text-align: center;
}

.data-hero-content {
    margin-bottom: 40px;
}

.data-hero-title {
    font-size: 52px;
    font-weight: 700;
    color: #333;
    margin: 24px;
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text; */
}

.data-hero-subtitle {
    font-size: 18px;
    color: #333;
    margin: 0;
    margin-left: auto;
    margin-right: auto;
}

/* Stats Section with Background */
.data-stats-wrapper {
    background-image: url('../images/data_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    padding: 48px 0;
    margin-top: 32px;
}

.data-stats {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.data-stats .stat-item {
    text-align: center;
    flex: 1;
    min-width: 0;
}

.data-stats .stat-number {
    font-size: 56px;
    font-weight: 800;
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 50%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    display: inline;
}

.data-stats .stat-suffix {
    font-size: 42px;
    font-weight: 700;
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 50%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.data-stats .stat-label {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 8px 0 4px;
}

.data-stats .stat-sublabel {
    font-size: 16px;
    color: #333;
    margin: 0;
}

/* Number Animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-number.animated {
    animation: countUp 0.5s ease-out forwards;
}

/* Database Section */
.database-section {
    background: #ffffff;
    padding: 40px 0 80px;
}

/* Database Tabs Navigation */
.database-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 48px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.database-tabs .tab-item {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    border-radius: 24px;
    transition: all 0.3s ease;
    background: transparent;
    border: 1px solid transparent;
}

.database-tabs .tab-item:hover {
    color: #4f46e5;
    background: rgba(79, 70, 229, 0.05);
}

.database-tabs .tab-item.active {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.2);
}

/* Database Content */
.database-content {
    margin-bottom: 56px;
    scroll-margin-top: 120px;
}

.database-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

/* Country Grid */
.country-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px 32px;
    min-height: 100px;
}

/* 骨架屏加载效果 */
.country-grid.loading {
    position: relative;
}

.skeleton-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.skeleton-flag {
    width: 36px;
    height: 26px;
    border-radius: 4px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-text {
    width: 80px;
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* 国家项目样式 */
.country-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(20px);
    background: transparent;
    position: relative;
}

/* 入场动画完成后的状态 */
.country-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 悬浮效果 */
.country-item:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.06) 0%, rgba(168, 85, 247, 0.06) 100%);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.1);
}

.country-item:hover .country-name {
    color: #4f46e5;
    transform: translateX(4px);
}

.country-item:hover .country-flag {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 国旗样式 */
.country-flag {
    width: 36px;
    height: 26px;
    border-radius: 4px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* 国旗图片 */
.country-flag-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.country-flag-img.loaded {
    opacity: 1;
}

/* 国家名称 */
.country-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .country-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 992px) {
    .country-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .data-stats {
        flex-wrap: wrap;
        justify-content: center;
    }

    .data-stats .stat-item {
        flex: 0 0 calc(33.333% - 16px);
        margin-bottom: 24px;
    }

    .data-stats .stat-number {
        font-size: 42px;
    }

    .data-stats .stat-suffix {
        font-size: 32px;
    }
}

@media (max-width: 768px) {
    .data-hero-title {
        font-size: 32px;
    }

    .country-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .database-tabs {
        gap: 8px;
    }

    .database-tabs .tab-item {
        padding: 6px 14px;
        font-size: 13px;
    }

    .data-stats .stat-item {
        flex: 0 0 calc(50% - 12px);
    }

    .data-stats .stat-number {
        font-size: 36px;
    }

    .data-stats .stat-suffix {
        font-size: 28px;
    }

    .data-stats-wrapper {
        padding: 32px 0;
    }
}

@media (max-width: 480px) {
    .country-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px 24px;
    }

    .data-hero {
        padding-top: calc(var(--header-height) + 40px);
    }

    .data-hero-title {
        font-size: 28px;
    }

    .data-stats .stat-item {
        flex: 0 0 100%;
    }

    .data-stats .stat-number {
        font-size: 32px;
    }

    .data-stats .stat-suffix {
        font-size: 24px;
    }
}