/**
 * 多浏览器 / 手机微信内核适配
 * Chrome、Edge、微信内置浏览器、iOS Safari、Android WebView
 */
html {
    -ms-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
html,
body {
    max-width: 100%;
    overflow-x: hidden;
    overscroll-behavior-x: none;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}
img,
video {
    max-width: 100%;
}
#form-verify-img,
#user-verify-win-img,
#verify-img,
.form-verify img,
.am-position-verify img {
    max-width: none !important;
    width: 10rem !important;
    height: 3.1rem !important;
    display: block !important;
}
a,
button,
input,
select,
textarea,
.am-btn,
.goods-contact-factory-event {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.08);
    touch-action: manipulation;
}
input[type='text'],
input[type='password'],
input[type='search'],
input[type='tel'],
input[type='number'],
input[type='email'],
input[type='url'],
select,
textarea,
.am-form-field,
.am-form input[type='text'],
.am-form input[type='password'],
.am-form input[type='search'],
.am-form input[type='tel'],
.am-form input[type='number'],
.am-form input[type='email'] {
    -webkit-appearance: none;
    appearance: none;
}
.body-content-container {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: calc(var(--app-vh, 1vh) * 100);
}
.am-text-truncate-2,
.am-text-truncate-2-md,
.aggregation .outer-con .describe,
.module-goods-list-base .item .item-content .base-content .detail-content {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
}

/* aspect-ratio 回退 */
@supports not (aspect-ratio: 1 / 1) {
    .module-goods-grid-base .item a.goods-info {
        height: 0;
        padding-bottom: 100%;
    }
    .module-goods-grid-base .item a.goods-info .goods-images {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
    }
    .scoll .slider-content {
        height: 0;
        padding-bottom: 100%;
    }
    .scoll .slider-content .am-slider {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
    }
}

/* gap 回退 */
@supports not (gap: 1px) {
    .module-goods-grid-base .bottom-operate > * + * {
        margin-left: 0.8rem;
    }
    .goods-contact-factory-popover .factory-contact-item .value {
        margin-left: 0.4rem;
    }
}

.goods-contact-factory-mask {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1198;
    background: rgba(0, 0, 0, 0.45);
}
.goods-contact-factory-popover.is-sheet {
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: auto;
    max-width: 28rem;
    -webkit-transform: none !important;
    transform: none !important;
    padding: 0.8rem 1.2rem;
    border-radius: 0.4rem;
    box-shadow: 0 0.4rem 1.2rem rgba(0, 0, 0, 0.12);
}
.goods-contact-factory-popover.is-sheet:after {
    display: block;
}

/* 平板：Edge / Chrome / 微信 iPad */
@media only screen and (min-width: 641px) and (max-width: 1024px) {
    .shop-navigation {
        padding-top: 0;
    }
    .nav-search {
        padding-left: 1.2rem;
        padding-right: 1.2rem;
    }
    .nav-search .logo-big {
        width: 12rem;
        margin-right: 2rem;
    }
    .search-bar {
        width: calc(100% - 16rem);
        max-width: none;
    }
    .shop-navigation .am-topbar-nav {
        display: -webkit-box;
        display: -webkit-flex;
        display: flex;
        -webkit-flex-wrap: nowrap;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    .shop-navigation .am-topbar-nav > li {
        -webkit-flex-shrink: 0;
        flex-shrink: 0;
        float: none;
    }
    .floor .goods-list {
        width: 100%;
        float: none;
        padding-left: 0;
    }
    .floor .aggregation-container {
        width: 100%;
        margin: 0 0 1rem;
    }
    .banner .am-slider,
    .banner .am-slider .am-slides li,
    .banner .am-slider .am-slides li img {
        height: auto;
        max-height: 32rem;
    }
}

/* 手机：微信 / Chrome / Edge */
@media only screen and (max-width: 640px) {
    html,
    body {
        width: 100%;
    }
    body {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .am-container,
    .footer,
    .nav-table {
        width: 100%;
        max-width: 100%;
        padding-left: 1.2rem;
        padding-right: 1.2rem;
        box-sizing: border-box;
    }
    .header-top,
    .nav-search,
    .shop-navigation {
        width: 100%;
        max-width: 100%;
    }
    .header-top {
        padding-left: calc(1.2rem + env(safe-area-inset-left, 0px));
        padding-right: calc(1.2rem + env(safe-area-inset-right, 0px));
    }
    .shop-navigation .am-container {
        padding-left: calc(1.2rem + env(safe-area-inset-left, 0px));
        padding-right: calc(1.2rem + env(safe-area-inset-right, 0px));
        overflow: visible;
    }
    .shop-navigation {
        overflow: visible;
    }
    .mobile-search-wrap {
        width: 100%;
        max-width: 100%;
    }
    body.index-index-index .home-banner-wrap,
    body.index-index-index .slideall.am-container {
        padding-left: 1.2rem;
        padding-right: 1.2rem;
        box-sizing: border-box;
    }
    body.index-index-index .banner-mixed,
    body.index-index-index .banner-news {
        padding-left: 0;
        padding-right: 0;
        margin-left: 0;
    }
    body.index-index-index .banner-news-title {
        left: 0;
        padding-left: 0;
        margin-left: 0;
    }
    .shop-navigation .mobile-search-wrap .navigation-search {
        width: 100%;
        max-width: 100%;
    }
    .mobile-search-input {
        font-size: 16px !important;
        min-height: 3.6rem;
    }
    .search-bar input,
    #search-input {
        font-size: 16px !important;
    }
    .mobile-navigation {
        display: -webkit-box;
        display: -webkit-flex;
        display: flex;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-shadow: 0 -0.2rem 0.8rem rgba(0, 0, 0, 0.06);
    }
    .mobile-navigation li {
        -webkit-box-flex: 1;
        -webkit-flex: 1;
        flex: 1;
        float: none;
        width: auto;
        padding-top: 0.4rem;
        padding-bottom: 0.4rem;
    }
    .mobile-navigation li a {
        display: -webkit-box;
        display: -webkit-flex;
        display: flex;
        -webkit-box-orient: vertical;
        -webkit-flex-direction: column;
        flex-direction: column;
        -webkit-align-items: center;
        align-items: center;
        -webkit-justify-content: flex-start;
        justify-content: flex-start;
    }
    .mobile-navigation li a > i.iconfont {
        margin-top: -0.2rem;
        margin-bottom: 0.2rem;
        height: 2.2rem;
        line-height: 2.2rem;
        font-size: 2.2rem;
    }
    .mobile-navigation li a > p {
        margin: 0;
        line-height: 1.2;
        font-size: 1.1rem;
    }
    .index-user-index .user-menu,
    .user-main .user-menu,
    a.user-menu {
        bottom: calc(7.6rem + env(safe-area-inset-bottom, 0px)) !important;
        right: 1.2rem;
        z-index: 1015;
    }
    .index-goods-cartinfo .mobile-navigation,
    body.iframe-popup-page .mobile-navigation {
        display: none !important;
    }
    .index-goods-cartinfo .am-form-popup-fixed .am-form-popup-submit {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1030;
        text-align: right;
        padding: 1.2rem 1.5rem calc(1.2rem + env(safe-area-inset-bottom, 0px));
        background: #fff;
        border-top: 0.1rem solid #f5f5f5;
    }
    .am-footer {
        padding-bottom: calc(7.2rem + env(safe-area-inset-bottom, 0px));
    }
    .buy-nav {
        bottom: calc(4.8rem + env(safe-area-inset-bottom, 0px)) !important;
        padding-bottom: 0;
        box-shadow: 0 -0.2rem 0.8rem rgba(0, 0, 0, 0.06);
        z-index: 1030;
    }
    .buy-nav .nav-min-home-submit,
    .buy-nav .nav-icon-home {
        display: none !important;
    }
    .buy-nav .buy-nav-opt .nav-icon-favor {
        width: 100% !important;
    }
    .theme-popover-mask {
        z-index: 2100 !important;
    }
    .theme-popover {
        z-index: 2101 !important;
    }
    .theme-popover .btn-op {
        z-index: 2102 !important;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .buy-nav-footer {
        bottom: calc(4.8rem + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .cart-nav.am-box-shadow-top {
        margin-bottom: 0;
    }

    .module-goods-list-base .item {
        -webkit-flex-wrap: nowrap;
        flex-wrap: nowrap;
    }
    .module-goods-list-base .item .goods-info {
        width: 8.8rem;
        height: 8.8rem;
    }
    .module-goods-list-base .item .item-content .bottom-content {
        -webkit-flex-wrap: wrap;
        flex-wrap: wrap;
        row-gap: 0.6rem;
    }
    .module-goods-list-base .item .item-content .bottom-content .goods-contact-factory-wrap {
        position: static;
        left: auto;
        -webkit-transform: none;
        transform: none;
        width: 100%;
        order: 3;
        text-align: left;
        margin-top: 0.2rem;
    }
    .module-goods-grid-base .bottom-operate {
        -webkit-flex-wrap: wrap;
        flex-wrap: wrap;
        justify-content: flex-start;
        width: 100%;
    }
    .module-goods-grid-base .bottom-operate .goods-contact-factory-event,
    .module-goods-grid-base .bottom-operate .buy-btn {
        margin-top: 0.4rem;
    }
    .module-goods-grid-base .item .item-bottom {
        -webkit-flex-wrap: wrap;
        flex-wrap: wrap;
    }

    .search-subcate-wrap {
        padding: 0.8rem 1.2rem;
    }
    .search-subcate-nav {
        -webkit-flex-wrap: wrap;
        flex-wrap: wrap;
    }
    .search-subcate-nav > li > a {
        padding: 0.6rem 0.8rem !important;
    }
    .sort-nav {
        overflow: hidden;
        position: relative;
    }
    .search-nav .sort-nav > li {
        display: none !important;
    }
    .search-nav .sort-nav > li.sort-nav-mobile-back {
        display: -webkit-box !important;
        display: -webkit-flex !important;
        display: flex !important;
        -webkit-box-flex: 0;
        -webkit-flex: 0 0 auto;
        flex: 0 0 auto;
        width: auto;
        -webkit-justify-content: flex-start;
        justify-content: flex-start;
        -webkit-align-items: center;
        align-items: center;
        text-align: left;
        z-index: 1;
    }
    .search-nav .sort-nav > li.sort-nav-mobile-back a,
    .search-nav .sort-nav > li.sort-nav-mobile-back a:hover,
    .search-nav .sort-nav > li.sort-nav-mobile-back a:active {
        color: #1677ff !important;
        font-size: 1.5rem;
        text-decoration: none;
        width: auto;
        padding: 0 1.2rem;
        text-align: left;
        white-space: nowrap;
    }
    .search-nav .sort-nav > li.sort-nav-layout-mobile {
        display: flex !important;
        position: absolute !important;
        left: 50%;
        top: 50%;
        -webkit-transform: translate(-50%, -50%);
        transform: translate(-50%, -50%);
        float: none !important;
        width: auto;
        height: 4rem;
        z-index: 2;
        align-items: center;
        justify-content: center;
    }
    .search-nav .sort-nav > li.sort-nav-layout-mobile .layout-styles i {
        font-size: 2rem;
        color: #333;
    }
    .index-search-index .breadcrumb-data .am-breadcrumb > li.breadcrumb-pc-home {
        display: none !important;
    }
    .index-search-index .breadcrumb-data .am-breadcrumb > li.breadcrumb-mobile-cate {
        display: inline-flex !important;
    }
    .index-search-index .search-subcate-bar-main {
        display: none !important;
    }

    .category-list-container {
        width: 100%;
        overflow: hidden;
    }
    .category-list-container ul.category-nav {
        width: 8.8rem;
        height: calc(var(--app-vh, 1vh) * 100 - 18rem);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .category-list-container .category-content {
        width: calc(100% - 8.8rem);
        height: calc(var(--app-vh, 1vh) * 100 - 18rem);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .detail-content .content-web,
    .detail-content .content-app,
    .content-web.richtext {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        word-break: break-word;
        max-width: 100%;
    }
    .detail-content .content-web img,
    .detail-content .content-app img,
    .content-web.richtext img,
    .content-app.richtext img {
        max-width: 100% !important;
        height: auto !important;
    }
    .detail-content .content-web table,
    .content-web.richtext table {
        display: block;
        width: 100% !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .system-goods-detail .clearfix,
    .system-goods-detail .item-inform,
    .system-goods-detail .clearfix-left,
    .system-goods-detail .clearfix-right {
        width: 100% !important;
        max-width: 100%;
        float: none;
        margin: 0;
    }
    .system-goods-detail .box,
    .system-goods-detail .tb-booth {
        width: 100% !important;
        max-width: 100%;
    }
    .banner .am-slider .am-slides li img {
        width: 100%;
        height: auto;
        max-height: 22rem;
        object-fit: cover;
    }
    .slideall {
        padding-left: 1.2rem;
        padding-right: 1.2rem;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }
    .home-floor .floor {
        overflow: hidden;
    }
    .floor .aggregation-container,
    .floor .goods-list {
        width: 100%;
        float: none;
        margin-left: 0;
        padding-left: 0;
    }

    .am-modal-dialog,
    .am-popup-inner,
    .am-offcanvas-bar {
        max-width: 100%;
    }
    .am-table-scrollable-horizontal {
        height: auto !important;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .form-table-search .chosen-container {
        display: none !important;
    }
    .form-table-search select.chosen-select,
    .form-table-search select.form-table-search-native-select {
        display: block !important;
        position: static !important;
        left: auto !important;
        top: auto !important;
        width: 100% !important;
        min-width: 8.8rem;
        height: 3.4rem !important;
        max-height: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        -webkit-appearance: menulist;
        appearance: menulist;
        background-color: #fff;
        border: 0.1rem solid #eee;
        border-radius: 0.4rem;
        padding: 0 0.6rem;
        font-size: 1.3rem;
        line-height: 3.2rem;
        z-index: 8;
    }
    .cart-content {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .cart-content table {
        min-width: 100%;
    }
    .user-main,
    .user-content-body,
    #user-offcanvas {
        width: 100%;
        max-width: 100%;
        height: auto !important;
    }
    .parameters-factory-item {
        white-space: normal;
        height: auto;
    }
    .parameters-factory-value {
        word-break: break-all;
    }
}

/* 微信内置浏览器 */
html.is-weixin body {
    -webkit-overflow-scrolling: touch;
}
html.is-weixin img {
    -webkit-touch-callout: none;
}
html.is-weixin a[target="_blank"] {
    cursor: pointer;
}

/* 登录/注册图形验证码：避免被全局 img max-width、overflow-x 裁掉 */
.am-form-input-material .am-position-verify {
    right: 0 !important;
    width: 10rem !important;
    height: 3.1rem !important;
    z-index: 5 !important;
    overflow: visible !important;
}

/* Edge / Chrome 滚动条与弹性盒 */
html.is-edge .am-topbar-nav,
html.is-chrome .am-topbar-nav {
    scrollbar-width: thin;
}
html.is-edge .search-bar form .search-group,
html.is-chrome .search-bar form .search-group {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: stretch;
    align-items: stretch;
}
