/* ========================================
 * VCG 海报模板浏览页 - 专用样式
 * gallery.css
 * ======================================== */

/* 页面标题区域 */
.gallery-header {
  text-align: center;
  padding: 40px 16px 24px;
  background-color: #ffffff;
}

.gallery-title {
  font-size: 24px;
  font-weight: 600;
  color: #262626;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.gallery-subtitle {
  font-size: 14px;
  color: #8C8C8C;
  font-weight: 400;
}

/* 分类筛选栏 */
.gallery-filters {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 16px 24px;
  background-color: #ffffff;
  border-bottom: 1px solid #F0F0F0;
}

.gallery-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 400;
  color: #595959;
  background-color: #F5F5F5;
  border: 1px solid transparent;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
  line-height: 1.5;
}

.gallery-filter-btn:hover {
  color: #E60012;
  background-color: rgba(230, 0, 18, 0.06);
}

.gallery-filter-btn.active {
  color: #ffffff;
  background-color: #E60012;
  font-weight: 500;
}

/* 卡片网格容器 */
.gallery-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* 模板卡片 */
.gallery-card {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: all 0.2s ease;
  cursor: default;
}

.gallery-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* 缩略图容器 */
.gallery-card__thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: auto;
  background-color: #F5F5F5;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-card__thumbnail canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 卡片信息区域 */
.gallery-card__info {
  padding: 12px 16px;
}

.gallery-card__name {
  font-size: 14px;
  font-weight: 600;
  color: #262626;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-card__meta {
  font-size: 12px;
  color: #8C8C8C;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 使用此模板按钮 */
.gallery-card__btn {
  display: block;
  width: 100%;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  background-color: #E60012;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-align: center;
  text-decoration: none;
  line-height: 1.5;
}

.gallery-card__btn:hover {
  background-color: #C4000F;
}

.gallery-card__btn:active {
  background-color: #A3000D;
}

/* 空状态 */
.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 16px;
  color: #8C8C8C;
  font-size: 14px;
}

.gallery-empty__icon {
  font-size: 48px;
  margin-bottom: 16px;
  color: #BFBFBF;
}

.gallery-empty__text {
  font-size: 16px;
  color: #595959;
  margin-bottom: 8px;
}

/* 加载状态 */
.gallery-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 16px;
  color: #8C8C8C;
  font-size: 14px;
}

.gallery-loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #E8E8E8;
  border-top-color: #E60012;
  border-radius: 50%;
  animation: gallery-spin 0.8s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

@keyframes gallery-spin {
  to { transform: rotate(360deg); }
}

/* ========================================
 * 响应式媒体查询
 * ======================================== */

/* >= 1200px: 4列 (默认) */

/* >= 768px 且 < 1200px: 3列 */
@media (max-width: 1199px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

/* < 768px: 2列 */
@media (max-width: 767px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .gallery-header {
    padding: 24px 16px 16px;
  }

  .gallery-title {
    font-size: 20px;
  }

  .gallery-subtitle {
    font-size: 13px;
  }

  .gallery-filters {
    gap: 6px;
    padding: 12px 12px 16px;
  }

  .gallery-filter-btn {
    padding: 5px 12px;
    font-size: 13px;
  }

  .gallery-content {
    padding: 16px 12px 32px;
  }

  .gallery-card__info {
    padding: 10px 12px;
  }

  .gallery-card__name {
    font-size: 13px;
  }

  .gallery-card__meta {
    font-size: 11px;
    margin-bottom: 8px;
  }

  .gallery-card__btn {
    font-size: 13px;
    padding: 6px 0;
  }
}
