/* ============================================================
   俊诚模具官网 响应式样式
   作用：在 980px 及以下覆盖原固定宽度布局，桌面端完全不受影响
   原则：只做覆盖，不修改 style.css；不引入新 JS
   ============================================================ */

/* ---------- 基础：图片与元素自适应 ---------- */
img {
    max-width: 100%;
    height: auto;
    -ms-interpolation-mode: bicubic;
}

/* 触屏设备上禁用图片热点（usemap 坐标在缩放后会错位，避免误点跳转） */
@media (hover: none) and (pointer: coarse) {
    img[usemap] { pointer-events: none; }
}

/* ---------- 980px 及以下：平板与手机 ---------- */
@media screen and (max-width: 980px) {

    body {
        -webkit-text-size-adjust: 100%;
        background-size: cover;
    }

    /* 容器：全部改为流式宽度 */
    .content,
    .contentw,
    .top,
    .dht,
    .slidebg,
    .gjcs,
    .dh {
        width: 100% !important;
        max-width: 980px;
        box-sizing: border-box;
        padding-left: 10px;
        padding-right: 10px;
    }

    /* ---------- 头部 ----------
       原 logo.jpg 为 954×107，内含公司名称与「全国服务热线」。
       移动端等比缩放完整显示，取消 min-height 避免留白；
       .shouru（中英文切换）浮于右上，用小字号避免与 logo 文字重叠。 */
    .top {
        height: auto !important;
        min-height: 0 !important;
        padding-top: 0 !important;
        background-size: 100% auto !important;
        background-repeat: no-repeat !important;
        background-position: center top !important;
        aspect-ratio: 954 / 107;
        padding-bottom: 11.2% !important; /* aspect-ratio 兜底：107/954≈11.2% */
        height: 0 !important;
        overflow: visible;
    }

    .shouru {
        float: none;
        text-align: right;
        margin-top: 0;
        padding-top: 2px;
        margin-right: 4px;
        font-size: 11px;
        position: relative;
        z-index: 2;
    }

    /* ---------- 导航：改为可换行 ----------
       原 li 为 float:left，窄屏换行后父容器高度塌陷（.dht 只剩 12px），
       导航文字被挤压。改用 inline-block，自然换行且不塌陷。 */
    .dht {
        height: auto !important;
        line-height: 1.4;
        padding-top: 8px;
        padding-bottom: 8px;
        /* 原深蓝底来自外层背景图，窄屏被裁切后白字不可见，改为显式底色 */
        background: #000c50 !important;
        text-align: center;
    }

    .dht ul {
        float: none;
        margin-left: 0;
        font-size: 14px;
        width: 100%;
        text-align: center;
    }

    .dht li {
        float: none;
        display: inline-block;
        vertical-align: middle;
        line-height: 30px;
        padding: 0 8px;
        white-space: nowrap;
    }

    .sykd {
        display: none;
    }

    /* ---------- 首页轮播：移动端隐藏 ----------
       原轮播为 1440px 绝对定位滑动，缩放后位移计算错乱，
       隐藏可保证移动端不出现横向滚动与错位。
       注意：外层 .dh 容器固定 447px 高，必须一并收起，否则顶部留大片空白。 */
    .dh,
    #index_b_hero {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        margin: 0 !important;
    }

    /* 热门产品条与轮播的装饰性间隔一并收起 */
    #main > .content:first-of-type .slidebg {
        display: none !important;
    }

    .slidebg {
        background-size: 100% 100%;
        height: 12px;
    }

    /* ---------- 热门产品条 ----------
       原背景 keywords.jpg 为 954px 切片，缩放后左侧红色装饰错位，
       移动端改用纯色底 + 左边框，视觉更干净且无变形。 */
    .gjcs {
        height: auto;
        line-height: 1.8;
        padding: 8px 10px !important;
        background: #f7f7f7 !important;
        border-left: 3px solid #000c50;
        word-break: break-all;
    }

    /* ---------- 主体两栏：堆叠 ---------- */
    .zuo,
    .ybf,
    .ybf1,
    .ylma,
    .ylmb,
    .ylmc,
    .ylmanr,
    .ylmcnr,
    .ylmbnr {
        width: 100% !important;
        float: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .zuo {
        margin-bottom: 12px;
    }

    /* 侧栏内部固定宽度一并放开 */
    .znrty,
    .znrty ul,
    .cplb,
    .zlma,
    .zlmb,
    .lxwm,
    .lxwmk,
    .about,
    .aboutnk {
        width: 100% !important;
        box-sizing: border-box;
    }

    .znrty ul {
        padding: 6px 8px;
    }

    /* ---------- 产品 / 文章列表 ---------- */
    .cpzs,
    .cpzswk,
    .ihotpro,
    #scroll,
    #scroll_box,
    #scroll_begin {
        width: 100% !important;
        height: auto !important;
        float: none !important;
        overflow: visible !important;
        box-sizing: border-box;
    }

    .cpzsk1,
    .cpzskw {
        float: none;
        display: inline-block;
        vertical-align: top;
        margin: 6px 4px;
    }

    /* 列表项在窄屏改为两列 */
    .cpzskw {
        width: 46%;
    }

    .cpzskw img {
        width: 100%;
        height: auto;
    }

    /* 分页 */
    .pages li {
        margin-bottom: 6px;
    }

    /* ---------- 内页与产品页：固定宽度元素放开 ---------- */
    .yema,
    .cptitle,
    .cppic,
    .container,
    .container_1,
    .detail,
    .choice,
    .order,
    .paganavigator,
    .neirong,
    #icenter {
        width: 100% !important;
        max-width: 100%;
        box-sizing: border-box;
    }

    .order li .remarks {
        width: 100% !important;
        box-sizing: border-box;
    }

    /* 产品详情主图 */
    .cppic img,
    .cp img {
        width: 100% !important;
        height: auto !important;
        max-width: 100%;
    }

    /* 询价表单：输入框在窄屏铺满 */
    .order input[type="text"],
    .order textarea,
    .order select,
    .choice input,
    .choice select {
        width: 100% !important;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* 分页条允许换行 */
    .paganavigator,
    .pages {
        line-height: 2.2;
        word-break: break-word;
    }

    /* ---------- 表格自适应 ---------- */
    table {
        width: 100% !important;
        max-width: 100%;
        table-layout: auto;
    }

    td, th {
        word-break: break-word;
    }

    /* ---------- 正文可读性 ---------- */
    .aboutnk,
    .znrty,
    .lxwmk {
        line-height: 1.8;
    }

    .aboutnk {
        padding: 10px;
    }

    /* ---------- 友情链接区 ---------- */
    #iregion,
    .iregion_con,
    .iregion_title {
        width: 100% !important;
        box-sizing: border-box;
    }

    /* ---------- 页脚 ---------- */
    .bottom,
    .bottomw {
        width: 100% !important;
        height: auto !important;
        box-sizing: border-box;
        text-align: center;
        background-size: 100% 100%;
        padding-bottom: 10px;
    }

    .bottom p {
        width: 100% !important;
        height: auto;
        box-sizing: border-box;
        padding: 8px 10px;
        line-height: 1.9;
    }

    .fnav {
        width: 100%;
        line-height: 2;
        padding: 6px 8px;
        box-sizing: border-box;
        word-break: break-all;
    }
}

/* ---------- 480px 及以下：小屏手机 ---------- */
@media screen and (max-width: 480px) {

    .dht ul {
        font-size: 13px;
    }

    .dht li {
        padding: 0 4px;
        line-height: 32px;
    }

    /* 产品列表改为单列 */
    .cpzskw {
        width: 100%;
        margin: 6px 0;
    }

    .cpzsk1 {
        width: 46%;
        margin: 4px 1%;
    }

    .cpzsk1 img {
        width: 100%;
        height: auto;
    }

    /* 正文行距与字号：覆盖全局 12px 基准及后台录入的内联 line-height */
    .aboutnk,
    .znrty {
        line-height: 1.9;
    }

    .neirong,
    .neirong p,
    .neirong div,
    .neirong span,
    .neirong td,
    .neirong li,
    .aboutnk,
    .aboutnk p,
    .aboutnk span,
    .aboutnk div,
    .znrty p,
    .znrty span,
    .detail p,
    .detail span {
        font-size: 15px !important;
        line-height: 1.75 !important;
    }

    .neirong h4,
    .aboutnk h2,
    .aboutnk h3 {
        font-size: 17px !important;
        line-height: 1.5 !important;
    }

    /* 表单输入保持 16px，避免 iOS 聚焦时自动放大页面 */
    input[type="text"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px !important;
    }

    /* ---------- 审计补全：内页固定宽元素 ---------- */
    .cp1,
    .dm,
    #iright,
    #message,
    .header-search-form,
    .ilink img,
    .icompany_detail img {
        max-width: 100% !important;
        height: auto !important;
        float: none !important;
        box-sizing: border-box;
    }

    .header-search-input {
        max-width: 100% !important;
        box-sizing: border-box;
    }

    h1, h2, h6,
    .cpzsk p {
        width: auto !important;
        max-width: 100% !important;
        float: none !important;
    }
}
