/* ============================================================================
   rich-content.css — 富文本（产品特性/规格）排版样式
   ----------------------------------------------------------------------------
   作用域：任何带 .rich-content 类的容器

     前台  <div class="detail-features rich-content">@Html.Raw(FeaturesHtml)</div>
     后台  TinyMCE 编辑器内容区（content_css 引用本文件 + body_class='rich-content'）

   为什么必须单独成文件：
     site.css 开头的全局 reset（*{margin:0;padding:0} + ul{list-style:none}）
     是为了让页面骨架可控，但它同时把富文本里 <ul>/<ol>/<p>/<h*>/<table> 的
     默认排版全部清零 —— 后台编辑器里看到的圆点、缩进、段落间距、标题层级，
     到前台就全没了。这里的规则用更高优先级把它们逐项还原，
     并且前台 / 后台共用同一份文件，保证「编辑器所见 = 前台所得」。

   注意：本文件必须自包含。编辑器 iframe 内不会加载 site.css，前台也不会
   二次加载 —— 两边都只依赖本文件的规则，不要假设外部 reset 存在或不存在。
   ========================================================================== */

/* ---------------------------------------------------------------- 基准排版 */
.rich-content{font-size:15px;line-height:1.75;color:#475569;overflow-wrap:break-word}

/* 首尾元素不留多余外边距（避免与 section 的 padding 叠加成双倍空白） */
.rich-content > *:first-child{margin-top:0}
.rich-content > *:last-child{margin-bottom:0}

.rich-content p{margin:0 0 14px}
.rich-content strong,.rich-content b{font-weight:700;color:#0f172a}
.rich-content em,.rich-content i{font-style:italic}
.rich-content small{font-size:13px;color:#64748b}
.rich-content sup,.rich-content sub{font-size:.75em;line-height:0}

/* -------------------------------------------------------------------- 标题 */
.rich-content h1,.rich-content h2,.rich-content h3,
.rich-content h4,.rich-content h5,.rich-content h6{
  font-family:'Sora','Inter',sans-serif;font-weight:700;color:#0f172a;
  line-height:1.3;margin:30px 0 14px}
.rich-content h1{font-size:26px}
.rich-content h2{font-size:22px}
.rich-content h3{font-size:20px}
.rich-content h4{font-size:17px}
.rich-content h5{font-size:15px}
.rich-content h6{font-size:14px;color:#334155}

/* --------------------------------------------------------- 列表（核心修复） */
/* 必须显式重写，否则被 site.css 的 ul{list-style:none} + *{padding:0} 清空 */
.rich-content ul,.rich-content ol{margin:0 0 16px;padding-left:24px}
.rich-content ul{list-style:disc}
.rich-content ul ul{list-style:circle}
.rich-content ul ul ul{list-style:square}
.rich-content ol{list-style:decimal}
.rich-content ol ol{list-style:lower-alpha}
.rich-content ol ol ol{list-style:lower-roman}

.rich-content li{margin:0 0 8px;padding-left:2px}
.rich-content li > ul,.rich-content li > ol{margin:8px 0 0}
/* 列表项内的段落不再额外撑开间距，避免行距忽大忽小 */
.rich-content li > p{margin:0 0 6px}

/* 项目符号用品牌蓝，和整站的 #0070e0 主色呼应 */
.rich-content li::marker{color:#0070e0;font-weight:600}

/* -------------------------------------------------------- 表格（规格表等） */
/* 后台用 TinyMCE 的 table 插件插入，不带任何 class —— 必须按标签选择器覆盖 */
.rich-content table{
  width:100%;border-collapse:collapse;margin:18px 0;font-size:14px;
  table-layout:auto}
.rich-content th,.rich-content td{
  border:1px solid #e2e8f0;padding:10px 14px;text-align:left;
  vertical-align:top;line-height:1.6}
.rich-content th{background:#f8fafc;font-weight:600;color:#334155}
.rich-content td{color:#475569}
.rich-content tbody tr:nth-child(even) td{background:#fcfdff}
/* 窄屏下允许横向滚动，避免表格把页面顶宽 */
.rich-content .table-scroll,.rich-content > table{max-width:100%}

/* ------------------------------------------------------------ 引用 / 分隔线 */
.rich-content blockquote{
  margin:18px 0;padding:12px 18px;border-left:3px solid #0070e0;
  background:#f1f7ff;border-radius:0 8px 8px 0;color:#334155}
.rich-content blockquote p:last-child{margin-bottom:0}
.rich-content hr{border:0;border-top:1px solid #e2e8f0;margin:26px 0}

/* -------------------------------------------------------------------- 链接 */
.rich-content a{color:#0070e0;text-decoration:underline;text-underline-offset:2px}
.rich-content a:hover{color:#0060c0}

/* ------------------------------------------------------------- 图片 / 代码 */
/* 富文本内图片默认自适应，绝不溢出 */
.rich-content img{max-width:100%;height:auto;border-radius:8px;display:block;margin:16px 0}
/* 编辑器里图片常被包在段落中，避免出现"段落间距 + 图片间距"双份空隙 */
.rich-content p > img:only-child{margin-top:0;margin-bottom:0}

.rich-content code{
  font-family:Consolas,Monaco,'Courier New',monospace;font-size:13px;
  background:#f1f5f9;color:#0f172a;padding:2px 6px;border-radius:4px}
.rich-content pre{
  background:#0f172a;color:#e2e8f0;padding:16px 18px;border-radius:10px;
  overflow-x:auto;font-size:13px;line-height:1.6;margin:18px 0}
.rich-content pre code{background:none;color:inherit;padding:0}

/* ------------------------------------ 一行 N 图网格（后台「2图 / 3图」按钮） */
/* 列宽用 fr，禁止写死 px */
.rich-content .img-grid-2{display:grid;grid-template-columns:repeat(2,1fr);gap:16px;margin:16px 0}
.rich-content .img-grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin:16px 0}
.rich-content .img-grid-2 img,.rich-content .img-grid-3 img{
  width:100%;height:auto;border-radius:8px;display:block;margin:0}

/* ---------------------------------------------------------------- 响应式 */
@media(max-width:1100px){
  .rich-content .img-grid-3{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:600px){
  .rich-content{font-size:14.5px}
  .rich-content h1{font-size:22px}
  .rich-content h2{font-size:20px}
  .rich-content h3{font-size:18px}
  .rich-content h4{font-size:16px}
  .rich-content .img-grid-2,.rich-content .img-grid-3{grid-template-columns:1fr}
  .rich-content th,.rich-content td{padding:8px 10px;font-size:13px}
}

/* ------------------------------------------------- 编辑器专属（前台无影响） */
/* TinyMCE 内容区：补内边距，让编辑时有正常呼吸感 */
body.rich-content{padding:18px 20px;background:#fff}
/* 编辑态占位段落（TinyMCE 空行输出 <p><br></p>）也保持行高，便于点选 */
body.rich-content p:empty::after{content:'\00a0'}
