/* ============================================================
   news.css — 迈驰智能技术（江苏）有限公司
             "新闻资讯" 列表页 + 详情页 合并样式
   版本: 2.0
   说明: 新闻列表页（news.html）与新闻详情页（news-detail.html）
         的完整样式。全局基础、导航、页面横幅、底部版权等请引用 common.css。
   ============================================================ */

/* ============================================================
   第一部分：公共左侧分类侧边栏（列表页与详情页共用）
   ============================================================ */

.category-sidebar {
    flex: 0 0 280px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0 0 12px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}
.category-sidebar::-webkit-scrollbar {
    width: 4px;
}
.category-sidebar::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}
.category-sidebar::-webkit-scrollbar-track {
    background: var(--bg-light);
}

.category-sidebar .sidebar-title {
    font-size: 20px;
    font-weight: 700;
    padding: 16px 20px;
    background: var(--bg-dark);
    color: #fff;
    border-radius: var(--radius) var(--radius) 0 0;
    letter-spacing: 0.5px;
}

/* 一级分类（详情页用） */
.cat-item {
    display: block;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-gray);
    transition: all var(--transition);
    border-left: 3px solid transparent;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}
.cat-item:last-child {
    border-bottom: none;
}
.cat-item:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}
.cat-item.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

/* ============================================================
   第二部分：新闻列表页专属（news.html）
   ============================================================ */

/* ----- 列表页整体布局 ----- */
.news-layout {
    display: flex;
    gap: 50px;
    align-items: flex-start;
}

/* ----- 左侧新闻列表 ----- */
.news-list-wrap {
    flex: 1;
    min-width: 0;
}

.news-item {
    display: flex;
    gap: 24px;
    padding: 28px 0;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition);
}
.news-item:first-child {
    padding-top: 0;
}
.news-item:last-child {
    border-bottom: none;
}
.news-item:hover {
    padding-left: 8px;
}

.news-item .news-date {
    flex-shrink: 0;
    min-width: 70px;
    text-align: center;
    padding-top: 2px;
}
.news-item .news-date .day {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
}
.news-item .news-date .month {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
}

.news-item .news-info {
    flex: 1;
}
.news-item .news-info .news-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: rgba(0, 82, 217, 0.08);
    padding: 2px 14px;
    border-radius: 50px;
    border: 1px solid rgba(0, 82, 217, 0.1);
    margin-bottom: 6px;
}
.news-item .news-info .title-link {
    display: block;
    transition: color var(--transition);
}
.news-item .news-info .title-link h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-dark);
    line-height: 1.3;
}
.news-item .news-info .title-link:hover h3 {
    color: var(--primary);
}
.news-item .news-info p {
    color: var(--text-gray);
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-item .news-info .read-more {
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap var(--transition);
}
.news-item .news-info .read-more:hover {
    gap: 10px;
}

/* ----- 分页 ----- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}
.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-gray);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    transition: all var(--transition);
}
.pagination a:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.pagination a.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.pagination .prev,
.pagination .next {
    min-width: 60px;
}

/* ----- 右侧侧边栏 ----- */
.news-sidebar {
    flex: 0 0 300px;
    position: sticky;
    top: 100px;
}

.sidebar-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px 22px 28px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}
.sidebar-card:last-child {
    margin-bottom: 0;
}
.sidebar-card .card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-dark);
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}
.sidebar-card .card-title .highlight {
    color: var(--primary);
}

/* 分类列表 */
.category-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition);
}
.category-list li:last-child {
    border-bottom: none;
}
.category-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-gray);
    transition: color var(--transition);
}
.category-list li a:hover {
    color: var(--primary);
}
.category-list li a .count {
    font-size: 12px;
    color: var(--text-light);
    background: var(--bg-light);
    padding: 0 10px;
    border-radius: 50px;
    font-weight: 500;
}

/* 热门新闻 */
.hot-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}
.hot-list li:last-child {
    border-bottom: none;
}
.hot-list li a {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    transition: color var(--transition);
}
.hot-list li a:hover {
    color: var(--primary);
}
.hot-list li .hot-num {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-light);
    margin-top: 2px;
}
.hot-list li:nth-child(1) .hot-num {
    background: var(--primary);
    color: #fff;
}
.hot-list li:nth-child(2) .hot-num,
.hot-list li:nth-child(3) .hot-num {
    background: var(--primary-light);
    color: var(--primary);
}
.hot-list li .hot-title {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-dark);
    flex: 1;
}
.hot-list li .hot-title .date {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    font-weight: 400;
    margin-top: 2px;
}

/* ============================================================
   第三部分：新闻详情页专属（news-detail.html）
   ============================================================ */

/* ----- 详情页布局 ----- */
.detail-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* ----- 右侧内容区 ----- */
.detail-content {
    flex: 1;
    min-width: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 40px 40px 48px;
    box-shadow: var(--shadow);
}

.detail-content .news-tag {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    background: rgba(0, 82, 217, 0.08);
    padding: 4px 18px;
    border-radius: 50px;
    border: 1px solid rgba(0, 82, 217, 0.1);
    margin-bottom: 14px;
}

.detail-content .content-title {
    font-size: 30px;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.3;
    margin-bottom: 12px;
}

.detail-content .meta {
    display: flex;
    align-items: center;
    gap: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    color: var(--text-light);
    font-size: 14px;
}
.detail-content .meta .date {
    display: flex;
    align-items: center;
    gap: 6px;
}
.detail-content .meta .views {
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-content .divider {
    width: 60px;
    height: 3px;
    background: var(--primary);
    border-radius: 4px;
    margin-bottom: 24px;
}

.detail-content .content-body {
    color: var(--text-gray);
    font-size: 16px;
    line-height: 1.9;
}
.detail-content .content-body p {
    margin-bottom: 18px;
}
.detail-content .content-body p:last-child {
    margin-bottom: 0;
}
.detail-content .content-body strong {
    color: var(--text-dark);
}
.detail-content .content-body img {
    width: 100%;
    border-radius: var(--radius);
    margin: 20px 0;
    border: 1px solid var(--border-color);
}

/* 相关新闻 */
.related-news {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}
.related-news .related-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-dark);
}
.related-news .related-title .highlight {
    color: var(--primary);
}
.related-news .related-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 30px;
}
.related-news .related-list li a {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-gray);
    transition: color var(--transition);
    padding: 6px 0;
}
.related-news .related-list li a:hover {
    color: var(--primary);
}
.related-news .related-list li a .rdate {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-light);
}

/* ============================================================
   第四部分：新闻页导航高亮（纯 CSS 控制）
   ============================================================ */
.nav-menu > li > a[href="/news.html"].active {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}
.navbar.scrolled .nav-menu > li > a[href="/news.html"].active {
    color: var(--primary);
    background: rgba(0, 82, 217, 0.06);
}

/* ============================================================
   第五部分：响应式
   ============================================================ */

/* 1024px 以下 */
@media (max-width: 1024px) {
    /* 列表页 */
    .news-sidebar {
        flex: 0 0 260px;
    }
    /* 详情页 */
    .category-sidebar {
        flex: 0 0 240px;
    }
    .related-news .related-list {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* 768px 以下 */
@media (max-width: 768px) {
    /* 列表页 */
    .news-layout {
        flex-direction: column;
        gap: 40px;
    }
    .news-sidebar {
        flex: none;
        width: 100%;
        position: relative;
        top: 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    .sidebar-card {
        margin-bottom: 0;
    }
    .news-item {
        flex-direction: column;
        gap: 8px;
        padding: 20px 0;
    }
    .news-item .news-date {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: auto;
    }
    .news-item .news-date .day {
        font-size: 24px;
    }
    .news-item .news-date .month {
        font-size: 13px;
    }
    .news-item .news-info .title-link h3 {
        font-size: 18px;
    }
    .pagination a,
    .pagination span {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
        padding: 0 8px;
    }
    .pagination .prev,
    .pagination .next {
        min-width: 50px;
        font-size: 13px;
    }

    /* 详情页 */
    .detail-layout {
        flex-direction: column;
        gap: 30px;
    }
    .category-sidebar {
        flex: none;
        width: 100%;
        position: relative;
        top: 0;
        max-height: none;
        padding: 0 0 12px 0;
    }
    .category-sidebar .sidebar-title {
        font-size: 18px;
    }
    .cat-item {
        font-size: 15px;
        padding: 12px 18px;
    }
    .detail-content {
        padding: 24px 20px 32px;
    }
    .detail-content .content-title {
        font-size: 24px;
    }
    .meta {
        flex-wrap: wrap;
        gap: 12px;
    }
}

/* 480px 以下 */
@media (max-width: 480px) {
    /* 列表页 */
    .news-sidebar {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .news-item .news-info .title-link h3 {
        font-size: 16px;
    }
    .news-item .news-info p {
        font-size: 14px;
    }
    .pagination a,
    .pagination span {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
        padding: 0 6px;
    }
    .pagination .prev,
    .pagination .next {
        min-width: 44px;
        font-size: 12px;
    }

    /* 详情页 */
    .detail-content {
        padding: 20px 16px 24px;
    }
    .detail-content .content-title {
        font-size: 20px;
    }
    .detail-content .content-body {
        font-size: 14px;
    }
    .category-sidebar .sidebar-title {
        font-size: 17px;
        padding: 14px 16px;
    }
    .cat-item {
        font-size: 14px;
        padding: 10px 16px;
    }
    .related-news .related-list {
        grid-template-columns: 1fr;
    }
}