/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

.gallery-section {
    /* max-width: 1200px; */
    max-width: 80%;
    margin: 40px auto;
    padding: 0 20px;
}

.gallery-section h1 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.gallery-section > p {
    text-align: center;
    margin-bottom: 40px;
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* 筛选按钮样式 */
.filters {
    text-align: center;
    margin-bottom: 30px;
}

.filter-btn {
    padding: 10px 20px;
    margin: 0 5px 10px;
    border: none;
    background: #ecf0f1;
    color: #34495e;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: #3498db;
    color: white;
}

/* 画廊网格布局 */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: white;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.item-info {
    padding: 15px;
}

.item-info h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #2c3e50;
}

.item-info p {
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    display: block;
    margin:  auto;
    max-width: 90%;
    max-height: 80%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 5px;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #bbb;
}

.modal-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    width: 80%;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .gallery-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .gallery-section h1 {
        font-size: 2rem;
    }
    
    .filters {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .filter-btn {
        margin-bottom: 10px;
        flex: 1 0 auto;
        max-width: 100px;
    }

    .gallery-item img {
        width: 100%;
        height: 160px;
        object-fit: cover;
        display: block;
        transition: transform 0.5s ease;
    }

    .filter-btn {
        padding: 10px 20px;
        margin: 0 5px 10px;
        border: none;
        background: #ecf0f1;
        color: #34495e;
        border-radius: 30px;
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: 0.8rem;
    }
}