/* 基础样式 */
body {
    margin: 0;
    font-family: Arial, sans-serif;
}

/* 宽幅头部 */
.header {
    position: relative;
    width: 100%;
    height: 588px; /* 头部高度 */
    overflow: hidden;
    display: flex;
    align-items: flex-end; /* 文字底部对齐 */
    justify-content: center;
    color: white;
    text-align: center;
}

.header-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.header-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 图片填充容器，不变形 */
}

.header-text {
    position: relative;
    z-index: 2;
    background: rgba(0, 0, 0, 0.5); /* 半透明背景 */
    padding: 20px;
    width: 66%; /* 宽度占满 */
    box-sizing: border-box; /* 防止padding影响宽度 */
    animation: fadeOut 9s forwards; /* 9秒后消失 */
}

@keyframes fadeOut {
    0% {
        opacity: 1; /* 初始状态：完全显示 */
    }
    100% {
        opacity: 0; /* 最终状态：完全消失 */
    }
}

.header-text h1 {
    margin: 0;
    font-size: 2.5rem;
}

.header-text p {
    margin: 1px 0 0;
    font-size: 1.2rem;
}

/* 12宫格图片布局 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(288px, 1fr)); /* 自动适应列数，最小200px */
    gap: 15px; /* 图片间距 */
}

.grid-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background: #fff;
    text-align: center; /* 文字居中 */
}

/* 图片容器 */
.image-container {
    width: 100%;
    padding-top: 100%; /* 1:1高宽比 */
    position: relative;
    overflow: hidden;
}

.image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* 图片填充容器，不变形 */
    display: block;
    transition: transform 0.3s ease;
}

.grid-item:hover img {
    transform: scale(1.1); /* 鼠标悬停时放大图片 */
}

/* 图片说明样式 */
figcaption {
    padding: 10px;
    font-size: 14px;
    color: #333;
    background: #f9f9f9;
    border-top: 1px solid #eee;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        height: 200px; /* 手机端头部高度 */
    }

    .header-text h1 {
        font-size: 2rem;
    }

    .header-text p {
        font-size: 1rem;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr); /* 手机端显示2列 */
    }
}

@media (max-width: 480px) {
    .header {
        height: 150px; /* 超小屏幕头部高度 */
    }

    .header-text h1 {
        font-size: 1.5rem;
    }

    .header-text p {
        font-size: 0.9rem;
    }

    .grid {
        grid-template-columns: 1fr; /* 超小屏幕显示1列 */
    }
}