/* ============================================
   新开元电销系统 - 移动端优化补丁
   针对 wangmarket 站点 354 的响应式布局优化
   ============================================ */

/* ---------- 1. 顶部导航悬浮固定（桌面 + 移动） ---------- */
/* 原样式为 absolute 覆盖在 hero 上；改用 position:sticky：
   - sticky 元素在文档流中占据自身高度 → 滚动时吸附顶部，且不会遮挡正文；
   - 自动适配各断点下的真实高度（实测 1440=117 / 1280=107 / 1024=138 /
     768=122 / 767=69 / 480=63px），无需手工估算 body padding-top。
   注：sticky 需祖先不产生滚动容器 —— 见第 2 节 overflow-x 采用 clip。 */
.header-top {
    position: sticky !important;
    top: 0 !important;
    z-index: 1030 !important;
    width: 100% !important;
    /* 原为 #00000047（半透明黑）叠加在深色 hero 图上；改为独立导航条后
       若仍用半透明黑叠白底，会变成浅灰导致白色导航文字几乎不可读，
       故统一改为实色深底。 */
    background: #202020 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

/* 移动端菜单过高时允许内部滚动，避免吸附后的导航被撑出视口 */
.navbar-collapse.show {
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---------- 2. 全局防溢出与触控目标 ---------- */
/* overflow-x:clip 不创建滚动容器，因此不会破坏 position:sticky 的吸附；
   老浏览器回退到 hidden（此时 sticky 可能不再吸附，但布局仍完好、无横向滚动）。 */
html, body {
    overflow-x: hidden;
}
@supports (overflow-x: clip) {
    html, body {
        overflow-x: clip;
    }
}
img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
}
a, button, .btn, .read a, .navbar-toggler, .nav-link {
    touch-action: manipulation;
}

/* ---------- 3. 通用移动端留白优化 ---------- */
@media screen and (max-width: 767px) {
    section {
        padding: 2em 0 !important;
    }
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }
    /* 防止容器内文字直接贴边 */
    .page-heading,
    .slide-caption,
    .welcome-grids > p,
    .welcome-grids > .content-template,
    .contact-agileinfo > [class*="col-"],
    .single-left,
    .inner_sec,
    .cpy-right p {
        padding-left: 15px;
        padding-right: 15px;
    }
    /* 长词自动换行 */
    p, h1, h2, h3, h4, h5, h6, li, span {
        overflow-wrap: break-word;
        word-wrap: break-word;
        word-break: break-word;
    }
}

/* ---------- 4. Header / Logo / 导航 ---------- */
@media screen and (max-width: 767px) {
    .header-top {
        padding: 0.3em 0;
        /* 背景色由第 1 节的实色深底统一控制 */
    }
    .navbar {
        padding: 0.3em 1em !important;
    }
    .logo .logo-h1 a.navbar-brand img {
        max-height: 40px !important;
        width: auto !important;
    }
    .navbar-toggler {
        padding: 6px 10px !important;
        font-size: 1rem !important;
        min-width: 44px;
        min-height: 44px;
    }
    .navbar-toggler-icon i {
        font-size: 1.1rem;
    }
    /* 移动端菜单：Bootstrap 默认 .navbar-nav 在移动端为 flex-direction:column，
       仅设 width 会导致"半宽条目靠左纵向堆叠、右侧大片留空"的错乱布局；
       这里改为横向自动换行的网格（配合下方 width 形成 3/2 列）。 */
    .navbar-nav {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        padding: 0.5em 0 !important;
    }
    li.nav-item {
        width: 33.33% !important;
        margin: 0 !important;
        padding: 5px 0;
    }
    .navbar-light .navbar-nav .nav-link {
        font-size: 13px !important;
        padding: 0.6em 0 !important;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media screen and (max-width: 480px) {
    .logo .logo-h1 a.navbar-brand img {
        max-height: 32px !important;
    }
    li.nav-item {
        width: 50% !important;
    }
    .navbar-light .navbar-nav .nav-link {
        font-size: 12px !important;
    }
}

/* ---------- 5. Banner / Slider 核心修复 ---------- */
@media screen and (max-width: 1280px) {
    .slide-caption h1 {
        font-size: 3.2em;
        letter-spacing: 8px;
        text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
        margin: 0;
        line-height: 1.2;
    }
}

@media screen and (max-width: 1080px) {
    .slide-caption h1 {
        font-size: 2.8em;
        letter-spacing: 6px;
    }
    .slide, .slide2, .slide3 {
        height: 58vw !important;
    }
}

@media screen and (max-width: 900px) {
    .slide-caption h1 {
        font-size: 2.4em;
        letter-spacing: 5px;
    }
    .slide-caption p {
        font-size: 14px !important;
        line-height: 24px !important;
    }
    .slide-window .slide-wrapper .slide .slide-caption {
        bottom: 8% !important;
        left: 8% !important;
        width: 84% !important;
        padding: 1.5em 1.5em !important;
    }
    .slide, .slide2, .slide3 {
        height: 65vw !important;
    }
}

@media screen and (max-width: 768px) {
    .slide-caption h1 {
        font-size: 2em;
        letter-spacing: 4px;
    }
    .slide-caption p {
        font-size: 13px !important;
        line-height: 22px !important;
        margin: 10px 0 !important;
    }
    .slide-window .slide-wrapper .slide .slide-caption {
        bottom: 5% !important;
        left: 5% !important;
        width: 90% !important;
        padding: 1em 1em !important;
    }
    .slide, .slide2, .slide3 {
        height: 80vw !important;
    }
}

@media screen and (max-width: 667px) {
    .slide-caption h1 {
        font-size: 1.8em;
        letter-spacing: 3px;
    }
    .slide, .slide2, .slide3 {
        height: 90vw !important;
    }
    .slide-caption p {
        font-size: 12px !important;
        line-height: 20px !important;
    }
}

@media screen and (max-width: 600px) {
    .slide-caption h1 {
        font-size: 1.6em;
        letter-spacing: 2px;
    }
    .slide-window .slide-wrapper .slide .slide-caption {
        bottom: 3% !important;
        left: 4% !important;
        width: 92% !important;
        padding: 1em 1em !important;
    }
    .slide, .slide2, .slide3 {
        height: 100vw !important;
    }
}

@media screen and (max-width: 480px) {
    .slide-caption h1 {
        font-size: 1.4em !important;
        letter-spacing: 2px !important;
    }
    .slide-caption h1 span {
        display: block;
        margin-top: 5px;
    }
    .slide-caption p {
        font-size: 11px !important;
        line-height: 18px !important;
        margin: 8px 0 !important;
        letter-spacing: 0.3px !important;
    }
    .slide-caption p br {
        display: none;
    }
    .slide-window .slide-wrapper .slide .slide-caption {
        bottom: 2% !important;
        left: 3% !important;
        width: 94% !important;
        padding: 1em 1em !important;
    }
    .slide, .slide2, .slide3 {
        height: 120vw !important;
    }
}

@media screen and (max-width: 414px) {
    .slide-caption h1 {
        font-size: 1.2em !important;
        letter-spacing: 1px !important;
    }
    .slide-caption p {
        font-size: 10px !important;
        line-height: 16px !important;
    }
    .slide, .slide2, .slide3 {
        height: 135vw !important;
    }
}

/* ---------- 6. Banner按钮优化 ---------- */
/* .read .btn 是绝对定位的圆形箭头按钮，需保留足够的右内边距避免文字被覆盖 */
@media screen and (max-width: 767px) {
    .read a {
        font-size: 13px !important;
        padding: 10px 55px 10px 22px !important;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
    .read .btn {
        width: 38px !important;
        height: 38px !important;
        line-height: 28px !important;
        font-size: 12px !important;
    }
}

@media screen and (max-width: 480px) {
    .read a {
        font-size: 12px !important;
        padding: 8px 50px 8px 18px !important;
    }
    .read .btn {
        width: 34px !important;
        height: 34px !important;
        line-height: 24px !important;
        font-size: 11px !important;
    }
}

/* ---------- 7. 内容区域优化 ---------- */
@media screen and (max-width: 767px) {
    .Welcome.py-5 {
        padding: 2em 0 !important;
    }
    .Welcome .container.py-sm-5 {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
    .welcome-grids h3 {
        font-size: 22px !important;
    }
    .welcome-grids p {
        font-size: 14px;
        line-height: 24px !important;
    }
    .welcome-image {
        margin-bottom: 15px;
    }
    .welcome-image img {
        width: 100%;
    }

    /* 文章详情页：直接挂在 row 下的段落/内容块补左右留白 */
    .welcome-grids > p,
    .welcome-grids > .content-template {
        padding-left: 15px;
        padding-right: 15px;
    }
    .content-template img {
        max-width: 100%;
        height: auto;
        display: block;
        margin: 1em auto;
    }

    /* 特色功能区 */
    .features.py-5 {
        padding: 2em 0 !important;
    }
    .features .container.py-sm-5 {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
    h3.heading {
        font-size: 24px !important;
        letter-spacing: 2px !important;
    }
    .para {
        font-size: 14px !important;
        margin-bottom: 1.5em !important;
    }
    .feature-grids h3 {
        font-size: 18px !important;
    }
    .feature-grids p {
        font-size: 13px;
        line-height: 22px;
    }
    .f1 {
        padding: 1.5em 1.2em !important;
        margin-bottom: 15px;
    }

    /* 计数器/数据区 */
    .Welcome-bottom .welcome_left_inner {
        padding: 1.5em 1em !important;
    }
    .agileits_w3layouts_about_counter_left {
        margin-bottom: 20px;
    }
    .counterinfo p {
        font-size: 24px !important;
    }
    .countericon h3 {
        font-size: 16px !important;
    }
    .welcome_bottom_right h3 {
        font-size: 20px !important;
    }
    .welcome_bottom_right p {
        font-size: 13px;
        line-height: 22px;
    }

    /* 成功案例区 */
    section.bottom-last .bottom-bg {
        padding: 2em 0 !important;
    }
    section.bottom-last .container.py-md-5 {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
    section.bottom-last h4.title {
        font-size: 1.3em !important;
    }
    section.bottom-last p {
        font-size: 13px;
        line-height: 22px;
    }

    /* 新闻区 */
    .team.py-5 {
        padding: 2em 0 !important;
    }
    .team .container.py-md-5 {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
    .team-row {
        width: 85% !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    .team-wrap {
        margin-bottom: 25px;
    }
    .team-title {
        font-size: 15px !important;
        line-height: 1.5;
    }
    .team-member span {
        font-size: 12px !important;
        line-height: 20px !important;
    }
}

/* ---------- 8. 内页Banner优化 ---------- */
@media screen and (max-width: 991px) {
    .inner-page-banner {
        min-height: 250px !important;
    }
    .inner-page-banner h1,
    .inner-page-banner h2 {
        font-size: 32px !important;
        letter-spacing: 3px !important;
    }
    .page-heading {
        padding-top: 120px !important;
    }
}

@media screen and (max-width: 767px) {
    .inner-page-banner {
        min-height: 200px !important;
    }
    .inner-page-banner h1,
    .inner-page-banner h2 {
        font-size: 28px !important;
        letter-spacing: 2px !important;
    }
    .page-heading {
        padding-top: 90px !important;
    }
}

@media screen and (max-width: 480px) {
    .inner-page-banner {
        min-height: 180px !important;
    }
    .inner-page-banner h1,
    .inner-page-banner h2 {
        font-size: 22px !important;
        letter-spacing: 1px !important;
    }
    .page-heading {
        padding-top: 75px !important;
    }
}

/* ---------- 9. 底部Footer优化 ---------- */
@media screen and (max-width: 767px) {
    footer h3 {
        font-size: 18px !important;
    }
    footer p, footer li, footer a {
        font-size: 13px !important;
    }
    .cpy-right {
        padding: 1.5em 1em !important;
    }
    .cpy-right p {
        font-size: 12px !important;
        line-height: 20px;
    }
}

/* ---------- 10. 内页文章详情优化 ---------- */
@media screen and (max-width: 767px) {
    .inner_sec {
        padding: 2em 0 !important;
    }
    .single-left h3 {
        font-size: 20px !important;
        line-height: 1.5;
    }
    .single-left p {
        font-size: 14px;
        line-height: 24px;
    }
    .admin {
        font-size: 12px !important;
    }
}
