/* ==========================================================================
   RedAI 官网 · 新闻正文「扩展块」样式  news-blocks.css
   --------------------------------------------------------------------------
   作用域：news-detail.html 的正文容器 #articleBody
   来源：2026-11-20 新增（Markdown 指令块）——视频 / 代码 / 图组 / CTA / 引导步骤 / 提示框
   约定：所有类名 nw- 前缀，不与既有 news.css 冲突；只在本容器内生效，
        避免影响站点其它页面。
   ========================================================================== */

#articleBody .nw-h2 {
  font-size: 24px;
  line-height: 1.35;
  margin: 34px 0 12px;
  letter-spacing: -.3px;
}

#articleBody .nw-h3 {
  font-size: 17px;
  margin: 24px 0 8px;
}

#articleBody .nw-p {
  margin: 0 0 14px;
}

#articleBody .nw-p.nw-lead {
  font-size: 16px;
  padding-left: 14px;
  border-left: 3px solid var(--brand-2, var(--brand-2));
}

#articleBody .nw-ul,
#articleBody .nw-ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

#articleBody .nw-ul li,
#articleBody .nw-ol li {
  margin: 6px 0;
}

#articleBody .nw-quote {
  margin: 22px 0;
  padding: 16px 20px;
  border-left: 4px solid var(--brand-1, var(--brand-1));
  border-radius: 0 10px 10px 0;
  font-size: 16px;
}

#articleBody .nw-quote cite {
  display: block;
  margin-top: 8px;
  font-size: 12.5px;
  font-style: normal;
  opacity: .65;
}

/* 图片 / 视频 */
#articleBody .nw-img,
#articleBody .nw-video {
  margin: 22px 0;
}

#articleBody .nw-img img,
#articleBody .nw-video video {
  width: 100%;
  border-radius: 12px;
  display: block;
  background: #EFE9E5;
}

#articleBody .nw-img figcaption,
#articleBody .nw-video figcaption {
  margin-top: 8px;
  font-size: 12.5px;
  opacity: .65;
}

/* 代码块 */
#articleBody .nw-code {
  margin: 20px 0;
  background: #1E1B1A;
  border-radius: 12px;
  overflow: hidden;
}

#articleBody .nw-code figcaption {
  font-family: var(--mono);
  font-size: 11.5px;
  color: #9C938E;
  padding: 10px 16px;
  border-bottom: 1px solid #2C2827;
  letter-spacing: .06em;
}

#articleBody .nw-code pre {
  margin: 0;
  padding: 16px;
  overflow: auto;
}

#articleBody .nw-code code {
  font-family: var(--mono);
  font-size: 13px;
  color: #EFE9E5;
  line-height: 1.65;
  background: none;
  padding: 0;
}

/* 图组 */
#articleBody .nw-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
}

#articleBody .nw-gallery img {
  width: 100%;
  border-radius: 10px;
  background: #EFE9E5;
  aspect-ratio: 4/3;
  object-fit: cover;
}

/* CTA 按钮 */
#articleBody .nw-cta-wrap {
  margin: 24px 0;
}

#articleBody .nw-cta {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14.5px;
  text-decoration: none;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2), #FF4D57);
  color: var(--white);
  box-shadow: 0 6px 18px rgba(200, 30, 42, .22);
  transition: transform .18s ease, box-shadow .18s ease;
}

@media (hover: hover) {
  #articleBody .nw-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(200, 30, 42, .28);
  }
}

#articleBody .nw-cta--ghost {
  background: var(--white);
  color: var(--brand-1, var(--brand-1));
  border: 1.5px solid var(--brand-2, var(--brand-2));
  box-shadow: none;
}

/* 引导步骤 */
#articleBody .nw-guide {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 20px 0;
  padding: 14px 16px;
  background: #FFF7EC;
  border: 1px dashed #E8C48C;
  border-radius: 12px;
}

#articleBody .nw-guide-step {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #C99B52;
  color: var(--white);
  font-family: var(--mono);
  font-size: 13px;
  display: grid;
  place-items: center;
  font-weight: 700;
}

#articleBody .nw-guide-text {
  color: #7A5B22;
  font-size: 14px;
}

/* 提示框 */
#articleBody .nw-note {
  margin: 20px 0;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 14px;
}

#articleBody .nw-note--info {
  background: #EEF6FF;
  border-left: 3px solid #3B82F6;
  color: #1E4E8C;
}

#articleBody .nw-note--warn {
  background: #FFF1F0;
  border-left: 3px solid var(--brand-2, var(--brand-2));
  color: #8C2B22;
}

#articleBody .nw-note--ok {
  background: #ECFDF3;
  border-left: 3px solid #16A34A;
  color: #14532D;
}

/* 封面缺图占位（2026-11-20）：不留浏览器破图图标，换成品牌渐变 + 说明 */
#articleBody ~ * .cover-fallback,
.detail-cover .cover-fallback {
  position: relative;
  background: linear-gradient(135deg, #F3EDE9, #E7DED8);
  border-radius: 12px;
  min-height: 220px;
  display: grid;
  place-items: center;
}

.detail-cover .cover-fallback::after {
  content: attr(data-note);
  font-size: 12.5px;
  letter-spacing: .08em;
  color: #9A908A;
}

/* 窄屏 */
@media (max-width: 520px) {
  #articleBody .nw-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
  #articleBody .nw-h2 {
    font-size: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #articleBody .nw-cta {
    transition: none;
  }
}
