/* ================================================
 * prose 容器：仅表格相关样式（解决富文本表格线不显示问题）
 * 适用场景：wangEditor / UEditor 等富文本编辑器保存的 HTML，
 *           编辑器内部显示依赖编辑器自带 CSS，生成页面缺少该样式。
 * 使用方式：<link href="/css/prose-table.css" rel="stylesheet">
 * ================================================ */

/* 1. 表格整体：合并边框 + 最外层底线 + 宽度撑满 */
.prose table,
.prose-rich-text table {
    width: 100% !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    margin: 1em 0 !important;
    font-size: 0.95em;
    color: #374151;
    /* 兜底外边框（即使 td/th 线都没渲染，至少能看到外框） */
    border: 1px solid #d1d5db !important;
    background-color: #ffffff;
    table-layout: auto;
}

/* 2. 单元格 & 表头：核心 —— 每个格子都有边框线 */
.prose table th,
.prose table td,
.prose-rich-text table th,
.prose-rich-text table td {
    border: 1px solid #d1d5db !important;
    padding: 0.6em 0.9em !important;
    text-align: left;
    vertical-align: top;
    line-height: 1.6;
    /* 防止内容里的 style="border:none" 把线干掉 */
    border-top-color: #d1d5db !important;
    border-right-color: #d1d5db !important;
    border-bottom-color: #d1d5db !important;
    border-left-color: #d1d5db !important;
    border-top-style: solid !important;
    border-right-style: solid !important;
    border-bottom-style: solid !important;
    border-left-style: solid !important;
    border-top-width: 1px !important;
    border-right-width: 1px !important;
    border-bottom-width: 1px !important;
    border-left-width: 1px !important;
}

/* 3. 表头：浅灰背景 + 加粗 */
.prose table thead th,
.prose table th,
.prose-rich-text table thead th,
.prose-rich-text table th {
    background-color: #f9fafb !important;
    font-weight: 600 !important;
    color: #1f2937;
}

/* 4. 偶数行斑马纹（提升可读性，可删） */
.prose table tbody tr:nth-child(even) td,
.prose-rich-text table tbody tr:nth-child(even) td {
    background-color: #fafafa;
}

/* 5. 表格里的段落/列表：去掉多余外边距，防止单元格撑得过高 */
.prose table p,
.prose table ul,
.prose table ol,
.prose-rich-text table p,
.prose-rich-text table ul,
.prose-rich-text table ol {
    margin: 0.2em 0 !important;
    padding-left: 1.2em;
}

.prose table p,
.prose-rich-text table p {
    padding-left: 0;
}
