/* Header styles */
.header {
    height: 80px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.logo {
    display: block;
    height: 42px;
    transition: all 0.3s ease;
}

.logo img {
    height: 100%;
    width: auto;
    object-fit: contain;
}

.nav {
    display: flex;
    align-items: center;
    gap: 30px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-header {
    display: none;
}

.nav-item {
    color: #333;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item:hover,
.nav-item.active {
    color: #ff69b4;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #ff69b4;
}

/* 汉堡菜单按钮 */
.menu-toggle {
    display: none;
    width: 25px;
    height: 20px;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 1001;
    padding: 0;
    background: none;
    border: none;
    position: relative;
}

.menu-toggle span {
    display: block;
    width: 90%;
    height: 2px;
    background-color: #ff69b4;
    transition: all 0.3s ease;
    transform-origin: left center;
    position: absolute;
    left: 0;
}

.menu-toggle span:nth-child(1) {
    top: 0;
}

.menu-toggle span:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.menu-toggle span:nth-child(3) {
    bottom: 0;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg);
    top: 2px;
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg);
    bottom: 2px;
}

/* 遮罩层 */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-overlay.active {
    opacity: 1;
    display: block;
}

/* 为了防止内容被导航栏遮挡 */
body {
    padding-top: 80px;
}

@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }

    .header {
        height: 70px;
        background-color: #fff;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    .header .container {
        padding: 0 15px;
        justify-content: flex-start;
        height: 70px;
    }

    .logo {
        height: 48px;
        z-index: 1001;
        margin: 0;
        position: relative;
        padding: 5px 0;
    }

    .menu-toggle {
        display: flex;
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        margin: 0;
        width: 32px;
        height: 26px;
    }

    .nav {
        position: fixed;
        top: 0;
        left: -75%;
        width: 75%;
        transform: none;
        height: 100vh;
        background-color: #fff;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 100px 40px 60px;
        gap: 40px;
        transition: all 0.3s ease;
        z-index: 1000;
        visibility: hidden;
        opacity: 0;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }

    .nav.active {
        left: 0;
        visibility: visible;
        opacity: 1;
    }

    .nav-item {
        width: 100%;
        text-align: left;
        padding: 0;
        font-size: 20px;
        color: #333;
        border: none;
        position: relative;
        display: block;
    }

    .nav-item::after {
        content: '';
        position: absolute;
        bottom: -10px;
        left: 0;
        width: 100%;
        height: 1px;
        background-color: #eee;
        transition: all 0.3s ease;
    }

    .nav-item.active {
        color: #ff69b4;
    }

    .nav-item.active::after {
        display: block;
        background-color: #ff69b4;
        height: 1px;
    }

    .nav-item:hover {
        color: #ff69b4;
    }

    .nav-overlay.active {
        visibility: visible;
        opacity: 1;
    }

    .nav-header {
        display: none;
    }

    body.nav-active {
        overflow: hidden;
    }
}