/* ============================================================
   新闻详情正文 — 独立配套样式表 (news-detail.css)
   作用域：仅作用于 .news-detail-content（CMS 富文本正文容器）
   设计令牌沿用 style.css 的 :root 变量，保持整站视觉统一
   ============================================================ */

/* ---------- 基础排版 ---------- */
.news-detail-content {
  font-family: var(--font-body);
  font-size: 1.0625rem;        /* ≈17px */
  font-weight: 400;
  line-height: 1.95;
  color: #33433b;
  word-break: break-word;
  overflow-wrap: break-word;
}

.news-detail-content p {
  margin: 0 0 1.25em;
  text-align: justify;
  text-justify: inter-ideograph;
}

/* ---------- 标题层级（CMS 富文本常见 h2/h3/h4） ---------- */
.news-detail-content h2,
.news-detail-content h3,
.news-detail-content h4 {
  font-family: var(--font-display);
  color: var(--forest);
  font-weight: 600;
  line-height: 1.45;
  margin: 2em 0 0.85em;
}

.news-detail-content h2 {
  font-size: 1.5rem;
  padding-left: 0.7rem;
  border-left: 4px solid var(--leaf);
}

.news-detail-content h3 {
  font-size: 1.25rem;
}

.news-detail-content h4 {
  font-size: 1.1rem;
  color: var(--leaf);
}

/* ---------- 链接 ---------- */
.news-detail-content a {
  color: var(--leaf);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  font-weight: 500;
}

.news-detail-content a:hover {
  color: var(--gold);
}

/* ---------- 强调 ---------- */
.news-detail-content strong {
  color: var(--ink);
  font-weight: 600;
}

.news-detail-content em {
  font-style: normal;
  color: var(--berry);
  font-family: var(--font-data);
}

/* ---------- 列表 ---------- */
.news-detail-content ul,
.news-detail-content ol {
  margin: 0 0 1.25em;
  padding-left: 1.6em;
}

.news-detail-content li {
  margin: 0.45em 0;
}

.news-detail-content ul li::marker {
  color: var(--leaf);
}

/* ---------- 图片 ---------- */
.news-detail-content img {
  max-width: 100%;
  height: auto;
  margin: 1.6em auto;
  border-radius: 8px;
  box-shadow: 0 6px 22px rgba(43, 114, 46, 0.10);
}

.news-detail-content figure {
  margin: 1.8em 0;
  text-align: center;
}

.news-detail-content figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.5em;
}

/* ---------- 表格 ---------- */
.news-detail-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.8em 0;
  font-size: 0.98rem;
  overflow: hidden;
  border-radius: 8px;
}

.news-detail-content th,
.news-detail-content td {
  border: 1px solid #dbe7dc;
  padding: 0.65em 0.95em;
  text-align: left;
  vertical-align: top;
}

.news-detail-content thead th {
  background: var(--forest);
  color: #fff;
  font-weight: 600;
}

.news-detail-content tbody tr:nth-child(even) {
  background: var(--paper);
}

/* ---------- 引用 ---------- */
.news-detail-content blockquote {
  margin: 1.8em 0;
  padding: 1.05em 1.4em;
  border-left: 4px solid var(--gold);
  background: var(--mist);
  border-radius: 0 8px 8px 0;
  color: var(--ink);
}

.news-detail-content blockquote p:last-child {
  margin-bottom: 0;
}

/* ---------- 代码 ---------- */
.news-detail-content code {
  font-family: "Courier New", Consolas, monospace;
  background: var(--mist);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.92em;
  color: var(--berry);
}

.news-detail-content pre {
  background: #1f2a24;
  color: #e9f3ea;
  padding: 1.1em 1.3em;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5em 0;
}

.news-detail-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: 0.92em;
}

/* ---------- 分隔线 ---------- */
.news-detail-content hr {
  border: 0;
  border-top: 1px solid rgba(55, 128, 57, 0.18);
  margin: 2.2em 0;
}

/* ---------- 上一篇 / 下一篇 上下文导航 ---------- */
.news-detail-nav {
  margin: 2.2rem 0 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.news-detail-nav-link {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  padding: 0.85rem 1.15rem;
  background: var(--mist);
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

a.news-detail-nav-link:hover {
  background: #e7f0e5;
  transform: translateX(2px);
}

.news-detail-nav-label {
  flex-shrink: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--leaf);
  letter-spacing: 0.05em;
}

.news-detail-nav-title {
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.news-detail-nav-link.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.news-detail-nav-link.is-disabled .news-detail-nav-label {
  color: var(--muted);
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .news-detail-content {
    font-size: 1rem;
    line-height: 1.85;
  }
  .news-detail-content h2 { font-size: 1.3rem; }
  .news-detail-content h3 { font-size: 1.15rem; }
  .news-detail-content h4 { font-size: 1.05rem; }
  .news-detail-content img { margin: 1.3em auto; }
}
