/* 基础变量和通用样式 */
:root {
    --nav-height: 80px;
    --primary-color: #00ffcc;
    --glow-color: rgba(0, 255, 204, 0.3);
    --bg-color: #0a0c0f;
    --submenu-bg: rgba(15, 17, 20, 0.95);
    --text-color: #ffffff;
    --border-color: rgba(255, 255, 255, 0.1);
    --hover-bg: rgba(0, 255, 204, 0.1);
}

/* 基础导航样式 */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: var(--nav-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    color: var(--text-color);
    font-size: 2rem;
    font-weight: bold;
    text-decoration: none;
    letter-spacing: 1px;
    margin-right: 2rem;
    flex-shrink: 0;
    z-index: 1001;
}

.logo:hover {
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--glow-color);
}

.menu-toggle {
    display: none;
}

/* PC端样式 (min-width: 993px) */
@media (min-width: 993px) {
    .nav-menu {
        flex: 1;
        display: flex;
        justify-content: flex-end;
    }

    .nav-menu > ul {
        display: flex;
        list-style: none;
        margin: 0;
        padding: 0;
        gap: 1rem;
    }

    .nav-menu li {
        position: relative;
    }

    .nav-menu > ul > li > a {
        color: var(--text-color);
        text-decoration: none;
        padding: 0.4rem 0.8rem;
        display: block;
        transition: all 0.3s;
        white-space: nowrap;
        font-size: 0.95rem;
    }

    .nav-menu a:hover {
        color: var(--primary-color);
    }

    .submenu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        background: var(--submenu-bg);
        border: 1px solid var(--border-color);
        min-width: 200px;
        z-index: 1000;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        padding: 0.3rem 0;
        border-radius: 4px;
    }

    .submenu li {
        list-style: none;
    }

    .submenu a {
        color: var(--text-color);
        text-decoration: none;
        padding: 0.5rem 1rem;
        display: block;
        transition: all 0.3s;
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .submenu a:hover {
        color: var(--primary-color);
        background: var(--hover-bg);
    }

    .submenu .submenu {
        top: 0;
        left: 100%;
        margin-top: -0.3rem;
    }

    /* 右侧导航项的子菜单向左展开 */
    .nav-menu > ul > li:nth-last-child(-n+3) > .submenu {
        right: 0;
        left: auto;
    }

    .nav-menu > ul > li:nth-last-child(-n+3) .submenu .submenu {
        right: 100%;
        left: auto;
    }

    /* PC端hover展开 */
    .has-submenu:hover > .submenu {
        display: block;
    }
}

/* 移动端样式 (max-width: 992px) */
@media (max-width: 992px) {
    .nav-container {
        padding: 0 1rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .logo {
        font-size: 1.5rem;
        z-index: 1001;
        margin-right: 0;
        text-align: left;
        flex: 0 0 auto;
    }

    .menu-toggle {
        display: block;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        width: 30px;
        height: 24px;
        position: relative;
        z-index: 1001;
        margin-left: auto;
        flex: 0 0 auto;
    }

    .menu-toggle span {
        display: block;
        width: 100%;
        height: 2px;
        background: var(--text-color);
        position: absolute;
        transition: all 0.3s;
    }

    .menu-toggle span:first-child {
        top: 0;
    }

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

    .menu-toggle span:last-child {
        bottom: 0;
    }

    .menu-toggle.active span:first-child {
        top: 50%;
        transform: translateY(-50%) rotate(45deg);
    }

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

    .menu-toggle.active span:last-child {
        top: 50%;
        transform: translateY(-50%) rotate(-45deg);
    }

    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--nav-height));
        background: var(--bg-color);
        padding: 0;
        overflow-y: auto;
        z-index: 1000;
        -webkit-overflow-scrolling: touch;
        display: none;
    }

    .nav-menu.active {
        display: block;
    }

    .nav-menu ul {
        list-style: none;
        margin: 0;
        padding: 0;
        width: 100%;
    }

    .nav-menu li {
        width: 100%;
        position: relative;
        background: var(--bg-color);
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu a {
        color: var(--text-color);
        text-decoration: none;
        padding: 1rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        transition: background-color 0.3s;
    }

    .nav-menu a:active {
        background-color: var(--hover-bg);
    }

    .submenu {
        display: none;
        width: 100%;
        background: var(--submenu-bg);
    }

    .has-submenu.active > .submenu {
        display: block;
    }

    .has-submenu > a.menu-link::after {
        content: '+';
        margin-left: 0.5rem;
        font-size: 1.2rem;
        line-height: 1;
    }

    .has-submenu.active > a.menu-link::after {
        content: '-';
    }

    /* 多级菜单样式 */
    .nav-menu > ul > li > a {
        padding: 1rem;
        background: var(--bg-color);
    }

    .submenu li > a {
        padding-left: 2rem;
        background: rgba(255, 255, 255, 0.02);
    }

    .submenu .submenu li > a {
        padding-left: 3rem;
        background: rgba(255, 255, 255, 0.04);
    }

    .submenu .submenu .submenu li > a {
        padding-left: 4rem;
        background: rgba(255, 255, 255, 0.06);
    }

    /* 遮罩层 */
    .nav-overlay {
        display: none;
        position: fixed;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--nav-height));
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

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