/* ============================================================
   Megatex Blanket — 新闻列表/详情页样式
   设计依据：13_毯子独立站/新闻 - 副本.psd（1920×2011）
   结构：Hero横幅(1920×450+20%遮罩) / 2列卡片(652×446) / 分页 / 文章页
   色板：页面纯白 / 卡片#fdfdfd / 按钮#2c2a25（与全站 --ink 一致）
   ============================================================ */

/* ---------- 1. Hero Banner（列表页） ---------- */
.news-hero {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  min-height: clamp(280px, 26vw, 358px);
  overflow: hidden;
  background: #2c2a25; /* 图未加载时兜底深色，避免白字闪没 */
}
.news-hero-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
/* PSD 矩形2：#2c2a25 均匀 20% 遮罩 */
.news-hero::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(44, 42, 37, .2);
}
.news-hero-inner {
  position: relative; z-index: 1;
  text-align: center;
  padding: 48px 24px;
  max-width: 1000px;
}
.news-hero-title {
  color: #fff;
  font-size: clamp(20px, 3.4vw, 38px);
  letter-spacing: 1px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .30);
}
.news-hero-sub {
  color: rgba(255, 255, 255, .88);
  font-size: clamp(14px, 1.1vw, 16px);
  line-height: 1.7;
  margin-top: 18px;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .25);
}
/* hero 内面包屑（与 about/customization 页一致的白色样式） */
.news-hero .crumb { margin-top: 22px; }
.news-hero .crumb ol {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 10px;
  list-style: none; padding: 0; margin: 0;
  font-size: 14px;
}
.news-hero .crumb li { display: flex; align-items: center; gap: 10px; color: rgba(255, 255, 255, .92); }
.news-hero .crumb li + li::before { content: "/"; color: rgba(255, 255, 255, .55); }
.news-hero .crumb a { color: rgba(255, 255, 255, .9); }
.news-hero .crumb a:hover { color: #fff; text-decoration: underline; }

/* ---------- 2. 新闻卡片网格（PSD：2列 652×446，列距42 行距56） ---------- */
.news-body { background: #fff; padding: 72px 0 96px; }
.news-container {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
}
.n-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 56px 42px;
  /* 关键：禁用 Grid stretch 对齐，每张卡按内容实际高度渲染
     —— 避免个别卡片因富文本残留标签导致盒模型异常时，整行被拉到异常高度造成排版变形 */
  align-items: start;
}

/* 卡片：#fdfdfd 底 + 14px 圆角 + 柔和阴影（PSD 矩形19，下方有淡阴影） */
.n-card {
  background: #fdfdfd;
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(44, 42, 37, .06);
  padding: 14px;
  transition: transform .3s ease, box-shadow .3s ease;
  /* 兜底：明确高度按内容，防御 Grid stretch + 未闭合 HTML 标签造成的循环拉高 */
  height: auto;
  min-height: 0;
  align-self: start;
}
.n-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 36px rgba(44, 42, 37, .12);
}
.n-card a { display: block; color: inherit; }

/* 卡片图：627×216（≈2.9:1 宽幅，PSD 矩形20） */
.n-ph {
  aspect-ratio: 627 / 216;
  border-radius: 16px;
  overflow: hidden;
  background: #efedea;
}
.n-ph img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .45s ease;
}
.n-card:hover .n-ph img { transform: scale(1.05); }
.n-nopic {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #999; font-size: 14px;
}

.n-info { padding: 18px 12px 26px; }
/* 标题：2行截断并固定双行高，保证多卡片按钮对齐 */
.n-title {
  font-size: 22px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
  transition: color .2s;
}
.n-card a:hover .n-title { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.n-intro {
  font-size: 14px; line-height: 1.7; color: #767676;
  margin-top: 12px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
  /* 兜底：长英文/URL 不溢出卡片；配合客户端 150 字截断双保险 */
  word-break: break-word;
  overflow-wrap: break-word;
}
/* 兜底：strip_tags 后若只剩空格，会输出空 <p>。用 :empty 消掉避免 margin-top:12px 留空缝 */
.n-intro:empty { display: none; margin: 0; }
/* EXPLORE ARTICLE 按钮（PSD 矩形21：167×43 深色 #2c2a25 白字） */
.n-more {
  display: inline-block;
  margin-top: 20px;
  padding: 13px 28px;
  background: var(--ink); color: #fff;
  border-radius: 6px;
  font-size: 12px; font-weight: 700;
  letter-spacing: 1.5px;
  transition: background .2s, transform .2s;
}
.n-card a:hover .n-more { background: var(--ink-2); transform: translateY(-1px); }

.n-empty {
  grid-column: 1 / -1;
  text-align: center; padding: 70px 20px;
  color: #666; font-size: 15px;
}

/* ---------- 3. 分页（PSD 矩形25：36px 高，当前页深色填充，其余描边） ---------- */
.pagination { display: flex; justify-content: center; margin-top: 72px; }
.pagination ul { display: flex; align-items: center; gap: 8px; list-style: none; }
.pagination li { display: flex; }
.pagination a,
.pagination li > span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 10px;
  border-radius: 6px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 13px; color: var(--ink);
  transition: background .2s, color .2s, border-color .2s;
}
.pagination a:hover { border-color: var(--ink); }
.pagination li.current a,
.pagination li > span {
  background: var(--ink); color: #fff; border-color: var(--ink);
  font-weight: 600;
}

/* ============================================================
   详情页（文章）
   ============================================================ */

/* ---------- 4. 面包屑条（与产品详情 show-crumb 同款） ---------- */
.na-crumb { background: var(--surface); border-bottom: 1px solid var(--line); }
.na-crumb ol {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 4px 12px;
  padding: 14px 0;
  font-size: 13px; color: #666;
  list-style: none;
}
.na-crumb li { display: flex; align-items: center; gap: 12px; }
.na-crumb li + li::before { content: "/"; color: #bbb; }
.na-crumb a { color: #666; }
.na-crumb a:hover { color: var(--ink); text-decoration: underline; }
.na-crumb .cur {
  color: var(--ink); max-width: 420px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- 5. 文章主体（与新闻列表页同宽 1346px） ---------- */
.na-article { background: #fff; padding: 52px 0 72px; }
.na-article .news-container { max-width: 1200px; }

.na-head { text-align: center; }
.na-title {
  font-size: clamp(18px, 2.8vw, 28px);
  line-height: 1.35;
}
.na-meta {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 10px;
  margin-top: 16px;
  font-size: 14px; color: #8a857b;
}
.na-date { color: #8a857b; }
.na-cate { color: var(--ink); font-weight: 600; }
.na-views { color: #8a857b; }
.na-dot { color: #c8c3b8; }

/* 封面大图（960×420 ≈ 2.29:1） */
.na-cover {
  margin: 32px 0 8px;
  border-radius: 12px;
  overflow: hidden;
  background: #efedea;
}
.na-cover img { width: 100%; height: auto; }

/* 正文 rich text：白底编辑式排版 */
.na-body {
  margin-top: 32px;
  font-size: 16px; line-height: 1.85; color: var(--text);
  word-wrap: break-word;
}
.na-body p { margin: 0 0 16px; }
.na-body h2 { font-size: 24px; margin: 30px 0 14px; }
.na-body h3 { font-size: 19px; margin: 24px 0 12px; }
.na-body img { max-width: 100%; height: auto; border-radius: 10px; margin: 6px 0; }
.na-body a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.na-body ul, .na-body ol { padding-left: 26px; margin: 0 0 16px; }
.na-body ul { list-style: disc; }
.na-body ol { list-style: decimal; }
.na-body li { margin: 0 0 8px; }
.na-body blockquote {
  margin: 20px 0; padding: 14px 22px;
  border-left: 3px solid var(--ink);
  background: #faf9f7; border-radius: 0 8px 8px 0;
  color: #555;
}
.na-body table { width: 100%; border-collapse: collapse; margin: 18px 0; }
.na-body td, .na-body th { border: 1px solid var(--line); padding: 8px 12px; font-size: 14px; }

/* ---------- 6. 上一篇 / 下一篇 ---------- */
.na-pn {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 56px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}
.na-pn-item {
  display: flex; flex-direction: column; gap: 8px;
  min-width: 0; /* 网格子项默认 min-width:auto 会被 nowrap 标题撑破，必须显式归零 */
  padding: 18px 22px;
  background: #fdfdfd;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color .2s, background .2s;
}
a.na-pn-item:hover { border-color: var(--ink); background: #faf9f7; }
.na-next { text-align: right; }
.na-pn-label {
  font-size: 12px; font-weight: 700; letter-spacing: 1.2px;
  color: #9a948a; text-transform: uppercase;
}
.na-pn-title {
  font-size: 15px; font-weight: 600; color: var(--ink);
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- 7. Latest News（沿用列表卡视觉的小卡 4 列） ---------- */
.na-latest { background: var(--bg); padding: 68px 0 84px; }
.na-latest-title {
  text-align: center;
  font-size: clamp(22px, 2.4vw, 30px);
}
.na-latest-title::after {
  content: ""; display: block;
  width: 48px; height: 3px;
  background: var(--ink);
  margin: 14px auto 0;
}
.na-latest .n-grid { margin-top: 40px; }
.n-grid--sm { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 22px; }

/* 小卡：仅图 + 标题，无摘要/按钮 */
.n-card--sm { padding: 12px; }
.n-card--sm .n-info { padding: 14px 8px 16px; }
.n-card--sm .n-title { font-size: 15px; line-height: 1.45; min-height: 2.9em; }

/* ---------- 滚动入场动画 ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .n-grid--sm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .news-body { padding: 48px 0 72px; }
  .n-grid { gap: 36px 28px; }
  .na-article { padding: 40px 0 56px; }
}
@media (max-width: 720px) {
  .n-grid { grid-template-columns: 1fr; }
  .news-hero { min-height: 260px; }
  .news-hero-inner { padding: 36px 20px; }
  .n-title { font-size: 19px; }
  .n-intro { font-size: 13px; }
  .n-info { padding: 14px 8px 22px; }
  .pagination { margin-top: 56px; }
  .na-pn { grid-template-columns: 1fr; gap: 14px; }
  .na-next { text-align: left; }
  .na-crumb .cur { max-width: 180px; }
  .na-body { font-size: 15px; }
  .na-latest { padding: 52px 0 64px; }
}
@media (max-width: 480px) {
  .n-grid--sm { grid-template-columns: 1fr; }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  .n-card, .n-ph img, .n-more, .reveal { transition: none; }
  .n-card:hover { transform: none; }
  .reveal { opacity: 1; transform: none; }
}
