/* 顶部导航区 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #ffffffe0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 78px;
}

.logo img {
    height: 50px;
}

.nav{
    height: 100%;
}
.nav-list {
    display: flex;
    gap: 5px;
    height: 100%;
    list-style: none;
}

.nav-item a {
    color: #8B4513;
    font-size: 16px;
    transition: color 0.3s;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
}

.nav-item a:hover,
.nav-item.active a {
    color: #8B4513;
    /* border-bottom-color: #8B4513; */
    font-weight: bold;
}

/* 子菜单样式 */
.nav-item {
    position: relative;
    height: 100%;
    width: 90px;
}

.nav-item-content {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
    flex-direction: column;
}

.nav-item-content:hover {
    border-top: 2px solid #8B4513;
    height: auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    background: #ffffffd4;
}

.nav-item-content:hover>a {
    font-weight: bold;
}

.nav-item-content>a{
    height: 76px;
    display: flex;
    align-items: center;
    padding: 0px;
    margin: 0px;
}

/* .nav-with-submenu > .nav-item-content > a::after {
    content: '▼';
    font-size: 10px;
    margin-left: 5px;
    transition: transform 0.3s;
} */

/* .nav-item-content:hover > a::after {
    transform: rotate(180deg);
} */

.submenu {
    /* position: absolute; */
    top: 100%;
    left: 0;
    /* background: #fff; */
    /* border-radius: 4px; */
    /* min-width: 150px; */
    /* visibility: hidden; */
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    z-index: 999;
    /* margin-top: 5px; */
    padding: 8px 0;
    display: none;
    width: 100%;
}

.nav-item-content:hover .submenu {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.submenu li {
    margin: 0;
    padding: 0;
}

.submenu li a {
    display: block;
    /* padding: 12px 20px; */
    color: #8B4513;
    font-size: 14px;
    transition: all 0.3s;
    white-space: nowrap;
}

.submenu li a:hover {
    /* background: #f5f5f5; */
    color: #8B4513;
    font-weight: bold;
    /* padding-left: 25px; */
}

/* toggle-icon 样式 */
.toggle-icon {
    display: none;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background-color: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.mobile-menu-btn span:nth-child(2) {
    width: 15px;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* 移动端菜单遮罩 */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

/* 移动端样式 */
@media (max-width: 768px) {
    .header {
        background: transparent;
        box-shadow: none;
    }

    .logo {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .header .container {
        height: 60px;
    }

    /* 移动端导航样式 */
    .nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 220px;
        height: 100vh;
        background-color: #fff;
        z-index: 1001;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        padding-top: 50px;
    }

    .nav.active {
        transform: translateX(0);
    }

    .nav-list {
        display: flex;
        flex-direction: column;
        gap: 0;
        height: auto;
    }

    .nav-item {
        width: 100%;
        height: auto;
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-item-content {
        height: auto;
        display: block;
    }

    .nav-item-content:hover {
        border-top: block;
        height: auto;
        box-shadow: none;
        background: transparent;
        border: 0px;
    }

    .nav-item-content > a {
        height: auto;
        padding: 16px 20px;
        display: flex;
        justify-content: space-between;
        width: 100%;
    }

    .submenu {
        position: static;
        display: block;
        width: 100%;
        box-shadow: none;
        padding: 0;
    }

    .submenu.active {
        display: flex;
        flex-direction: column;
    }

    .submenu li a {
        padding: 12px 20px 12px 40px;
        font-size: 14px;
    }

    .nav-item-content:hover .submenu {
        display: block;
    }

    /* 移动端显示 toggle-icon */
    .toggle-icon {
        display: inline-block;
    }

}
