/* ========== Clean Gallery Carousel (component-scoped) ========== */

.gallery-container {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.carousel-wrapper {
  position: relative;
  width: 100%;
  max-width: 1200px;
  height: 80vh;
  min-height: 400px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.8);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
  transform: translateZ(0);
}

.carousel-slide {
  position: relative;
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  transition: all 0.6s ease;
}

.slide-image-container {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.carousel-slide:hover .slide-image-container {
  transform: scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* 图片 */
.slide-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0;
  transform: scale(1.1);
}
.slide-image.loaded {
  opacity: 1;
  transform: scale(1);
  transition: all 0.6s ease;
}

/* 根据方向自动适配 */
.slide-image-container.portrait { max-height: 100%; width: auto; }
.slide-image-container.landscape { max-width: 100%; height: auto; }
.slide-image-container.square { max-width: 100%; max-height: 100%; }

/* 文案卡片 */
.slide-content {
  position: absolute;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 600px;
  text-align: center;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  padding: 24px 32px;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  opacity: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.carousel-slide.active .slide-content { bottom: 30px; opacity: 1; }

.slide-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.slide-description {
  font-size: 1rem;
  line-height: 1.6;
  opacity: 0.8;
  color: #4a5568;
}

/* 导航按钮 */
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.carousel-nav:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}
.carousel-nav.prev { left: 20px; }
.carousel-nav.next { right: 20px; }
.carousel-nav svg { width: 20px; height: 20px; fill: #4a5568; }

/* 指示器 */
.carousel-indicators {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.8);
  padding: 8px 16px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
}
.indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}
.indicator.active,
.indicator:hover {
  background: #4a5568;
  transform: scale(1.3);
}

/* 缩略图 */
.thumbnail-strip {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  padding: 12px;
  border-radius: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.thumbnail {
  width: 60px;
  height: 45px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0.6;
  border: 2px solid transparent;
}
.thumbnail:hover,
.thumbnail.active {
  opacity: 1;
  transform: scale(1.05);
  border-color: #4a5568;
}
.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 加载动画 */
.loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid rgba(74, 85, 104, 0.2);
  border-top-color: #4a5568;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 5;
}
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* 响应式 */
@media (max-width: 768px) {
  .gallery-container { padding: 10px; }
  .carousel-wrapper { height: 70vh; min-height: 300px; border-radius: 16px; }
  .carousel-slide { padding: 20px; }
  .slide-title { font-size: 1.4rem; }
  .slide-content { padding: 16px 20px; width: 95%; bottom: -60px; }
  .carousel-slide.active .slide-content { bottom: 15px; }
  .thumbnail-strip { display: none; }
  .carousel-nav { width: 40px; height: 40px; }
  .carousel-nav.prev { left: 10px; }
  .carousel-nav.next { right: 10px; }
  .carousel-nav svg { width: 16px; height: 16px; }
  .carousel-indicators { bottom: 8px; padding: 6px 12px; gap: 8px; }
  .indicator { width: 8px; height: 8px; }
}

@media (max-width: 480px) {
  .carousel-wrapper { height: 60vh; min-height: 280px; }
  .carousel-slide { padding: 15px; }
  .slide-content { padding: 12px 16px; bottom: -50px; }
  .slide-title { font-size: 1.2rem; margin-bottom: 8px; }
  .slide-description { font-size: 0.9rem; }
}
