Files
diary-news/frontend/src/style.css
Mavis 380e8b124e feat(llm): 排版容器固定CSS + 插图用正文第一段 + 适中尺寸
- enrichment._enrich_format:把排版好的段落包到带固定 CSS 的 <div class=article-body> 里
  (font: system-ui / 17px / line-height 1.7 / color #3e3e3e / p margin-bottom 1.5em)
  CSS 同时内联到 style 属性,前端 .article-body 全局类做兑底
- enrichment._enrich_image:prompt 改用 body_zh_text 的第一段(原为 title);
  新增 {body} 占位符,image_prompt_template 默认模板同步改写
- 插图尺寸写死为 768x512(适中);image_size 字段保留供用户手改但默认行为不依赖它
- 分类明确多标签(2-5 个),提示词加 {body} 变量,容错读 categories/tags 两种 key
- AdminLlmSettings.vue:placeholder / 变量说明同步更新
2026-06-08 20:53:21 +08:00

48 lines
1.2 KiB
CSS

:root {
--max-width: 1200px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
line-height: 1.6;
color: #1f2328;
background: #fafbfc;
}
* { box-sizing: border-box; }
html, body, #app {
margin: 0;
padding: 0;
min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
a:hover { color: #2080f0; }
img { max-width: 100%; }
.n-card.article-card {
margin-bottom: 16px;
transition: box-shadow 0.15s;
}
.n-card.article-card:hover {
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
/* === 文章正文容器(项目级固定 CSS,排版版译文用)===
* 后端 enrichment 也会在容器 div 上内联同样的属性;这里做兜底,
* 万一 inline style 被 sanitizer 剥掉,样式仍生效。
* 与 backend/app/services/llm/enrichment.py 里的常量保持一致。
*/
.article-body {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
font-size: 17px;
line-height: 1.7;
color: #3e3e3e;
}
.article-body p {
margin: 0 0 1.5em 0;
}
.article-body p:last-child {
margin-bottom: 0;
}