.image-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.carousel-container {
  position: relative;
  /* 高度将通过JavaScript设置为第一张图片的高度 */
}

.carousel-slides {
  display: flex;
  height: 100%;
}

.carousel-slide {
  flex: 0 0 100%;
  display: none;
  position: relative;
}

.carousel-slide:first-child {
  display: block; /* 确保第一张幻灯片可见以获取高度 */
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.carousel-slide video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.slide-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 20px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  opacity: 0;
}

.carousel-slide:hover .slide-caption {
  transform: translateY(0);
  opacity: 1;
}

.slide-caption h3 {
  margin: 0 0 10px;
  font-size: 24px;
}

.slide-caption p {
  margin: 0;
  font-size: 16px;
}

.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.3s;
  opacity: 0.7;
}

.carousel-control:hover {
  background: rgba(0, 0, 0, 0.8);
  opacity: 1;
}

.carousel-control.prev {
  left: 20px;
}

.carousel-control.next {
  right: 20px;
}

/* 小红书风格轮播指示器 */
.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    z-index: 10;
    padding: 3px 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.carousel-indicator {
    width: 8px;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    position: relative;
}

.carousel-indicator.active {
    width: 16px;
    background: #ff2442; /* 小红书标志性红色 */
    box-shadow: 0 0 8px rgba(255, 36, 66, 0.5);
}
/* 指示器悬停效果 */
.carousel-indicator:not(.active):hover {
    background: rgba(255, 255, 255, 0.7);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .carousel-indicators {
        bottom: 12px;
        padding: 2px 6px;
    }
    
    .carousel-indicator {
        width: 6px;
        height: 2px;
    }
    
    .carousel-indicator.active {
        width: 12px;
    }
}




/* 图片放大模态框样式 */
.image-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.9);
  padding: 20px; /* 增加内边距避免图片贴边 */
  box-sizing: border-box; /* 确保内边距不影响整体尺寸 */
}

.modal-content {
  margin: auto;
  display: block;
  /* 移除固定宽度限制，改为最大宽度 */
  max-width: 90%; 
  /* 关键：保持图片原始比例，限制最大高度不超过屏幕 */
  max-height: 90vh; 
  width: auto !important; /* 强制宽度自适应 */
  height: auto !important; /* 强制高度自适应 */
  object-fit: contain; /* 确保图片完整显示不裁剪 */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: #bbb;
  text-decoration: none;
}
