- main.py 新增模板命名模块提取:Shared Resources/Marketplace/Unresolved/Core Points/Top Contributors\n- 新增贡献者昵称抽取与文本长度控制,提升模板数据稳定性\n- gemini_summary_card.html 重构为接近 gemini-code 的模块顺序与样式语言\n- 恢复 Key Discussions -> Resources -> Marketplace/Unresolved -> Core Points -> Contributors 的版式节奏\n- 保持模板为纯展示层,使用 main.py 结构化数据喂给模板,减少样式与内容错位
506 lines
16 KiB
HTML
506 lines
16 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>
|
|
{{ local_font_css }}
|
|
|
|
:root {
|
|
--slate-50: #f8fafc;
|
|
--slate-100: #f1f5f9;
|
|
--slate-200: #e2e8f0;
|
|
--slate-300: #cbd5e1;
|
|
--slate-400: #94a3b8;
|
|
--slate-500: #64748b;
|
|
--slate-600: #475569;
|
|
--slate-700: #334155;
|
|
--slate-900: #0f172a;
|
|
--blue-50: #eff6ff;
|
|
--blue-100: #dbeafe;
|
|
--blue-600: #2563eb;
|
|
--indigo-50: #eef2ff;
|
|
--indigo-600: #4f46e5;
|
|
--emerald-50: #ecfdf5;
|
|
--emerald-100: #d1fae5;
|
|
--emerald-600: #059669;
|
|
--emerald-800: #065f46;
|
|
--shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
|
|
}
|
|
|
|
* { box-sizing: border-box; }
|
|
|
|
body {
|
|
margin: 0;
|
|
padding: 22px 0;
|
|
background-color: var(--slate-50);
|
|
color: var(--slate-700);
|
|
font-family: var(--abot-font-sans, 'Inter', 'PingFang SC', -apple-system, sans-serif);
|
|
-webkit-font-smoothing: antialiased;
|
|
}
|
|
|
|
.report-container {
|
|
width: min(720px, calc(100vw - 14px));
|
|
margin: 0 auto;
|
|
background: #ffffff;
|
|
box-shadow: var(--shadow);
|
|
border: 1px solid var(--slate-200);
|
|
}
|
|
|
|
.label-tiny {
|
|
font-size: 9px;
|
|
font-weight: 800;
|
|
text-transform: uppercase;
|
|
letter-spacing: .08em;
|
|
color: var(--slate-400);
|
|
margin-bottom: 2px;
|
|
display: block;
|
|
}
|
|
|
|
.mono { font-family: var(--abot-font-code, 'JetBrains Mono', monospace); }
|
|
|
|
.header {
|
|
padding: 20px;
|
|
border-bottom: 1px solid var(--slate-100);
|
|
}
|
|
|
|
.header-row {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: flex-start;
|
|
gap: 10px;
|
|
margin-bottom: 13px;
|
|
}
|
|
|
|
.header-title {
|
|
margin: 0;
|
|
font-size: 16px;
|
|
font-weight: 900;
|
|
letter-spacing: -0.02em;
|
|
color: var(--slate-900);
|
|
}
|
|
|
|
.header-title .accent { color: var(--blue-600); font-weight: 600; }
|
|
|
|
.header-id {
|
|
margin: 4px 0 0;
|
|
font-size: 10px;
|
|
color: var(--slate-400);
|
|
font-weight: 600;
|
|
letter-spacing: .03em;
|
|
}
|
|
|
|
.header-tag {
|
|
padding: 4px 8px;
|
|
background: var(--slate-100);
|
|
border-radius: 4px;
|
|
font-size: 9px;
|
|
font-weight: 700;
|
|
color: var(--slate-500);
|
|
text-transform: uppercase;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.meta-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
gap: 8px;
|
|
text-align: center;
|
|
}
|
|
|
|
.meta-item {
|
|
background: var(--slate-50);
|
|
border-radius: 4px;
|
|
padding: 8px 6px;
|
|
}
|
|
|
|
.meta-value {
|
|
font-size: 12px;
|
|
font-weight: 800;
|
|
color: var(--slate-700);
|
|
}
|
|
|
|
.meta-value.is-blue { color: var(--blue-600); }
|
|
.meta-value.is-indigo { color: var(--indigo-600); }
|
|
.meta-value.is-emerald { color: var(--emerald-600); }
|
|
|
|
.radar {
|
|
padding: 0 20px 16px;
|
|
border-bottom: 1px solid var(--slate-100);
|
|
}
|
|
|
|
.radar-tags {
|
|
margin-top: 8px;
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 8px;
|
|
}
|
|
|
|
.radar-tag {
|
|
font-size: 10px;
|
|
padding: 2px 8px;
|
|
border-radius: 6px;
|
|
font-weight: 700;
|
|
border: 1px solid transparent;
|
|
}
|
|
|
|
.radar-tag.tone-blue { background: var(--blue-50); color: var(--blue-600); border-color: var(--blue-100); font-style: italic; }
|
|
.radar-tag.tone-indigo { background: var(--indigo-50); color: var(--indigo-600); border-color: #dbeafe; font-style: italic; }
|
|
.radar-tag.tone-emerald { background: var(--emerald-50); color: var(--emerald-600); border-color: var(--emerald-100); font-style: italic; }
|
|
.radar-tag.tone-slate { background: var(--slate-100); color: var(--slate-500); }
|
|
|
|
.content { padding: 20px; }
|
|
|
|
.lead {
|
|
margin: 0 0 14px;
|
|
background-color: #f0fdf4;
|
|
border-left: 2px solid #22c55e;
|
|
padding: 8px;
|
|
border-radius: 0 4px 4px 0;
|
|
font-size: 11px;
|
|
color: var(--emerald-800);
|
|
line-height: 1.7;
|
|
font-weight: 700;
|
|
}
|
|
|
|
.topic-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 14px;
|
|
}
|
|
|
|
.topic-card {
|
|
border: 1px solid var(--slate-200);
|
|
border-radius: 8px;
|
|
padding: 10px;
|
|
background: #fff;
|
|
}
|
|
|
|
.topic-title-row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
.topic-title {
|
|
margin: 0;
|
|
font-size: 12px;
|
|
font-weight: 800;
|
|
color: var(--slate-900);
|
|
}
|
|
|
|
.topic-divider {
|
|
height: 1px;
|
|
flex: 1;
|
|
background: var(--slate-100);
|
|
}
|
|
|
|
.topic-meta {
|
|
margin: 0 0 8px;
|
|
padding: 8px;
|
|
border-radius: 4px;
|
|
background: var(--slate-50);
|
|
border: 1px dashed var(--slate-200);
|
|
font-size: 11px;
|
|
color: var(--slate-600);
|
|
line-height: 1.6;
|
|
}
|
|
|
|
.topic-block { margin-bottom: 8px; }
|
|
.topic-block:last-child { margin-bottom: 0; }
|
|
|
|
.topic-text {
|
|
margin: 0;
|
|
font-size: 11px;
|
|
color: var(--slate-600);
|
|
line-height: 1.7;
|
|
}
|
|
|
|
.topic-bullets {
|
|
margin: 0;
|
|
padding-left: 14px;
|
|
color: var(--slate-600);
|
|
font-size: 11px;
|
|
line-height: 1.68;
|
|
}
|
|
|
|
.topic-bullets li { margin: 2px 0; }
|
|
|
|
.conclusion-area {
|
|
background-color: #f0fdf4;
|
|
border-left: 2px solid #22c55e;
|
|
padding: 8px;
|
|
border-radius: 0 4px 4px 0;
|
|
}
|
|
|
|
.conclusion-text {
|
|
margin: 0;
|
|
font-size: 11px;
|
|
font-weight: 700;
|
|
color: var(--emerald-800);
|
|
line-height: 1.6;
|
|
font-style: italic;
|
|
}
|
|
|
|
.resource-wrap {
|
|
margin-top: 14px;
|
|
padding: 14px 0;
|
|
border-top: 1px solid var(--slate-100);
|
|
border-bottom: 1px solid var(--slate-100);
|
|
background: rgba(248,250,252,0.5);
|
|
}
|
|
|
|
.resource-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 6px;
|
|
padding: 0 10px;
|
|
}
|
|
|
|
.resource-item {
|
|
border: 1px solid var(--slate-100);
|
|
border-radius: 4px;
|
|
padding: 7px 8px;
|
|
font-size: 10px;
|
|
color: var(--slate-600);
|
|
line-height: 1.6;
|
|
background: #fff;
|
|
}
|
|
|
|
.market-grid {
|
|
margin-top: 14px;
|
|
display: grid;
|
|
grid-template-columns: repeat(2, minmax(0,1fr));
|
|
gap: 12px;
|
|
}
|
|
|
|
.market-card {
|
|
border: 1px solid var(--slate-100);
|
|
border-radius: 6px;
|
|
padding: 8px;
|
|
background: #fff;
|
|
}
|
|
|
|
.market-item {
|
|
margin: 0 0 6px;
|
|
font-size: 10px;
|
|
color: var(--slate-600);
|
|
line-height: 1.6;
|
|
}
|
|
|
|
.market-item:last-child { margin-bottom: 0; }
|
|
|
|
.core-wrap { margin-top: 14px; }
|
|
|
|
.core-card {
|
|
border-radius: 6px;
|
|
background: #0f172a;
|
|
color: #e2e8f0;
|
|
padding: 10px;
|
|
border: 1px solid #1e293b;
|
|
}
|
|
|
|
.core-item {
|
|
margin: 0 0 6px;
|
|
font-size: 10px;
|
|
line-height: 1.65;
|
|
color: #cbd5e1;
|
|
}
|
|
|
|
.core-item:last-child { margin-bottom: 0; }
|
|
|
|
.footer-main {
|
|
margin-top: 14px;
|
|
padding: 12px 10px;
|
|
background: var(--slate-50);
|
|
border-top: 1px solid var(--slate-100);
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
gap: 12px;
|
|
}
|
|
|
|
.avatar-list { display: flex; margin-left: auto; }
|
|
|
|
.avatar {
|
|
width: 24px;
|
|
height: 24px;
|
|
border-radius: 50%;
|
|
border: 2px solid #fff;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 9px;
|
|
font-weight: 700;
|
|
margin-left: -6px;
|
|
}
|
|
|
|
.avatar:nth-child(1) { background: var(--blue-100); color: var(--blue-600); }
|
|
.avatar:nth-child(2) { background: #e0e7ff; color: var(--indigo-600); }
|
|
.avatar:nth-child(3) { background: #e2e8f0; color: var(--slate-500); }
|
|
|
|
.footer-note {
|
|
text-align: center;
|
|
margin-top: 10px;
|
|
font-size: 9px;
|
|
color: var(--slate-400);
|
|
letter-spacing: .03em;
|
|
text-transform: uppercase;
|
|
}
|
|
|
|
@media (max-width: 760px) {
|
|
.meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
.market-grid { grid-template-columns: 1fr; }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="report-container">
|
|
<header class="header">
|
|
<div class="header-row">
|
|
<div>
|
|
<h1 class="header-title">CHAT INSIGHTS <span class="accent">REPORT</span></h1>
|
|
<p class="header-id mono">ID: {{ generated_at }}</p>
|
|
</div>
|
|
<div class="header-tag">{{ summary_metrics.activity_badge or "Daily Archive" }}</div>
|
|
</div>
|
|
|
|
<div class="meta-grid">
|
|
{% for card in summary_metrics.kpi_cards|default([]) %}
|
|
<div class="meta-item">
|
|
<span class="label-tiny">{{ card.label }}</span>
|
|
<span class="meta-value {% if card.tone == 'blue' %}is-blue{% elif card.tone == 'violet' %}is-indigo{% elif card.tone == 'emerald' %}is-emerald{% endif %}">{{ card.value }}</span>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</header>
|
|
|
|
<section class="radar">
|
|
<span class="label-tiny"># Personal Interest Radar</span>
|
|
<div class="radar-tags">
|
|
{% for tag in summary_metrics.topic_tags|default([]) %}
|
|
<span class="radar-tag {% if loop.index0 % 4 == 0 %}tone-blue{% elif loop.index0 % 4 == 1 %}tone-indigo{% elif loop.index0 % 4 == 2 %}tone-emerald{% else %}tone-slate{% endif %}">{{ tag }}</span>
|
|
{% endfor %}
|
|
{% if not (summary_metrics.topic_tags|default([])) %}
|
|
<span class="radar-tag tone-slate">暂无热点标签</span>
|
|
{% endif %}
|
|
</div>
|
|
</section>
|
|
|
|
<section class="content">
|
|
<span class="label-tiny"># {{ summary_doc_title or title }}</span>
|
|
<p class="lead">{{ summary_lead or "暂无总结内容。" }}</p>
|
|
|
|
<span class="label-tiny"># Key Discussions</span>
|
|
<div class="topic-list">
|
|
{% for topic in summary_topics|default([]) %}
|
|
<article class="topic-card">
|
|
<div class="topic-title-row">
|
|
<h3 class="topic-title">{{ "%02d"|format(loop.index) }}. {{ topic["title"] }}</h3>
|
|
<div class="topic-divider"></div>
|
|
</div>
|
|
|
|
{% if topic["time_range"] or topic["participants"] %}
|
|
<div class="topic-meta">
|
|
{% if topic["time_range"] %}<div>时段:{{ topic["time_range"] }}</div>{% endif %}
|
|
{% if topic["participants"] %}<div>参与人数:{{ topic["participants"] }}</div>{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if topic["analysis_points"]|default([]) %}
|
|
<div class="topic-block">
|
|
<span class="label-tiny">Background</span>
|
|
<p class="topic-text">{{ topic["analysis_points"][0] }}</p>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if topic["overview_points"]|default([]) %}
|
|
<div class="topic-block">
|
|
<span class="label-tiny">Key Points</span>
|
|
<ul class="topic-bullets">
|
|
{% for line in topic["overview_points"] %}
|
|
<li>{{ line }}</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if topic["quote_text"] %}
|
|
<div class="conclusion-area">
|
|
<span class="label-tiny" style="color:#16a34a;">Conclusion</span>
|
|
<p class="conclusion-text">{{ topic["quote_text"] }}</p>
|
|
</div>
|
|
{% endif %}
|
|
</article>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
{% if not (summary_topics|default([])) %}
|
|
<p class="topic-text">{{ summary_fallback_text }}</p>
|
|
{% endif %}
|
|
|
|
{% if summary_shared_resources|default([]) %}
|
|
<section class="resource-wrap">
|
|
<span class="label-tiny" style="padding:0 10px 6px;"># Shared Resources</span>
|
|
<div class="resource-list">
|
|
{% for line in summary_shared_resources %}
|
|
<p class="resource-item">{{ line }}</p>
|
|
{% endfor %}
|
|
</div>
|
|
</section>
|
|
{% endif %}
|
|
|
|
<section class="market-grid">
|
|
<article class="market-card">
|
|
<span class="label-tiny"># Marketplace</span>
|
|
{% for line in summary_marketplace|default([]) %}
|
|
<p class="market-item">{{ line }}</p>
|
|
{% endfor %}
|
|
{% if not (summary_marketplace|default([])) %}
|
|
<p class="market-item">暂无交易信息</p>
|
|
{% endif %}
|
|
</article>
|
|
|
|
<article class="market-card">
|
|
<span class="label-tiny"># Unresolved Pool</span>
|
|
{% for line in summary_unresolved_pool|default([]) %}
|
|
<p class="market-item">{{ line }}</p>
|
|
{% endfor %}
|
|
{% if not (summary_unresolved_pool|default([])) %}
|
|
<p class="market-item">暂无待解问题</p>
|
|
{% endif %}
|
|
</article>
|
|
</section>
|
|
|
|
<section class="core-wrap">
|
|
<div class="core-card">
|
|
<span class="label-tiny" style="color:#64748b;"># Core Knowledge Points</span>
|
|
{% for line in summary_core_points|default([]) %}
|
|
<p class="core-item">{{ line }}</p>
|
|
{% endfor %}
|
|
{% if not (summary_core_points|default([])) %}
|
|
<p class="core-item">暂无核心知识点</p>
|
|
{% endif %}
|
|
</div>
|
|
</section>
|
|
|
|
<footer class="footer-main">
|
|
<span class="label-tiny" style="margin:0;">Top Contributors</span>
|
|
<div class="avatar-list">
|
|
{% for name in summary_top_contributors|default([]) %}
|
|
<span class="avatar">{{ name[:1] }}</span>
|
|
{% endfor %}
|
|
{% if not (summary_top_contributors|default([])) %}
|
|
<span class="avatar">A</span><span class="avatar">B</span><span class="avatar">C</span>
|
|
{% endif %}
|
|
</div>
|
|
</footer>
|
|
|
|
<div class="footer-note">Engine: Playwright · Tokens: {{ summary_metrics.token_total }} · Latency: {{ summary_metrics.latency_text }}</div>
|
|
</section>
|
|
</div>
|
|
</body>
|
|
</html>
|