/**
 * SWYFY H5 移动端适配
 * 断点：≤991px 平板/手机，≤575px 小屏手机
 */

@media (max-width: 991px) {
    html,
    body#smart-body,
    html.smart-design-mode body {
        min-width: 0 !important;
        overflow-x: hidden;
    }

    #mainContentWrapper,
    #mainContentWrapper > div,
    .smvWrapper,
    #smv_AreaMainWrapper,
    #smv_MainContent,
    .main-layout,
    .main-layout-wrapper {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    [style*="min-width:1200px"],
    [style*="min-width: 1200px"],
    [style*="width:1200px"],
    [style*="width: 1200px"] {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .header,
    .footer,
    #smv_Area0,
    #smv_Area3,
    #smv_Main,
    .smvContainer {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* 移动端顶栏 */
    .swyfy-mobile-header {
        display: flex;
        align-items: center;
        gap: 8px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100000;
        height: 48px;
        padding: 0 10px;
        background: #fff;
        border-bottom: 1px solid #e8e8e8;
        box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    }

    .swyfy-mobile-menu-btn {
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
        border: none;
        background: transparent;
        padding: 0;
        cursor: pointer;
    }

    .swyfy-mobile-menu-icon,
    .swyfy-mobile-menu-icon::before,
    .swyfy-mobile-menu-icon::after {
        display: block;
        width: 22px;
        height: 2px;
        background: #333;
        border-radius: 1px;
        transition: transform 0.2s, opacity 0.2s;
    }

    .swyfy-mobile-menu-icon {
        position: relative;
        margin: 0 auto;
    }

    .swyfy-mobile-menu-icon::before,
    .swyfy-mobile-menu-icon::after {
        content: "";
        position: absolute;
        left: 0;
    }

    .swyfy-mobile-menu-icon::before {
        top: -7px;
    }

    .swyfy-mobile-menu-icon::after {
        top: 7px;
    }

    body.swyfy-mobile-nav-open .swyfy-mobile-menu-icon {
        background: transparent;
    }

    body.swyfy-mobile-nav-open .swyfy-mobile-menu-icon::before {
        top: 0;
        transform: rotate(45deg);
    }

    body.swyfy-mobile-nav-open .swyfy-mobile-menu-icon::after {
        top: 0;
        transform: rotate(-45deg);
    }

    .swyfy-mobile-brand {
        flex: 1;
        min-width: 0;
        font-size: 13px;
        font-weight: 600;
        color: #333;
        text-decoration: none;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .swyfy-mobile-phone {
        flex: 0 0 auto;
        font-size: 12px;
        color: #68b030;
        text-decoration: none;
        white-space: nowrap;
    }

    .swyfy-mobile-nav {
        display: block;
        position: fixed;
        top: 48px;
        left: 0;
        right: 0;
        z-index: 99998;
        max-height: 0;
        overflow: hidden;
        visibility: hidden;
        background: #fff;
        border-bottom: 1px solid #e8e8e8;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        transition: max-height 0.25s ease, visibility 0.25s;
    }

    body.swyfy-mobile-nav-open .swyfy-mobile-nav {
        max-height: 70vh;
        overflow-y: auto;
        visibility: visible;
    }

    .swyfy-mobile-nav-list {
        list-style: none;
        margin: 0;
        padding: 8px 0;
    }

    .swyfy-mobile-nav-link {
        display: block;
        padding: 12px 16px;
        color: #333;
        text-decoration: none;
        font-size: 15px;
        border-bottom: 1px solid #f0f0f0;
    }

    .swyfy-mobile-nav-link.is-active,
    .swyfy-mobile-nav-link:active {
        color: #68b030;
        background: #f7fbf4;
    }

    .swyfy-mobile-nav-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 99997;
        background: rgba(0, 0, 0, 0.35);
    }

    body.swyfy-mobile-nav-open .swyfy-mobile-nav-backdrop {
        display: block;
    }

    body.swyfy-is-mobile {
        padding-top: 48px;
    }

    /* 移动端语言选择 */
    .swyfy-lang-mobile-item {
        border-top: 1px solid rgba(255, 255, 255, 0.15);
    }

    .swyfy-lang-mobile-wrap {
        display: flex;
        align-items: center;
        padding: 12px 20px;
        gap: 8px;
    }

    .swyfy-lang-mobile-wrap .swyfy-lang-label {
        color: #fff;
        font-size: 15px;
        line-height: 1.4;
    }

    .swyfy-lang-mobile-select {
        flex: 1;
        height: 36px;
        font-size: 14px;
        min-width: 0;
        max-width: none;
    }

    /* 页头：仅保留幻灯片 */
    #smv_Area0 {
        height: auto !important;
        padding-top: 0;
    }

    #smv_Area0 > .smartAbs:not([ctype="slideset"]) {
        display: none !important;
    }

    #smv_Area0 [ctype="slideset"] {
        position: relative !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: 42vw !important;
        min-height: 180px !important;
        max-height: 320px !important;
        margin: 0 !important;
        z-index: 1 !important;
        overflow: hidden !important;
    }

    #smv_Area0 [ctype="slideset"] .w-slide,
    #smv_Area0 [ctype="slideset"] .w-slide-inner {
        position: relative !important;
        left: 0 !important;
        width: 100% !important;
        overflow: hidden !important;
    }

    #smv_Area0 [ctype="slideset"] .w-slide,
    #smv_Area0 [ctype="slideset"] .w-slide-inner,
    #smv_Area0 [ctype="slideset"] .content-box,
    #smv_Area0 [ctype="slideset"] .content-box-inner {
        height: 100% !important;
    }

    /* 隐藏 PC 导航 */
    [ctype="nav"] .nav_pc_t_7,
    [ctype="nav"] .nav_pc_t_1,
    [ctype="nav"] .nav_pc_t_9 {
        display: none !important;
    }

    /* 主内容区改为流式布局 */
    #smv_Main {
        height: auto !important;
        min-height: 0 !important;
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    #smv_Main > .smartAbs,
    #smv_Main .smartAbs {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        transform: none !important;
    }

    #smv_Main [ctype="banner"] .fullcolumn-inner,
    #smv_Main .fullcolumn-inner {
        width: 100% !important;
        max-width: 100% !important;
    }

    #smv_Main img {
        max-width: 100% !important;
        height: auto !important;
    }

    #smv_Main .w-image-box img {
        width: auto !important;
        max-width: 100% !important;
    }

    /* 产品/案例列表：展平横向滑块为两列网格 */
    [ctype="listproduct"] .w-list,
    [ctype="listproduct"] .w-list > div,
    [ctype="listproduct"] .w-list > div > div {
        position: static !important;
        left: auto !important;
        top: auto !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        transform: none !important;
    }

    [ctype="listproduct"] .w-list-ul,
    [ctype="listproduct"] .w-product-list {
        position: static !important;
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        left: auto !important;
        top: auto !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        transform: none !important;
    }

    [ctype="listproduct"] .w-list-item,
    [ctype="listproduct"] .w-list-li {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        float: none !important;
        width: 50% !important;
        max-width: 50% !important;
        height: auto !important;
        box-sizing: border-box;
        padding: 8px !important;
    }

    [ctype="listproduct"] .w-list-pic,
    [ctype="listproduct"] .w-list-piclink,
    [ctype="listproduct"] .w-list-pic img,
    [ctype="listproduct"] .w-listpic-in,
    [ctype="listproduct"] .w-list-piclink img {
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        left: auto !important;
        top: auto !important;
    }

    [ctype="listproduct"] .w-list-title {
        width: 100% !important;
        white-space: normal !important;
        text-align: center;
    }

    /* 视频区块纵向排列 */
    [ctype="video"] {
        margin-bottom: 12px !important;
    }

    [ctype="video"] .w-video,
    [ctype="video"] video,
    [ctype="video"] .video-js {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 新闻列表 */
    [ctype="listnews"] .w-list-item {
        width: 100% !important;
        margin-bottom: 12px !important;
    }

    /* 留言表单 */
    .w-guestbook,
    .w-guestbook-item,
    .w-guestbook-input,
    .w-guestbook-textarea {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    /* 页脚堆叠 */
    #smv_Area3 {
        height: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 16px 12px 24px !important;
        overflow: hidden !important;
        box-sizing: border-box;
    }

    #smv_Area3 .smartAbs {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        margin: 0 0 12px 0 !important;
        transform: none !important;
        text-align: center;
    }

    #smv_Area3 .fullcolumn-inner,
    #smv_Area3 .w-company-info,
    #smv_Area3 .w-company-info li,
    #smv_Area3 .company-info-item,
    #smv_Area3 .company-info-text,
    #smv_Area3 .bottom-content {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        box-sizing: border-box;
    }

    #smv_Area3 .w-company-info,
    #smv_Area3 .w-company-info li {
        display: block !important;
        text-align: center;
        white-space: normal !important;
        word-break: break-word;
    }

    .bottom-content {
        width: 100% !important;
        padding: 0 12px;
        box-sizing: border-box;
    }

    .bottom-content .top-area,
    .bottom-content .bottom-area {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    /* 分页 */
    .w-pager,
    .w-pager-box {
        width: 100% !important;
        text-align: center;
    }

    /* 面包屑 */
    .breadcrumb_Style1,
    .w-crumbs {
        padding: 8px 12px !important;
        font-size: 13px !important;
        word-break: break-word;
    }

    /* 详情页上下篇 */
    [ctype="productPreviousBind"],
    [ctype="productNextBind"] {
        width: 100% !important;
        padding: 8px 12px !important;
        box-sizing: border-box;
    }

    html[lang="ar"] [ctype="productPreviousBind"],
    html[lang="ar"] [ctype="productNextBind"] {
        left: auto !important;
    }
}

@media (max-width: 575px) {
    .swyfy-mobile-brand {
        font-size: 12px;
    }

    .swyfy-mobile-phone {
        font-size: 11px;
    }

    #smv_Area0 [ctype="slideset"] {
        min-height: 160px !important;
        max-height: 240px !important;
    }

    [ctype="listproduct"] .w-list-item,
    [ctype="listproduct"] .w-list-li {
        width: 100% !important;
        max-width: 100% !important;
    }

}

/* 桌面端隐藏移动端组件 */
@media (min-width: 992px) {
    .swyfy-mobile-header,
    .swyfy-mobile-nav,
    .swyfy-mobile-nav-backdrop {
        display: none !important;
    }
}
