/* ==========================================================================
   分类页 · 新版
   ========================================================================== */
.page-cat { background: #f7f9fc; }
.page-cat .main-content { background: #f7f9fc; }

.cat-wrap { max-width: 1240px; margin: 0 auto; padding: 20px 20px 70px; }

/* 面包屑 */
.cat-crumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: #94a3b8; margin-bottom: 16px;
}
.cat-wrap {
    max-width: none;
    width: 100%;
    margin: 0 auto;
    padding: 20px 24px 70px;
    box-sizing: border-box;
}
.cat-crumb a:hover { color: #4a6cf7; }

/* 分类头部 */
.cat-hero {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, #eef3ff 0%, #f6f0ff 100%);
  border: 1px solid #e6ecff;
  border-radius: 18px;
  padding: 22px 26px;
  margin-bottom: 20px;
}
.cat-hero-icon {
  width: 54px; height: 54px; flex: none;
  border-radius: 16px;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #4a6cf7;
  box-shadow: 0 6px 16px rgba(74,108,247,.14);
}
.cat-hero-main h1 { font-size: 24px; margin: 0 0 6px; color: #1a202c; }
.cat-hero-main p { margin: 0; font-size: 13px; color: #64748b; }
.cat-hero-main b { color: #4a6cf7; font-size: 15px; }

/* 分组胶囊 */
.cat-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.cat-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 15px; border-radius: 999px;
  font-size: 13px; color: #64748b; cursor: pointer;
  background: #fff; border: 1px solid #e8eef7;
  transition: .2s; user-select: none;
}
.cat-tab em {
  font-style: normal; font-size: 11px; color: #94a3b8;
  background: #f4f7fc; padding: 1px 7px; border-radius: 999px; line-height: 1.5;
}
.cat-tab:hover { color: #4a6cf7; border-color: #c9d6ff; }
.cat-tab:hover em { background: #eef3ff; color: #4a6cf7; }
.cat-tab.active {
  background: linear-gradient(135deg, #4a6cf7, #7c3aed);
  border-color: transparent; color: #fff; font-weight: 600;
  box-shadow: 0 4px 12px rgba(74,108,247,.25);
}
.cat-tab.active em { background: rgba(255,255,255,.22); color: #fff; }

/* 两栏布局 */
.cat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}
.cat-side { width: 300px; }
.cat-side { position: sticky; top: 20px; }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.site-card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid #eef2f6; border-radius: 14px;
  padding: 14px 16px;
  text-decoration: none; color: inherit;
  transition: transform .22s, box-shadow .22s, border-color .22s;
}
.site-card:hover {
  transform: translateY(-3px);
  border-color: #c9d6ff;
  box-shadow: 0 12px 28px rgba(74,108,247,.10);
}
.site-card.is-recommend {
  background: linear-gradient(145deg, #fffdf5, #fffaeb);
  border-color: #f6e05e;
}

.site-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.site-icon {
  width: 42px; height: 42px; flex: none;
  border-radius: 11px; overflow: hidden;
  background: #f8fafc; border: 1px solid #edf2f7;
  display: flex; align-items: center; justify-content: center;
}
.site-icon img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }

.site-title-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.site-name {
  font-size: 14.5px; font-weight: 600; color: #1a202c;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.site-card:hover .site-name { color: #4a6cf7; }
.site-tag {
  font-size: 11px; color: #94a3b8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.site-badge {
  flex: none; font-size: 10.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; color: #fff;
}
.badge-recommend { background: linear-gradient(135deg, #f89250, #f1404b); }
.badge-hot       { background: linear-gradient(135deg, #f56565, #e53e3e); }
.badge-default   { background: linear-gradient(135deg, #4a6cf7, #6a8cff); }

.site-desc {
  font-size: 12.5px; color: #718096; line-height: 1.65;
  margin-bottom: 12px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 41px;
}

.site-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 10px; border-top: 1px solid #f4f7fb;
  font-size: 12px; color: #a0aec0;
}
.site-click { display: inline-flex; align-items: center; gap: 4px; }
.site-click i { color: #cbd5e1; }
.site-arrow {
  width: 24px; height: 24px; border-radius: 50%;
  background: #f4f7fc; color: #94a3b8;
  display: inline-flex; align-items: center; justify-content: center;
  transition: .2s;
}
.site-card:hover .site-arrow { background: #4a6cf7; color: #fff; transform: rotate(45deg); }

/* 空状态 */
.cat-empty { text-align: center; color: #a0aec0; padding: 60px 0; }
.cat-empty i { font-size: 44px; display: block; margin-bottom: 12px; color: #cbd5e1; }
.cat-empty p { margin: 0; font-size: 14px; }

/* 排行榜 */
.cat-rank {
  background: #fff; border: 1px solid #eef2f6; border-radius: 16px;
  padding: 16px 14px;
}
.cat-rank-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; font-weight: 700; color: #1a202c;
  padding: 0 4px 12px; margin-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}
.cat-rank-head i { color: #ff6b3d; margin-right: 4px; }
.cat-rank-head em { font-style: normal; font-size: 11px; color: #a0aec0; font-weight: 400; }

.cat-rank-list { list-style: none; margin: 0; padding: 0; }
.cat-rank-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 6px; border-radius: 9px;
  text-decoration: none; color: inherit; transition: background .18s;
}
.cat-rank-item:hover { background: #f6f9ff; }

.cat-rank-no {
  flex: none; width: 21px; height: 21px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700;
  background: #f1f5f9; color: #94a3b8;
}
.cat-rank-no.rn-1 { background: linear-gradient(135deg, #ffd666, #ff9f43); color: #fff; }
.cat-rank-no.rn-2 { background: linear-gradient(135deg, #cfd8e8, #a8b6cc); color: #fff; }
.cat-rank-no.rn-3 { background: linear-gradient(135deg, #f0b27a, #d98b4a); color: #fff; }

.cat-rank-icon {
  width: 26px; height: 26px; flex: none; border-radius: 7px;
  object-fit: contain; background: #f8fafc; border: 1px solid #eef2f6; padding: 2px;
}
.cat-rank-name {
  flex: 1; min-width: 0; font-size: 13px; color: #1a202c;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cat-rank-item:hover .cat-rank-name { color: #4a6cf7; }
.cat-rank-count { flex: none; font-size: 12px; color: #94a3b8; font-variant-numeric: tabular-nums; }
.cat-rank-empty { text-align: center; color: #a0aec0; font-size: 13px; padding: 24px 0; }

/* 分页 */
.cat-pager {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; margin-top: 28px; flex-wrap: wrap;
}
.cat-pager-total { font-size: 13px; color: #94a3b8; margin-right: 8px; }
.cat-page {
  min-width: 36px; height: 36px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; font-size: 13px; color: #4a5568;
  background: #fff; border: 1px solid #e8eef7;
  text-decoration: none; transition: .2s;
}
.cat-page:hover { border-color: #c9d6ff; color: #4a6cf7; }
.cat-page.active {
  background: linear-gradient(135deg, #4a6cf7, #7c3aed);
  border-color: transparent; color: #fff; font-weight: 600;
}
.cat-dots { color: #cbd5e1; padding: 0 4px; }

/* AJAX 加载态 */
#groupContentWrapper { transition: opacity .2s; }
#groupContentWrapper.is-loading { opacity: .45; pointer-events: none; }

/* 暗色 */
body.dark-mode.page-cat,
body.dark-mode.page-cat .main-content { background: #12172a; }
body.dark-mode .cat-hero { background: linear-gradient(135deg, #1a2340, #211a3a); border-color: #26304a; }
body.dark-mode .cat-hero-main h1 { color: #e2e8f0; }
body.dark-mode .cat-hero-icon { background: #1a2035; }
body.dark-mode .site-card,
body.dark-mode .cat-rank,
body.dark-mode .cat-tab,
body.dark-mode .cat-page { background: #1a2035; border-color: #26304a; }
body.dark-mode .site-name,
body.dark-mode .cat-rank-name,
body.dark-mode .cat-rank-head { color: #e2e8f0; }
body.dark-mode .site-desc { color: #94a3b8; }
body.dark-mode .site-foot { border-top-color: #26304a; }
body.dark-mode .site-card.is-recommend { background: #1f2320; border-color: #4a4326; }
body.dark-mode .site-arrow { background: #26304a; color: #94a3b8; }

/* 响应式 */
@media (max-width: 1080px) {
  .cat-layout { grid-template-columns: 1fr; }
  .cat-side { position: static; }
}
@media (max-width: 768px) {
  .cat-wrap { padding: 14px 12px 50px; }
  .cat-hero { padding: 18px; gap: 12px; }
  .cat-hero-icon { width: 44px; height: 44px; font-size: 21px; border-radius: 13px; }
  .cat-hero-main h1 { font-size: 19px; }
  .cat-grid { grid-template-columns: 1fr; gap: 10px; }
  .cat-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .cat-tabs::-webkit-scrollbar { display: none; }
  .cat-tab { white-space: nowrap; }
}