/*
 * 前台响应式（手机 / 平板）。
 *
 * 老站 ssm 模板是按 1200 / 1400 两档桌面宽度写的，所有固定宽度规则继续留在 style.css 里，
 * 这里只在断点内覆盖，桌面（≥1200）读到的规则为空 —— 桌面视觉与老站保持一致。
 *
 * 断点：
 *   1199px  窄桌面 / 平板横屏（把 1200px 固宽容器改成流式）
 *   1023px  平板竖屏起按移动端布局（头部抽屉、全部单列、触屏交互）
 *   767px   手机
 *   479px   小屏手机
 */

/* ==========================================================================
   0. 基础：只在移动端出现的东西默认隐藏（桌面不受影响）
   ========================================================================== */
.nav-toggle,
.nav-mask {
    display: none;
}

/* ==========================================================================
   1. 窄桌面 / 平板横屏：固宽容器改流式（仍在同一套左右分栏布局里）
   ========================================================================== */
@media only screen and (max-width: 1199px) {
    .pmcc {
        width: 100%;
        max-width: 1200px;
        padding: 30px 20px;
        box-sizing: border-box;
    }

    .pmcc_l {
        width: 220px;
    }

    .pmcc_r {
        width: calc(100% - 240px);
    }

    .newswp {
        width: 100%;
        max-width: 1140px;
        box-sizing: border-box;
    }

    .news_l {
        width: 30%;
        height: auto;
    }

    .news_r {
        width: 66%;
    }

    .con_ab1_c {
        width: 100%;
        max-width: 1200px;
        padding: 0 20px;
        box-sizing: border-box;
    }

    .con_ab1_c_l {
        width: 52%;
    }

    /* 首页简介图带 540×150 的宽高属性，窄屏要按容器缩放 */
    .con_ab1_c_l img,
    .c101 img {
        max-width: 100%;
        height: auto;
    }

    .con_ab1_c_r {
        width: 44%;
    }

    #footerc,
    #footercl,
    #footertcc {
        width: 100%;
        max-width: 1200px;
        box-sizing: border-box;
        padding-left: 20px;
        padding-right: 20px;
    }

    #footercl .clt {
        width: 28%;
        margin-right: 4%;
    }

    #footercl .cpt {
        width: 30%;
    }

    #footercl .ft2 {
        width: 38%;
    }
}

/* ==========================================================================
   2. 平板竖屏 / 手机公共布局（≤1023）
   头部改抽屉、所有双栏改单列、触屏元素加大
   ========================================================================== */
@media only screen and (max-width: 1023px) {
    /* ---------- 头部：LOGO + 搜索 + 汉堡，导航收进左侧抽屉 ---------- */
    .top {
        height: 64px;
    }

    .topc {
        width: 100%;
        height: 64px;
        padding: 0 12px;
        box-sizing: border-box;
        display: flex;
        align-items: center;
    }

    .logo {
        float: none;
        width: auto;
        height: 64px;
        display: flex;
        align-items: center;
    }

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

    .tp_tel {
        display: none;
    }

    /* 搜索框：触屏没有 hover，改成点一下展开 */
    .tp_ss {
        position: relative;
        right: auto;
        top: auto;
        margin-left: auto;
        width: 40px;
        height: 40px;
        flex: none;
    }

    .tp_ss:hover {
        width: 40px;
        background: #050102;
        border-color: #050102;
    }

    .tp_ss.open,
    .tp_ss.open:hover {
        width: 245px;
        background: #383838;
        border-color: #383838;
    }

    .ss1 {
        width: 200px;
        height: 38px;
        line-height: 38px;
    }

    /* 汉堡按钮（桌面不渲染） */
    .nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 40px;
        height: 40px;
        margin-left: 8px;
        padding: 0 9px;
        box-sizing: border-box;
        background: transparent;
        border: #333 1px solid;
        border-radius: 4px;
        cursor: pointer;
    }

    .nav-toggle span {
        display: block;
        height: 2px;
        background: #ccc;
        transition: transform 0.25s ease, opacity 0.25s ease;
    }

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

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

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

    /* 抽屉本体：沿用同一份 #nav 结构，不另建一套模板 */
    #toprb {
        position: fixed;
        top: 64px;
        left: 0;
        width: 280px;
        max-width: 82%;
        height: calc(100% - 64px);
        padding: 0;
        float: none;
        background: #0b0b0b;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        z-index: 98;
    }

    body.nav-open #toprb {
        transform: none;
    }

    #menu {
        width: 100%;
        height: auto;
        padding-top: 0;
    }

    #nav .mainlevel {
        float: none;
        width: 100%;
        text-align: left;
        border-bottom: rgba(255, 255, 255, 0.08) 1px solid;
    }

    #nav .mainlevel > a {
        width: auto;
        height: 46px;
        line-height: 46px;
        padding: 0 16px;
        text-align: left;
        font-size: 15px;
        background: none;
    }

    /* 二级菜单：原位手风琴。!important 是为了压掉 js.js 里 mousemove 触发的 slideDown */
    #nav .mainlevel ul {
        position: static;
        display: none !important;
        width: auto;
        padding: 0 0 8px 0;
        margin: 0;
        background: transparent;
    }

    #nav .mainlevel.open ul {
        display: block !important;
    }

    #nav .mainlevel li {
        float: none;
        width: 100%;
    }

    #nav .mainlevel li a {
        width: auto;
        height: 40px;
        line-height: 40px;
        padding: 0 16px 0 32px;
        color: #b5b5b5;
        border-bottom: rgba(255, 255, 255, 0.05) 1px solid;
        font-size: 14px;
    }

    #nav .mainlevel i.fa-angle-down {
        float: right;
        line-height: 46px;
        margin-right: 0;
        transition: transform 0.25s ease;
    }

    #nav .mainlevel.open i.fa-angle-down {
        transform: rotate(180deg);
    }

    .nav-mask {
        display: none;
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 97;
    }

    body.nav-open .nav-mask {
        display: block;
    }

    body.nav-open {
        overflow: hidden;
    }

    /* ---------- 内页页头：横幅 / 面包屑 / 页内页签 ---------- */
    #bannera {
        height: 200px;
        border-top-width: 64px;
        background-size: cover !important;
    }

    #mkp {
        height: auto;
        padding-bottom: 8px;
    }

    #mkpc {
        width: 100%;
        height: auto;
        padding: 0 16px;
        box-sizing: border-box;
    }

    #mkpcl {
        width: 100%;
        height: auto;
        float: none;
        margin-top: 8px;
        line-height: 22px;
        padding-left: 0;
        background: none;
        font-size: 12px;
    }

    #mkpcr {
        width: 100%;
        height: auto;
        float: none;
        text-align: left;
        line-height: 1;
        padding-top: 8px;
    }

    #mkpcr a {
        display: inline-block;
        line-height: 20px;
        padding: 8px 14px;
        margin: 0 6px 6px 0;
        font-size: 13px;
    }

    /* ---------- 大标题条 ---------- */
    .abc_title {
        width: auto;
        padding: 26px 16px 0;
        font-size: 26px;
        line-height: 38px;
    }

    .abc_title1 {
        width: auto;
        padding: 26px 16px 0;
        font-size: 22px;
        line-height: 32px;
    }

    /* ---------- 富文本正文 ---------- */
    #main_cc {
        width: auto;
        max-width: none;
        margin: 20px 16px;
        line-height: 28px;
        font-size: 15px;
        overflow-x: auto;
    }

    #main_cc p {
        line-height: 28px;
        font-size: 15px;
    }

    #main_cc img,
    .pm_rd img,
    .pm_rcon img,
    .cert_item img {
        max-width: 100%;
        height: auto;
    }

    /* 后台富文本里粘进来的宽表格：让容器横向滚动。
       不能把 table 改成 display:block —— 那会让单元格宽度塌成内容宽度（表单框会变窄） */
    #info-C,
    .pm_rd,
    .xzlx_2 {
        overflow-x: auto;
    }

    #main_cc table,
    #info-C table,
    .pm_rd table {
        max-width: 100%;
    }

    /* ---------- 留言 / 询盘表单 ---------- */
    .xzlx_wp {
        max-width: none;
    }

    .xzlx_1,
    .xzlx_2 {
        width: 100%;
        float: none;
    }

    .xzlx_1 {
        margin-bottom: 24px;
    }

    .lxb1 {
        width: 100%;
        box-sizing: border-box;
        height: 46px;
        line-height: 46px;
        font-size: 16px;
    }

    /* ---------- 通用页脚留言条 ---------- */
    .cont9 {
        height: auto;
        padding: 26px 16px 30px;
        box-sizing: border-box;
    }

    .c4cs {
        width: 100%;
        height: auto;
        padding: 10px 0 0;
    }

    .c4cs table,
    .c4cs tbody,
    .c4cs tr,
    .c4cs td {
        display: block;
        width: 100% !important;
    }

    .s41,
    .s42 {
        display: block;
        width: 100%;
        box-sizing: border-box;
        margin: 0 0 10px;
    }

    /* ---------- 页脚 ---------- */
    #footer {
        padding: 30px 0 26px;
    }

    #footercl {
        padding: 0 16px;
    }

    #footercl ul li {
        float: none;
        width: 100%;
        height: auto;
        margin-right: 0;
    }

    #footercl .clt,
    #footercl .cpt,
    #footercl .ft2 {
        width: 100%;
        float: none;
        margin-right: 0;
        padding-bottom: 16px;
    }

    #footercl .cpt a {
        width: calc(50% - 10px);
        margin-right: 10px;
        height: 40px;
        line-height: 40px;
    }

    #footertcc {
        padding: 18px 16px;
        font-size: 13px;
        line-height: 22px;
    }

    /* ---------- 首页轮播卡片：触屏用滑动，去掉两侧箭头 ---------- */
    .layer3Warp .swiper-button-prev,
    .layer3Warp .swiper-button-next,
    .layer5Warp .swiper-button-prev,
    .layer5Warp .swiper-button-next {
        display: none;
    }

    /* ---------- 右侧浮窗：缩小占位，避免挡住内容 ---------- */
    .izl-rmenu {
        transform: scale(0.72);
        transform-origin: right center;
        top: 45%;
    }

    /* ---------- 分页：加大点击区域 ---------- */
    #nextpage,
    #nx_pg {
        width: 100%;
        box-sizing: border-box;
        padding: 16px 8px 20px;
        line-height: 2.6;
    }

    #nextpage a,
    #nx_pg a {
        padding: 8px 11px;
        font-size: 14px;
    }
}

/* ==========================================================================
   3. 手机（≤767）：单列为主
   ========================================================================== */
@media only screen and (max-width: 767px) {
    /* ---------- 首页 ---------- */
    /* 右侧浮窗再缩一档，少遮住正文 */
    .izl-rmenu {
        transform: scale(0.62);
    }

    /* 按 16:9 出图：后台 1920×1080 的轮播图正好满宽不裁两侧，高度 390 宽约 219px
       （原来 44vh≈371px 太高，且 1080 图被撑高后左右各裁掉一截）；max-height 只在横屏生效。
       poposlides.css 在 responsive.css 之后引入，它的 .slides-box{height:100%} 同优先级会赢，
       这里必须提高一级特异性（html body ...）才能落到 auto。 */
    html body .slides-box {
        height: auto;
        aspect-ratio: 16 / 9;
        max-height: 60vh;
    }

    .con_ab1 {
        padding: 28px 0 26px;
    }

    .con_ab1_c {
        padding: 0 16px;
    }

    .con_ab1_c_l,
    .con_ab1_c_r {
        width: 100%;
        float: none;
        font-size: 15px;
        line-height: 26px;
    }

    .con_ab1_c_l img,
    .c101 img,
    .bt_link img {
        max-width: 100%;
        height: auto;
    }

    .con_ab1_c_r {
        padding-top: 20px;
        text-align: center;
    }

    #bt {
        padding-bottom: 0;
    }

    #bt h2 {
        font-size: 20px;
        line-height: 48px;
    }

    .cont1 {
        width: auto;
        padding: 10px 12px 20px;
    }

    .layer3_box img {
        height: auto !important;
        aspect-ratio: 1 / 1;
        object-fit: contain;
        background: #fff;
    }

    .ic2 {
        height: auto;
        min-height: 44px;
        padding: 8px 10px;
        font-size: 13px;
        line-height: 20px;
        white-space: normal;
    }

    /* ---------- 产品列表 ---------- */
    .pmcc {
        padding: 18px 12px 24px;
    }

    .pmcc_l,
    .pmcc_r {
        width: 100%;
        float: none;
    }

    .pm_rtitle {
        height: auto;
        line-height: 38px;
        font-size: 20px;
        margin-bottom: 16px;
        padding: 6px 0;
    }

    .cr1 {
        height: auto;
        margin-bottom: 12px;
    }

    .cr1 table,
    .cr1 tbody,
    .cr1 tr,
    .cr1 td {
        display: block;
        width: 100% !important;
    }

    .cr1 .s1 {
        width: 100%;
        box-sizing: border-box;
        border-right: #e5e5e5 1px solid;
        border-radius: 4px;
        margin-bottom: 8px;
    }

    .cr1 .s2 {
        width: 100%;
        height: 42px;
        line-height: 42px;
        border-radius: 4px;
    }

    /* 分类：横向排列的胶囊标签，省掉左侧长列表 */
    .pmaa ul {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 8px;
        margin-bottom: 6px;
    }

    .pmaa ul li {
        display: block;
        width: auto;
    }

    .pmaa a {
        width: auto;
        height: auto;
        line-height: 20px;
        padding: 8px 12px;
        font-size: 13px;
        text-indent: 0;
        border-radius: 4px;
    }

    .pmaa i {
        display: none;
    }

    /* 产品九宫格 → 两列 */
    #pm_4 {
        padding-bottom: 10px;
    }

    #pm_4 ul {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    #pm_4 ul li {
        float: none;
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
    }

    #pm_4 .li1 {
        width: auto;
        height: auto;
        padding: 6px;
    }

    #pm_4 .li1 img {
        width: 100%;
        height: auto !important;
        max-width: none;
        aspect-ratio: 1 / 1;
        object-fit: contain;
    }

    #pm_4 .li2 {
        width: auto;
        height: auto;
        min-height: 46px;
        padding: 8px 6px 10px;
        font-size: 13px;
        line-height: 19px;
    }

    #pm_4 .li3 a {
        height: 36px;
        line-height: 36px;
        font-size: 13px;
    }

    /* ---------- 产品详情 ---------- */
    .pcal,
    .pcar {
        width: 100%;
        float: none;
    }

    .pcar {
        margin-top: 18px;
    }

    .preview {
        width: 100%;
        height: auto;
    }

    .bigImg {
        width: 100%;
        height: auto;
        float: none;
        border: 0;
        cursor: zoom-in;
    }

    .bigImg #midimg {
        width: 100% !important;
        height: auto !important;
        max-height: 78vw;
        object-fit: contain;
        cursor: zoom-in;
    }

    /* 触屏没有 hover：关掉局部放大视窗，改点击看大图 */
    #zoomPanel,
    #winSelector {
        display: none !important;
    }

    .smallImg {
        display: flex;
        align-items: center;
        width: 100%;
        height: auto;
        padding: 8px 0 0;
        float: none;
        box-sizing: border-box;
    }

    .smallImg .scrollbutton {
        float: none;
        flex: none;
        margin: 0 !important;
        background-size: 16px 40px !important;
    }

    #imageMenu {
        float: none;
        width: auto;
        flex: 1;
        margin: 0;
    }

    #imageMenu li {
        width: 66px;
        margin-left: 4px;
    }

    #imageMenu li img,
    #imageMenu li#onlickImg img,
    #imageMenu li:hover img {
        width: 58px !important;
        height: 58px !important;
    }

    .pcar_1 {
        font-size: 20px;
        line-height: 28px;
        padding: 10px 0 14px;
    }

    .pcar_2 {
        line-height: 26px;
        padding: 10px 0 12px;
        margin-bottom: 12px;
    }

    .dd_title1 {
        height: auto;
        line-height: 34px;
        font-size: 17px;
    }

    .pm_rd {
        padding: 12px 0 16px;
        line-height: 28px;
        font-size: 15px;
    }

    /* 询盘表格：手机上一行一字段 */
    .dingdan_table1,
    .dingdan_table1 tbody,
    .dingdan_table1 tr,
    .dingdan_table1 td {
        display: block;
        width: auto !important;
    }

    .dingdan_table1 {
        border: 0;
        margin-bottom: 10px;
    }

    .dingdan_table1 td {
        border: 0;
        padding: 6px 0;
        text-align: left;
    }

    .dingdan_table1 .tr1 {
        display: none;
    }

    .lxb4 {
        width: 100%;
        box-sizing: border-box;
    }

    /* ---------- 新闻 / 下载列表 ---------- */
    .newswp {
        width: auto;
        padding: 16px;
        margin-bottom: 16px;
    }

    .news_l,
    .news_r {
        width: 100%;
        float: none;
    }

    .news_l {
        height: auto;
        margin-bottom: 10px;
    }

    .news_l img {
        width: 100%;
        height: auto;
        max-height: 240px;
        object-fit: cover;
        display: block;
    }

    .ne1,
    .ne2,
    .ne3,
    .ne4 {
        width: 100%;
        height: auto;
        line-height: 24px;
    }

    .ne1 {
        font-size: 16px;
    }

    /* ---------- 新闻详情 ---------- */
    #info-T {
        padding: 8px 0 10px;
        font-size: 19px;
        line-height: 28px;
    }

    #info-M {
        font-size: 13px;
        line-height: 22px;
    }

    /* ---------- 相册：两列，图片矮一点 ---------- */
    .album_list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .album_item .album_link img {
        height: 150px;
    }

    .album_viewer_prev,
    .album_viewer_next {
        width: 44px;
        height: 44px;
        line-height: 44px;
        margin-top: -22px;
        font-size: 26px;
    }

    .album_viewer_prev {
        left: 8px;
    }

    .album_viewer_next {
        right: 8px;
    }

    .album_viewer_close {
        top: 10px;
        right: 14px;
        font-size: 34px;
    }
}

/* ==========================================================================
   4. 小屏手机（≤479）
   ========================================================================== */
@media only screen and (max-width: 479px) {
    /* 小屏跟随 767 断点的 16:9 比例，不再单独锁高度 */
    .abc_title {
        font-size: 22px;
        line-height: 32px;
    }

    .abc_title1 {
        font-size: 19px;
        line-height: 28px;
    }

    #pm_4 ul {
        gap: 10px;
    }

    #pm_4 .li2 {
        font-size: 12px;
    }

    .album_list {
        grid-template-columns: 1fr;
    }

    .album_item .album_link img {
        height: 200px;
    }

    #imageMenu li {
        width: 60px;
    }

    #imageMenu li img,
    #imageMenu li#onlickImg img,
    #imageMenu li:hover img {
        width: 52px !important;
        height: 52px !important;
    }

    /* 小屏时搜索框展开不留太大，避免挤出 LOGO */
    .tp_ss.open,
    .tp_ss.open:hover {
        width: 190px;
    }

    .ss1 {
        width: 145px;
    }
}
