/* ===== 2026-10-27 排行榜页改版 (Hermes) =====
 * 回滚: 删除模板里对本文件的引用即可
 * 风格: 蓝色调 #2563eb / 浅灰蓝背景 / 12px圆角 / 轻阴影
 */

/* 页面容器 */
.rank-page { background: #f8fafc; padding-bottom: 40px; }

/* ===== 分类导航 ===== */
.rank-cat-box {
    background: #fff;
    border-radius: 12px;
    padding: 20px 22px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}
.rank-cat-title {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.rank-cat-title::before {
    content: '';
    width: 4px; height: 16px;
    background: #2563eb;
    border-radius: 2px;
}
.rank-cat-list { display: flex; flex-wrap: wrap; gap: 8px; }
.rank-cat-list a {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 13px;
    text-decoration: none;
    transition: all .18s ease;
    border: 1px solid transparent;
}
.rank-cat-list a:hover {
    background: #e0e7ff;
    color: #2563eb;
    border-color: #c7d2fe;
}
.rank-cat-list a.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(37, 99, 235, .28);
}

/* ===== 合集卡片 ===== */
.rank-card {
    background: #fff;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
    border: 1px solid #eef2f7;
    overflow: hidden;
    transition: box-shadow .2s ease;
}
.rank-card:hover { box-shadow: 0 4px 16px rgba(15, 23, 42, .09); }

/* 卡片头 */
.rank-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(180deg, #fbfdff 0%, #fff 100%);
}
.rank-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
}
.rank-card-title:hover { color: #2563eb; }
.rank-card-meta {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 400;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 20px;
}
.rank-detail-link {
    font-size: 13px;
    color: #2563eb;
    text-decoration: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 8px;
    background: #eff6ff;
    transition: all .18s;
}
.rank-detail-link:hover { background: #2563eb; color: #fff; }

/* 卡片体：产品网格 */
.rank-card-body { padding: 18px 20px 20px; }
.rank-product-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}
/* 产品数量少时自动收窄，避免右侧大片空白 */
.rank-product-grid[data-count="1"] { grid-template-columns: repeat(1, minmax(0,1fr)); max-width: 140px; }
.rank-product-grid[data-count="2"] { grid-template-columns: repeat(2, minmax(0,1fr)); max-width: 280px; }
.rank-product-grid[data-count="3"] { grid-template-columns: repeat(3, minmax(0,1fr)); max-width: 420px; }
.rank-product-grid[data-count="4"] { grid-template-columns: repeat(4, minmax(0,1fr)); max-width: 560px; }
.rank-product-grid[data-count="5"] { grid-template-columns: repeat(5, minmax(0,1fr)); max-width: 700px; }
@media (max-width: 1199px) { .rank-product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 767px)  { .rank-product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* 单个产品 */
.rank-product {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 6px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all .18s ease;
    position: relative;
}
.rank-product:hover {
    background: #f8fafc;
    border-color: #dbeafe;
    transform: translateY(-2px);
}

/* Logo 统一容器 */
.rank-product-logo {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #eef2f7;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 9px;
    box-shadow: 0 1px 2px rgba(15,23,42,.05);
}
.rank-product-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    display: block;
}
/* Logo 视觉统一：强制内容撑满可用区，避免大小差异过大 */
.rank-product-logo {
    --pad: 8px;
}
.rank-product-logo img[src*="topic.svg"] {
    padding: 14px;
    opacity: .45;
}
.rank-product-name {
    font-size: 13px;
    color: #334155;
    text-align: center;
    font-weight: 500;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    width: 100%;
    word-break: break-all;
}
.rank-product:hover .rank-product-name { color: #2563eb; }

/* 前三名徽章 */
.rank-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.rank-badge-1 { background: linear-gradient(135deg,#fbbf24,#f59e0b); }
.rank-badge-2 { background: linear-gradient(135deg,#cbd5e1,#94a3b8); }
.rank-badge-3 { background: linear-gradient(135deg,#fb923c,#ea580c); }

/* 无产品时 */
.rank-empty {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.8;
    padding: 4px 0;
}

/* ===== 右侧栏 ===== */
.rank-side-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eef2f7;
    box-shadow: 0 1px 3px rgba(15,23,42,.06);
    overflow: hidden;
    margin-bottom: 16px;
}
.rank-side-head {
    padding: 15px 18px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}
.rank-side-head::before {
    content: '';
    width: 4px; height: 15px;
    background: #2563eb;
    border-radius: 2px;
}
.rank-side-list { padding: 8px 0; }
.rank-side-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 18px;
    text-decoration: none;
    transition: background .15s;
}
.rank-side-item:hover { background: #f8fafc; }
.rank-side-name {
    font-size: 13.5px;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    line-height: 1.6;
}
.rank-side-item:hover .rank-side-name { color: #2563eb; }
.rank-side-num {
    font-size: 11px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 分页 */
.rank-pager { padding: 18px 0 6px; }
