/* ============================================================
   内容正文统一样式（前台展示 + 后台编辑器 共用同一份）
   —— 后台编辑器画布与前台详情页都套 .cp-detail-body，
      保证「后台看到的」= 「发布出去的」，零渲染差异。
   —— 任何正文样式只能改这个文件，不要在别处再写一份。
   ============================================================ */

.cp-detail-body{
  font-size: 15px;
  line-height: 1.8;
  color: #1f2937;
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.cp-detail-body > *:first-child{ margin-top: 0; }
.cp-detail-body > *:last-child{ margin-bottom: 0; }

/* 后端区块包裹层（blocksToHtml 输出 <div class="blk">） */
.cp-detail-body .blk{ margin: 0 0 6px; }
.cp-detail-body .blk:last-child{ margin-bottom: 0; }

/* 标题 */
.cp-detail-body h1,
.cp-detail-body h2,
.cp-detail-body h3,
.cp-detail-body h4{ line-height: 1.4; margin: 1.2em 0 .5em; font-weight: 700; color: #111827; }
.cp-detail-body h1{ font-size: 22px; }
.cp-detail-body h2{ font-size: 19px; }
.cp-detail-body h3{ font-size: 16px; }
.cp-detail-body h4{ font-size: 15px; }

/* 段落与行内 */
.cp-detail-body p{ margin: .7em 0; }
.cp-detail-body strong, .cp-detail-body b{ font-weight: 700; color: #111827; }
.cp-detail-body em, .cp-detail-body i{ font-style: italic; }
.cp-detail-body u{ text-decoration: underline; }
.cp-detail-body s, .cp-detail-body strike, .cp-detail-body del{ text-decoration: line-through; }
.cp-detail-body a{ color: #2563eb; text-decoration: none; border-bottom: 1px solid rgba(37,99,235,.35); }
.cp-detail-body a:hover{ border-bottom-color: #2563eb; }
.cp-detail-body mark{ background: #fef08a; padding: 0 3px; border-radius: 3px; }

/* 列表 */
.cp-detail-body ul, .cp-detail-body ol{ margin: .7em 0; padding-left: 1.5em; }
.cp-detail-body ul{ list-style: disc; }
.cp-detail-body ol{ list-style: decimal; }
.cp-detail-body li{ margin: .3em 0; }
.cp-detail-body li > ul, .cp-detail-body li > ol{ margin: .2em 0; }

/* 引用 */
.cp-detail-body blockquote{
  border-left: 3px solid #2563eb;
  margin: .8em 0; padding: 6px 14px;
  color: #6b7280; background: #eef3ff; border-radius: 0 8px 8px 0;
}
.cp-detail-body blockquote p{ margin: .3em 0; }

/* 代码 */
.cp-detail-body code{ background: #f1f5f9; padding: 2px 6px; border-radius: 6px; font-size: 13px; font-family: Consolas, Monaco, "Courier New", monospace; }
.cp-detail-body pre{ background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 10px; overflow-x: auto; margin: .8em 0; }
.cp-detail-body pre code{ background: none; padding: 0; color: inherit; }

/* 分隔线 */
.cp-detail-body hr{ border: 0; border-top: 1px solid #e6e9ef; margin: 1.4em 0; }

/* 图片 */
.cp-detail-body img{ max-width: 100%; height: auto; border-radius: 10px; display: block; margin: .8em 0; }
.cp-detail-body figure{ margin: .9em 0; }
.cp-detail-body figcaption{ color: #6b7280; font-size: 13px; margin-top: 6px; text-align: center; }

/* 表格 */
.cp-detail-body table{ width: 100%; border-collapse: collapse; margin: .9em 0; font-size: 14px; }
.cp-detail-body th, .cp-detail-body td{ border: 1px solid #e6e9ef; padding: 8px 12px; text-align: left; }
.cp-detail-body th{ background: #f6f8fb; font-weight: 700; }

/* 图标：编辑器插入的内联 SVG，尺寸与颜色跟随内联 style */
.cp-detail-body .cp-ico{
  display: inline-flex; align-items: center; justify-content: center;
  vertical-align: -0.16em; line-height: 1;
  width: 1.15em; height: 1.15em;
  color: inherit;
}
.cp-detail-body .cp-ico svg{ width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }
.cp-detail-body .cp-ico[data-fill="1"] svg{ fill: currentColor; stroke: none; }

/* 提示框（编辑器「插入提示块」） */
.cp-detail-body .cp-callout{
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid #dbeafe; background: #eff6ff;
  border-radius: 10px; padding: 12px 14px; margin: .9em 0;
}
.cp-detail-body .cp-callout .cp-ico{ flex: 0 0 auto; margin-top: .18em; color: #2563eb; }
.cp-detail-body .cp-callout-body{ flex: 1 1 auto; }
.cp-detail-body .cp-callout-body > *:first-child{ margin-top: 0; }
.cp-detail-body .cp-callout-body > *:last-child{ margin-bottom: 0; }
.cp-detail-body .cp-callout.is-warn{ border-color: #fde68a; background: #fffbeb; }
.cp-detail-body .cp-callout.is-warn .cp-ico{ color: #d97706; }
.cp-detail-body .cp-callout.is-ok{ border-color: #bbf7d0; background: #f0fdf4; }
.cp-detail-body .cp-callout.is-ok .cp-ico{ color: #059669; }
.cp-detail-body .cp-callout.is-danger{ border-color: #fecaca; background: #fef2f2; }
.cp-detail-body .cp-callout.is-danger .cp-ico{ color: #dc2626; }
