/*
 * 分类页（Star 模板）—— 版式对齐 eeenav /favorites/{slug}
 *
 * 实测规格（1440 视口 @ eeenav 2026-11-07）：
 *   筛选卡      .taxonomy-selects   1410 × 186，白底，tab 14px 间隔 15px
 *   热门区      .tax-popular        1410 × 190，padding 20
 *   热门卡      .popular-item-a     186 × 150，border 1px #f1f1f1，radius 8
 *   排名水印    .item-index         100px，#f1f1f1，右下溢出
 *   列表卡      .posts-item         459 × 88，3 列，gap 10
 *   列表图标    .sites-icon         44 × 44
 *   圆角        卡片 12px / 内块 8px
 *
 * 前缀统一 st-catpage-，避免和首页的 st-site-* / st-cat-* 撞车
 * （详情页就因为撞车被压成 61px 横条，教训见 star-detail-sync.css）。
 */

/* ---------- 顶部头图 ---------- */
.st-catpage-hero {
    position: relative;
    margin: 0 0 14px;
    padding: 46px 24px 42px;
    border-radius: var(--radius-md, 12px);
    overflow: hidden;
    text-align: center;
    color: #fff;
    background: linear-gradient(128deg, var(--theme-color) 0%, #ff7a4d 62%, #ffa84d 100%);
}
/* 右下角一层柔光，避免纯色渐变太平 */
.st-catpage-hero::after {
    content: '';
    position: absolute;
    right: -8%;
    bottom: -60%;
    width: 60%;
    padding-top: 60%;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255, 255, 255, .28), transparent);
    pointer-events: none;
}
.st-catpage-title {
    position: relative;
    z-index: 1;
    margin: 0 0 10px;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: .04em;
    color: #fff;
}
.st-catpage-count {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0 0 12px;
    padding: 3px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    font-size: 13px;
    color: #fff;
}
.st-catpage-count i { font-size: 14px; opacity: .9; }
.st-catpage-page { font-size: 12px; opacity: .75; }
.st-catpage-desc {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    font-size: 13.5px;
    line-height: 1.7;
    color: rgba(255, 255, 255, .92);
}

/* ---------- 筛选卡 ---------- */
.st-catpage-filter {
    margin: 0 0 14px;
    padding: 16px 18px;
    border-radius: var(--radius-md, 12px);
    background: var(--card-bg, #fff);
    border: 1px solid var(--line-color);
}
.st-catpage-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 15px;
    padding-bottom: 12px;
    border-bottom: 1px dashed rgba(125, 125, 125, .16);
}
.st-catpage-tabs--sub { padding-top: 12px; }
.st-catpage-tab {
    font-size: 14px;
    line-height: 1.9;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
    transition: color .16s var(--ease);
}
.st-catpage-tab:hover { color: var(--theme-color); }
.st-catpage-tab.on { color: var(--theme-color); font-weight: 600; }

.st-catpage-sort {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    padding-top: 14px;
}
.st-catpage-sort-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-right: 14px;
}
.st-catpage-sort-label::after {
    content: '|';
    margin-left: 14px;
    color: var(--line-color);
}
.st-catpage-sort-item {
    position: relative;
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color .16s var(--ease);
}
.st-catpage-sort-item + .st-catpage-sort-item::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    margin: 0 .6em;
    border-radius: 50%;
    background: currentColor;
    vertical-align: .22em;
    opacity: .5;
}
.st-catpage-sort-item:hover { color: var(--theme-color); }
.st-catpage-sort-item.on { color: var(--theme-color); font-weight: 600; }

/* ---------- 最受欢迎的网址 ---------- */
.st-catpage-pop {
    display: flex;
    gap: 10px;
    margin: 0 0 14px;
    padding: 20px;
    border-radius: var(--radius-md, 12px);
    background: var(--card-bg, #fff);
    border: 1px solid var(--line-color);
}
.st-catpage-pop-head {
    flex: 0 0 168px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 6px 8px 6px 2px;
}
.st-catpage-pop-title {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    font-weight: 500;
    color: var(--text-muted);
}
.st-catpage-pop-title span { display: block; font-weight: 700; color: var(--text-color); }
.st-catpage-pop-cat {
    display: block;
    margin-bottom: 2px;
    font-style: normal;
    font-size: 15px;
    font-weight: 700;
    color: var(--theme-color);
}
.st-catpage-pop-more {
    display: inline-block;
    align-self: flex-start;
    padding: 6px 14px;
    border-radius: 6px;
    background: var(--muted-bg);
    font-size: 12.5px;
    color: var(--text-muted);
    text-decoration: none;
    transition: background .16s var(--ease), color .16s var(--ease);
}
.st-catpage-pop-more:hover { background: var(--theme-color); color: #fff; }

.st-catpage-pop-list {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
}
.st-catpage-pop-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 150px;
    padding: 18px 10px 14px;
    border: 1px solid #f1f1f1;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    background: var(--card-bg, #fff);
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}
.st-catpage-pop-item:hover {
    border-color: rgba(241, 64, 75, .35);
    box-shadow: 0 8px 22px -12px rgba(16, 24, 40, .28);
    transform: translateY(-2px);
}
.st-catpage-pop-item > * { position: relative; z-index: 1; }
.st-catpage-pop-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.st-catpage-pop-logo img { width: 45px; height: 45px; object-fit: contain; }
.st-catpage-pop-name {
    max-width: 100%;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.st-catpage-pop-views {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 999px;
    background: #fff8e6;
    font-size: 11.5px;
    color: #b8791b;
    font-variant-numeric: tabular-nums;
}
.st-catpage-pop-views i { font-size: 12px; }
/* 排名水印：右下角巨大数字，压在卡片底层 */
.st-catpage-pop-index {
    position: absolute;
    right: -4px;
    bottom: -30px;
    z-index: 0;
    font-style: normal;
    font-size: 100px;
    font-weight: 800;
    line-height: 1;
    color: #f4f5f7;
    pointer-events: none;
    user-select: none;
}

/* ---------- 站点列表（3 列） ---------- */
.st-catpage-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 14px;
}
.st-catpage-card {
    border-radius: var(--radius-md, 12px);
    background: var(--card-bg, #fff);
    border: 1px solid var(--line-color);
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.st-catpage-card:hover {
    border-color: rgba(241, 64, 75, .32);
    box-shadow: 0 10px 24px -16px rgba(16, 24, 40, .3);
}
.st-catpage-card-link {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    height: 100%;
    /* 实测 eeenav 列表卡 459×88：图标 44 + 标题 + 1 行描述 + 标签，padding 10~12。
       我们原来 padding 14/12/12/14 且描述给 2 行，整卡 118，一屏少看两行站。 */
    padding: 12px 12px 10px 12px;
    text-decoration: none;
}
.st-catpage-card-logo {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--muted-bg);
}
.st-catpage-card-logo img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    background: #fff;
}
.st-catpage-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.st-catpage-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.st-catpage-card-desc {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--text-muted);
}
.st-catpage-card-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    align-self: flex-start;
    margin-top: 2px;
    font-size: 11.5px;
    color: #e08a2e;
}
.st-catpage-card-tag i { font-size: 12px; }
.st-catpage-card-arrow {
    flex: 0 0 auto;
    align-self: flex-end;
    font-size: 16px;
    color: var(--line-color);
    transition: color .16s var(--ease), transform .16s var(--ease);
}
.st-catpage-card:hover .st-catpage-card-arrow { color: var(--theme-color); transform: translateX(2px); }

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
    .st-catpage-pop { flex-direction: column; }
    .st-catpage-pop-head { flex: none; flex-direction: row; align-items: center; gap: 12px; }
    .st-catpage-pop-title span { display: inline; }
    .st-catpage-pop-cat { display: inline; margin-right: 4px; }
    .st-catpage-pop-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .st-catpage-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .st-catpage-hero { padding: 34px 18px 30px; }
    .st-catpage-title { font-size: 22px; }
    .st-catpage-desc { font-size: 12.5px; }
    .st-catpage-pop { padding: 14px; }
    .st-catpage-pop-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .st-catpage-pop-item { min-height: 132px; }
    .st-catpage-list { grid-template-columns: minmax(0, 1fr); }
    /* 手机上 18 个分类 tab 换行要占三行，改成横向滚动（eeenav 用 overflow-x-auto） */
    .st-catpage-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .st-catpage-tabs::-webkit-scrollbar { display: none; }
    .st-catpage-tab { font-size: 13px; }
    .st-catpage-sort { overflow-x: auto; scrollbar-width: none; }
    .st-catpage-sort::-webkit-scrollbar { display: none; }
}
