/* 统计页面样式 */

/* 统计概览 */
.statistics-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 20px 25px;
    background: var(--bg-primary);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.overview-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 20px 15px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.overview-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.overview-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.overview-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.overview-label {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* 统计区域 */
.statistics-section {
    background: var(--bg-primary);
    padding: 20px 25px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.btn-icon {
    background: var(--bg-secondary);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--primary-color);
    transform: rotate(90deg);
}

.btn-icon:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
}

/* 排行榜列表 */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.ranking-item:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
    transform: translateX(4px);
}

/* 歌手统计列表 */
.singer-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.singer-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.singer-item:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.singer-rank {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 40px;
    text-align: center;
}

.singer-rank.gold {
    color: #ffd700;
    text-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
}

.singer-rank.silver {
    color: #c0c0c0;
    text-shadow: 0 2px 4px rgba(192, 192, 192, 0.3);
}

.singer-rank.bronze {
    color: #cd7f32;
    text-shadow: 0 2px 4px rgba(205, 127, 50, 0.3);
}

.singer-info {
    flex: 1;
    margin-left: 15px;
    min-width: 0;
}

.singer-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.singer-song-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.singer-stats {
    text-align: right;
    min-width: 80px;
}

.singer-play-count {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.singer-play-label {
    font-size: 0.75rem;
    color: var(--text-light);
}

.ranking-rank {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 40px;
    text-align: center;
}

.ranking-rank.gold {
    color: #ffd700;
    text-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
}

.ranking-rank.silver {
    color: #c0c0c0;
    text-shadow: 0 2px 4px rgba(192, 192, 192, 0.3);
}

.ranking-rank.bronze {
    color: #cd7f32;
    text-shadow: 0 2px 4px rgba(205, 127, 50, 0.3);
}

.ranking-info {
    flex: 1;
    margin-left: 15px;
}

.ranking-song-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-singer {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.ranking-stats {
    text-align: right;
    min-width: 80px;
}

.ranking-play-count {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.ranking-play-label {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* 所有统计列表 */
.filter-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.filter-controls #searchInput {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--bg-secondary);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.filter-controls #searchInput:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-controls #sortBy {
    padding: 10px 15px;
    border: 1px solid var(--bg-secondary);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-controls #sortBy:focus {
    outline: none;
    border-color: var(--primary-color);
}

.statistics-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.statistics-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 15px;
    align-items: center;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.statistics-item:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.statistics-song-info {
    overflow: hidden;
    min-width: 0;
}

.statistics-song-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.statistics-singer {
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.statistics-play-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}

.statistics-count-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
}

.statistics-count-label {
    font-size: 0.7rem;
    color: var(--text-light);
    white-space: nowrap;
}

.statistics-time {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    min-width: 70px;
    max-width: 100px;
}

.statistics-time-label {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-bottom: 2px;
    white-space: nowrap;
}

.statistics-time-value {
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h4 {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 0.9rem;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* 错误状态 */
.error-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.error-state-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.error-state h4 {
    margin-bottom: 10px;
    color: var(--text-primary);
}

.error-state p {
    font-size: 0.9rem;
    margin-bottom: 15px;
}

/* 移动端优化 */
@media (max-width: 480px) {
    .statistics-overview {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 15px 20px;
    }

    .overview-card {
        padding: 12px 8px;
    }

    .overview-icon {
        font-size: 1.3rem;
        margin-bottom: 5px;
    }

    .overview-value {
        font-size: 1.1rem;
        margin-bottom: 3px;
    }

    .overview-label {
        font-size: 0.65rem;
    }

    .statistics-section {
        padding: 15px 20px;
    }

    .section-header {
        margin-bottom: 12px;
    }

    .section-header h2 {
        font-size: 1rem;
    }

    .btn-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    /* 移动端筛选控件 */
    .filter-controls {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 12px;
    }

    .filter-controls #searchInput,
    .filter-controls #sortBy {
        width: 100%;
        padding: 9px 12px;
        font-size: 0.85rem;
    }

    /* 移动端统计列表 - 保持同行显示 */
    .statistics-item {
        grid-template-columns: 1fr auto auto;
        gap: 8px;
        padding: 12px 10px;
    }

    .statistics-song-info {
        min-width: 0;
    }

    .statistics-song-name {
        font-size: 0.85rem;
        margin-bottom: 2px;
    }

    .statistics-singer {
        font-size: 0.7rem;
    }

    .statistics-play-count {
        min-width: 40px;
    }

    .statistics-count-value {
        font-size: 1rem;
    }

    .statistics-count-label {
        font-size: 0.65rem;
    }

    .statistics-time {
        min-width: 60px;
        max-width: 80px;
    }

    .statistics-time-label {
        font-size: 0.65rem;
    }

    .statistics-time-value {
        font-size: 0.75rem;
    }

    /* 移动端排行榜 */
    .ranking-item {
        padding: 12px 10px;
        gap: 8px;
    }

    .ranking-rank {
        font-size: 1.1rem;
        min-width: 28px;
    }

    .ranking-info {
        margin-left: 8px;
        min-width: 0;
        flex: 1;
    }

    .ranking-song-name {
        font-size: 0.85rem;
        margin-bottom: 2px;
    }

    .ranking-singer {
        font-size: 0.7rem;
    }

    .ranking-stats {
        min-width: 50px;
        text-align: right;
    }

    .ranking-play-count {
        font-size: 1rem;
    }

    .ranking-play-label {
        font-size: 0.65rem;
    }

    /* 移动端歌手统计 */
    .singer-item {
        padding: 12px 10px;
        gap: 8px;
    }

    .singer-rank {
        font-size: 1.1rem;
        min-width: 28px;
    }

    .singer-info {
        margin-left: 8px;
        min-width: 0;
        flex: 1;
    }

    .singer-name {
        font-size: 0.85rem;
        margin-bottom: 2px;
    }

    .singer-song-count {
        font-size: 0.7rem;
    }

    .singer-stats {
        min-width: 50px;
        text-align: right;
    }

    .singer-play-count {
        font-size: 1rem;
    }

    .singer-play-label {
        font-size: 0.65rem;
    }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
    .statistics-overview {
        gap: 6px;
        padding: 12px 15px;
    }

    .overview-card {
        padding: 10px 6px;
    }

    .overview-icon {
        font-size: 1.2rem;
    }

    .overview-value {
        font-size: 1rem;
    }

    .overview-label {
        font-size: 0.6rem;
    }

    .statistics-section {
        padding: 12px 15px;
    }

    .section-header h2 {
        font-size: 0.95rem;
    }

    /* 超小屏幕统计列表 */
    .statistics-item {
        padding: 10px 8px;
        gap: 6px;
    }

    .statistics-song-name {
        font-size: 0.8rem;
    }

    .statistics-singer {
        font-size: 0.65rem;
    }

    .statistics-play-count {
        min-width: 35px;
    }

    .statistics-count-value {
        font-size: 0.95rem;
    }

    .statistics-count-label {
        font-size: 0.6rem;
    }

    .statistics-time {
        min-width: 50px;
        max-width: 70px;
    }

    .statistics-time-value {
        font-size: 0.7rem;
    }

    /* 超小屏幕排行榜 */
    .ranking-item {
        padding: 10px 8px;
    }

    .ranking-rank {
        font-size: 1rem;
        min-width: 25px;
    }

    .ranking-song-name {
        font-size: 0.8rem;
    }

    .ranking-singer {
        font-size: 0.65rem;
    }

    .ranking-play-count {
        font-size: 0.95rem;
    }
}

/* 动画 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ranking-item,
.statistics-item {
    animation: slideIn 0.3s ease;
}

/* 高亮动画 */
@keyframes highlight {
    0%, 100% {
        background: var(--bg-secondary);
    }
    50% {
        background: rgba(99, 102, 241, 0.1);
    }
}

.ranking-item.refreshing,
.statistics-item.refreshing {
    animation: highlight 0.5s ease;
}
