/* 排行榜页专用样式 */

/* 统计条 */
.stats-bar {
    background: var(--c-cash);
    border: var(--border-width) solid var(--c-dark);
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-x) var(--shadow-y) 0 var(--c-dark);
}

.stats-bar-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 900;
    font-family: "JetBrains Mono", monospace;
    color: var(--c-dark);
}

.stat-label {
    font-size: 0.9rem;
    font-weight: 700;
    opacity: 0.7;
}

/* 排行榜列表 */
.leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.leaderboard-item {
    background: white;
    border: var(--border-width) solid var(--c-dark);
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 4px 4px 0 #ddd;
    transition: 0.2s;
    cursor: pointer;
    position: relative;
    animation: slideInLeft 0.5s ease-out backwards;
}

.leaderboard-item:nth-child(1) { animation-delay: 0.1s; }
.leaderboard-item:nth-child(2) { animation-delay: 0.2s; }
.leaderboard-item:nth-child(3) { animation-delay: 0.3s; }
.leaderboard-item:nth-child(4) { animation-delay: 0.4s; }
.leaderboard-item:nth-child(5) { animation-delay: 0.5s; }
.leaderboard-item:nth-child(6) { animation-delay: 0.6s; }
.leaderboard-item:nth-child(7) { animation-delay: 0.7s; }
.leaderboard-item:nth-child(8) { animation-delay: 0.8s; }
.leaderboard-item:nth-child(9) { animation-delay: 0.9s; }
.leaderboard-item:nth-child(10) { animation-delay: 1s; }

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.leaderboard-item:hover {
    transform: translate(-3px, -3px);
    box-shadow: 6px 6px 0 var(--c-dark);
    background: #fffdf0;
}

/* 第一名特殊样式 */
.leaderboard-item.rank-1 {
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
    border-width: 4px;
}

.leaderboard-item.rank-1 .rank-badge {
    color: var(--c-cash);
    filter: drop-shadow(2px 2px 0 var(--c-dark));
}

.leaderboard-item.rank-1::before {
    content: "👑";
    position: absolute;
    top: -15px;
    left: 10px;
    font-size: 2rem;
    animation: crownFloat 2s ease-in-out infinite;
}

@keyframes crownFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* 排名徽章 */
.rank-badge {
    font-size: 2.5rem;
    font-weight: 900;
    font-family: "JetBrains Mono", monospace;
    color: var(--c-smoke);
    margin-right: 15px;
    display: inline-block;
    min-width: 60px;
}

/* 排行榜内容 */
.leaderboard-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-cost {
    font-size: 2rem;
    font-weight: 900;
    font-family: "JetBrains Mono", monospace;
    color: var(--c-fire);
}

.leaderboard-details {
    font-size: 0.95rem;
    color: var(--c-smoke);
    margin-top: 5px;
}

.leaderboard-tag {
    display: inline-block;
    background: var(--c-light);
    border: 2px solid var(--c-dark);
    padding: 3px 10px;
    margin-right: 10px;
    font-size: 0.9rem;
}

/* 进度条 */
.cost-progress {
    width: 100%;
    height: 8px;
    background: var(--c-light);
    border: 2px solid var(--c-dark);
    margin-top: 10px;
    overflow: hidden;
}

.cost-progress-bar {
    height: 100%;
    background: var(--c-fire);
    transition: width 1s ease-out;
}

/* 标签分布图 */
.tag-distribution {
    margin-top: 30px;
}

.tag-stat-item {
    margin-bottom: 15px;
}

.tag-stat-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-weight: 700;
}

.tag-stat-bar {
    height: 30px;
    background: var(--c-light);
    border: 2px solid var(--c-dark);
    position: relative;
    overflow: hidden;
}

.tag-stat-fill {
    height: 100%;
    background: var(--c-fire);
    transition: width 1s ease-out;
}

/* Tab切换 */
.tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.tab-btn {
    flex: 1;
    padding: 15px;
    border: 3px solid var(--c-dark);
    background: white;
    cursor: pointer;
    font-weight: 700;
    text-transform: uppercase;
    transition: 0.2s;
}

.tab-btn:hover {
    background: var(--c-light);
}

.tab-btn.active {
    background: var(--c-fire);
    color: white;
    box-shadow: 4px 4px 0 var(--c-dark);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .leaderboard-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .rank-badge {
        font-size: 2rem;
        min-width: 40px;
    }

    .leaderboard-cost {
        font-size: 1.5rem;
    }

    .stats-bar-content {
        flex-direction: column;
    }
}
