@import "base.css";

.new-content {
    max-width: 100rem;
    /* 1620px */
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* 新闻标题 */
.news-title {
    text-align: center;
    margin-top: 3.125rem;
    /* 50px */
    font-size: 2.5rem;
    /* 40px */
    color: var(--text-dark);
    font-weight: 700;
    position: relative;
    margin-bottom: 1.875rem;
}

.news-title::after {
    content: '';
    position: absolute;
    bottom: -0.1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 1.2rem;
    height: 0.04rem;
    background: linear-gradient(90deg, var(--primary-color), #9b59b6);
    border-radius: 0.02rem;
}


/* 新闻网格 */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.875rem;
    margin: 1.25rem auto 3.75rem;
    max-width: 100rem;
    padding: 0 1.25rem;
}

article {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

article:hover {
    /* transform: translateY(-0.1rem); */
    box-shadow: 0 0.75rem 1.875rem rgba(0, 0, 0, 0.15);
}

article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0.25rem;
    background: linear-gradient(90deg, var(--primary-color), #9b59b6);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

article:hover::before {
    transform: scaleX(1);
}

article a {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 图片部分 */
.article-img {
    height: 16.25rem;
    /* 260px - 固定高度 */
    overflow: hidden;
    position: relative;
}

.article-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

article:hover .article-img img {
    transform: scale(1.05);
}

.article-img::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.2) 0%, rgba(0, 0, 0, 0.05) 100%);
}

/* 内容部分 */
.article-content {
    display: flex;
    flex-direction: column;
    padding: 1.5625rem;
    background: #fff;
    flex: 0 0 auto;
    height: 7.5rem;
    justify-content: center;
}

.article-title {
    font-size: 1rem;
    text-align: center;
    margin: 0;
    line-height: 1.4;
    transition: color 0.3s ease;
    font-weight: 600;
    color: #333;
    position: relative;
    padding-bottom: 0.9375rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 5.775rem;
    max-height: 5.775rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

article:hover .article-title {
    color: #6a0dad;
}

.article-content h2.article-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 0.02rem;
    width: 0.5rem;
    background: #eee;
}

/* 响应式设计 */
@media (max-width: 1100px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .article-img {
        height: 2.4rem;
    }
}

@media (max-width: 768px) {
    /* body {
        padding: 0.3rem 0.15rem;
    } */

    .news-grid {
        grid-template-columns: 1fr;
        /* max-width: 8rem; */
        /* margin: 0 auto; */
        gap: 1.5rem;
        padding: 0;
    }

    article{
        box-shadow: 0 0.75rem 1.875rem rgba(0, 0, 0, 0.15);
        border-radius: .25rem;
    }

    .news-title {
        font-size: 0.32rem;
    }

    .category-btn {
        padding: 0.06rem 0.2rem;
        font-size: 0.12rem;
    }

    .article-img {
        height: initial;
    }
}

/*page*/
.page {
    clear: both;
    padding-top: 40px;
    overflow: hidden;
    display: block
}

.pagination {
    text-align: center;
    margin-bottom: 2rem;
}

.pagination li {
    width: 2rem;
    height: 2rem;
    display: inline-block;
    font-size: 0.875rem;
    margin-left: .5rem;
}

.pagination li a,.pagination li span {
    width: 2rem;
    height: 2rem;
    background: #eee;
    display: block;
    text-align: center;
    line-height: 2rem;
    color: #333;
}

.pagination li.active span {
    color: #fff;
    background: var(--theme-color);
}

.pagination li.disabled span {
    color: #d3d3d3;
}


