/* ===========================================================
   深圳兰凯官网 — 分辨率自适应 (Responsive) 全局覆盖样式
   -----------------------------------------------------------
   策略：
     - 所有表格：不超过视口宽度，自动收缩适应，不出现横向滚动条
     - 图片等比缩放，绝不溢出
   =========================================================== */

/* 防止整页横向溢出 */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* 图片随容器缩放，保持纵横比 */
img {
    max-width: 100% !important;
    height: auto !important;
}

/* 表格改为流式：不超过视口宽度，超出时自动收缩，不出现横向滚动条 */
table {
    max-width: 100% !important;
    height: auto;
    table-layout: auto;
}
table table {
    max-width: 100%;
}
td, th {
    width: auto !important;
}

/* 平板：适当缩小字号 */
@media screen and (max-width: 991px) {
    body {
        font-size: 15px;
        line-height: 1.6;
    }
}

/* 手机：功能方块等微调 */
@media screen and (max-width: 767px) {
    body {
        font-size: 14px;
        line-height: 1.6;
    }
    .site-name {
        font-size: 20px !important;
        line-height: 50px !important;
    }
    .tm-block {
        width: 50% !important;
        aspect-ratio: 1 / 1 !important;
    }
    .tm-blocks-container {
        max-width: 280px !important;
        width: 280px !important;
        margin: 0 auto !important;
    }
}

/* ===== 顶部导航响应式：≤1199px 纵向堆叠，所有菜单项直接可见 ===== */
@media screen and (max-width: 1199px) {
    /* 隐藏汉堡图标（菜单直接可见） */
    .mobile-menu-icon {
        display: none !important;
    }

    /* header 区域允许 logo 和菜单上下排列 */
    .header-bg .container,
    .header-bg .row {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .site-name-container {
        width: 100% !important;
        height: 50px !important;
        float: none !important;
        padding-left: 15px !important;
    }

    .site-name {
        line-height: 50px !important;
        height: 50px !important;
    }

    .site-name img {
        max-height: 40px !important;
        width: auto !important;
    }

    /* 菜单容器：占满宽度，位于 logo 下方 */
    .templatemo-nav-container {
        position: static !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #08292b !important;
        float: none !important;
        -webkit-box-align: stretch !important;
            -ms-flex-align: stretch !important;
                align-items: stretch !important;
    }

    /* 菜单：纵向排列，不出现横向滚动条 */
    .templatemo-nav {
        display: block !important;
        width: 100% !important;
        overflow: visible !important;
        background: #08292b !important;
        margin: 0 !important;
    }

    .templatemo-nav ul {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .templatemo-nav li {
        float: none !important;
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        border-bottom: 1px solid rgba(255,255,255,0.08) !important;
    }

    .templatemo-nav li a {
        width: 100% !important;
        height: auto !important;
        padding: 14px 10px !important;
        color: #fff !important;
        background: transparent !important;
        white-space: normal !important;
        text-align: center !important;
        display: block !important;
    }

    /* 页面里用 <p style="color:black"> 包菜单文字，强制改白 */
    .templatemo-nav li a p {
        color: #fff !important;
        margin: 0 !important;
    }

    /* 悬停/当前页高亮：用深色块替代原背景图 */
    .templatemo-nav li:hover,
    .templatemo-nav .active {
        background: #225965 !important;
        background-image: none !important;
    }

    .templatemo-nav li:hover a,
    .templatemo-nav .active a,
    .templatemo-nav li:hover a p,
    .templatemo-nav .active a p {
        color: #fff !important;
    }
}

/* 超小屏：进一步缩小字号 */
@media screen and (max-width: 479px) {
    body {
        font-size: 13px;
    }
    .tm-block {
        width: 50% !important;
        aspect-ratio: 1 / 1 !important;
    }
    .tm-blocks-container {
        max-width: 260px !important;
        width: 260px !important;
    }
}

/* ===========================================================
   彻底自适应：消除一切残留的固定宽度溢出
   =========================================================== */

/* 1) 产品页原模板在 >=1200px 强制 min-width:1500px，
      会顶破 max-width:100%，导致 1200-1499px 区间右侧被裁切。
      这里全局取消该强制最小宽度，让 body 始终跟随视口。 */
body.product-page {
    min-width: 0 !important;
}

/* 2) 首页“我们的技术 / 人才 / 服务”三栏卡片：窄屏纵向堆叠 */
@media screen and (max-width: 767px) {
    table[width="1378"] > tbody > tr,
    table[width="1378"] > tbody > tr > td {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        box-sizing: border-box !important;
        padding: 0 !important;
    }
    table[width="1378"] > tbody > tr > td > table,
    table[width="1378"] > tbody > tr > td > table.btn-default {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        margin-bottom: 20px !important;
    }
    table[width="1378"] .lb-icon {
        font-size: 48px !important;
        margin-bottom: 15px !important;
    }
    table[width="1378"] .lb-title {
        font-size: 22px !important;
    }
    table[width="1378"] div[id$="Text"] {
        padding: 10px 15px !important;
    }

    /* 英文版首页“Our Technology / Talent / Service”三栏卡片（宽度 1473）：窄屏纵向堆叠 */
    table[width="1473"] > tbody > tr,
    table[width="1473"] > tbody > tr > td {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        box-sizing: border-box !important;
        padding: 0 !important;
    }
    table[width="1473"] > tbody > tr > td > table,
    table[width="1473"] > tbody > tr > td > table.btn-default {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        margin-bottom: 20px !important;
    }
    table[width="1473"] .lb-icon {
        font-size: 48px !important;
        margin-bottom: 15px !important;
    }
    table[width="1473"] .lb-title {
        font-size: 22px !important;
    }
    table[width="1473"] div[id$="Text"] {
        padding: 10px 15px !important;
    }

    /* 首页“核心主营”4 列产品卡片：窄屏纵向堆叠 */
    table[width="1732"] > tbody > tr > td {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        box-sizing: border-box !important;
        padding: 15px 10px !important;
        margin-bottom: 20px !important;
        border-bottom: 1px solid #eee !important;
    }
    table[width="1732"] img {
        max-width: 100% !important;
        max-height: 200px !important;
        width: auto !important;
        height: auto !important;
        vertical-align: middle !important;
    }
    /* 图片容器高度自适应，不要固定 300px */
    table[width="1732"] td > div:first-child {
        height: auto !important;
        min-height: 160px !important;
        line-height: normal !important;
        padding: 15px 0 !important;
        text-align: center !important;
        margin-bottom: 10px !important;
    }
    /* 产品名称蓝色条 */
    table[width="1732"] td > div:nth-child(2) {
        height: auto !important;
        min-height: 40px !important;
        line-height: 1.4 !important;
        padding: 10px 5px !important;
        font-size: 18px !important;
        white-space: normal !important;
        margin-bottom: 10px !important;
    }
    /* 产品描述 */
    table[width="1732"] td > div:last-child {
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        padding: 5px 0 !important;
        font-size: 14px !important;
        line-height: 1.6 !important;
    }

    /* 首页“联系我们/公司简介”两栏：左侧彩色方块 + 右侧文字 */
    table[width="1741"] > tbody > tr > td {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        box-sizing: border-box !important;
        padding: 10px 15px !important;
    }
    table[width="1741"] td[width="400"],
    table[width="1741"] td[width="1105"] {
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    /* 左侧彩色方块容器：改成居中、宽度自适应 */
    table[width="1741"] .tm-blocks-container {
        width: 100% !important;
        max-width: 360px !important;
        margin: 0 auto 20px auto !important;
        float: none !important;
    }
    table[width="1741"] .tm-block {
        width: 50% !important;
        aspect-ratio: 1 / 1 !important;
    }
    table[width="1741"] .tm-block img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    /* 右侧公司简介文字 */
    table[width="1741"] td > div {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* 3) 小屏下，把内联 style="width:..." 的固定宽度块级/行内元素
      改为自适应，避免内容被推出视口（覆盖内联样式优先级）。 */
@media screen and (max-width: 991px) {
    div[style*="width:"],
    p[style*="width:"] {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    span[style*="width:"],
    td[style*="width:"],
    th[style*="width:"] {
        width: auto !important;
        max-width: 100% !important;
    }
    /* 任何带固定内联宽度的盒子，在小屏也允许收缩 */
    *[style*="width:"][style*="px"] {
        max-width: 100% !important;
    }
}

/* ===========================================================
   等比缩放叠加层 (lk-page-fit) — 固定像素表格页按视口等比缩放
   -----------------------------------------------------------
   策略：主表保持 1296 设计宽度布局（撤销上方全局 max-width:100%
         对它的压缩），再由 js/lk-page-fit.js 设置 CSS zoom，
         把整表连同框/位置/字号等比缩小到视口宽 —— 像看图一样
         整体缩放，不重排、不堆叠、不变列，同主页观感。
   =========================================================== */
table[width="1296"] {
    max-width: 1296px !important;   /* 覆盖全局 table{max-width:100%!important} */
}
