/* ===== 共用部分：导航栏样式 ===== */

.header {
    background: #2F2F30;
    height: 64px;
    width: 100%;
    position: relative;
    z-index: 1000;
}

.header-inner {
    max-width: 1440px;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    /* padding: 0 60px; */
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 48px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 2px;
    text-decoration: none;
}

.logo-img {
    display: block;
    height: 22px;
    width: auto;
}

.nav {
    display: flex;
    align-items: center;
    gap: 50px;
}

.nav a {
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
}

.nav a:hover,
.nav a.active {
    color: #F97F19;
}

/* ===== 桌面端「产品中心」下拉大面板（设计稿 11_327549） ===== */
.nav-item.has-mega {
    display: flex;
    align-items: center;
}

.nav-mega {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: #fff;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 999;
}

.nav-item.has-mega:hover .nav-mega,
.nav-item.has-mega:focus-within .nav-mega {
    opacity: 1;
    visibility: visible;
}

.nav-mega-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 0 36px;
    display: flex;
    gap: 120px;
}

/* 窄屏下面板内容不贴边 */
@media (max-width: 1488px) {
    .nav-mega-inner {
        padding-left: 24px;
        padding-right: 24px;
    }
}

.nav-mega-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.nav-mega-label {
    font-size: 13px;
    color: #666;
    font-weight: 305;
    margin-bottom: 22px;
    line-height: 1;
}

.nav-mega-group a {
    font-size: 16px;
    color: #0F0E14;
    font-weight: 305;
    line-height: 22px;
    margin-bottom: 14px;
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
}

.nav-mega-group a:hover {
    color: #F97F19;
}

/* 横排简易面板（服务中心：常见问题 / 样册下载） */
.nav-mega-row {
    display: flex;
    gap: 120px;
    padding: 22px 24px 26px;
}

.nav-mega-row a {
    font-size: 16px;
    color: #0F0E14;
    font-weight: 305;
    line-height: 22px;
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
}

.nav-mega-row a:hover {
    color: #F97F19;
}

@media (max-width: 768px) {
    .nav-mega {
        display: none;
    }
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.header-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.75);
    flex-shrink: 0;
}

.header-icon-link:hover .header-icon {
    color: #F97F19;
}

.header-icon {
    width: 20px;
    height: 20px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.75);
    flex-shrink: 0;
}

/* 全局「在线留言」右侧悬浮按钮（Figma #11:327541: 48×68 白色圆角矩形 + 图标 + 横排"留言"） */
.float-msg-btn {
    position: fixed;
    right: max(24px, calc(50vw - 936px));
    top: calc(50% - 90px); /* 位于回到顶部按钮上方 */
    transform: translateY(-50%);
    width: 48px;
    height: 68px;
    padding: 11px 6px 0;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 24px;
    box-shadow: 0 4px 16px rgba(15, 14, 20, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    z-index: 900;
    transition: box-shadow .3s ease, transform .3s ease;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

/* 设计稿图标：36×25.87，位于 (6,11)，自带橙色阴影 */
.float-msg-btn .ico-img {
    display: block;
    width: 36px;
    height: auto;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 8px rgba(249, 127, 25, 0.24));
}

/* 设计稿文字："留言" 14px MiSans Light #0F0E14，位于 (10,39) */
.float-msg-btn .txt {
    margin-top: 2px;
    font-size: 14px;
    font-weight: 300;
    line-height: 19px;
    color: #0F0E14;
}

/* 英文模式：文字变长（Message），按钮宽度自适应避免溢出 */
.float-msg-btn.lang-en {
    width: auto;
    min-width: 48px;
    padding: 11px 10px 0;
}

.float-msg-btn.lang-en .txt {
    font-size: 12px;
    line-height: 19px;
    white-space: nowrap;
}

/* 「回到顶部」按钮（页面右侧中部，位于留言按钮下方） */
.back-to-top {
    position: fixed;
    right: max(24px, calc(50vw - 936px));
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid rgba(190, 190, 190, 0.4);
    box-shadow: 0 4px 16px rgba(15, 14, 20, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .3s ease, visibility .3s ease, box-shadow .3s ease, transform .3s ease;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.back-to-top:hover {
    box-shadow: 0 8px 24px rgba(15, 14, 20, 0.16);
    transform: translateY(-50%) scale(1.06);
}

.back-to-top:active { transform: translateY(-50%) scale(0.95); }

.back-to-top .ico {
    display: block;
    width: 15px;
    height: 7px;
    transition: transform .25s ease;
}

.back-to-top:hover .ico { transform: translateY(-2px); }

.float-msg-btn:hover {
    transform: translateY(-50%) translateY(-2px);
}

/* 移动端：右下角圆形图标按钮 */
@media (max-width: 768px) {
    .float-msg-btn {
        right: 16px;
        top: auto;
        bottom: 90px;
        transform: none;
        width: 44px;
        height: 44px;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
    }

    .float-msg-btn .txt {
        display: none;
    }

    .float-msg-btn .ico-img {
        width: 24px;
    }

    /* 回到顶部：移动端缩小并移到右下角 */
    .back-to-top {
        right: 16px;
        left: auto;
        top: auto;
        bottom: 22px;
        transform: none;
        width: 42px;
        height: 42px;
        border-color: rgba(190, 190, 190, 0.5);
        box-shadow: 0 4px 12px rgba(15, 14, 20, 0.12);
    }

    .back-to-top:hover { transform: none; box-shadow: 0 4px 12px rgba(15, 14, 20, 0.12); }
    .back-to-top:active { transform: scale(0.94); }
    .back-to-top:hover .ico { transform: none; }

    .float-msg-btn:hover {
        transform: none;
    }
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    border: 1px solid #fff;
    border-radius: 24px;
    padding: 1px;
    font-size: 14px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.lang-switch:hover {
    border-color: #fff;
}

.lang-item {
    min-width: 28px;
    padding: 8px 10px;
    border-radius: 20px;
    color: #1a1a1a;
    text-align: center;
    transition: all 0.2s;
    line-height: 1;
}

.lang-item.active {
    background: #000;
    color: #fff;
}

.lang-item:not(.active):hover {
    color: #000;
}

/* 汉堡按钮：桌面端隐藏，移动端显示 */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 28px;
    height: 28px;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

/* 展开态：三横线变为 X */
.header.menu-open .nav-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.header.menu-open .nav-toggle span:nth-child(2) {
    opacity: 0;
}

.header.menu-open .nav-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* 移动端菜单：桌面端隐藏 */
.nav-mobile {
    display: none;
}

/* 平板适配 */
@media (max-width: 1024px) {
    .header-inner {
        padding: 0 32px;
    }

    .header-left {
        gap: 32px;
    }

    .nav {
        gap: 20px;
    }
}

/* 导航栏响应式 */
@media (max-width: 768px) {
    .header-inner {
        padding: 0 20px;
    }

    .header-left {
        gap: 0;
    }

    .nav {
        display: none;
    }

    .lang-switch {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-mobile {
        display: none;
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        bottom: 0;
        min-height: calc(100vh - 64px);
        background: #fff;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 1001;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
        box-sizing: border-box;
    }

    .header.menu-open .nav-mobile {
        display: block;
    }

    .mobile-menu {
        padding: 8px 20px 40px;
    }

    .mobile-link,
    .mobile-group-toggle,
    .mobile-subgroup-toggle,
    .mobile-subsubmenu a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 16px 4px;
        font-size: 15px;
        color: #1a1a1a;
        text-decoration: none;
        background: none;
        border: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        text-align: left;
        cursor: pointer;
        box-sizing: border-box;
    }

    .mobile-link.active,
    .mobile-link:hover {
        color: #F97F19;
    }

    .chevron {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
        transition: transform 0.25s;
    }

    .mobile-group.is-open > .mobile-group-toggle .chevron,
    .mobile-subgroup.is-open > .mobile-subgroup-toggle .chevron {
        transform: rotate(180deg);
    }

    .mobile-submenu,
    .mobile-subsubmenu {
        display: none;
        padding-left: 16px;
    }

    .mobile-group.is-open > .mobile-submenu,
    .mobile-subgroup.is-open > .mobile-subsubmenu {
        display: block;
    }

    .mobile-submenu .mobile-subgroup-toggle,
    .mobile-submenu .mobile-subsubmenu a {
        font-size: 14px;
        color: #333;
        border-bottom-color: rgba(0, 0, 0, 0.04);
    }

    .mobile-subsubmenu {
        padding-left: 16px;
    }

    .mobile-subsubmenu a {
        font-size: 14px;
        color: #555;
        padding: 14px 4px;
    }
}
