/* Navigation Container */
.nav-container {
    width: var(--nav-width);
    height: 100%;
    transition: width var(--transition-duration) ease;
}

.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--nav-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: var(--nav-padding) 0;
    z-index: 1000;
    transition: all var(--transition-duration) ease;
}

/* Background layer for primary nav to allow submenu to slide behind white bar but over content */
.nav::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    border-right: 1px solid #e3e3e3;
    z-index: 10;
}

.nav-logo,
.nav-menu,
.nav-footer {
    position: relative;
    z-index: 20;
}

/* 移动端顶部 Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: #ffffff;
    z-index: 1001;
    padding: 0 20px;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.mobile-header .mobile-logo {
    height: 18px;
}

.mobile-header .mobile-logo img {
    height: 100%;
    width: auto;
}

/* 移动端 header 占位 */
.mobile-header-spacer {
    display: none;
    height: 70px;
}

/* 移动端汉堡菜单按钮 */
.menu-toggle {
    display: none;
    position: relative;
    z-index: 1002;
    background: #ffffff;
    border: none;
    border-radius: 8px;
    width: 48px;
    height: 48px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 1px;
}

/* 汉堡菜单状态1：初始状态 - 白色背景，灰色线（默认样式） */

/* 汉堡菜单状态2：菜单展开 - 橙色背景，白色线 */
.menu-toggle.active {
    background: var(--primary-color);
}

.menu-toggle.active span {
    background: #ffffff;
}



/* 移动端右侧滑出导航面板 */
.nav-mobile {
    position: fixed;
    top: 70px;
    right: 0;
    width: 140px;
    height: auto;
    max-height: calc(100vh - 70px);
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0 20px;
    z-index: 999;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    border-radius: 16px 0 0 16px;
}

.nav-mobile.active {
    transform: translateX(0);
}

.nav-menu-mobile {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0;
    width: 100%;
}

.nav-item-mobile {
    width: 100%;
    border-radius: 0;
}

.nav-link-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 20px 10px;
    text-decoration: none;
    position: relative;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.nav-link-mobile .nav-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 8px;
}

.nav-link-mobile .nav-text {
    font-size: 14px;
    line-height: 1.3;
    text-align: center;
    margin-top: 0;
    color: #666;
}

.nav-link-mobile.active {
    background-color: transparent;
    border-radius: 0;
}

.nav-link-mobile.active .nav-icon {
    /* 激活状态使用橙色图标 - 需要添加橙色版本图标或使用filter */
}

.nav-link-mobile.active .nav-text {
    color: var(--primary-color);
    font-weight: 600;
}



/* Logo Section */
.nav-logo {
    width: 91px;
    height: 13px;
    margin-bottom: 8px;
}

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

/* Navigation Menu */
.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--nav-width);
    height: var(--nav-width);
    cursor: pointer;
}

.nav-item .nav-link {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.nav-item.active .nav-link {
    position: relative;
    background: var(--primary-color-20);
}

.nav-item.active .nav-link::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    background: url(../image/active-nav-line.png) no-repeat top right / auto 100%;

}

/* Navigation Icons */
.nav-icon {
    display: block;
    width: 28px;
    height: 28px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.nav-text {
    font-size: 16px;
    color: #000;
    line-height: 18px;
    text-align: center;
    margin-top: 10px;
    font-weight: 500;
}

.icon-home {
    background-image: url('../image/icon-home.png');
}

.icon-about {
    background-image: url('../image/icon-about.png');
}

.icon-product {
    background-image: url('../image/icon-product.png');
}

.icon-particle {
    background-image: url('../image/icon-particle.png');
}

.icon-contact {
    background-image: url('../image/icon-contact.png');
}

.icon-language {
    background-image: url('../image/icon-language.png');
}

/* Navigation Footer */
.nav-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Submenu Styles */
.nav-submenu {
    position: fixed;
    top: 0;
    left: var(--nav-width);
    width: 320px;
    height: 100vh;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    padding: 0 50px;
    z-index: 5;
    list-style: none;
    visibility: hidden;
    opacity: 0;
    transform: translateX(-50%);
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
}

.nav-submenu.active {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
}

.submenu-item {
    margin-bottom: 25px;
}

.submenu-link {
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
    white-space: nowrap;
}

.submenu-link:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

/* ==================== 响应式适配 ==================== */

/* 平板及以下设备 (1024px 以下) - 隐藏桌面导航,显示移动端导航 */
@media screen and (max-width: 1024px) {
    /* 隐藏桌面端导航 */
    .nav-container {
        display: none;
    }

    /* 显示移动端顶部 Header */
    .mobile-header {
        display: flex;
    }

    /* 显示 header 占位 */
    .mobile-header-spacer {
        display: block;
    }

    /* 显示汉堡菜单按钮 */
    .menu-toggle {
        display: flex;
    }

    /* 主内容区域不需要额外的顶部间距 */
    .main-container {
        padding-top: 0 !important;
    }

    /* 移动端logo隐藏（已在header中显示） */
    .nav-logo-mobile {
        display: none;
    }
}

/* 小平板/大手机 (768px 以下) */
@media screen and (max-width: 768px) {
    .mobile-header {
        height: 60px;
        padding: 0 15px;
    }

    .mobile-header-spacer {
        height: 60px;
    }

    .mobile-header .mobile-logo {
        height: 16px;
    }

    .menu-toggle {
        width: 44px;
        height: 44px;
    }

    .menu-toggle span {
        width: 18px;
        height: 2px;
        margin: 2.5px 0;
    }

    .nav-mobile {
        top: 60px;
        width: 120px;
        max-height: calc(100vh - 60px);
        padding: 8px 0 16px;
    }

    .nav-link-mobile {
        padding: 16px 8px;
    }

    .nav-link-mobile .nav-icon {
        width: 24px;
        height: 24px;
        margin-bottom: 6px;
    }

    .nav-link-mobile .nav-text {
        font-size: 12px;
    }


}

/* 手机设备 (480px 以下) */
@media screen and (max-width: 480px) {
    .mobile-header {
        height: 56px;
        padding: 0 12px;
    }

    .mobile-header-spacer {
        height: 56px;
    }

    .mobile-header .mobile-logo {
        height: 14px;
    }

    .menu-toggle {
        width: 40px;
        height: 40px;
    }

    .menu-toggle span {
        width: 16px;
        height: 2px;
        margin: 2px 0;
    }

    .nav-mobile {
        top: 56px;
        width: 110px;
        max-height: calc(100vh - 56px);
        padding: 6px 0 14px;
    }

    .nav-link-mobile {
        padding: 14px 6px;
    }

    .nav-link-mobile .nav-icon {
        width: 22px;
        height: 22px;
        margin-bottom: 5px;
    }

    .nav-link-mobile .nav-text {
        font-size: 11px;
    }


}