/* =================================================================
   新闻区 — 列表页 / 详情页 / 标签页 / 首页露出区块
   服务端渲染页面（/news/*）与首页 home-teaser 共用本文件。

   深蓝皮肤令牌与 `about-blue.css` 的 `body.about-page` 是同一套视觉。
   注意：两边是镜像，改一处要改另一处。后续可抽成共享皮肤文件。
================================================================= */

html.news-document { background: #153057; --bg-0: #153057; }

body.news-page {
  --command-ink: #153057;
  --command-panel: #254c75;
  --command-red: #ff526e;
  --command-cyan: #73e6ff;
  --command-blue: #638dff;
  --command-line: #a3d6ff40;
  --accent: #73e6ff;
  --accent-2: #638dff;
  --accent-3: #73e6ff;
  --grad: linear-gradient(120deg, #73e6ff, #638dff);
  --text: #f5faff;
  --text-dim: #c2d5e8;
  --text-mute: #b2cce0;
  --surface: #ffffff09;
  --surface-hi: #ffffff12;
  --border: #a3d6ff40;
  --border-hi: #a3d6ff88;
  background: #153057;
  color: #f5faff;
  color-scheme: dark;
}

/* ---------- 外壳 ---------- */
/* global.css 给 main 加了 max-width:1320px + 左右 padding，内容页必须自己解除，
   否则 .news-shell 的 min(calc(100% - 64px), 1280px) 会叠加出双份留白
   （about.css 对 .about-main 做的是同一件事）。 */
.news-page .news-main { position: relative; z-index: 2; max-width: none; margin: 0; padding: 0; }
.news-shell { width: min(calc(100% - 64px), 1280px); margin-inline: auto; }
.news-shell--narrow { width: min(calc(100% - 64px), 820px); margin-inline: auto; }
.news-section { position: relative; padding: 80px 0; border-top: 1px solid #a8d8ff38; box-shadow: inset 0 1px #ffffff06; }
.news-section--flush { padding-top: 0; border-top: 0; }
.news-index {
  display: inline-block; margin-bottom: 18px; padding: 7px 10px;
  color: #a0eaff; font: 600 .68rem/1.4 var(--font-mono, monospace); letter-spacing: .12em;
  background: #ffffff07; border: 1px solid #a3d6ff40; border-radius: 5px;
}
.news-hero { padding: 132px 0 44px; border-top: 0; box-shadow: none; }
.news-hero h1 { margin: 0; font-size: clamp(2.4rem, 4.6vw, 4.2rem); line-height: 1.08; letter-spacing: -.045em; }
.news-hero__lead { max-width: 620px; margin: 20px 0 0; color: #c2d5e8; font-size: 1.02rem; line-height: 1.85; }

/* 导航与页脚在深蓝底上的适配（页面自身仍用 global.css/components.css 的结构） */
.news-page .site-nav,
.news-page .nav__drawer { background: rgba(21, 48, 87, .96); }
.news-page .btn--primary { background: #ff526e; color: #102b50; font-weight: 750; box-shadow: 0 6px 26px #ff526e30; }
.news-page .btn--primary:hover { box-shadow: 0 12px 30px #ff526e44; filter: brightness(1.06); }
.news-page .content-footer { background: #163657; color: #c2d5e8; border-color: #a3d6ff40; }
.news-page .content-footer a,
.news-page .content-footer p,
.news-page .content-footer span { color: #c2d5e8; }
.news-page :focus-visible { outline: 2px solid #b5f4ff; outline-offset: 4px; }

/* 未配图时的品牌占位（PRD 7.1：封面缺失用品牌占位图）。
   放在媒体框内部绝对定位，尺寸与 .news-card__media / .news-pinned__media 一致。 */
.news-media-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 38%, #2a5682, #1b3b63 72%);
  color: #73e6ff4d;
}
.news-media-empty svg { width: 34%; max-width: 108px; min-width: 48px; height: auto; }

/* ---------- 存量文案 ---------- */
.news-count {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  margin: 34px 0 18px; padding-top: 22px; border-top: 1px solid #a8d8ff38;
  color: #b2cce0; font: 500 .74rem/1.6 var(--font-mono, monospace); letter-spacing: .08em;
}
.news-count b { color: #a0eaff; font-weight: 600; }

/* ---------- 标签 ---------- */
.news-tag {
  display: inline-block; padding: 3px 11px; border-radius: 999px;
  font-size: .68rem; font-weight: 600; line-height: 1.7; letter-spacing: .04em; white-space: nowrap;
}
.news-tag--company { color: #73e6ff; background: #73e6ff14; border: 1px solid #73e6ff55; }
.news-tag--product { color: #ff8fa3; background: #ff526e14; border: 1px solid #ff526e55; }
.news-tag--insight { color: #6bffaf; background: #6bffaf14; border: 1px solid #6bffaf55; }

/* ---------- 置顶横幅 ---------- */
.news-pinned {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  margin: 0 0 34px; overflow: hidden; text-decoration: none;
  background: linear-gradient(135deg, #2f5b89, #224771);
  border: 1px solid #a3d6ff55; border-radius: 16px;
  box-shadow: 0 16px 42px #071c3420, inset 0 1px #e3f3ff22;
  transition: border-color .24s ease, background .24s ease, transform .24s ease;
}
.news-pinned:hover { background: #315d87; border-color: #a0eaff88; transform: translateY(-2px); }
.news-pinned__media { position: relative; min-height: 280px; overflow: hidden; background: #1b3b63; }
.news-pinned__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .92; transition: transform .5s var(--ease-out, cubic-bezier(.16,1,.3,1)); }
.news-pinned:hover .news-pinned__media img { transform: scale(1.04); }
.news-pinned__flag {
  position: absolute; top: 16px; left: 16px; z-index: 2; padding: 5px 12px; border-radius: 999px;
  background: #ff526e; color: #102b50; font-size: .66rem; font-weight: 700; line-height: 1.6; letter-spacing: .08em;
}
.news-pinned__body { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 36px clamp(24px, 3vw, 44px); }
.news-pinned__body h2 { margin: 0; color: #f5faff; font-size: clamp(1.4rem, 2.2vw, 2.05rem); line-height: 1.35; letter-spacing: -.02em; }
.news-pinned__body p { margin: 0; color: #c2d5e8; font-size: .94rem; line-height: 1.85; }
.news-pinned__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: #a8c4dd; font-size: .78rem; }
.news-pinned__more { color: #a0eaff; font-size: .86rem; font-weight: 600; }

/* 置顶区：第 1 条用上方大横幅保层次，其余复用 .news-card 的整行卡片 + 置顶徽标。
   用整行卡片而不是两列网格，是为了 1/2/3 条置顶都成立——两列网格在只有 2 条时右侧会空半格。 */
.news-pinned-area { margin: 0 0 34px; }
.news-pinned-area .news-pinned { margin: 0; }
/* 徽标在大横幅上是绝对定位，回到列表卡片里要变回行内流。 */
.news-pinned__flag--inline {
  position: static;
  padding: 3px 10px;
  font-size: .68rem;
}

/* ---------- 列表：单列横向卡片 ---------- */
.news-list { display: grid; gap: 0; }
.news-card {
  display: grid; grid-template-columns: 322px minmax(0, 1fr); gap: 0;
  padding: 22px 0; border-top: 1px solid #a3d6ff26; text-decoration: none;
  transition: background .24s ease;
}
.news-card:last-child { border-bottom: 1px solid #a3d6ff26; }
.news-card:hover { background: #ffffff06; }
.news-card__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; background: #1b3b63; }
.news-card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease-out, cubic-bezier(.16,1,.3,1)); }
.news-card:hover .news-card__media img { transform: scale(1.05); }
.news-card__body { display: flex; flex-direction: column; gap: 11px; min-width: 0; padding: 2px 0 2px clamp(20px, 2.4vw, 34px); }
.news-card__top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.news-card__date { color: #a8c4dd; font: 500 .76rem/1.6 var(--font-mono, monospace); letter-spacing: .04em; }
.news-card__title {
  margin: 0; color: #f5faff; font-size: clamp(1.08rem, 1.5vw, 1.34rem); line-height: 1.45; letter-spacing: -.015em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-card:hover .news-card__title { color: #a0eaff; }
.news-card__summary {
  margin: 0; color: #c2d5e8; font-size: .9rem; line-height: 1.8;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.news-card__more { margin-top: auto; padding-top: 6px; color: #a0eaff; font-size: .82rem; font-weight: 600; opacity: .85; }

/* ---------- 空态 ---------- */
.news-empty { padding: 70px 24px; border: 1px dashed #a3d6ff40; border-radius: 16px; text-align: center; color: #b2cce0; }
.news-empty strong { display: block; margin-bottom: 10px; color: #f5faff; font-size: 1.05rem; }

/* ---------- 分页 ---------- */
.news-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 44px 0 0; }
.news-pager a,
.news-pager span {
  min-width: 40px; padding: 9px 13px; text-align: center; text-decoration: none;
  color: #c2d5e8; font: 500 .82rem/1.4 var(--font-mono, monospace);
  border: 1px solid #a3d6ff40; border-radius: 10px;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}
.news-pager a:hover { color: #a0eaff; background: #ffffff09; border-color: #a0eaff88; }
.news-pager .is-current { background: #73e6ff; border-color: #73e6ff; color: #0b2340; font-weight: 700; }
.news-pager .is-disabled { opacity: .35; }
.news-pager .is-gap { border: 0; background: transparent; color: #7f97b0; }

/* ---------- 详情页 ---------- */
.news-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: #a8c4dd; font-size: .78rem; }
.news-crumb a { color: #a0eaff; text-decoration: none; }
.news-crumb a:hover { text-decoration: underline; }
.news-crumb i { font-style: normal; color: #6f8aa6; }
.news-detail h1 { margin: 0; font-size: clamp(1.9rem, 3.4vw, 3rem); line-height: 1.22; letter-spacing: -.03em; }
.news-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px;
  margin: 22px 0 0; padding-bottom: 24px; border-bottom: 1px solid #a3d6ff26;
  color: #a8c4dd; font: 500 .78rem/1.6 var(--font-mono, monospace); letter-spacing: .04em;
}
.news-figure { margin: 32px 0 0; overflow: hidden; background: #1b3b63; border: 1px solid #a3d6ff40; border-radius: 16px; }
.news-figure img { display: block; width: 100%; height: auto; }
.news-figure figcaption { padding: 12px 16px; color: #9db6cf; font-size: .76rem; line-height: 1.7; border-top: 1px solid #a3d6ff26; }

/* 正文排版 */
.news-prose { margin-top: 34px; color: #c2d5e8; font-size: 1.02rem; line-height: 1.95; }
.news-prose > * + * { margin-top: 20px; }
.news-prose h2 { margin: 44px 0 0; color: #f5faff; font-size: clamp(1.24rem, 1.9vw, 1.6rem); line-height: 1.45; letter-spacing: -.02em; }
.news-prose h3 { margin: 32px 0 0; color: #e8f4ff; font-size: 1.1rem; line-height: 1.5; }
.news-prose p { margin: 0; }
.news-prose strong { color: #f5faff; font-weight: 600; }
.news-prose ul,
.news-prose ol { margin: 0; padding-left: 22px; }
.news-prose li + li { margin-top: 10px; }
.news-prose li::marker { color: #73e6ff; }
.news-prose blockquote {
  margin: 28px 0 0; padding: 18px 22px; color: #d9e7f5;
  background: #ffffff07; border-left: 3px solid #73e6ff; border-radius: 0 12px 12px 0;
}
.news-prose blockquote p { margin: 0; }
.news-prose img { display: block; width: 100%; height: auto; margin-top: 26px; border: 1px solid #a3d6ff40; border-radius: 14px; }
.news-prose a { color: #a0eaff; text-decoration: underline; text-underline-offset: 3px; }
.news-prose code {
  padding: 2px 7px; color: #a0eaff; font-family: var(--font-mono, monospace); font-size: .88em;
  background: #ffffff10; border: 1px solid #a3d6ff33; border-radius: 6px;
}
.news-prose pre { margin: 26px 0 0; padding: 18px; overflow-x: auto; background: #10284a; border: 1px solid #a3d6ff33; border-radius: 12px; }
.news-prose pre code { padding: 0; background: none; border: 0; font-size: .84rem; line-height: 1.7; }
.news-prose hr { margin: 40px 0 0; border: 0; border-top: 1px solid #a3d6ff33; }
.news-prose table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.news-prose th,
.news-prose td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #a3d6ff26; }
.news-prose th { color: #a0eaff; font-weight: 600; }

/* 文末 CTA */
.news-cta {
  margin: 52px 0 0; padding: 32px; text-align: center;
  background: radial-gradient(ellipse at 85% 30%, #638dff22, transparent 55%), #285381;
  border: 1px solid #a3d6ff55; border-radius: 16px;
}
.news-cta strong { display: block; color: #f5faff; font-size: 1.18rem; letter-spacing: -.015em; }
.news-cta p { margin: 10px 0 20px; color: #c2d5e8; font-size: .9rem; line-height: 1.8; }

/* 相关阅读 */
.news-related { margin: 56px 0 0; padding-top: 32px; border-top: 1px solid #a3d6ff33; }
.news-related h2 { margin: 0 0 20px; color: #a0eaff; font: 600 .72rem/1.4 var(--font-mono, monospace); letter-spacing: .16em; text-transform: uppercase; }
.news-related__list { display: grid; gap: 10px; }
.news-related__item {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 20px;
  padding: 15px 18px; text-decoration: none;
  background: #ffffff06; border: 1px solid #a3d6ff33; border-radius: 12px;
  transition: border-color .2s ease, background .2s ease;
}
.news-related__item:hover { background: #ffffff0d; border-color: #a0eaff88; }
.news-related__item span { color: #f5faff; font-size: .94rem; line-height: 1.6; }
.news-related__item time { color: #a8c4dd; font: 500 .74rem/1.6 var(--font-mono, monospace); white-space: nowrap; }
.news-share { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 28px; color: #9db6cf; font-size: .78rem; }

/* ---------- 首页露出区块 ---------- */
/* 整块（含 section）一起隐藏：无已发布文章或后端不可用时首页不留空白 */
.news-teaser-section[hidden] { display: none !important; }
.news-teaser { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 18px 28px; margin-bottom: 26px; }
.news-teaser h2 { margin: 14px 0 0; font-size: clamp(1.5rem, 2.4vw, 2.1rem); letter-spacing: -.03em; }
.news-teaser__more { display: inline-flex; align-items: center; gap: 10px; padding-bottom: 6px; color: var(--accent, #73e6ff); font-size: .88rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.news-teaser__more span { transition: transform .24s ease; }
.news-teaser__more:hover span { transform: translateX(4px); }
.news-teaser__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.news-teaser__card {
  display: flex; flex-direction: column; overflow: hidden; text-decoration: none;
  background: linear-gradient(135deg, #2a5682, #224771);
  border: 1px solid #a3d6ff40; border-radius: 16px;
  box-shadow: 0 16px 42px #071c3420, inset 0 1px #e3f3ff22;
  transition: border-color .24s ease, background .24s ease, transform .24s ease;
}
.news-teaser__card:hover { background: #315d87; border-color: #a0eaff88; transform: translateY(-3px); }
.news-teaser__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #1b3b63; }
.news-teaser__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease-out, cubic-bezier(.16,1,.3,1)); }
.news-teaser__card:hover .news-teaser__media img { transform: scale(1.05); }
.news-teaser__body { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 22px; }
.news-teaser__body .news-tag { align-self: flex-start; }
.news-teaser__body h3 {
  margin: 0; color: #f5faff; font-size: 1rem; line-height: 1.5; letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-teaser__card:hover .news-teaser__body h3 { color: #a0eaff; }
.news-teaser__date { color: #a8c4dd; font: 500 .74rem/1.6 var(--font-mono, monospace); }

/* 首页是更深的深色底（#081a33 起），卡片沿用首页自己的面板色，
   否则会比首页其它卡片明显偏亮、显得串台。 */
.home-page .news-teaser__card {
  background: linear-gradient(135deg, rgba(28, 61, 94, .9), rgba(16, 39, 68, .96));
  border-color: rgba(160, 222, 255, .3);
  box-shadow: 0 16px 42px #071c342b, inset 0 1px #e3f3ff22;
}
.home-page .news-teaser__card:hover { background: #264c70; border-color: #a2eaff; }
.home-page .news-teaser__card:hover .news-teaser__body h3 { color: #a2eaff; }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .news-teaser__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .news-teaser__list > :last-child { display: none; }
}
@media (max-width: 900px) {
  .news-pinned { grid-template-columns: 1fr; }
  .news-pinned__media { min-height: 200px; }
  .news-card { grid-template-columns: 1fr; gap: 16px; padding: 20px 0; }
  .news-card__body { padding-left: 0; }
  .news-teaser { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .news-shell,
  .news-shell--narrow { width: calc(100% - 32px); }
  .news-section { padding: 48px 0; }
  .news-hero { padding: 112px 0 32px; }
}
@media (max-width: 600px) {
  .news-teaser__list { grid-template-columns: 1fr; }
  .news-teaser__list > :last-child { display: flex; }
  .news-pager a,
  .news-pager span { min-width: 36px; padding: 8px 10px; }
  .news-cta { padding: 24px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .news-card__media img,
  .news-pinned__media img,
  .news-teaser__media img { transition: none; }
  .news-card:hover .news-card__media img,
  .news-pinned:hover .news-pinned__media img,
  .news-teaser__card:hover .news-teaser__media img { transform: none; }
  .news-pinned:hover,
  .news-teaser__card:hover { transform: none; }
}
@media print {
  body.news-page,
  .news-page .content-footer { background: #fff !important; color: #111 !important; }
  .news-teaser,
  .news-cta,
  .news-share,
  .news-pager { display: none !important; }
}

/* ============================================================
   星舰皮肤覆盖：红青配色，贴合 whynotai.cn 星舰首页
   （覆盖上方深蓝配色，不改结构与布局）
   ============================================================ */
body.news-page {
  background: #02070e;
  --command-ink: #02070e;
  --command-panel: rgba(13, 25, 43, 0.86);
  --command-blue: #ff454a;
  --accent: #73e6ff;
  --accent-2: #ff454a;
  --accent-3: #73e6ff;
  --grad: linear-gradient(120deg, #73e6ff, #ff454a);
  --command-line: rgba(78, 151, 190, 0.26);
}
.news-page .site-nav, .news-page .nav__drawer { background: rgba(7, 12, 24, 0.96); }
.news-page .content-footer { background: #0a1420; border-color: rgba(78, 151, 190, 0.26); }
.news-pinned { background: linear-gradient(145deg, rgba(13, 25, 43, 0.86), rgba(7, 12, 24, 0.76)); border: 1px solid rgba(78, 151, 190, 0.26); }
.news-pinned:hover { background: #122238; border-color: rgba(0, 212, 255, 0.55); }
.news-card__media, .news-pinned__media, .news-figure, .news-teaser__media { background: #0a1420; }
.news-prose pre { background: #0a1420; border: 1px solid rgba(78, 151, 190, 0.2); }
.news-cta { background: radial-gradient(ellipse at 85% 30%, rgba(255, 69, 74, 0.16), transparent 55%), #0a1420; border: 1px solid rgba(78, 151, 190, 0.26); }
.news-media-empty { background: radial-gradient(ellipse at 50% 38%, #122238, #0a1420 72%); }
.news-teaser__card { background: linear-gradient(145deg, rgba(13, 25, 43, 0.86), rgba(7, 12, 24, 0.76)); border: 1px solid rgba(78, 151, 190, 0.26); }
.news-teaser__card:hover { background: #122238; border-color: rgba(0, 212, 255, 0.55); }
.home-page .news-teaser__card:hover { background: #122238; border-color: rgba(255, 69, 74, 0.55); }
