.first {
    position: relative;
    height: 6rem;
    overflow: hidden;
    background: url("../assets/images/projects/projects.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;
}

/* ============================================================
   第二屏：项目卡片网格（设计稿 1920：内边距 80/160，
   4 列 370×440，列距 40；首张卡为悬浮后的效果）
   ============================================================ */
.second {
    padding: 0.8rem 1.6rem;
}

.second__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
}

/* ---------- 卡片（a 标签） ---------- */
.second__card {
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: 0 0.02rem 0.08rem rgba(0, 0, 0, 0.04);
}

/* 图片区：370×258，悬浮放大 */
.second__card-media {
    height: 2.58rem;
    overflow: hidden;
    flex: 0 0 auto;
}

.second__card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease-out);
}

/* 信息区：370×182，悬浮变蓝底 */
.second__card-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1 1 auto;
    height: 1.82rem;
    padding: 0.26rem 0.16rem 0;
    background: #fff;
    transition: background 0.4s ease;
}

/* 标签胶囊：#F2FAFD 底 + #D0EDF8 描边 */
.second__card-tag {
    flex: 0 0 auto;
    height: 0.29rem;
    padding: 0 0.1rem;
    background: #f2fafd;
    border: 0.01rem solid #d0edf8;
    color: #333;
    font-size: 0.14rem;
    font-weight: 500;
    line-height: 0.27rem;
    transition: background 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}

/* 标题：Montserrat 600 / 20px，最多两行截断 */
.second__card-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    margin-top: 0.15rem;
    width: 100%;
    color: #333;
    font-size: 0.2rem;
    font-weight: 600;
    line-height: 1.5;
    transition: color 0.4s ease;
}

/* 日期行：3×16 灰竖条 + Uploadtime */
.second__card-time {
    display: flex;
    align-items: center;
    gap: 0.08rem;
    margin-top: 0.14rem;
    color: #999;
    font-size: 0.14rem;
    font-weight: 500;
    transition: color 0.4s ease;
}

.second__card-time-bar {
    width: 0.03rem;
    height: 0.16rem;
    background: #d9d9d9;
    flex: 0 0 auto;
    transition: background 0.4s ease;
}

/* ---------- 悬浮态（对应设计稿首张卡效果） ---------- */
.second__card:hover .second__card-body,
.second__card:focus-visible .second__card-body {
    background: #0265b2;
}

.second__card:hover .second__card-title,
.second__card:focus-visible .second__card-title {
    color: #fff;
}

.second__card:hover .second__card-time,
.second__card:focus-visible .second__card-time {
    color: #d9d9d9;
}

.second__card:hover .second__card-media img,
.second__card:focus-visible .second__card-media img {
    transform: scale(1.06);
}

/* 卡片入场：淡入 + 上移（data-reveal 默认效果），错峰延迟由 HTML data-reveal-delay 控制 */

/* ---------- H5 ---------- */
html[data-mode="h5"] .second {
    padding: 0.6rem 0.4rem;
}

html[data-mode="h5"] .second__grid {
    grid-template-columns: repeat(1, 1fr);
}

html[data-mode="h5"] .second__card-media {
    height: 3.2rem;
}

html[data-mode="h5"] .second__card-body {
    height: auto;
    min-height: 2.6rem;
    padding: 0.32rem 0.24rem 0.32rem;
}

html[data-mode="h5"] .second__card-tag {
    height: 0.4rem;
    padding: 0 0.16rem;
    font-size: 0.32rem;
    line-height: 0.38rem;
}

html[data-mode="h5"] .second__card-title {
    margin-top: 0.2rem;
    font-size: 0.32rem;
}

html[data-mode="h5"] .second__card-time {
    margin-top: 0.2rem;
    font-size: 0.32rem;
}

html[data-mode="h5"] .second__card-time-bar {
    height: 0.32rem;
}