/* 相册样式 */
.photo-gallery {
  max-width: 100%;
  margin: 2rem auto;
  padding: 0 1rem;
}

.gallery-container {
  position: relative;
  max-width: 640px; /* 800px * 0.8 = 640px */
  margin: 0 auto;
  overflow: hidden;
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  background: #fff;
}

.gallery-slider {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item {
  min-width: 100%;
  position: relative;
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  height: 400px; /* 500px * 0.8 = 400px */
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: white;
  padding: 3rem 2rem 2rem;
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-caption {
  transform: translateY(0);
}

.gallery-caption h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.8rem;
  font-weight: 600;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.gallery-caption p {
  margin: 0;
  opacity: 0.9;
  font-size: 1.1rem;
  line-height: 1.4;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  padding: 1.2rem;
  font-size: 1.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-nav:hover {
  background: rgba(0,0,0,0.9);
  transform: translateY(-50%) scale(1.1);
}

.gallery-nav.prev {
  left: 20px;
}

.gallery-nav.next {
  right: 20px;
}

.gallery-indicators {
  text-align: center;
  padding: 1.5rem;
  background: rgba(0,0,0,0.05);
  border-radius: 0 0 15px 15px;
}

.indicator {
  height: 12px;
  width: 12px;
  margin: 0 8px;
  background-color: #ccc;
  border-radius: 50%;
  display: inline-block;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.indicator.active {
  background-color: #333;
  transform: scale(1.2);
}

.indicator:hover {
  background-color: #666;
  transform: scale(1.1);
}

/* 自动播放动画 */
@keyframes autoSlide {
  0% { transform: translateX(0); }
  33% { transform: translateX(-100%); }
  66% { transform: translateX(-200%); }
  100% { transform: translateX(0); }
}

.gallery-slider.auto-play {
  animation: autoSlide 9s infinite;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .gallery-item img {
    height: 280px; /* 350px * 0.8 = 280px */
  }
  
  .gallery-caption {
    padding: 2rem 1rem 1rem;
  }
  
  .gallery-caption h3 {
    font-size: 1.4rem;
  }
  
  .gallery-caption p {
    font-size: 1rem;
  }
  
  .gallery-nav {
    padding: 0.8rem;
    font-size: 1.4rem;
    width: 40px;
    height: 40px;
  }
  
  .gallery-nav.prev {
    left: 10px;
  }
  
  .gallery-nav.next {
    right: 10px;
  }
}

@media (max-width: 480px) {
  .gallery-item img {
    height: 170px; /* 250px * 0.8 = 200px */
  }
  
  .gallery-caption {
    padding: 1.5rem 0.8rem 0.8rem;
  }
  
  .gallery-caption h3 {
    font-size: 1.2rem;
  }
  
  .gallery-caption p {
    font-size: 0.9rem;
  }
}

/* 加载动画 */
.gallery-item img {
  opacity: 0;
  animation: fadeIn 0.5s ease-in-out forwards;
}

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

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  .gallery-caption {
    transform: translateY(0);
    background: rgba(0,0,0,0.7);
  }
  
  .gallery-nav {
    background: rgba(0,0,0,0.8);
  }
}
