* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: rgba(249, 254, 243, 0.9);
}

.container-fluid {
    padding: 0 2.5rem;  /* 保持水平内边距 */
    margin: 0;
    min-height: 85vh;  /* 确保容器占满视口高度 !!!!需要调*/
    display: flex;      /* 使用flex布局 */
    align-items: center;/* 垂直居中 */
}

.card-wrapper {
    position: relative;
    height: 100%;
}

.card-wrapper:hover .card {
    transform: scale(1.05);
    z-index: 10;
}

.card-wrapper:hover .card-title p::after {
    transform: scaleX(1);
}

.card {
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
    width: 100%;
}

.card:hover {
    z-index: 10;
}

.card:hover ~ .card-title p::after {
    transform: scaleX(1);  /* 当卡片悬停时激活所有文字的下划线 */
}

.grid-item .card-img-top {
    width: 100%;
    aspect-ratio: 4 / 5;  /* 保持4:5比例 */
    object-fit: cover;    /* 保持图片比例并填充容器 */
    border-radius: 10px;     /* 添加卡片图片下方圆角 */
}

.wide-card .card-img-top {
    aspect-ratio: 8.3 / 5;  /* 宽卡片的比例 */
    width: 100%;
    object-fit: cover;    /* 保持图片比例并填充容器 */
    border-radius: 10px;     /* 添加卡片图片下方圆角 */
}

.card-title {
    position: absolute;
    bottom: -6.5rem;  /* 将标题放在卡片下方 */
    left: 0;
    width: 100%;
    text-align: left;
    padding: 10px 0;
    z-index: 2;
    text-decoration: none;
    font-size: 1rem;
}

.card-style {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;  /* 为下划线添加相对定位 */
}

.card-style p {
    margin: 0;
    line-height: 1.2;
    position: relative;
    display: inline-block;  /* 使元素宽度适应内容 */
    width: fit-content;     /* 确保宽度只包含文字 */
}

.card-style p::after {
    content: '';
    position: absolute;
    width: 100%;           /* 现在是相对于文字宽度的100% */
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}

.card-style:hover ~ .card::after {
    transform: scaleX(1); /* 可以改回1，因为现在是相对于文字宽度 */
}

.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}