.first {
    position: relative;
    height: 6rem;
    overflow: hidden;
    background: url("../assets/images/news/news.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;
}

.second {
    padding: 0.68rem 1.6rem 1rem;
}

.second__cats {
    display: flex;
    justify-content: flex-end;
    gap: 0.1rem;
    margin-bottom: 0.6rem;
    list-style: none;
}

html[data-mode="h5"] .second {
    padding: 0.3rem 0.4rem 0.5rem;
}

html[data-mode="h5"] .second__cats {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.16rem;
    margin-bottom: 0.4rem;
}

/* ---------- 入场动画（自右错峰滑入，与 faq.css 同名同步） ---------- */
@keyframes second-cat-in {
    from {
        opacity: 0;
        transform: translateX(0.5rem);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.second__cat-item {
    opacity: 0;
    display: flex;
    animation: second-cat-in 0.6s var(--ease-out) forwards;
}

.second__cat-item:nth-child(1) {
    animation-delay: 0.05s;
}

.second__cat-item:nth-child(2) {
    animation-delay: 0.15s;
}

.second__cat-item:nth-child(3) {
    animation-delay: 0.25s;
}

.second__cat-item:nth-child(4) {
    animation-delay: 0.35s;
}

html[data-mode="h5"] .second__cat {
    height: 0.64rem;
    padding: 0 0.36rem;
    border-radius: 0.12rem;
    font-size: 0.32rem;
}

html[data-mode="h5"] .second__cat-item {
    animation-duration: 0.5s;
}

html[data-mode="h5"] .second__cat-item:nth-child(1) {
    animation-delay: 0.04s;
}

html[data-mode="h5"] .second__cat-item:nth-child(2) {
    animation-delay: 0.12s;
}

html[data-mode="h5"] .second__cat-item:nth-child(3) {
    animation-delay: 0.2s;
}

html[data-mode="h5"] .second__cat-item:nth-child(4) {
    animation-delay: 0.28s;
}

.second__cat {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 0.48rem;
    padding: 0 0.4rem;
    overflow: hidden;
    background: #f6f6f6;
    border-radius: 0.1rem;
    color: #333;
    font-size: 0.16rem;
    font-weight: 500;
    white-space: nowrap;
    /* 建立层叠上下文，保证 ::before 色块垫在文字之下 */
    isolation: isolate;
    transition: color 0.35s ease, transform 0.35s var(--ease-out), box-shadow 0.35s ease;
}

/* 悬浮：蓝色色块自左扫入 */
.second__cat::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: #0265B2;
    border-radius: inherit;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.4s var(--ease-out);
}

.second__cat:hover {
    color: #fff;
    transform: translateY(-0.04rem);
    box-shadow: 0 0.08rem 0.2rem rgba(2, 101, 178, 0.35);
}

.second__cat:hover::before {
    transform: scaleX(1);
}

/* ---------- 选中态（设计稿末项 Faq） ---------- */
.second__cat.is-active {
    background: #0265B2;
    color: #fff;
}

/* 选中项不再播放扫入色块，仅保留轻微上浮 */
.second__cat.is-active::before {
    display: none;
}

.second__cat.is-active:hover {
    color: #fff;
    transform: translateY(-0.04rem);
    box-shadow: 0 0.1rem 0.24rem rgba(2, 101, 178, 0.45);
}

/* ============================================================
   新闻卡片网格（设计稿 1600×1410：3 列 × 2 行，间距 50px）
   ============================================================ */
.second__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    list-style: none;
}

.second__card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 6.8rem;
    padding: 0.22rem 0.31rem 0.31rem;
    background: #F3FAFC;
    border-radius: 0.1rem;
    text-decoration: none;
    transition: transform 0.45s var(--ease-out), box-shadow 0.45s ease;
}

/* 悬浮：顶部 10px 蓝色横条自左扫入（对应设计稿第一张卡片悬浮态） */
.second__card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0.1rem;
    background: #0265B2;
    border-radius: 0.1rem 0.1rem 0 0 ;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.45s var(--ease-out);
}

.second__card:hover {
    transform: translateY(-0.08rem);
    box-shadow: 0 0.16rem 0.4rem rgba(2, 101, 178, 0.14);
}

.second__card:hover::before {
    transform: scaleX(1);
}

/* ---------- 日期块 ---------- */
.second__date {
    display: flex;
    flex-direction: column;
}

.second__date-day {
    color: #D7E3ED;
    font-size: 0.56rem;
    font-weight: 600;
    line-height: 1;
}

.second__date-month {
    margin-top: 0.06rem;
    color: #999;
    font-size: 0.16rem;
    font-weight: 500;
    line-height: 1.4;
}

/* ---------- 标题 / 摘要 ---------- */
.second__card-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    margin-top: 0.39rem;
    color: #333;
    font-size: 0.2rem;
    font-weight: 600;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.second__card:hover .second__card-title {
    color: #0265B2;
}

.second__card-excerpt {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    margin-top: 0.18rem;
    color: #666;
    font-size: 0.16rem;
    font-weight: 500;
    line-height: 1.5;
}

/* ---------- 图片 ---------- */
.second__card-media {
    margin-top: 0.3rem;
    height: 2.56rem;
    overflow: hidden;
    border-radius: 0.2rem;
}

.second__card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out);
}

.second__card:hover .second__card-media img {
    transform: scale(1.06);
}

/* ---------- Read More ---------- */
.second__card-more {
    display: inline-flex;
    align-items: center;
    gap: 0.04rem;
    margin-top: auto;
    align-self: flex-start;
    color: #333;
    font-size: 0.16rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.second__more-arrow {
    width: 0.24rem;
    height: 0.24rem;
    color: #0265B2;
    transition: transform 0.3s var(--ease-out);
}

.second__card:hover .second__card-more,
.second__card-more:hover {
    color: #0265B2;
}

.second__card:hover .second__more-arrow,
.second__card-more:hover .second__more-arrow {
    transform: translateX(0.06rem);
}

/* ============================================================
   入场动画：滚动进入视口后逐张错峰上浮淡入
   （复用 common.js 的 data-reveal → .is-in-view 机制，
     用动画而非过渡实现错峰，避免 delay 影响悬浮过渡）
   ============================================================ */
@keyframes second-card-in {
    from {
        opacity: 0;
        transform: translateY(0.4rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.second__grid-item[data-reveal] {
    opacity: 0;
    transform: translateY(0.4rem);
}

/* 每张卡的错峰延迟（作用于动画，不影响悬浮 transition） */
.second__grid .second__grid-item:nth-child(1) {
    --reveal-delay: 0.05s;
}

.second__grid .second__grid-item:nth-child(2) {
    --reveal-delay: 0.15s;
}

.second__grid .second__grid-item:nth-child(3) {
    --reveal-delay: 0.25s;
}

.second__grid .second__grid-item:nth-child(4) {
    --reveal-delay: 0.35s;
}

.second__grid .second__grid-item:nth-child(5) {
    --reveal-delay: 0.45s;
}

.second__grid .second__grid-item:nth-child(6) {
    --reveal-delay: 0.55s;
}

.second__grid-item[data-reveal].is-in-view {
    opacity: 1;
    transform: translateY(0);
    animation: second-card-in 0.7s var(--ease-out) var(--reveal-delay, 0s) backwards;
}

/* ---------- 响应式：≤1200px 两列 ---------- */
@media (max-width: 1200px) {
    .second__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---------- H5：单列自适应高度 ---------- */
html[data-mode="h5"] .second__grid {
    grid-template-columns: 1fr;
    gap: 0.4rem;
}

html[data-mode="h5"] .second__card {
    height: auto;
    padding: 0.32rem 0.4rem 0.4rem;
}

html[data-mode="h5"] .second__date-day {
    font-size: 0.8rem;
}

html[data-mode="h5"] .second__date-month {
    margin-top: 0.08rem;
    font-size: 0.32rem;
}

html[data-mode="h5"] .second__card-title {
    margin-top: 0.36rem;
    font-size: 0.3rem;
}

html[data-mode="h5"] .second__card-excerpt {
    margin-top: 0.2rem;
    font-size: 0.32rem;
}

html[data-mode="h5"] .second__card-media {
    margin-top: 0.32rem;
    height: 3.8rem;
    border-radius: 0.3rem;
}

html[data-mode="h5"] .second__card-more {
    margin-top: 0.36rem;
    font-size: 0.32rem;
}

html[data-mode="h5"] .second__more-arrow {
    width: 0.36rem;
    height: 0.36rem;
}

html[data-mode="h5"] .second__card::before {
    height: 0.12rem;
    border-radius: 0 0 0.12rem 0.12rem;
}
