/* ============================================================
 * rank.css — 流量消耗排行榜（rank.php）
 *
 * 视觉与全站 np 设计令牌（pages.css / panel.css 的 --np-*）统一：
 * 白底卡片、1px 细边框、大圆角、弱阴影、品牌蓝强调。
 * 主题（浅色/深色/跟随系统）由 <html data-theme> 驱动，
 * 因此本文件仅使用 --np-* 令牌，深色模式自动生效。
 *
 * 仅调整样式与结构，所有 DOM id / class 与 js/rank.js 的契约保持不变：
 *   #rankBodyFull / #podium1-3（.podium-name/.podium-value/.podium-avatar/
 *   .podium-letter/.podium-bar）/.rank-tab[data-period]/#rankPodium/#rankTableFull
 * ============================================================ */

.rank-page-section { padding: 22px; }

/* ---------- 周期切换（分段控件） ---------- */
.rank-period-tabs {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 26px;
}
.rank-tab {
    padding: 9px 24px;
    border: 1px solid var(--np-border-strong);
    border-radius: 999px;
    background: var(--np-subtle);
    color: var(--np-text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.rank-tab:hover:not(.active) {
    background: var(--np-card);
    color: var(--np-text);
    border-color: var(--np-primary);
}
.rank-tab.active {
    background: var(--np-primary);
    border-color: var(--np-primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(47, 107, 255, .30);
}

/* ---------- 领奖台 ---------- */
.rank-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 18px;
    margin-bottom: 34px;
    padding: 0 10px;
    min-height: 200px;
}
.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 112px;
    position: relative;
    padding-bottom: 8px;
}
/* 注意：podium-bar 高度为 js 按比例内联设置，此处仅负责外观与定位 */
.podium-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--np-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    order: 1;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
}
.podium-avatar-wrap { position: relative; margin-bottom: 8px; order: 2; z-index: 2; }
.podium-value {
    font-size: 13px;
    color: var(--np-primary);
    font-weight: 700;
    order: 3;
    position: relative;
    z-index: 2;
}
.podium-bar {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 72%;
    min-height: 44px;
    border-radius: 8px 8px 0 0;
    transition: height .8s ease;
    order: 4;
    z-index: 1;
    opacity: .92;
}
.podium-1st .podium-bar { background: linear-gradient(to top, #ffd700, #ffe066); }
.podium-2nd .podium-bar { background: linear-gradient(to top, #c0c0c0, #e0e0e0); }
.podium-3rd .podium-bar { background: linear-gradient(to top, #cd7f32, #daa06d); }

.podium-avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--np-card);
    box-shadow: var(--np-shadow);
    background: var(--np-subtle);
}
.podium-avatar-box {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--np-primary), var(--np-primary-dark));
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; position: relative;
}
.podium-1st .podium-avatar-box { width: 68px; height: 68px; background: linear-gradient(135deg, #ffd700, #ffaa00); border: 3px solid #ffd700; }
.podium-2nd .podium-avatar-box { border: 3px solid #c0c0c0; }
.podium-3rd .podium-avatar-box { border: 3px solid #cd7f32; }
.podium-letter {
    display: none;
    width: 100%; height: 100%;
    align-items: center; justify-content: center;
    color: #fff; font-size: 22px; font-weight: 700;
    position: absolute; top: 0; left: 0;
}
.podium-1st .podium-letter { font-size: 26px; }
.podium-badge {
    position: absolute; bottom: -4px; right: -4px;
    font-size: 18px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .2));
}
.podium-1st .podium-avatar { width: 68px; height: 68px; border-width: 3px; border-color: #ffd700; }

/* ---------- 完整排行表格 ---------- */
.rank-table-full {
    width: 100%;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
}
.rank-table-full th {
    padding: 13px 16px;
    text-align: left;
    font-size: 12px;
    letter-spacing: .03em;
    background: var(--np-subtle);
    color: var(--np-text-muted);
    font-weight: 650;
    border: none;
}
.rank-table-full td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--np-border);
    font-size: 14px;
    color: var(--np-text);
}
.rank-table-full tbody tr:last-child td { border-bottom: none; }
.rank-table-full tbody tr:hover { background: var(--np-primary-soft); }

.rank-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: var(--np-subtle); color: var(--np-text-muted);
}
.rank-gold { background: linear-gradient(135deg, #ffd700, #ffaa00) !important; color: #fff !important; }
.rank-silver { background: linear-gradient(135deg, #c0c0c0, #a0a0a0) !important; color: #fff !important; }
.rank-bronze { background: linear-gradient(135deg, #cd7f32, #a0522d) !important; color: #fff !important; }

.rank-user-cell { display: flex; align-items: center; gap: 10px; }
.rank-list-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.rank-list-noavatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--np-primary); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: bold;
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
    .rank-podium { gap: 10px; min-height: 160px; }
    .podium-item { width: 92px; }
    .podium-avatar, .podium-avatar-box { width: 48px; height: 48px; }
    .podium-1st .podium-avatar, .podium-1st .podium-avatar-box { width: 56px; height: 56px; }
    .rank-tab { padding: 8px 16px; font-size: 13px; }
}
