/* Go 渲染的栏目页与文章页的样式。
 *
 * 全部用 cms- 前缀的自有类名，不碰前端那套带构建哈希的 CSS Modules 类名
 * （SiteHeader-module__Iuk-4q__header 这种）——那些每次重新构建都会变，
 * 写死了迟早失配。页头页尾仍复用前端的原始 HTML 和样式表，
 * 所以整站观感是一致的，这里只管内容区。
 */

.cms-page {
  /* 页头是 fixed 定位的，内容要往下让出它的高度，否则被盖住 */
  padding: 104px 0 64px;
  background: #f7f8fa;
  min-height: 60vh;
}

.cms-page .container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---- 面包屑 ---- */
.cms-breadcrumb {
  font-size: 13px;
  color: #8a93a2;
  margin-bottom: 16px;
}
.cms-breadcrumb a { color: #8a93a2; text-decoration: none; }
.cms-breadcrumb a:hover { color: #1d74de; }
.cms-sep { margin: 0 6px; color: #c8cdd6; }

/* ---- 文章 ---- */
.cms-article,
.cms-cat-head,
.cms-related {
  background: #fff;
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
}
.cms-cat-head { padding: 24px 32px; }
.cms-related { margin-top: 24px; }

.cms-title {
  font-size: 30px;
  line-height: 1.4;
  font-weight: 700;
  color: #1a1f28;
  margin: 0 0 14px;
}

.cms-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: #8a93a2;
  margin-bottom: 22px;
}
.cms-meta a { color: #1d74de; text-decoration: none; }

.cms-cover {
  width: 100%;
  height: auto;
  border-radius: 6px;
  margin-bottom: 22px;
}

.cms-summary {
  font-size: 15px;
  line-height: 1.8;
  color: #5b6472;
  padding: 14px 18px;
  background: #f4f7fb;
  border-left: 3px solid #1d74de;
  border-radius: 0 4px 4px 0;
  margin: 0 0 24px;
}

/* ---- 正文 ----
 * 正文是编辑器产出的 HTML，标签种类不固定，所以按标签选择而不是按类名。 */
.cms-body { font-size: 16px; line-height: 1.9; color: #2c3440; }
.cms-body p { margin: 0 0 18px; }
.cms-body h2 { font-size: 22px; font-weight: 700; margin: 34px 0 14px; color: #1a1f28; }
.cms-body h3 { font-size: 18px; font-weight: 700; margin: 28px 0 12px; color: #1a1f28; }
.cms-body h4 { font-size: 16px; font-weight: 700; margin: 24px 0 10px; }
.cms-body ul,
.cms-body ol { margin: 0 0 18px; padding-left: 26px; }
.cms-body li { margin-bottom: 8px; }
.cms-body a { color: #1d74de; }
.cms-body img { max-width: 100%; height: auto; border-radius: 6px; margin: 10px 0; }
.cms-body blockquote {
  margin: 0 0 18px;
  padding: 12px 18px;
  background: #f7f8fa;
  border-left: 3px solid #d4dae3;
  color: #5b6472;
}
.cms-body pre {
  background: #1e2430;
  color: #e6e9ef;
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;   /* 长代码横向滚动，不撑破版面 */
  font-size: 13px;
  line-height: 1.7;
}
.cms-body code { font-size: 13px; }
.cms-body table { width: 100%; border-collapse: collapse; margin: 0 0 18px; }
.cms-body th,
.cms-body td { border: 1px solid #e5e8ee; padding: 8px 12px; text-align: left; }
.cms-body th { background: #f7f8fa; font-weight: 600; }

/* ---- 列表 ---- */
.cms-list { list-style: none; margin: 20px 0 0; padding: 0; }

.cms-item {
  display: flex;
  gap: 18px;
  background: #fff;
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
}
.cms-item-cover {
  flex: 0 0 180px;
  display: block;
  border-radius: 6px;
  overflow: hidden;
}
.cms-item-cover img {
  width: 180px;
  height: 116px;
  object-fit: cover;   /* 封面比例不一时统一裁切，避免列表参差不齐 */
  display: block;
}
.cms-item-body { flex: 1 1 auto; min-width: 0; }
.cms-item-title { font-size: 18px; font-weight: 600; margin: 0 0 8px; line-height: 1.5; }
.cms-item-title a { color: #1a1f28; text-decoration: none; }
.cms-item-title a:hover { color: #1d74de; }
.cms-item-summary {
  font-size: 14px;
  line-height: 1.7;
  color: #6b7482;
  margin: 0 0 10px;
  /* 摘要最多两行，超出省略，保证每张卡片高度接近 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cms-item .cms-meta { margin-bottom: 0; }

/* ---- 相关文章 ---- */
.cms-related h2 { font-size: 18px; font-weight: 700; margin: 0 0 14px; }
.cms-related ul { list-style: none; margin: 0; padding: 0; }
.cms-related li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f2f5;
}
.cms-related li:last-child { border-bottom: 0; }
.cms-related a { color: #2c3440; text-decoration: none; }
.cms-related a:hover { color: #1d74de; }
.cms-date { color: #a2aab7; font-size: 13px; white-space: nowrap; }

/* ---- 翻页 ---- */
.cms-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 26px;
  font-size: 14px;
  color: #6b7482;
}
.cms-pager a {
  color: #1d74de;
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid #d9e2ee;
  border-radius: 4px;
  background: #fff;
}

.cms-empty {
  background: #fff;
  border-radius: 8px;
  padding: 48px;
  text-align: center;
  color: #8a93a2;
}

/* ---- 窄屏 ---- */
@media (max-width: 768px) {
  .cms-page { padding-top: 76px; }
  .cms-article { padding: 22px 18px; }
  .cms-title { font-size: 23px; }
  .cms-item { flex-direction: column; gap: 12px; }
  .cms-item-cover { flex: none; }
  .cms-item-cover img { width: 100%; height: 180px; }
}
