/*****************************************************************
 * 手机端样式 Mobile Stylesheet
 * 与电脑端共用同一套模板与数据接口（controllers/qd_controller.go 的 Pages()），
 * 依据视口宽度自动适配（响应式媒体查询 = 自动识别电脑/手机）。
 * 设计语言沿用电脑端：主色 #32C36C / 深色 #1A2A36 / 浅色 #F6F7F8。
 * 中英文切换沿用页面既有 language 参数与导航按钮，无需在此额外处理。
 *****************************************************************/

/* 导航在 ≤991px 折叠，故将 ≤991px 统一视为小屏/手机 */
@media (max-width: 991.98px) {
    /* ---------- 基础排版 ---------- */
    img { max-width: 100%; }
    body { font-size: 15px; line-height: 1.6; }

    h1, .h1 { font-size: 1.8rem; }
    h2, .h2 { font-size: 1.5rem; }
    h3, .h3 { font-size: 1.25rem; }
    .lead { font-size: 1rem; }

    /* 减小过大的留白，保留设计节奏，提升移动端信息密度 */
    .py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
    .my-5 { margin-top: 3rem !important; margin-bottom: 3rem !important; }

    /* ---------- 导航栏 ---------- */
    .navbar .navbar-brand img { max-height: 46px; width: auto !important; }
    .navbar .navbar-nav .nav-link { font-size: 16px !important; padding: 12px 0 !important; }
    .navbar .navbar-toggler { padding: .4rem .6rem; border-color: rgba(0, 0, 0, .1); }
    /* 语言切换按钮：移动端也要显示，并压缩内边距 */
    .navbar .btn.btn-primary.rounded-0 {
        display: block !important;
        width: auto !important;
        padding: 8px 16px !important;
        font-size: 14px !important;
        margin: 10px 16px !important;
    }

    /* ---------- 首页轮播 ---------- */
    .bannerimg { width: 100% !important; height: 100% !important; object-fit: cover !important; }
    .owl-carousel-inner { top: 0 !important; text-align: center !important; }
    .owl-carousel-inner h1 { width: 100% !important; }
    .display-2 { font-size: 2.1rem !important; }
    .header-carousel .owl-dots { right: 10px; width: 44px; }
    .header-carousel .owl-dots .owl-dot { width: 34px; height: 34px; }
    .header-carousel .owl-dots .owl-dot.active { width: 44px; height: 44px; }

    /* ---------- 内页页头 ---------- */
    .page-header { background-size: cover !important; background-position: center !important; }
    .page-header h1.display-3 { font-size: 2rem !important; line-height: 1.2 !important; }
    .page-header .breadcrumb { font-size: 14px; }

    /* ---------- 关于 / 特性 / 引言 图文区块 ---------- */
    .about .position-absolute.img-fluid,
    .feature .position-absolute.img-fluid {
        height: 100% !important;
        object-fit: cover !important;
    }

    /* ---------- 作品 / 产品 筛选 ---------- */
    #portfolio-flters { padding-left: 0; }
    #portfolio-flters li { font-size: 14px; margin: 4px 8px !important; }

    /* 产品 / 证书缩略图容器统一浅灰底，避免小图留白突兀 */
    .portfolio-img { background: #f7f7f7; }

    /* ---------- 页脚 ---------- */
    .footer .row > div { margin-bottom: 1.5rem; }
    .footer .copyright { font-size: 13px; }

    /* 回到顶部按钮紧凑化 */
    .back-to-top { right: 20px; bottom: 20px; }
}

/* 超小屏（手机竖屏）精修 */
@media (max-width: 575.98px) {
    h1, .h1 { font-size: 1.6rem; }
    h2, .h2 { font-size: 1.35rem; }
    .display-2 { font-size: 1.8rem !important; }
    .page-header h1.display-3 { font-size: 1.7rem !important; }
    .py-5 { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }
    .page-header { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }

    /* 证书 / 场地照片：手机上两列展示，提升密度 */
    div[class*="col-sm-6"] {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    /* 语言切换按钮在极窄屏占满宽度，便于点击 */
    .navbar .btn.btn-primary.rounded-0 {
        width: calc(100% - 32px) !important;
        text-align: center;
    }

    /* 轮播高度略减，减少一屏滚动 */
    .header-carousel .owl-carousel-item { min-height: 420px; }
}

/* 手机竖屏：首页「媒体中心」资讯卡片强制单列，避免一行三个拥挤（兜底，防止内联宽度复现） */
@media (max-width: 767.98px) {
    .col-md-6.col-lg-4 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
}
