/* Gallery 自定义样式 - 让图片完整显示并适配移动端 */

/* 修改查看器中的图片显示方式 */
#viewer .slide .image {
    background-size: contain !important; /* 改为contain保证完整显示 */
    background-position: center !important; /* 居中显示 */
    background-color: #000 !important; /* 添加黑色背景 */
}

/* 优化缩略图显示 */
#thumbnails article .thumbnail img {
    height: 200px !important; /* 固定缩略图高度 */
    object-fit: cover !important; /* 缩略图保持比例裁切 */
    object-position: center !important; /* 缩略图居中显示 */
}

/* 优化文字显示 */
#thumbnails article h2, #thumbnails article p {
    display: block !important; /* 显示标题和描述 */
    color: #fff !important;
    text-align: center !important;
    padding: 0.5em !important;
    background: rgba(0,0,0,0.7) !important;
}

#thumbnails article h2 {
    font-size: 1em !important;
    font-weight: bold !important;
    margin-bottom: 0.25em !important;
}

#thumbnails article p {
    font-size: 0.8em !important;
    opacity: 0.9 !important;
}

/* 移动端适配 */
@media screen and (max-width: 980px) {
    #thumbnails article {
        width: 100% !important; /* 移动端单列显示 */
    }
    
    #thumbnails article .thumbnail img {
        height: 250px !important; /* 移动端增大缩略图 */
    }
    
    #viewer .slide .image {
        background-size: contain !important; /* 确保移动端也完整显示 */
    }
}

@media screen and (max-width: 736px) {
    #thumbnails {
        padding: 0.5em !important;
    }
    
    #thumbnails article .thumbnail img {
        height: 200px !important;
    }
    
    #thumbnails article h2 {
        font-size: 0.9em !important;
    }
    
    #thumbnails article p {
        font-size: 0.75em !important;
    }
}

@media screen and (max-width: 480px) {
    #thumbnails article .thumbnail img {
        height: 180px !important;
    }
    
    #thumbnails article h2 {
        font-size: 0.8em !important;
    }
    
    #thumbnails article p {
        font-size: 0.7em !important;
    }
}

/* 改善加载状态和过渡效果 */
#viewer .slide .image {
    transition: opacity 0.3s ease-in-out !important;
}

/* 确保在所有设备上图片都完整显示 */
body.fullscreen #viewer .slide .image {
    background-size: contain !important;
    background-position: center !important;
}