/* 排行榜页面样式 */

/* 顶部导航 */
.rank-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
}

.rank-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-filter {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-filter:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 排行榜标签 */
.rank-tabs {
    display: flex;
    padding: 0 20px;
    gap: 8px;
    overflow-x: auto;
    background-color: var(--bg-secondary);
    padding-top: 12px;
    padding-bottom: 12px;
    -webkit-overflow-scrolling: touch;
}

.rank-tabs::-webkit-scrollbar {
    display: none;
}

.rank-tab {
    flex-shrink: 0;
    padding: 8px 20px;
    border: none;
    background-color: var(--bg-primary);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.rank-tab.active {
    background-color: var(--primary-color);
    color: white;
}

/* 我的排名 */
.my-rank-section {
    padding: 16px 20px;
    background-color: var(--bg-secondary);
}

.my-rank-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 16px;
    padding: 20px;
    color: white;
    box-shadow: 0 8px 24px rgba(255, 107, 107, 0.2);
}

.my-rank-card .rank-number {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 16px;
}

.rank-label {
    font-size: 14px;
    opacity: 0.9;
}

.rank-value {
    font-size: 32px;
    font-weight: 700;
}

.rank-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.my-rank-card .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.my-rank-card .user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.my-rank-card .user-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.my-rank-card .user-stats {
    display: flex;
    gap: 16px;
    font-size: 14px;
    opacity: 0.9;
}

.my-rank-card .stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rank-progress {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
}

.progress-text {
    font-size: 12px;
    margin-bottom: 8px;
    opacity: 0.9;
}

.rank-progress .progress-bar {
    height: 6px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.rank-progress .progress-fill {
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 3px;
    transition: width var(--transition-normal);
}

/* 排行榜列表 */
.rank-list-section {
    padding: 0 20px 80px;
}

.rank-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rank-item {
    display: flex;
    align-items: center;
    background-color: var(--bg-primary);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.rank-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* 前三名特殊样式 */
.rank-item.top-rank {
    position: relative;
    overflow: hidden;
}

.rank-item.rank-1 {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
}

.rank-item.rank-2 {
    background: linear-gradient(135deg, #C0C0C0 0%, #A8A8A8 100%);
    color: white;
}

.rank-item.rank-3 {
    background: linear-gradient(135deg, #CD7F32 0%, #B87333 100%);
    color: white;
}

.rank-medal {
    font-size: 28px;
    margin-right: 12px;
}

.rank-item .rank-number {
    width: 32px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
}

.rank-user {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.rank-user .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.rank-user .user-name {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 2px;
}

.rank-user .user-region {
    font-size: 12px;
    opacity: 0.7;
}

.top-rank .user-region {
    opacity: 0.9;
}

.rank-stats {
    text-align: center;
}

.rank-stats .stat-value {
    font-size: 18px;
    font-weight: 700;
}

.rank-stats .stat-label {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 2px;
}

.top-rank .stat-label {
    opacity: 0.9;
}

/* 加载更多 */
.loading-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    color: var(--text-tertiary);
    font-size: 14px;
}

/* 筛选模态框 */
.filter-section {
    margin: 20px 0;
}

.filter-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.filter-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.filter-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background-color: var(--bg-tertiary);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-option:hover {
    background-color: var(--bg-secondary);
}

.filter-option input[type="radio"] {
    margin-right: 8px;
}

.filter-option span {
    font-size: 14px;
    color: var(--text-secondary);
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.modal-actions button {
    flex: 1;
}

/* 响应式适配 */
@media screen and (max-width: 375px) {
    .rank-header h1 {
        font-size: 18px;
    }
    
    .rank-tab {
        padding: 6px 16px;
        font-size: 13px;
    }
    
    .rank-value {
        font-size: 28px;
    }
    
    .rank-item {
        padding: 12px;
    }
    
    .filter-options {
        grid-template-columns: 1fr;
    }
}