.first {
    position: relative;
    height: 6rem;
    overflow: hidden;
    background: url("../assets/images/certifications/img1.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;
}

/* ============================================================
   第二屏：Certifications（设计稿 373_2250）
   - 内边距 120/260 → padding: 1.2rem 2.6rem（内容区 1400 宽）
   - 居中标题（48px #131841）+ 副标题（16px #666）+ 4×2 卡片网格
   - 卡片 332×536：白底 1px #D9D9D9 描边，内边距 15/16，
     证书图 300×424，说明文字 16px #333 居中（左右留白 42）
   - 入场：复用 common.js data-reveal，模糊淡入上浮错峰（动画实现，
     不占 transition，避免影响悬浮动效）
   - 悬浮：卡片上浮投影 + 描边变蓝 + 图片放大 + 底部蓝色渐层
     + 说明文字变蓝
   ============================================================ */
.second {
    padding: 1.2rem 2.6rem;
    background: #fff;
}

.second__title {
    color: #131841;
    font-size: 0.48rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
}

.second__sub {
    margin-top: 0.22rem;
    color: #666;
    font-size: 0.16rem;
    font-weight: 500;
    text-align: center;
}

.second__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.24rem;
    margin-top: 0.18rem;
    padding: 0;
    list-style: none;
}

/* ---------- 证书卡片 ---------- */
.second-card {
    position: relative;
    overflow: hidden;
    padding: 0.15rem 0.16rem 0.24rem;
    background: #fff;
    border: 1px solid #D9D9D9;
    transition: transform 0.4s var(--ease-out), box-shadow 0.4s ease, border-color 0.4s ease;
}

.second-card:hover {
    transform: translateY(-0.08rem);
    border-color: #0265B2;
    box-shadow: 0 0.2rem 0.5rem rgba(2, 101, 178, 0.22);
}

.second-card__img {
    display: block;
    width: 100%;
    aspect-ratio: 300 / 424;
    object-fit: cover;
    transition: transform 0.5s var(--ease-out);
}

/* 图片区蓝色渐层：悬浮渐显 */
.second-card::after {
    content: "";
    position: absolute;
    left: 0.16rem;
    right: 0.16rem;
    top: 0.15rem;
    height: 4.24rem;
    background: linear-gradient(180deg, rgba(2, 101, 178, 0) 55%, rgba(2, 101, 178, 0.25) 100%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.second-card:hover .second-card__img {
    transform: scale(1.04);
}

.second-card:hover::after {
    opacity: 1;
}

.second-card__name {
    max-width: 2.48rem;
    margin: 0.21rem auto 0;
    color: #333;
    font-size: 0.16rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    transition: color 0.3s ease;
}

.second-card:hover .second-card__name {
    color: #0265B2;
}

/* ---------- 入场动画：模糊淡入 + 上浮，错峰延迟（动画实现，不占 transition） ---------- */
@keyframes second-card-in {
    from {
        opacity: 0;
        transform: translateY(0.4rem) scale(0.96);
        filter: blur(0.06rem);
    }

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

.second__title[data-reveal],
.second__sub[data-reveal],
.second-card[data-reveal] {
    opacity: 0;
    transform: translateY(0.4rem);
    filter: blur(0.06rem);
}

.second__title[data-reveal].is-in-view,
.second__sub[data-reveal].is-in-view,
.second-card[data-reveal].is-in-view {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    animation: second-card-in 0.7s var(--ease-out) var(--reveal-delay, 0s) backwards;
}

/* 错峰延迟：标题 → 副标题 → 8 张卡片依次入场 */
.second__sub[data-reveal] {
    --reveal-delay: 0.12s;
}

.second__grid .second-card:nth-child(1) {
    --reveal-delay: 0.2s;
}

.second__grid .second-card:nth-child(2) {
    --reveal-delay: 0.28s;
}

.second__grid .second-card:nth-child(3) {
    --reveal-delay: 0.36s;
}

.second__grid .second-card:nth-child(4) {
    --reveal-delay: 0.44s;
}

.second__grid .second-card:nth-child(5) {
    --reveal-delay: 0.52s;
}

.second__grid .second-card:nth-child(6) {
    --reveal-delay: 0.6s;
}

.second__grid .second-card:nth-child(7) {
    --reveal-delay: 0.68s;
}

.second__grid .second-card:nth-child(8) {
    --reveal-delay: 0.76s;
}

/* ---------- H5（read.md 规范：模块主标题 0.44rem，内容不小于 0.32rem） ---------- */
html[data-mode="h5"] .second {
    padding: 0.6rem 0.4rem;
}

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

html[data-mode="h5"] .second__sub {
    margin-top: 0.16rem;
    font-size: 0.32rem;
}

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

html[data-mode="h5"] .second-card {
    padding: 0.24rem 0.24rem 0.32rem;
}

html[data-mode="h5"] .second-card::after {
    left: 0.24rem;
    right: 0.24rem;
    top: 0.24rem;
    height: auto;
    aspect-ratio: 300 / 424;
}

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

/* ============================================================
   第三屏：Welding Quality Standard（设计稿 373_2287）
   - 全宽圆角横幅 1920×666：背景图 img3.webp + 圆角 10px
   - 内容左对齐：图标 68×68（y=156）→ 标题 48px #131841（y=258，
     宽 552 两行）→ 描述 18px #666（y=410，宽 550，行高 2）
   - 入场：复用 common.js data-reveal，图标/标题/描述错峰淡入上浮
   ============================================================ */
.third {
    height: 6.66rem;
    overflow: hidden;
    border-radius: 0.1rem;
    background: url("../assets/images/certifications/img3.webp") center / cover no-repeat;
}

.third__inner {
    height: 100%;
    padding: 1.56rem 2.6rem 0;
}

.third__icon {
    display: block;
    width: 0.68rem;
    height: 0.68rem;
}

.third__icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.third__title {
    max-width: 5.52rem;
    margin-top: 0.34rem;
    color: #131841;
    font-size: 0.48rem;
    font-weight: 600;
    line-height: 1.2;
}

.third__desc {
    max-width: 5.5rem;
    margin-top: 0.37rem;
    color: #666;
    font-size: 0.18rem;
    font-weight: 500;
    line-height: 2;
}

/* ---------- H5（read.md 规范：模块主标题 0.44rem，内容不小于 0.32rem） ---------- */
html[data-mode="h5"] .third {
    height: max-content;
    border-radius: 0.16rem;
}

html[data-mode="h5"] .third__inner {
    padding: 0.8rem 0.4rem;
}

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

html[data-mode="h5"] .third__desc {
    max-width: 100%;
    margin-top: 0.24rem;
    font-size: 0.32rem;
    line-height: 1.7;
}