/* ===================================================================
   全站响应式兜底样式
   所有模板的每个页面都会引入本文件（在 </head> 前）
   设计原则：
     1. 只做「防溢出 / 自动折行 / 字号缩放」这类通用修正
     2. 不覆盖模板自己的布局（除非它明显会溢出）
     3. 桌面端（>991px）几乎不干预
   =================================================================== */

/* ---------- 全局基础 ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    max-width: 100%;
}

img,
video,
iframe,
embed,
object {
    max-width: 100%;
    height: auto;
}

/* 图片不撑破容器 */
img {
    -ms-interpolation-mode: bicubic;
}

/* 长单词 / 长链接断行 */
p,
div,
li,
span,
td,
th,
h1,
h2,
h3,
h4,
h5,
h6,
a {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 表格：小屏可横向滚动 */
table {
    max-width: 100%;
}

/* 输入控件不溢出 */
input,
textarea,
select,
button {
    max-width: 100%;
    font-family: inherit;
}

/* ===================================================================
   平板及以下（≤ 1200px）
   =================================================================== */
@media (max-width: 1200px) {
    /* 内联写死的超宽容器 */
    [style*="width:1200px"],
    [style*="width: 1200px"] {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ===================================================================
   平板（≤ 991px）
   =================================================================== */
@media (max-width: 991px) {
    /* ---- 常见容器类名统一自适应 ---- */
    .container,
    .wrapper,
    .wrap,
    .main,
    .content,
    .inner,
    .layout {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* ---- 内联写死的固定宽度 ---- */
    [style*="width:980px"],
    [style*="width: 980px"],
    [style*="width:1000px"],
    [style*="width: 1000px"],
    [style*="width:1100px"],
    [style*="width: 1100px"],
    [style*="width:1190px"],
    [style*="width: 1190px"],
    [style*="width:1200px"],
    [style*="width: 1200px"],
    [style*="width:90%"],
    [style*="width: 90%"] {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* ---- 栅格容器自动折行（常见写法） ---- */
    .row,
    .grid,
    .list,
    .items,
    .columns {
        flex-wrap: wrap !important;
    }

    /* ---- 侧栏 + 主内容：上下排列 ---- */
    .sidebar,
    .side,
    .aside,
    .left-nav,
    .leftnav,
    .right-nav,
    .rightnav {
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 18px !important;
    }

    .content-main,
    .main-content,
    .article,
    .detail,
    .detail-content {
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* ---- 表格 ---- */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* ---- 浮动列表：两列 ---- */
    .fl,
    .fr {
        float: none !important;
    }

    /* ---- 标题字号 ---- */
    h1 {
        font-size: 26px !important;
    }

    h2 {
        font-size: 22px !important;
    }

    h3 {
        font-size: 19px !important;
    }

    /* ---- 绝对定位的大图不超出 ---- */
    [style*="position:absolute"][style*="width:1920"],
    [style*="position: absolute"][style*="width:1920"] {
        width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
    }
}

/* ===================================================================
   手机（≤ 767px）
   =================================================================== */
@media (max-width: 767px) {
    body {
        font-size: 14px;
        line-height: 1.75;
    }

    .container,
    .wrapper,
    .wrap,
    .main,
    .content,
    .inner,
    .layout {
        padding-left: 13px !important;
        padding-right: 13px !important;
    }

    h1 {
        font-size: 21px !important;
        line-height: 1.4 !important;
    }

    h2 {
        font-size: 18px !important;
        line-height: 1.45 !important;
    }

    h3 {
        font-size: 16px !important;
        line-height: 1.5 !important;
    }

    h4 {
        font-size: 15px !important;
    }

    h5,
    h6 {
        font-size: 14px !important;
    }

    p,
    li,
    td,
    th {
        font-size: 14px;
    }

    /* ---- 多列布局变单列 ---- */
    .row > [class*="col-"],
    .grid > *,
    .items > * {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* ---- 内联固定宽度一律 100% ---- */
    [style*="width:300px"],
    [style*="width: 300px"],
    [style*="width:350px"],
    [style*="width: 350px"],
    [style*="width:400px"],
    [style*="width: 400px"],
    [style*="width:450px"],
    [style*="width: 450px"],
    [style*="width:500px"],
    [style*="width: 500px"],
    [style*="width:520px"],
    [style*="width: 520px"] {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
    }

    /* ---- 内联固定高度的大图块 ---- */
    [style*="height:400px"],
    [style*="height: 400px"],
    [style*="height:450px"],
    [style*="height: 450px"],
    [style*="height:500px"],
    [style*="height: 500px"],
    [style*="height:600px"],
    [style*="height: 600px"] {
        height: auto !important;
        max-height: 320px !important;
    }

    /* ---- 隐藏桌面专用元素 ---- */
    .hidden-xs,
    .hidden-sm,
    .pc-only,
    .desktop-only,
    .d-none {
        display: none !important;
    }

    /* ---- 表格 ---- */
    table {
        font-size: 13px;
    }

    /* ---- 按钮点击区域 ---- */
    a,
    button {
        -webkit-tap-highlight-color: rgba(0, 0, 0, .06);
    }

    /* ---- 表单 ---- */
    input[type="text"],
    input[type="tel"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    textarea,
    select {
        width: 100% !important;
        height: 40px;
        font-size: 14px;
    }

    textarea {
        height: auto;
        min-height: 110px;
    }

    /* ---- 超长词不断行导致的横向溢出 ---- */
    pre {
        overflow-x: auto;
        white-space: pre;
    }

    /* ---- 分页 ---- */
    .pagination,
    .page,
    .pager,
    .page-list {
        flex-wrap: wrap !important;
        gap: 6px;
    }
}

/* ===================================================================
   小屏（≤ 575px）
   =================================================================== */
@media (max-width: 575px) {
    .container,
    .wrapper,
    .wrap,
    .main,
    .content {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    h1 {
        font-size: 19px !important;
    }

    h2 {
        font-size: 17px !important;
    }
}

/* ===================================================================
   大屏（≥ 1440px）
   =================================================================== */
@media (min-width: 1440px) {
    .container,
    .wrapper,
    .wrap,
    .inner {
        max-width: 1280px;
    }
}

/* ===================================================================
   横屏手机（高度小）
   =================================================================== */
@media (max-height: 500px) and (orientation: landscape) {
    .swiper-off-container,
    .slideBox,
    .banner {
        max-height: 60vh !important;
    }
}

/* ===================================================================
   打印
   =================================================================== */
@media print {
    .header,
    .head,
    .topbar,
    .nav,
    .footer,
    .aside,
    .sidebar,
    .menu,
    .fixed,
    .tabbar,
    .swiper-off-button-prev,
    .swiper-off-button-next {
        display: none !important;
    }

    body {
        font-size: 12pt;
        background: #fff;
        color: #000;
    }

    a::after {
        content: "";
    }
}

/* ===================================================================
   老模板常见容器类名（yt_warp / xx_wrap / xx_box）手机自适应
   =================================================================== */
@media (max-width: 991px) {
    [class*="_warp"],
    [class*="-warp"],
    [class*="warp"],
    [class*="_wrap"]:not(.swiper-wrapper):not(.tempWrap):not(.owl-wrapper):not(.owl-wrapper-outer),
    [class*="-wrap"]:not(.swiper-wrapper):not(.tempWrap):not(.owl-wrapper):not(.owl-wrapper-outer),
    [class*="_box"],
    [class*="-box"],
    [class*="_con"],
    [class*="-con"],
    [class*="_main"],
    [class*="-main"],
    [class*="_inner"],
    [class*="-inner"] {
        width: auto !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    /* 但带 padding 的容器保留内边距（轮播横向 wrapper 除外） */
    [class*="_warp"],
    [class*="warp"],
    [class*="_wrap"]:not(.swiper-wrapper):not(.tempWrap):not(.owl-wrapper):not(.owl-wrapper-outer) {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }
}

@media (max-width: 767px) {
    /* 产品卡片：手机 2 列 */
    #yt_con4 .yt_con4_u ul,
    .pro-list,
    .pro-list ul,
    .product-list ul,
    .picList {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        display: grid !important;
        gap: 12px !important;
    }

    #yt_con4 .yt_con4_u li,
    .pro-list li,
    .product-list li,
    .picList li {
        width: auto !important;
        max-width: 100% !important;
        float: none !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    /* 图片撑满卡片 */
    #yt_con4 .yt_con4_u .pic,
    .pro-list li .pic,
    .product-list li .pic {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1 / 1;
        overflow: hidden;
    }

    #yt_con4 .yt_con4_u .pic img,
    .pro-list li .pic img,
    .product-list li .pic img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block;
    }
}

/* 移动端再缩小一点 */
@media (max-width: 767px) {
    .yt_al,
    .date-box,
    .time-box,
    .news-date,
    .list-date {
        min-height: 46px !important;
        flex: 0 0 56px !important;
        width: 56px !important;
        min-width: 56px !important;
        padding: 6px 3px !important;
    }

    .yt_al > em,
    .date-box > em,
    .time-box > em,
    .news-date > em {
        font-size: 17px !important;
    }

    .yt_al > p,
    .date-box > p,
    .time-box > p,
    .news-date > p {
        font-size: 10px !important;
    }
}
/* ===================================================================
   通用：日期块高度自适应（不改变原布局，只放开固定高度）
   覆盖 331 个模板里出现的日期块类名
   =================================================================== */
.yt_al,
.booktop_time,
.newsTime,
.news_time,
.news_date,
.news-date,
.date-box,
.date-wrap,
.date-day,
.date-yearMonth,
.dateblock,
.list-date,
.time-box,
.view-date,
.news-time,
.news-item-day,
.time-day,
.time-date {
    height: auto !important;
    max-height: none !important;
    min-height: 46px !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}

/* 日期块里的两行文字：贴紧，不溢出 */
.yt_al > em,
.yt_al > p,
.booktop_time > em,
.booktop_time > p,
.booktop_time > span,
.newsTime > em,
.newsTime > p,
.newsTime > span,
.news_time > em,
.news_time > p,
.news_time > span,
.news-date > em,
.news-date > p,
.news_date > em,
.news_date > p,
.date-box > em,
.date-box > p,
.date-wrap > em,
.date-wrap > p,
.list-date > em,
.list-date > p,
.time-box > em,
.time-box > p {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center !important;
    text-indent: 0 !important;
    float: none !important;
    white-space: nowrap !important;
    line-height: 1.25 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

/* 数字那行稍大、日期那行稍小，视觉有层次 */
.yt_al > em,
.booktop_time > em,
.newsTime > em,
.news_time > em,
.news-date > em,
.news_date > em,
.date-box > em,
.list-date > em {
    font-size: 20px !important;
    font-weight: 600 !important;
    line-height: 1.15 !important;
}

.yt_al > p,
.booktop_time > p,
.newsTime > p,
.news_time > p,
.news-date > p,
.news_date > p,
.date-box > p,
.list-date > p {
    margin-top: 2px !important;
    font-size: 11px !important;
}

/* 手机端收紧 */
@media (max-width: 767px) {
    .yt_al,
    .booktop_time,
    .newsTime,
    .news_time,
    .news-date,
    .news_date,
    .date-box,
    .list-date {
        min-height: 42px !important;
        padding: 5px 3px !important;
    }

    .yt_al > em,
    .booktop_time > em,
    .newsTime > em,
    .news_time > em,
    .news-date > em {
        font-size: 16px !important;
    }

    .yt_al > p,
    .booktop_time > p,
    .newsTime > p,
    .news_time > p,
    .news-date > p {
        font-size: 10px !important;
    }
}