/* 资讯中心：文章卡片列表 */

.news-section {
  padding: 120px 0 90px;
}
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.news-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  display: flex;
  flex-direction: column;
}
.news-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-200);
}
.news-thumb {
  position: relative;
  width: 100%;
  height: 196px;
  background: linear-gradient(135deg, #2563EB 0%, #3B82F6 50%, #8B5CF6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.news-thumb svg {
  width: 46px;
  height: 46px;
  color: rgba(255, 255, 255, 0.92);
  position: relative;
  z-index: 1;
}
.news-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.07) 0 14px, transparent 14px 28px);
}
.news-card:nth-child(3n+2) .news-thumb {
  background: linear-gradient(135deg, #0EA5A4 0%, #22C55E 100%);
}
.news-card:nth-child(3n) .news-thumb {
  background: linear-gradient(135deg, #7C3AED 0%, #A78BFA 100%);
}
.news-body {
  padding: 22px 24px 26px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.news-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.6;
  margin-bottom: 0;
  /* 标题最多两行，超出显示省略号；保留两行高度使卡片等高 */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  /* 兜底：不支持 line-clamp 时也不会超出两行（行高 1.6 × 2 = 3.2em） */
  min-height: 3.2em;
  max-height: 3.2em;
}

/* 有封面时图片铺满缩略图区 */
.news-thumb img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 数据加载失败时的提示 */
.news-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 0;
  color: var(--text-secondary);
  font-size: 15px;
}

/* 渲染后的进场动画，动画结束由 JS 移除该类 */
.news-card--in {
  animation: newsCardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes newsCardIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 980px) {
  .news-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .news-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .news-section { padding: 100px 0 60px; }
}
@media (max-width: 560px) {
  .news-grid { grid-template-columns: 1fr; }
  .news-thumb { height: 180px; }
}
