/* products — 全部限定 body.page-h5.page-products，不影响 PC */
@media (max-width: 992px) {
  /* 底部 Tabbar 固定定位，留白放在内容区底部，不再靠 --h5-main-h 锁高度 */
  body.page-h5.page-products {
    padding-bottom: 0;
  }

  body.page-h5.page-products .products-main.page-main {
    display: flex;
    flex-direction: column;
    margin-top: calc(var(--h5-header) + var(--h5-safe-top));
    height: auto;
    max-height: none;
    overflow: visible;
  }

  /* 顶部 Banner：高度随标题+描述内容撑开，不再固定 348px */
  body.page-h5.page-products .cp-banner {
    flex-shrink: 0;
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;
    max-height: none;
  }

  body.page-h5.page-products .cp-banner-img {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    object-fit: cover;
  }

  body.page-h5.page-products .cp-banner-inner {
    height: auto;
    min-height: 0;
    padding: 24px 15px 20px;
    box-sizing: border-box;
  }

  /* 硬件区：grid 布局；软件区单独样式，避免 .cp-body 共用导致软件内容被隐藏/错位 */
  body.page-h5.page-products .cp-body--hardware {
    flex: 1;
    display: grid;
    grid-template-columns: calc(360 / 1080 * 100vw) minmax(0, 1fr);
    align-items: start;
    gap: 0;
    width: 100%;
    max-width: none;
    margin: 0 0 calc(var(--h5-tabbar) + var(--h5-safe-bottom) + 16px);
    padding: 30px 0 16px;
    min-height: 0;
    height: auto;
    overflow: visible;
    box-sizing: border-box;
  }

  body.page-h5.page-products .cp-body--software {
    display: none;
    flex: none;
    align-self: flex-start;
    width: 100%;
    min-height: 0;
    margin: 0 0 calc(var(--h5-tabbar) + var(--h5-safe-bottom) + 16px);
    padding: 30px 15px 20px;
    box-sizing: border-box;
  }

  body.page-h5.page-products .products-main[data-cp-type="software"] .cp-body--hardware {
    display: none;
  }

  body.page-h5.page-products .products-main[data-cp-type="software"] .cp-body--software {
    display: block;
  }

  body.page-h5.page-products .products-main[data-cp-type="hardware"] .cp-body--hardware {
    display: grid;
  }

  /* 软件平台 Banner：保留图片+标题，仅隐藏描述小字 */
  body.page-h5.page-products .products-main[data-cp-type="software"] .cp-banner-desc--software {
    display: none;
  }

  body.page-h5.page-products .products-main[data-cp-type="software"] .cp-banner-inner {
    padding: 20px 15px 12px;
  }

  /* H5：cp-wrap 不参与布局（PC 仍作内部滚动容器）；软件模式整层隐藏 */
  body.page-h5.page-products .cp-wrap {
    display: contents;
  }

  body.page-h5.page-products #cp-type-software:checked ~ .cp-wrap,
  body.page-h5.page-products .products-main[data-cp-type="software"] .cp-wrap {
    display: none;
  }

  /* 二级分类：距左 36px；整列相对产品区垂直居中，滚动时 sticky 固定 */
  body.page-h5.page-products .cp-categories-wrap {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    position: sticky;
    top: 16px;
    z-index: 2;
    margin: 0;
    padding: 0 0 0 calc(40 / 1080 * 100vw);
    box-sizing: border-box;
  }

  body.page-h5.page-products .cp-main {
    grid-column: 2;
    grid-row: 1;
    flex: none;
    width: auto;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 0 calc(30 / 1080 * 100vw) 0 0;
    padding-top: 0;
    overflow-x: visible;
    overflow-y: visible;
  }

  body.page-h5.page-products #cp-cat-v:checked ~ .cp-main,
  body.page-h5.page-products #cp-cat-iii:checked ~ .cp-main,
  body.page-h5.page-products #cp-cat-ii:checked ~ .cp-main,
  body.page-h5.page-products #cp-cat-i:checked ~ .cp-main,
  body.page-h5.page-products #cp-cat-huawei:checked ~ .cp-main,
  body.page-h5.page-products #cp-cat-cabinet:checked ~ .cp-main {
    width: auto;
    min-width: 0;
    max-width: none;
  }

  body.page-h5.page-products .cp-products.cp-products--5 {
    width: 100%;
    min-width: 0;
  }

  body.page-h5.page-products .cp-categories {
    flex: 0 0 calc(238 / 1080 * 100vw);
    width: calc(238 / 1080 * 100vw);
    min-width: calc(238 / 1080 * 100vw);
    max-width: calc(238 / 1080 * 100vw);
    flex-shrink: 0;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: calc(16 / 1080 * 100vw);
    margin: 0;
    padding: 0;
  }

  body.page-h5.page-products .cp-categories li {
    width: calc(238 / 1080 * 100vw);
    flex: none;
  }

  body.page-h5.page-products .cp-category {
    width: calc(238 / 1080 * 100vw);
    min-width: calc(238 / 1080 * 100vw);
    max-width: calc(238 / 1080 * 100vw);
    height: calc(82 / 1080 * 100vw);
    min-height: calc(82 / 1080 * 100vw);
    max-height: calc(82 / 1080 * 100vw);
    flex: none;
    padding: 0 2px;
    font-size: clamp(14px, calc(28 / 1080 * 100vw), 16px);
    line-height: 1.25;
    border-radius: 6px;
    box-sizing: border-box;
    justify-content: center;
    gap: 0;
  }

  body.page-h5.page-products .cp-category[for="cp-cat-huawei"],
  body.page-h5.page-products .cp-category[for="cp-cat-cabinet"] {
    height: calc(98 / 1080 * 100vw);
    min-height: calc(98 / 1080 * 100vw);
    max-height: calc(98 / 1080 * 100vw);
  }

  body.page-h5.page-products .cp-category-name {
    display: block;
    width: 100%;
    text-align: center;
    font-size: inherit;
    line-height: inherit;
  }

  body.page-h5.page-products #cp-cat-v:checked ~ .cp-categories-wrap .cp-category[for="cp-cat-v"],
  body.page-h5.page-products #cp-cat-iii:checked ~ .cp-categories-wrap .cp-category[for="cp-cat-iii"],
  body.page-h5.page-products #cp-cat-ii:checked ~ .cp-categories-wrap .cp-category[for="cp-cat-ii"],
  body.page-h5.page-products #cp-cat-i:checked ~ .cp-categories-wrap .cp-category[for="cp-cat-i"],
  body.page-h5.page-products #cp-cat-huawei:checked ~ .cp-categories-wrap .cp-category[for="cp-cat-huawei"],
  body.page-h5.page-products #cp-cat-cabinet:checked ~ .cp-categories-wrap .cp-category[for="cp-cat-cabinet"] {
    font-weight: 700;
    height: calc(82 / 1080 * 100vw);
    min-height: calc(82 / 1080 * 100vw);
    max-height: calc(82 / 1080 * 100vw);
    padding: 0 2px 2px;
    justify-content: flex-end;
    gap: 2px;
  }

  body.page-h5.page-products #cp-cat-huawei:checked ~ .cp-categories-wrap .cp-category[for="cp-cat-huawei"],
  body.page-h5.page-products #cp-cat-cabinet:checked ~ .cp-categories-wrap .cp-category[for="cp-cat-cabinet"] {
    height: calc(98 / 1080 * 100vw);
    min-height: calc(98 / 1080 * 100vw);
    max-height: calc(98 / 1080 * 100vw);
  }

  body.page-h5.page-products .cp-category-line {
    width: clamp(96px, calc(200 / 1080 * 100vw), 112px);
    height: 2px;
    flex-shrink: 0;
  }

  body.page-h5.page-products .cp-tabs-wrap {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 12px auto;
    padding: 0 15px;
    box-sizing: border-box;
  }

  /* 硬件产品 / 软件平台：整组水平居中，两项等宽 */
  body.page-h5.page-products .cp-type-tabs {
    display: flex;
    justify-content: center;
    align-items: stretch;
    width: calc(828 / 1080 * 100vw);
    max-width: calc(100% - 30px);
    margin: 0 auto;
    height: 56px;
    gap: calc(20 / 1080 * 100vw);
    padding: 0;
    list-style: none;
    box-sizing: border-box;
  }

  body.page-h5.page-products .cp-type-tabs li {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
    padding: 0;
  }

  body.page-h5.page-products .cp-type-tab {
    width: 100%;
    flex: 1 1 auto;
    min-width: 0;
    height: 56px;
    font-size: 16px;
    padding-bottom: 6px;
  }

  body.page-h5.page-products .cp-type-tab-icon {
    width: 24px;
    height: 24px;
  }

  body.page-h5.page-products .cp-type-tab-line {
    width: min(160px, 70%);
  }

  body.page-h5.page-products .cp-products {
    width: 100%;
    min-width: 0;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  body.page-h5.page-products .cp-product {
    width: 100%;
    min-height: 0;
    flex-direction: row;
    align-items: flex-start;
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
    list-style: none;
  }

  body.page-h5.page-products .cp-product-pic {
    width: calc(270 / 1080 * 100vw);
    min-height: calc(176 / 1080 * 100vw);
    height: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: calc(8 / 1080 * 100vw);
    box-sizing: border-box;
  }

  body.page-h5.page-products .cp-product-pic img {
    width: 100%;
    max-height: calc(144 / 1080 * 100vw);
    object-fit: contain;
  }

  body.page-h5.page-products .cp-product-pic h3 {
    margin: 4px 0 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    color: #333;
    white-space: normal;
  }

  body.page-h5.page-products .cp-product-info {
    flex: 1;
    min-width: 0;
    padding: 10px 10px 10px 0;
  }

  body.page-h5.page-products .cp-product-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    min-height: 0;
    justify-content: flex-start;
  }

  body.page-h5.page-products .cp-product-pic .cp-product-head {
    width: 100%;
    margin: 4px 0 0;
    gap: 6px;
  }

  body.page-h5.page-products .cp-product-pic .cp-product-head h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    color: #333;
    white-space: normal;
  }

  body.page-h5.page-products .cp-product-pic .cp-product-badge {
    padding: 0 4px;
    font-size: 11px;
    line-height: 16px;
  }

  body.page-h5.page-products .cp-product-series-block + .cp-product-models,
  body.page-h5.page-products .cp-product-series-block + .cp-product-models-block {
    margin-top: 8px;
  }

  body.page-h5.page-products .cp-product-label,
  body.page-h5.page-products .cp-product-item-btn {
    font-size: 12px;
  }

  /* 型号/系列：空间不足时自动换行，禁止右侧裁切 */
  body.page-h5.page-products .cp-product-body,
  body.page-h5.page-products .cp-product-info {
    overflow: visible;
  }

  body.page-h5.page-products .cp-product-series,
  body.page-h5.page-products .cp-product-series-block,
  body.page-h5.page-products .cp-product-models-block {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    width: 100%;
    min-width: 0;
  }

  body.page-h5.page-products .cp-product-label {
    width: auto;
    height: auto;
    flex-shrink: 0;
  }

  body.page-h5.page-products .cp-product-series-list,
  body.page-h5.page-products .cp-product-models,
  body.page-h5.page-products .cp-product-model-rows {
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
  }

  body.page-h5.page-products .cp-product-models-block .cp-product-label,
  body.page-h5.page-products .cp-product-series-block .cp-product-label {
    flex: 0 0 auto;
  }

  body.page-h5.page-products .cp-product-models-block .cp-product-model-rows,
  body.page-h5.page-products .cp-product-series-block .cp-product-series-list {
    flex: 1 1 0;
    min-width: 0;
    max-width: calc(100% - 52px);
  }

  body.page-h5.page-products .cp-product-model {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    width: 100%;
    min-width: 0;
  }

  body.page-h5.page-products .cp-product-model-items {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 4px 8px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  body.page-h5.page-products .cp-product-model .cp-product-item-btn,
  body.page-h5.page-products .cp-product-model-items .cp-product-item-btn {
    flex: 0 1 auto;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
    text-align: left;
  }

  /* 配套机柜颜色：标签一行、色块换行，避免右侧被裁切 */
  body.page-h5.page-products .cp-product-colors {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 4px 0;
    width: 100%;
    min-width: 0;
    margin: 8px 0 0;
    overflow: visible;
  }

  body.page-h5.page-products .cp-product-models + .cp-product-colors,
  body.page-h5.page-products .cp-product-series + .cp-product-colors,
  body.page-h5.page-products .cp-product-series-block + .cp-product-colors {
    margin-top: 8px;
  }

  body.page-h5.page-products .cp-product-colors .cp-product-label {
    flex: 0 0 auto;
    width: 100%;
  }

  body.page-h5.page-products .cp-product-color-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0 0 0 52px;
    list-style: none;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: visible;
  }

  body.page-h5.page-products .cp-product-color-btn {
    flex-shrink: 0;
    width: 34px;
    height: 20px;
  }

  body.page-h5.page-products .cp-product-color-btn span {
    width: 30px;
    height: 16px;
  }

  body.page-h5.page-products .cp-soft-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 0 0 20px;
    list-style: none;
    box-sizing: border-box;
  }

  body.page-h5.page-products .cp-soft-item {
    width: 100%;
    height: 136px;
    border-radius: 8px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    box-sizing: border-box;
  }

  body.page-h5.page-products .cp-soft-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 10px 10px 8px;
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
  }

  body.page-h5.page-products .cp-soft-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    color: #C8CED6;
  }

  body.page-h5.page-products .cp-soft-line {
    width: 72px;
    height: 3px;
    margin: 6px auto 0;
    flex-shrink: 0;
  }

  /* 设计稿无描述小字，HTML 保留供 PC/后端 */
  body.page-h5.page-products .cp-soft-desc {
    display: none;
  }

  body.page-h5.page-products .cp-soft-more {
    align-self: flex-start;
    margin-top: auto;
    font-size: 11px;
    line-height: 1;
    color: #E10600;
  }

  body.page-h5.page-products .cp-soft-more::after {
    content: " ↗";
  }

  body.page-h5.page-products .cp-modal.is-open {
    align-items: center;
    padding: 60px 12px 48px;
  }

  body.page-h5.page-products .cp-modal-box {
    width: 100%;
    max-width: 100%;
    max-height: none;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  body.page-h5.page-products .cp-modal-panel,
  body.page-h5.page-products .cp-modal-panel.active,
  body.page-h5.page-products .cp-modal-body {
    width: 100%;
  }

  body.page-h5.page-products .cp-modal-panel.active .cp-modal-body {
    flex-direction: column;
    gap: 12px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    box-sizing: border-box;
    overflow: visible;
  }

  body.page-h5.page-products .cp-modal-panel.active .cp-modal-gallery {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  body.page-h5.page-products .cp-modal-panel.active .cp-modal-detail {
    display: none;
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 0;
    padding: 12px;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
  }

  body.page-h5.page-products .cp-modal-panel.active.is-specs .cp-modal-gallery {
    display: none;
  }

  body.page-h5.page-products .cp-modal-panel.active.is-specs .cp-modal-detail {
    display: flex;
    flex-direction: column;
    min-height: max(240px, 48vh);
    max-height: 65vh;
    height: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  }

  /* 仅大图区白底卡片，缩略图各自独立白底，外层透明 */
  body.page-h5.page-products .cp-modal-main {
    flex-shrink: 0;
    width: 100%;
    height: 48vh;
    min-height: 240px;
    background: #fff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
  }

  body.page-h5.page-products .cp-modal-thumbs {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 2px 0 4px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  body.page-h5.page-products .cp-modal-thumbs::-webkit-scrollbar {
    display: none;
  }

  body.page-h5.page-products .cp-modal-thumb {
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
  }

  body.page-h5.page-products .cp-modal-thumb button {
    width: 56px;
    height: 56px;
    padding: 3px;
    border: 2px solid transparent;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
  }

  body.page-h5.page-products .cp-modal-thumb.active button {
    border-color: #E10600;
  }

  body.page-h5.page-products .cp-modal-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  body.page-h5.page-products .cp-modal-head {
    gap: 10px;
    flex-wrap: wrap;
  }

  body.page-h5.page-products .cp-modal-title {
    font-size: 18px;
    line-height: 24px;
  }

  body.page-h5.page-products .cp-modal-subtitle {
    font-size: 14px;
    line-height: 20px;
  }

  body.page-h5.page-products .cp-modal-specs {
    min-height: 0;
  }

  body.page-h5.page-products .cp-modal-spec-col {
    display: block;
    flex: 1 1 0;
    min-width: 0;
    column-count: auto;
    column-gap: 0;
    width: auto;
    height: auto;
  }

  body.page-h5.page-products .cp-modal-spec-col li {
    width: auto;
    max-width: none;
    box-sizing: border-box;
    margin-left: 0;
    padding: 0 8px 0 14px;
    list-style-position: outside;
    font-size: 12px;
    line-height: 20px;
    break-inside: auto;
  }

  /* 单个规格列表才拆为左右两列；已有两个 ul 的产品保持一边一个列表。 */
  body.page-h5.page-products .cp-modal-specs > .cp-modal-spec-col:only-child {
    display: flex;
    flex: 0 0 100%;
    flex-wrap: wrap;
    align-content: flex-start;
    width: 100%;
    gap: 4px 0;
  }

  body.page-h5.page-products .cp-modal-specs > .cp-modal-spec-col:only-child li {
    flex: 0 0 50%;
    width: 50%;
    max-width: 50%;
  }

  body.page-h5.page-products .cp-modal-spec-col--tall {
    height: auto;
  }

  body.page-h5.page-products .cp-modal-group-tabs {
    width: 100%;
    max-width: 257px;
  }

  body.page-h5.page-products .cp-modal-mode {
    display: flex;
    flex-shrink: 0;
    width: 100%;
    max-width: 280px;
    height: 40px;
    margin-top: 12px;
    padding: 0;
    gap: 0;
    background: #fff;
    border-radius: 20px;
    box-sizing: border-box;
    overflow: hidden;
  }

  body.page-h5.page-products .cp-modal-mode-btn {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 8px;
    border: 0;
    border-radius: 20px;
    background: transparent;
    font-family: "Alibaba PuHuiTi", "Microsoft YaHei", sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1;
    color: #8F8F8F;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  body.page-h5.page-products .cp-modal-mode-btn.active {
    background: linear-gradient(180deg, #F25458 12.02%, #C10014 69.23%);
    opacity: 0.9;
    color: #fff;
  }
}
