.first {
    position: relative;
    height: 6rem;
    overflow: hidden;
    background: url("../assets/images/products/products.webp") center / cover no-repeat;
}

.first__inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    height: 100%;
    padding: 0 1.6rem 0.87rem;
}

/* ---------- 入场动画 ---------- */
@keyframes first-hero-in {
    from {
        opacity: 0;
        transform: translateY(0.3rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.first__badge,
.first__title,
.first__desc {
    opacity: 0;
    animation: first-hero-in 0.7s var(--ease-out) forwards;
}

.first__badge {
    animation-delay: 0.1s;
}

.first__title {
    animation-delay: 0.25s;
}

.first__desc {
    animation-delay: 0.4s;
}

/* ---------- 徽标胶囊 ---------- */
.first__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0.81rem;
    height: 0.34rem;
    border: 0.01rem solid rgba(255, 255, 255, 0.5);
    border-radius: 1rem;
    color: #fff;
    font-size: 0.16rem;
    font-weight: 500;
}

/* ---------- 标题 / 描述 ---------- */
.first__title {
    max-width: 10.14rem;
    margin-top: 0.2rem;
    color: #fff;
    font-size: 0.48rem;
    font-weight: 600;
    line-height: 1.2;
}

.first__desc {
    max-width: 9.36rem;
    margin-top: 0.23rem;
    color: #fff;
    font-size: 0.16rem;
    font-weight: 500;
    line-height: 1.5;
}

html[data-mode="h5"] .first {
    height: auto;
    min-height: 3.6rem;
}

html[data-mode="h5"] .first__inner {
    max-width: none;
    padding: 1.1rem 0.4rem 0.6rem;
    height: 5rem;
}

html[data-mode="h5"] .first__badge {
    min-width: max-content;
    padding: 0 0.2rem;
    height: 0.48rem;
    font-size: 0.32rem;
}

html[data-mode="h5"] .first__title {
    max-width: 100%;
    margin-top: 0.24rem;
    font-size: 0.44rem;
}

html[data-mode="h5"] .first__desc {
    max-width: 100%;
    margin-top: 0.24rem;
    font-size: 0.32rem;
    display: none;
}

/* ============================================================
   第二屏：产品分类（设计稿 279_1483）
   - 1920 基准：内边距 0.6rem / 1.6rem
   - 侧边栏 365：标题行 76 + 4 个分类项 70（间距 16）
   - 选中态：#0265B2 蓝底白字 600；未选中：白底左描边 #E5E5E5 灰字
   - 入场：复用 common.js data-reveal，标题→分类项错峰上浮
   - 悬浮：左描边变蓝 + 淡蓝底 + 右移 + 箭头右移（选中项除外）
   ============================================================ */
.second {
    padding: 0.6rem 1.6rem;
    background: hsl(196.3636deg 73.3333% 97.0588%);
}

.second__inner {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    /* 65px：侧边栏与产品列表间距 */
}

/* ---------- 侧边栏 ---------- */
.sidebar {
    flex: 0 0 3.65rem;
}

.sidebar__title {
    display: flex;
    align-items: center;
    height: 0.76rem;
    padding: 0 0.24rem;
    background: #fff;
    color: #333;
    font-size: 0.24rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 0.16rem;
}

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

/* ---------- 分类项 ---------- */
.sidebar__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.12rem;
    height: 0.7rem;
    padding: 0 0.24rem;
    box-sizing: border-box;
    background: #fff;
    border-left: 0.03rem solid #E5E5E5;
    color: #666;
    font-size: 0.2rem;
    font-weight: 400;
    line-height: 1.4;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease,
        transform 0.3s var(--ease-out), box-shadow 0.3s ease;
}

.sidebar__arrow {
    display: block;
    flex: 0 0 auto;
    width: 0.2rem;
    height: 0.2rem;
    color: #666;
    transition: color 0.3s ease, transform 0.3s var(--ease-out);
}

.sidebar__arrow path {
    stroke: currentColor;
}

/* ---------- 个性化悬浮动效（未选中项）：左描边点亮 + 淡蓝底 + 右移 + 箭头右移 ---------- */
.sidebar__link:not(.is-active):hover {
    background: #F4F7FD;
    border-left-color: #0265B2;
    color: #0265B2;
    transform: translateX(0.06rem);
    box-shadow: 0 0.06rem 0.16rem rgba(2, 101, 178, 0.12);
}

.sidebar__link:not(.is-active):hover .sidebar__arrow {
    color: #0265B2;
    transform: translateX(0.04rem);
}

.sidebar__link:not(.is-active):focus-visible {
    outline: 0.02rem solid #0265B2;
    outline-offset: 0.02rem;
}

/* ---------- 选中态：蓝底白字 ---------- */
.sidebar__link.is-active {
    background: #0265B2;
    border-left-color: transparent;
    color: #fff;
    font-weight: 600;
}

.sidebar__link.is-active .sidebar__arrow {
    color: #fff;
}

/* ---------- 右：产品列表区 ---------- */
.second__content {
    flex: 1 1 auto;
    min-width: 0;
}

/* ============================================================
   产品列表（设计稿 279_1488）
   - 3 列网格，列距 30 / 行距 40；卡片 370×440（图 258 + 信息区 182）
   - 信息区：标题 20/600 #333，描述 16/500 #666（两行截断），蓝圆↗图标
   - 第 9 格 CTA 卡：白底居中文案
   - 入场：data-reveal 错峰淡入上浮（延迟见 HTML data-reveal-delay）
   - 悬浮：卡片上浮投影 + 图片缩放 + 底部蓝色渐显 + 箭头旋转
   ============================================================ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem 0.3rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ---------- 卡片主体 ---------- */
.product-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    transition: transform 0.4s var(--ease-out), box-shadow 0.4s ease;
}

.product-card__link:hover {
    transform: translateY(-0.08rem);
    box-shadow: 0 0.16rem 0.4rem rgba(2, 101, 178, 0.18);
}

.product-card__link:focus-visible {
    outline: 0.02rem solid #0265B2;
    outline-offset: 0.02rem;
}

/* ---------- 图片：缩放 + 底部蓝色渐层 ---------- */
.product-card__media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 370 / 258;
}

.product-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease-out);
}

.product-card__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(2, 101, 178, 0) 45%, rgba(2, 101, 178, 0.35) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.product-card__link:hover .product-card__media img {
    transform: scale(1.06);
}

.product-card__link:hover .product-card__media::after {
    opacity: 1;
}

/* ---------- 信息区 ---------- */
.product-card__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    height: 1.82rem;
    padding: 0.23rem 0.16rem 0.2rem;
    box-sizing: border-box;
}

.product-card__title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    overflow: hidden;
    color: #333;
    font-size: 0.2rem;
    font-weight: 600;
    line-height: 1.25;
    transition: color 0.3s ease;
}

.product-card__link:hover .product-card__title {
    color: #0265B2;
}

.product-card__desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    margin-top: 0.11rem;
    color: #666;
    font-size: 0.16rem;
    font-weight: 500;
    line-height: 1.6;
}

/* ---------- 蓝圆 ↗ 图标（悬浮旋转 45° 变 →） ---------- */
.product-card__go {
    display: block;
    margin-top: auto;
    width: 0.32rem;
    height: 0.32rem;
}

.product-card__go svg {
    display: block;
    width: 100%;
    height: 100%;
    transition: transform 0.45s var(--ease-out);
}

.product-card__link:hover .product-card__go svg {
    transform: rotate(-45deg) scale(1.08);
}

/* ---------- CTA 卡：白底居中 ---------- */
.product-card--cta .product-card__link {
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.3rem 0.23rem;
    box-sizing: border-box;
    transition: transform 0.4s var(--ease-out), box-shadow 0.4s ease,
        background-color 0.4s ease;
}

.product-card__cta-title {
    color: #333;
    font-size: 0.24rem;
    font-weight: 600;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.product-card__cta-desc {
    max-width: 3.24rem;
    margin-top: 0.4rem;
    color: #666;
    font-size: 0.16rem;
    font-weight: 500;
    line-height: 1.6;
    transition: color 0.3s ease;
}

.product-card--cta .product-card__go {
    margin-top: 0.5rem;
}

/* CTA 悬浮：整卡反白为品牌蓝，文字与图标同步变色 */
.product-card--cta .product-card__link:hover {
    background: #0265B2;
}

.product-card--cta .product-card__link:hover .product-card__cta-title,
.product-card--cta .product-card__link:hover .product-card__cta-desc {
    color: #fff;
}

/* ---------- H5 ---------- */
html[data-mode="h5"] .product-grid {
    grid-template-columns: 1fr;
    gap: 0.3rem;
}

html[data-mode="h5"] .product-card__body {
    height: auto;
    min-height: 2.2rem;
    padding: 0.28rem 0.28rem 0.28rem;
}

html[data-mode="h5"] .product-card__title {
    font-size: 0.38rem;
}

html[data-mode="h5"] .product-card__desc {
    font-size: 0.32rem;
}

html[data-mode="h5"] .product-card__go {
    width: 0.44rem;
    height: 0.44rem;
}

html[data-mode="h5"] .product-card__cta-title {
    font-size: 0.32rem;
}

html[data-mode="h5"] .product-card__cta-desc {
    max-width: 100%;
    margin-top: 0.3rem;
    font-size: 0.32rem;
}

html[data-mode="h5"] .product-card--cta .product-card__go {
    margin-top: 0.4rem;
}

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

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

html[data-mode="h5"] .sidebar {
    flex: 0 0 auto;
    width: 100%;
}

html[data-mode="h5"] .sidebar__title {
    height: 0.8rem;
    font-size: 0.32rem;
}

html[data-mode="h5"] .sidebar__list {
    gap: 0.2rem;
}

html[data-mode="h5"] .sidebar__link {
    height: auto;
    min-height: 0.8rem;
    padding: 0.12rem 0.28rem;
    font-size: 0.32rem;
}

html[data-mode="h5"] .sidebar__arrow {
    width: 0.28rem;
    height: 0.28rem;
}


/* ============================================================
   产品分类二级菜单（新增）
   - 分类名称：正常访问分类页面
   - 右侧箭头：独立按钮展开/收起
   - 默认无 JS：子分类全部可见，确保可访问
   - JS 生效：仅展开当前所在的一级分类，其他折叠
   ============================================================ */
.sidebar__item {
    min-width: 0;
}

.sidebar__row {
    display: flex;
    align-items: stretch;
    min-width: 0;
    background: #fff;
    transition: transform 0.3s var(--ease-out, ease),
        box-shadow 0.3s ease, background-color 0.3s ease;
}

.sidebar__row > .sidebar__link {
    flex: 1 1 auto;
    min-width: 0;
    /* 箭头按钮从链接里分离后，防止文字过长撑出侧边栏 */
    text-decoration: none;
}

.sidebar__text {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* 有子分类时，一级分类右侧显示独立可点击的展开按钮 */
.sidebar__toggle {
    display: flex;
    flex: 0 0 0.58rem;
    justify-content: center;
    align-items: center;
    align-self: stretch;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.sidebar__toggle .sidebar__arrow {
    color: inherit;
    pointer-events: none;
    transition: transform 0.3s var(--ease-out, ease);
}

.sidebar__row.is-active,
.sidebar__row.is-active > .sidebar__link {
    background: #0265B2;
}

.sidebar__row.is-active .sidebar__toggle {
    color: #fff;
}

/* 统一整行的悬浮效果，覆盖旧规则中链接单独位移的效果 */
.sidebar__row .sidebar__link:not(.is-active):hover {
    background: transparent;
    transform: none;
    box-shadow: none;
}

.sidebar__row:not(.is-active):hover {
    background: #F4F7FD;
    transform: translateX(0.06rem);
    box-shadow: 0 0.06rem 0.16rem rgba(2, 101, 178, 0.12);
}

.sidebar__row:not(.is-active):hover > .sidebar__link {
    color: #0265B2;
    border-left-color: #0265B2;
}

.sidebar__row:not(.is-active):hover .sidebar__toggle {
    color: #0265B2;
}

.sidebar__toggle:hover {
    background: rgba(2, 101, 178, 0.08);
}

.sidebar__row.is-active .sidebar__toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

.sidebar__toggle:focus-visible,
.second__sublink:focus-visible {
    outline: 0.02rem solid #0265B2;
    outline-offset: -0.02rem;
}

.sidebar__row.is-active .sidebar__toggle:focus-visible {
    outline-color: #fff;
}

/* 开启的箭头：右向 > 旋转为下向 v */
.sidebar__row.is-open .sidebar__toggle .sidebar__arrow {
    transform: rotate(90deg);
}

/* 不依赖 JS 的基础子菜单样式 */
.second__item-panel {
    min-width: 0;
}

.second__item-panel-inner {
    min-height: 0;
    overflow: hidden;
}

.second__sublist {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.04rem;
    margin: 0;
    padding: 0.12rem 0 0.04rem 0.28rem;
    border-left: 0.02rem solid #e5edf5;
}

.second__sublist > li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.second__sublink {
    display: flex;
    align-items: center;
    min-height: 0.45rem;
    gap: 0.12rem;
    padding: 0.09rem 0.16rem;
    border-radius: 0.04rem;
    color: #666;
    font-size: 0.17rem;
    font-weight: 400;
    line-height: 1.5;
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.second__sublink::before {
    content: "";
    flex: 0 0 0.06rem;
    width: 0.06rem;
    height: 0.06rem;
    border-radius: 50%;
    background: #b7c5d4;
    transition: background-color 0.25s ease;
}

.second__sublink:hover,
.second__sublink.is-active {
    background: #e6f2fb;
    color: #0265B2;
}

.second__sublink.is-active {
    font-weight: 600;
}

.second__sublink:hover::before,
.second__sublink.is-active::before {
    background: #0265B2;
}

/* 仅在 JS 初始化后使用折叠动画，保证 JS 失效时二级分类仍然可点击 */
.sidebar--accordion .second__item-panel {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    visibility: hidden;
    transition: grid-template-rows 0.32s ease, opacity 0.25s ease,
        visibility 0.32s ease;
}

.sidebar--accordion .second__item-panel.is-open {
    grid-template-rows: 1fr;
    opacity: 1;
    visibility: visible;
}

/* 延续项目原有 html[data-mode="h5"] 的移动端切换方式 */
html[data-mode="h5"] .sidebar__toggle {
    flex-basis: 0.84rem;
    min-width: 0.84rem;
}

html[data-mode="h5"] .second__sublist {
    gap: 0.08rem;
    padding: 0.16rem 0 0.06rem 0.32rem;
}

html[data-mode="h5"] .second__sublink {
    min-height: 0.72rem;
    padding: 0.12rem 0.22rem;
    font-size: 0.3rem;
    line-height: 1.4;
}

html[data-mode="h5"] .second__sublink::before {
    width: 0.1rem;
    height: 0.1rem;
    flex-basis: 0.1rem;
}

@media (prefers-reduced-motion: reduce) {
    .sidebar--accordion .second__item-panel,
    .sidebar__toggle .sidebar__arrow {
        transition: none;
    }
}


/* All Products：整个标题行可点击；仅在后台页面 ID 63 显示选中态 */
.sidebar__title {
    padding: 0;
}

.sidebar__title > a {
    box-sizing: border-box;
    padding: 0 0.24rem;
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
    transition: color 0.25s ease;
}

.sidebar__title:not(.is-active) > a:hover {
    color: #0265B2;
}

.sidebar__title > a:focus-visible {
    outline: 0.02rem solid #0265B2;
    outline-offset: 0.02rem;
}

.sidebar__title.is-active {
    background: #0265B2;
    color: #fff;
}

.sidebar__title.is-active > a {
    color: #fff;
}

.sidebar__title.is-active > a:focus-visible {
    outline-color: #fff;
}

/* 移动端避免产品网格因父容器宽度不足而收缩 */
html[data-mode="h5"] .second__content {
    width: 100%;
}
