diff --git a/app/server/public/css/style.css b/app/server/public/css/style.css index 4f167bd..c35423c 100644 --- a/app/server/public/css/style.css +++ b/app/server/public/css/style.css @@ -135,6 +135,49 @@ main { flex: 1; min-height: 0; display: flex; flex-direction: column; } max-width: 100%; white-space: pre-wrap; word-break: break-word; } +/* markdown 排版(v1 同款;仅当 marked 渲染成功时加 .md 类,否则保留 pre-wrap 原文) */ +.bubble-ai.md, .bubble-user.md { white-space: normal; } +.bubble-ai.md > :first-child, .bubble-user.md > :first-child { margin-top: 0; } +.bubble-ai.md > :last-child, .bubble-user.md > :last-child { margin-bottom: 0; } +.bubble-ai.md p, .bubble-user.md p { margin: 6px 0; } +.bubble-ai.md h1, .bubble-ai.md h2, .bubble-ai.md h3, +.bubble-user.md h1, .bubble-user.md h2, .bubble-user.md h3 { + margin: 12px 0 6px; line-height: 1.35; font-weight: 600; +} +.bubble-ai.md h1 { font-size: 1.3em; } +.bubble-ai.md h2 { font-size: 1.18em; } +.bubble-ai.md h3 { font-size: 1.08em; } +.bubble-user.md h1, .bubble-user.md h2, .bubble-user.md h3 { font-size: 1.05em; } +.bubble-ai.md ul, .bubble-ai.md ol, +.bubble-user.md ul, .bubble-user.md ol { padding-left: 1.5em; margin: 6px 0; } +.bubble-ai.md li, .bubble-user.md li { margin: 2px 0; } +.bubble-ai.md pre, .bubble-user.md pre { + background: var(--surface); border: 1px solid var(--border); + padding: 8px 10px; border-radius: 8px; margin: 6px 0; + overflow-x: auto; max-width: 100%; font-size: 13px; line-height: 1.5; +} +.bubble-ai.md code, .bubble-user.md code { + font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; + background: var(--surface); padding: 1px 4px; border-radius: 4px; font-size: 0.92em; +} +.bubble-ai.md pre code, .bubble-user.md pre code { background: none; padding: 0; } +.bubble-ai.md img, .bubble-user.md img { max-width: 100%; border-radius: 8px; } +.bubble-ai.md table, .bubble-user.md table { + border-collapse: collapse; margin: 6px 0; display: block; overflow-x: auto; +} +.bubble-ai.md th, .bubble-ai.md td, +.bubble-user.md th, .bubble-user.md td { + border: 1px solid var(--border); padding: 4px 8px; font-size: 13px; text-align: left; +} +.bubble-ai.md blockquote, .bubble-user.md blockquote { + border-left: 3px solid var(--gray-light); padding-left: 8px; + color: var(--gray); margin: 6px 0; +} +.bubble-ai.md a, .bubble-user.md a { color: var(--active); } +.bubble-ai.md hr, .bubble-user.md hr { + border: 0; border-top: 1px solid var(--border); margin: 10px 0; +} + /* AI 思考过程折叠模块 */ .think { align-self: stretch; max-width: 100%; diff --git a/app/server/public/index.html b/app/server/public/index.html index 7cd7a70..b16276a 100644 --- a/app/server/public/index.html +++ b/app/server/public/index.html @@ -4,6 +4,7 @@