/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    transition: background-image 1s ease-in-out;
    min-height: 100vh;
}

/* 背景图样式 */
.bg-1 {
    background-image: url('dog.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.bg-2 {
    background-image: url('yh1.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.bg-3 {
    background-image: url('cs.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* 背景图切换控制 */
.bg-control {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
}

.bg-btn {
    padding: 8px 16px;
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.bg-btn:hover {
    background-color: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
}

/* 容器样式 */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏样式 */
nav {
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

nav h1 a {
    color: #333;
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: bold;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav ul li a {
    color: #333;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: #666;
}

/* 英雄区域样式 */
.hero {
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 20px;
    animation: fadeInUp 1s ease-out;
}

.hero p {
    font-size: 1.5rem;
    animation: fadeInUp 1s ease-out 0.3s both;
}

/* 区块样式 */
.section {
    padding: 80px 0;
    background-color: rgba(255, 255, 255, 0.95);
    margin: 40px 0;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: #333;
}

/* 风景照片展示 */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.photo-item {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.photo-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.photo-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.photo-item p {
    padding: 20px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 500;
}

/* 代码项目展示 */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.project-item {
    background-color: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.project-item h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #333;
}

.project-item p {
    color: #666;
    line-height: 1.6;
}

/* 关于我 */
.about-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 30px;
}

.about-content img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.about-text h3 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #333;
}

.about-text p {
    font-size: 1.1rem;
    color: #666;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

/* 页脚样式 */
footer {
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 40px 0;
    text-align: center;
}

footer p {
    margin: 10px 0;
    font-size: 1rem;
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    nav .container {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    nav ul {
        gap: 20px;
    }

    .hero h2 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1.2rem;
    }

    .section h2 {
        font-size: 2rem;
    }

    .photo-gallery,
    .project-grid {
        grid-template-columns: 1fr;
    }

    .bg-control {
        top: 10px;
        right: 10px;
        flex-direction: column;
        gap: 5px;
    }

    .bg-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .hero h2 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .section {
        padding: 50px 0;
        margin: 20px 0;
    }

    .section h2 {
        font-size: 1.8rem;
    }

    .photo-item img {
        height: 200px;
    }

    .project-item {
        padding: 20px;
    }

    .about-content img {
        width: 150px;
        height: 150px;
    }

    .about-text h3 {
        font-size: 1.5rem;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}