/* 全站 Markdown 表格语义化自适应排版（不靠拉宽页面硬凑，任意屏幕防截断） */

/* 1. 外层滚动容器：仅在真正溢出时出横向滚动条，替换 Butterfly 默认的 scroll */
#article-container .table-wrap {
  overflow-x: auto;
}

/* 2. 表格整体：满宽展示，字号略微收敛，提升多列技术参数表的信息密度 */
#article-container .table-wrap table {
  width: 100%;
  font-size: 0.92em;
  line-height: 1.6;
}

#article-container .table-wrap th,
#article-container .table-wrap td {
  padding: 8px 12px;
}

/* 3. 表头与居中对齐列（Markdown :-: 语义为序号/状态/徽章）：保持单行不折行 */
#article-container .table-wrap th,
#article-container .table-wrap td[align="center"] {
  white-space: nowrap;
}

/* 4. 所有正文单元格默认允许自然换行，避免超宽列撑爆表格 */
#article-container .table-wrap td {
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
}

/* 5. 首列：保底最小宽度且不劈开短中文词（如“最佳场景”），
      但允许长复合语法（如 read_file(<path>) / write_file(<path>)）在空格与斜杠处优雅换行 */
#article-container .table-wrap td:first-child {
  min-width: 6.5em;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* 6. 表格内行内代码：适度收紧字号，优先在标点/空格断行，极长 URI/路径允许安全折行防截断 */
#article-container .table-wrap td code {
  font-size: 0.86em;
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
}

/* 7. 提示框与上方表格/代码块之间保持呼吸感，不紧贴 */
#article-container .note {
  margin-top: 16px;
}

/* 8. 移动端收敛表格字号与单元格边距，允许表头自然换行以缩短横向滚动距离 */
@media (max-width: 768px) {
  #article-container .table-wrap table {
    font-size: 0.86em;
  }

  #article-container .table-wrap th {
    white-space: normal;
    min-width: 5.5em;
  }

  #article-container .table-wrap th,
  #article-container .table-wrap td {
    padding: 6px 10px;
  }
}
