.gallery img {
    width: 100%;
    height: auto;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform 0.3s ease;
    border-radius: 4px;}



/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    transition: all 0.3s ease;
    transform: scale(0.8);}

.modal.show .modal-content {
    transform: scale(1);}

.modal-img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    margin: 0 auto;}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s ease;}

.close-btn:hover {
    transform: rotate(90deg);}

.caption {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    display: none;}

.nav-btn {
position: absolute;
top: 50%;
transform: translateY(-50%);
color: white;
font-size: 30px;
cursor: pointer;
user-select: none;
background: rgba(0, 0, 0, 0.3);
border-radius: 50%;
width: 50px;
height: 50px;
text-align: center;
line-height: 50px;}

.prev-btn {
    left: 30px;}

.next-btn {
    right: 30px;}

/* 响应式设计 */
@media (max-width: 768px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));}

    .gallery img {
        height: 150px;}

    .close-btn {
        top: 10px;
        right: 15px;
        font-size: 30px;}

    .nav-btn {
        font-size: 30px;}

    .prev-btn {
        left: 10px;}

    .next-btn {
        right: 10px;}
}
