/* 导航外层容器 */
.nav {
    width: 100%;
    height: 60px;
    background: #1f2937;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 15px;
    box-sizing: border-box;
}

/* 导航Logo */
.nav-logo {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    flex-shrink: 0;
}
.nav-logo img {
    width: 200px;
    height: 40px;
    object-fit: contain;
    vertical-align: middle;
}

/* PC端导航菜单 */
.nav-pc {
    display: flex;
    gap: 15px;
    margin-left: auto;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: calc(100vw - 260px);
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.nav-pc::-webkit-scrollbar {
    display: none;
}
.nav-pc a {
    color: #e5e7eb;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0 2px;
}
.nav-pc a:hover {
    color: #fff;
}

/* 移动端汉堡按钮 */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    margin-left: auto;
    flex-shrink: 0;
    
    /* 三横样式 */
    position: relative;
    width: 36px;
    height: 36px;
    font-size: 0;
    padding: 0;
}

/* 汉堡按钮 三横样式 */
.nav-toggle::before,
.nav-toggle::after,
.nav-toggle span {
    content: '';
    position: absolute;
    left: 6px;
    width: 24px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}
.nav-toggle span {
    top: 16px;
}
.nav-toggle::before {
    top: 8px;
}
.nav-toggle::after {
    top: 24px;
}

/* 激活态：变成X */
.nav-toggle.active::before {
    top: 16px;
    transform: rotate(45deg);
}
.nav-toggle.active::after {
    top: 16px;
    transform: rotate(-45deg);
}
.nav-toggle.active span {
    opacity: 0;
}

/* 手机端菜单：宽度跟随文字 + 平滑动画 + 块状 + 分隔线 */
.nav-mobile {
    position: fixed;
    top: 60px;
    right: 0;
    /* 关键修改：宽度改为自适应，最大不超过80vw，防止超出屏幕 */
    width: auto;
    min-width: 160px;
    max-width: 80vw;
    background: #1f2937;
    z-index: 9998;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease-out;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 2px 10px rgba(0,0,0,0.2);
}
.nav-mobile.show {
    max-height: 600px;
    opacity: 1;
    padding: 8px 0;
}
.nav-mobile a {
    color: #e5e7eb;
    text-decoration: none;
    font-size: 15px;
    padding: 12px 20px;
    display: block;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    transition: background 0.2s;
    /* 关键：禁止文字换行，让宽度自动适配 */
    white-space: nowrap;
}
.nav-mobile a:last-child {
    border-bottom: none;
}
.nav-mobile a:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

/* 响应式 */
@media (max-width: 1200px) {
    .nav-pc {
        display: none;
    }
    .nav-toggle {
        display: block;
    }
}