/* ============================================================
   通用表格规整样式表 table-style.css
   作用：修复变形、无边框、超出页面宽度等问题，
   让网页中所有 <table> 自动适应容器宽度并统一边框。
   使用方式：在 </head> 前引入本文件（务必放在其他
   CSS 之后，以便用 !important 覆盖内联/冲突样式）。
   ============================================================ */

/* 1. 表格本身：占满容器、边框合并、自动换列 */
table {
  width: 100% !important;        /* 自适应网页宽度 */
  max-width: 100% !important;
  border-collapse: collapse !important;   /* 合并边框，避免双重线 */
  border-spacing: 0 !important;
  table-layout: auto !important;          /* 按内容自动分配列宽 */
  box-sizing: border-box !important;
  margin: 16px 0 !important;
  font-size: 15px !important;
  line-height: 1.6 !important;
  overflow-wrap: anywhere !important;     /* 长英文/链接自动换行 */
  word-break: break-word !important;
}

/* 2. 单元格：统一边框、内边距、对齐（覆盖内联的 border-left:none 等） */
table td,
table th {
  border: 1px solid #3e3e3e !important;  /* 统一深灰边框 */
  padding: 8px 12px !important;
  text-align: left !important;
  vertical-align: top !important;
  width: auto !important;                  /* 取消 width="25" 等固定像素 */
  min-width: 0 !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

/* 3. 表头行稍微突出（兼容带 thead 或 .firstRow 的情况） */
table thead th,
table tr.firstRow td,
table th {
  background-color: #f5f7f9 !important;
  font-weight: 600 !important;
}

/* 4. 表格内段落去掉多余外边距，避免撑高行 */
table p {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.6 !important;
}

/* 5. 响应式容器：窄屏（手机/平板）下表格可横向滚动，不撑破页面 */
.table-responsive {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  box-sizing: border-box !important;
}

/* 6. 图片类内容在单元格内不溢出 */
table img {
  max-width: 100% !important;
  height: auto !important;
}
