/* ==========================================================================
   五封信聚合页（resources-tips-all.html）专属样式
   ========================================================================== */

/* ========== 5 封信网格 — flex wrap 让最后一行自动居中 ========== */
.letters-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 44px 20px;
}
.letters-grid > .letter-card {
    flex: 0 0 auto;
    width: 100%;
    max-width: 260px;
    aspect-ratio: 1 / 1;
}

/* 可点击的信件卡片 */
.letter-card {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform 0.3s ease;
}
.letter-card:hover {
    text-decoration: none;
    color: inherit;
}
.letter-card:hover .letter-block {
    transform: translateY(-4px);
}

/* ========== 单封书信区块 ========== */
.letter-block {
    margin-bottom: 0;
    scroll-margin-top: 100px;
    transition: transform 0.3s ease;
    height: 100%;
}
.letter-block:last-child {
    margin-bottom: 0;
}

.letter-block-body {
    position: relative;
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(23, 135, 106, 0.10);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    text-align: center;
}
.letter-card:hover .letter-block-body {
    box-shadow: 0 14px 28px rgba(23, 135, 106, 0.22);
}
.letter-block-body p {
    color: #4a5a55;
    font-size: 0.9rem;
    line-height: 1.8;
    margin-bottom: 8px;
    text-align: left;
}
.letter-block-body p:last-child {
    margin-bottom: 0;
}
.letter-block-body strong {
    color: #17876a;
    font-weight: 700;
}

/* 书信内插图 — 撑满外框（外框已缩小到与图片 1:1） */
.letter-block-img {
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: none;
    cursor: pointer;
}
.letter-block-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s ease, transform 0.5s ease;
}
.letter-block-img:hover img {
    transform: scale(1.03);
}
.letter-block-img .letter-img-hover {
    position: absolute;
    inset: 0;
    opacity: 0;
}
.letter-block-img:hover .letter-img-hover {
    opacity: 1;
}
.letter-block-img:hover .letter-img-default {
    opacity: 0;
}

/* 卡片底部深色条带 + 白色标题，叠在图片底部 */
.view-full-page {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 12px;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(12,28,24,0.78) 35%, rgba(12,28,24,0.88) 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.35;
    transition: gap 0.25s ease, background 0.3s ease;
}
.view-full-page i {
    color: #d7f1e6;
    font-size: 1rem;
    transition: transform 0.25s ease;
}
.letter-card:hover .view-full-page {
    gap: 12px;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(23,135,106,0.55) 35%, rgba(23,135,106,0.72) 100%);
}
.letter-card:hover .view-full-page i {
    transform: translateX(3px);
}

/* ========== 响应式：平板 2 列，手机 2 列 ========== */
@media (max-width: 991px) {
    .letters-grid > .letter-card {
        max-width: 340px;
    }
    .letters-grid {
        gap: 36px 16px;
    }
}
@media (max-width: 575px) {
    .letters-grid {
        gap: 28px 12px;
    }
    .letters-grid > .letter-card {
        max-width: 100%;
    }
    .view-full-page {
        font-size: 0.92rem;
        padding: 10px 8px;
        gap: 6px;
    }
}
