
.news-filter {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 3rem;
    position: relative;
    z-index: 100;
}

.filter-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 1rem;
}

.filter-tab {
    padding: 0.5rem 1.5rem;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 25px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.filter-tab:hover {
    color: var(--primary-color);
    background: rgba(0, 86, 179, 0.05);
}

.filter-tab.active {
    color: white;
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.filter-tab .badge {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.news-item {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.news-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.news-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-item:hover .news-image img {
    transform: scale(1.05);
}

.news-category-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--accent-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.news-date {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.news-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* --- 1. 新闻标题设置 (固定2行) --- */
.news-title {
    /* 字体与排版基础 */
    font-size: 1.25rem; /* 假设字体大小，按需调整 */
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;

    /* --- 核心逻辑开始 --- */

    /* A. 设置行高 (这是计算基准) */
    line-height: 1.4;

    /* B. 限制最多显示2行 + 省略号 */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;

    /* C. 强制最少占用2行高度 */
    /* 计算公式：行高(1.4) * 行数(2) = 2.8em */
    min-height: 2.8em;

    /* D. 防止长单词(如型号)撑破布局 */
    word-break: break-word;

    /* --- 核心逻辑结束 --- */
}

.news-item:hover .news-title {
    color: var(--primary-color);
}

/* --- 2. 新闻简介设置 (固定2行) --- */
.news-summary {
    /* 字体与排版基础 */
    font-size: 1rem; /* 基础字体大小 */
    color: #666;
    margin-bottom: 1rem;

    /* --- 核心逻辑开始 --- */

    /* A. 设置行高 (正文通常比标题宽松一点) */
    line-height: 1.6;

    /* B. 限制最多显示2行 + 省略号 */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;

    /* C. 强制最少占用2行高度 */
    /* 计算公式：行高(1.6) * 行数(2) = 3.2em */
    min-height: 3.2em;

    /* --- 核心逻辑结束 --- */
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.news-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.85rem;
}

.news-author i {
    color: var(--accent-color);
}

.news-stats {
    display: flex;
    gap: 1rem;
    color: #999;
    font-size: 0.85rem;
}

.pagination {
    justify-content: center;
    margin-top: 3rem;
}

.page-link {
    color: var(--primary-color);
    border: 1px solid #e9ecef;
    margin: 0 0.2rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.page-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-item.active .page-link {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.sidebar {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    position: sticky;
    top: 100px;
}

.sidebar-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--accent-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.popular-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.popular-item:last-child {
    border-bottom: none;
}

.popular-item:hover {
    padding-left: 0.5rem;
}

.popular-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.popular-content {
    flex-grow: 1;
}

.popular-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    margin-bottom: 0.3rem;
    transition: color 0.3s ease;
}

.popular-item:hover .popular-title {
    color: var(--primary-color);
}

.popular-date {
    font-size: 0.75rem;
    color: #999;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.tag {
    padding: 0.3rem 0.8rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 15px;
    font-size: 0.85rem;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
}

.tag:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .sidebar {
        position: static;
        margin-top: 2rem;
    }

    .filter-tabs {
        justify-content: center;
    }
}
