/* ========== 分类页网格封面卡片 ========== */

/* 1. 分类页容器毛玻璃化（和侧边栏风格统一） */
.type-categories #page {
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  padding: 2rem !important;
}

/* 2. 列表改为网格布局 */
#page .category-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  padding: 0 !important;
  list-style: none;
  margin: 0;
}

/* 3. 单个分类卡片基础样式 + 入场动画 + 移除边框 */
#page .category-list-item {
  position: relative;
  height: 200px;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  /* 强制移除所有边框 */
  border: none !important;
  outline: none !important;
  /* 动画初始状态：透明 + 向下偏移 */
  opacity: 0;
  transform: translateY(30px);
  /* 动画执行规则：时长 0.6s，ease-out 缓出，保持最终状态 */
  animation: fadeInUp 0.6s ease-out forwards;
}

/* 定义入场动画关键帧：从下往上 + 渐显 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 为不同卡片设置错落延迟 */
#page .category-list-item:nth-child(1) {
  animation-delay: 0.1s;
}
#page .category-list-item:nth-child(2) {
  animation-delay: 0.25s;
}
#page .category-list-item:nth-child(3) {
  animation-delay: 0.4s;
}
#page .category-list-item:nth-child(4) {
  animation-delay: 0.55s;
}
#page .category-list-item:nth-child(5) {
  animation-delay: 0.7s;
}

/* 4. 卡片封面背景 */
#page .category-list-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s ease;
  z-index: 1;
  border: none !important;
}

/* 5. 底部渐变遮罩，保证文字清晰 */
#page .category-list-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  z-index: 2;
  transition: opacity 0.3s ease;
  border: none !important;
}

/* 6. 链接铺满整个卡片 + 强制移除默认蓝色边框 */
#page .category-list-link {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff !important;
  text-decoration: none;
  z-index: 3;
  box-sizing: border-box;
  /* 核心：移除主题默认的蓝色顶边与聚焦轮廓 */
  border: none !important;
  border-top: none !important;
  outline: none !important;
}

/* 移除链接聚焦、悬停时的边框 */
#page .category-list-link:hover,
#page .category-list-link:focus,
#page .category-list-link:active {
  border: none !important;
  outline: none !important;
}

/* 7. 文章数量样式 */
#page .category-list-count {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-top: 0.3rem;
  color: rgba(255, 255, 255, 0.8);
  border: none !important;
}

/* 移除默认的括号 */
#page .category-list-count::before,
#page .category-list-count::after {
  display: none;
}

/* 8. Hover 动效 */
#page .category-list-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

#page .category-list-item:hover::before {
  transform: scale(1.08);
}

#page .category-list-item:hover::after {
  opacity: 0.9;
}

/* 9. 移动端适配 */
@media screen and (max-width: 768px) {
  #page .category-list {
    grid-template-columns: 1fr;
  }
  
  #page .category-list-item {
    height: 160px;
    animation-duration: 0.5s;
  }
}

/* ========== 各分类独立封面配置 ========== */
/* 第1个分类：C语言基础 */
#page .category-list-item:nth-child(1)::before {
  background-image: url('/img/shenlifu.jpg');
}

/* 第2个分类：数据结构 */
#page .category-list-item:nth-child(2)::before {
  background-image: url('/img/weierlite_1.png');
}