/**
 * 新闻等 CMS 富文本：站内未引入后台编辑器皮肤时，补全常见「对齐」类/结构，
 * 避免在后台居中、官网却贴左（尤其块级 img 不受 text-align:center 影响）。
 * 仅对 .cms-rich-text 内节点生效。
 */

/* Quill */
.cms-rich-text .ql-align-center {
  text-align: center;
}
.cms-rich-text .ql-align-right {
  text-align: right;
}
.cms-rich-text .ql-align-justify {
  text-align: justify;
}

/* 段落声明居中时，块级图片用水平边距居中（editor 常给 img 加 display:block） */
.cms-rich-text .ql-align-center img,
.cms-rich-text p[style*="text-align:center"] img,
.cms-rich-text p[style*="text-align: center"] img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* WordPress 经典 */
.cms-rich-text img.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* --------------------------------------------------------------------------
 * 新闻详情正文：压缩 CMS 内标题与正文基准字号，避免 h1/h2 与页内标题抢视觉
 *（仅带 .cms-rich-text--news 时使用，帮助中心等其它富文本不受影响）
 * -------------------------------------------------------------------------- */

.cms-rich-text--news {
  font-size: 0.9375rem;
  line-height: 1.75;
}

.cms-rich-text--news h1,
.cms-rich-text--news h2 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 1.35rem;
  margin-bottom: 0.5rem;
}

.cms-rich-text--news h3 {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 1.15rem;
  margin-bottom: 0.45rem;
}

.cms-rich-text--news h4,
.cms-rich-text--news h5,
.cms-rich-text--news h6 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  margin-top: 1rem;
  margin-bottom: 0.4rem;
}

.cms-rich-text--news h1:first-child,
.cms-rich-text--news h2:first-child,
.cms-rich-text--news h3:first-child,
.cms-rich-text--news h4:first-child {
  margin-top: 0;
}

.cms-rich-text--news p {
  margin-bottom: 0.65rem;
}

.cms-rich-text--news ul,
.cms-rich-text--news ol {
  margin-bottom: 0.65rem;
  padding-left: 1.25rem;
}

.cms-rich-text--news li + li {
  margin-top: 0.25rem;
}

/* 过时 align 属性 */
.cms-rich-text img[align="center"],
.cms-rich-text img[align="middle"] {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* 部分后台用通用类名 */
.cms-rich-text .align-center {
  text-align: center;
}
