* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 添加个性化字体和配色 */
:root {
    --primary-color: #2c3e50;    /* 深蓝色调 */
    --accent-color: #3498db;     /* 亮蓝色调 */
    --text-color: #2c3e50;       /* 文字颜色 */
    --bg-color: #f9f9f9;         /* 背景色 */
}

body {
    font-family: 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden; /* 防止水平滚动 */
}

/* 导航栏样式 */
nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-container h1 {
    font-size: 1.2rem;
    white-space: nowrap;
    color: var(--primary-color);
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li a {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: color 0.3s;
    position: relative;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

nav ul li a:hover::after {
    width: 100%;
}

/* 首页部分样式 */
.hero {
    height: 100vh;
    min-height: 600px; /* 设置最小高度 */
    background-image: url('https://images.unsplash.com/photo-1484417894907-623942c8ee29');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 768px) {
    .hero {
        background-image: url('background-large.jpg');  /* 大屏幕加载高清图 */
    }
}

/* 添加遮罩层，使文字更清晰 */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);  /* 半透明黑色遮罩 */
}

.hero-content {
    position: relative;  /* 确保内容在遮罩之上 */
    z-index: 2;
    text-align: center;
    padding: 0 20px;
    max-width: 800px;
    margin: 0 auto;
    color: #ffffff;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInDown 1s ease-out;
}

.hero-content p {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 3px;
    animation: fadeInUp 1s ease-out 0.5s;
    animation-fill-mode: both;
}

/* 添加动画效果 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式适配 */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content p {
        font-size: 1.2rem;
    }
}

/* 优化背景图加载 */
.hero {
    background-color: #2c3e50;  /* 加载前的背景色 */
}

/* 关于我部分样式 */
.about {
    background-color: #f8f9fa;
    padding: 80px 0;
}

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

.about h2 {
    text-align: center;
    margin-bottom: 40px;
    color: #2c3e50;
    font-size: 2.5rem;
}

.about-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.about-text {
    max-width: 800px;
    text-align: center;
}

.intro-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #666;
    font-weight: 300;
    margin: 0 auto;
    padding: 20px;
}

/* 添加一些简单的动画效果 */
.about-text {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.2s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式适配 */
@media (max-width: 768px) {
    .about {
        padding: 60px 0;
    }
    
    .about h2 {
        font-size: 2rem;
    }
    
    .intro-text {
        font-size: 1.1rem;
    }
}

/* 照片集样式 */
.gallery {
    padding: 5rem 2rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.gallery-item {
    position: relative;
    width: 100%;
}

.image-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 66.67%;
    overflow: hidden;
}

.gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 保留简单的加载动画 */
.gallery-item {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 简化的动画延迟 */
.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }

/* 添加 JavaScript 来动态设置图片容器的宽高比 */

/* 响应式调整 */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }

    .gallery-item img {
        height: 250px;
    }
}

/* 简化的页脚样式 */
footer {
    background: #f8f9fa;
    padding: 40px 0;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.email-link {
    color: #2c3e50;
    text-decoration: none;
    font-size: 1rem;
    display: block;
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

.email-link:hover {
    color: #3498db;
}

.copyright {
    color: #666;
    font-size: 0.9rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    footer {
        padding: 30px 0;
    }
}

/* 响应��设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        text-align: center;
    }
    
    nav ul {
        margin-top: 1rem;
    }
    
    .about-content {
        flex-direction: column;
        text-align: center;
    }
    
    .about-content img {
        margin: 0 auto;
    }
}

/* 使用模糊加载效果 */
.lazy-image {
    filter: blur(10px);
    transition: filter 0.3s;
}

.lazy-image.loaded {
    filter: blur(0);
}

/* 添加页面加载进度条 */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: #007bff;
    z-index: 9999;
    transition: width 0.2s;
}

/* 内容区域样式 */
#content {
    position: relative;
    z-index: 1;
    background: #fff;
}

/* 调整其他部分的间距 */
section {
    padding: 80px 0;  /* 增加区块间距 */
}

/* 确保内容部分在导航栏下方正确显示 */
section:not(.hero) {
    margin-top: 0;
    position: relative;
    background: #fff;
}

/* 修复移动端的滚动问题 */
@media (max-width: 768px) {
    .hero {
        height: calc(100vh - 60px); /* 考虑移动端导航栏高度 */
        background-attachment: scroll; /* 移动端禁用固定背景 */
    }
}

/* 隐藏文章相关内 */
#blog, 
nav ul li a[href="#blog"] {
    display: none;
}

/* 统一的部分样式 */
.about, .gallery {
    background-color: #f8f9fa;
    padding: 80px 0;
}

/* 统一的标题样式 */
.about h2, .gallery h2 {
    text-align: center;
    margin-bottom: 40px;
    color: #2c3e50;
    font-size: 2.5rem;
}

/* 统一的文本样式 */
.about-content, .gallery-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.about-text, .gallery-text {
    max-width: 800px;
    text-align: center;
}

.intro-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #666;
    font-weight: 300;
    margin: 0 auto;
    padding: 20px;
}

/* 统一的动画效果 */
.about-text, .gallery-text {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.2s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 交替背景色（可选） */
.gallery {
    background-color: #fff; /* 让照片集和关于我的背景色交替 */
}

/* 为将来的照片网格预留样式 */
.gallery-grid {
    margin-top: 40px;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

/* 响��式适配 */
@media (max-width: 768px) {
    .about, .gallery {
        padding: 60px 0;
    }
    
    .about h2, .gallery h2 {
        font-size: 2rem;
    }
    
    .intro-text {
        font-size: 1.1rem;
    }
}

/* 联系部分样式 */
.contact {
    background-color: #f8f9fa;
    padding: 80px 0;
}

.contact h2 {
    text-align: center;
    margin-bottom: 40px;
    color: #2c3e50;
    font-size: 2.5rem;
}

.contact-content {
    text-align: center;
}

.email-link {
    color: #2c3e50;
    text-decoration: none;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.email-link:hover {
    color: #3498db;
}

/* 更新页脚样式为更简单的版本 */
footer {
    background: #f8f9fa;
    padding: 40px 0;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.contact-section {
    margin-bottom: 20px;
}

.contact-label {
    color: #2c3e50;
    font-size: 1rem;
    margin-right: 10px;
}

.email-link {
    color: #2c3e50;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.email-link:hover {
    color: #3498db;
}

.copyright {
    color: #666;
    font-size: 0.9rem;
}

/* 响应式调 */
@media (max-width: 768px) {
    footer {
        padding: 30px 0;
    }
    
    .contact-section {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }
}

/* 更新页脚样式 */
footer {
    background: #f8f9fa;
    padding: 40px 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-sections {
    display: flex;
    flex-wrap: wrap;  /* 添加换行 */
    justify-content: space-between;  /* 改为两端对齐 */
    gap: 30px;  /* 减小间距 */
    margin-bottom: 30px;
}

.footer-section {
    text-align: left;
}

.footer-section h4 {
    color: #2c3e50;
    font-size: 0.9rem;
    margin-bottom: 15px;
    font-weight: 600;  /* 加粗标题 */
    text-transform: uppercase;  /* 标题大写 */
    letter-spacing: 1px;  /* 标题字间距 */
}

.footer-link {
    color: #666;  /* 更浅的文字颜色 */
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: normal;
    transition: color 0.3s ease;
    display: block;
    line-height: 1.6;
}

.footer-link:hover {
    color: #3498db;
}

.friend-links {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.copyright {
    color: #666;
    font-size: 0.9rem;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .footer-section {
        margin-bottom: 20px;
    }
    
    .friend-links {
        flex-direction: column;
        gap: 10px;
    }
}

/* 瀑布流照片展示样式 */
.masonry-grid {
    column-count: 2;
    column-gap: 20px;
    padding: 20px 0;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 20px;
}

.masonry-item img {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: cover;
    display: block;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

/* 悬停效果 */
.masonry-item:hover img {
    transform: scale(1.02);
}

/* 加载动画 */
.masonry-item {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .masonry-grid {
        column-count: 1;
    }
    
    .masonry-item img {
        max-height: 500px;
    }
}

/* 优图片加载 */
.masonry-item img {
    background: #f0f0f0;
}

/* 添加图片加载动画 */
@keyframes imageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.masonry-item img.loaded {
    animation: imageFadeIn 0.5s ease;
}

/* 添加加载��示样式 */
.masonry-item {
    position: relative;
    break-inside: avoid;
    margin-bottom: 20px;
    max-height: 400px;
    overflow: hidden;
    background: #f5f5f5;  /* 背景色 */
    border-radius: 8px;
}

.image-loading-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f0f0f0 0%, #f8f8f8 50%, #f0f0f0 100%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    z-index: 1;
}

.masonry-item img {
    position: relative;
    width: 100%;
    height: 100%;
    max-height: 400px;
    object-fit: cover;
    display: block;
    border-radius: 8px;
    transition: opacity 0.3s ease;
    opacity: 0;
    z-index: 2;
}

.masonry-item img.loaded {
    opacity: 1;
}

.masonry-item img.loaded + .image-loading-placeholder {
    display: none;
}

/* 加载动画 */
@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 其他样式保持不变 */
.masonry-grid {
    column-count: 2;
    column-gap: 20px;
    padding: 20px 0;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .masonry-grid {
        column-count: 1;
    }
    
    .masonry-item,
    .masonry-item img {
        max-height: 350px;
    }
}

/* 添加模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding: 20px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
}

.close-modal {
    position: fixed;
    right: 35px;
    top: 15px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* 添加图片悬停效果 */
.gallery-img {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-img:hover {
    transform: scale(1.02);
}

/* 模态框动画 */
@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content {
    animation: zoomIn 0.3s ease;
}

/* 添加语言切换按钮样式 */
.lang-switch button {
    background: none;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    color: #333;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.lang-switch button:hover {
    background: #333;
    color: #fff;
}

/* 在暗色背景下���样式 */
.hero .lang-switch button {
    border-color: #fff;
    color: #fff;
}

.hero .lang-switch button:hover {
    background: #fff;
    color: #333;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .nav-container h1 {
        font-size: 1rem;
    }
}

/* 添加到现有的 gallery 相关样式中 */
.scroll-container {
    width: 100%;
    height: 80vh; /* 使用视口高度而不是固定高度 */
    overflow: hidden;
    position: relative;
}

.scroll-wrapper {
    display: flex;
    flex-direction: column; /* 改为垂直方向 */
    animation: scrollGallery 25s linear infinite;
    height: 200%; /* 两倍高度 */
}

.scroll-wrapper:hover {
    animation-play-state: paused;
}

@keyframes scrollGallery {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-50%); /* 改为垂直方向滚动 */
    }
}

.masonry-grid {
    flex: 0 0 50%;
    column-count: 2;
    column-gap: 20px;
    padding: 20px 0;
}

/* 移动端特定样式 */
@media (max-width: 768px) {
    .scroll-container {
        height: 70vh; /* 移动端稍微降低高度 */
    }
    
    .masonry-grid {
        column-count: 1; /* 移动端单列显示 */
        gap: 15px;
    }
    
    .scroll-wrapper {
        animation-duration: 20s; /* 移动端稍快的滚动速度 */
    }
    
    .masonry-item {
        margin-bottom: 15px;
    }
    
    .masonry-item img {
        max-height: 300px; /* 限制移动端图片高度 */
        width: 100%;
        object-fit: cover;
    }
}

@media (max-width: 768px) {
    .footer-sections {
        flex-direction: column;
        gap: 20px;
    }
    
    .footer-section {
        width: 100%;
        margin-bottom: 0;
    }
    
    .footer-content {
        padding: 0 15px;  /* 减小两边间距 */
    }
}