From e96e1cf1ff6ca68cfff1d55d2033a7bea6b48297 Mon Sep 17 00:00:00 2001 From: Mavis Date: Thu, 11 Jun 2026 22:53:38 +0800 Subject: [PATCH] =?UTF-8?q?style(article):=20=E6=AD=A3=E6=96=87=20p=20?= =?UTF-8?q?=E5=AD=97=E5=8F=B7=2017=E2=86=9219px,=E8=A1=8C=E9=AB=98=201.7?= =?UTF-8?q?=E2=86=921.75(=E9=98=85=E8=AF=BB=E6=9B=B4=E8=88=92=E6=9C=8D)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 后端 enrichment.ARTICLE_BODY_FONT_SIZE: 17 → 19(新写库的 LLM 排版版) - 前端 style.css .article-body / .diary-para: 17 → 19,line-height 1.7 → 1.75 - 768px 媒体查询: 16 → 18,line-height 1.8 → 1.85 - 480px 媒体查询: 15.5 → 17 老文章也立即变大(前端 .article-body 兜底);新排版文章用新 inline style。 后端要等下一次 enrich 才落新行(原 inline style 还是 17px), 如果想老排版版立即也变,在 /admin/llm 手动 trigger 几篇 enrich 即可。 --- backend/app/services/llm/enrichment.py | 4 ++-- frontend/src/style.css | 17 +++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/backend/app/services/llm/enrichment.py b/backend/app/services/llm/enrichment.py index 9d80ec7..bef0456 100644 --- a/backend/app/services/llm/enrichment.py +++ b/backend/app/services/llm/enrichment.py @@ -8,7 +8,7 @@ 排版容器 CSS(固定,不再让用户改): - 字体: system-ui 字体栈 -- 字号: 17px +- 字号: 19px(2026-06 调大,从 17 → 19,提升阅读舒适度) - 行高: 1.7 - 颜色: #3e3e3e - 段落: margin-bottom 1.5em(自动空一行);class 名固定为 diary-para @@ -49,7 +49,7 @@ ARTICLE_BODY_FONT_FAMILY = ( "system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, " "'Helvetica Neue', sans-serif" ) -ARTICLE_BODY_FONT_SIZE = "17px" +ARTICLE_BODY_FONT_SIZE = "19px" ARTICLE_BODY_LINE_HEIGHT = "1.7" ARTICLE_BODY_COLOR = "#3e3e3e" ARTICLE_BODY_P_MARGIN_BOTTOM = "1.5em" diff --git a/frontend/src/style.css b/frontend/src/style.css index 3763d7f..f0aceb3 100644 --- a/frontend/src/style.css +++ b/frontend/src/style.css @@ -107,8 +107,8 @@ h3 { font-size: 18px; font-weight: 700; line-height: 1.4; } h3 { font-size: 17px; line-height: 1.45; } /* 文章正文:行高微调(屏幕窄,行高再松一点) */ - .article-body { font-size: 16px; line-height: 1.8; } - .diary-para { font-size: 16px; line-height: 1.8; } + .article-body { font-size: 18px; line-height: 1.85; } + .diary-para { font-size: 18px; line-height: 1.85; } /* 评论钩子字号微调 */ .commentary-box { font-size: 13px; padding: 10px 12px; } @@ -132,8 +132,8 @@ h3 { font-size: 18px; font-weight: 700; line-height: 1.4; } padding: 10px 12px !important; } h1 { font-size: 20px; } - .article-body { font-size: 15.5px; } - .diary-para { font-size: 15.5px; } + .article-body { font-size: 17px; } + .diary-para { font-size: 17px; } } /* 工具类:手机端隐藏侧栏相关装饰 */ @@ -170,11 +170,12 @@ h3 { font-size: 18px; font-weight: 700; line-height: 1.4; } * 后端 enrichment 也会在容器 div 上内联同样的属性;这里做兜底, * 万一 inline style 被 sanitizer 剥掉,样式仍生效。 * 与 backend/app/services/llm/enrichment.py 里的常量保持一致。 + * 2026-06 字号从 17px 调到 19px,提升阅读舒适度 */ .article-body { font-family: var(--font-sans); - font-size: 17px; - line-height: 1.7; + font-size: 19px; + line-height: 1.75; color: var(--color-letter); } .article-body p { @@ -187,9 +188,9 @@ h3 { font-size: 18px; font-weight: 700; line-height: 1.4; } /* ===== 排版段落(.diary-para)兜底规则 ===== */ .diary-para { margin: 0 0 1.5em 0; - line-height: 1.7; + line-height: 1.75; color: var(--color-letter); - font-size: 17px; + font-size: 19px; } .diary-para:last-child { margin-bottom: 0;