.news-hub-page {
  --news-accent: var(--brand-gradient-start, var(--color-primary));
  --news-accent-fallback: var(--color-primary);
  --news-accent-use: var(--news-accent, var(--news-accent-fallback));
  --news-cover-aspect: 16 / 9;
  --news-bg: #f8f9fa;
  --news-card-radius: 12px;
  --news-text: #1a1a1a;
  --news-muted: #64748b;
  --news-border: rgba(15, 23, 42, 0.1);
  --news-pill-bg: #e9ecef;
  --news-pill-active: #dee2e6;

  margin: 0 auto;
  padding: 1.75rem var(--layout-page-padding-x, 1rem) 3.5rem;
  max-width: 1120px;
  background: var(--news-bg);
  min-height: 60vh;
  box-sizing: border-box;
}

body[data-page-id="news"] main[data-page-root].news-hub-page {
  gap: 0;
  background: var(--news-bg);
}

.news-hub {
  width: 100%;
  max-width: none;
  margin: 0;
}

.news-hub__title {
  margin: 0 0 1.25rem;
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--news-text);
  letter-spacing: 0.02em;
}

/* ----- Category pills ----- */
.news-hub__filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 0.65rem;
  margin: 0 0 2.25rem;
  padding: 0;
}

.news-hub > .news-hub__filter-bar:first-child {
  margin-top: 0.25rem;
}

.news-hub__filter-pill {
  border: none;
  cursor: pointer;
  padding: 0.5rem 1.05rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  color: #495057;
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease;
}

.news-hub__filter-pill:hover,
.news-hub__filter-pill:focus-visible {
  background: #dde1e5;
  outline: none;
}

.news-hub__filter-pill.is-active {
  background: transparent;
  color: #212529;
  font-weight: 600;
}

/* ----- 安全合规专题标签筛选（二级） ----- */
.news-hub__topic-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.55rem;
  margin: -1.1rem 0 1.65rem;
  padding: 0;
}

.news-hub__topic-filter-pill {
  border: 1px solid rgba(15, 23, 42, 0.1);
  cursor: pointer;
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #495057;
  background: #fff;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.news-hub__topic-filter-pill:hover,
.news-hub__topic-filter-pill:focus-visible {
  border-color: rgba(var(--color-primary-rgb, 17, 163, 185), 0.35);
  color: var(--news-accent-use);
  outline: none;
}

.news-hub__topic-filter-pill.is-active {
  border-color: transparent;
  color: #fff;
  background: var(--news-accent-use);
  font-weight: 600;
}

.news-hub__section--featured {
  margin-bottom: 1.5rem;
}

/* ----- Pinned carousel shell ----- */
.news-hub__featured-host {
  margin: 0;
}

.news-hub__pinned-carousel {
  position: relative;
  border-radius: var(--news-card-radius);
  box-shadow: 0 8px 32px -12px rgba(15, 23, 42, 0.18);
}

.news-hub__pinned-stage {
  position: relative;
}

.news-hub__pinned-viewport {
  position: relative;
  overflow: hidden;
  border-radius: var(--news-card-radius);
  border: 1px solid var(--news-border);
  background: #fff;
  container-type: inline-size;
}

.news-hub__pinned-track {
  position: relative;
}

/* 仅当前条参与排版高度，避免出现纵向滚动条 */
.news-hub__pinned-slide {
  overflow: hidden;
}

.news-hub__pinned-slide[hidden] {
  display: none !important;
}

/* 高度 = 左半 16:9 封面（cqw 为轮播容器宽度） */
.news-hub__pinned-viewport .news-hub__featured {
  border: 0;
  box-shadow: none;
  border-radius: 0;
  width: 100%;
  height: calc(100cqw * 9 / 32);
  max-height: calc(100cqw * 9 / 32);
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}

.news-hub__pinned-viewport .news-hub__featured-media {
  aspect-ratio: unset;
  height: 100%;
  min-height: 0;
}

.news-hub__pinned-viewport .news-hub__featured-img-link {
  position: absolute;
  inset: 0;
  height: auto;
}

.news-hub__pinned-viewport .news-hub__featured-img,
.news-hub__pinned-viewport .news-hub__featured-img-placeholder {
  height: 100%;
}

.news-hub__pinned-viewport .news-hub__featured-body {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  justify-content: center;
}

.news-hub__pinned-viewport .news-hub__btn-primary {
  margin-top: 0;
}

.news-hub__pinned-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--news-accent-use);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.news-hub__pinned-nav:hover,
.news-hub__pinned-nav:focus-visible {
  background: #fff;
  outline: 2px solid var(--news-accent-use);
  outline-offset: 2px;
}

.news-hub__pinned-nav--prev {
  left: 0.65rem;
}

.news-hub__pinned-nav--next {
  right: 0.65rem;
}

.news-hub__pinned-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.5rem;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  padding: 0;
  margin: 0;
  pointer-events: none;
}

.news-hub__pinned-dots .news-hub__pinned-dot {
  pointer-events: auto;
}

.news-hub__pinned-dot {
  width: 0.45rem;
  height: 0.45rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 163, 185, 0.35);
  cursor: pointer;
}

.news-hub__pinned-dot.is-active {
  background: var(--news-accent-use);
  width: 1.1rem;
}

@media (prefers-reduced-motion: reduce) {
  .news-hub__pinned-dot,
  .news-hub__pinned-nav {
    transition: none;
  }
}

/* ----- Featured horizontal card ----- */

.news-hub__featured {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  align-items: start;
  background: #fff;
  border-radius: var(--news-card-radius);
  box-shadow: 0 8px 32px -12px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  border: 1px solid var(--news-border);
}

.news-hub__featured-media {
  position: relative;
  width: 100%;
  aspect-ratio: var(--news-cover-aspect);
  background: #e9ecef;
  overflow: hidden;
}

.news-hub__featured-img-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  outline-offset: 2px;
}

.news-hub__featured-img-link:focus-visible {
  outline: 2px solid var(--news-accent-use);
}

.news-hub__featured-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  vertical-align: middle;
}

.news-hub__featured-img-placeholder {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.news-hub__featured-body {
  padding: clamp(1.25rem, 2.4vw, 1.75rem) clamp(1.35rem, 2.6vw, 2rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.65rem;
  min-height: 100%;
  box-sizing: border-box;
}

.news-hub__meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
}

.news-hub__meta-row .news-hub__category {
  flex-shrink: 0;
}

.news-hub__meta-date {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--news-muted);
}

.news-hub__date-icon {
  display: flex;
  color: #94a3b8;
}

.news-hub__date-icon svg {
  display: block;
}

.news-hub__featured-title {
  margin: 0;
  font-size: var(--heading-h3-size);
  font-weight: var(--heading-h3-weight);
  line-height: var(--heading-h3-line-height);
  color: var(--news-text);
}

.news-hub__featured-title a {
  color: inherit;
  text-decoration: none;
}

.news-hub__featured-title a:hover,
.news-hub__featured-title a:focus-visible {
  color: var(--news-accent-use);
  text-decoration: underline;
  outline: none;
}

.news-hub__featured-summary {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--news-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-hub__btn-primary {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.35rem;
  border-radius: 8px;
  background: var(--news-accent-use);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.news-hub__btn-primary:hover,
.news-hub__btn-primary:focus-visible {
  filter: brightness(1.05);
  outline: 2px solid var(--news-accent-use);
  outline-offset: 2px;
}

/* ----- 分类标签（正文区左上角，不压在封面上）----- */
.news-hub__category {
  display: inline-block;
  align-self: flex-start;
  margin: 0;
  padding: 0.28rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #fff;
  background: var(--news-accent-use);
  border-radius: 999px;
  line-height: 1.2;
}

/* 下载中心等仍叠在封面上的角标 */
.news-hub__badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2;
  pointer-events: none;
  padding: 0.28rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #fff;
  background: var(--news-accent-use);
  line-height: 1.2;
}

.news-hub__badge--pill {
  border-radius: 999px;
}

/* ----- Card grid ----- */
.news-hub__grid-wrap {
  margin-top: 0.25rem;
}

.news-hub__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
}

.news-hub__card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--news-card-radius);
  border: 1px solid var(--news-border);
  box-shadow: 0 4px 20px -8px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  min-height: 0;
}

.news-hub__card-media {
  position: relative;
  aspect-ratio: var(--news-cover-aspect);
  background: #e9ecef;
  overflow: hidden;
}

.news-hub__card-img-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  outline-offset: 2px;
}

.news-hub__card-img-link:focus-visible {
  outline: 2px solid var(--news-accent-use);
}

.news-hub__card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  vertical-align: middle;
}

.news-hub__card-img-placeholder {
  width: 100%;
  height: 100%;
  min-height: 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.news-hub__card-body {
  padding: 1.1rem 1.2rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.news-hub__card-title {
  margin: 0;
  font-size: var(--heading-h5-size);
  font-weight: var(--heading-h5-weight);
  line-height: var(--heading-h5-line-height);
  color: var(--news-text);
}

.news-hub__card-title a {
  color: inherit;
  text-decoration: none;
}

.news-hub__card-title a:hover,
.news-hub__card-title a:focus-visible {
  color: var(--news-accent-use);
  text-decoration: underline;
  outline: none;
}

.news-hub__card-summary {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--news-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.news-hub__card-more {
  margin-top: 0.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--news-accent-use);
  text-decoration: none;
}

.news-hub__card-more:hover,
.news-hub__card-more:focus-visible {
  text-decoration: underline;
  outline: none;
}

.news-hub__empty {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--news-muted);
}

.news-hub__pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1rem;
  margin-top: 1.75rem;
  padding-top: 0.25rem;
}

.news-hub__page-btn {
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: var(--news-text);
  border-radius: 8px;
  padding: 0.45rem 0.95rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.news-hub__page-btn:hover:not(:disabled),
.news-hub__page-btn:focus-visible:not(:disabled) {
  border-color: rgba(var(--color-primary-rgb), 0.35);
  color: var(--news-accent-use);
  outline: none;
}

.news-hub__page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.news-hub__page-meta {
  font-size: 0.875rem;
  color: var(--news-muted);
}

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

  .news-hub__pinned-viewport .news-hub__featured {
    height: auto;
    max-height: none;
  }

  .news-hub__pinned-viewport .news-hub__featured-media {
    aspect-ratio: var(--news-cover-aspect);
    height: auto;
  }

  .news-hub__pinned-viewport .news-hub__featured-body {
    height: auto;
    overflow: visible;
  }

  .news-hub__pinned-dots {
    position: static;
    padding: 0.5rem 0 0;
    pointer-events: auto;
  }

  .news-hub__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .news-hub__featured-title {
    font-size: 1.15rem;
  }

  .news-hub__featured-summary {
    -webkit-line-clamp: 3;
  }

  .news-hub__filter-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .news-hub__filter-bar::-webkit-scrollbar {
    display: none;
  }

  .news-hub__filter-pill {
    flex: 0 0 auto;
  }
}

/* ----- News article detail ----- */
body[data-page-id="news-detail"] main[data-page-root] {
  margin: 0 auto;
  padding: 1.75rem var(--layout-page-padding-x, 1rem) 3.5rem;
  max-width: 800px;
  background: #fff;
  box-sizing: border-box;
}

.news-article {
  width: 100%;
}

.news-article__back {
  display: inline-block;
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--news-muted, #64748b);
  text-decoration: none;
  transition: color 0.15s ease;
}

.news-article__back:hover,
.news-article__back:focus-visible {
  color: var(--news-accent-use, var(--color-primary, #0d9488));
  outline: none;
}

.news-article__header {
  margin: 0 0 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--news-border, rgba(15, 23, 42, 0.1));
}

.news-article__title {
  margin: 0 0 0.85rem;
  font-size: clamp(1.45rem, 3.2vw, 1.85rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--news-text, #1a1a1a);
  letter-spacing: 0.01em;
}

.news-article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin: 0 0 1rem;
}

.news-article__date {
  font-size: 0.9rem;
  color: var(--news-muted, #64748b);
}

.news-article__category,
.news-article__topic {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
}

.news-article__category {
  color: #0f766e;
  background: rgba(13, 148, 136, 0.1);
}

.news-article__topic {
  color: #475569;
  background: #f1f5f9;
}

.news-article__summary {
  margin: 0;
  font-size: 1rem;
  line-height: 1.65;
  color: #475569;
}

.news-article__body {
  font-size: 1rem;
  line-height: 1.8;
  color: #334155;
  word-break: break-word;
}

.news-article__body p {
  margin: 0 0 1rem;
}

.news-article__body .ql-align-center {
  text-align: center;
}

.news-article__body .ql-align-right {
  text-align: right;
}

.news-article__body .ql-align-justify {
  text-align: justify;
}

.news-article__body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
  border-radius: 8px;
}

.news-article__body .ql-align-center img {
  margin-left: auto;
  margin-right: auto;
}

.news-article__body .ql-align-right img {
  margin-left: auto;
  margin-right: 0;
}

.news-article__body img[width] {
  max-width: 100%;
  height: auto;
}

.news-article__body h2,
.news-article__body h3,
.news-article__body h4 {
  margin: 1.75rem 0 0.75rem;
  color: var(--news-text, #1a1a1a);
  line-height: 1.4;
}

.news-article__body ul,
.news-article__body ol {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}

.news-article__body a {
  color: var(--news-accent-use, var(--color-primary, #0d9488));
  text-decoration: underline;
  text-underline-offset: 2px;
}
