/* ====================================
   Homepage Styles - Dark Warm Theme
   ==================================== */

:root {
  --primary: #ff69b4;
  /* accent pink */
  --muted: #9aa0a6;
  --bg: #0f0f10;
  --card: #0b0b0c;
}

body {
  background: var(--bg);
  color: #e6e6e6;
}

/* ====================================
   Hero Section
   ==================================== */

.hero {
  text-align: center;
  padding: 48px 12px 12px;
}

.title {
  font-size: 40px;
  color: #ffffff;
  margin: 6px 0 6px;
  font-weight: 800;
  letter-spacing: 1px;
}

.description {
  color: var(--muted);
  margin: 6px 0 28px;
  font-size: 15px;
}

/* 手机端减少hero区域空间 */
@media (max-width: 600px) {
  .hero {
    padding: 20px 12px 8px;
    /* 大幅减少padding，从48px减少到20px */
  }

  .title {
    font-size: 28px;
    /* 减小标题字体 */
    margin: 4px 0 4px;
    /* 减少上下margin */
  }

  .description {
    font-size: 13px;
    /* 减小描述字体 */
    margin: 4px 0 12px;
    /* 减少上下margin，特别是底部margin */
  }
}

/* ====================================
   Page List & Grid
   ==================================== */

.page-list {
  max-width: 1200px;
  margin: 30px auto 48px;
  padding: 12px 20px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.category-title {
  grid-column: 1 / -1;
  margin-top: 28px;
  margin-bottom: 6px;
  font-weight: 700;
  color: var(--primary);
  font-size: 18px;
}

/* ====================================
   Featured Card (Large Preview)
   ==================================== */

.featured-card {
  grid-column: span 1;
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  /* 保持长方形布局，宽高比16:9 */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(255, 105, 180, 0.18);
  background: linear-gradient(135deg, #1a1a1e 0%, #2d2d2f 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.featured-card a {
  display: block;
  width: 100%;
  height: 100%;
}

.featured-card .card-imgbox,
.featured-card .featured-bg {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-right: 0;
  height: 100%;
  /* 使用100%高度，由aspect-ratio控制 */
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: transparent;
  padding: 0;
  overflow: hidden;
}

/* Picture标签样式 */
.featured-card picture {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: block;
}

/* 主图片样式 - 填充满整个卡片 */
.featured-card .card-main-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  background: linear-gradient(135deg, #1a1a1e 0%, #2d2d2f 100%);
  transition: opacity 0.3s ease;
}

/* 图片加载占位符 */
.featured-card .card-main-image[loading="lazy"] {
  opacity: 0;
}

.featured-card .card-main-image.loaded {
  opacity: 1;
}

/* Badge in top right */
.featured-card .badge-hot {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 30;
  background: linear-gradient(90deg, #ff69b4, #ffb347);
  color: #fff;
  font-size: 13px;
  font-weight: bold;
  padding: 4px 12px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(255, 105, 180, 0.3);
}

/* 移除旧的 compare-img 相关样式，不再需要 */

/* Title and description: 半透明背景在底部 */
.featured-card .img-overlay {
  position: absolute;
  left: 0;
  bottom: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px 30px 18px;
  z-index: 40;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.5) 50%, transparent 100%);
  min-height: 0;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.8);
}

.featured-card .img-overlay .big-card-title {
  color: #fff;
  font-size: 1.8rem;
  font-weight: 900;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  margin-bottom: 6px;
}

.featured-card .img-overlay .big-card-desc {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.6;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  max-width: 100%;
}

/* ====================================
   Regular Cards (Icon + Meta)
   ==================================== */

.page-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.15));
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
}

.page-card a {
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.page-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
  border-color: rgba(255, 105, 180, 0.12);
}

/* Icon styling */
.icon {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon img {
  width: 56px;
  height: 56px;
  display: block;
  border-radius: 10px;
}

/* Meta section (title + description) */
.meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.card-title {
  font-size: 1.18rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.card-desc {
  font-size: 0.98rem;
  color: #ffe0b2;
  font-weight: 400;
  line-height: 1.5;
}

.meta .name {
  font-weight: 700;
  color: #fff;
}

.meta .hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

/* ====================================
   Hidden Cards
   ==================================== */

.hidden-card {
  display: none !important;
}

/* ====================================
   Responsive Design
   ==================================== */

@media (max-width: 900px) {
  .page-list {
    grid-template-columns: 1fr;
    padding: 12px 16px;
    gap: 16px;
  }

  .featured-card {
    aspect-ratio: 16 / 9;
    /* 保持长方形布局 */
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: linear-gradient(135deg, #1f1f23 0%, #2f2f33 100%);
  }

  .featured-card .card-imgbox,
  .featured-card .featured-bg {
    height: 100%;
    /* 使用100%高度，由aspect-ratio控制 */
  }

  .featured-card .img-overlay {
    padding: 16px 20px 16px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.6) 50%, transparent 100%);
  }

  .featured-card .img-overlay .big-card-title {
    font-size: 1.4rem;
  }

  .featured-card .img-overlay .big-card-desc {
    font-size: 0.95rem;
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .page-list {
    grid-template-columns: 1fr;
    padding: 12px 8px;
    /* 减少左右padding，让卡片更贴近屏幕边缘 */
    gap: 14px;
  }

  .featured-card {
    grid-column: span 1;
    aspect-ratio: 16 / 9;
    /* 保持长方形布局，与PC端一致 */
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, #1f1f23 0%, #2f2f33 100%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  }

  .featured-card .card-imgbox,
  .featured-card .featured-bg {
    height: 100%;
    /* 使用100%高度，由aspect-ratio控制 */
  }

  .featured-card .img-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 60%, transparent 100%);
    padding: 16px 12px 12px;
    /* 减少padding，向下移动文字 */
    text-align: left;
  }

  .featured-card .img-overlay .big-card-title {
    font-size: 1.3rem;
    margin-bottom: 6px;
    /* 减少标题和描述之间的间距 */
  }

  .featured-card .img-overlay .big-card-desc {
    font-size: 0.9rem;
    line-height: 1.4;
    /* 稍微减少行高 */
    max-width: 100%;
  }

  .page-card {
    padding: 12px;
  }
}

@media (max-width: 520px) {
  .page-list {
    gap: 12px;
    padding: 12px 6px;
    /* 进一步减少左右padding */
  }

  .title {
    font-size: 26px;
  }

  .featured-card {
    aspect-ratio: 16 / 9;
    /* 保持长方形布局，与PC端一致 */
    border: 1px solid rgba(255, 255, 255, 0.25);
  }

  .featured-card .card-imgbox,
  .featured-card .featured-bg {
    height: 100%;
    /* 使用100%高度，由aspect-ratio控制 */
  }

  .featured-card .img-overlay {
    padding: 14px 10px 10px;
    /* 减少padding，向下移动文字 */
  }

  .featured-card .img-overlay .big-card-title {
    font-size: 1.2rem;
    margin-bottom: 4px;
    /* 减少标题和描述之间的间距 */
  }

  .featured-card .img-overlay .big-card-desc {
    font-size: 0.85rem;
    line-height: 1.35;
    /* 稍微减少行高 */
  }
}