/**
 * 逸程全站头部组件
 * 这是头部、桌面导航、搜索入口、移动端菜单的唯一最终表现层。
 * 首页和内页只通过变量切换主题，不再各自重写结构位置。
 */

body {
    --yc-header-component-height: 90px;
    --yc-header-component-mobile-height: 72px;
    --yc-header-component-container: 1440px;
    --yc-header-component-wide: 1520px;
    --yc-header-component-bg: rgba(255, 255, 255, 0.98);
    --yc-header-component-border: rgba(15, 35, 60, 0.08);
    --yc-header-component-shadow: 0 10px 30px rgba(15, 35, 60, 0.08);
    --yc-header-component-backdrop: saturate(1.2) blur(12px);
    --yc-header-component-position: sticky;
    --yc-header-component-z: 1200;
    --yc-header-component-logo-filter: none;
    --yc-header-component-nav-color: #111827;
    --yc-header-component-muted: #A9B6C5;
    --yc-header-component-accent: #126B8F;
    --yc-header-component-menu-color: #126B8F;
    --yc-header-component-search-bg: #126B8F;
    --yc-header-component-search-color: #FFFFFF;
    --yc-header-component-dropdown-bg: #FFFFFF;
    --yc-header-component-dropdown-shadow: 0 22px 46px rgba(15, 35, 60, 0.15);
}

body:has(.yc-home) {
    --yc-header-component-bg: transparent;
    --yc-header-component-border: var(--yc-color-border-header, rgba(255, 255, 255, 0.22));
    --yc-header-component-shadow: none;
    --yc-header-component-backdrop: none;
    --yc-header-component-position: fixed;
    --yc-header-component-z: 1000;
    --yc-header-component-logo-filter: brightness(0) invert(1);
    --yc-header-component-nav-color: #FFFFFF;
    --yc-header-component-muted: rgba(255, 255, 255, 0.72);
    --yc-header-component-menu-color: #FFFFFF;
    --yc-header-component-search-bg: #FFFFFF;
    --yc-header-component-search-color: #126B8F;
}

body.yc-home-scrolled:has(.yc-home),
body.yc-mobile-nav-open:has(.yc-home) {
    --yc-header-component-bg: rgba(255, 255, 255, 0.98);
    --yc-header-component-border: rgba(15, 35, 60, 0.08);
    --yc-header-component-shadow: 0 10px 30px rgba(15, 35, 60, 0.08);
    --yc-header-component-backdrop: saturate(1.2) blur(12px);
    --yc-header-component-logo-filter: none;
    --yc-header-component-nav-color: #111827;
    --yc-header-component-muted: #A9B6C5;
    --yc-header-component-menu-color: #126B8F;
    --yc-header-component-search-bg: #126B8F;
    --yc-header-component-search-color: #FFFFFF;
}

body:not(:has(.yc-home)) {
    --yc-header-component-height: var(--yc-inner-header-height, 90px);
    --yc-header-component-mobile-height: var(--yc-inner-header-mobile, 72px);
    --yc-header-component-container: var(--yc-inner-container-wide, 1440px);
    --yc-header-component-wide: var(--yc-inner-container-wide, 1440px);
}

body:has(.yc-home) header.head,
body:not(:has(.yc-home)) header.head {
    width: 100% !important;
    max-width: none !important;
}

header.head,
header.head.fixed {
    position: var(--yc-header-component-position) !important;
    top: 0 !important;
    z-index: var(--yc-header-component-z) !important;
    width: 100% !important;
    max-width: none !important;
    height: var(--yc-header-component-height) !important;
    margin: 0 !important;
    background: var(--yc-header-component-bg) !important;
    border-bottom: 1px solid var(--yc-header-component-border) !important;
    box-shadow: var(--yc-header-component-shadow) !important;
    backdrop-filter: var(--yc-header-component-backdrop) !important;
}

header.head > .wrap.fix {
    position: relative !important;
    display: flex !important;
    width: min(var(--yc-header-component-wide), calc(100% - 96px)) !important;
    max-width: var(--yc-header-component-container) !important;
    height: var(--yc-header-component-height) !important;
    align-items: center !important;
    margin: 0 auto !important;
    padding: 0 !important;
}

header.head .logo {
    order: 1 !important;
    position: static !important;
    display: flex !important;
    flex: 0 0 210px !important;
    width: 210px !important;
    height: var(--yc-header-component-height) !important;
    align-items: center !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    background: none !important;
}

header.head .logo a {
    display: flex !important;
    width: 178px !important;
    height: 54px !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    transform: none !important;
}

header.head .logo img {
    display: block !important;
    width: 178px !important;
    max-height: 54px !important;
    height: auto !important;
    filter: var(--yc-header-component-logo-filter) !important;
}

header.head .nav {
    order: 2 !important;
    display: flex !important;
    flex: 1 1 auto !important;
    width: auto !important;
    height: var(--yc-header-component-height) !important;
    align-items: center !important;
    justify-content: center !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 24px !important;
    line-height: 1 !important;
}

header.head .nav .nLi,
header.head .nav .nLi h3 {
    position: relative !important;
    float: none !important;
    height: var(--yc-header-component-height) !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: var(--yc-header-component-height) !important;
}

header.head .nav .nLi h3 a {
    display: flex !important;
    height: var(--yc-header-component-height) !important;
    align-items: center !important;
    padding: 0 26px !important;
    color: var(--yc-header-component-nav-color) !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    line-height: 1 !important;
    transition: color 0.2s ease;
}

header.head .nav .nLi h3 a:hover,
header.head .nav .yc-current h3 a {
    color: var(--yc-header-component-accent) !important;
}

body:has(.yc-home):not(.yc-home-scrolled):not(.yc-mobile-nav-open) header.head .nav .nLi h3 a:hover,
body:has(.yc-home):not(.yc-home-scrolled):not(.yc-mobile-nav-open) header.head .nav .yc-current h3 a {
    color: #FFFFFF !important;
}

header.head .nav .nLi h3 a::after,
header.head .nav .nLi.on:not(.yc-current) .yc-nav-label::after {
    display: none !important;
    transform: scaleX(0) !important;
}

header.head .nav .yc-nav-label {
    position: relative !important;
    display: inline-flex !important;
    height: var(--yc-header-component-height) !important;
    align-items: center !important;
}

header.head .nav .yc-nav-label::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    display: block !important;
    width: 100%;
    height: 2px;
    background: var(--yc-header-component-accent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.2s ease;
}

body:has(.yc-home):not(.yc-home-scrolled):not(.yc-mobile-nav-open) header.head .nav .yc-nav-label::after {
    background: #FFFFFF;
}

header.head .nav .yc-current .yc-nav-label::after {
    transform: scaleX(1);
}

header.head .nav .nLi h3 a i {
    margin-left: 7px !important;
    color: var(--yc-header-component-muted) !important;
    font-size: 12px !important;
}

header.head .nav .sxian {
    display: none !important;
}

header.head .nav .sub {
    position: absolute !important;
    top: var(--yc-header-component-height) !important;
    left: 50% !important;
    width: auto !important;
    min-width: 230px !important;
    padding: 18px 0 !important;
    transform: translate(-50%, -8px) !important;
    border: 0 !important;
    border-radius: 0 0 16px 16px !important;
    background: var(--yc-header-component-dropdown-bg) !important;
    box-shadow: var(--yc-header-component-dropdown-shadow) !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
}

header.head .nav .nLi:hover > .sub,
header.head .nav .nLi:focus-within > .sub {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0) !important;
}

header.head .nav .sub li,
header.head .nav .sub .sub01 {
    float: none !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

header.head .nav .sub a {
    display: block !important;
    padding: 11px 26px !important;
    color: #344054 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    white-space: nowrap !important;
}

header.head .nav .sub a:hover {
    background: #EAF6FC !important;
    color: var(--yc-header-component-accent) !important;
}

body:has(.yc-home) header.head .head_lang,
body:not(:has(.yc-home)) header.head .head_lang {
    display: none !important;
}

body:has(.yc-home) header.head .head_ser,
body:not(:has(.yc-home)) header.head .head_ser {
    order: 3 !important;
    display: flex !important;
    height: var(--yc-header-component-height) !important;
    align-items: center !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

body:has(.yc-home) header.head .head_ser ._val,
body:not(:has(.yc-home)) header.head .head_ser ._val {
    display: inline-flex !important;
    width: 150px !important;
    height: 46px !important;
    min-height: 0 !important;
    max-height: 46px !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 9px;
    padding: 0 22px !important;
    border-radius: 999px !important;
    background: var(--yc-header-component-search-bg) !important;
    color: var(--yc-header-component-search-color) !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
}

body:has(.yc-home) header.head .head_ser ._val i,
body:has(.yc-home) header.head .head_ser ._val span,
body:not(:has(.yc-home)) header.head .head_ser ._val i,
body:not(:has(.yc-home)) header.head .head_ser ._val span {
    display: inline-flex !important;
    height: auto !important;
    min-height: 0 !important;
    align-items: center !important;
    padding: 0 !important;
    color: inherit !important;
    line-height: 1 !important;
}

body:has(.yc-home) header.head .head_ser ._val i,
body:not(:has(.yc-home)) header.head .head_ser ._val i {
    font-size: 21px !important;
}

header.head .head_ser .h_search {
    position: fixed !important;
    top: var(--yc-header-component-height) !important;
    left: 0 !important;
    right: 0 !important;
    z-index: calc(var(--yc-header-component-z) - 1) !important;
    width: 100% !important;
    height: auto !important;
    padding: 34px 0 !important;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 24px 50px rgba(15, 35, 60, 0.14);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
}

header.head .head_ser:hover .h_search,
header.head .head_ser:focus-within .h_search {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

header.head .head_ser .h_search .wrap {
    width: min(920px, calc(100% - 48px)) !important;
    max-width: 920px !important;
}

header.head .head_ser .h_search .item {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 96px;
    align-items: center;
    gap: 12px;
    height: 58px !important;
    border-bottom: 2px solid #101828 !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

header.head .head_ser .h_search .item:focus-within {
    border-bottom-color: var(--yc-header-component-accent) !important;
    box-shadow: 0 1px 0 rgba(18, 107, 143, 0.10);
}

header.head .head_ser .h_search .item i {
    position: static !important;
    display: inline-flex !important;
    width: 28px !important;
    height: 58px !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    color: var(--yc-header-component-accent) !important;
    font-size: 24px !important;
    line-height: 1 !important;
}

header.head .head_ser .h_search .inp {
    display: block !important;
    width: 100% !important;
    height: 58px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #101828 !important;
    font-size: 18px !important;
    line-height: 58px !important;
}

header.head .head_ser .h_search .inp:focus,
header.head .head_ser .h_search .inp:focus-visible {
    outline: 0 !important;
    box-shadow: none !important;
}

header.head .head_ser .h_search .button {
    display: inline-flex !important;
    width: 96px !important;
    height: 42px !important;
    align-items: center;
    justify-content: center;
    border: 0 !important;
    border-radius: 999px;
    background: var(--yc-header-component-accent) !important;
    color: #FFFFFF !important;
    font-size: 15px !important;
    font-weight: 800;
    line-height: 1 !important;
}

header.head .menu-icon {
    display: none !important;
}

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

@media (max-width: 1180px) {
    header.head > .wrap.fix {
        width: calc(100% - 36px) !important;
    }

    header.head .nav .nLi h3 a {
        padding: 0 16px !important;
        font-size: 15px !important;
    }
}

@media (max-width: 820px) {
    body:has(.yc-home),
    body:not(:has(.yc-home)) {
        padding-top: 0 !important;
    }

    body.yc-mobile-nav-open {
        overflow: hidden !important;
    }

    header.head,
    header.head.fixed {
        height: var(--yc-header-component-mobile-height) !important;
    }

    body:has(.yc-home) header.head > .wrap.fix,
    body:not(:has(.yc-home)) header.head > .wrap.fix {
        width: calc(100% - 24px) !important;
        height: var(--yc-header-component-mobile-height) !important;
        justify-content: flex-start !important;
    }

    body:has(.yc-home) header.head .logo,
    body:not(:has(.yc-home)) header.head .logo {
        flex: 0 0 190px !important;
        width: 190px !important;
        height: var(--yc-header-component-mobile-height) !important;
    }

    body:has(.yc-home) header.head .logo a,
    body:not(:has(.yc-home)) header.head .logo a {
        width: 160px !important;
        height: 42px !important;
        transform: none !important;
    }

    body:has(.yc-home) header.head .logo img,
    body:not(:has(.yc-home)) header.head .logo img {
        width: 160px !important;
        max-height: 42px !important;
        transform: translateX(-4px) !important;
    }

    body:has(.yc-home) header.head .nav,
    body:has(.yc-home) header.head .head_lang,
    body:has(.yc-home) header.head .head_ser,
    body:not(:has(.yc-home)) header.head .nav,
    body:not(:has(.yc-home)) header.head .head_lang,
    body:not(:has(.yc-home)) header.head .head_ser {
        display: none !important;
    }

    body:has(.yc-home) header.head .menu-icon,
    body:not(:has(.yc-home)) header.head .menu-icon {
        order: 4 !important;
        display: block !important;
        position: absolute !important;
        right: 0 !important;
        top: 50% !important;
        z-index: 1302 !important;
        width: 34px !important;
        height: 24px !important;
        min-height: 0 !important;
        max-height: 24px !important;
        margin: 0 !important;
        padding: 0 !important;
        transform: translateY(-50%) !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        appearance: none;
        cursor: pointer;
    }

    body:has(.yc-home) header.head .menu-icon span,
    body:not(:has(.yc-home)) header.head .menu-icon span {
        display: block !important;
        width: 34px !important;
        height: 2px !important;
        margin: 0 0 8px !important;
        border-radius: 999px;
        background: var(--yc-header-component-menu-color) !important;
        transform-origin: center;
        transition: transform 0.2s, opacity 0.2s, background 0.2s;
    }

    header.head .menu-icon span:last-child {
        margin-bottom: 0 !important;
    }

    body.yc-mobile-nav-open header.head .menu-icon span,
    header.head .menu-icon.active span {
        position: absolute !important;
        left: 0 !important;
        top: 50% !important;
        margin: 0 !important;
    }

    body.yc-mobile-nav-open header.head .menu-icon span:nth-child(1),
    header.head .menu-icon.active span:nth-child(1) {
        transform: translateY(-50%) rotate(45deg) !important;
    }

    body.yc-mobile-nav-open header.head .menu-icon span:nth-child(2),
    header.head .menu-icon.active span:nth-child(2) {
        opacity: 0 !important;
        transform: translateY(-50%) scaleX(0.3) !important;
    }

    body.yc-mobile-nav-open header.head .menu-icon span:nth-child(3),
    header.head .menu-icon.active span:nth-child(3) {
        transform: translateY(-50%) rotate(-45deg) !important;
    }

    header.head .mobile-nav {
        display: none !important;
        position: fixed !important;
        top: var(--yc-header-component-mobile-height) !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        z-index: 1301 !important;
        width: 100% !important;
        height: calc(100vh - var(--yc-header-component-mobile-height)) !important;
        max-height: none !important;
        padding: 18px 24px 90px !important;
        overflow-y: auto !important;
        contain: none !important;
        background: #FFFFFF !important;
        box-shadow: 0 24px 48px rgba(15, 35, 60, 0.18);
    }

    body.yc-mobile-nav-open header.head .mobile-nav {
        display: block !important;
    }

    header.head .mobile-nav ul {
        margin: 0 !important;
        padding: 0 !important;
        list-style: none !important;
    }

    header.head .mobile-nav li {
        float: none !important;
        width: 100% !important;
        border-bottom: 1px solid #EDF2F7 !important;
    }

    header.head .mobile-nav a,
    header.head .mobile-nav .m-sub-toggle {
        display: flex !important;
        width: 100% !important;
        min-height: 62px;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 17px 0 !important;
        border: 0 !important;
        background: transparent !important;
        color: #111827 !important;
        font-size: 22px !important;
        font-weight: 800 !important;
        line-height: 1.3 !important;
        text-align: left !important;
        appearance: none;
    }

    header.head .mobile-nav .m-sub-toggle span::before {
        content: "+";
        color: var(--yc-header-component-accent);
        font-size: 22px;
        font-weight: 700;
    }

    header.head .mobile-nav .yc-mobile-sub-open > .m-sub-toggle span::before {
        content: "-";
    }

    header.head .mobile-nav .m-sub-menu {
        display: none !important;
        padding: 0 0 12px 18px !important;
        background: #FFFFFF !important;
    }

    header.head .mobile-nav .yc-mobile-sub-open > .m-sub-menu {
        display: block !important;
    }

    header.head .mobile-nav .m-sub-menu li {
        border-bottom: 0 !important;
    }

    header.head .mobile-nav .m-sub-menu a {
        min-height: 0 !important;
        padding: 10px 0 !important;
        color: #667085 !important;
        font-size: 16px !important;
        font-weight: 700 !important;
    }
}
