/* 容器样式 */
.news-3 {
    width: calc(100% + 10px);
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
}

/* 单个项目样式 */
.news-3 .item {
    width: calc(25% - 10px); /* 每个项目占据25%的宽度，减去左右padding */
    margin-right: 10px;
    margin-bottom:10px;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    background-color: #F8f8f8;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    height: 220px; /* 固定高度，你可以根据需要调整 */
    position: relative; /* 为了绝对定位描述文本（可选） */
}

.news-3 .item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease; /* 添加过渡效果 */
}

.news-3 .item:hover img {
    transform: scale(1.2); /* 当鼠标悬停时，图片放大到原来的1.05倍 */
}

.news-3 .item h4 {
    font-size: 14px;
    color: #333;
    font-weight: bold;
    line-height: 24px;
}

.news-3 .item p {
        position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    text-align: center;
    width: 100%;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 14px;
}
}

/* 响应式设计 */
@media (max-width: 768px) {
    .news-3 .item {
        flex: 1 1 calc(50% - 20px); /* 每个项目占据50%的宽度 */
    }
}

@media (max-width: 480px) {
    .news-3 .item {
        flex: 1 1 calc(100% - 20px); /* 每个项目占据100%的宽度 */
    }
}