/* ============================================
   排行榜页面样式
   猫哥创作 | 2026-01-20
   ============================================ */

/* Hero区域 */
.leaderboard-hero {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(236, 72, 153, 0.1));
    border-bottom: 1px solid var(--border);
    padding: 3rem 0 2rem;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
}

.hero-title i {
    color: #f59e0b;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
}

/* 排行榜容器 */
.leaderboard-container {
    padding: 2rem 0;
}

/* 标签切换 */
.leaderboard-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: 12px;
    justify-content: center;
}

.tab-btn {
    padding: 1rem 2rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tab-btn i {
    font-size: 1.25rem;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 排行榜内容 */
.leaderboard-content {
    display: none;
}

.leaderboard-content.active {
    display: block;
}

/* Top 3 特殊展示 */
.top-three {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.top-card {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    position: relative;
    transition: all 0.3s;
}

.top-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

/* 第一名特殊样式 */
.top-card.rank-1 {
    border-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.1));
    transform: scale(1.05);
}

.top-card.rank-1:hover {
    transform: scale(1.05) translateY(-8px);
}

.top-card.rank-2 {
    border-color: #94a3b8;
}

.top-card.rank-3 {
    border-color: #cd7f32;
}

/* 排名徽章 */
.rank-badge {
    position: absolute;
    top: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    color: white;
    border: 3px solid var(--dark-lighter);
}

.rank-badge.gold {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.5);
}

.rank-badge.silver {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    box-shadow: 0 4px 16px rgba(148, 163, 184, 0.5);
}

.rank-badge.bronze {
    background: linear-gradient(135deg, #cd7f32, #b8631f);
    box-shadow: 0 4px 16px rgba(205, 127, 50, 0.5);
}

.rank-badge i {
    font-size: 1.5rem;
    margin-bottom: -0.25rem;
}

.rank-badge span {
    font-size: 0.875rem;
}

/* 头像 */
.top-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 4px solid var(--border);
    margin: 1.5rem auto 1rem;
}

.rank-1 .top-avatar {
    border-color: #f59e0b;
}

.rank-2 .top-avatar {
    border-color: #94a3b8;
}

.rank-3 .top-avatar {
    border-color: #cd7f32;
}

/* 名称和数据 */
.top-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.top-value {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.rank-1 .top-value {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.top-detail {
    font-size: 0.9375rem;
    color: var(--text-muted);
}

/* 4-20名列表 */
.rank-list {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rank-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s;
}

.rank-item:hover {
    transform: translateX(8px);
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.rank-number {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-muted);
}

.rank-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--border);
}

.rank-info {
    flex: 1;
}

.rank-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.375rem;
}

.rank-detail {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.rank-stats {
    display: flex;
    align-items: center;
    gap: 2rem;
    text-align: right;
}

.rank-main-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.rank-sub-value {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* 我的排名高亮 */
.rank-item.my-rank {
    border: 2px solid var(--primary);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    position: relative;
}

.rank-item.my-rank::before {
    content: 'YOU';
    position: absolute;
    top: -0.75rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* 响应式 */
@media (max-width: 1024px) {
    .top-three {
        grid-template-columns: 1fr;
        max-width: 400px;
    }
    
    .top-card.rank-1 {
        transform: scale(1);
        order: -1;
    }
    
    .top-card.rank-1:hover {
        transform: translateY(-8px);
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .leaderboard-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tab-btn {
        padding: 0.875rem 1.5rem;
        justify-content: center;
    }
    
    .top-card {
        padding: 1.5rem 1rem;
    }
    
    .top-avatar {
        width: 80px;
        height: 80px;
    }
    
    .top-value {
        font-size: 1.5rem;
    }
    
    .rank-item {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .rank-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
}

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

.top-card,
.rank-item {
    animation: fadeInUp 0.5s ease;
}

.top-card:nth-child(1) {
    animation-delay: 0.1s;
}

.top-card:nth-child(2) {
    animation-delay: 0s;
}

.top-card:nth-child(3) {
    animation-delay: 0.2s;
}

.rank-item:nth-child(n) {
    animation-delay: calc(0.05s * var(--index));
}
