/* =========================================================
   SUNMATE News — Coze-faithful styling (scoped, no Bootstrap)
   Listing scope:  .news-page
   Detail scope:    .news-detail
   ========================================================= */

/* ---------- Shared font stack ---------- */
.news-page,
.news-detail {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    'PingFang SC', 'Microsoft YaHei', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* =========================================================
   LISTING PAGE
   ========================================================= */

/* Breadcrumb (sits just under the global nav) */
.news-breadcrumb {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 16px;
  font-size: 13px;
  color: #6B7280;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #F3F4F6;
}
.news-breadcrumb a {
  color: #6B7280;
  text-decoration: none;
  transition: color .2s;
}
.news-breadcrumb a:hover { color: #2563EB; }
.news-breadcrumb .nb-sep {
  display: inline-flex;
  align-items: center;
  color: #D1D5DB;
}
.news-breadcrumb .nb-sep svg { width: 12px; height: 12px; }
.news-breadcrumb .nb-current {
  color: #1E40AF;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hero — pure gradient (no banner image, matching Coze default) */
.news-hero {
  position: relative;
  min-height: 280px;
  display: flex;
  align-items: center;
  background: linear-gradient(90deg, rgba(37, 99, 235, .92), rgba(30, 64, 175, .82));
}
.news-hero__inner {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}
.news-hero h1 {
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 8px;
}
.news-hero p {
  color: rgba(255, 255, 255, .8);
  font-size: 15px;
  max-width: 640px;
  margin: 0;
  line-height: 1.6;
}
@media (min-width: 768px) {
  .news-hero h1 { font-size: 30px; }
}

/* Category filter bar (全部 / 公司新闻 / 产品消息 / 活动公告) */
.news-cats {
  background: #fff;
  border-bottom: 1px solid #F3F4F6;
}
.news-cats__bar {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
@media (min-width: 640px) {
  .news-cats__bar { padding: 16px 24px; gap: 10px; }
}
.news-cat {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  font-size: 13px;
  color: #4B5563;
  text-decoration: none;
  border: 1px solid #E5E7EB;
  border-radius: 999px;
  transition: color .2s, border-color .2s, background .2s;
  white-space: nowrap;
}
@media (min-width: 640px) {
  .news-cat { font-size: 14px; padding: 8px 20px; }
}
.news-cat:hover { color: #2563EB; border-color: #2563EB; }
.news-cat.is-active {
  color: #fff;
  background: #1E40AF;
  border-color: #1E40AF;
  font-weight: 500;
}

/* Content container */
.news-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 16px;
}
@media (min-width: 640px) {
  .news-container { padding: 48px 24px; }
}

/* Grid */
.news-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 640px) {
  .news-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}
@media (min-width: 1024px) {
  .news-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Card */
.news-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #F3F4F6;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .25s, border-color .25s, border-left-width .25s,
    border-left-color .25s;
  border-left: 3px solid transparent;
}
.news-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
  border-left: 3px solid #2563EB;
}

/* Image area — fixed height, always present */
.news-card__img {
  width: 100%;
  height: 176px;          /* h-44 */
  flex-shrink: 0;
  background: #F0F4F8;
  overflow: hidden;
}
.news-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}
.news-card:hover .news-card__img img { transform: scale(1.05); }
.news-card__img .news-noimg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.news-card__img .news-noimg svg { width: 40px; height: 40px; color: #D1D5DB; }

/* Body */
.news-card__body {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
}
@media (min-width: 640px) { .news-card__body { padding: 20px; } }

.news-card__date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #9CA3AF;
  margin-bottom: 8px;
  flex-shrink: 0;
}
.news-card__date svg { width: 12px; height: 12px; }

.news-card__title {
  font-size: 13px;
  font-weight: 500;
  color: #1A1A2E;
  line-height: 1.5;
  margin: 0 0 8px;
  transition: color .2s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}
@media (min-width: 640px) { .news-card__title { font-size: 14px; } }
.news-card:hover .news-card__title { color: #2563EB; }

.news-card__summary {
  font-size: 11px;
  color: #9CA3AF;
  line-height: 1.6;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
@media (min-width: 640px) { .news-card__summary { font-size: 12px; } }

.news-card__more {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #2563EB;
  transition: gap .2s;
  flex-shrink: 0;
}
@media (min-width: 640px) { .news-card__more { font-size: 12px; } }
.news-card:hover .news-card__more { gap: 8px; }
.news-card__more svg { width: 12px; height: 12px; }

/* Empty state */
.news-empty {
  text-align: center;
  padding: 64px 16px;
  background: #fff;
  border: 1px solid #F3F4F6;
  border-radius: 8px;
}
.news-empty svg { width: 64px; height: 64px; color: #2563EB; opacity: .4; margin: 0 auto 16px; }
.news-empty p { margin: 0; }
.news-empty .ne-title { font-size: 18px; font-weight: 500; color: #1E40AF; margin-bottom: 8px; }
.news-empty .ne-sub { font-size: 13px; color: #6B7280; }

/* Pagination (matches Coze Pagination component) */
.news-pager {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 40px;
}
@media (min-width: 640px) {
  .news-pager { flex-direction: row; align-items: center; justify-content: space-between; }
}
.news-pager__total { font-size: 13px; color: #6B7280; }
.news-pager__nums {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.news-pager__nums .pg {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #1F2937;
  cursor: pointer;
  transition: background .2s;
}
.news-pager__nums .pg:hover:not(:disabled) { background: #F3F4F6; }
.news-pager__nums .pg.is-active { background: #1E40AF; color: #fff; font-weight: 500; }
.news-pager__nums .pg:disabled { opacity: .3; cursor: not-allowed; }
.news-pager__nums .pg svg { width: 16px; height: 16px; }
.news-pager__nums .pg-ellipsis {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #9CA3AF;
}

/* =========================================================
   DETAIL PAGE
   ========================================================= */
.news-detail { background: #F5F7FA; min-height: 100vh; }

.news-detail__container {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 16px;
}

.news-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #2563EB;
  text-decoration: none;
  margin-bottom: 24px;
}
.news-back:hover { text-decoration: underline; }
.news-back svg { width: 16px; height: 16px; }

.news-article {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #F3F4F6;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  overflow: hidden;
}
.news-article__cover {
  width: 100%;
  height: 256px;          /* h-64 */
  overflow: hidden;
}
.news-article__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.news-article__body { padding: 24px; }
@media (min-width: 768px) { .news-article__body { padding: 32px; } }

.news-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #6B7280;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.news-meta .badge {
  background: rgba(37, 99, 235, .1);
  color: #2563EB;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}
.news-meta .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.news-meta .meta-item svg { width: 12px; height: 12px; }

.news-detail h1 {
  font-size: 24px;
  font-weight: 700;
  color: #1A1A2E;
  margin: 0 0 24px;
  line-height: 1.3;
}
@media (min-width: 768px) { .news-detail h1 { font-size: 30px; } }

.news-summary {
  color: #6B7280;
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #F3F4F6;
}

.news-prose { color: #1A1A2E; font-size: 15px; line-height: 1.8; }
.news-prose p { margin: 0 0 16px; }
.news-prose h2 { font-size: 18px; font-weight: 600; margin: 24px 0 12px; color: #1A1A2E; }
.news-prose img { width: 100%; border-radius: 8px; margin: 16px 0; }
.news-prose ul { margin: 0 0 16px; padding-left: 22px; }
.news-prose li { margin-bottom: 6px; }

/* Detail gallery / videos */
.news-gallery { margin-top: 32px; display: flex; flex-direction: column; gap: 16px; }
.news-gallery img { width: 100%; border-radius: 8px; display: block; }
.news-video {
  margin-top: 32px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}
.news-video iframe { width: 100%; height: 100%; border: 0; }

/* CTA — 需要技术支持或样品？ */
.news-cta {
  margin-top: 32px;
  background: linear-gradient(90deg, rgba(30, 64, 175, .92), rgba(37, 99, 235, .82));
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
  color: #fff;
}
.news-cta h2 {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px;
}
.news-cta p {
  color: rgba(255, 255, 255, .85);
  font-size: 14px;
  margin: 0 0 20px;
}
.news-cta .btn-contact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: #1E40AF;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 26px;
  border-radius: 999px;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
}
.news-cta .btn-contact:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}
.news-cta .btn-contact svg { width: 16px; height: 16px; }

/* ── 上一篇 / 下一篇 导航 ─────────────────────────────── */
.news-pager {
  display: flex;
  gap: 16px;
  margin-top: 32px;
}
.pager-item {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid #e6e8ee;
  border-radius: 12px;
  background: #fff;
  color: #1c2433;
  text-decoration: none;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.pager-item:hover {
  border-color: #2563eb;
  box-shadow: 0 6px 18px rgba(37, 99, 235, .12);
  transform: translateY(-2px);
}
.pager-item svg { width: 20px; height: 20px; color: #2563eb; flex: 0 0 auto; }
.pager-next { justify-content: flex-end; text-align: right; }
.pager-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.pager-label {
  font-size: 12px;
  color: #8a93a6;
  margin-bottom: 4px;
}
.pager-title {
  font-size: 15px;
  font-weight: 600;
  color: #1c2433;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.pager-disabled {
  visibility: hidden;
  border: 0;
  padding: 0;
  background: none;
}
@media (max-width: 640px) {
  .news-pager { gap: 10px; }
  .pager-item { padding: 14px; }
  .pager-title { font-size: 13px; max-width: 42vw; }
}
