/* ============================================================
 * md-render.css  v7.9.44
 * 公式 / 表格 / 增强 Markdown 样式（浅色 + 深色）
 * ============================================================ */

/* ---------- 表格 ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 10px 0;
  border: 1px solid rgba(0, 0, 0, .09);
  border-radius: 10px;
  background: rgba(0, 0, 0, .02);
}
.md-table {
  border-collapse: collapse;
  width: 100%;
  min-width: max-content;
  font-size: 14px;
  line-height: 1.65;
}
.md-table th,
.md-table td {
  border: 1px solid rgba(0, 0, 0, .1);
  padding: 7px 12px;
  vertical-align: middle;
}
.md-table thead th {
  background: rgba(0, 0, 0, .05);
  font-weight: 600;
  white-space: nowrap;
}
.md-table tbody tr:nth-child(even) { background: rgba(0, 0, 0, .025); }
.md-table tbody tr:hover { background: rgba(0, 0, 0, .05); }
.md-table code { font-size: 12px; }

/* ---------- 公式（KaTeX auto-render 输出） ---------- */
.math-block {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  padding: 10px 6px;
  margin: 8px 0;
  text-align: center;
  background: rgba(0, 0, 0, .03);
  border-radius: 8px;
  -webkit-overflow-scrolling: touch;
}
.math-block .katex-display { margin: .4em 0; }
.math-block .katex { font-size: 1.06em; }
.message-bubble .katex { font-size: 1.04em; }
.message-bubble .katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  margin: 6px 0;
  padding: 4px 0;
  text-align: center;
  -webkit-overflow-scrolling: touch;
}
.math-err {
  color: #e5484d;
  background: rgba(229, 72, 77, .08);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---------- 其它增强 ---------- */
del { color: rgba(0, 0, 0, .45); }
.task-item { list-style: none; margin-left: -20px; }
.task-item input { margin-right: 6px; vertical-align: -1px; }

/* ---------- 深色模式 ---------- */
[data-theme="dark"] .table-wrap { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .12); }
[data-theme="dark"] .md-table th,
[data-theme="dark"] .md-table td { border-color: rgba(255, 255, 255, .14); }
[data-theme="dark"] .md-table thead th { background: rgba(255, 255, 255, .07); }
[data-theme="dark"] .md-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, .035); }
[data-theme="dark"] .md-table tbody tr:hover { background: rgba(255, 255, 255, .07); }
[data-theme="dark"] .math-block { background: rgba(255, 255, 255, .05); }
[data-theme="dark"] .message-bubble .katex,
[data-theme="dark"] .math-block .katex { color: #F0F0F0; }
