/* ============================================================
   汝北电脑 - 移动端前台样式（v2 全面重写）
   设计规范：
   - 品牌色 #667eea，品牌渐变 135deg #667eea → #764ba2
   - 卡片圆角 14px、统一柔和投影、统一 16px 间距节奏
   - 底部导航（首页/新闻/产品/其它）+ "其它"抽屉
   - 断点：<= 991.98px（与顶部导航折叠点一致）
   ============================================================ */

/* 底部导航与抽屉：桌面端默认隐藏 */
.m-bottom-nav,
.m-sheet,
.m-sheet-mask {
    display: none;
}

body.m-sheet-open {
    overflow: hidden;
}

@media (max-width: 991.98px) {

    /* ---------- 1. 基础与排版 ---------- */
    html {
        -webkit-text-size-adjust: 100%;
        font-size: 15px;
    }

    body {
        background: #f4f6fa;
        padding-bottom: calc(62px + env(safe-area-inset-bottom));
        -webkit-tap-highlight-color: transparent;
        overflow-x: hidden;
    }

    h1 { font-size: 24px !important; line-height: 1.35; }
    h2 { font-size: 21px !important; line-height: 1.35; }
    h3 { font-size: 18px !important; line-height: 1.4; }
    h4, h5 { font-size: 16.5px !important; line-height: 1.4; }
    h6 { font-size: 15px !important; }

    .container,
    .container-fluid {
        padding-left: 16px;
        padding-right: 16px;
    }

    section { overflow-x: hidden; }

    /* ---------- 2. 顶部导航 ---------- */
    .navbar {
        padding-top: 10px;
        padding-bottom: 10px;
        box-shadow: 0 2px 10px rgba(16, 42, 100, .06);
    }

    .navbar-brand img {
        max-height: 38px !important;
    }

    .navbar-collapse {
        margin-top: 8px;
        padding: 8px 12px 12px;
        background: #fff;
        border-radius: 0 0 14px 14px;
        box-shadow: 0 10px 24px rgba(16, 42, 100, .08);
    }

    .navbar-nav .nav-link {
        padding: 11px 8px !important;
        font-size: 15px;
        border-bottom: 1px solid #f1f3f7;
    }

    .navbar-nav .nav-item:last-child .nav-link {
        border-bottom: 0;
    }

    /* ---------- 3. 顶部横幅 page-header ---------- */
    .page-header {
        padding: 44px 0 40px !important;
    }

    .page-header h1 {
        font-size: 24px !important;
    }

    .page-header p,
    .page-header .lead {
        font-size: 14px !important;
        opacity: .92;
    }

    /* ---------- 4. 面包屑与搜索 ---------- */
    .breadcrumb {
        flex-wrap: wrap;
        font-size: 13px;
        padding: 0;
        margin: 0;
    }

    .page-search,
    .search-box,
    form[role="search"] {
        width: 100%;
    }

    /* 面包屑 + 搜索那一行改为纵向排列 */
    .d-flex.justify-content-between.align-items-center.mb-3 {
        flex-direction: column;
        align-items: stretch !important;
        gap: 12px;
    }

    /* 模板里内联 min-width 的搜索框 */
    div[style*="min-width: 280px"],
    div[style*="min-width:280px"],
    div[style*="min-width: 300px"],
    div[style*="min-width:300px"] {
        min-width: 0 !important;
        width: 100%;
        margin: 0 !important;
    }

    /* ---------- 5. 统一卡片体系 ---------- */
    .card,
    .feature-card,
    .news-item,
    .sidebar-widget {
        background: #fff;
        border: 0 !important;
        border-radius: 14px !important;
        box-shadow: 0 2px 12px rgba(16, 42, 100, .07) !important;
        overflow: hidden;
    }

    .card-body {
        padding: 14px 16px !important;
    }

    /* 通用卡片标题与摘要 */
    .card-title {
        font-size: 15.5px !important;
        font-weight: 600;
        color: #2b3245;
    }

    .card-text {
        font-size: 13px !important;
        color: #7a8299;
    }

    /* 列表行距统一 */
    .card {
        margin-bottom: 14px;
    }

    /* ---------- 6. 新闻列表（横向条目卡） ---------- */
    .news-list {
        padding: 4px 0;
    }

    .news-item {
        display: flex;
        gap: 12px;
        padding: 14px !important;
        margin-bottom: 12px !important;
        border-radius: 14px !important;
        align-items: flex-start;
    }

    .news-item:hover {
        transform: none !important;
    }

    .news-date {
        width: 52px !important;
        height: 52px !important;
        border-radius: 12px !important;
        flex-shrink: 0;
    }

    .date-day {
        font-size: 20px !important;
    }

    .date-month {
        font-size: 11px !important;
        margin-top: 2px !important;
    }

    .news-content {
        min-width: 0;
        flex: 1;
    }

    .news-title {
        font-size: 15.5px !important;
        margin-bottom: 6px !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .news-summary {
        font-size: 13px !important;
        margin-bottom: 8px !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .news-meta {
        font-size: 11.5px !important;
        gap: 10px;
    }

    .news-meta span {
        margin-right: 10px;
    }

    /* ---------- 7. 产品列表：两列电商卡片 ---------- */
    .product-layout .row.g-3,
    .products-section .row {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        margin: 0;
    }

    .product-layout .row.g-3 > [class*="col-"],
    .products-section .row > [class*="col-"] {
        width: 100%;
        max-width: 100%;
        flex: 0 0 auto;
        padding: 0;
    }

    /* 覆盖内联 height:260px */
    .taobao-card img,
    .product-card img,
    .card-img-top {
        height: 165px !important;
        object-fit: cover !important;
    }

    .taobao-card {
        border-radius: 14px !important;
        box-shadow: 0 2px 10px rgba(16, 42, 100, .08) !important;
        margin-bottom: 0 !important;
    }

    .taobao-card .card-body {
        padding: 10px 12px 12px !important;
    }

    .taobao-card .card-title,
    .product-card .card-title {
        font-size: 14.5px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .product-price,
    .taobao-card .price,
    .product-card .price {
        font-size: 15px !important;
        color: #e5533d;
        font-weight: 700;
    }

    /* 产品详情页相册 */
    .product-image img,
    .product-gallery img {
        border-radius: 14px;
    }

    /* ---------- 8. 服务 / FAQ / 下载 / 团队 卡片 ---------- */
    .service-card .card-body,
    .faq-card .card-body,
    .download-card .card-body {
        padding: 16px !important;
    }

    .service-card .card-body {
        padding: 14px 16px !important;
    }

    /* FAQ 圆形图标缩小 */
    .faq-card .rounded-circle {
        width: 40px !important;
        height: 40px !important;
        flex-shrink: 0;
    }

    .faq-card .rounded-circle i {
        font-size: 16px !important;
    }

    /* 下载卡按钮 */
    .btn-download {
        width: 100%;
        min-height: 42px;
        border-radius: 10px !important;
    }

    .download-icon {
        width: 42px;
        height: 42px;
        flex-shrink: 0;
    }

    /* 团队卡片 */
    .team-card {
        border-radius: 14px !important;
    }

    .team-card .position-relative {
        padding: 26px 0 !important;
    }

    /* 覆盖内联 140px 头像 */
    .team-card .rounded-circle,
    .team-avatar,
    .member-avatar {
        width: 104px !important;
        height: 104px !important;
        border-width: 4px !important;
    }

    .team-card .card-body {
        padding: 14px 16px 18px !important;
    }

    /* 团队/服务/FAQ 列表在窄屏单列，间距统一 */
    .team-card,
    .service-card,
    .faq-card,
    .download-card {
        margin-bottom: 14px;
    }

    /* ---------- 9. 首页特色服务：两列 ---------- */
    .features-section .row {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        margin: 0;
    }

    .features-section .row > [class*="col-"] {
        width: 100%;
        max-width: 100%;
        flex: 0 0 auto;
        padding: 0;
    }

    .feature-card {
        height: 100%;
        padding: 18px 14px !important;
        text-align: center;
    }

    .feature-card h4 {
        font-size: 15px !important;
        margin-bottom: 6px !important;
    }

    .feature-card p {
        font-size: 12.5px !important;
        margin: 0;
    }

    .feature-icon {
        width: 46px !important;
        height: 46px !important;
        margin-bottom: 10px !important;
    }

    .feature-icon i {
        font-size: 20px !important;
    }

    /* 首页新闻卡 */
    .news-card {
        margin-bottom: 14px;
    }

    /* ---------- 10. 分类侧栏 / 标签行 ---------- */
    .category-item {
        display: inline-block;
        padding: 7px 14px !important;
        margin: 0 8px 8px 0 !important;
        font-size: 13px;
        border-radius: 999px;
        background: #fff;
        border: 1px solid #e3e7f0;
        color: #4b5568;
    }

    .category-item.active {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-color: transparent;
        color: #fff;
    }

    .item-count {
        font-size: 12px;
    }

    /* 分类侧栏：移动端改为横向滑动胶囊 */
    .sidebar-sticky {
        position: static !important;
    }

    .category-sidebar {
        background: #fff;
        border-radius: 14px;
        padding: 12px 14px;
        box-shadow: 0 2px 10px rgba(16, 42, 100, .06);
        margin-bottom: 16px;
    }

    .sidebar-title {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .category-list {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .category-list .category-item {
        white-space: nowrap;
        margin: 0 !important;
    }

    /* ---------- 11. 详情页 ---------- */
    .news-main-title {
        font-size: 20px !important;
        line-height: 1.45;
    }

    .news-meta-info {
        font-size: 12px !important;
    }

    .news-meta-info span {
        display: inline-block;
        margin-bottom: 4px;
    }

    .news-detail-content {
        font-size: 15.5px;
        line-height: 1.85;
    }

    .content-body p {
        text-align: left;
        word-break: break-word;
    }

    .content-body img,
    .news-detail-content img {
        max-width: 100% !important;
        height: auto !important;
        border-radius: 12px;
        margin: 14px 0 !important;
    }

    /* 上一篇/下一篇等高 */
    .btn-outline-secondary.text-start,
    .btn-outline-secondary.text-end {
        min-height: 64px;
        border-radius: 12px;
    }

    /* 侧栏小组件全宽化 */
    .sidebar-widget {
        padding: 16px !important;
        margin-top: 0 !important;
    }

    .recommend-item,
    .product-recommend-item {
        padding-left: 0 !important;
    }

    .recommend-item:hover,
    .product-recommend-item:hover {
        background: transparent !important;
    }

    /* ---------- 12. 评论与表单 ---------- */
    input.form-control,
    textarea.form-control,
    select.form-control {
        font-size: 16px !important; /* 防止 iOS 聚焦自动放大 */
        border-radius: 10px !important;
        min-height: 44px;
        padding: 8px 12px !important;
    }

    textarea.form-control {
        min-height: 96px;
    }

    .form-label {
        font-size: 13.5px;
        margin-bottom: 6px;
    }

    .btn {
        min-height: 42px;
        border-radius: 10px;
    }

    .btn-sm {
        min-height: 34px;
    }

    /* 验证码一行可换行 */
    .d-flex.align-items-end.gap-3 {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }

    .comment-item {
        margin-bottom: 10px;
    }

    .modal-dialog {
        margin: .75rem;
    }

    /* ---------- 13. 轮播 / Hero ---------- */
    .hero-swiper,
    .hero-swiper .swiper-slide img,
    .carousel-item img {
        height: 200px !important;
        object-fit: cover;
    }

    .carousel-caption {
        bottom: 12px;
        padding: 0 12px;
    }

    .carousel-caption h1,
    .carousel-caption h2 {
        font-size: 19px !important;
    }

    .carousel-caption p {
        font-size: 13px !important;
        display: none;
    }

    .swiper-button-next,
    .swiper-button-prev {
        display: none !important;
    }

    .swiper-pagination-bullet {
        width: 7px;
        height: 7px;
    }

    /* ---------- 14. 分页 ---------- */
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
        margin: 18px 0 6px;
    }

    .page-link {
        min-width: 38px;
        min-height: 38px;
        padding: 7px 10px;
        border-radius: 10px !important;
        margin: 0 3px;
        font-size: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* ---------- 15. 表格 ---------- */
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 10px;
    }

    /* ---------- 16. 页脚 ---------- */
    .footer {
        padding-top: 26px !important;
        padding-bottom: 12px;
    }

    .footer h5 {
        font-size: 15px;
        margin-bottom: 12px;
    }

    .footer .row > div {
        margin-bottom: 16px !important;
        padding: 0 !important;
    }

    .footer ul li,
    .footer p {
        font-size: 13px;
    }

    .footer-bottom {
        font-size: 12px;
        padding: 12px 0 !important;
    }

    .friend-links-bar {
        padding: 12px 14px !important;
        font-size: 12.5px;
        text-align: center;
    }

    .friend-links-bar .d-flex {
        flex-wrap: wrap;
        justify-content: flex-start !important;
        gap: 6px 0;
    }

    .friend-links-bar a,
    .friend-links-bar strong {
        font-size: 12.5px !important;
    }

    /* ---------- 17. 杂项修正 ---------- */
    img {
        max-width: 100%;
    }

    iframe {
        max-width: 100%;
    }

    .shadow,
    .shadow-sm {
        box-shadow: 0 2px 10px rgba(16, 42, 100, .07) !important;
    }

    .alert {
        font-size: 13.5px;
        border-radius: 12px;
    }

    /* 移动端隐藏 AOS 入场位移，避免列表错位感 */
    [data-aos] {
        transform: none !important;
        opacity: 1 !important;
    }

    /* ---------- 18. 底部导航 ---------- */
    .m-bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1050;
        height: calc(62px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        background: rgba(255, 255, 255, .96);
        -webkit-backdrop-filter: saturate(180%) blur(14px);
        backdrop-filter: saturate(180%) blur(14px);
        border-top: 1px solid rgba(16, 42, 100, .08);
        box-shadow: 0 -4px 16px rgba(16, 42, 100, .06);
    }

    .m-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 6px 2px;
        color: #8a92a6;
        text-decoration: none;
        font-size: 11.5px;
        line-height: 1;
        background: none;
        border: 0;
        cursor: pointer;
        -webkit-user-select: none;
        user-select: none;
    }

    .m-nav-item i {
        font-size: 19px;
        line-height: 1;
        transition: transform .18s ease;
    }

    .m-nav-item:active i {
        transform: scale(.88);
    }

    .m-nav-item.active {
        color: #667eea;
        font-weight: 600;
    }

    /* ---------- 19. "其它"抽屉 ---------- */
    .m-sheet-mask {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .5);
        z-index: 1060;
        opacity: 0;
        visibility: hidden;
        transition: opacity .25s ease, visibility .25s ease;
    }

    .m-sheet {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1070;
        background: #fff;
        border-radius: 20px 20px 0 0;
        padding: 18px 18px calc(20px + env(safe-area-inset-bottom));
        transform: translateY(105%);
        transition: transform .3s cubic-bezier(.32, .72, .33, 1);
        max-height: 76vh;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .m-sheet.show {
        transform: translateY(0);
    }

    .m-sheet-mask.show {
        opacity: 1;
        visibility: visible;
    }

    .m-sheet-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 18px;
        padding-bottom: 12px;
        border-bottom: 1px solid #f0f2f7;
    }

    .m-sheet-header strong {
        font-size: 16px;
        color: #2b3245;
    }

    .m-sheet-close {
        width: 32px;
        height: 32px;
        border: 0;
        border-radius: 50%;
        background: #f1f3f8;
        color: #495057;
        font-size: 19px;
        line-height: 1;
    }

    .m-sheet-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 18px 10px;
    }

    .m-sheet-grid a {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        color: #3d4557;
        text-decoration: none;
        font-size: 12px;
        text-align: center;
        word-break: break-all;
    }

    .m-sheet-grid i {
        width: 46px;
        height: 46px;
        border-radius: 14px;
        background: #f2f4fb;
        color: #667eea;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        transition: transform .18s ease;
    }

    .m-sheet-grid a:active i {
        transform: scale(.9);
    }
}

/* 小屏（<=575.98px）进一步微调 */
@media (max-width: 575.98px) {
    .taobao-card img,
    .product-card img,
    .card-img-top {
        height: 150px !important;
    }

    .hero-swiper,
    .hero-swiper .swiper-slide img,
    .carousel-item img {
        height: 178px !important;
    }

    .page-header {
        padding: 36px 0 32px !important;
    }

    .page-header h1 {
        font-size: 21px !important;
    }
}

/* ============================================================
   全站卡片美化（桌面端 + 移动端通用）
   ============================================================ */
.card,
.feature-card,
.news-item,
.news-card,
.taobao-card,
.team-card,
.service-card,
.faq-card,
.download-card {
    transition: transform .25s ease, box-shadow .25s ease;
}

.team-card:hover,
.service-card:hover,
.faq-card:hover,
.taobao-card:hover,
.download-card:hover,
.feature-card:hover,
.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 26px rgba(16, 42, 100, .14) !important;
}

.team-card,
.service-card,
.faq-card,
.download-card {
    border-radius: 14px !important;
    box-shadow: 0 3px 14px rgba(16, 42, 100, .08) !important;
}

/* FAQ 图标圆底品牌色 */
.faq-card .rounded-circle {
    background: rgba(102, 126, 234, .12) !important;
}

.faq-card .rounded-circle i {
    color: #667eea;
}

/* 下载按钮品牌渐变 */
.btn-download {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 0;
    color: #fff;
}

.btn-download:hover {
    color: #fff;
    opacity: .92;
}

/* 分类胶囊（桌面端同样生效） */
.category-item {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    margin: 0 8px 8px 0;
    font-size: 13px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e3e7f0;
    color: #4b5568;
    text-decoration: none;
    transition: all .2s ease;
}

.category-item:hover {
    border-color: #667eea;
    color: #667eea;
}

.category-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: #fff;
}

.category-item.active:hover {
    color: #fff;
}

/* 产品数量角标 */
.item-count {
    display: inline-block;
    margin-left: 6px;
    font-size: 11px;
    background: rgba(102, 126, 234, .12);
    color: #667eea;
    border-radius: 999px;
    padding: 1px 7px;
}

.category-item.active .item-count {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

/* 团队成员姓名强调 */
.team-card .card-title {
    font-weight: 600;
    color: #2b3245;
}
