/* 轮播图基本样式 - 简化版 */
/* 覆盖全局section样式，确保轮播图没有额外padding */
section.carousel {
    padding: 0;
}

.carousel {
    position: relative;
    width: 100%;
    height: auto;
    overflow: hidden;
    margin-top: 56px;
    aspect-ratio: 16/9;
}

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

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

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

/* 确保媒体元素正确显示 */
.carousel-video, .carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
    position: relative;
    z-index: 1;
}

/* 视频轮播图时隐藏文字标签 */
.carousel-item:has(.carousel-video) .carousel-content {
    display: none;
}

/* 视频元素基本样式 */
.carousel-video {
    background-color: #000;
    z-index: 1;
}

/* 文字内容基本样式 - 统一大小 */
.carousel-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 10;
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem 1.5rem;
    max-width: 500px;
    min-width: 200px;
    width: 50%;
    box-sizing: border-box;
}

.carousel-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.carousel-content p {
    font-size: 1rem;
    margin-bottom: 1rem;
}

/* 控制按钮基本样式 */
.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    color: white;
    cursor: pointer;
    z-index: 15;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.carousel-control:hover {
    background-color: rgba(255, 255, 255, 0.8);
    color: var(--primary-color);
}

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

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

/* 指示器基本样式 */
.carousel-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 20;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.7);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background-color: var(--primary-color);
    width: 12px;
    border-radius: 4px;
}

/* 隐藏视频标签，使用CSS控制显示 */
.carousel-video {
    display: block;
}

/* 确保静态资源路径正确指向html/static/ */
.carousel-video source {
    src: url('../static/videos/lb.mp4') type='video/mp4';
}

/* 播放/暂停按钮样式 - 居中且更明显 */
.carousel-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background-color: rgba(255, 107, 0, 0.8);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.4);
}

.carousel-play-btn:hover {
    background-color: rgba(255, 107, 0, 1);
    color: white;
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 107, 0, 0.6);
}

/* 简化音量控制样式 - 移动到右下角并缩小 */
.carousel-volume-control {
    display: none;
    position: absolute;
    bottom: 15px;
    right: 15px;
    z-index: 15;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 0.3rem 0.5rem;
    border-radius: 20px;
    gap: 0.3rem;
    align-items: center;
    transform: scale(0.8);
}

.carousel-volume-control.visible {
    display: flex;
}

.volume-slider {
    width: 50px;
    accent-color: var(--primary-color);
}

.volume-icon {
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
}

/* 电脑端媒体查询 - 轮播图调整 */
@media (min-width: 768px) {
    /* 保持16:9比例，不覆盖原有aspect-ratio设置 */
    
    .carousel-content {
        padding: 1.5rem 3rem;
    }
    
    .carousel-content h2 {
        font-size: 2rem;
        margin-bottom: 0.8rem;
    }
    
    .carousel-content p {
        font-size: 1rem;
        margin-bottom: 1.2rem;
    }
    
    .carousel-play-btn {
        top: 50%;
        left: 50%;
        bottom: auto;
        transform: translate(-50%, -50%);
        width: 60px;
        height: 60px;
        font-size: 1.4rem;
    }
    
    .carousel-control {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .carousel-control.prev {
        left: 20px;
    }
    
    .carousel-control.next {
        right: 20px;
    }
    
    /* 音量控制电脑端样式 - 保持在右下角 */
    .carousel-volume-control {
        bottom: 20px;
        right: 20px;
        transform: scale(0.9);
    }
    
    .volume-slider {
        width: 60px;
    }
    
    .indicator {
        width: 10px;
        height: 10px;
    }
    
    .indicator.active {
        width: 16px;
    }
    
    .carousel-indicators {
        gap: 8px;
        bottom: 20px;
    }
}

/* 移动端优化 - 轮播图 */
@media (max-width: 480px) {
    /* 轮播图优化 */
    .carousel {
        margin-top: 50px;
    }
    
    .carousel-content {
        padding: 0.8rem 1.2rem;
    }
    
    .carousel-content h2 {
        font-size: 1.1rem;
    }
    
    .carousel-content p {
        font-size: 0.75rem;
    }
    
    .carousel-control {
        width: 25px;
        height: 25px;
        font-size: 0.8rem;
    }
    
    .carousel-control.prev {
        left: 5px;
    }
    
    .carousel-control.next {
        right: 5px;
    }
    
    .carousel-play-btn {
        width: 25px;
        height: 25px;
        font-size: 0.8rem;
        bottom: 15px;
    }
    
    .indicator {
        width: 6px;
        height: 6px;
    }
    
    .indicator.active {
        width: 10px;
    }
    
    .carousel-indicators {
        gap: 4px;
        bottom: 12px;
    }
}
