/**
 * Shiguang 拾光集 - 分类页样式
 * 设计风格：毛玻璃 · 简约白
 */

/* ========== 分类页头部增强 ========== */
.page-header {
  padding: 130px 0 56px;
}

.page-header::before {
  background: linear-gradient(180deg,
    rgba(108, 159, 255, 0.08) 0%,
    rgba(255, 184, 122, 0.04) 40%,
    rgba(245, 247, 251, 0) 100%);
}

/* ========== 分类网格容器 ========== */
.categories-section {
  padding-top: 24px;
  padding-bottom: 80px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

/* ========== 分类大卡片 ========== */
.cat-card {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(100, 120, 160, 0.06);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.cat-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(100, 120, 160, 0.14);
  border-color: rgba(108, 159, 255, 0.2);
}

/* 卡片缩略图区域 */
.cat-card-cover {
  position: relative;
  width: 100%;
  height: 160px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(108, 159, 255, 0.08), rgba(255, 184, 122, 0.08));
}

.cat-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.cat-card:hover .cat-card-cover img {
  transform: scale(1.08);
}

/* 图片加载前的占位渐变 */
.cat-card-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(108, 159, 255, 0.05) 0%,
    rgba(255, 184, 122, 0.03) 100%);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.cat-card-cover img.loaded::after {
  opacity: 0;
}

/* 文章数量角标 */
.cat-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  background: linear-gradient(135deg, rgba(108, 159, 255, 0.85), rgba(74, 127, 224, 0.85));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(108, 159, 255, 0.3);
  z-index: 1;
}

/* 卡片内容区域 */
.cat-card-body {
  padding: 20px 22px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cat-card-name {
  font-size: 17px;
  font-weight: 600;
  color: #1A1A2E;
  margin-bottom: 8px;
  line-height: 1.4;
}

.cat-card-desc {
  font-size: 13px;
  color: #6B7B8D;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  margin-bottom: 14px;
}

/* 底部进入指示 */
.cat-card-action {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #6C9FFF;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.3s ease;
}

.cat-card:hover .cat-card-action {
  opacity: 1;
  transform: translateY(0);
}

.cat-card-action::after {
  content: '→';
  transition: transform 0.3s ease;
}

.cat-card:hover .cat-card-action::after {
  transform: translateX(4px);
}

/* ========== 空状态 ========== */
.categories-empty {
  text-align: center;
  padding: 80px 20px;
  color: #9CAAB8;
}

.categories-empty .empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.35;
}

.categories-empty p {
  font-size: 14px;
}

/* ========== 装饰光斑 ========== */
.categories-section::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(108, 159, 255, 0.04);
  filter: blur(80px);
  top: -100px;
  right: -150px;
  pointer-events: none;
  z-index: -1;
}

.categories-section {
  position: relative;
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .category-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .cat-card-cover {
    height: 140px;
  }

  .cat-card-body {
    padding: 16px 18px 20px;
  }

  .cat-card-name {
    font-size: 16px;
  }

  .categories-section {
    padding-bottom: 56px;
  }

  .page-header {
    padding: 110px 0 40px;
  }
}

@media (max-width: 480px) {
  .cat-card-cover {
    height: 120px;
  }

  .cat-card-badge {
    top: 10px;
    right: 10px;
    padding: 3px 10px;
    font-size: 11px;
  }
}
