/* ============================================================
   移动端适配样式（在 index.css 之后加载，仅新增不修改原框架）
   断点沿用 index.css 体系：1200 / 800 / 576
   ============================================================ */

/* 图标字体本地化：index.css 中的 @font-face 指向外部 CDN，
   此处用本地文件重声明（同名同描述符，后定义生效），
   避免 CDN 不可用时汉堡按钮等图标显示为字母 */
@font-face {
    font-family: "MiebachIcons";
    src: url("../fonts/MiebachIcons.woff") format("woff"),
         url("../fonts/MiebachIcons.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
}

/* ---------- 通用保护 ---------- */

img {
    max-width: 100%;
    height: auto;
}

/* 深色文字版 logo 默认隐藏（仅移动端白色页头时显示） */
.logo-img-dark {
    display: none;
}

/* ---------- 页脚（comm/foot.html，样式由模板内联收敛为类） ---------- */

.footer-nav {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    color: #fff;
    font-size: 14px;
    padding: 0 22px;
    font-family: SourceHanSansCN-Light, Helvetica, Arial, sans-serif;
}

.footer-contact-row {
    display: flex;
    justify-content: space-between;
    color: #fff;
    font-size: 14px;
    padding: 0 22px;
    margin-top: 75px;
}

.beian-block {
    width: 300px;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 0;
}

/* ---------- ≤1200px：切换为移动导航后的页头修正 ---------- */

@media screen and (max-width: 1200px) {
    /* 覆盖 head.html 内联的 padding:3px 60px 与 index.css 的固定 40px 高 */
    .header-top {
        padding: 8px 15px;
        height: auto;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
    }

    /* 页头两行布局：logo + 语言/电话一行，菜单条独占一行 */
    .header-top .insideFlex {
        flex-wrap: wrap;
    }

    .header-top .insideFlex > .logo:first-child {
        flex: 0 0 auto;
    }

    .header-top .insideFlex > .nav-primary {
        width: 100%;
        order: 5;
    }

    .header-top .lang {
        margin-left: auto;
        flex: 0 0 auto;
        white-space: nowrap;
    }

    /* 移动菜单面板为白底，覆盖 index.css:2630 全导航白色 !important 的定制 */
    .nav-primary .mobil-navi .level1 .nav li a {
        color: #5a5a5a !important;
    }

    .nav-primary .mobil-navi .level1 .nav li.active > a {
        color: #fff !important;
    }

    /* 联系入口是蓝色底（.contact 也带 .nav 类，需恢复白字） */
    .nav-primary .mobil-navi .level1 .contact li a {
        color: #fff !important;
    }

    /* 该断点下 header-top 背景变为白色（index.css:2809），
       原为白色设计的文字需改为深色，否则不可见 */
    .header-top .lang,
    .header-top .lang a {
        color: #005da8;
    }

    .header-top .insideFlex > .logo:last-child a span {
        color: #203344;
    }

    /* 白色页头下切换为深色文字版 logo（白色文字版在白底下不可见） */
    .header-top .logo .logo-img-light {
        display: none;
    }

    .header-top .logo .logo-img-dark {
        display: block;
        width: 160px;
        height: auto;
    }
}

/* ---------- ≤800px：小平板 ---------- */

@media screen and (max-width: 800px) {
    /* 首页/荣誉页新闻卡片：内联 480x222 背景图改为按比例自适应 */
    .news-teaser-home .news-item .image-clip,
    .event-teaser-home .news-item .image-clip {
        width: 100% !important;
        height: 0 !important;
        padding-bottom: 46.25%;
        background-size: cover;
        background-position: center center;
    }

    /* 首页项目/荣誉卡片：内联固定高度改为自适应，避免窄屏文字被裁切 */
    .mod-project-teaser .el-project-teaser {
        height: auto !important;
        min-height: 0 !important;
    }

    .mod-project-teaser .el-project-teaser .teaser-container {
        height: auto !important;
        min-height: 0 !important;
        padding-bottom: 15px;
    }

    .mod-project-teaser .el-project-teaser .teaser-container .main {
        height: auto !important;
        position: static;
        padding: 10px 15px;
    }

    /* 领导团队卡片内联 height:503px */
    .mod-leadership .el-leadership {
        height: auto !important;
        min-height: 0 !important;
    }

    /* 招聘 teaser / 页面信息块内联固定高度（about/joblist） */
    .el-job-opening-teaser,
    .page-info-main {
        height: auto !important;
        min-height: 0 !important;
    }

    /* 新闻/公告详情（newslist/announcement）：.valign 是 table-cell，
       窄屏下匿名表格会按内容最大宽度撑破版面（实测可达 1292px） */
    .mod-insight .el-news .main .valign {
        display: block;
    }

    .mod-insight .el-news .main,
    .mod-insight .el-news .main-content,
    .mod-insight .el-news .bodytext {
        max-width: 100%;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    /* 文章正文里的 <pre>（后台富文本粘贴产生）默认不换行，窄屏下文字被裁切 */
    .mod-insight .el-news pre,
    .main-content pre {
        white-space: pre-wrap;
        word-break: break-word;
        max-width: 100%;
    }

    /* 首页轮播标题在窄屏略微下移，避开顶部汉堡按钮行 */
    .slider-wrapper .title-container {
        margin-top: 40px;
    }

    /* 产品页“成功项目”等 medium teaser：桌面宽 28.57%，窄屏独占一行 */
    .el-page-teaser.medium {
        width: 100%;
        float: none;
        margin-bottom: 25px;
    }

    /* 关于/联系页的 联系信息+表单 双栏改单栏 */
    .container.pages {
        flex-direction: column;
        padding-bottom: 60px;
    }

    .container.pages .info {
        padding-right: 0;
    }

    .container.pages .input {
        width: 100%;
        margin-right: 0;
        padding: 30px 0 0 0;
        border-left: none;
    }

    .container.pages .input .line {
        display: none;
    }

    .container.pages .input input {
        width: 100%;
    }

    .container.pages textarea {
        width: 100%;
    }

    /* 页脚联系区纵向堆叠 */
    .footer-contact-row {
        flex-direction: column;
        margin-top: 40px;
    }

    .footer-contact-row .first-img {
        margin-top: 20px;
    }

    .footer-contact-row .first-img img {
        width: 120px !important;
        height: auto !important;
    }

    /* 留言/会员页（message/member）：模板使用 Bootstrap 栅格类但未加载 bootstrap.css，
       这里做最小可用化（仅窄屏生效，桌面维持现状） */
    .container.pages > .row,
    .container.pages form .row {
        margin-left: 0;
        margin-right: 0;
    }

    .container.pages form .form-group {
        margin-bottom: 15px;
    }

    .container.pages form label {
        display: block;
        margin-bottom: 4px;
        color: #203344;
    }

    .container.pages form .form-control {
        width: 100%;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
        padding: 8px 10px;
        border: 1px solid #ccc;
        border-radius: 4px;
        font-size: 16px;
    }

    .container.pages form .col-6 {
        float: left;
        width: 50%;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
        padding-right: 8px;
    }

    .container.pages form .btn {
        display: inline-block;
        padding: 8px 20px;
        background: #005da8;
        color: #fff;
        border: none;
        border-radius: 4px;
        font-size: 16px;
        cursor: pointer;
    }
}

/* ---------- ≤576px：手机 ---------- */

@media screen and (max-width: 576px) {
    .header-top {
        padding: 3px 10px;
    }

    /* 右侧电话块让位给汉堡按钮与语言切换 */
    .header-top .insideFlex > .logo:last-child {
        display: none;
    }

    .header-top .lang {
        font-size: 13px;
        white-space: nowrap;
    }

    /* 表单行每项独占一行 */
    .container.pages .input-item .item {
        flex-basis: 100%;
    }

    /* 验证码行：输入框 + canvas + 提交按钮换行排列 */
    .container.pages .input form > div:last-child {
        flex-wrap: wrap;
    }

    .container.pages .input form #text {
        flex: 1 1 auto;
        width: auto !important;
        min-width: 0;
    }

    .container.pages .input form .submit-btn {
        width: 100%;
        height: 40px;
        margin-top: 10px;
    }

    /* 页脚导航居中换行 */
    .footer-nav {
        justify-content: center;
        text-align: center;
    }

    .footer-nav > div {
        padding: 4px 6px;
    }

    .footer-contact-row .contact-lines > div {
        line-height: 1.8;
        margin-bottom: 6px;
    }

    /* 各页底部“立即联系”横幅（内联 height:80px，文字窄屏换行会被裁切） */
    div[style*="home_footer.jpg"] {
        height: auto !important;
        min-height: 80px;
        padding: 10px 0;
    }
}
