/* ============================================================
 * 轮播图
 * 文件：css/carousel.css
 * ============================================================ */

/* 轮播图 */
.carousel {
    position: relative;
    width: 100%;
    max-width: none;
    /* 高度随窗口宽度自适应；窗口又窄又扁时用 70vh 兜底，不会高得离谱 */
    height: clamp(240px, min(45vw, 70vh), 640px);
    margin: 0 0 40px;
    overflow: hidden;
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    /* 手机上允许上下滑动页面，但左右滑动交给轮播图处理 */
    touch-action: pan-y;
}

.carousel-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

.carousel-item {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
    z-index: 10;
}

.carousel-btn:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.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.3s;
}

.indicator.active {
    background-color: #fff;
    transform: scale(1.2);
}
