/**
 * 新闻正文内容样式
 * ================
 *
 * 为什么需要这个独立文件
 * ----------------------
 * news-detail.html 原本把正文样式写在 <style type="text/tailwindcss"> 里，
 * 但该页面加载的是「预编译」的 tailwind-index.css，并未引入
 * cdn.tailwindcss.com（Tailwind Play CDN）。浏览器无法识别该 type，
 * 会整块忽略这段样式，导致正文里的表格、图片、标题完全没有样式。
 *
 * 本文件是普通的 <link> 样式表，浏览器必定生效。
 *
 * 统一用 #news-content 限定作用域：ID 选择器特异性高于 Tailwind preflight
 * 的元素选择器，可稳定覆盖 preflight 对标题 / 列表 / 引用的重置。
 */

/* ========== 页面装饰类（原 type="text/tailwindcss" 死代码块迁出） ==========
 * 这些类原本写在 news-detail.html / news.html 的 <style type="text/tailwindcss">
 * 里，因缺少 Play CDN 而全部失效。现统一沉淀到普通样式表，
 * 两个新闻页共用，保证观感一致。
 */
.text-shadow { text-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.bg-gradient-blue { background: linear-gradient(135deg, #165DFF 0%, #722ED1 100%); }
.transition-custom { transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.card-shadow { box-shadow: 0 10px 30px -5px rgba(0,0,0,0.1); }
.nav-shadow { box-shadow: 0 4px 20px rgba(0,0,0,0.05); }
.hover-scale { transition: transform 0.3s ease; }
.hover-scale:hover { transform: scale(1.02); }

/* ========== 容器 ========== */
#news-content {
  font-size: 1rem;
  line-height: 1.75;
  color: #4E5969;
  word-break: break-word;
  overflow-wrap: anywhere;
  /* 宽表格 / 代码块在窄屏横向滚动，避免撑破页面布局 */
  overflow-x: auto;
}

/* ========== 段落 ========== */
#news-content p { margin: 0 0 1.25rem; line-height: 1.75; color: #4E5969; }
/* Vditor 空段落占位 <p><br></p> 不应撑开间距 */
#news-content p:empty,
#news-content p > br:only-child { margin-bottom: 0; }

/* ========== 标题 ========== */
#news-content :is(h1,h2,h3,h4,h5,h6) {
  color: #1D2129;
  font-weight: 600;
  line-height: 1.4;
  margin: 2rem 0 1rem;
}
#news-content > :first-child { margin-top: 0; }
#news-content h1 { font-size: 1.75rem; }
#news-content h2 {
  font-size: 1.5rem;
  line-height: 1.35;
  padding-left: 0.875rem;
  border-left: 4px solid #165DFF;
}
#news-content h3 { font-size: 1.25rem; }
#news-content h4 { font-size: 1.125rem; }
#news-content h5 { font-size: 1rem; }
#news-content h6 { font-size: 0.9375rem; color: #4E5969; }

/* ========== 列表 ========== */
#news-content :is(ul,ol) { margin: 0 0 1.25rem; padding-left: 1.4rem; line-height: 1.75; }
#news-content ul { list-style: disc; }
#news-content ol { list-style: decimal; }
#news-content ul ul { list-style: circle; }
#news-content ul ul ul { list-style: square; }
#news-content li { margin-bottom: 0.375rem; }
#news-content li > :is(ul,ol) { margin: 0.375rem 0 0; }
/* Vditor 任务列表 <ul><li data-list="check"> */
#news-content li[data-list="check"] { list-style: none; margin-left: -1.25rem; }

/* ========== 引用 ========== */
#news-content blockquote {
  margin: 1.75rem 0;
  padding: 0.875rem 1.125rem;
  border-left: 4px solid #165DFF;
  background: #F7F8FA;
  border-radius: 0 0.5rem 0.5rem 0;
  color: #4E5969;
}
#news-content blockquote p:last-child { margin-bottom: 0; }

/* ========== 图片 / 视频 ========== */
#news-content :is(img,video) {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.5rem auto;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
#news-content figcaption {
  text-align: center;
  font-size: 0.875rem;
  color: #86909C;
  margin: -0.875rem 0 1.5rem;
}

/* ========== 链接 ========== */
#news-content a {
  color: #165DFF;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}
#news-content a:hover { color: #0E42D2; }

/* ========== 行内格式 ========== */
#news-content strong { font-weight: 600; color: #1D2129; }
#news-content del { color: #86909C; }
#news-content mark {
  background: #FFF3CD;
  color: #1D2129;
  padding: 0 0.25rem;
  border-radius: 0.25rem;
}

/* ========== 行内代码 / 代码块 ========== */
#news-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9375em;
  background: #F2F3F5;
  color: #D14B53;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
}
#news-content pre {
  background: #1D2129;
  color: #F2F3F5;
  padding: 1.25rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1.75rem 0;
  font-size: 0.875rem;
  line-height: 1.7;
}
#news-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
  border-radius: 0;
}

/* ========== 表格 ========== */
#news-content table {
  width: 100%;
  min-width: 480px;
  margin: 1.75rem 0;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #4E5969;
}
#news-content :is(th,td) {
  border: 1px solid #E5E6EB;
  padding: 0.625rem 0.875rem;
  text-align: left;
  vertical-align: top;
}
#news-content th {
  background: #F7F8FA;
  font-weight: 600;
  color: #1D2129;
  white-space: nowrap;
}
/* 斑马纹提升长表格可读性 */
#news-content tbody tr:nth-child(even) { background: #FCFCFD; }
#news-content caption {
  caption-side: bottom;
  padding-top: 0.75rem;
  font-size: 0.875rem;
  color: #86909C;
  text-align: left;
}

/* ========== 分隔线 ========== */
#news-content hr { border: 0; border-top: 1px solid #E5E6EB; margin: 2rem 0; }

/* ========== 摘要导语 ========== */
#news-summary { font-size: 1.0625rem; line-height: 1.8; }

/* ========== 移动端收敛 ========== */
@media (max-width: 640px) {
  #news-content { font-size: 0.9375rem; line-height: 1.7; }
  #news-content h1 { font-size: 1.375rem; }
  #news-content h2 { font-size: 1.1875rem; padding-left: 0.625rem; }
  #news-content h3 { font-size: 1.0625rem; }
  #news-content table { font-size: 0.8125rem; }
  #news-content :is(th,td) { padding: 0.4375rem 0.625rem; }
  #news-summary { font-size: 1rem; }
}
