/**
 * GIF Gallery 样式
 * 动图画廊展示效果
 */

.gif-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin: 20px 0;
  width: 100%;
}

.gif-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.gif-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.gif-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.gif-item:hover .gif-image {
  transform: scale(1.05);
}

.gif-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: white;
  padding: 10px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gif-item:hover .gif-caption {
  opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .gif-gallery {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
  }

  .gif-item {
    height: 150px;
  }
}

@media (max-width: 480px) {
  .gif-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .gif-item {
    height: 120px;
  }

  .gif-caption {
    font-size: 12px;
    padding: 8px;
  }
}

/* 灯箱效果（点击放大） */
.gif-item img {
  cursor: pointer;
}

.gif-lightbox {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  animation: fadeIn 0.3s ease;
}

.gif-lightbox.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gif-lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  animation: slideUp 0.3s ease;
}

.gif-lightbox-content img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.gif-lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.gif-lightbox-close:hover {
  transform: scale(1.2);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
