/* 斗笠江湖 CMS —— 文章正文排版（后台预览与前台渲染共用）
 * 通过 .cms-prose 应用；前端渲染代理会加载同一文件，保证前后端一致。
 * 仅使用白名单标签（与后端 sanitize_html 对应），不依赖任何外部样式。 */

.cms-prose {
    color: #1f2733;
    font-size: 16px;
    line-height: 1.85;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.cms-prose::after { content: ""; display: table; clear: both; }
.cms-prose > *:first-child { margin-top: 0; }
.cms-prose > *:last-child { margin-bottom: 0; }

.cms-prose p { margin: 0 0 1em; }
.cms-prose h2 {
    font-size: 1.5em; line-height: 1.35; font-weight: 700;
    margin: 1.5em 0 .6em; padding-bottom: .25em; border-bottom: 1px solid #eef2f7;
}
.cms-prose h3 { font-size: 1.25em; line-height: 1.4; font-weight: 700; margin: 1.3em 0 .5em; }
.cms-prose h4 { font-size: 1.08em; font-weight: 700; margin: 1.1em 0 .4em; }

.cms-prose a { color: #0f766e; text-decoration: underline; text-underline-offset: 2px; }
.cms-prose a:hover { color: #115e59; }

.cms-prose ul, .cms-prose ol { margin: 0 0 1em; padding-left: 1.6em; }
.cms-prose li { margin: .35em 0; }
.cms-prose li > ul, .cms-prose li > ol { margin: .3em 0; }

.cms-prose blockquote {
    margin: 1em 0; padding: .7em 1em;
    border-left: 4px solid #14b8a6; background: #f0fdfa;
    color: #334155; border-radius: 8px;
}
.cms-prose blockquote p:last-child { margin-bottom: 0; }

.cms-prose img {
    max-width: 100%; height: auto; border-radius: 8px;
    margin: .6em 0; display: inline-block; vertical-align: middle;
    box-shadow: 0 1px 3px rgba(20,30,50,.08);
}
.cms-prose figure { margin: 1em 0; text-align: center; }
.cms-prose figcaption { font-size: 13px; color: #6b7785; margin-top: .3em; }

.cms-prose hr { border: 0; border-top: 1px solid #e3e8ef; margin: 1.6em 0; }

.cms-prose code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .9em; background: #f1f5f9; padding: .15em .4em; border-radius: 5px; color: #0f766e;
}
.cms-prose pre {
    background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 10px;
    overflow: auto; font-size: 13px; line-height: 1.6; margin: 1em 0;
}
.cms-prose pre code { background: none; color: inherit; padding: 0; }

.cms-prose table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 14px; }
.cms-prose th, .cms-prose td { border: 1px solid #e3e8ef; padding: 8px 10px; text-align: left; }
.cms-prose th { background: #f8fafc; font-weight: 600; }

.cms-prose small { font-size: 12px; color: #6b7785; }
.cms-prose sub, .cms-prose sup { font-size: .75em; }

/* 页面主标题的无障碍文本保留在既有图片式版面内。 */
.cms-sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.cms-mobile-list-title { margin: 0; padding: 0; font-size: inherit; line-height: inherit; font-weight: inherit; }
.article-detail-page h1.detail_title { font-weight: inherit; }
.mobile-subpage .detail-wrapper h1.title { line-height: inherit; }

/* 对齐工具类（由工具栏 justify* 生成） */
.cms-prose .align-left { text-align: left; }
.cms-prose .align-center { text-align: center; }
.cms-prose .align-right { text-align: right; }
.cms-prose .align-justify { text-align: justify; }

/* 前台文章使用深色底图；在旧版 cms-config.css 中也保持足够阅读对比度。 */
.article-detail-page .detail_content.cms-prose,
.mobile-subpage .article-content.cms-prose {
    color: #f3f0e8 !important;
    font-size: 18px;
    line-height: 1.85;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}
.article-detail-page .detail_content.cms-prose :is(p, li, div, span, h2, h3, h4),
.mobile-subpage .article-content.cms-prose :is(p, li, div, span, h2, h3, h4) { color: inherit; }
.article-detail-page .detail_content.cms-prose figcaption,
.mobile-subpage .article-content.cms-prose figcaption { color: #c9c6bf; }
