/* ==========================================================================
   World Star - news.css
   新闻栏目：列表页（分类筛选 / 卡片网格 / 分页）与详情页
   依赖 common.css 中的 CSS 变量与通用组件，完全响应式
   ========================================================================== */

/* ---------- 分类筛选 Tabs ---------- */
.news-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
}

.news-tab {
  display: inline-block;
  padding: 9px 22px;
  border: 1px solid var(--gray-border);
  border-radius: 999px;
  background: var(--white);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.news-tab:hover {
  border-color: var(--red);
  color: var(--red);
}

.news-tab.is-current {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.news-tab.is-current:hover { color: var(--white); }

/* ---------- 新闻卡片网格 ---------- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.news-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.news-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.news-card__pic {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--gray-bg);
}

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

.news-card:hover .news-card__pic img { transform: scale(1.05); }

.news-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 22px 24px;
}

.news-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 10px;
  font-size: 13px;
  color: #8a94a6;
}

.news-card__meta .cat { color: var(--red); font-weight: 600; }

.news-card__title {
  margin: 0 0 10px;
  font-size: 17px;
  line-height: 1.45;
}

.news-card__title a { color: var(--heading); }
.news-card__title a:hover { color: var(--red); }

.news-card__desc {
  margin: 0 0 16px;
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card__more {
  margin-top: auto;
  font-size: 14px;
  font-weight: 600;
  color: var(--red);
}

.news-card__more:hover { color: var(--red-dark); }

/* ---------- 空状态 ---------- */
.news-empty {
  margin: 0;
  padding: 60px 20px;
  border: 1px dashed var(--gray-border);
  border-radius: var(--radius);
  text-align: center;
  color: #8a94a6;
  font-size: 15px;
}

/* ---------- 分页 ---------- */
.news-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 44px;
}

.news-pagination a,
.news-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.news-pagination a:hover {
  border-color: var(--red);
  color: var(--red);
}

.news-pagination .page-num-current {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

/* ---------- 详情页 ---------- */
.news-detail {
  max-width: 820px;
  margin: 0 auto;
}

.news-detail__title {
  font-size: 32px;
  margin-bottom: 14px;
}

.news-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-bottom: 22px;
  font-size: 14px;
  color: #8a94a6;
}

.news-detail__meta .cat { color: var(--red); font-weight: 600; }

.news-detail__pic {
  margin: 0 0 26px;
  border-radius: var(--radius);
  overflow: hidden;
}

.news-detail__content {
  font-size: 16px;
  color: var(--text);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.news-detail__content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.news-detail__content h2 { font-size: 24px; margin-top: 1.6em; }
.news-detail__content h3 { font-size: 20px; margin-top: 1.4em; }

.news-detail__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-border);
}

.news-pn { max-width: 48%; }

.news-pn--next {
  margin-left: auto;
  text-align: right;
}

.news-pn .label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8a94a6;
}

.news-pn a {
  color: var(--heading);
  font-weight: 600;
  line-height: 1.5;
}

.news-pn a:hover { color: var(--red); }

/* ---------- 详情页：正文 + 相关文章侧栏 ---------- */
.news-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 40px;
  align-items: start;
}

.news-layout .news-detail {
  max-width: none;
  margin: 0;
}

.news-layout__aside .news-related {
  margin-top: 0;
}

/* 侧栏内相关文章单列排列，卡片样式不变 */
.news-layout__aside .news-grid {
  grid-template-columns: 1fr;
  gap: 20px;
}

/* ---------- 相关阅读 ---------- */
.news-related { margin-top: 60px; }

.news-related .section-head {
  margin-bottom: 28px;
}

.news-related .news-grid { gap: 22px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1199px) {
  .news-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .news-layout__aside { margin-top: 50px; }
  .news-layout__aside .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 991px) {
  .news-grid { grid-template-columns: repeat(2, 1fr); gap: 22px; }
  .news-detail__title { font-size: 28px; }
}

@media (max-width: 640px) {
  .news-grid { grid-template-columns: 1fr; gap: 20px; }
  .news-tabs { gap: 8px; margin-bottom: 26px; }
  .news-tab { padding: 8px 16px; font-size: 13px; }
  .news-detail__title { font-size: 24px; }
  .news-pn { max-width: 100%; }
}

@media (max-width: 480px) {
  .news-layout__aside .news-grid { grid-template-columns: 1fr; }
}
