/* 导航当前项下划线 — 全站统一（对齐设计稿图三） */
.nav-list li a.active {
    font-weight: bold;
}

.nav-list li a.active::after {
    content: "";
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    border-radius: 3px;
    background: #00b8d4;
    transition: background 0.35s ease;
}

/* 青色顶栏：下划线为白色短圆角条 */
.site-header.is-scrolled .nav-list li a.active::after,
body.page-list .nav-list li a.active::after,
body.page-detail .nav-list li a.active::after {
    background: #fff;
}

/* 解决方案下拉箭头 */
.nav-dropdown-arrow {
    display: inline-block;
    width: auto;
    height: 8px;
    margin-left: 5px;
    vertical-align: middle;
    transition: transform 0.2s ease;
    filter: brightness(0);
}

.site-header.is-scrolled .nav-dropdown-arrow,
body.page-list .nav-dropdown-arrow,
body.page-detail .nav-dropdown-arrow {
    filter: none;
}

.nav-dropdown.open .nav-dropdown-arrow {
    transform: rotate(180deg);
}

/* 桌面端 hover 展开下拉（与 JS 配合，无 JS 时仍可用） */
@media (min-width: 769px) {
    .nav-dropdown:hover .nav-dropdown-menu {
        opacity: 1;
        visibility: visible;
    }

    .nav-dropdown:hover .nav-dropdown-arrow {
        transform: rotate(180deg);
    }

    .mobile-nav-deco {
        display: none !important;
    }
}

/* 手机端导航（对齐 imserv.cn：顶栏 + 下方下拉面板，非全屏） */
/* 手机专用 logo，桌面隐藏 */
.logo-img--mobile {
    display: none;
}

@media (max-width: 768px) {
    :root {
        --nav-theme: #14abab;
        --mobile-header-h: 56px;
    }

    body.nav-open {
        overflow: hidden;
    }

    .mobile-nav-deco {
        display: none !important;
    }

    /* 遮罩：菜单以下区域压暗，露出页面内容 */
    .mobile-nav-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 1098;
        border: none;
        padding: 0;
        margin: 0;
        background: rgba(0, 0, 0, 0.35);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    body.nav-open .mobile-nav-backdrop {
        display: block;
    }

    .nav-list {
        display: none !important;
    }

    /* 手机端顶栏：顶部半透明，下滑/展开菜单后实色主题 */
    .site-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: var(--mobile-header-h) !important;
        max-height: var(--mobile-header-h);
        background: rgba(20, 171, 171, 0.38) !important;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: none !important;
        overflow: visible;
        z-index: 1100;
        transition:
            background 0.35s ease,
            box-shadow 0.35s ease,
            height 0.35s ease,
            backdrop-filter 0.35s ease;
    }

    .site-header::before {
        opacity: 0 !important;
    }

    .site-header.is-scrolled,
    .site-header.nav-open {
        background: var(--nav-theme) !important;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18) !important;
    }

    .site-header.is-scrolled {
        height: 48px !important;
        max-height: 48px;
        --mobile-header-h: 48px;
    }

    /* 压住各页内联 .is-scrolled 的桌面顶栏/菜单样式 */
    .site-header.is-scrolled::before {
        opacity: 0 !important;
    }

    .site-header.is-scrolled .logo-img--default,
    .site-header.is-scrolled .logo-img--scrolled {
        display: none !important;
    }

    .site-header.is-scrolled .logo-img--mobile {
        display: block !important;
        max-height: 28px !important;
    }

    .site-header.is-scrolled .mobile-nav-btn {
        color: #fff !important;
    }

    .site-header.is-scrolled .nav-list {
        display: none !important;
    }

    body.page-list .site-header.is-scrolled,
    body.page-detail .site-header.is-scrolled {
        height: 48px !important;
        --mobile-header-h: 48px;
    }

    .site-header .header-inner {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        height: 100%;
        padding: 0 12px 0 16px;
        overflow: visible;
    }

    .site-header .logo-img--default,
    .site-header .logo-img--scrolled {
        display: none !important;
    }

    .site-header .logo-img--mobile {
        display: block !important;
        height: auto;
        max-height: 32px;
        width: auto;
        max-width: min(168px, 46vw);
    }

    .site-header.is-scrolled .logo-img--mobile {
        display: block !important;
        max-height: 28px;
    }

    .mobile-nav-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        margin: 0;
        margin-left: auto;
        padding: 0;
        border: none;
        background: none;
        line-height: 1;
        cursor: pointer;
        z-index: 1102;
        color: #fff !important;
        flex-shrink: 0;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-nav-btn:hover {
        transform: none !important;
    }

    .mobile-nav-btn__icon {
        position: relative;
        display: block;
        width: 22px;
        height: 2px;
        background: currentColor;
        border-radius: 2px;
        transition: background 0.2s ease;
    }

    .mobile-nav-btn__icon::before,
    .mobile-nav-btn__icon::after {
        content: "";
        position: absolute;
        left: 0;
        width: 22px;
        height: 2px;
        background: currentColor;
        border-radius: 2px;
        transition: transform 0.28s ease, top 0.28s ease, bottom 0.28s ease;
    }

    .mobile-nav-btn__icon::before {
        top: -7px;
    }

    .mobile-nav-btn__icon::after {
        bottom: -7px;
        top: auto;
    }

    .site-header.nav-open .mobile-nav-btn__icon {
        background: transparent;
    }

    .site-header.nav-open .mobile-nav-btn__icon::before {
        top: 0;
        transform: rotate(135deg);
    }

    .site-header.nav-open .mobile-nav-btn__icon::after {
        bottom: 0;
        transform: rotate(225deg);
    }

    /* 展开：菜单在顶栏下方下拉（显式 top，避免 is-scrolled 时变量未生效） */
    .site-header.nav-open:not(.is-scrolled) .nav-list {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        width: 100%;
        height: auto !important;
        min-height: 0;
        max-height: none;
        margin: 0;
        padding: 0 0 8px;
        overflow: visible;
        align-items: stretch;
        background-color: var(--nav-theme);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
        z-index: 1099;
        gap: 0;
        animation: mobile-nav-panel-in 0.28s ease;
    }

    .site-header.is-scrolled.nav-open .nav-list {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        top: 48px !important;
        left: 0;
        right: 0;
        width: 100%;
        height: auto !important;
        min-height: 0;
        max-height: none;
        margin: 0;
        padding: 0 0 8px;
        overflow: visible;
        align-items: stretch;
        background-color: var(--nav-theme) !important;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
        z-index: 1099;
        gap: 0;
        animation: mobile-nav-panel-in 0.28s ease;
    }

    @keyframes mobile-nav-panel-in {
        from {
            opacity: 0;
            transform: translateY(-8px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .site-header.nav-open .nav-list li {
        display: block;
        height: auto !important;
        min-height: 0;
        margin: 0;
        text-align: left;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    .site-header.nav-open .nav-list li:last-child {
        border-bottom: none;
    }

    .site-header.nav-open .nav-list li a,
    .site-header.is-scrolled.nav-open .nav-list li a {
        height: auto !important;
        min-height: 0;
        padding: 18px 28px !important;
        line-height: 1.35 !important;
        justify-content: flex-start !important;
        color: #fff !important;
        font-size: 15px !important;
        font-weight: 400;
        letter-spacing: 0.02em;
    }

    .site-header.nav-open .nav-list li a.nav-dropdown-toggle {
        justify-content: space-between;
    }

    .site-header.nav-open .nav-list li a.active {
        font-weight: 600;
        background: rgba(255, 255, 255, 0.12);
    }

    .site-header.nav-open .nav-list li a.active::after {
        display: none !important;
    }

    .site-header.nav-open .nav-dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        background: transparent !important;
        opacity: 1;
        visibility: hidden;
        max-height: 0;
        overflow: hidden;
        padding: 0;
        transition: max-height 0.3s ease, visibility 0.2s ease;
    }

    .site-header.nav-open .nav-dropdown.open .nav-dropdown-menu {
        visibility: visible;
        max-height: 280px;
    }

    .site-header.nav-open .nav-dropdown-menu li {
        border-bottom: none;
    }

    .site-header.nav-open .nav-dropdown-menu a,
    .site-header.is-scrolled.nav-open .nav-dropdown-menu a {
        color: rgba(255, 255, 255, 0.92) !important;
        justify-content: flex-start !important;
        font-size: 14px !important;
        font-weight: 400;
        padding: 14px 28px 14px 44px !important;
        background: transparent !important;
    }

    .site-header.is-scrolled .nav-dropdown-menu,
    .site-header.is-scrolled.nav-open .nav-dropdown-menu {
        position: static !important;
        transform: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    .site-header.nav-open .nav-dropdown-arrow {
        filter: none !important;
        margin-left: 8px;
    }
}
