/*
Theme Name: 汉广检测 - Mobile Styles
Description: 移动端响应式样式（从 style.css 拆分）
Version: 1.0.0
Text Domain: hangtest-customized
*/

/* =============================================
   首页「新闻动态 + 知识分享」五五开区块
   响应式：窄屏堆叠为上下两栏
   ============================================= */
@media (max-width: 768px) {
    .hk-row { flex-direction: column; gap: 35px; }
    .hk-col { width: 100%; }
    .hk-pic { width: 120px; height: 84px; }
}

/* =============================================
   Service Grid Cards - 移动端列数适配
   ============================================= */
@media (max-width: 768px) {
    .service-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}
@media (max-width: 480px) {
    .service-grid { grid-template-columns: 1fr; }
}

/* =============================================
   Post List Grid - 移动端列数适配
   ============================================= */
@media (max-width: 768px) {
    .post-list-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}
@media (max-width: 480px) {
    .post-list-grid { grid-template-columns: 1fr; }
}

/* =============================================
   Page with Sidebar Layout - 中等屏幕侧边栏移到正文下方
   ============================================= */
@media (max-width: 1024px) {
    .page-with-sidebar { flex-direction: column; }
    .page-with-sidebar > .service-sidebar-wrap {
        width: 100%;
        flex: 1 1 auto;
    }
}
@media (max-width: 768px) {
    .page-with-sidebar { flex-direction: column; }
}

/* =============================================
   Service Sidebar - 移动端隐藏
   ============================================= */
@media (max-width: 768px) {
    .service-sidebar-wrap { display: none; }
}

/* =============================================
   Header / Banner / Navigation / Layout
   移动端全面适配（768px / 991px / 575px 三个断点）
   ============================================= */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .menu-btn { display: block; }
    .header { position: fixed; top: 0; left: 0; width: 100%; border-radius: 0; }
    .banner-container { height: 70vh; }
    .banner-item { height: 70vh; padding-bottom: 60px; }
    .banner-item.other-slide { padding-bottom: 70px; }
    .banner-item h1 { font-size: 28px; }
    .banner-item h2 { font-size: 32px; }
    .banner-item h3 { font-size: 24px; }

    .main-container { flex-direction: column; margin: 10px; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid #eee; }
    .content-area { padding: 15px; }
    .card-grid { grid-template-columns: repeat(2, 1fr); max-height: 220px; overflow-y: auto; overflow-x: hidden; }
    .card-grid .hot-card { grid-column: span 1 !important; }
    .service-grid .hot-card { grid-column: span 1 !important; }

    .tab-list { display: flex; flex-wrap: wrap; }
    .tab-item { flex: 0 0 25%; padding: 12px 4px; font-size: 13px; justify-content: center; }

    .quote-section { height: auto; padding: 40px 20px; background-size: cover; background-position: center; }
    .quote-content { flex-direction: column; text-align: center; align-items: center; }
    .quote-text { margin-bottom: 20px; }
    .quote-buttons { justify-content: center; margin-top: 20px; }
    .quote-buttons .btn-se { margin-left: 0 !important; }
    .btn { padding: 12px 26px !important; font-size: 16px !important; }

    .std-grid { grid-template-columns: 1fr; }
    .std-card { padding: 24px 20px; }
    .section-header h2, .qc-title, .news-title { font-size: 24px; }

    .qc-accordion {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }
    .accordion-item {
        flex: none;
        width: 100%;
        min-height: 70px;
        height: 70px;
        margin-right: 0 !important;
        margin-bottom: 8px;
        border-radius: 8px;
        overflow: hidden;
        position: relative;
    }
    .accordion-item.active {
        min-height: auto;
        height: auto;
        flex: none;
    }
    .accordion-item .item-content-box {
        position: relative;
        padding: 20px;
        height: auto;
        background: rgba(0, 56, 120, 0.85);
    }
    .accordion-item .item-simple-title {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        display: flex;
        align-items: center;
        width: 100%;
        height: 70px;
        box-sizing: border-box;
        padding: 0 20px;
        font-size: 18px;
        white-space: normal;
        color: #222;
    }
    .accordion-item .more-txt {
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        left: auto;
        padding: 0;
        font-size: 14px;
        color: #222;
    }
    .accordion-item .shrink-bg {
        display: block;
        width: 100%;
        height: 70px;
        object-fit: cover;
    }
    .accordion-item .open-bg {
        display: none;
    }
    .accordion-item.active .shrink-bg {
        display: none;
    }
    .accordion-item.active .open-bg {
        display: block;
        width: 100%;
        height: 120px;
        object-fit: cover;
    }
    .accordion-item.active .item-simple-title,
    .accordion-item.active .more-txt {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        font-size: 20px;
        color: #fff;
        z-index: 2;
    }
    .accordion-item.active .more-txt {
        display: none;
    }

    .contrast-card { background: #fff !important; flex-direction: column; min-height: auto; }
    .left-col, .right-col { padding: 30px 20px; width: 100%; }
    .left-col { background-color: var(--color-primary); }
    .vs-badge { display: none; }
    .label { width: 40px; }

    .customer-section { flex-direction: column; }
    .customer-left-panel { width: 100%; padding: 20px; margin-right: 0; }
    .customer-right-panel { display: none; }
    .customer-stats-row { flex-wrap: wrap; row-gap: 18px; }
    .customer-stat-item { flex: 0 0 50%; align-items: center; }
    .customer-stat-num { font-size: 28px; }

    .news-list-wrap { flex-direction: column; gap: 15px; }
    .news-item { width: 100%; flex-direction: row; align-items: center; text-align: left; }
    .news-thumb { width: 120px; height: 80px; margin-right: 15px; margin-bottom: 0; }
    .news-headline { font-size: 16px; margin-bottom: 8px; }
    .content-area { margin-left: 0; }
    .eval-logo-wrap { width: 100%; margin-left: 0; }
    body { overflow-x: hidden; }
    .entry-content .alignwide,
    .entry-content .alignfull {
        margin-left: 0;
        margin-right: 0;
        max-width: 100%;
        width: 100%;
    }

    .discount-section h3 { font-size: 22px; }
    .discount-form { flex-direction: column; }
    .discount-form input { width: 100%; }
    .discount-form-cf7 .wpcf7-form { flex-direction: column; }
    .discount-form-cf7 .wpcf7-submit { width: 100%; }

    .footer-content { flex-direction: column; text-align: center; }
    .footer-center { justify-content: center; margin-right: 0; }
    .footer-qr { justify-content: center; }
    .back-top { right: 15px; bottom: 15px; }
}

@media (max-width: 991px) {
    .banner-container { height: 85vh; }
    .banner-item { height: 85vh; padding-bottom: 80px; }
    .banner-item.other-slide { padding-bottom: 90px; }
}
@media (max-width: 575px) {
    .banner-item h1 { font-size: 22px; }
    .banner-item h2 { font-size: 26px; }
    .banner-item h3 { font-size: 20px; }
    .page-banner-title { font-size: 24px; }
    .card-grid { grid-template-columns: 1fr; max-height: 420px; }
    .tab-item { flex: 0 0 33.33%; }
    .customer-stat-item { flex: 0 0 50%; }
}

/* =============================================
   Side Float - 侧边浮窗：移动端右侧贴边中部显示
   ============================================= */
@media (max-width: 1199px) {
    .youce {
        display: block !important;
        right: 0;
        top: calc(50% + 110px);
        transform: translateY(-50%);
        width: 58px;
        padding-left: 0;
        border-radius: 8px 0 0 8px;
        transition: transform .35s ease;
    }
    .youce > a {
        padding: 12px 0 10px;
        font-size: 13px;
        line-height: 18px;
        margin-bottom: 6px;
        border-radius: 8px 0 0 8px;
    }
    .youce > a i { font-size: 18px; }
    .youce > .divbox {
        padding: 6px 0 10px;
        font-size: 12px;
        border-radius: 8px 0 0 8px;
    }
    .youce > .divbox a .top { padding: 12px 0; font-size: 12px; }
    .youce > .divbox a i { font-size: 18px; }
    .youce > .divbox a:nth-last-child(1) { padding-top: 4px; }

    /* 抽屉式把手：位于浮窗左缘中部，作为浮窗的一部分随其一起滑出/滑入 */
    .youce-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        left: -20px;
        top: 50%;
        transform: translateY(-50%);
        width: 20px;
        height: 48px;
        padding: 0;
        border: none;
        border-radius: 8px 0 0 8px;
        background: var(--color-primary);
        color: #fff;
        font-size: 18px;
        line-height: 1;
        cursor: pointer;
        z-index: 3;
        box-shadow: 0 0 11px rgba(0,0,0,0.15);
    }
    /* 收起态：浮窗整体向右滑出屏幕，仅留箭头把手在右缘 */
    .youce.collapsed {
        transform: translate(100%, -50%);
    }
}

/* =============================================
   Service Page (single-sd_service) 响应式
   ============================================= */
@media (max-width: 1024px) {
    .page_lt__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .page-with-sidebar { flex-direction: column; }
    .service-sidebar-wrap { width: 100%; order: 2; display: none; }
    .page-with-sidebar > .main-content { width: 100%; order: 1; }
    .product-header { flex-direction: column; }
    .product-image { width: 100%; height: 100%; }
    .main-content { padding: 10px; }
    .question-word1 { width: auto; }
    .question-word2 { width: auto; }
    .page_md__grid { grid-template-columns: 1fr; }
    .page_lt__grid { grid-template-columns: 1fr; }
    .features-container { grid-template-columns: 1fr; }
    .sd-case-grid { grid-template-columns: 1fr; }
    .sd-case-media { width: 40%; }
    .sd-partner-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =============================================
   News Excerpt - 移动端长描述截断
   ============================================= */
@media (max-width: 767px) {
    .news-excerpt {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* --- 移动端隐藏爱番番「邀请」浮窗 (embed-invite-wrap) --- */
@media (max-width: 768px) {
    .embed-invite,
    body .embed-invite,
    html .embed-invite {
        display: none !important;
    }
}


/* ---  移动端字号调整 --- */
@media (max-width: 768px) {
    .main-content {
        font-size: 14px;
    }
}