/* 轮播图容器 */
.stacked-carousel {
    position: relative;
    width: 100%;
    height: 500px;
    perspective: 1000px; /* 为3D效果提供透视感 */
}

/* 轨道 - 包含所有图片 */
.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 单张图片容器 - 基础样式：默认隐藏 */
.carousel-item {
    position: absolute;
    width: 800px;
    height: 460px;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backface-visibility: hidden;

    /* --- 关键修正：默认隐藏所有图片 --- */
    opacity: 0; /* 默认完全透明 */
    transform: scale(0.5); /* 默认缩到很小，或使用 translateX 移出视图 */
    z-index: 1; /* 默认在最底层 */
    /* ------------------------------- */
}

/* 图片本身 */
.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 当前主图样式 */
.carousel-item.current {
    z-index: 10; /* 置于最上层 */
    opacity: 1; /* 覆盖基础样式，完全不透明 */
    transform: scale(1) translateZ(0); /* 覆盖基础样式，正常大小 */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* 左侧预览图 (前一张) */
.carousel-item.prev {
    z-index: 5; /* 低于主图 */
    opacity: 0.6; /* 半透明 */
    transform: scale(0.7) translateX(-200px) rotateY(-15deg); /* 缩小、左移、轻微3D旋转 */
}

/* 右侧预览图 (后一张) */
.carousel-item.next {
    z-index: 5; /* 低于主图 */
    opacity: 0.6; /* 半透明 */
    transform: scale(0.7) translateX(200px) rotateY(15deg); /* 缩小、右移、轻微3D旋转 */
}

/* 控制箭头 (保持不变) */
.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 15;
    opacity: 0.8;
    transition: opacity 0.3s, background-color 0.3s;
}

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

.prev { left: 15px; }
.next { right: 15px; }

/* 指示器 (可选，保持不变) */
.indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 15;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s;
}

.indicator.active {
    background-color: white;
}

/* 分页器 (指示器) */
.indicators {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 15; /* 确保在所有图片之上 */
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5); /* 默认半透明 */
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.indicator:hover {
    transform: scale(1.2); /* 悬停时稍微放大 */
}

.indicator.active {
    background-color: white; /* 当前页高亮 */
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}