/* web/leaderboard/leaderboard.css - 英语风云榜移动端特化专属样式表 */
:root {
    --gold: #f59e0b;
    --gold-bg: #fef3c7;
    --silver: #64748b;
    --silver-bg: #f1f5f9;
    --bronze: #b45309;
    --bronze-bg: #ffedd5;
}

.leaderboard-container {
    padding-bottom: 96px; position: relative; width: 100%;
    box-sizing: border-box; overflow-x: hidden;
}

/* 头部导航 */
.lb-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0 12px; border-bottom: 1px solid var(--border-color);
}
.lb-back-btn, .lb-quiz-btn {
    font-size: 0.88rem; font-weight: 700; color: var(--primary);
    text-decoration: none; padding: 4px 8px; border-radius: var(--radius-sm); white-space: nowrap;
}
.lb-quiz-btn { background: #eef2ff; }
.lb-title { font-size: 1.10rem; font-weight: 800; color: var(--text-main); }

/* 年级筛选胶囊条 */
.grade-filter-bar {
    display: flex; gap: 6px; margin: 12px 0 10px;
    background: #f1f5f9; padding: 4px; border-radius: 24px;
}
.grade-pill-btn {
    flex: 1; border: none; background: transparent; padding: 6px 0;
    border-radius: 20px; font-size: 0.85rem; font-weight: 700;
    color: var(--text-muted); cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.grade-pill-btn.active {
    background: #ffffff; color: var(--primary); box-shadow: var(--shadow-sm);
}

/* 指标横向滚动选项卡 */
.metric-tabs-wrapper {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; margin: 0 -12px 12px; padding: 0 12px;
}
.metric-tabs-wrapper::-webkit-scrollbar { display: none; }
.metric-tabs-scroll { display: flex; gap: 6px; width: max-content; padding: 2px 0; }
.metric-tab {
    display: flex; align-items: center; gap: 4px;
    border: 1px solid var(--border-color); background: #ffffff;
    padding: 6px 12px; border-radius: 20px; font-size: 0.82rem;
    font-weight: 700; color: var(--text-main); cursor: pointer;
    white-space: nowrap; transition: all 0.2s;
}
.metric-tab.active {
    background: var(--primary); color: #ffffff;
    border-color: var(--primary); box-shadow: 0 3px 8px rgba(79, 70, 229, 0.25);
}

/* 当前榜单说明卡片 */
.metric-intro-card {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    background: #ffffff; border: 1px solid var(--border-color);
    border-radius: var(--radius-md); padding: 9px 12px; margin-bottom: 14px; box-sizing: border-box;
}
.intro-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.intro-icon { font-size: 22px; flex-shrink: 0; }
.intro-title-col { min-width: 0; flex: 1; }
.intro-title-row { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.intro-title { font-size: 0.90rem; font-weight: 800; color: var(--text-main); white-space: nowrap; }
.season-badge {
    background: #eff6ff; color: #2563eb; padding: 1px 6px;
    border-radius: 10px; font-size: 0.68rem; font-weight: 700; white-space: nowrap; flex-shrink: 0;
}
.intro-desc {
    font-size: 0.72rem; color: var(--text-muted); margin-top: 1px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.intro-count-badge {
    font-size: 0.72rem; font-weight: 700; color: var(--primary);
    background: #eef2ff; padding: 3px 8px; border-radius: 12px; white-space: nowrap; flex-shrink: 0;
}

/* 通用自适应头像容器 */
.avatar-circle {
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    overflow: hidden; position: relative; user-select: none;
    background-size: cover; background-position: center; flex-shrink: 0;
}
.avatar-img { width: 100%; height: 100%; object-fit: cover; }
.avatar-circle.boy { background: linear-gradient(135deg, #dbeafe 0%, #93c5fd 100%); }
.avatar-circle.girl { background: linear-gradient(135deg, #fce7f3 0%, #f472b6 100%); }

/* 前三名领奖台 */
.podium-section {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: flex-end; gap: 6px; margin-bottom: 18px; padding-top: 20px;
    width: 100%; box-sizing: border-box;
}
.podium-card {
    background: #ffffff; border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md); padding: 12px 4px 10px; text-align: center;
    position: relative; box-shadow: var(--shadow-sm); display: flex;
    flex-direction: column; align-items: center; width: 100%;
    box-sizing: border-box; min-width: 0; overflow: hidden;
}
.podium-card.podium-slot-1,
.podium-card.rank-1 {
    order: 2; border-color: #fcd34d;
    background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.18);
    padding-top: 18px; padding-bottom: 12px;
    transform: translateY(-10px); z-index: 2;
}
.podium-card.podium-slot-2,
.podium-card.rank-2 {
    order: 1; border-color: #cbd5e1;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    transform: translateY(4px); z-index: 1;
}
.podium-card.podium-slot-3,
.podium-card.rank-3 {
    order: 3; border-color: #fed7aa;
    background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
    transform: translateY(4px); z-index: 1;
}

.podium-badge {
    position: absolute; top: -14px; font-size: 22px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}
.podium-card.podium-slot-1 .podium-badge,
.podium-card.rank-1 .podium-badge { font-size: 28px; top: -18px; }

.podium-avatar {
    width: 44px; height: 44px; font-size: 22px; margin-bottom: 4px;
    border: 2.5px solid #ffffff; box-shadow: var(--shadow-sm);
}
.podium-card.podium-slot-1 .podium-avatar,
.podium-card.rank-1 .podium-avatar {
    width: 54px; height: 54px; font-size: 28px; border-color: #fef3c7;
}

.podium-name {
    font-size: 0.82rem; font-weight: 800; color: var(--text-main);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 96%; width: 100%; line-height: 1.25;
}
.podium-grade {
    font-size: 0.65rem; color: var(--text-muted); margin: 1px 0 3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 96%; width: 100%; line-height: 1.2;
}
.podium-score {
    font-size: 0.76rem; font-weight: 800; color: var(--primary); background: #f1f5f9;
    padding: 2px 6px; border-radius: 10px; display: inline-block;
    white-space: nowrap; max-width: 96%; overflow: hidden; text-overflow: ellipsis; line-height: 1.2;
}
.podium-card.rank-1 .podium-score { background: var(--gold-bg); color: #b45309; }

/* 4名及以后排行榜列表 */
.ranking-list { display: flex; flex-direction: column; gap: 6px; width: 100%; box-sizing: border-box; }
.ranking-item {
    display: flex; align-items: center; background: #ffffff;
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
    padding: 9px 10px; gap: 8px; box-shadow: var(--shadow-sm); transition: transform 0.2s;
    width: 100%; box-sizing: border-box; min-width: 0;
}
.rank-num {
    font-size: 0.88rem; font-weight: 800; color: var(--text-muted);
    width: 26px; text-align: center; flex-shrink: 0;
}
.item-avatar { width: 36px; height: 36px; font-size: 20px; flex-shrink: 0; }
.item-info {
    flex: 1; min-width: 0; display: flex; flex-direction: column;
    justify-content: center; gap: 2px; overflow: hidden;
}
.item-name-row { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; }
.item-name {
    font-size: 0.88rem; font-weight: 700; color: var(--text-main);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 80px; flex-shrink: 1;
}
.me-tag {
    font-size: 0.65rem; background: #fef3c7; color: #b45309; font-weight: 800;
    padding: 1px 4px; border-radius: 6px; border: 1px solid #fde68a; flex-shrink: 0; white-space: nowrap;
}
.item-grade {
    font-size: 0.70rem; color: var(--text-light); white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; line-height: 1.2;
}
.item-score-pill {
    font-size: 0.82rem; font-weight: 800; color: var(--primary);
    background: #eef2ff; padding: 3px 8px; border-radius: 12px;
    white-space: nowrap; flex-shrink: 0; text-align: right;
}
.item-tier-pill {
    font-size: 0.80rem; font-weight: 800;
    padding: 3px 8px; border-radius: 12px;
    white-space: nowrap; flex-shrink: 0; text-align: right;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.my-rank-tier-pill {
    font-size: 0.78rem; font-weight: 800;
    padding: 2px 8px; border-radius: 10px;
    white-space: nowrap; flex-shrink: 0;
}

/* 自身高亮状态 */
.ranking-item.highlight-self,
.podium-card.highlight-self {
    border: 1.5px solid #f59e0b !important; background: #fffdf5 !important;
    box-shadow: 0 3px 12px rgba(245, 158, 11, 0.20) !important;
}

/* 底部常驻卡 */
.bottom-spacer { height: 76px; }
.my-rank-sticky {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 520px; background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1.5px solid #e2e8f0; box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
    padding: 8px 12px max(8px, env(safe-area-inset-bottom)); z-index: 99; box-sizing: border-box;
}
.my-rank-content {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; width: 100%; min-width: 0;
}
.my-rank-left { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; overflow: hidden; }
.my-rank-pos {
    font-size: 1.05rem; font-weight: 900; color: var(--primary);
    white-space: nowrap; flex-shrink: 0; min-width: 24px; text-align: center;
}
.my-rank-mid { flex: 1; min-width: 0; overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
.my-rank-name-row { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; }
.my-rank-name {
    font-size: 0.85rem; font-weight: 800; color: var(--text-main);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 75px; flex-shrink: 1;
}
.my-rank-score {
    font-size: 0.80rem; font-weight: 800; color: var(--primary);
    white-space: nowrap; margin-left: auto; flex-shrink: 0;
}
.my-rank-tip {
    font-size: 0.68rem; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2;
}
.btn-locate-me {
    border: none; background: var(--primary); color: #ffffff;
    font-size: 0.78rem; font-weight: 700; padding: 6px 10px;
    border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap;
    flex-shrink: 0; box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

/* 荣耀段位徽章与星级样式 (手机端特化紧凑自适应) */
.tier-badge-pill {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 1px 5px; border-radius: 8px; font-size: 0.68rem; font-weight: 800;
    white-space: nowrap; flex-shrink: 0; line-height: 1.2; box-sizing: border-box;
}
.tier-podium-badge {
    display: inline-flex; align-items: center; justify-content: center; gap: 2px;
    margin: 2px 0 2px; padding: 1px 5px; border-radius: 8px; font-size: 0.65rem;
    font-weight: 800; white-space: nowrap; max-width: 96%; overflow: hidden;
    text-overflow: ellipsis; line-height: 1.2; box-sizing: border-box;
}
.tier-stars-text { letter-spacing: 0.5px; color: #f59e0b; font-size: 0.66rem; }
.sticky-progress-wrap { display: flex; align-items: center; gap: 4px; min-width: 0; margin-top: 1px; }
.sticky-progress-bar {
    width: 48px; height: 4px; background: #e2e8f0; border-radius: 3px; overflow: hidden; flex-shrink: 0;
}
.sticky-progress-fill {
    height: 100%; background: linear-gradient(90deg, #3b82f6, #6366f1);
    border-radius: 3px; transition: width 0.3s;
}
.sticky-progress-text { font-size: 0.65rem; color: #64748b; font-weight: 700; white-space: nowrap; flex-shrink: 0; }

/* 极小屏幕 (<= 360px) 响应式断点特化 */
@media (max-width: 360px) {
    .podium-section { gap: 4px; }
    .podium-card { padding: 10px 2px 8px; }
    .podium-avatar { width: 40px; height: 40px; font-size: 20px; }
    .podium-card.rank-1 .podium-avatar { width: 48px; height: 48px; font-size: 24px; }
    .podium-name { font-size: 0.76rem; }
    .tier-podium-badge { font-size: 0.60rem; padding: 1px 3px; }
    .podium-grade { font-size: 0.60rem; }
    .podium-score { font-size: 0.70rem; padding: 1px 4px; }
    .ranking-item { padding: 8px 6px; gap: 6px; }
    .item-avatar { width: 32px; height: 32px; font-size: 18px; }
    .item-name { max-width: 60px; font-size: 0.82rem; }
    .tier-badge-pill { font-size: 0.62rem; padding: 1px 4px; }
    .item-score-pill { font-size: 0.75rem; padding: 2px 6px; }
    .my-rank-name { max-width: 55px; font-size: 0.80rem; }
    .sticky-progress-bar { width: 36px; }
}
