Files
abot/plugins/message_summary/templates/gemini_summary_card.html
liuwei 35f1fbc978 群总结模板升级:新增Gemini风格卡片并优化Markdown富标签渲染
变更项:

1. 新增 templates/gemini_summary_card.html,按 Gemini 风格实现移动卡片化总结模板。

2. message_summary 渲染链路升级:支持更完整的 Markdown 富标签转 HTML(标题/列表/表格/代码块/引用等)。

3. 增加渲染后 HTML 安全过滤,清理 script/iframe/on* 事件与 javascript: 链接。

4. 增加 markdown 依赖缺失时的轻量回退解析,保证插件在最小环境下可用。

5. 默认输出配置切换为 template,并指向新 Gemini 风格模板。
2026-04-23 09:37:31 +08:00

299 lines
9.1 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ title }}</title>
<style>
:root {
--bg: #f8fafc;
--surface: #ffffff;
--line: #eef2f7;
--text: #334155;
--text-soft: #64748b;
--text-faint: #94a3b8;
--title: #0f172a;
--brand: #2563eb;
--brand-soft: #dbeafe;
--ok-soft: #f0fdf4;
--ok-line: #22c55e;
--quote-bg: #f8fafc;
--quote-line: #cbd5e1;
--code-bg: #0f172a;
--code-text: #e2e8f0;
--shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
}
* { box-sizing: border-box; }
body {
margin: 0;
padding: 24px 0;
background: var(--bg);
color: var(--text);
font-family: "Inter", "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
-webkit-font-smoothing: antialiased;
}
.report-container {
width: 440px;
margin: 0 auto;
background: var(--surface);
box-shadow: var(--shadow);
border: 1px solid #e2e8f0;
}
.label-tiny {
font-size: 9px;
font-weight: 800;
text-transform: uppercase;
letter-spacing: .08em;
color: var(--text-faint);
margin-bottom: 2px;
display: block;
}
.header {
padding: 18px 18px 14px;
border-bottom: 1px solid var(--line);
}
.header-row {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 12px;
gap: 10px;
}
.header-title {
font-size: 15px;
font-weight: 900;
color: var(--title);
letter-spacing: -.02em;
line-height: 1.35;
}
.header-title .accent {
color: var(--brand);
font-weight: 600;
}
.header-id {
margin-top: 4px;
font-size: 10px;
color: var(--text-faint);
font-weight: 600;
letter-spacing: .03em;
}
.header-tag {
padding: 4px 8px;
background: #f1f5f9;
border-radius: 4px;
font-size: 9px;
font-weight: 800;
color: #64748b;
text-transform: uppercase;
white-space: nowrap;
border: 1px solid #e2e8f0;
}
.meta-grid {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 8px;
text-align: center;
}
.meta-item {
background: #f8fafc;
border: 1px solid #f1f5f9;
border-radius: 4px;
padding: 8px 4px 6px;
}
.meta-value {
font-size: 11px;
font-weight: 800;
color: #475569;
}
.meta-value.brand {
color: var(--brand);
}
.summary-body {
padding: 16px 18px 18px;
}
.markdown-body {
font-size: 12px;
line-height: 1.82;
color: var(--text);
word-wrap: break-word;
}
.markdown-body > *:first-child { margin-top: 0; }
.markdown-body > *:last-child { margin-bottom: 0; }
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
color: var(--title);
margin: 16px 0 8px;
line-height: 1.42;
font-weight: 800;
letter-spacing: -.01em;
}
.markdown-body h1 { font-size: 18px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.markdown-body h2 { font-size: 16px; }
.markdown-body h3 { font-size: 14px; }
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 { font-size: 13px; }
.markdown-body p { margin: 8px 0; }
.markdown-body ul,
.markdown-body ol {
margin: 8px 0 12px;
padding-left: 18px;
}
.markdown-body li { margin: 4px 0; }
.markdown-body blockquote {
margin: 10px 0;
padding: 8px 10px;
border-left: 3px solid var(--quote-line);
background: var(--quote-bg);
color: #475569;
border-radius: 0 4px 4px 0;
}
.markdown-body hr {
border: none;
border-top: 1px dashed #dbe3ee;
margin: 14px 0;
}
.markdown-body a {
color: var(--brand);
text-decoration: none;
border-bottom: 1px dotted rgba(37, 99, 235, .5);
}
.markdown-body strong {
color: #1e293b;
font-weight: 800;
}
.markdown-body em {
color: #475569;
font-style: italic;
}
.markdown-body code {
font-family: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
font-size: 11px;
background: #eff6ff;
color: #1e40af;
padding: 1px 4px;
border-radius: 4px;
}
.markdown-body pre {
margin: 10px 0;
padding: 10px 11px;
border-radius: 6px;
background: var(--code-bg);
color: var(--code-text);
overflow-x: auto;
border: 1px solid #1e293b;
}
.markdown-body pre code {
background: transparent;
color: inherit;
padding: 0;
border-radius: 0;
font-size: 11px;
line-height: 1.7;
}
.markdown-body table {
width: 100%;
border-collapse: collapse;
margin: 10px 0;
font-size: 11px;
border: 1px solid #e2e8f0;
}
.markdown-body th,
.markdown-body td {
border: 1px solid #e2e8f0;
padding: 6px 7px;
text-align: left;
vertical-align: top;
}
.markdown-body th {
background: #f8fafc;
color: #334155;
font-weight: 700;
}
.markdown-body img {
max-width: 100%;
border-radius: 6px;
border: 1px solid #e2e8f0;
margin: 6px 0;
}
.summary-footer {
margin-top: 14px;
padding-top: 10px;
border-top: 1px dashed #e2e8f0;
font-size: 10px;
color: var(--text-faint);
display: flex;
justify-content: space-between;
align-items: center;
gap: 10px;
}
.summary-footer .right {
font-size: 9px;
color: #94a3b8;
letter-spacing: .04em;
text-transform: uppercase;
white-space: nowrap;
}
.safe-callout {
margin-top: 10px;
padding: 8px 10px;
background: var(--ok-soft);
border-left: 2px solid var(--ok-line);
border-radius: 0 4px 4px 0;
font-size: 11px;
color: #166534;
}
</style>
</head>
<body>
<div class="report-container">
<header class="header">
<div class="header-row">
<div>
<div class="header-title">CHAT INSIGHTS <span class="accent">SUMMARY</span></div>
<div class="header-id">{{ generated_at }}</div>
</div>
<div class="header-tag">Daily Archive</div>
</div>
<div class="meta-grid">
<div class="meta-item">
<span class="label-tiny">Type</span>
<div class="meta-value">群总结</div>
</div>
<div class="meta-item">
<span class="label-tiny">Mode</span>
<div class="meta-value brand">Template</div>
</div>
<div class="meta-item">
<span class="label-tiny">Render</span>
<div class="meta-value">HTML</div>
</div>
<div class="meta-item">
<span class="label-tiny">Engine</span>
<div class="meta-value">LLM</div>
</div>
</div>
</header>
<section class="summary-body">
<span class="label-tiny"># {{ title }}</span>
<div class="markdown-body">
{{ summary_html }}
</div>
<div class="safe-callout">
内容已按 Markdown 富标签样式渲染(标题、列表、表格、代码块、引用)。
</div>
<div class="summary-footer">
<span>ABOT · Message Summary Gemini Style</span>
<span class="right">Renderer: Playwright</span>
</div>
</section>
</div>
</body>
</html>