/* 全站页尾覆盖层：只盖 footer.php 的三块（logo / 底部导航 / 社交）。
   每条都必须带 #footer 前缀，NanoStyle 的同名规则是单类，压不住就会回退旧样子；整块下线直接删本文件。 */

/* 一、整条：蓝底 #0071C3、min-height 120；浅底图是 NanoStyle 的，这里关掉。
   左右内缩照首页版心（maxw 1480 + gutter），页尾与各板块左右缘对齐。 */
#footer .footer-credits {
    background-color: #0071C3;
    background-image: none;
    min-height: 120px;
    padding: 0 calc(max(0px, (100vw - 1480px) / 2) + clamp(20px, 4.5vw, 48px));
    gap: 20px;
    /* 顶部橙线：色值走全局变量，缺失时兜底 #E68B1E */
    border-top: 10px solid var(--cproj-color-accent-orange, #E68B1E);
}

/* 〇、三块老盒模型清零：它们是 bootstrap 的 col-*，自带 15px 内缩；主题还给 .footer-menu 加过负边距和大字号。
   清掉后块间距只由上面那条 gap 决定。 */
#footer .footer-credits > div {
    margin: 0;
    padding: 0;
    font-size: 15px;
}

/* 二、logo：NanoStyle 的 .footer-join 是 flex 且没写 align-items，默认 stretch 会把 img 竖向拉变形，这里恢复按比例。
   竖排：logo 在上、版权行在下，整组垂直居中靠左；白 logo 由后台「页尾信息」或 images/logo-white.webp 提供。 */
#footer .footer-join {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    /* 三段按内容宽分，中间导航拿剩下的空间，否则 1200 左右导航会被挤到第 2 行 */
    flex: 0 0 auto;
    max-width: none;
}

#footer .footer-join img {
    /* 只锁高度、宽度按图自身比例，否则换高分辨率素材会爆满整行 */
    height: 48px;
    width: auto;
    max-width: 100%;
    padding: 0;
    /* flex:none 防在 .footer-join 里被收缩 */
    flex: none;
}

/* 版权行：Poppins 13/400 白，桌面同样显示在 logo 下方。
   padding / background / text-align / display 都要清：NanoStyle 给 .copyrightinfo 写过居中、浅底和窄屏 grid，不顶住会看到亮色块并换行。
   文案在后台「页尾信息」，留空时 footer.php 不输出这个 div。 */
#footer .footer-join .copyrightinfo {
    display: block;
    padding: 0;
    background: none;
    text-align: left;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 19px;
    letter-spacing: normal;
    color: #FFFFFF;
}

/* 三、底部导航：Poppins 15/400 白，整排水平居中。
   NanoStyle 在 ≤1500 把 .footer-menu 整个 display:none，这里用 (1,1,0) 覆盖回来。 */
#footer .footer-menu {
    display: flex;
    justify-content: center;
    /* col-lg-6 的 max-width:50% 也要顶掉，否则 1024 这档导航被压到换行 */
    flex: 1 1 auto;
    max-width: none;
}

#footer .m-margin {
    flex: 0 0 auto;
    max-width: none;
}

#footer .footer-menu ul {
    justify-content: center;
    /* 项间 61 是 1920 稿值，按视口线性缩到 22 兜底；写死 61 会在 1260 以下把第 4 项顶到第 2 行 */
    gap: 0 clamp(22px, calc(4vw - 15.8px), 61px);
    /* flex:none 防被当普通 flex 项收缩（1024 差 15px 就换行） */
    flex: none;
    margin: 0;
    padding: 0;
}

/* 旧样式给 li 加过 margin-left:30px，不清掉项间距会变大并把第 4 项顶到第 2 行 */
#footer .footer-menu ul li {
    margin: 0;
    padding: 0;
}

#footer .footer-menu ul li a {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 21px;
    color: #FFFFFF;
    /* 主题给 .footer-menu 带过 -0.0277em 字距，字会挤在一起显得变粗，这里归零 */
    letter-spacing: normal;
    /* 后台菜单存的是「Products」，靠 uppercase 显示成大写；写死免得跟主题规则变 */
    text-transform: uppercase;
}

/* 四、社交图标：40×40 白圆底 + 蓝色 glyph #0071C3，间距 20。
   NanoStyle 是黑圆底白图标，要整个反过来；hover 圆底不能变蓝（蓝底上会消失）。 */
#footer .social_icon ul {
    display: flex;
    gap: 20px;
}

#footer .social_icon li {
    width: 40px;
    height: 40px;
    float: none;
    padding: 0;
    line-height: normal;
}

#footer .social_icon li a {
    width: 40px;
    height: 40px;
    background-color: #FFFFFF;
}

#footer .social_icon li a i {
    font-size: 21px;
    color: #0071C3;
}

#footer .social_icon li a:hover {
    background-color: #FFFFFF;
}

/* NanoStyle 在移动档给 .LeftLiBorder/.RightLiBorder 加过 1px 灰线，稿里没有，去掉 */
#footer .social_icon li.LeftLiBorder,
#footer .social_icon li.RightLiBorder {
    border: none;
}

/* 五、微信二维码（后台「页尾信息 → 微信二维码图片」）：存空串时 footer.php 不输出这个 li。
   形态同 CN 站旧版气泡（100×100 浅灰 + 10 内缩 + 6 圆角 + 底部小三角，悬停淡入上移）；class 用 nv2- 前缀，
   气泡相对图标居中（CN 旧样式没写 left 会向右溢出）；带 :focus 方便键盘与 headless 实测。 */
#footer .social_icon li.nv2-wechat-li {
    width: 40px;
    height: 40px;
    float: none;
    padding: 0;
}

#footer .nv2-wechat {
    position: relative;
    width: 40px;
    height: 40px;
    background-color: #FFFFFF;
}

#footer .nv2-wechat i {
    font-size: 16px;
    color: #0071C3;
}

#footer .nv2-wechat-qr {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    box-sizing: border-box;
    width: 100px;
    height: 100px;
    padding: 10px;
    margin: 0;
    background-color: rgb(221 221 221);
    border-radius: 6px;
    z-index: 1;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all .3s ease-in-out;
}

#footer .nv2-wechat-qr::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: rgb(221 221 221);
}

#footer .nv2-wechat-qr img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#footer .nv2-wechat:hover .nv2-wechat-qr,
#footer .nv2-wechat:focus .nv2-wechat-qr {
    opacity: 1;
    visibility: visible;
    bottom: 65px;
}

/* 六、手机端（≤991）：顺序 logo → 导航 → 社交，段间 24；三段各自贴边，内缩统一用上面那套版心值。 */
@media only screen and (max-width: 991px) {
    #footer .footer-credits {
        min-height: 0;
        flex-wrap: wrap;
        padding-block: 23px 30px;
        gap: 24px;
    }

    #footer .footer-join {
        /* 竖排与字号在基础规则里，这里只占满整行并贴顶 */
        flex: 1 1 100%;
        justify-content: flex-start;
    }

    /* 导航在上、社交在下靠右；justify-content 改回 flex-start，否则 ul 窄于整行时还被居中 */
    #footer .footer-menu {
        flex: 1 1 100%;
        order: 2;
        justify-content: flex-start;
    }

    #footer .m-margin {
        flex: 1 1 100%;
        order: 3;
    }

    #footer .social_icon {
        justify-content: flex-end;
    }

    /* 整组左对齐，项间 30 / 行间 12；必须允许收缩，否则 375 上会撑出横向滚动条 */
    #footer .footer-menu ul {
        justify-content: flex-start;
        gap: 12px 30px;
        flex: 0 1 auto;
    }
}
