/* ============================================
   新闻资讯页面样式 - 对齐 trae-v3
   文件: news.css
   适用范围: news_index.html、news_detail.html
   色调统一走 common.css CSS 变量
   ============================================ */

/* 页面布局 */
.news-page { padding: 20px 0; }
.news-page-inner { display: flex; gap: 24px; }

/* 左侧边栏 */
.news-sidebar { width: 260px; flex-shrink: 0; }
.news-cat-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}
.news-cat-box h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--bg);
}
.news-cat-list { list-style: none; padding: 0; margin: 0; }
.news-cat-list li { margin-bottom: 8px; }
.news-cat-list li:last-child { margin-bottom: 0; }
.news-cat-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text-2);
    border-radius: var(--radius);
    transition: all .2s;
}
.news-cat-list a:hover,
.news-cat-list a.active {
    background: var(--brand);
    color: #fff;
}
.news-cat-list a .count {
    font-size: 12px;
    color: var(--text-3);
}
.news-cat-list a.active .count,
.news-cat-list a:hover .count { color: rgba(255,255,255,.75); }

/* 热门文章 */
.news-hot-list .hot-item-side {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--bg);
    align-items: flex-start;
}
.news-hot-list .hot-item-side:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.hot-item-side .hot-rank {
    width: 22px;
    height: 22px;
    background: var(--border);
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-3);
    font-weight: 600;
    flex-shrink: 0;
}
.hot-item-side:nth-child(1) .hot-rank { background: var(--accent); color: #fff; }
.hot-item-side:nth-child(2) .hot-rank { background: #F59E0B; color: #fff; }
.hot-item-side:nth-child(3) .hot-rank { background: #16A34A; color: #fff; }
.hot-item-side h4 {
    font-size: 13px;
    color: var(--text-2);
    font-weight: 400;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hot-item-side h4 a { color: var(--text-2); }
.hot-item-side h4 a:hover { color: var(--brand); }

/* 主区 */
.news-main-area { flex: 1; min-width: 0; }
.news-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
}
.news-list-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}
.news-filter-bar {
    display: flex;
    gap: 16px;
    align-items: center;
}
.news-filter-bar a {
    font-size: 14px;
    color: var(--text-3);
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    transition: all .2s;
}
.news-filter-bar a:hover,
.news-filter-bar a.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

/* 新闻卡片列表 */
.news-card-list { display: flex; flex-direction: column; gap: 16px; }
.news-card-item {
    display: flex;
    gap: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: box-shadow .2s;
}
.news-card-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.news-card-img {
    width: 240px;
    height: 150px;
    flex-shrink: 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg);
}
.news-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.news-card-item:hover .news-card-img img { transform: scale(1.05); }
.news-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.news-card-tag {
    display: inline-block;
    padding: 2px 10px;
    background: var(--brand);
    color: #fff;
    font-size: 12px;
    border-radius: 2px;
    margin-bottom: 10px;
    align-self: flex-start;
}
.news-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 10px;
    line-height: 1.4;
}
.news-card-title a { color: var(--text); }
.news-card-title a:hover { color: var(--brand); }
.news-card-summary {
    font-size: 13px;
    color: var(--text-3);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
    flex: 1;
}
.news-card-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-3);
}
.news-card-meta span { display: inline-flex; align-items: center; gap: 4px; }

/* 空数据 */
.news-empty {
    text-align: center;
    padding: 80px 0;
    color: var(--text-3);
    background: var(--bg-card);
    border-radius: var(--radius);
}
.news-empty i { font-size: 36px; margin-bottom: 12px; display: block; }

/* 分页 */
.news-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--bg);
}
.pager .news-pagination a,
.pager .news-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    color: var(--text-2);
    background: #fff;
    transition: all .2s;
}
.pager .news-pagination a:hover {
    border-color: var(--brand);
    color: var(--brand);
}
.pager .news-pagination li.active span,
.pager .news-pagination li.active a {
    background: #fff;
    color: var(--brand);
    border-color: var(--brand);
    font-weight: 500;
}
.pager .news-pagination .disabled {
    color: var(--text-4);
    cursor: not-allowed;
}

/* ============================================
   详情页
   ============================================ */
.news-detail-wrap { flex: 1; min-width: 0; }
.news-article {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
}
.news-article-header { text-align: center; margin-bottom: 30px; padding-bottom: 24px; border-bottom: 1px solid var(--bg); }
.news-article-header .article-tag {
    display: inline-block;
    padding: 3px 14px;
    background: var(--brand);
    color: #fff;
    font-size: 12px;
    border-radius: 2px;
    margin-bottom: 14px;
}
.news-article-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    margin: 0 0 16px;
}
.article-meta-bar {
    display: flex;
    justify-content: center;
    gap: 24px;
    font-size: 13px;
    color: var(--text-3);
    flex-wrap: wrap;
}
.article-meta-bar span { display: inline-flex; align-items: center; gap: 4px; }

/* 封面图 */
.article-cover {
    margin-bottom: 25px;
    text-align: center;
}
.article-cover img {
    max-width: 100%;
    border-radius: var(--radius);
    max-height: 400px;
    object-fit: cover;
}

/* 文章摘要 */
.article-summary {
    border-left: 3px solid var(--brand);
    background: var(--bg);
    padding: 12px 18px;
    color: var(--text-2);
    margin: 0 0 20px;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 14px;
    line-height: 1.7;
}
.article-summary strong { color: var(--text); margin-right: 4px; }

/* 文章正文 */
.article-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-2);
}
.article-content p { margin-bottom: 16px; }
.article-content img {
    max-width: 100%;
    border-radius: var(--radius);
    margin: 20px 0;
}
.article-content h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: 24px 0 12px;
    padding-left: 12px;
    border-left: 4px solid var(--brand);
}
.article-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 20px 0 10px;
}
.article-content strong { color: var(--text); font-weight: 600; }

/* 分享栏 */
.article-share {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid var(--bg);
}
.article-share a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-2);
    border: 1px solid var(--border);
    transition: all .2s;
    cursor: pointer;
}
.article-share a:hover { border-color: var(--brand); color: var(--brand); }

/* 上一篇/下一篇 */
.article-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--bg);
    gap: 20px;
}
.article-nav-prev,
.article-nav-next { max-width: 48%; flex: 1; }
.article-nav-prev span,
.article-nav-next span {
    font-size: 12px;
    color: var(--text-3);
    display: block;
    margin-bottom: 4px;
}
.article-nav-prev a,
.article-nav-next a {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-nav-prev a:hover,
.article-nav-next a:hover { color: var(--brand); }
.article-nav-next { text-align: right; }
.article-nav-none { color: var(--text-4) !important; font-style: italic; }

/* 相关文章 */
.news-related {
    margin-top: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.news-related h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--bg);
}
.related-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.related-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.related-list a {
    font-size: 14px;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.related-list a::before {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--text-4);
    border-radius: 50%;
    flex-shrink: 0;
}
.related-list a:hover { color: var(--brand); }
.related-list span { font-size: 12px; color: var(--text-3); flex-shrink: 0; }

/* 响应式 */
@media (max-width: 992px) {
    .news-page-inner { flex-direction: column; }
    .news-sidebar { width: 100%; }
    .news-card-img { width: 180px; height: 110px; }
    .news-article { padding: 24px 20px; }
    .news-article-header h1 { font-size: 20px; }
}
@media (max-width: 768px) {
    .news-card-item { flex-direction: column; }
    .news-card-img { width: 100%; height: 180px; }
    .article-meta-bar { gap: 14px; }
    .article-nav { flex-direction: column; }
    .article-nav-prev, .article-nav-next { max-width: 100%; text-align: left; }
}
