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;
    min-width: 0;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.1);
    padding: 32px;
    margin-right: 16px;
    overflow: hidden;
}

.news-header h1 {
    font-size: 24px;
    margin: 0;
    color: #333;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-wrap: break-word;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 12px;
    color: #c3c3c3;
    padding-bottom: 16px;
    border-bottom: 1px dashed #e7e7e7;
}

.news-body {
    font-size: 14px;
    margin-top: 13px;
    line-height: 1.6;
    color: #333;
}

.news-body p {
    margin: 15px 0;
}

.news-body img {
    max-width: 100%;
    border-radius: 6px;
    margin-top: 16px;
}

.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;
}

.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;
    padding: 8px 16px;
    border-radius: 6px;
    background-color: #f6f6f6;
    transition: background-color 0.3s, color 0.3s;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 为推荐阅读链接添加多行文本处理 */
.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: #007bff; /* 悬停时的纯色背景 */
}

.sidebar-menu li a:hover,
.recommended-reading li a:hover {
    background-color: #007bff;
    color: #fff;
}

.chat .submit {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 8px;
    width: 100%;
}

.pre-and-next {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
}
.pre-and-next .pre,
.pre-and-next .next{
    font-size: 12px;
    color: #1a1e21;
    transition: .3s;
    max-width: 45%; /* 限制宽度，防止过长 */
}

.pre-and-next .pre span,
.pre-and-next .next span {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90%; /* 限制宽度，留出空间给箭头图标 */
    vertical-align: middle;
}

.pre-and-next .pre:hover,
.pre-and-next .next:hover{
    color: #007bff;
}