body {
    font-family: sans-serif;
    margin: 0;
    /* 动态渐变背景 */
    background: linear-gradient(-45deg, #e0f2f7, #c1e4f4, #a0d5ee, #80c6e8); /* 定义渐变颜色 */
    background-size: 400% 400%; /* 扩大背景尺寸以实现动画效果 */
    animation: gradientAnimation 15s ease infinite; /* 应用动画 */
    color: #333; /* 深灰色文字 */
    line-height: 1.6;
    overflow-x: hidden; /* 防止水平滚动 */
}

/* 定义渐变动画 */
@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%; /* 动画开始位置 */
    }
    50% {
        background-position: 100% 50%; /* 动画中间位置 */
    }
    100% {
        background-position: 0% 50%; /* 动画结束位置，回到开始 */
    }
}

/* 当模态框打开时，body 的滚动条隐藏 */
body.modal-open {
    overflow: hidden;
}

/* 引入新的字体 - 例如 Oswald 和 Raleway */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@700&family=Raleway:wght@400;600&display=swap');


header {
    background-color: rgba(224, 242, 247, 0.8); /* 淡蓝色半透明头部 */
    color: #333;
    padding: 0.8em 2em; /* **减小顶部和底部的内边距** */
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed; /* 固定在顶部 */
    top: 0;
    left: 0;
    right: 0;
    z-index: 100; /* 确保在内容上方 */
}

.logo {
    font-size: 1.3em; /* **稍微减小Logo字体大小** */
    font-weight: bold;
    font-family: 'Oswald', sans-serif; /* Logo也使用新字体 */
    display: flex; /* 使用flexbox对齐图标和文字 */
    align-items: center; /* 垂直居中对齐 */
}

.logo-icon {
    height: 1.3em; /* **控制图标高度，与新Logo字体大小对齐** */
    width: auto; /* 保持图标比例 */
    margin-right: 0.5em; /* 图标与文字之间的间距 */
    vertical-align: middle; /* 垂直对齐方式 */
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

nav li {
    margin-left: 1.2em; /* **减小列表项之间的间距** */
    padding: 0.3em 0; /* **减小导航链接的垂直内边距** */
    font-size: 0.95em; /* **稍微减小导航文字大小** */
}

nav a {
    color: #555;
    text-decoration: none;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #007bff; /* 蓝色hover效果 */
}

main {
    padding-top: 50px; /* **调整main的padding-top，以适应更小的header** */
}

.section {
    padding: 4em 2em;
    text-align: center;
}

.section h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 3.5em;
    font-weight: 700;
    margin-bottom: 0.3em;

    background: linear-gradient(45deg, #007bff, #00c6ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;

    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
}

.section p {
    font-family: 'Raleway', sans-serif;
    font-size: 1.2em;
    color: #555;
    margin-top: 0;
    margin-bottom: 2em;
}

/* 音频播放器容器样式 */
.audio-player {
    margin: 10px;
    display: inline-block;
    vertical-align: top;
}

#myAudio1,
#myAudio2,
#myAudio3 {
    width: 250px;
    max-width: 100%;
}

/* 为了让所有音频播放器横向居中，给它们的父容器添加 Flexbox */
#home .section-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
}

/* 照片部分样式 */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5em;
    margin-top: 2em;
}

.photo-grid img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease-in-out;
    cursor: pointer;
}

.photo-grid img:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.4);
}

/* 视频播放器样式 */
.video-player {
    margin-top: 20px;
    text-align: center;
}

#myVideo {
    width: 90%;
    max-width: 800px;
    height: 500px; /* 您仍然可以自定义播放器高度 */
    object-fit: contain; /* 将 'cover' 修改为 'contain' */
    background-color: #000; /* 添加黑色背景以美化黑边效果 */
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

footer {
    background-color: #f0f8ff; /* 浅天蓝色底部 */
    color: #666;
    text-align: center;
    padding: 1em;
    position: relative;
}

/* --- 图片放大模态框样式 --- */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: hidden;

    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    display: block;
    max-width: 95vw;
    max-height: 95vh;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: auto;
    animation-name: zoom;
    animation-duration: 0.6s;
    background-color: transparent;
}

/* 关闭按钮 */
.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 50px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
    z-index: 10000;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
}

/* 图片说明文字 */
#caption {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    color: #ccc;
    padding: 10px 20px;
    background-color: rgba(0, 0, 0, 0.7);
    box-sizing: border-box;
    z-index: 9999;
}

/* 动画效果 */
@keyframes zoom {
    from {transform: scale(0.1)}
    to {transform: scale(1)}
}

/* --- Back to Top Button --- */
#backToTopBtn {
    display: none; /* 默认隐藏 */
    position: fixed;
    bottom: 20px;
    right: 30px;
    z-index: 101; /* 确保在其它内容之上，除了模态框 */
    border: none;
    outline: none;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    padding: 15px;
    border-radius: 10px;
    font-size: 18px;
    transition: background-color 0.3s, opacity 0.5s;
}

#backToTopBtn:hover {
    background-color: #0056b3;
}

/* --- Footer Link Button --- */
#footer-link-button {
    position: absolute;
    left: 2em; /* Distance from the left edge */
    top: 50%;  /* Position halfway down the footer */
    transform: translateY(-50%); /* Precisely center vertically */
    font-size: 0.8em; /* Makes the button text small */
    text-decoration: none;
    padding: 5px 10px;
    background-color: rgba(0, 123, 255, 0.7); /* Semi-transparent blue */
    color: white;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

#footer-link-button:hover {
    background-color: #0056b3; /* Darker blue on hover */
}

/* 针对小屏幕设备的响应式调整 */
@media screen and (max-width: 768px) {
    header {
        padding: 0.5em 1em; /* **小屏幕header padding更小** */
    }
    .logo {
        font-size: 1.1em; /* **小屏幕logo字体更小** */
    }
    .logo-icon {
        height: 1.1em; /* **小屏幕图标大小** */
    }
    nav li {
        margin-left: 0.8em; /* **小屏幕导航间距更小** */
        font-size: 0.85em; /* **小屏幕导航文字更小** */
    }
    main {
        padding-top: 40px; /* **小屏幕main的padding-top** */
    }
    .section h2 {
        font-size: 2.5em;
    }
    .section p {
        font-size: 1em;
    }
    .modal-content {
        max-width: 98vw;
        max-height: 90vh;
    }
    .close {
        font-size: 40px;
        top: 15px;
        right: 25px;
    }
    #caption {
        padding: 8px 15px;
        font-size: 0.8em;
    }
}