/* =========================================================
   Nav 样式（桌面 + 移动端 · 渐变胶囊统一）
   设计原则：
   1️⃣ 左侧 Logo 调小
   2️⃣ 菜单选中状态及语言按钮统一 Logo 渐变胶囊
   3️⃣ 移动端 / 桌面端未选中菜单透明底
   4️⃣ 保留 hover 浮起效果、指示条、语言下拉
========================================================= */
 
/* 通用 Nav */
.nav {
    font-weight: 500;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    z-index: 1000;
    background: rgba(245, 244, 250, .9);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(123, 79, 201, .18);
    transition:
        transform .4s cubic-bezier(.2, .8, .2, 1),
        background .3s ease,
        box-shadow .3s ease;
}

/* 向下滚动隐藏菜单 */
.nav-hidden {
    transform: translateY(-100%);
}

/* 滚动一定距离改变背景 */
.nav-dim {
    background: rgba(245, 244, 250, .85);
}

/* 内部容器 */
.nav-inner {
    max-width: 1200px;
    height: 100%;
    margin: auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo */
.nav-logo-img {
    height: 26px;
    /* 更小，更轻盈 */
}

/* 桌面菜单 */
.nav-menu {
    display: flex;
    gap: 32px;
    list-style: none;
    position: relative;
}

.nav-menu li {
    position: relative;
    padding: 8px 14px;
    border-radius: 999px;
    /* 胶囊形状 */
    cursor: pointer;
    color: #374151;
    transition: all .35s cubic-bezier(.2, .8, .2, 1);
    background: transparent;
    /* 未选中菜单透明底 */
}

/* 菜单浮起透明胶囊效果 */
.nav-menu li:hover {
    background: linear-gradient(90deg, rgba(155, 92, 255, 0.15) 0%, rgba(122, 108, 255, 0.15) 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(123, 79, 201, 0.12);
}

/* 当前页选中状态（深色浮起胶囊 + 闪光效果） */
.nav-menu li.is-active {
    color: #fff;
    font-weight: 600;
    background: linear-gradient(90deg, rgba(155, 92, 255, 0.8) 0%, rgba(122, 108, 255, 0.8) 100%);
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(123, 79, 201, 0.32),
        0 10px 28px rgba(123, 79, 201, 0.22);
    position: relative;
}

/* 当前页闪光效果 */
.nav-menu li.is-active::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(120deg,
            transparent 30%,
            rgba(255, 255, 255, 0.55),
            transparent 70%);
    animation: glow 2.8s infinite;
    pointer-events: none;
}

@keyframes glow {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(100%);
    }
}

/* 桌面指示条 */
.nav-indicator {
    position: absolute;
    bottom: -6px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, #9B5CFF 0%, #7A6CFF 100%);
    box-shadow: 0 4px 10px rgba(123, 79, 201, .3);
    transition: left .45s cubic-bezier(.2, .8, .2, 1),
        width .45s cubic-bezier(.2, .8, .2, 1),
        opacity .25s ease;
    opacity: 0;
}

/* 桌面语言容器 */
.nav-lang {
    position: relative; /* ⭐ 必须 */
    display: flex;
    align-items: center;
}

/* 桌面语言按钮 */
.nav-lang .lang-btn {
    padding: 4px 10px;
    border-radius: 12px;
    background: linear-gradient(90deg, #ede9fe 0%, #ede9fe 100%);
    border: 1px solid transparent;
    font-size: 12px;
    font-weight: 600;
    color: #4c1d95;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ▼ 桌面语言下拉 */
.nav-lang .lang-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px); /* 比 36px 更稳 */
    background: #fff;
    border-radius: 10px;
    min-width: 120px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .15);
    z-index: 2000;
}

.nav-lang .lang-dropdown div {
    padding: 10px 16px;
    cursor: pointer;
}

.nav-lang .lang-dropdown div:hover {
    background: #ede9fe;
}

/* =========================
   移动端菜单
========================= */
@media (max-width: 768px) {
    .desktop-only {
        display: none;
    }

    .mobile-only {
        display: block;
    }

    .nav-toggle {
        font-size: 24px;
        font-weight: 400;
        line-height: 1;
        color: #4b5563;
        cursor: pointer;
        user-select: none;
    }

    .nav-toggle:hover {
        color: #374151;
    }

    .nav-menu {
        position: absolute;
        top: 64px;
        right: 16px;
        width: 180px;
        background: #fff;
        border-radius: 14px;
        box-shadow: 0 16px 40px rgba(0, 0, 0, .18);
        gap: 5px !important;
        padding: 6px 0;
        margin: 0;
        list-style: none;
        display: flex;
        flex-direction: column;
        transform: translateY(-6px) scale(.96);
        opacity: 0;
        pointer-events: none;
        transition: .25s ease;
    }

    .nav-menu.open {
        transform: translateY(0) scale(1);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-menu>li {
        height: 32px;
        display: flex;
        align-items: center;
        padding: 0 14px;
        font-size: 13.5px;
        line-height: 1;
        cursor: pointer;
        border-radius: 999px;
        background: transparent;
        transition: all .25s ease;
        position: relative;
    }

    .nav-menu>li:hover {
        background: linear-gradient(90deg, rgba(155, 92, 255, 0.15) 0%, rgba(122, 108, 255, 0.15) 100%);
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(123, 79, 201, 0.12);
    }

    .nav-menu>li.is-active {
        background: linear-gradient(90deg, rgba(155, 92, 255, 0.8) 0%, rgba(122, 108, 255, 0.8) 100%);
        box-shadow: inset 0 0 0 1px rgba(123, 79, 201, 0.32),
            0 10px 28px rgba(123, 79, 201, 0.22);
    }

    .nav-menu>li.is-active::after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: inherit;
        background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .55), transparent 70%);
        animation: glow 2.8s infinite;
        pointer-events: none;
    }

    .nav-menu>li.mobile-lang {
        background: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        border-top: 1px solid rgba(0, 0, 0, .12);
        margin-top: 6px;
        padding: 0 14px;
        color: #4b5563;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .nav-menu>li.mobile-lang span {
        margin-left: 8px;
        display: inline-block;
        transform: rotate(0deg);
        transition: transform .2s ease;
    }

    .nav-menu>li.mobile-lang.open span {
        transform: rotate(90deg);
    }

    .nav-menu>li.mobile-lang-item {
        height: 22px;
        font-size: 12px;
        display: flex;
        align-items: center;
        padding-left: 20px;
        padding-right: 14px;
        color: #374151;
        position: relative;
    }

    .nav-menu>li.mobile-lang-item::before {
        content: "•";
        position: absolute;
        left: 8px;
        font-size: 13px;
        color: #9ca3af;
        line-height: 1;
    }
}

@media (min-width: 769px) {

    .mobile-lang,
    .mobile-lang-item,
    .nav-toggle {
        display: none !important;
        height: 0 !important;
        overflow: hidden !important;
        pointer-events: none !important;
    }
}

