/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/*.container {*/
/*    max-width: 1200px;*/
/*    margin: 0 auto;*/
/*    padding: 20px;*/
/*}*/

/* 头部样式 */
.photo-wall-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
 
 
}

.photo-wall-header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.photo-wall-header h1 i {
    color: #3498db;
}

.photo-wall-header p {
    font-size: 1.1rem;
    color: #7f8c8d;
}

/* 照片墙容器 */
.photo-wall-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    display: inline-block; 
}

/* 照片墙主容器 - 固定2列基础布局 */
.photo-wall {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 基础2列布局 */
    grid-auto-rows: 250px; /* 固定行高 */
    gap: 20px;
    padding: 20px;
    position: relative;
}

/* 照片项样式 - 核心：悬停占2x2位置 */
.photo-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* 弹性动画 */
    z-index: 2;
    /* 防止内容溢出 */
    display: flex;
    flex-direction: column;
}

/* 核心效果：悬停时占据2行2列 */
.photo-item:hover {
    /* 占据2列2行 */
    grid-column: span 2;
    grid-row: span 2;
    /* 视觉强化 */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    z-index: 10; /* 最高层级 */
    transform: translateY(-5px); /* 轻微上浮 */
}

/* 照片图片样式 - 适配放大后的容器 */
.photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s ease;
}

/* 悬停时图片轻微放大填充空间 */
.photo-item:hover .photo-img {
    transform: scale(1.02);
}

/* 照片标题遮罩 */
.photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 25px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    transform: translateY(100%);
    transition: transform 0.4s ease 0.1s; /* 延迟显示，更自然 */
}

.photo-item:hover .photo-caption {
    transform: translateY(0);
}

.photo-caption h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.photo-caption p {
    font-size: 1rem;
    opacity: 0.9;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* 图片预览弹窗 */
.photo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.photo-modal.active {
    opacity: 1;
    visibility: visible;
}

/* 关闭按钮 */
.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s ease;
    z-index: 1001;
}

.modal-close:hover {
    color: #e74c3c;
}

/* 弹窗图片 */
.modal-img {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
    transform: scale(0.9);
    transition: transform 0.4s ease;
}

.photo-modal.active .modal-img {
    transform: scale(1);
}

/* 弹窗标题 */
.modal-caption {
    color: white;
    font-size: 1.2rem;
    margin-top: 20px;
    text-align: center;
    max-width: 80%;
}

/* 响应式调整 */
@media (min-width: 992px) {
    /* 大屏显示4列，悬停占2x2 */
    .photo-wall {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .photo-item:hover {
        grid-column: span 2;
        grid-row: span 2;
    }
}

@media (max-width: 991px) and (min-width: 576px) {
    /* 中屏2列，悬停占2x2 */
    .photo-wall {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .photo-item:hover {
        grid-column: span 2;
        grid-row: span 2;
    }
}

@media (max-width: 575px) {
    
    .photo-wall {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 基础2列布局 */
    grid-auto-rows: 62px; /* 固定行高 */
    gap: 20px;
    padding: 20px;
    position: relative;
}


.photo-wall-container {
    width: 90vw;
    overflow: hidden;
    position: relative;
    display: inline-block;
}
    .photo-img {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: all 0.5s ease;
}

    /* 小屏1列，悬停占1x2 */
    .photo-wall {
     
          margin: 0 auto;
          display: grid; /* 必须先声明网格布局，否则grid属性不生效 */
    grid-template-columns: repeat(2, 1fr); /* 1行2列，两列等宽 */
    gap: 16px; /* 可选：添加列之间的间距，提升美观度，可自定义数值 */
    }
    
    .photo-item:hover {
        grid-column: span 1;
        grid-row: span 2; /* 占2行 */
        transform: translateY(0);
    }
    
    .photo-wall-header h1 {
        font-size: 2rem;
    }
    
    .modal-close {
        font-size: 1.8rem;
        top: 15px;
        right: 20px;
    }
    
    .modal-img {
        max-width: 95%;
    }
}