/* ==================== 统计模块样式 ==================== */

.statistics-section {
    margin: 80px 0 60px;
    padding: 60px 0;
    /* 删除自定义背景,使用主题默认背景 */
    /* 删除顶部和底部横线 */
}

.statistics-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.statistics-header {
    text-align: center;
    margin-bottom: 48px;
}

.statistics-header h2 {
    margin: 0 0 12px;
    font-size: 2rem;
    color: var(--text-primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.statistics-header p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-secondary);
}

/* 统计卡片网格 - 单行布局 */
.statistics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 强制4列单行布局 */
    gap: 16px;
    /* 缩小间距 */
    margin-bottom: 48px;
}

.stat-card {
    /* 删除自定义背景,使用主题默认背景 */
    border: 2px solid var(--border-color);
    border-radius: 12px;
    /* 缩小圆角 */
    padding: 16px;
    /* 缩小内边距 */
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    /* 缩小高度 */
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    /* 缩小间距 */
    margin-bottom: 12px;
    /* 缩小间距 */
}

.stat-icon {
    font-size: 1.5rem;
    /* 缩小图标 */
    width: 40px;
    /* 缩小宽度 */
    height: 40px;
    /* 缩小高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border-radius: 10px;
    /* 缩小圆角 */
}

.stat-card-title {
    flex: 1;
}

.stat-card-title h3 {
    margin: 0 0 2px;
    /* 缩小间距 */
    font-size: 0.75rem;
    /* 缩小字体 */
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
    /* 防止换行 */
}

.stat-value {
    font-size: 1.5rem;
    /* 缩小字体 */
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    line-height: 1;
}

.stat-unit {
    font-size: 0.75rem;
    /* 缩小字体 */
    color: var(--text-muted);
    margin-left: 4px;
}

.stat-card-footer {
    margin-top: 8px;
    /* 缩小间距 */
    padding-top: 8px;
    /* 缩小间距 */
    border-top: 1px solid var(--border-color);
    font-size: 0.7rem;
    /* 缩小字体 */
    color: var(--text-muted);
    line-height: 1.3;
    /* 调整行高 */
}

/* 排行榜区域 */
.rankings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
}

.ranking-card {
    /* 删除自定义背景,使用主题默认背景 */
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
}

.ranking-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.ranking-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.ranking-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
    flex: 1;
}

.ranking-icon {
    font-size: 1.5rem;
}

.ranking-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    /* 删除自定义背景,使用主题默认背景 */
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.ranking-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.ranking-item:hover {
    /* 删除自定义背景,使用主题默认背景 */
    transform: translateX(4px);
}

.ranking-item:hover::before {
    transform: scaleY(1);
}

.ranking-position {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: white;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.ranking-position.top-1 {
    background: linear-gradient(135deg, var(--color-warning-light), var(--color-warning));
}

.ranking-position.top-2 {
    background: linear-gradient(135deg, var(--text-muted), var(--text-secondary));
}

.ranking-position.top-3 {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
}

.ranking-info {
    flex: 1;
    min-width: 0;
}

.ranking-name {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 0 4px;
}

.ranking-details {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

.ranking-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    flex-shrink: 0;
}

.ranking-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* 实时更新指示器 */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--color-success-bg);
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--color-success);
    font-weight: 600;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--color-success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* 响应式设计 */
/* 平板 - 2x2 布局 */
@media (max-width: 1024px) {
    .statistics-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2列布局 */
        gap: 12px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-icon {
        font-size: 1.3rem;
        width: 36px;
        height: 36px;
    }

    .stat-card-title h3 {
        font-size: 0.7rem;
    }

    .stat-value {
        font-size: 1.3rem;
    }
}

/* 移动端 - 单列布局 */
@media (max-width: 768px) {
    .statistics-section {
        margin: 60px 0 40px;
        padding: 40px 0;
    }

    .statistics-container {
        padding: 0 20px;
    }

    .statistics-header {
        margin-bottom: 32px;
    }

    .statistics-header h2 {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 8px;
    }

    .statistics-grid {
        grid-template-columns: 1fr;
        /* 单列布局 */
        gap: 16px;
        margin-bottom: 32px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-icon {
        font-size: 1.8rem;
        width: 48px;
        height: 48px;
    }

    .stat-card-title h3 {
        font-size: 0.85rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .stat-card-footer {
        font-size: 0.75rem;
    }

    .rankings-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .ranking-card {
        padding: 20px;
    }

    .ranking-item {
        padding: 10px;
    }

    .ranking-position {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .ranking-name {
        font-size: 0.85rem;
    }

    .ranking-value {
        font-size: 0.9rem;
    }
}

/* 加载动画 */
.stat-card,
.ranking-card {
    animation: fadeInUp 0.6s ease-out;
}

.stat-card:nth-child(1) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(2) {
    animation-delay: 0.2s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.3s;
}

.stat-card:nth-child(4) {
    animation-delay: 0.4s;
}

.ranking-card:nth-child(1) {
    animation-delay: 0.5s;
}

.ranking-card:nth-child(2) {
    animation-delay: 0.6s;
}

.ranking-card:nth-child(3) {
    animation-delay: 0.7s;
}

/* 数值更新动画 */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-value.updating {
    animation: countUp 0.3s ease-out;
}