.nav {
    /* Override Bootstrap's `.nav { display:flex; }` to avoid layout conflicts. */
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
    z-index: 1000;
    padding: 8px 0;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    /* Make the center nav visually centered in the viewport (not between left/right blocks). */
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    column-gap: 24px;
}

.nav-logo {
    display: flex;
    align-items: center;
    justify-self: start;
}

.nav-logo a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.nav-logo img {
    height: 32px;
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(12px, 3vw, 32px);
    margin: 0;
}

.nav-link {
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
    opacity: 1;
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 10px 6px;
}

.nav-link:after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #FF4D00;
    transition: width 0.3s ease;
}

.nav-link:hover {
    opacity: 1;
}

.nav-link:hover:after {
    width: 100%;
}

.nav-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-self: end;
}

/* 小程序环境下隐藏头部交互（与首页一致） */
body.miniprogram-env .nav-buttons,
body.miniprogram-env .nav-toggle,
body.miniprogram-env .mobile-menu {
    display: none !important;
}

/* Header CTA pills */
.console-button,
.guide-button {
    background: #000000;
    color: #ffffff;
    border: 1.5px solid rgba(255, 255, 255, 0.9);
    border-radius: 9999px;
    padding: 6px 14px;
    min-height: 32px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    letter-spacing: 0.2px;
    text-decoration: none;
    white-space: nowrap;
}

.gitee-button {
    text-transform: none !important;
}

.console-button:hover,
.guide-button:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    text-decoration: none;
}

.console-button svg,
.guide-button svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Mobile toggle + popup menu (shared) */
.nav-toggle {
    display: none;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.35);
}

.nav-toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.mobile-menu {
    position: fixed;
    top: 64px;
    right: 12px;
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    z-index: 1200;
    backdrop-filter: blur(8px);
    min-width: 0;
    align-items: flex-end;
}

.mobile-menu.open {
    display: flex;
}

.mobile-menu a {
    width: 120px;
    justify-content: center;
    text-align: center;
}

.mobile-menu .console-button,
.mobile-menu .guide-button {
    padding: 6px 10px;
    font-size: 12px;
}

/* Back-to-top vertical nav (shared) */
.vertical-nav {
    position: fixed;
    right: 0;
    bottom: 100px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 15px 10px;
    border-radius: 8px 0 0 8px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transform: translateX(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease, box-shadow 0.3s ease;
    box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.2);
}

.vertical-nav:hover {
    box-shadow: -4px 4px 15px rgba(0, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0.8);
}

.vertical-nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #ffffff;
    text-decoration: none;
    font-size: 12px;
    gap: 4px;
    padding: 5px;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: visible;
}

.vertical-nav-item:hover {
    color: #0061FF;
    transform: translateY(-2px);
}

.vertical-nav-item svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.vertical-nav-item:hover svg {
    transform: scale(1.1);
}

.button {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.button-primary {
    background: linear-gradient(135deg, #FF4D00 0%, #FF6B00 100%);
    color: #fff;
    border: none;
}

.button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 77, 0, 0.3);
}

.nav .button-outline {
    background: transparent;
    color: #fff;
    border: 1px solid transparent;
    box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.35);
    background-clip: padding-box;
}

.nav .button-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: transparent;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 1);
}

.nav.scrolled {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(12px);
    padding: 8px 0;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .nav-links {
        gap: clamp(10px, 2.6vw, 24px);
    }

    .nav-logo img {
        height: 40px;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 15px;
        grid-template-columns: auto 1fr auto;
    }

    .nav-logo img {
        height: 36px;
    }

    .nav-links {
        display: flex;
        justify-content: center;
        gap: 12px;
    }

    .nav-links .hide-mobile {
        display: none;
    }

    .nav-link {
        font-size: 13px;
        padding: 8px 4px;
    }

    .nav-buttons {
        display: none;
    }

    .nav-toggle {
        display: inline-flex;
        justify-self: end;
    }
} 
