/**
 * 组件轮播模块 - 前端样式
 */

.component-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #000;
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-item {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    top: 0;
    left: 0;
}

.carousel-item.active {
    opacity: 1;
}

.carousel-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-bg-mobile {
    display: none;
}

/* 轮播指示点 */
.carousel-dots {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 10;
}

.carousel-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #ccc;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.carousel-dot.active {
    background-color: #000;
}

/* 播放进度条 */
.dot-progress {
    position: absolute;
    left: 0;
    top: 0;
    width: 0%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    transition: width linear;
}

.carousel-dot.active .dot-progress {
    width: 0%;
    animation: progress 5s linear forwards;
}

@keyframes progress {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

/* 点击指示点的激活状态 */
.carousel-dot.playing .dot-progress {
    animation: progress 5s linear forwards;
}

/* 移动设备响应式 */
@media (max-width: 768px) {
    .carousel-bg-desktop {
        display: none !important;
    }
    
    .carousel-bg-mobile {
        display: block !important;
    }
}

/* 平板设备 */
@media (min-width: 769px) {
    .carousel-bg-mobile {
        display: none !important;
    }
    
    .carousel-bg-desktop {
        display: block !important;
    }
}

/* PC 端调整 */
@media (min-width: 1024px) {
    .carousel-dots {
        bottom: -50px;
    }
}
