.first {
    position: relative;
    width: 100%;
    max-width: 19.2rem;
    height: 8rem;
    margin: 0 auto;
    background: #1a1a1a url('../assets/images/product/first-img.webp') no-repeat center / cover;
    box-sizing: border-box;
    padding: 0 1.6rem;
    color: #FFF;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.first__content {
    flex: 1;
    min-width: 0;
}

.first__title {
    color: #FFF;
    font-family: Montserrat, sans-serif;
    font-size: 0.44rem;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    text-transform: capitalize;
    margin: 0 0 0.24rem;
}

.first__desc {
    color: #FFF;
    font-family: Montserrat, sans-serif;
    font-size: 0.16rem;
    font-style: normal;
    font-weight: 300;
    line-height: normal;
    text-transform: capitalize;
    margin: 0;
}

.first__breadcrumb {
    position: absolute;
    left: 1.6rem;
    bottom: 0.30rem;
    color: #FFF;
    font-family: Montserrat, sans-serif;
    font-size: 0.18rem;
    font-style: normal;
    font-weight: 300;
    line-height: normal;
    text-transform: capitalize;
    display: flex;
    align-items: center;
    gap: 0.10rem;
    margin: 0;
    padding: 0;
}

.first__breadcrumb a {
    color: #FFF;
    text-decoration: none;
    transition: opacity 0.25s ease;
}

.first__breadcrumb a:hover {
    opacity: 0.75;
}

.first__breadcrumb-sep {
    color: #FFF;
    opacity: 0.85;
}

.first__breadcrumb-current {
    color: #FFF;
}

/* ============================================================
   Products 第二屏：分类侧边栏 + 产品网格 + 分页器
   ============================================================ */
.second {
    width: 100%;
    max-width: 19.2rem;
    margin: 0 auto;
    background: url('../assets/images/product/second-img.webp') no-repeat center / cover;
    padding: 0.6rem 1.6rem 1.2rem;
    box-sizing: border-box;
}

.second__inner {
    max-width: 16.5rem;
    margin: 0 auto;
}

.second__layout {
    display: flex;
    align-items: flex-start;
    gap: 0.3rem;
}

/* ---------- 左侧分类树（最多三级，结构可递归） ---------- */
.second__categories {
    width: 3.9rem;
    flex-shrink: 0;
}

.second__cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.16rem;
}

.second__cat {
    list-style: none;
}

/* 一级节点头：沿用大卡片样式 */
.second__cat-list > .second__cat > .second__cat-head {
    display: flex;
    align-items: center;
    gap: 0.06rem;
    width: 100%;
    height: 0.9rem;
    background: #FFF;
    border-radius: 0.04rem;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
    padding: 0 0.24rem;
    box-sizing: border-box;
    border-left: 0.025rem solid #BFBFBF;
}

.second__cat-list > .second__cat > .second__cat-head img {
    width: 0.5rem;
    height: 0.5rem;
    object-fit: contain;
    display: block;
}

.second__cat-list > .second__cat > .second__cat-head a {
    color: #999;
    font-family: Inter, sans-serif;
    font-size: 0.2rem;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
    text-transform: capitalize;
    text-decoration: none;
    transition: color 0.3s ease;
}

/* 一级：hover / 展开 / 选中均为蓝底白字 */
.second__cat-list > .second__cat > .second__cat-head:hover,
.second__cat-list > .second__cat.is-open > .second__cat-head,
.second__cat-list > .second__cat.is-active > .second__cat-head {
    background: #02347D;
}

.second__cat-list > .second__cat > .second__cat-head:hover a,
.second__cat-list > .second__cat.is-open > .second__cat-head a,
.second__cat-list > .second__cat.is-active > .second__cat-head a {
    color: #FFF;
}

/* 子级列表：展开/收起过渡；不做缩进，用灰色容器底 + 行样式 + 圆点区分层级。
   收起时 padding 一并归零，避免 max-height:0 仍露出一截内容 */
.second__cat-children {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.06rem;
    background: #F4F6F9;
    max-height: 0;
    overflow: hidden;
    box-sizing: border-box;
    transition: max-height 0.35s ease, padding 0.35s ease;
}

.second__cat.is-open > .second__cat-children {
    max-height: 9.6rem;
    padding: 0.1rem;
}

/* 二级/三级节点头：统一白底行 */
.second__cat-children > .second__cat > .second__cat-head {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 0.52rem;
    background: #FFF;
    border-radius: 0.03rem;
    cursor: pointer;
    padding: 0.05rem 0.16rem;
    box-sizing: border-box;
    transition: background 0.25s ease, color 0.25s ease;
}

.second__cat-children > .second__cat > .second__cat-head a {
    color: #333;
    font-family: Inter, sans-serif;
    font-size: 0.17rem;
    font-style: normal;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    transition: color 0.25s ease;
}

.second__cat-children > .second__cat > .second__cat-head:hover {
    background: #E8EEF7;
}

.second__cat-children > .second__cat > .second__cat-head:hover a {
    color: #02347D;
}

/* 展开中的二级父节点：蓝字提示 */
.second__cat-children > .second__cat.is-open > .second__cat-head a {
    color: #02347D;
}

/* 选中优先于展开：蓝底白字（避免 is-open 的蓝字规则盖住） */
.second__cat-children > .second__cat.is-active > .second__cat-head a {
    color: #FFF;
}

/* 选中项不做悬浮变色，保持蓝底白字 */
.second__cat-children > .second__cat.is-active > .second__cat-head:hover {
    background: #02347D;
}

.second__cat-children > .second__cat.is-active > .second__cat-head:hover a {
    color: #FFF;
}

/* 三级：更小字号 + 前缀圆点区分层级（不缩进） */
.second__cat-children .second__cat-children .second__cat-head {
    position: relative;
    min-height: 0.42rem;
    padding-left: 0.26rem;
}

.second__cat-children .second__cat-children .second__cat-head::before {
    content: '';
    position: absolute;
    left: 0.12rem;
    top: 50%;
    margin-top: -0.025rem;
    width: 0.05rem;
    height: 0.05rem;
    border-radius: 50%;
    background: #C0C6D0;
}

.second__cat-children .second__cat-children .second__cat-head a {
    font-size: 0.15rem;
    font-weight: 500;
    color: #666;
}

.second__cat-children .second__cat-children .second__cat-head:hover::before {
    background: #02347D;
}

/* 叶子选中：蓝底白字（与一级选中一致） */
.second__cat.is-active > .second__cat-head {
    background: #02347D;
}

.second__cat.is-active > .second__cat-head a {
    color: #FFF;
}

.second__cat.is-active > .second__cat-head .second__cat-arrow {
    color: #FFF;
}

/* 展开箭头：仅父级节点输出 */
.second__cat-arrow {
    width: 0.08rem;
    height: 0.08rem;
    margin-left: auto;
    flex-shrink: 0;
    border-right: 0.015rem solid currentColor;
    border-bottom: 0.015rem solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.3s ease, color 0.3s ease;
    color: #999;
}

.second__cat.is-open > .second__cat-head .second__cat-arrow {
    transform: rotate(225deg);
}

.second__cat-list > .second__cat > .second__cat-head:hover .second__cat-arrow,
.second__cat-list > .second__cat.is-open > .second__cat-head .second__cat-arrow,
.second__cat-list > .second__cat.is-active > .second__cat-head .second__cat-arrow {
    color: #FFF;
}

/* ---------- 右侧产品区 ---------- */
.second__main {
    flex: 1;
    min-width: 0;
}

/* ---------- 产品网格（首页第二屏样式，3 列） ---------- */
.second__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.24rem;
}

/* 分类切换时的卡片入场动效：display:none → 显示时会自动重播 */
@keyframes cardFadeUp {
    from {
        opacity: 0;
        transform: translateY(0.2rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.second__card {
    display: block;
    color: inherit;
    text-decoration: none;
    background: #FFF;
    border-radius: 0.04rem;
    overflow: hidden;
    box-shadow: 0 0.02rem 0.08rem rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    padding: 0.16rem 0.24rem;
    animation: cardFadeUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

/* 交错的动画延迟由 product.js 按显示顺序写入，此处不设固定 delay */

@media (prefers-reduced-motion: reduce) {
    .second__card {
        animation: none;
    }
}

.second__card:hover {
    transform: translateY(-0.04rem);
    box-shadow: 0 0.06rem 0.2rem rgba(0, 0, 0, 0.1);
}

.second__card-img {
    height: 3.34rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.second__card-img img {
    width: 3.34rem;
    height: 3.34rem;
    object-fit: contain;
    display: block;
}

.second__card-title {
    color: #333;
    font-family: Inter, sans-serif;
    font-size: 0.2rem;
    font-style: normal;
    font-weight: 500;
    line-height: normal;
    margin-bottom: 0.14rem;
    text-overflow: ellipsis;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.second__card-divider {
    height: 0.01rem;
    background: #DFDFDF;
    margin-bottom: 0.14rem;
}

.second__card-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.second__card-action span {
    color: #666;
    font-family: Inter, sans-serif;
    font-size: 0.18rem;
    font-style: normal;
    font-weight: 500;
    line-height: normal;
    transition: color 0.3s ease;
}

.second__card-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 0.34rem;
    height: 0.34rem;
    background: #CACACA;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.second__card-icon-wrap img {
    width: 0.12rem;
    height: 0.07rem;
    display: block;
}

.second__card-icon-wrap img.second__card-icon-hover {
    display: none;
}

.second__card:hover .second__card-icon-wrap img.second__card-icon {
    display: none;
}

.second__card:hover .second__card-icon-wrap img.second__card-icon-hover {
    display: block;
}

.second__card:hover .second__card-icon-wrap {
    background: #02347D;
}

.second__card:hover .second__card-action span {
    color: #02347D;
}

/* ---------- H5 适配 ---------- */
html[data-mode="h5"] .second {
    padding: 0.4rem 0.3rem 0.6rem;
}

html[data-mode="h5"] .second__layout {
    flex-direction: column;
    gap: 0.3rem;
}

/* 左侧分类树 H5：纵向全宽手风琴（简单处理） */
html[data-mode="h5"] .second__categories {
    width: 100%;
}

html[data-mode="h5"] .second__cat-list {
    gap: 0.12rem;
}

html[data-mode="h5"] .second__cat-list > .second__cat > .second__cat-head {
    height: 0.7rem;
}

html[data-mode="h5"] .second__cat-list > .second__cat > .second__cat-head img {
    width: 0.4rem;
    height: 0.4rem;
}

html[data-mode="h5"] .second__cat-list > .second__cat > .second__cat-head a {
    font-size: 0.16rem;
}

html[data-mode="h5"] .second__cat-children > .second__cat > .second__cat-head {
    min-height: 0.4rem;
}

html[data-mode="h5"] .second__cat.is-open > .second__cat-children {
    max-height: 12rem;
    padding: 0.08rem;
}

html[data-mode="h5"] .second__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.16rem;
}

html[data-mode="h5"] .second__card-img {
    height: 1.8rem;
}

html[data-mode="h5"] .second__card-img img {
    width: 1.8rem;
    height: 1.8rem;
}

html[data-mode="h5"] .second__card-title {
    font-size: 0.18rem;
}

html[data-mode="h5"] .second__card-action span {
    font-size: 0.16rem;
}

html[data-mode="h5"] .second__card-icon-wrap {
    width: 0.3rem;
    height: 0.3rem;
}

/* ---------- 首屏 Banner H5 适配 ---------- */
html[data-mode="h5"] .first {
    height: 4.4rem;
    padding: 0 0.3rem;
}

html[data-mode="h5"] .first__title {
    font-size: 0.36rem;
    margin-bottom: 0.16rem;
}

html[data-mode="h5"] .first__desc {
    font-size: 0.14rem;
    max-width: 100%;
}

html[data-mode="h5"] .first__breadcrumb {
    left: 0.3rem;
    bottom: 0.2rem;
    font-size: 0.14rem;
    gap: 0.06rem;
}