/**
 * CMS 正文还原：后台 UEditor 编辑什么，前台就按什么显示。
 * 抵消 public.css 全局 reset 对正文区的影响，并保留内联 style。
 */
.cms-html {
  line-height: 1.75;
  color: #333;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* 标题 */
.cms-html h1,
.cms-html h2,
.cms-html h3,
.cms-html h4,
.cms-html h5,
.cms-html h6 {
  font-weight: 700;
  line-height: 1.35;
  margin: 1em 0 0.5em;
  color: inherit;
}
.cms-html h1 { font-size: 2em; }
.cms-html h2 { font-size: 1.5em; }
.cms-html h3 { font-size: 1.25em; }
.cms-html h4 { font-size: 1.125em; }
.cms-html h5 { font-size: 1em; }
.cms-html h6 { font-size: 0.9em; }

/* 段落 / 换行 */
.cms-html p {
  margin: 0 0 0.75em;
  font-size: inherit;
  line-height: inherit;
}
.cms-html br { line-height: inherit; }

/* 强调：抵消 reset 的 font-weight/font-style:normal */
.cms-html b,
.cms-html strong { font-weight: 700 !important; }
.cms-html i,
.cms-html em,
.cms-html cite,
.cms-html dfn,
.cms-html var { font-style: italic !important; }
.cms-html u,
.cms-html ins { text-decoration: underline; }
.cms-html s,
.cms-html strike,
.cms-html del { text-decoration: line-through; }
.cms-html sub { vertical-align: sub; font-size: smaller; }
.cms-html sup { vertical-align: super; font-size: smaller; }
.cms-html small { font-size: smaller; }
.cms-html big { font-size: larger; }

/* 链接 */
.cms-html a {
  color: #1a5fb4;
  text-decoration: underline;
}
.cms-html a:hover { color: #c4161c; }

/* 列表：抵消 ul/ol list-style:none */
.cms-html ul {
  list-style: disc !important;
  margin: 0.5em 0 0.75em;
  padding-left: 2em !important;
}
.cms-html ol {
  list-style: decimal !important;
  margin: 0.5em 0 0.75em;
  padding-left: 2em !important;
}
.cms-html li {
  list-style: inherit !important;
  margin: 0.25em 0;
  padding: 0;
  font-size: inherit;
  line-height: inherit;
}
.cms-html ul ul { list-style: circle !important; }
.cms-html ul ul ul { list-style: square !important; }
.cms-html ol ol { list-style: lower-alpha !important; }

/* 表格 */
.cms-html table {
  border-collapse: collapse;
  border-spacing: 0;
  width: auto;
  max-width: 100%;
  margin: 1em 0;
  background: #fff;
}
.cms-html table th,
.cms-html table td {
  border: 1px solid #ddd;
  padding: 8px 12px !important;
  vertical-align: top;
  font-size: inherit;
  line-height: 1.5;
  background: transparent;
}
.cms-html table th {
  font-weight: 700 !important;
  background: #f7f7f7;
  text-align: left;
}
.cms-html table caption {
  caption-side: top;
  text-align: center;
  font-weight: 700;
  margin-bottom: 0.5em;
}

/* 图片 / 媒体 — height:auto !important 覆盖编辑器写入的内联 height，避免只缩宽不缩高导致变形 */
.cms-html img {
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  vertical-align: middle;
  object-fit: contain;
}
.cms-html video,
.cms-html iframe {
  max-width: 100%;
}
.cms-html hr {
  border: 0;
  border-top: 1px solid #ddd;
  margin: 1.25em 0;
}

/* 引用 / 代码 */
.cms-html blockquote {
  margin: 1em 0;
  padding: 0.5em 0 0.5em 1em;
  border-left: 4px solid #ccc;
  color: #555;
}
.cms-html pre,
.cms-html code {
  font-family: Consolas, Monaco, monospace;
  font-size: 0.9em;
}
.cms-html pre {
  background: #f6f8fa;
  padding: 12px;
  overflow: auto;
  margin: 1em 0;
  white-space: pre-wrap;
}

/* 对齐（UEditor 常用） */
.cms-html .align-left,
.cms-html [align="left"] { text-align: left; }
.cms-html .align-center,
.cms-html [align="center"] { text-align: center; }
.cms-html .align-right,
.cms-html [align="right"] { text-align: right; }
.cms-html .align-justify,
.cms-html [align="justify"] { text-align: justify; }

/* 浮动图 */
.cms-html img[style*="float:left"],
.cms-html img[style*="float: left"] { margin: 0 1em 0.5em 0; }
.cms-html img[style*="float:right"],
.cms-html img[style*="float: right"] { margin: 0 0 0.5em 1em; }

/* 内联 style / font 标签优先级：不强制覆盖 color/font-size，交给编辑器输出 */
.cms-html font { font-size: inherit; }

@media (max-width: 640px) {
  .cms-html table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cms-html h1 { font-size: 1.5em; }
  .cms-html h2 { font-size: 1.3em; }
  .cms-html h3 { font-size: 1.15em; }
}
