/* =====================================================
 * 合集页样式（索引页 + 详情页共用）
 * ===================================================== */

/* ===== 合集详情页 Hero ===== */
.collection-hero {
  position: relative;
  text-align: center;
  padding: 48px 24px 32px;
  margin: 0 0 32px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.08));
  border-radius: 16px;
  overflow: hidden;
  isolation: isolate;
}
[data-theme="dark"] .collection-hero {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
}
.collection-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15), transparent 70%);
  pointer-events: none;
}
.collection-hero-icon {
  font-size: 64px;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.3));
}
.collection-hero h1 {
  margin: 0 0 12px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.collection-hero p {
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto 24px;
  line-height: 1.7;
  font-size: 15px;
}

/* 统计胶囊 */
.collection-stats {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.collection-stat {
  padding: 10px 20px;
  min-width: 90px;
  text-align: center;
}
.collection-stat + .collection-stat {
  border-left: 1px solid var(--border-color);
}
.collection-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.2;
}
.collection-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* 工具区标题 */
.collection-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-color);
}
.collection-section-title h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}
.collection-section-title-count {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.collection-grid a {
  position: relative;
}
.collection-grid a:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
  border-color: var(--color-primary) !important;
}

/* 其他合集推荐 */
.other-collections {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.other-collections a:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary) !important;
}

/* ===== 合集索引页 Hero ===== */
.col-hero {
  position: relative;
  text-align: center;
  padding: 56px 24px 40px;
  margin: 0 0 40px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(236, 72, 153, 0.08), rgba(6, 182, 212, 0.08));
  border-radius: 20px;
  overflow: hidden;
  isolation: isolate;
}
[data-theme="dark"] .col-hero {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(236, 72, 153, 0.15), rgba(6, 182, 212, 0.15));
}
.col-hero::before {
  content: '';
  position: absolute;
  top: -60%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.18), transparent 70%);
  pointer-events: none;
}
.col-hero-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 16px;
}
.col-hero h1 {
  margin: 0 0 12px;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.col-hero h1 .accent {
  background: linear-gradient(135deg, #6366f1, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.col-hero p {
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 24px;
  line-height: 1.7;
  font-size: 15px;
}
.col-hero-stats {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}
.col-hero-stat {
  padding: 10px 22px;
  text-align: center;
  min-width: 90px;
}
.col-hero-stat + .col-hero-stat {
  border-left: 1px solid var(--border-color);
}
.col-hero-stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.2;
}
.col-hero-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ===== 合集卡片网格 ===== */
.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin: 24px 0 40px;
}
.col-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 20px;
  border-radius: 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  text-decoration: none;
  transition: all 0.25s ease;
  overflow: hidden;
}
.col-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.25s;
}
.col-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  border-color: var(--accent);
}
.col-card:hover::before {
  opacity: 1;
}
.col-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.col-card-icon {
  font-size: 36px;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.12));
}
.col-card-hot {
  font-size: 11px;
  padding: 3px 8px;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border-radius: 999px;
  font-weight: 600;
}
.col-card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.3;
}
.col-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.col-card-preview {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 8px 10px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.85;
}
.col-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px dashed var(--border-color);
}
.col-card-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}
.col-card-arrow {
  font-size: 18px;
  color: var(--accent);
  transition: transform 0.25s;
}
.col-card:hover .col-card-arrow {
  transform: translateX(4px);
}

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  /* 合集详情页 */
  .collection-hero { padding: 32px 16px 24px; }
  .collection-hero-icon { font-size: 48px; }
  .collection-hero h1 { font-size: 24px; }
  .collection-grid { grid-template-columns: 1fr; }
  .collection-stat { padding: 8px 12px; min-width: 70px; }
  .collection-stat-value { font-size: 20px; }

  /* 合集索引页 */
  .col-hero { padding: 40px 16px 28px; }
  .col-hero h1 { font-size: 26px; }
  .col-hero-stat { padding: 8px 14px; min-width: 70px; }
  .col-hero-stat-value { font-size: 18px; }
  .collections-grid { grid-template-columns: 1fr; gap: 14px; }
  .col-card { padding: 16px; }
}

/* ===== 广告容器响应式（合集页 + 详情页共用） ===== */
._xjdi33gt19l {
  width: 100%;
  max-width: 100%;
  margin: 24px auto;
  overflow: hidden;
  box-sizing: border-box;
}
._xjdi33gt19l iframe,
._xjdi33gt19l img,
._xjdi33gt19l object,
._xjdi33gt19l embed,
._xjdi33gt19l > div {
  max-width: 100% !important;
  height: auto;
  box-sizing: border-box;
}
._xjdi33gt19l img {
  display: block;
  margin: 0 auto;
}
@media (max-width: 640px) {
  ._xjdi33gt19l, ._xjdi33gt19l > * { max-width: 100% !important; }
  ._xjdi33gt19l table { width: 100% !important; max-width: 100% !important; table-layout: fixed; }
}
