/* 全局重置 */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    /*font-family: "Microsoft YaHei", sans-serif;*/
}

main {
    width: 100%;
    /* 移除 min-width: 1200px */
    background: #F7F8FA;
    overflow-x: hidden;
}

.content_bg {
    width: 100%;
    overflow: hidden;
    background: linear-gradient( 153deg, #F0F7FF 0%, #E8F0FE 50%, #F5F3FF 100%);
}

/* 通用模块容器 */
.content_bg .module {
    width: 100%;
    height: 320px;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* --- Module 1: Hero Section --- */
.module h1 {
    font-weight: 600;
    font-size: 40px;
    color: #333333;
    margin-bottom: 20px;
    line-height: 1.3;
}

.module p {
    max-width: 650px; 
    font-size: 18px;
    color: rgba(51, 51, 51, 0.8);
    line-height: 28px;
    margin-bottom: 40px;
}

/* --- Banner --- */
.banner {
    width: 100%;
    height: 340px;
    overflow: hidden;
}

.banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- 主容器 --- */
.news-container {
    display: flex;
    width: 100%;
    max-width: 1200px; /* 最大宽度限制 */
    padding: 0 20px 40px; /* 两侧增加内边距 */
    margin: 0 auto;
    gap: 20px; /* 使用 gap 控制间距 */
    align-items: flex-start;
}

/* --- 侧边栏 (保留原样式核心，增加响应式适配) --- */
.sidebar {
    width: 240px; /* 稍微加宽一点以适应点击 */
    flex-shrink: 0; /* 防止被压缩 */
    background: #FFFFFF;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    padding: 14px 20px;
    cursor: pointer;
    font-size: 15px;
    color: #333;
    transition: all 0.3s;
    border-left: 2px solid transparent; /* 预留边框位置，防止抖动 */
}

.category-item:hover {
    background: rgba(70, 113, 254, 0.05);
    color: #4671FE;
}

.category-item.active {
    background: rgba(70, 113, 254, 0.1);
    color: #4671FE;
    border-left: 2px solid #4671FE;
    font-weight: 600;
}

/* --- 内容区域 --- */
.content {
    flex: 1; /* 占据剩余空间 */
    background-color: #fff;
    padding: 40px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    min-height: 600px;
}

/* --- 新闻列表 --- */
.news-list {
    margin-bottom: 20px;
}

.news-item {
    display: flex;
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid #eee;
}

.news-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* 日期模块 */
.news_date {
    width: 132px; /* 稍微缩小以适应小屏 */
    height: 110px;
    border-radius: 4px;
    border: 1px solid #F0F0F0;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end; /* 居中对齐更美观 */
    flex-shrink: 0;
    background: #fafafa;
    box-sizing: border-box;
}

.news_date span {
    font-weight: 600;
    font-size: 24px;
    color: #333333;
    line-height: 1;
}

.news_date .year {
    font-size: 14px;
    color: #999999;
    margin-top: 5px;
}

/* 详情模块 */
.detail {
    flex: 1; /* 自适应宽度 */
    margin-left: 20px;
    display: flex;
    flex-direction: column;
}

/* 
   关键需求：新闻标题使用 a 标签 
   关键需求：a 标签加上 hover 效果
*/
.news-title {
    font-weight: 600;
    font-size: 20px;
    color: #333333;
    line-height: 1.4;
    margin-bottom: 15px;
    text-decoration: none; /* 移除下划线 */
    display: block;
    transition: color 0.3s ease;
    
    /* 单行省略 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hover 效果 */
.news-title:hover {
    color: #4671FE;
}

.news-summary {
    font-weight: 400;
    font-size: 14px;
    color: #666666;
    line-height: 1.6;
    
    /* 多行省略 (2行) */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- 分页控件 --- */
.pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
}

.pager a,
.pager span {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    border: 1px solid #ddd;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    color: #666;
    font-size: 14px;
    padding: 0 12px;
    text-decoration: none;
    list-style: none;
}

.pager a:hover {
    background-color: #f5f5f5;
    border-color: #ccc;
    color: #333;
}

.pager span.current {
    background-color: #4671FE;
    color: white;
    border-color: #4671FE;
}

.pager span.current:hover {
    background-color: #355acf;
}

.pager a.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}


/* =========================================
   新闻详情页面样式
   ========================================= */

/* 详情页主容器 */
.news-detail-container {
    width: 100%;
    max-width: 1200px;
    padding: 10px 20px 40px;
    margin: 0 auto;
}

/* 新闻详情区域 */
.news-detail {
    background-color: #fff;
    padding: 32px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

/* 新闻标题 */
.news-detail-title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    line-height: 1.4;
    padding-bottom: 14px;
}

/* 新闻元信息 */
.news-meta {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.news-meta span {
    font-size: 14px;
    color: #666;
}

.news-meta .view-count {
    padding-left: 20px;
}



/* 新闻内容 */
.news-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    padding: 20px 0;
}

.news-content p {
    margin-bottom: 20px;
    text-indent: 2em;
}

.news-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 4px;
}

.news-content h2 {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin: 30px 0 15px;
    padding-left: 10px;
    border-left: 4px solid #4671FE;
}

.news-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 25px 0 12px;
}

.news-content ul,
.news-content ol {
    margin: 15px 0;
    padding-left: 25px;
}

.news-content li {
    margin-bottom: 10px;
    line-height: 1.8;
}

.news-content a {
    color: #4671FE;
    text-decoration: none;
}

.news-content a:hover {
    text-decoration: underline;
}

.news-content blockquote {
    margin: 20px 0;
    padding: 15px 20px;
    background: #f8f9fa;
    border-left: 4px solid #4671FE;
    font-style: italic;
    color: #666;
}

/* 上一篇/下一篇导航 */
.news-nav {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.news-nav .prev-news,
.news-nav .next-news {
    display: flex;
    align-items: flex-start;
}

.news-nav .nav-label {
    font-size: 14px;
    color: #999;
    min-width: 60px;
    flex-shrink: 0;
}

.news-nav .nav-link {
    font-size: 14px;
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-nav .nav-link:hover {
    color: #4671FE;
}

/* =========================================
   响应式媒体查询
   ========================================= */

/* 平板及中等屏幕 (<= 992px) */
@media screen and (max-width: 992px) {
    .news-container {
        flex-direction: column; /* 上下堆叠 */
    }

    .sidebar {
        width: 100%; /* 占满全宽 */
        margin-bottom: 20px;
    }

    .category-list {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px;
    }

    .category-item {
        padding: 8px 15px;
        border-left: none; /* 移动端去掉左边框，改为底部或背景 */
        border-radius: 4px;
        font-size: 14px;
    }
    
    .category-item.active {
        border-left: none;
    }

    .content {
        width: 100%;
        padding: 30px 20px;
    }
}

/* 手机屏幕 (<= 768px) */
@media screen and (max-width: 768px) {
    .banner {
        height: 200px;
    }

    .news-container {
        padding: 20px 15px;
    }

    .content {
        padding: 20px 15px;
    }

    /* 新闻条目垂直排列 */
    .news-item {
        flex-direction: column;
        margin-bottom: 30px;
        padding-bottom: 30px;
    }

    /* 日期变为顶部横条 */
    .news_date {
        width: 100%;
        height: auto;
        flex-direction: row;
        justify-content: flex-start;
        padding: 10px 15px;
        margin-bottom: 15px;
        border: none;
        background: #f9f9f9;
        border-radius: 4px;
    }

    .news_date span {
        font-size: 16px;
        margin-right: 10px;
    }

    .news_date .year {
        margin-top: 0;
        font-size: 12px;
    }

    .detail {
        margin-left: 0;
    }

    /* 标题允许换行 */
    .news-title {
        white-space: normal;
        font-size: 18px;
        /* 如果希望移动端也限制行数，可保留省略号逻辑，或者去掉让它完全展示 */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .news-summary {
        font-size: 13px;
    }

    /* 新闻详情页面响应式 */
    .news-detail-container {
        padding: 20px 15px;
    }

    .news-detail {
        padding: 25px 20px;
    }

    .news-detail-title {
        font-size: 22px;
        padding-bottom: 15px;
        margin-bottom: 20px;
    }

    .news-meta {
        flex-direction: column;
        gap: 10px;
        align-items: center;
        padding: 12px 15px;
    }

    .news-meta span {
        font-size: 13px;
    }

    .news-content {
        font-size: 15px;
        line-height: 1.7;
    }

    .news-content p {
        text-indent: 1.5em;
        margin-bottom: 15px;
    }

    .news-content h2 {
        font-size: 18px;
        margin: 20px 0 12px;
    }

    .news-content h3 {
        font-size: 16px;
        margin: 18px 0 10px;
    }

    .news-nav {
        margin-top: 30px;
        padding-top: 20px;
    }

    .news-nav .nav-label {
        font-size: 13px;
        min-width: 55px;
    }

    .news-nav .nav-link {
        font-size: 13px;
    }
}