/* ========================
   榜单页面专属样式
   ======================== */

.rank-main {
    max-width: 900px;
    margin: 0 auto;
    padding: calc(var(--navbar-height) + 28px) 24px 56px;
}

.rank-container { display: flex; flex-direction: column; gap: 28px; }

/* 页面标题 */
.rank-header {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.rank-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; flex-shrink: 0;
}
.hot-icon { background: linear-gradient(135deg,#ff6b6b,#f59e0b); color:#fff; }
.discuss-icon { background: linear-gradient(135deg,#7c3aed,#5b6af0); color:#fff; }

.rank-header h1 { font-size: 1.6rem; font-weight: 800; letter-spacing:-.02em; margin-bottom: 3px; }
.rank-header p { font-size: .9rem; color: var(--text-secondary); }

.rank-switch {
    margin-left: auto;
    display: flex; gap: 6px;
    background: var(--bg-hover); padding: 4px; border-radius: 10px;
}
.rank-tab {
    display: flex; align-items: center; gap: 5px;
    padding: 6px 16px; border-radius: 8px;
    font-size: .88rem; color: var(--text-secondary);
    transition: all .15s;
}
.rank-tab:hover { background: var(--bg-secondary); color: var(--text); }
.rank-tab.active {
    background: var(--bg-secondary); color: var(--text);
    font-weight: 600; box-shadow: var(--shadow-sm);
}

/* 前三名领奖台 */
.rank-podium {
    display: flex;
    gap: 14px;
    justify-content: center;
    align-items: flex-end;
}
.podium-item {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px 14px;
    cursor: pointer;
    transition: border-color .18s, box-shadow .18s, transform .18s;
    text-decoration: none; color: inherit;
    flex: 1; max-width: 240px;
}
.podium-item:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-3px); }

.podium-item:nth-child(1) {
    border-color: #f59e0b;
    background: linear-gradient(to bottom, #fffbeb, var(--bg-secondary));
    order: 2; /* 第1名在中间 */
    padding-bottom: 20px;
}
[data-theme="dark"] .podium-item:nth-child(1) { background: linear-gradient(to bottom, #2d2200, var(--bg-secondary)); }
.podium-item:nth-child(2) { order: 1; }
.podium-item:nth-child(3) { order: 3; }

.podium-rank {
    font-size: 1.5rem; font-weight: 900; line-height: 1;
}
.rank-1 { color: #f59e0b; }
.rank-2 { color: #94a3b8; }
.rank-3 { color: #b45309; }

.podium-icon {
    width: 52px; height: 52px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; font-weight: 700; color: #fff;
}
.podium-name { font-size: .96rem; font-weight: 700; text-align: center; }
.podium-meta { font-size: .78rem; color: var(--text-muted); text-align: center; }

/* 榜单表格 */
.rank-list-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.rank-list-header {
    display: grid;
    grid-template-columns: 52px 1fr 100px 100px 120px;
    gap: 0;
    padding: 10px 16px;
    background: var(--bg-hover);
    font-size: .76rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .05em;
    border-bottom: 1px solid var(--border);
}

.rank-row {
    display: grid;
    grid-template-columns: 52px 1fr 100px 100px 120px;
    align-items: center;
    gap: 0;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background .15s;
    text-decoration: none; color: inherit;
}
.rank-row:last-child { border-bottom: none; }
.rank-row:hover { background: var(--bg-hover); }

.rank-num {
    font-size: 1.05rem; font-weight: 800; color: var(--text-muted);
    text-align: center;
}
.rank-num.top1 { color: #f59e0b; }
.rank-num.top2 { color: #94a3b8; }
.rank-num.top3 { color: #b45309; }

.rank-tool {
    display: flex; align-items: center; gap: 10px; min-width: 0;
}
.rank-tool-icon {
    width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: .95rem; font-weight: 700; color: #fff;
}
.rank-tool-name { font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-tool-desc { font-size: .75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rank-category {
    font-size: .78rem; color: var(--text-muted);
    background: var(--bg-hover); padding: 3px 8px; border-radius: 6px;
    white-space: nowrap; text-align: center;
    display: inline-flex; width: fit-content;
}

.rank-count {
    font-size: .9rem; font-weight: 700; color: var(--text);
}
.rank-count small { font-size: .72rem; font-weight: 400; color: var(--text-muted); }

.rank-trend {
    display: flex; align-items: center; gap: 4px;
    font-size: .78rem;
}
.trend-up { color: #22c55e; }
.trend-down { color: #ef4444; }
.trend-same { color: var(--text-muted); }

/* 响应式 */
@media (max-width: 700px) {
    .rank-list-header,
    .rank-row { grid-template-columns: 40px 1fr 80px 80px; }
    .rank-list-header span:last-child,
    .rank-row .rank-trend { display: none; }
    .rank-podium { flex-direction: row; flex-wrap: wrap; }
    .podium-item { order: unset !important; max-width: 200px; }
}
@media (max-width: 500px) {
    .rank-list-header,
    .rank-row { grid-template-columns: 36px 1fr 70px; }
    .rank-list-header span:nth-child(3),
    .rank-row .rank-category { display: none; }
}
