.gallery-container {
    padding: 40px 0 40px;
    min-height: calc(100vh - 200px);
    position: relative;
}

.gallery-header {
    text-align: center;
    margin-bottom: 50px;
}

.gallery-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    margin-bottom: 15px;
    color: #333;
    position: relative;
    display: inline-block;
}

.gallery-title:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #8e44ad);
}

.gallery-description {
    color: #6c757d;
    max-width: 800px;
    margin: 25px auto 0;
    font-size: 1.1rem;
    line-height: 1.6;
    align-content: center;
}

/* 相册网格布局 */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .photo-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .photo-grid {
        grid-template-columns: 1fr;
    }

    .gallery-title {
        font-size: 2.2rem;
    }
}

/* 相册卡片样式 */
.photo-card {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    aspect-ratio: 4/3;
    background: #fff;
    transform-origin: center;
    z-index: 1;
    cursor: pointer;
}

.photo-card:hover {
    transform: scale(2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.photo-card:hover .photo-img {
    transform: scale(1);
}

.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    padding: 25px 20px 15px;
    color: white;
    opacity: 0;
    transition: all 0.4s ease;
    transform: translateY(15px);
}

.photo-card:hover .photo-overlay {
    opacity: 1;
    transform: translateY(0);
}

.photo-title {
    font-size: 0.8rem;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* 模态框样式 - 完全透明悬浮效果 */
.photo-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    background-color: transparent;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.photo-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    padding: 20px;
    pointer-events: none;
}

.modal-image {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    transition: transform 0.3s ease;
    border-radius: 8px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
}

/* 控制按钮 - 悬浮效果 */
.modal-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    background: transparent;
    padding: 10px 15px;
    border-radius: 25px;
    z-index: 10001;
    pointer-events: auto;
}

.modal-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: #333;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.modal-btn:hover {
    transform: scale(1.2);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* 关闭按钮 */
.close-btn {
    position: absolute;
    top: 25px;
    right: 30px;
    color: #333;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10001;
    background: rgba(255, 255, 255, 0.9);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
}

.close-btn:hover {
    color: #ff4757;
    transform: scale(1.1);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .modal-controls {
        bottom: 20px;
        gap: 12px;
    }

    .modal-btn {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }

    .close-btn {
        top: 15px;
        right: 20px;
        font-size: 30px;
        width: 40px;
        height: 40px;
    }

    .modal-image {
        max-width: 95%;
        max-height: 85vh;
    }
}

/* 确保body在模态框打开时可以滚动 */
body {
    overflow-x: hidden;
}

body.modal-open {
    overflow: hidden;
}

/* 背景遮罩 */
.modal-backdrop {
    display: none;
    position: fixed;
    z-index: 9998;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-backdrop.show {
    display: block;
    opacity: 1;
}