/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #5a4a42;
    background-color: #fffaf0;
}

/* 导航栏样式 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background-color: #f5e6d3;
    box-shadow: 0 2px 10px rgba(139, 69, 19, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #8b4513;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #8b4513;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.nav-link:hover,
.nav-link.active {
    background-color: #e6d3b7;
    color: #654321;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: #8b4513;
    margin: 3px 0;
    transition: 0.3s;
}

/* 主要内容区域 */
main {
    min-height: calc(100vh - 120px);
    padding: 2rem 5%;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

/* 主页样式 */
.hero {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.hero h1 {
    font-size: 2.5rem;
    color: #8b4513;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    color: #a0522d;
}

.intro {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background-color: #fdf6e3;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.1);
}

.intro h2 {
    color: #8b4513;
    margin-bottom: 1rem;
    text-align: center;
}

/* 日记页面样式 */
.diary-container {
    max-width: 800px;
    margin: 0 auto;
}

.diary-entry {
    background-color: #fdf6e3;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(139, 69, 19, 0.1);
    border-left: 4px solid #d2b48c;
}

.diary-date {
    font-weight: bold;
    color: #8b4513;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.diary-content p {
    color: #5a4a42;
    line-height: 1.8;
}

/* 照片墙样式 */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.photo-item {
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.photo-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.photo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.3);
}

/* 联系我页面样式 */
.contact-container {
    max-width: 800px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.contact-info h3,
.contact-form h3 {
    color: #8b4513;
    margin-bottom: 1rem;
}

.contact-info p {
    margin-bottom: 0.8rem;
    color: #5a4a42;
}

.contact-text {
    background-color: #fdf6e3;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(139, 69, 19, 0.1);
}

.contact-text p {
    color: #5a4a42;
    line-height: 1.8;
    margin-top: 1rem;
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 1.5rem;
    background-color: #f5e6d3;
    color: #8b4513;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: #f5e6d3;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    main {
        padding: 1rem 5%;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .contact-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .photo-item img {
        height: 150px;
    }
}

@media screen and (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .intro {
        padding: 1rem;
    }

    .diary-entry {
        padding: 1rem;
    }
}