/* ============================================================
   1. 首屏 Hero（Figma 560_2：1920 × 700）
   ============================================================ */
.first {
    position: relative;
    height: 7rem;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

/* 背景大图：入场缓慢回缩（Ken Burns），顶部品牌蓝压色保证 header 衔接 */
.first__bg {
    position: absolute;
    inset: 0;
    background: url("../assets/images/catalog/catalog.webp") center / cover no-repeat;
    animation: firstZoom 2.2s var(--ease-out) both;
    will-change: transform;
}

/* 底部轻压暗，保证标题/面包屑可读性 */
.first::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            rgba(3, 82, 141, 0.35) 0%,
            rgba(3, 82, 141, 0) 30%,
            rgba(0, 0, 0, 0) 62%,
            rgba(0, 0, 0, 0.32) 100%);
    pointer-events: none;
}

.first__content {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 0 1.6rem 0.76rem;
}

/* ---------- 标题：遮罩上滑 + 字距收缩 ---------- */
.first__title {
    overflow: hidden;
    /* 遮罩：文字从下方滑入 */
    font-size: 0.64rem;
    font-weight: 600;
    line-height: 1.15;
    color: #ffffff;
}

.first__title span {
    display: inline-block;
    animation: firstTitleUp 0.9s var(--ease-out) 0.25s both;
}

/* ---------- 入场动效 ---------- */
@keyframes firstZoom {
    from {
        transform: scale(1.12);
    }

    to {
        transform: scale(1);
    }
}

@keyframes firstTitleUp {
    from {
        transform: translateY(110%);
        letter-spacing: 0.04rem;
        opacity: 0.4;
    }

    to {
        transform: translateY(0);
        letter-spacing: normal;
        opacity: 1;
    }
}

/* ============================================================
   2. 第二屏：左侧分类手风琴（Figma 635_1347：365 × 1179）
   ============================================================ */
.second {
    padding: 0.6rem 1.6rem 1rem;
}

.second__inner {
    display: grid;
    grid-template-columns: 3.65rem minmax(0, 1fr);
    gap: 0.86rem;
    align-items: start;
}

/* ---------- 标题栏：品牌蓝 ---------- */
.second__aside-title {
    display: flex;
    align-items: center;
    height: 0.96rem;
    padding: 0 0.24rem;
    background: #03528D;
    border-bottom: 1px solid #D9D9D9;
    font-size: 0.32rem;
    font-weight: 700;
    color: #ffffff;
}

/* ---------- 手风琴项 ---------- */
.second__accordion {
    list-style: none;
}

.second__item {
    background: #ffffff;
    border-bottom: 1px solid #E5E5E5;
}

.second__item-head {
    margin: 0;
}

.second__item-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.12rem;
    width: 100%;
    height: 0.7rem;
    padding: 0 0.24rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
}

.second__item-btn:focus-visible {
    outline: 2px solid #F5770B;
    outline-offset: -2px;
}

.second__item-name {
    font-size: 0.2rem;
    font-weight: 400;
    color: #666666;
    transition: color 0.3s ease;
}

/* 图标：收起为灰色右箭头，展开变蓝底白下箭头（旋转过渡） */
.second__item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 0.3rem;
    height: 0.3rem;
    border-radius: 50%;
    background: transparent;
    color: #666666;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.second__item-icon svg {
    width: 0.2rem;
    height: 0.2rem;
    transform: rotate(0deg);
    transition: transform 0.3s var(--ease-out);
}

.second__item.is-open .second__item-name {
    color: #03528D;
    font-weight: 600;
}

.second__item.is-open .second__item-icon {
    background: #03528D;
    color: #ffffff;
}

.second__item.is-open .second__item-icon svg {
    transform: rotate(90deg);
}

/* ---------- 展开面板：grid-template-rows 0fr→1fr 平滑收展 ---------- */
.second__item-panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s var(--ease-out);
}

.second__item.is-open .second__item-panel {
    grid-template-rows: 1fr;
}

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

.second__sublist {
    list-style: none;
    padding: 0.2rem 0.24rem 0.3rem;
}

.second__sublist li+li {
    margin-top: 0.2rem;
}

.second__sublink {
    display: block;
    padding-left: 0.24rem;
    font-size: 0.16rem;
    line-height: 0.24rem;
    color: #666666;
    transition: color 0.3s ease, transform 0.3s var(--ease-out);
}

.second__sublink:hover {
    color: #03528D;
    transform: translateX(0.02rem);
}

/* 选中态：品牌蓝加粗 + 左侧短条标记 */
.second__sublink {
    position: relative;
}

.second__sublink.is-active {
    color: #03528D;
    font-weight: 600;
}

.second__sublink.is-active::before {
    content: "";
    position: absolute;
    left: 0.06rem;
    top: 50%;
    width: 0.04rem;
    height: 0.14rem;
    background: #03528D;
    border-radius: 0.02rem;
    transform: translateY(-50%);
}

/* ---------- 右侧产品列表（Figma 639_1743：3×3，列距 20 行距 50） ---------- */
.second__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem 0.2rem;
    list-style: none;
}

.second__card-link {
    display: block;
    text-decoration: none;
}

/* 产品图：370×276，浅灰底衬 */
.second__card-media {
    overflow: hidden;
    background: #F6F7F8;
}

.second__card-media img {
    display: block;
    width: 100%;
    height: 2.76rem;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out);
}

/* 白色卡脚：标题 + View More（高 1.64rem，底部分隔线） */
.second__card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 1.64rem;
    padding: 0.22rem 0.16rem 0.29rem;
    background: #ffffff;
    border-bottom: 1px solid #D9D9D9;
}

/* 标题最多两行，超出省略 */
.second__card-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    max-width: 3.37rem;
    text-align: center;
    font-size: 0.2rem;
    font-weight: 600;
    line-height: 1.4;
    color: #333333;
    transition: color 0.3s ease;
}

/* View More：胶囊按钮，常态品牌蓝，卡片悬浮变橙 */
.second__card-more {
    display: inline-flex;
    align-items: center;
    gap: 0.06rem;
    height: 0.36rem;
    margin-top: auto;
    padding: 0 0.16rem;
    background: #03528D;
    border-radius: 1rem;
    font-size: 0.16rem;
    color: #ffffff;
    transition: background-color 0.3s ease;
}

.second__card-more svg {
    width: 0.2rem;
    height: 0.2rem;
    transition: transform 0.3s var(--ease-out);
}

.second__card-link:hover .second__card-media img {
    transform: scale(1.05);
}

.second__card-link:hover .second__card-more {
    background: #F5770B;
}

.second__card-link:hover .second__card-more svg {
    transform: translate(0.02rem, -0.02rem);
}

.second__card-link:focus-visible .second__card-more {
    background: #F5770B;
}

/* ---------- 入场动画：标题上滑 + 各项错峰淡入（依赖 data-reveal） ---------- */
html.js .second__aside-title {
    opacity: 0;
    transform: translateY(0.24rem);
    transition: opacity 0.6s ease, transform 0.6s var(--ease-out);
}

html.js .second__item {
    opacity: 0;
    transform: translateY(0.24rem);
    transition: opacity 0.6s ease, transform 0.6s var(--ease-out);
}

html.js .second__aside.is-in-view .second__aside-title {
    opacity: 1;
    transform: translateY(0);
}

html.js .second__aside.is-in-view .second__item {
    opacity: 1;
    transform: translateY(0);
}

html.js .second__aside.is-in-view .second__item:nth-child(1) {
    transition-delay: 0.05s;
}

html.js .second__aside.is-in-view .second__item:nth-child(2) {
    transition-delay: 0.1s;
}

html.js .second__aside.is-in-view .second__item:nth-child(3) {
    transition-delay: 0.15s;
}

html.js .second__aside.is-in-view .second__item:nth-child(4) {
    transition-delay: 0.2s;
}

html.js .second__aside.is-in-view .second__item:nth-child(5) {
    transition-delay: 0.25s;
}

html.js .second__aside.is-in-view .second__item:nth-child(6) {
    transition-delay: 0.3s;
}

html.js .second__aside.is-in-view .second__item:nth-child(7) {
    transition-delay: 0.35s;
}

html.js .second__aside.is-in-view .second__item:nth-child(8) {
    transition-delay: 0.4s;
}

html.js .second__aside.is-in-view .second__item:nth-child(9) {
    transition-delay: 0.45s;
}

html.js .second__aside.is-in-view .second__item:nth-child(10) {
    transition-delay: 0.5s;
}

html.js .second__aside.is-in-view .second__item:nth-child(11) {
    transition-delay: 0.55s;
}

/* 卡片入场：随右栏 data-reveal 进入视口后 9 张错峰淡入上移 */
html.js .second__card {
    opacity: 0;
    transform: translateY(0.24rem);
    transition: opacity 0.6s ease, transform 0.6s var(--ease-out);
}

html.js .second__content.is-in-view .second__card {
    opacity: 1;
    transform: translateY(0);
}

html.js .second__content.is-in-view .second__card:nth-child(3n + 2) {
    transition-delay: 0.12s;
}

html.js .second__content.is-in-view .second__card:nth-child(3n + 3) {
    transition-delay: 0.24s;
}

html.js .second__content.is-in-view .second__card:nth-child(n + 4) {
    transition-delay: 0.1s;
}

html.js .second__content.is-in-view .second__card:nth-child(n + 4):nth-child(3n + 2) {
    transition-delay: 0.22s;
}

html.js .second__content.is-in-view .second__card:nth-child(n + 4):nth-child(3n + 3) {
    transition-delay: 0.34s;
}

html.js .second__content.is-in-view .second__card:nth-child(n + 7) {
    transition-delay: 0.2s;
}

html.js .second__content.is-in-view .second__card:nth-child(n + 7):nth-child(3n + 2) {
    transition-delay: 0.32s;
}

html.js .second__content.is-in-view .second__card:nth-child(n + 7):nth-child(3n + 3) {
    transition-delay: 0.44s;
}

/* ============================================================
   3. H5 适配
   ============================================================ */
html[data-mode="h5"] .first {
    height: 4.8rem;
}

html[data-mode="h5"] .first__content {
    padding: 0 0.4rem 0.5rem;
}

html[data-mode="h5"] .first__title {
    font-size: 0.56rem;
}

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

html[data-mode="h5"] .second__inner {
    grid-template-columns: 1fr;
    gap: 0.4rem;
}

html[data-mode="h5"] .second__aside {
    display: none;
}
html[data-mode="h5"] .second__aside-title {
    height: 0.88rem;
    font-size: 0.4rem;
}

html[data-mode="h5"] .second__item-btn {
    height: 0.8rem;
    padding: 0 0.3rem;
}

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

html[data-mode="h5"] .second__item-icon {
    width: 0.4rem;
    height: 0.4rem;
}

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

html[data-mode="h5"] .second__sublist {
    padding: 0.24rem 0.3rem 0.36rem;
}

html[data-mode="h5"] .second__sublist li+li {
    margin-top: 0.28rem;
}

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

html[data-mode="h5"] .second__grid {
    grid-template-columns: 1fr;
    gap: 0.4rem;
}
html[data-mode="h5"] .second__card-media {
    background: transparent;
}

html[data-mode="h5"] .second__card-media img {
    height: 3.6rem;
        object-fit: contain;
}

html[data-mode="h5"] .second__card-body {
    height: 2rem;
    padding: 0.24rem 0.2rem 0.32rem;
}

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

html[data-mode="h5"] .second__card-more {
    height: 0.56rem;
    padding: 0 0.26rem;
    font-size: 0.32rem;
}

html[data-mode="h5"] .second__card-more svg {
    width: 0.26rem;
    height: 0.26rem;
}