/* =========================
   OVERLAY MENU
   (Based on user snippet & request)
========================= */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    /* 初始高度为0 */
    background: #5293ED;
    z-index: 9999;
    /* 提升层级，确保在 topbar 之上 */
    overflow: hidden;
    /* 隐藏超出内容 */
    transition: height 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    /* 平滑的展开动画 */
    display: flex;
    flex-direction: column;
}

.nav-overlay.is-active {
    height: 100vh;
    /* 展开至全屏 */
    overflow-y: auto;
    /* 允许滚动 */
}

.nav-overlay__inner {
    /* 与 topbar__inner 保持一致的宽度 */
    width: calc(100% - 60px);
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 0 40px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Header inside overlay (Logo + Nav) - 必须与 topbar 尺寸完全一致 */
.nav-overlay__header {
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    /* 让 logo 占据左侧空间 */
}

/* Top Nav Links inside Overlay */
.nav-overlay__top-links {
    display: flex;
    gap: 7px;
    margin-left: auto;
    /* 推到右侧 */
}

.nav-overlay__top-links a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 114px;
    /* Matches style.css .topbar__nav a width */
    padding: 10px;
    color: white;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.2px;
    transition: opacity 0.2s;
}

.nav-overlay__top-links a:hover {
    opacity: 0.8;
}

/* ============================================
   主导航链接区块 - 只在移动端/平板端显示
   当顶部导航栏的链接被隐藏时才显示这个模块
============================================ */

/* 默认隐藏（桌面端不显示） */
.nav-overlay__main-nav {
    display: none;
    flex-direction: column;
    gap: 0;
    margin-bottom: 32px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* 导航链接基础样式 */
.nav-overlay__nav-link {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    color: white !important;
    /* 强制白色 */
    text-decoration: none !important;
    font-family: 'Montserrat', 'Inter', -apple-system, sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    position: relative;
}

/* 左侧金色装饰线 */
.nav-overlay__nav-link::before {
    content: '';
    display: block;
    width: 4px;
    height: 0;
    background: linear-gradient(180deg, #FFE066 0%, #FFC107 100%);
    border-radius: 2px;
    margin-right: 16px;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

/* Hover 效果 */
.nav-overlay__nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(8px);
}

.nav-overlay__nav-link:hover::before {
    height: 24px;
}

/* 分隔线 */
.nav-overlay__nav-link:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== 响应式：只在 900px 以下显示（此时顶部导航栏链接被隐藏）===== */
@media (max-width: 900px) {
    .nav-overlay__main-nav {
        display: flex;
        /* 显示导航卡片 */
    }
}

/* ===== 手机端进一步优化 ===== */
@media (max-width: 520px) {
    .nav-overlay__main-nav {
        margin-bottom: 24px;
        padding: 16px;
        border-radius: 16px;
    }

    .nav-overlay__nav-link {
        padding: 14px 16px;
        font-size: 16px;
    }

    .nav-overlay__nav-link::before {
        margin-right: 12px;
    }
}

/* Close Button - 隐藏，因为现在使用 menu-pill 作为关闭按钮 */
.close-btn {
    display: none;
}


/* Layout Grid */
.nav-overlay__grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
    color: #fff;
    position: relative;
}

/* Col 1: Desc */
.nov-col-1 {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 320px;
}

/* Column Titles */
.nov-col__title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 8px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.nav-desc {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 26px;
    opacity: 0.95;
    color: white;
}

/* Col 2: Sub Links */
.nov-col-2 {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.overlay-link {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: white;
    text-decoration: none;
    padding: 10px;
    transition: opacity 0.3s;
}

.overlay-link:hover {
    opacity: 0.8;
}

/* Col 3: Contact & Button */
.nov-col-3 {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: flex-start;
}

.overlay-contact-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    line-height: 20px;
    color: #D1D5DC;
}

.overlay-icon {
    width: 20px;
    height: 20px;
    /* Use CSS to simulate the icon box as in snippet */
    position: relative;
    border: 1.5px solid #70ACFF;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Just basic shapes for icons to match style */

.overlay-apply-btn {
    margin-top: 10px;
    background: #FFDB6F;
    /* User snippet text color is white? Usually yellow bg has dark text, but snippet says white */
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 20px;
    padding: 14px 40px;
    border-radius: 50px;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Bottom Area (Footer) */
.nav-overlay__footer {
    margin-top: auto;
    padding-top: 40px;
    border-top: 1px solid rgba(54, 65, 83, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    color: #fff;
    position: relative;
}

.overlay-follow {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.overlay-follow-title {
    font-size: 16px;
    font-weight: 500;
}

.overlay-follow-desc {
    font-size: 14px;
    color: #FFDB6F;
}

.overlay-center-qr {
    position: absolute;
    left: 50%;
    bottom: 0px;
    transform: translateX(-50%);
    text-align: center;
}

.overlay-qr-img {
    width: 115px;
    height: 116px;
    border-radius: 12px;
    background: #fff;
    /* Placeholder */
    display: block;
    margin-bottom: 20px;
    /* some space */
}

.overlay-social {
    display: flex;
    gap: 16px;
}

.overlay-social-btn {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive */
@media (max-width: 1100px) {

    /* 导航链接改为垂直显示 */
    .nav-overlay__top-links {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        margin-left: 0;
    }

    .nav-overlay__top-links a {
        width: auto;
        padding: 8px 0;
        font-size: 18px;
    }

    .nav-overlay__header {
        flex-direction: column;
        align-items: flex-start;
        height: auto;
        padding: 24px 0;
        gap: 20px;
        margin-bottom: 20px;
    }

    .nav-overlay__grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
        text-align: left;
    }

    /* 第一列独占整行 */
    .nov-col-1 {
        grid-column: 1 / -1;
        max-width: 100%;
        text-align: center;
        align-items: center;
    }

    .nov-col-2,
    .nov-col-3 {
        align-items: flex-start;
        max-width: 100%;
    }

    .nov-col-2 {
        text-align: left;
    }

    .overlay-center-qr {
        position: static;
        transform: none;
        margin: 30px auto;
    }

    .nav-overlay__footer {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        text-align: center;
    }
}

@media (max-width: 520px) {
    .nav-overlay__header {
        display: none;
        /* 手机端隐藏叠层内的 Header，避免与原 Topbar 的 Logo 重叠 */
        margin-bottom: 20px;
    }

    .nav-overlay__inner {
        width: calc(100% - 32px);
        padding-top: 80px;
        /* 增加顶部间距，把按钮挤下来 */
        padding-bottom: 24px;
    }

    .nav-overlay__grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    .nov-col__title {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .nav-desc {
        font-size: 14px;
        line-height: 22px;
    }

    .overlay-link {
        font-size: 14px;
        padding: 6px 0;
    }

    .overlay-contact-row {
        font-size: 12px;
        line-height: 18px;
    }

    .overlay-apply-btn {
        font-size: 16px;
        padding: 12px 28px;
    }

    .overlay-follow-title {
        font-size: 14px;
    }

    .overlay-follow-desc {
        font-size: 12px;
    }

    .overlay-qr-img {
        width: 90px;
        height: 90px;
    }

    .overlay-social-btn {
        width: 38px;
        height: 38px;
    }
}