/* ============================================
   Editor.js 渲染样式
   前台 / 后台预览 公共样式，保持一致
   ============================================ */

.editorjs-content {
    max-width: 1200px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.75;
    color: #24292f;
}

/* ---- 段落 ---- */
.editorjs-p {
    margin: 0 0 1em 0;
}

/* ---- 标题 ---- */
.editorjs-h1,
.editorjs-h2,
.editorjs-h3,
.editorjs-h4,
.editorjs-h5,
.editorjs-h6 {
    font-weight: 700;
    line-height: 1.3;
    color: #1f2328;
    margin: 1.6em 0 0.6em 0;
}
.editorjs-h1 { font-size: 2em;   border-bottom: 2px solid #d0d7de; padding-bottom: 0.3em; }
.editorjs-h2 { font-size: 1.6em; border-bottom: 1px solid #d0d7de; padding-bottom: 0.25em; }
.editorjs-h3 { font-size: 1.3em; }
.editorjs-h4 { font-size: 1.1em; }
.editorjs-h5 { font-size: 1em;   color: #57606a; }
.editorjs-h6 { font-size: 0.9em; color: #57606a; }

/* ---- 列表 ---- */
.editorjs-ul,
.editorjs-ol {
    margin: 0 0 1em 0;
    padding-left: 1.8em;
}
.editorjs-ul li,
.editorjs-ol li {
    margin: 0.3em 0;
}
.editorjs-ul { list-style: disc; }
.editorjs-ol { list-style: decimal; }

/* ---- 代码块 ---- */
.editorjs-code-wrap {
    position: relative;
    margin: 1.2em 0;
}
.editorjs-code-lang {
    display: inline-block;
    background: #30363d;
    color: #8b949e;
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 6px 6px 0 0;
    font-family: "SFMono-Regular", Consolas, monospace;
    letter-spacing: 0.05em;
    user-select: none;
}
.editorjs-pre {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 0 6px 6px 6px;
    padding: 1.1em 1.3em;
    overflow-x: auto;
    margin: 0;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, "Courier New", monospace;
    font-size: 14px;
    line-height: 1.65;
    color: #c9d1d9;
    tab-size: 4;
}
.editorjs-code-wrap .editorjs-pre {
    border-top: none;   /* lang label 存在时去掉顶部边框 */
}
.editorjs-pre code {
    background: transparent;
    padding: 0;
    font-size: inherit;
    color: inherit;
    border-radius: 0;
}

/* ---- 引用块 ---- */
.editorjs-quote {
    margin: 1.2em 0;
    padding: 1em 1.4em;
    border-left: 4px solid #58a6ff;
    background: #f6f8fa;
    border-radius: 0 6px 6px 0;
    color: #57606a;
    font-style: italic;
}
.editorjs-cite {
    display: block;
    margin-top: 0.6em;
    font-size: 0.85em;
    color: #8c959f;
    font-style: normal;
}
.editorjs-cite::before { content: "— "; }

/* ---- Warning 提示框 ---- */
.editorjs-warning {
    margin: 1.2em 0;
    padding: 1em 1.4em;
    background: #fff8e1;
    border: 1px solid #ffd54f;
    border-left: 4px solid #ff9800;
    border-radius: 6px;
    color: #5d4037;
}
.editorjs-warning-title {
    font-weight: 700;
    margin-bottom: 0.4em;
    font-size: 0.95em;
}
.editorjs-warning-msg {
    font-size: 0.93em;
    line-height: 1.6;
}

/* ---- 分隔线 ---- */
.editorjs-hr {
    border: none;
    border-top: 2px solid #d0d7de;
    margin: 2em 0;
}

/* ---- 图片 ---- */
.editorjs-figure {
    margin: 1.4em 0;
    text-align: center;
}
.editorjs-img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: zoom-in;
}
.editorjs-img:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 16px rgba(0,0,0,0.16);
}
.editorjs-img.with-border {
    border: 1px solid #d0d7de;
}
.editorjs-img.with-bg {
    background: #f6f8fa;
    padding: 12px;
}
.editorjs-img.stretched {
    width: 100%;
    max-width: none;
}
.editorjs-img-cap {
    margin-top: 0.5em;
    font-size: 0.85em;
    color: #8c959f;
    font-style: italic;
}

/* ---- 表格 ---- */
.editorjs-table-wrap {
    overflow-x: auto;
    margin: 1.2em 0;
}
.editorjs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    overflow: hidden;
}
.editorjs-table th,
.editorjs-table td {
    border: 1px solid #d0d7de;
    padding: 0.55em 1em;
    text-align: left;
}
.editorjs-table th {
    background: #f6f8fa;
    font-weight: 600;
    color: #24292f;
}
.editorjs-table tr:nth-child(even) { background: #f6f8fa; }

/* ---- Checklist ---- */
.editorjs-checklist {
    list-style: none;
    padding-left: 0;
    margin: 0 0 1em 0;
}
.editorjs-check-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5em;
    margin: 0.3em 0;
    color: #24292f;
}
.editorjs-check-item.checked {
    color: #8c959f;
    text-decoration: line-through;
}
.editorjs-check-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

/* ---- 旧 HTML 兼容（Quill 历史数据） ---- */
.editorjs-legacy {
    font-size: 15px;
    line-height: 1.75;
    color: #24292f;
}
.editorjs-legacy h1,
.editorjs-legacy h2,
.editorjs-legacy h3 {
    font-weight: 600;
    margin: 1.4em 0 0.6em;
}
.editorjs-legacy pre {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 1em;
    overflow-x: auto;
    color: #c9d1d9;
    font-size: 14px;
    font-family: monospace;
    margin: 1em 0;
}
.editorjs-legacy code {
    background: rgba(175,184,193,0.2);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}
.editorjs-legacy pre code {
    background: transparent;
    padding: 0;
}
.editorjs-legacy blockquote {
    border-left: 4px solid #58a6ff;
    background: #f6f8fa;
    margin: 1em 0;
    padding: 0.6em 1.2em;
    color: #57606a;
}
.editorjs-legacy hr {
    border: none;
    border-top: 2px solid #d0d7de;
    margin: 1.5em 0;
}
.editorjs-legacy table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
    font-size: 14px;
}
.editorjs-legacy table th,
.editorjs-legacy table td {
    border: 1px solid #d0d7de;
    padding: 8px 12px;
    text-align: left;
}
.editorjs-legacy table th {
    background: #f6f8fa;
    font-weight: 600;
    color: #24292f;
}
.editorjs-legacy table tr:nth-child(even) {
    background: #f6f8fa;
}
.editorjs-legacy ul,
.editorjs-legacy ol {
    margin: 0 0 1em 0;
    padding-left: 1.8em;
}
.editorjs-legacy li {
    margin: 0.3em 0;
}
.editorjs-legacy img {
    max-width: 100%;
    border-radius: 6px;
    margin: 8px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.editorjs-legacy a {
    color: #0066FF;
    text-decoration: none;
}
.editorjs-legacy a:hover {
    text-decoration: underline;
}
