/* ========================================
   基础
======================================== */

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
}

body.header-menu-open {
    overflow: hidden;
}

/* ========================================
   Header
   始终悬浮于 Banner 上
======================================== */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;

    z-index: 9990;

    width: 100%;

    background: rgba(255, 255, 255, .72);

    border-bottom: 1px solid rgba(255, 255, 255, .48);

    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);

    transition:
        background .2s ease,
        border-color .2s ease;
}

/* 页面滚动后 */

.site-header.is-scrolled {
    background: rgba(255, 255, 255, .88);

    border-bottom-color: rgba(148, 163, 184, .16);
}

/* ========================================
   Header 容器
======================================== */

.header-container {
    width: 1200px;

    max-width: calc(100% - 40px);

    margin: 0 auto;

    padding: 0 !important;
}

.header-inner {
    position: relative;

    display: flex;
    align-items: center;

    height: 68px;
}

/* ========================================
   LOGO
======================================== */

.header-logo {
    display: flex;
    align-items: center;

    flex-shrink: 0;

    margin-right: 42px;

    color: #331d1e;

    text-decoration: none;
}

.header-logo:hover {
    color: #331d1e;
}

.header-logo-text {
    margin: 0;

    color: #331d1e;

    font-size: 24px;
    font-weight: 700;

    line-height: 1;

    letter-spacing: -.5px;

    white-space: nowrap;
}

.header-logo-image {
    display: block;

    width: auto;
    max-width: 180px;
    height: 50px;

    object-fit: contain;
}

/* ========================================
   导航整体
======================================== */

.header-nav-wrap {
    display: flex;
    align-items: center;

    flex: 1;

    min-width: 0;
}

.site-nav {
    display: flex;
    align-items: center;

    flex: 1;

    min-width: 0;

    margin: 0;
    padding: 0;

    list-style: none;
}

.site-nav-item {
    position: relative;

    display: flex;
    align-items: center;

    flex-shrink: 0;

    height: 68px;

    margin: 0 2px;

    /* 保证当前栏目及其下拉菜单始终位于页面内容之上 */
    z-index: 1;
}

.site-nav-item.has-child:hover,
.site-nav-item.has-child:focus-within {
    z-index: 20;
}

.site-nav-row {
    display: flex;
    align-items: center;

    height: 100%;
}

/* ========================================
   一级栏目
======================================== */

.site-nav-link {
    position: relative;

    display: flex;
    align-items: center;

    height: 68px;

    padding: 0 14px;

    box-sizing: border-box;

    color: #4a3534;

    font-size: 15px;
    font-weight: 400;

    line-height: 1;

    white-space: nowrap;

    text-decoration: none;

    transition: color .16s ease;
}

.site-nav-link:hover {
    color: #331d1e;
}

/* ========================================
   当前栏目
======================================== */

.site-nav-item.is-active
> .site-nav-row
> .site-nav-link {
    color: #331d1e;

    font-weight: 400;
}

/* 当前栏目底部色块见文件末尾“当前栏目：底部色块” */

/* ========================================
   有二级栏目的一级栏目
======================================== */

.site-nav-item.has-child
> .site-nav-row
> .site-nav-link {
    padding-right: 11px;
}

/* ========================================
   下拉箭头

   不再使用实心倒三角
   使用细线 Chevron
======================================== */

.site-nav-arrow {
    position: relative;

    display: inline-block;

    width: 7px;
    height: 7px;

    margin-left: 8px;
    margin-top: -4px;

    border-right: 1.5px solid #6b5553;
    border-bottom: 1.5px solid #6b5553;

    transform: rotate(45deg);

    transform-origin: center;

    transition:
        border-color .16s ease,
        transform .16s ease;
}

.site-nav-item.has-child:hover
.site-nav-arrow {
    border-color: #331d1e;

    transform:
        translateY(3px)
        rotate(225deg);
}

/* ========================================
   手机单独展开按钮
======================================== */

.site-nav-toggle {
    display: none;
}

/* ========================================
   PC 二级菜单
======================================== */

.site-subnav {
    position: absolute;

    /* 防止外部主题样式在当前栏目页把 ul 隐藏 */
    display: block;

    /*
     * 与顶部导航留一点距离
     */
    top: calc(100% + 12px);

    left: 50%;

    z-index: 1000;

    min-width: 176px;

    margin: 0;
    padding: 6px;

    box-sizing: border-box;

    list-style: none;

    border: 1px solid #e8dcd8;

    /*
     * 圆角进一步缩小
     */
    border-radius: 4px;

    background: #ffffff;

    box-shadow:
        0 10px 28px rgba(26, 15, 15, .09);

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    transform:
        translate(-50%, 5px);

    transition:
        opacity .15s ease,
        visibility .15s ease,
        transform .15s ease;
}

/*
 * 一级导航与二级菜单之间的透明桥
 */
.site-subnav::before {
    content: "";

    position: absolute;

    left: 0;
    right: 0;

    top: -20px;

    height: 20px;

    background: transparent;
}

/* ========================================
   PC Hover 显示
   仅 PC 生效，禁止影响移动端
======================================== */

@media screen and (min-width: 993px) {

    .site-nav-item.has-child:hover
    > .site-subnav,
    .site-nav-item.has-child:focus-within
    > .site-subnav,
    .site-nav-item.has-child.is-hover-open
    > .site-subnav {
        display: block;

        opacity: 1;

        visibility: visible;

        pointer-events: auto;

        transform:
            translate(-50%, 0);
    }

    /* 当前已选中的一级栏目同样必须允许重新 Hover 展开 */
    .site-nav-item.has-child.is-active:hover,
    .site-nav-item.has-child.is-active:focus-within {
        z-index: 9995 !important;
        pointer-events: auto !important;
    }

    .site-nav-item.has-child.is-active:hover
    > .site-subnav,
    .site-nav-item.has-child.is-active:focus-within
    > .site-subnav {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: translate(-50%, 0) !important;
    }

}

/* ========================================
   二级栏目链接
======================================== */

.site-subnav li {
    margin: 0;
    padding: 0;
}

.site-subnav-link {
    display: flex;
    align-items: center;

    min-height: 38px;

    padding: 7px 11px;

    box-sizing: border-box;

    /*
     * 比外层还小
     */
    border-radius: 2px;

    color: #5c4645;

    font-size: 14px;
    font-weight: 400;

    line-height: 1.5;

    white-space: nowrap;

    text-decoration: none;

    transition:
        color .15s ease,
        background .15s ease;
}

.site-subnav-link:hover {
    color: #331d1e;

    background: #f5f7fa;
}

/* ========================================
   当前栏目 / 当前子栏目高亮

   使用 !important 防止栏目页面自身样式覆盖 Header。
======================================== */

.site-nav-item.is-active
> .site-nav-row
> .site-nav-link {
    color: #331d1e !important;
    font-weight: 400 !important;
}

.site-subnav-link.is-active {
    color: #331d1e !important;
    font-weight: 400 !important;
    background: transparent !important;
}

/* ========================================
   PC 下拉菜单最终兜底

   不再依赖 has-child class。
   只要 li 内真实存在 .site-subnav，鼠标移入当前栏目
   或普通栏目都可以正常显示。
======================================== */

@media screen and (min-width: 993px) {

    .site-nav-item {
        overflow: visible !important;
    }

    .site-nav-item > .site-subnav {
        display: block !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .site-nav-item:hover > .site-subnav,
    .site-nav-item:focus-within > .site-subnav,
    .site-nav-item.is-hover-open > .site-subnav {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: translate(-50%, 0) !important;
    }

    .site-nav-item:hover,
    .site-nav-item:focus-within,
    .site-nav-item.is-hover-open {
        z-index: 100 !important;
    }

}

/* ========================================
   搜索区域
======================================== */

.header-actions {
    display: flex;
    align-items: center;

    flex-shrink: 0;

    margin-left: 28px;
}

/* ========================================
   搜索
   固定宽度
======================================== */

.header-search {
    position: relative;

    width: 188px;
}

/* ========================================
   搜索框

   实色
   无阴影
   无放大
   浅灰填充
   边框稍深
======================================== */

.header-search-form {
    position: relative;

    display: flex;
    align-items: center;

    width: 100%;
    height: 34px;

    box-sizing: border-box;

    overflow: hidden;

    /*
     * 稍深于填充色
     */
    border: 1px solid #dfe3e8;

    border-radius: 18px;

    /*
     * 不透明浅灰
     */
    background: #f7f2ee;

    /*
     * 明确关闭阴影
     */
    box-shadow: none;

    transition:
        background .15s ease,
        border-color .15s ease;
}

/* ========================================
   搜索框颜色固定

   默认 / Hover / Focus / 页面滚动后
   始终保持完全一致
======================================== */

.header-search-form,
.header-search:hover .header-search-form,
.header-search:focus-within .header-search-form,
.site-header.is-scrolled .header-search-form,
.site-header.is-scrolled .header-search:hover .header-search-form,
.site-header.is-scrolled .header-search:focus-within .header-search-form {
    background: #f7f2ee !important;
    border-color: #dfe3e8 !important;
    box-shadow: none !important;
}

/* ========================================
   搜索图标
======================================== */

.header-search-icon {
    position: absolute;

    left: 13px;
    top: 50%;

    z-index: 2;

    color: #6b5553;

    font-size: 16px;

    transform: translateY(-50%);

    pointer-events: none;

    transition: color .15s ease;
}

.header-search:focus-within
.header-search-icon {
    color: #331d1e;
}

/* ========================================
   搜索输入
======================================== */

.header-search-input {
    display: block;

    width: 100%;
    height: 100%;

    padding:
        0 36px
        0 38px;

    box-sizing: border-box;

    border: 0;

    outline: none;

    background: transparent;

    color: #3f2d2c;

    font-size: 13px;

    line-height: 34px;
}

.header-search-input::placeholder {
    color: #7c8797;

    opacity: 1;
}

.header-search-input::-webkit-search-cancel-button {
    display: none;
}

/* ========================================
   清空搜索
======================================== */

.header-search-clear {
    position: absolute;

    top: 50%;
    right: 5px;

    z-index: 3;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 25px;
    height: 25px;

    margin: 0;
    padding: 0;

    border: 0;

    border-radius: 50%;

    outline: none;

    background: transparent;

    color: #6b5553;

    cursor: pointer;

    opacity: 0;
    visibility: hidden;

    transform: translateY(-50%);

    transition:
        opacity .15s ease,
        visibility .15s ease,
        background .15s ease;
}

.header-search.has-value
.header-search-clear {
    opacity: 1;

    visibility: visible;
}

.header-search-clear:hover {
    background: #e4e7eb;
}

.header-search-clear i {
    font-size: 15px;
}

.header-mobile-site-intro {
    display: none;
}

/* ========================================
   Header 移动端占位层

   Header 本身始终独立。
   PC 不占位，允许 Header 悬浮在 Banner 上。
   移动端占 64px，让页面 / Banner 从 Header 下方开始。
======================================== */

.site-header-spacer {
    display: block;

    width: 100%;
    height: 68px;
}

/* ========================================
   手机菜单按钮
======================================== */

.header-mobile-toggle {
    display: none;

    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;

    margin: 0;
    padding: 0;

    border: 0;
    outline: none;

    background: transparent;

    color: #331d1e;

    cursor: pointer;
}

/* 不依赖图标字体，避免移动端菜单图标丢失 */
.header-mobile-toggle-icon {
    position: relative;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    width: 22px;
    height: 16px;
}

.header-mobile-toggle-icon > span {
    display: block;

    width: 100%;
    height: 1.5px;

    background: currentColor;

    transform-origin: center;

    transition:
        transform .18s ease,
        opacity .18s ease;
}

.header-mobile-toggle[aria-expanded="true"]
.header-mobile-toggle-icon > span:nth-child(1) {
    transform: translateY(7.25px) rotate(45deg);
}

.header-mobile-toggle[aria-expanded="true"]
.header-mobile-toggle-icon > span:nth-child(2) {
    opacity: 0;
}

.header-mobile-toggle[aria-expanded="true"]
.header-mobile-toggle-icon > span:nth-child(3) {
    transform: translateY(-7.25px) rotate(-45deg);
}

/* ========================================
   手机遮罩
======================================== */

.header-mobile-mask {
    position: fixed;

    inset: 0;

    z-index: 9980;

    display: none;

    background: rgba(26, 15, 15, .18);

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    transition:
        opacity .2s ease,
        visibility .2s ease;
}

.header-mobile-mask.is-open {
    opacity: 1;
    visibility: visible;

    pointer-events: auto;
}

/* ========================================
   1100
======================================== */

@media screen and (max-width: 1100px) {

    .header-logo {
        margin-right: 24px;
    }

    .site-nav-link {
        padding:
            0 10px;

        font-size: 14px;
    }

    .header-actions {
        margin-left: 16px;
    }

    .header-search {
        width: 160px;
    }

}

/* ========================================
   手机 / 平板
======================================== */

@media screen and (max-width: 992px) {

    /* ========================================
       Header

       保持 fixed，和页面内容完全解耦。
       移动端取消 backdrop-filter，
       避免部分浏览器把 fixed 菜单错误限制在 Header 内。
    ======================================== */

    .site-header {
        position: fixed;

        top: 0;
        left: 0;
        right: 0;

        width: 100%;

        background: #ffffff;

        border-bottom:
            1px solid #efe5e0;

        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .site-header.is-scrolled {
        background: #ffffff;

        border-bottom-color: #e8dcd8;
    }

    /*
     * Header 自己提供页面占位。
     * 页面无需知道 Header 高度，
     * Banner 也不需要额外 margin / padding。
     */
    .site-header-spacer {
        display: block;

        height: 64px;
    }

    /* ========================================
       Header 容器
    ======================================== */

    .header-container {
        width: 100%;

        max-width: none;

        margin: 0;

        padding:
            0 15px !important;

        box-sizing: border-box;
    }

    .header-inner {
        position: relative;

        display: flex;
        align-items: center;
        justify-content: space-between;

        width: 100%;
        height: 64px;
    }

    /* ========================================
       LOGO
    ======================================== */

    .header-logo {
        position: relative;

        z-index: 2;

        display: flex;
        align-items: center;

        min-width: 0;
        max-width:
            calc(
                100% - 60px
            );

        margin-right: 0;
    }

    .header-logo-text {
        overflow: hidden;

        font-size: 21px;

        text-overflow: ellipsis;

        white-space: nowrap;
    }

    .header-logo-image {
        width: auto;
        max-width: 190px;
        height: 42px;

        object-fit: contain;
    }

    /* ========================================
       手机菜单按钮
    ======================================== */

    .header-mobile-toggle {
        position: relative;

        top: auto;
        right: auto;
        left: auto;

        z-index: 3;

        display: flex;

        flex: 0 0 44px;

        width: 44px;
        height: 44px;

        margin-left: 12px;

        transform: none;
    }

    /* ========================================
       手机遮罩

       菜单自身已经占满 Header 以下区域。
       遮罩仅用于菜单动画时兜底以及点击关闭，
       不参与布局。
    ======================================== */

    .header-mobile-mask {
        display: block;

        top: 64px;

        background:
            rgba(
                15,
                23,
                42,
                .12
            );
    }

    /* ========================================
       手机导航面板

       完全相对浏览器视口：
       top = 64px
       height = 可视屏幕 - 64px

       不依赖 Banner，不依赖 fly-main，
       不依赖 layui-container。
    ======================================== */

    .header-nav-wrap {
        position: fixed;

        top: 64px;
        left: 0;
        right: 0;

        z-index: 9991;

        display: block;

        width: 100%;

        height:
            calc(
                100vh - 64px
            );

        height:
            calc(
                100svh - 64px
            );

        height:
            calc(
                100dvh - 64px
            );

        max-height: none;

        margin: 0;

        padding:
            10px 16px
            calc(
                28px
                + env(
                    safe-area-inset-bottom
                )
            );

        box-sizing: border-box;

        overflow-x: hidden;
        overflow-y: auto;

        overscroll-behavior: contain;

        touch-action: pan-y;

        -webkit-overflow-scrolling: touch;

        border-top:
            1px solid #efe5e0;

        background: #ffffff;

        opacity: 0;
        visibility: hidden;

        pointer-events: none;

        transform:
            translateY(-6px);

        transition:
            opacity .18s ease,
            visibility .18s ease,
            transform .18s ease;
    }

    .header-nav-wrap.is-open {
        opacity: 1;
        visibility: visible;

        pointer-events: auto;

        transform:
            translateY(0);
    }

    /* ========================================
       手机一级栏目
    ======================================== */

    .site-nav {
        display: block;

        width: 100%;

        margin: 0;
        padding: 0;
    }

    .site-nav-item {
        display: block;

        width: 100%;
        height: auto;

        margin: 0;

        border-bottom:
            1px solid #efe5e0;
    }

    .site-nav-row {
        display: flex;
        align-items: stretch;

        width: 100%;
        min-height: 52px;
        height: auto;
    }

    /*
     * 无子栏目：
     * 整行链接都可以进入栏目。
     */
    .site-nav-link {
        flex: 1 1 auto;

        min-width: 0;
        min-height: 52px;
        height: auto;

        padding: 14px 4px;

        box-sizing: border-box;

        font-size: 15px;
        font-weight: 400;
    }

    /*
     * 有子栏目：
     * 只有栏目文字区域跳转，
     * 其余区域交给展开按钮。
     */
    .site-nav-item.has-child
    > .site-nav-row
    > .site-nav-link {
        flex: 0 1 auto;

        width: auto;
        min-width: 0;
        min-height: 52px;

        padding:
            14px 4px;

        align-self: stretch;
    }

    .site-nav-item.is-active
    > .site-nav-row
    > .site-nav-link::after {
        content: none !important;
        display: none !important;
    }

    .site-nav-item.is-active
    > .site-nav-row
    > .site-nav-link {
        color: #331d1e !important;

        font-weight: 400 !important;
        background: transparent !important;
    }

    /* 当前一级栏目：只改变文字颜色，不加背景、不加边框、不加粗 */
    .site-nav-item.is-active
    > .site-nav-row {
        position: relative;
        width: 100%;
        margin: 0;
        padding: 0;
        box-sizing: border-box;

        background: transparent !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .site-nav-item.is-active
    > .site-nav-row::before {
        content: none !important;
        display: none !important;
    }

    /*
     * PC 箭头在手机隐藏。
     */
    .site-nav-arrow {
        display: none;
    }

    /* ========================================
       子栏目展开按钮
    ======================================== */

    .site-nav-toggle {
        display: flex;
        align-items: center;
        justify-content: flex-end;

        flex: 1 1 auto;

        min-width: 56px;
        min-height: 52px;

        margin: 0;

        padding:
            0 8px
            0 16px;

        box-sizing: border-box;

        border: 0;
        outline: none;

        background: transparent !important;

        color: #6b5553;

        cursor: pointer;

        -webkit-tap-highlight-color:
            transparent;
    }

    .site-nav-toggle-arrow {
        display: block;

        width: 8px;
        height: 8px;

        margin-top: -4px;

        border-right:
            1.5px solid #6b5553;

        border-bottom:
            1.5px solid #6b5553;

        transform:
            rotate(45deg);

        transition:
            border-color .16s ease,
            transform .16s ease;
    }

    .site-nav-item.is-open
    .site-nav-toggle-arrow {
        border-color: #6b5553;

        transform:
            translateY(4px)
            rotate(225deg);
    }

    /* ========================================
       手机二级栏目
    ======================================== */

    .site-subnav {
        position: static;

        top: auto;
        left: auto;

        display: none !important;

        width: 100%;
        max-width: 100%;
        min-width: 0;

        margin: 0;

        padding:
            0 0 12px;

        box-sizing: border-box;

        overflow: visible;

        border: 0;
        border-radius: 0;

        background: transparent;

        box-shadow: none;

        opacity: 1;
        visibility: visible;

        pointer-events: auto;

        transform:
            none !important;

        transition: none;
    }

    .site-subnav::before {
        display: none;
    }

    /*
     * 手机端二级菜单只由 is-open 控制。
     * hover / focus 不参与显示逻辑。
     */
    .site-nav-item.has-child:not(.is-open)
    > .site-subnav {
        display: none !important;
    }

    .site-nav-item.has-child.is-open
    > .site-subnav {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: none !important;
    }

    .site-subnav-link {
        min-height: 42px;

        margin: 0;

        padding:
            10px 4px
            10px 18px;

        box-sizing: border-box;

        border: 0;
        border-radius: 0;

        background: transparent !important;
        box-shadow: none !important;

        color: #6b5553;
        font-weight: 400 !important;

        white-space: normal;
    }

    .site-subnav-link:hover {
        color: #331d1e;

        background: transparent;
    }

    .site-subnav-link.is-active {
        color: #331d1e !important;
        font-weight: 400 !important;
        background: transparent !important;
    }

    /* ========================================
       手机导航最终兜底
       选中只变文字颜色
       子菜单只由 is-open 控制
    ======================================== */

    .site-nav-item.is-active > .site-nav-row,
    .site-nav-item.is-active > .site-nav-row:hover,
    .site-nav-item.is-active > .site-nav-row:focus {
        background: transparent !important;
        box-shadow: none !important;
    }

    .site-nav-item.is-active
    > .site-nav-row
    > .site-nav-link {
        color: #331d1e !important;
        font-weight: 400 !important;
        background: transparent !important;
    }

    .site-subnav-link.is-active {
        color: #331d1e !important;
        font-weight: 400 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    /* ========================================
       手机搜索
    ======================================== */

    .header-actions {
        display: block;

        width: 100%;

        margin:
            16px 0 6px;
    }

    .header-search {
        width: 100%;
    }

    .header-search-form {
        height: 36px;

        border-radius: 18px;

        background: #f7f2ee;

        border-color: #dfe3e8;
    }

    .header-search-input {
        line-height: 36px;

        font-size: 14px;
    }

    /* ========================================
       手机站点介绍
    ======================================== */

    .header-mobile-site-intro {
        display: block;

        margin-top: 18px;

        padding:
            18px 0
            8px;

        border-top:
            1px solid #efe5e0;
    }

    .header-mobile-site-intro-label {
        margin-bottom: 7px;

        color: #4a3534;

        font-size: 13px;
        font-weight: 500;

        line-height: 1.5;
    }

    .header-mobile-site-intro-text {
        color: #9c8683;

        font-size: 12px;

        line-height: 1.8;
    }

}

/* ========================================
   小屏
======================================== */

@media screen and (max-width: 480px) {

    .header-container {
        padding:
            0 12px !important;
    }

    .header-logo {
        max-width:
            calc(
                100% - 56px
            );
    }

    .header-logo-text {
        font-size: 20px;
    }

    .header-logo-image {
        max-width: 170px;

        height: 38px;
    }

    .header-mobile-toggle {
        flex-basis: 42px;

        width: 42px;
        height: 42px;

        margin-left: 8px;
    }

    .header-nav-wrap {
        padding-left: 12px;

        padding-right: 12px;
    }

}

/* ========================================
   当前栏目：文字下方短色块

   色块宽度与栏目文字等宽，水平居中，
   位于文字下方固定距离处
======================================== */

@media screen and (min-width: 993px) {

    .site-nav-item.is-active
    > .site-nav-row
    > .site-nav-link
    > .site-nav-text {
        position: relative;
    }

    .site-nav-item.is-active
    > .site-nav-row
    > .site-nav-link
    > .site-nav-text::after {
        content: "" !important;
        display: block !important;

        position: absolute;
        left: 50%;
        bottom: -16px;

        width: 100%;
        min-width: 18px;
        height: 3px;

        background: #331d1e;

        transform: translateX(-50%);
    }

}
