html,
body {
    background-color: aliceblue;
}

.navbar-container {
    background-color: #153165;
}

.main {
    display: flex;
    padding: 16px 0;
    margin-top: 86px;
    margin-bottom: 168px;
    width: 100%;
    overflow: hidden;
}

.main-content {
    flex: 3;
    padding-right: 16px;
    min-width: 0; /* 防止flex子项目超出容器 */
    /*display: grid;*/
    /*grid-template-columns: 1fr;*/
    /*gap: 16px;*/
}

.news-item {
    display: flex;
    background-color: #fff;
    /* margin-bottom: 16px; */
    padding: 15px;
    margin-bottom: 16px;
    border-radius: 5px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.1);
    height: 160px;
    width: 100%;
    overflow: hidden;
}

.news-item img {
    width: 150px;
    height: 100%;
    margin-right: 16px;
    border-radius: 6px;
    object-fit: cover;
}

.news-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    width: 100%;
    overflow: hidden;
}

.news-details:hover h2 {
    color: #153165;
}

.news-details h2 {
    margin: 0;
    transition: all 0.3s;
    font-size: 18px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-details p {
    flex: 1;
    margin: 10px 0;
    font-size: 14px;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* 最多显示3行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-details .date {
    font-size: 12px;
    color: #999;
}

.sidebar {
    flex: 1;
    min-width: 0; /* 防止溢出 */
    background-color: #fff;
    padding: 16px;
    border-radius: 6px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.1);
}

.sidebar h3 {
    margin-top: 0;
    font-size: 18px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.sidebar-menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.sidebar-menu li {
    width: 100%;
}

.sidebar-menu li a {
    width: 100%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-menu,
.recommended-reading {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}


.recommended-reading {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.sidebar-menu li a,
.recommended-reading li a {
    text-decoration: none;
    color: #333;
    font-size: 14px;
    display: block;
    border-radius: 6px;
    background-color: #f6f6f6;
    transition: background-color 0.3s, color 0.3s;
    width: 100%;
}

/* 为侧边栏菜单单独设置padding */
.sidebar-menu li a {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 8px 16px;
}

.recommended-reading li a {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 显示2行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5; /* 稍微增加行高，确保文字不会被截断 */
    font-size: 14px; /* 明确指定字体大小 */
    min-height: 45px; /* 确保即使只有一行也有统一高度 */
    padding: 8px 16px 12px 16px; /* 增加底部padding */
    position: relative;
    box-sizing: border-box;
    max-height: 58px; /* 微调高度，确保不会显示第三行 */
}

/* 使用更大的遮罩，确保完全覆盖第三行文字 */
.recommended-reading li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 12px; /* 与底部padding相同 */
    background-color: #f6f6f6; /* 纯色背景，与链接背景色相同 */
    transition: background-color 0.3s;
    z-index: 1;
}

.recommended-reading li a:hover::after {
    background-color: #153165; /* 悬停时的纯色背景 */
}

.sidebar-menu li a:hover,
.recommended-reading li a:hover {
    background-color: #153165;
    color: #fff;
}

/* ===== News pagination (scoped) ===== */
.news-pagination {
    display: flex;
    justify-content: center;
}

.news-pagination .pagination {
    gap: 8px;
    flex-wrap: wrap;
    margin: 0;
}

.news-pagination .page-item .page-link {
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    min-width: 40px;
    text-align: center;
    font-size: 14px;
    line-height: 1;
    color: #153165;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.news-pagination .page-item .page-link:hover {
    transform: translateY(-1px);
    background: #153165;
    color: #fff;
}

.news-pagination .page-item.active .page-link {
    background: #153165;
    color: #fff;
    box-shadow: 0 6px 18px rgba(21, 49, 101, 0.25);
}

.news-pagination .page-item.disabled .page-link {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.news-pagination .page-item.disabled .page-link:hover {
    background: rgba(255, 255, 255, 0.95);
    color: #153165;
}

@media (max-width: 576px) {
    .news-pagination .page-item .page-link {
        padding: 8px 12px;
        min-width: 36px;
    }
}