/* ==========================================================================
   theme-v2 · site-custom.css （smartlockfactory）
   子主题全局修正层：只放跨页面通用的结构性修正；最后加载。
   ========================================================================== */

/* --------------------------------------------------------------------------
   2026-10-06 · 顶栏语言/菜单下拉被首屏 Hero 大图遮挡（层叠上下文修复）
   移植自《06-顶栏下拉被Hero大图遮挡z-index层叠上下文修复记录》/ 母版规则。

   根因：agon 编译产物中 .header-top-green{position:relative;z-index:2}
   使顶栏成为层叠上下文，内部 z-index:1000 的下拉被困在第 2 层；hero
   定位容器同为 z-index:2 且 DOM 靠后，同层后者覆盖前者，下拉被截断。
   修法：只抬高困住下拉的顶栏祖先一级到 100，不碰下拉/hero，不用
   !important（同特异性，本文件加载在后生效）。
   -------------------------------------------------------------------------- */
.header-top.header-top-green {
    z-index: 100;
}

/* --------------------------------------------------------------------------
   2026-10-30 · 26 语种切换器下拉超出视口（语言全量启用后的可达性修复）
   现象：下拉高约 1002px，视口 900px 时底部语种落到视口外，无法点击。
   修法：限制高度为视口 70% 并在面板内部滚动；层级仍由父级顶栏 z-index
   保证，不参与本规则。
   -------------------------------------------------------------------------- */
.header-top .language-switcher-container .dropdown-menu {
    max-height: 70vh;
    min-width: 210px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* --------------------------------------------------------------------------
   2026-10-07 · 主导航修复：6 个顶级项压成一行 + 长下拉双列 mega panel
   根因：agon 原生 a 为 18px/44px 横向内边距，6 项总宽 ~1040px，超过
   1296px 容器分给导航的 ~859px，float 折行成 4+2 且视觉松散；
   Products(7 项)/Applications(14 项) 单列下拉过长。
   方案：按断点两档压缩顶级项；two_col 面板加宽、整卡圆角、分栏防断，
   hover 改浅蓝底不位移。仅作用于 >=1200 桌面菜单，移动端手风琴不受影响。
   -------------------------------------------------------------------------- */
@media (min-width: 1200px) {
    .header .main-header .header-logo {
        margin-right: 32px;
    }

    .header .main-menu {
        padding-top: 0;
    }

    .header .main-menu > li > a {
        padding: 26px 14px;
        font-size: 15px;
        line-height: 1.2;
        white-space: nowrap;
    }

    .header .main-menu > li.has-children > a::after {
        font-size: 12px;
        margin-left: 3px;
    }

    /* Products / Applications 双列下拉 */
    .header .main-menu > li.mn-mega > ul.sub-menu.two-col {
        min-width: 440px;
        margin-top: 4px;
        padding: 12px;
        column-gap: 8px;
        border: 1px solid #e8ebf1;
        border-radius: 14px;
        box-shadow: 0 20px 50px -12px rgba(15, 23, 42, 0.18);
    }

    .header .main-menu > li.mn-mega-apps > ul.sub-menu.two-col {
        min-width: 464px;
    }

    .header .main-menu > li.mn-mega {
        position: relative;
    }

    /* 三角挂在 li 上：挂在多列 ul 上会被当成列内容参与分列流动 */
    .header .main-menu > li.mn-mega::before {
        content: "";
        position: absolute;
        top: calc(100% - 2px);
        left: 26px;
        border: 7px solid transparent;
        border-bottom-color: #ffffff;
        z-index: 1000;
        pointer-events: none;
    }

    .header .main-menu > li.mn-mega::after {
        content: "";
        position: absolute;
        top: calc(100% - 3px);
        left: 25px;
        border: 8px solid transparent;
        border-bottom-color: #e8ebf1;
        z-index: 999;
        pointer-events: none;
    }

    .header .main-menu li.mn-mega ul li {
        width: 100%;
        break-inside: avoid;
        -webkit-column-break-inside: avoid;
        page-break-inside: avoid;
    }

    .header .main-menu li.mn-mega ul li > a {
        display: block;
        padding: 9px 12px;
        border-radius: 8px;
        font-size: 14px;
        line-height: 1.35;
        white-space: nowrap;
        transition: background-color 0.15s ease, color 0.15s ease;
    }

    .header .main-menu li.mn-mega ul li > a:hover {
        padding-left: 12px;
        background-color: #f1f5ff;
        color: var(--color-primary, #0b63ce);
    }
}

/* 1200–1499：容器仅 1116px 可用，进一步收紧字号/间距与右侧 CTA */
@media (min-width: 1200px) and (max-width: 1499.98px) {
    .header .main-header .header-logo {
        margin-right: 24px;
    }

    .header .main-menu > li > a {
        padding: 24px 9px;
        font-size: 13px;
    }

    .header .main-menu > li.has-children > a::after {
        font-size: 11px;
        margin-left: 2px;
    }

    .header .header-right {
        max-width: 196px;
    }

    .header .header-right .btn {
        padding-left: 16px;
        padding-right: 16px;
        font-size: 13px;
        white-space: nowrap;
    }
}
