/* ============================================================
   正文共用样式 content.css  —— 前台正文与后台编辑器共用同一份
   目的：所见即所得。同一段内容在前台显示成什么样，编辑器里就显示成什么样。
   只管正文内容本身（字号/行高/字体/颜色/图片/表格），不含整页布局
   （左栏、导航、页头页脚都不在这里）。
   前台引用：assets/content.css
   编辑器引用：ckeditor/contents.css 里 @import 本文件（相对路径 ../assets/content.css）
   ============================================================ */

/* ---- 正文基础排版：与前台四个正文页的容器口径一致 ---- */
/* 字号 12px、行高 200%、宋体、链接色 #AA611C，
   均取自前台 cust_Show/main_show/tixi_Show 的实际渲染值。
   字号保持现状 12px，不放大（用户确认 16px 过大）。 */
body,
.x-cell,
.cke_editable{
  font-family: SimSun, "宋体", serif;
  font-size: 12px;
  line-height: 200%;
  color: #000;
}
body a, .x-cell a, .cke_editable a { color: #AA611C; }

/* ---- 图片：一张大图全档通吃 ---- */
/* max-width 压宽度，height:auto 等比算高度。
   关键：height:auto 必须覆盖带 height 属性的图片，
   CK 编辑器插入图片默认带 width+height，若不覆盖，窄屏会被压扁。 */
img,
.x-cell img,
.cke_editable img{
  max-width: 100% !important;
  height: auto !important;
}

/* ---- 表格分两类 ---- */
/* 规则只作用于正文区，不影响后台列表页、不影响页面布局表格。 */

/* 第一类：普通数据表（无跨列）——手机档可拆成单列阅读 */
/* 第二类：流程图/布局表（含 colspan>=2）——拆单列会丢失行列结构。
   用 :has 选中含跨列单元格的表，保留表格结构，不拆散。
   :has 在现代浏览器（Edge/Chrome 105+）支持；旧浏览器不支持时
   退回到下面的"全部表格出横向滚动"兜底。 */
/* :has 规则：不支持的浏览器会忽略这条规则，退回原表格表现 */
  .x-cell table:has(td[colspan]):has(td[colspan]:not([colspan="1"])),
  .cke_editable table:has(td[colspan]):has(td[colspan]:not([colspan="1"])){
    display: table !important;
    width: auto !important;
    table-layout: auto !important;
  }
  /* 滚动容器：给包了容器的表不设 max-width，让它保持原宽可横向滚动 */
  .content-table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%}
  .content-table-scroll table{max-width:none !important;min-width:0 !important}
  .content-table-scroll td{width:auto !important}
  .x-cell table:has(td[colspan]):has(td[colspan]:not([colspan="1"])) tbody,
  .cke_editable table:has(td[colspan]):has(td[colspan]:not([colspan="1"])) tbody{ display: table-row-group !important; }
  .x-cell table:has(td[colspan]):has(td[colspan]:not([colspan="1"])) tr,
  .cke_editable table:has(td[colspan]):has(td[colspan]:not([colspan="1"])) tr{ display: table-row !important; }
  .x-cell table:has(td[colspan]):has(td[colspan]:not([colspan="1"])) td,
  .cke_editable table:has(td[colspan]):has(td[colspan]:not([colspan="1"])) td{
    display: table-cell !important;
    width: auto !important;
    box-sizing: content-box !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }

/* ---- 正文表格行高压紧 ---- */
/* 正文行高 200% 会被 Word/Excel 导出的表格单元格继承，把表格撑高。
   表格内的行高恢复紧凑，不影响正文段落。 */
.x-cell table td, .x-cell table th,
.cke_editable table td, .cke_editable table th { line-height: normal; }
.x-cell table td[height] p, .x-cell table th[height] p,
.cke_editable table td[height] p, .cke_editable table th[height] p { margin: 0; }
