/* 轮播容器 */
.gallery-swiper {
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 0.5rem;
    position: relative;
}

/* 图片自适应 */
.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* 导航按钮 */
.swiper-button-prev, 
.swiper-button-next {
    color: #fff;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
    transform: scale(0.8);
}

/* 分页器 */
.swiper-pagination-bullet {
    background: #fff !important;
    opacity: 0.5;
    width: 8px;
    height: 8px;
}

.swiper-pagination-bullet-active {
    opacity: 1;
    transform: scale(1.2);
}

/* 全屏模式适配 */
.fancybox-container {
    background: rgba(0,0,0,0.9);
}

.fancybox-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

.fancybox-swiper img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
}

/* 缩略图轮播样式 */
.gallery-thumbs-swiper {
    padding: 0 10px;
    margin-top: 10px;
    margin-bottom: 2.5rem;
    height: clamp(80px, 12vh, 180px);
}

.gallery-thumbs-swiper .swiper-slide {
    overflow: hidden;
    border-radius: 4px;
    transition: all 0.3s ease;
    opacity: 0.6;
    cursor: pointer;
    aspect-ratio: 3/4; /* 所有情况下缩略图保持3:4比例 */
}

.gallery-thumbs-swiper .swiper-slide-thumb-active {
    opacity: 1 !important;
    border: 2px solid #3498db;
    transform: scale(1.05);
}

.gallery-thumbs-swiper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 微信浏览器特殊处理 */
@supports (-webkit-overflow-scrolling: touch) {
    /* 竖屏模式 - 3:4 比例 */
    .gallery-swiper {
        aspect-ratio: auto;
        height: 0;
        padding-bottom: 133.33%; /* 3:4 */
    }
    
    .gallery-swiper .swiper-wrapper {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
    
    .gallery-swiper .swiper-slide {
        height: 100% !important;
    }
    
    .gallery-swiper .swiper-slide img {
        min-height: 1px;
    }
    
    /* 缩略图 */
    .gallery-thumbs-swiper .swiper-slide {
        aspect-ratio: auto;
        height: 100%;
    }
    
    .gallery-thumbs-swiper .swiper-slide > div {
        position: relative;
        width: 100%;
        height: 0;
        padding-bottom: 133.33%; /* 3:4 */
    }
    
    .gallery-thumbs-swiper .swiper-slide img {
        position: absolute;
        top: 0;
        left: 0;
        min-height: 1px;
    }
    
    /* 横屏模式 - 4:3 比例 */
    @media (orientation: landscape) {
        .gallery-swiper {
            padding-bottom: 75%; /* 4:3 */
        }
        
        .gallery-thumbs-swiper {
            height: clamp(80px, 15vw, 120px);
        }
    }
}

/* 普通浏览器布局控制 */
/* 竖屏模式 - 3:4 比例 */
@media (orientation: portrait) {
    .gallery-swiper {
        aspect-ratio: 3/4;
    }
}

/* 横屏模式 & 桌面端 - 4:3 比例 */
@media (orientation: landscape), (min-width: 1025px) {
    .gallery-swiper {
        aspect-ratio: 4/3;
    }
    
    .gallery-thumbs-swiper {
        height: clamp(80px, 15vw, 120px);
    }
}

/* 响应式调整 */
@media (max-width: 1024px) {
    .gallery-thumbs-swiper {
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    .gallery-thumbs-swiper {
        margin-bottom: 1.5rem;
    }
    
    .swiper-button-prev, 
    .swiper-button-next {
        transform: scale(0.6);
    }
}