/* 侧边栏轮播图样式 */
.sidebar-carousel {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  margin: -1.25rem;
  width: calc(100% + 2.5rem);
}

.carousel-container {
  position: relative;
  width: 100%;
  height: 250px;
  overflow: hidden;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.carousel-slide.active {
  opacity: 1;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  cursor: pointer;
  transition: transform 0.3s ease;
  background: #f5f5f5;
}

.carousel-slide img:not([src]), 
.carousel-slide img[src=""],
.carousel-slide img[src*="data:image/svg+xml"] {
  background: #f5f5f5;
  position: relative;
}

.carousel-slide img:not([src])::after, 
.carousel-slide img[src=""]::after,
.carousel-slide img[src*="data:image/svg+xml"]::after {
  content: '图片加载中...';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #999;
  font-size: 14px;
}

.carousel-slide img:hover {
  transform: scale(1.05);
}

.carousel-controls {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 8px;
  transform: translateY(-50%);
  pointer-events: none;
}

.carousel-btn {
  background: rgba(255, 255, 255, 0.8);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  pointer-events: auto;
  font-size: 12px;
  color: #333;
}

.carousel-btn:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: scale(1.1);
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 10px 0 6px;
  background: rgba(255, 255, 255, 0.9);
  flex-wrap: wrap;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ccc;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.dot::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  background: rgba(50, 115, 220, 0.1);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dot.active {
  background: #3273dc;
  transform: scale(1.2);
}

.dot:hover {
  background: #5a9bd4;
  transform: scale(1.1);
}

.dot:hover::after {
  opacity: 1;
}

/* 图片预览模态框样式 */
.image-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.image-preview-modal.active {
  opacity: 1;
  visibility: visible;
}

.image-preview-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-preview-prev,
.image-preview-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 20px;
  transition: all 0.3s ease;
  z-index: 10001;
}

.image-preview-prev {
  left: -70px;
}

.image-preview-next {
  right: -70px;
}

.image-preview-prev:hover,
.image-preview-next:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.8);
  transform: translateY(-50%) scale(1.1);
}

.image-preview-content img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.image-preview-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 18px;
  transition: all 0.3s ease;
}

.image-preview-close:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.8);
  transform: scale(1.1);
}

.image-preview-info {
  position: absolute;
  bottom: -50px;
  left: 0;
  right: 0;
  text-align: center;
  color: white;
  font-size: 14px;
  opacity: 0.8;
}

.image-preview-counter {
  position: absolute;
  top: -50px;
  left: 0;
  right: 0;
  text-align: center;
  color: white;
  font-size: 16px;
  font-weight: bold;
  opacity: 0.9;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .carousel-container {
    height: 200px;
  }
  
  .carousel-btn {
    width: 28px;
    height: 28px;
    font-size: 10px;
  }
  
  .image-preview-content {
    max-width: 95%;
    max-height: 95%;
  }
  
  .image-preview-close {
    top: -35px;
    width: 35px;
    height: 35px;
    font-size: 16px;
  }
  
  .image-preview-prev,
  .image-preview-next {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  
  .image-preview-prev {
    left: -50px;
  }
  
  .image-preview-next {
    right: -50px;
  }
  
  .image-preview-counter {
    top: -40px;
    font-size: 14px;
  }
  
  .image-preview-info {
    bottom: -40px;
    font-size: 12px;
  }
}
