/* ============================================================
   排行榜 - 严格按截图实现 (banchong.cn/leaderboard 风格)
   ============================================================ */
#ranking { 
    display: none; 
    background: #F6F7F9; 
    min-height: 100vh;
    padding: 24px 16px;
}
#ranking.active { display: block; }
.ranking-inner { 
    max-width: 640px; 
    margin: 0 auto; 
    padding: 0;
}

/* 二级 Tab 栏 - 居中窄宽度 */
/* 用 #ranking 提升权重，覆盖 base.css 里的同名样式 */
#ranking .tabbar {
    display: flex; align-items: center;
    gap: 190px;                  /* 两组 Tab 之间拉开距离 */
    padding-bottom: 0;
    margin-bottom: 20px;
    border-bottom: none;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}
#ranking .tab-group { display: inline-flex; align-items: center; gap: 0; background: #E5E7EB; padding: 4px; border-radius: 14px; box-shadow: inset 0 1px 3px rgba(17, 24, 39, 0.06), 0 1px 2px rgba(17, 24, 39, 0.03); }
#ranking .tab-divider {
    flex: 0 0 0px;              /* 分隔符仅作结构占位，不显示 */
    width: 0;
    height: 0;
    margin: 0;
    background: transparent;
}
.tab-btn {
    font-size: 14px; color: #6B7280;
    padding: 8px 18px;
    position: relative;
    cursor: pointer;
    background: transparent; border: none; border-radius: 10px;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    line-height: 1.4;
    white-space: nowrap;
    z-index: 1;
}
.tab-btn:hover { color: #374151; background: rgba(255, 255, 255, 0.45); }
.tab-btn.active { color: #FFFFFF; font-weight: 600; background: linear-gradient(135deg, #818CF8 0%, #4F46E5 100%); border-radius: 10px; box-shadow: 0 2px 8px rgba(79, 70, 229, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.25); transform: none; z-index: 2; }
.tab-btn.active::after { display: none; }
.tab-divider { width: 1px; height: 16px; background: #D1D5DB; margin: 0 16px; display: none; }

/* 榜单头部 - 居中窄宽度，标题+标签 */
.board-header {
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}
.board-title { 
    font-size: 18px; 
    font-weight: 700; 
    color: #111827; 
    line-height: 1.5;
}
.board-title-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    background: #4F46E5;
    color: #FFF;
    font-size: 12px;
    font-weight: 500;
    border-radius: 10px;
    vertical-align: middle;
}
.board-time  { 
    font-size: 13px; 
    color: #6B7280; 
    margin-top: 4px;
    display: block;
}
.board-actions { display: flex; align-items: center; gap: 8px; position: absolute; right: 0; }

/* 刷新按钮 */
.btn-icon-refresh {
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #999; font-size: 18px;
    cursor: pointer; border: 1px solid #E5E7EB; background: #FFF;
    transition: all 0.15s;
}
.btn-icon-refresh:hover { background: #FFF5E9; border-color: #4F46E5; color: #4F46E5; }

/* 导出按钮 */
.btn-export {
    height: 34px; padding: 0 14px; border: 1px solid #E5E7EB;
    border-radius: 17px; font-size: 13px;
    color: #999;
    background: #FFF;
    cursor: pointer; transition: all 0.15s;
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 34px;
    white-space: nowrap;
}
.btn-export:hover { background: #FFF5E9; border-color: #4F46E5; color: #4F46E5; }

/* 列表区 - 白卡居中 */
.ranking-card {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 4px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    max-width: 640px;
    margin: 0 auto;
}
.rank-list { display: flex; flex-direction: column; }

/* 列表行 - 前三名不再有彩色背景/边框，只有奖牌区别 */
.rank-item {
    height: 52px; padding: 0 20px;
    display: flex; align-items: center; gap: 12px;
    position: relative;
    transition: background .15s ease;
}
.rank-item:hover { background: #F9FAFB; }

/* 奖牌/排名 */
.rank-medal {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0; line-height: 1;
}
.rank-medal.none { font-size: 15px; font-weight: 600; color: #D1D5DB; }

/* 头像 */
.rank-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: #E5E7EB; color: #6B7280;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
    overflow: hidden;
}
.rank-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* 姓名 */
.rank-name { flex: 1; font-size: 15px; color: #111827; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 分数 - 第一名大橙字，其他小绿字，4名以后灰/绿 */
.rank-score { font-size: 16px; font-weight: 600; min-width: 40px; text-align: right; flex-shrink: 0; color: #059669; }
.rank-item.rank-1 .rank-score { font-size: 24px; font-weight: 700; color: #4F46E5; }
.rank-item.rank-2 .rank-score,
.rank-item.rank-3 .rank-score { font-size: 16px; color: #4F46E5; }

/* 奖牌勋章（行末） */
.rank-badge {
    font-size: 12px; padding: 2px 8px;
    border-radius: 4px; flex-shrink: 0;
}
.rank-badge.gold   { background: #FFF4D6; color: #B07A00; }
.rank-badge.silver { background: #EEF0F3; color: #5C6370; }
.rank-badge.bronze { background: #F8E8DC; color: #A0542C; }
.rank-badge.none   { color: #6B7280; }

/* 小组 PK 行 */
.team-item { flex-direction: column; height: auto; padding: 0; overflow: hidden; }
.team-head {
    height: 44px; padding: 0 20px;
    display: flex; align-items: center; gap: 16px; width: 100%;
    cursor: pointer; border: inherit; border-radius: inherit;
}
.team-body {
    width: 100%;
    background: #F9FAFB;
    padding: 12px 20px 12px 60px;
    border-top: 1px dashed #E5E7EB;
    display: none; flex-direction: column; gap: 8px;
    font-size: 14px; color: #4B5563;
}
.team-body.expanded { display: flex; }
.team-body .row { display: flex; justify-content: space-between; }
.team-body .row .name::before { content: '·  '; color: #6B7280; }
.team-toggle { margin-left: auto; font-size: 12px; color: #6B7280; }

/* 空状态 */
.ranking-empty { text-align: center; padding: 60px 20px; color: #6B7280; }
.ranking-empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
