work-rhythm 0.1.8 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/notes/AGENTS.md +7 -1
- package/.agents/notes/decisions/2026-12-01-interjections-batch-into-one-answer-and-interrupt-reruns.md +33 -0
- package/.agents/notes/decisions/2026-12-01-long-runs-are-bounded-by-silence-not-wall-clock.md +35 -0
- package/.agents/notes/decisions/2026-12-01-router-and-worker-pass-content-in-handoff-docs.md +41 -0
- package/.agents/notes/pitfalls/2026-12-01-replace-string-dollar-quote-expands.md +16 -0
- package/.agents/skills/work-rhythm/SKILL.md +14 -12
- package/README.md +7 -4
- package/collectors/local.env.example +10 -1
- package/docs/agents.md +28 -11
- package/docs/channels.md +9 -6
- package/docs/router-worker.md +241 -0
- package/docs/scheduled-tasks.md +4 -4
- package/package.json +1 -1
- package/scripts/cli.js +4 -3
- package/scripts/cmd/agent.js +78 -40
- package/scripts/cmd/check.js +4 -0
- package/scripts/cmd/listen.js +18 -4
- package/scripts/cmd/rhythm.js +6 -2
- package/scripts/cmd/trigger.js +143 -0
- package/scripts/lib/agent.js +377 -30
- package/scripts/lib/bot.js +140 -35
- package/scripts/lib/engine.js +523 -0
- package/scripts/lib/handoff.js +165 -0
- package/scripts/lib/markdown.js +328 -38
- package/scripts/lib/rhythm.js +369 -31
- package/scripts/lib/router.js +161 -0
- package/scripts/lib/run.js +43 -0
- package/scripts/lib/view.js +583 -0
- package/scripts/lib/worker.js +97 -0
- package/scripts/test/agent.test.js +17 -9
- package/scripts/test/check.test.js +7 -2
- package/scripts/test/harness.js +13 -1
- package/scripts/test/listen.test.js +2 -2
- package/scripts/test/rhythm.test.js +28 -6
- package/scripts/test/router-helper.js +80 -0
- package/scripts/test/router.test.js +509 -0
- package/scripts/test/stubs.js +82 -12
- package/scripts/test/timeout.test.js +99 -0
- package/templates/00-config/profile.example.yaml +7 -0
- package/templates/AGENTS.md +3 -1
- package/templates/README.md +4 -1
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
// 路由和执行者之间传内容的交接文档,都放在工作目录的 .agents/handoff/ 下:任务书 t-000123.md、回执 t-000123.result.md。
|
|
2
|
+
// 提示词里只带路径,不带正文(docs/router-worker.md 的「交接文档」)。这里还管路由回复的解析:它回一段 Markdown,
|
|
3
|
+
// 先列决定行(「- t-000123 dispatch」),要文字的决定再各给一个小节(「## handoff t-000123」)。
|
|
4
|
+
// 文件名只认 t-数字.md 和 t-数字.result.md 两种,网页服务按这个放行。只用 node 自带的能力。
|
|
5
|
+
'use strict';
|
|
6
|
+
const fs = require('node:fs');
|
|
7
|
+
const path = require('node:path');
|
|
8
|
+
|
|
9
|
+
const DIR = '.agents/handoff';
|
|
10
|
+
const NAME_RE = /^(t-\d+)(\.result)?\.md$/;
|
|
11
|
+
const ACTIONS = ['dispatch', 'continue', 'stop', 'interrupt', 'reply', 'ignore', 'notify'];
|
|
12
|
+
const SECTION_RE = /^##[ \t]+(reply|ignore|handoff|notify)[ \t]+(t-\d+)[ \t]*.*$/;
|
|
13
|
+
const DECISION_RE = /^[ \t]*-?[ \t]*(t-\d+)[ \t]+(dispatch|continue|stop|interrupt|reply|ignore|notify)(?:[ \t]+(t-\d+))?[ \t]*$/;
|
|
14
|
+
const MARKER = '【work-rhythm 路由】';
|
|
15
|
+
const DAY_MS = 24 * 3600 * 1000;
|
|
16
|
+
|
|
17
|
+
const dir = (root) => path.join(root, DIR);
|
|
18
|
+
const relTask = (id) => `${DIR}/${id}.md`;
|
|
19
|
+
const relResult = (id) => `${DIR}/${id}.result.md`;
|
|
20
|
+
const taskPath = (root, id) => path.join(dir(root), `${id}.md`);
|
|
21
|
+
const resultPath = (root, id) => path.join(dir(root), `${id}.result.md`);
|
|
22
|
+
|
|
23
|
+
const readText = (file) => {
|
|
24
|
+
try {
|
|
25
|
+
return fs.readFileSync(file, 'utf8');
|
|
26
|
+
} catch {
|
|
27
|
+
return '';
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// 回执在不在、是不是空的
|
|
32
|
+
function resultReady(root, id) {
|
|
33
|
+
try {
|
|
34
|
+
return fs.statSync(resultPath(root, id)).size > 0;
|
|
35
|
+
} catch {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// 回执的开头几句:汇报给路由时带上,不用读文件就能判断要不要理它
|
|
41
|
+
function opening(text, max = 300) {
|
|
42
|
+
const flat = String(text || '').replace(/^#.*$/gm, '').replace(/\s+/g, ' ').trim();
|
|
43
|
+
return flat.length > max ? `${flat.slice(0, max)}…` : flat;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// 任务书的一级标题当这件事的标题(路由自己写的,不是原话)
|
|
47
|
+
function titleOf(body) {
|
|
48
|
+
const m = /^#[ \t]+(.+)$/m.exec(String(body || ''));
|
|
49
|
+
return m ? m[1].trim().slice(0, 60) : '';
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function write(file, text) {
|
|
53
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
54
|
+
fs.writeFileSync(file, text);
|
|
55
|
+
return file;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// 任务书。t 是触发记录(id、kind、at、text…),body 是要求(路由写的 handoff 小节,或 tasks/<id>.md 的全文),extra 填表头
|
|
59
|
+
function taskText(t, body, extra = {}) {
|
|
60
|
+
const when = String(t.at || '').slice(5, 16);
|
|
61
|
+
const source = {
|
|
62
|
+
message: `message(云之家,${when})· 原话:「${t.text || ''}」`,
|
|
63
|
+
manual: `manual(命令行 trigger fire,${when})· 原话:「${t.text || ''}」`,
|
|
64
|
+
schedule: `schedule(到点 ${when})· 任务:${t.task || ''}(${t.taskFile || ''})`,
|
|
65
|
+
report: `report(${when})· 重做 ${t.of || ''} 那件事`,
|
|
66
|
+
}[t.kind] || t.kind;
|
|
67
|
+
const lines = [
|
|
68
|
+
`# 任务书 ${t.id}`,
|
|
69
|
+
'',
|
|
70
|
+
`- 来源:${source}`,
|
|
71
|
+
`- 派给:执行者 · 权限 ${extra.mode || 'plan'} · 最多 ${extra.timeoutS || 300} 秒`,
|
|
72
|
+
`- ${t.kind === 'report' ? '重做自' : '续做自'}:${t.kind === 'report' ? t.of || '' : extra.continueOf || '无'}`,
|
|
73
|
+
'',
|
|
74
|
+
'## 要求',
|
|
75
|
+
'',
|
|
76
|
+
String(body || '').trim(),
|
|
77
|
+
'',
|
|
78
|
+
'## 回执',
|
|
79
|
+
'',
|
|
80
|
+
`做完把结果写到 \`${relResult(t.id)}\`:做了什么、改了哪些文件、要留意什么、有几件事等我拿主意。`,
|
|
81
|
+
'取不到的数据写「未取到」,不要编。要改动外部系统(发消息、改日程、流转工作项)的事不要做,写进回执让我定。',
|
|
82
|
+
'没有写权限就把同样内容作为最后一段话输出。纯文本,不放链接。不要向我提问,不要等待确认,不要自己发消息。',
|
|
83
|
+
'',
|
|
84
|
+
];
|
|
85
|
+
return lines.join('\n');
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const writeTask = (root, t, body, extra) => write(taskPath(root, t.id), taskText(t, body, extra));
|
|
89
|
+
|
|
90
|
+
// 回执。执行者自己写的优先;它没写(只读、忘了、没跑成)时由 CLI 落盘,注明是谁写的
|
|
91
|
+
function resultText(id, body, { ok = true, reason = '', seconds = 0, agent = '', by = '' } = {}) {
|
|
92
|
+
const head = [
|
|
93
|
+
`# 回执 ${id}`,
|
|
94
|
+
'',
|
|
95
|
+
`- 结果:${ok ? '成功' : '失败'}${reason ? ` · 原因:${reason}` : ''}${seconds ? ` · 用时 ${seconds} 秒` : ''}${agent ? ` · 执行者 ${agent}` : ''}`,
|
|
96
|
+
`- ${by === 'cli' ? '由 CLI 从执行者最后的回答落盘' : by === 'cli-fail' ? '由 CLI 落盘(执行者没留下回执)' : '执行者写的'}`,
|
|
97
|
+
'',
|
|
98
|
+
].join('\n');
|
|
99
|
+
return `${head}\n${String(body || '').trim()}\n`;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const writeResult = (root, id, body, meta) => write(resultPath(root, id), resultText(id, body, meta));
|
|
103
|
+
|
|
104
|
+
// 过期的交接文档清掉,返回清了几个。按文件的修改时间算
|
|
105
|
+
function cleanup(root, keepDays, now = Date.now()) {
|
|
106
|
+
const cutoff = now - keepDays * DAY_MS;
|
|
107
|
+
let names;
|
|
108
|
+
try {
|
|
109
|
+
names = fs.readdirSync(dir(root));
|
|
110
|
+
} catch {
|
|
111
|
+
return 0;
|
|
112
|
+
}
|
|
113
|
+
let removed = 0;
|
|
114
|
+
for (const name of names) {
|
|
115
|
+
if (!NAME_RE.test(name)) continue;
|
|
116
|
+
const file = path.join(dir(root), name);
|
|
117
|
+
try {
|
|
118
|
+
if (fs.statSync(file).mtimeMs < cutoff) {
|
|
119
|
+
fs.unlinkSync(file);
|
|
120
|
+
removed += 1;
|
|
121
|
+
}
|
|
122
|
+
} catch {
|
|
123
|
+
// 刚好被别的进程动了
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return removed;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// 解析路由的回复 → 决定的数组 [{ id, action, target?, handoff?, text? }]。
|
|
130
|
+
// 决定行在任务书小节外面都认(任务书正文里的不认);只有小节没有决定行的,从小节标题认动作
|
|
131
|
+
function parseRouterReply(text) {
|
|
132
|
+
const found = {};
|
|
133
|
+
const pick = (id) => found[id] || (found[id] = { id });
|
|
134
|
+
let section = null; // 当前在哪个小节里:{ kind, id, lines }
|
|
135
|
+
const sections = [];
|
|
136
|
+
for (const raw of String(text || '').split('\n')) {
|
|
137
|
+
const m = SECTION_RE.exec(raw);
|
|
138
|
+
if (m) {
|
|
139
|
+
section = { kind: m[1], id: m[2], lines: [] };
|
|
140
|
+
sections.push(section);
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
if (section) section.lines.push(raw);
|
|
144
|
+
const d = (!section || section.kind !== 'handoff') ? DECISION_RE.exec(raw) : null;
|
|
145
|
+
if (d) {
|
|
146
|
+
const it = pick(d[1]);
|
|
147
|
+
it.action = d[2];
|
|
148
|
+
if (d[3]) it.target = d[3];
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
for (const s of sections) {
|
|
152
|
+
const it = pick(s.id);
|
|
153
|
+
it[s.kind] = s.lines.join('\n').trim();
|
|
154
|
+
if (!it.action) it.action = s.kind === 'handoff' ? 'dispatch' : s.kind;
|
|
155
|
+
}
|
|
156
|
+
return Object.values(found).map((it) => ({
|
|
157
|
+
id: it.id,
|
|
158
|
+
action: ACTIONS.includes(it.action) ? it.action : '',
|
|
159
|
+
target: it.target || '',
|
|
160
|
+
handoff: it.handoff || '',
|
|
161
|
+
text: it.reply || it.notify || it.ignore || '',
|
|
162
|
+
}));
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
module.exports = { DIR, NAME_RE, MARKER, dir, relTask, relResult, taskPath, resultPath, readText, resultReady, opening, titleOf, taskText, writeTask, resultText, writeResult, cleanup, parseRouterReply };
|
package/scripts/lib/markdown.js
CHANGED
|
@@ -8,7 +8,8 @@ function escapeHtml(s) {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
// 行内标记。代码段先换成占位符,免得里面的星号、方括号被当成标记
|
|
11
|
-
function inline(text) {
|
|
11
|
+
function inline(text, opts) {
|
|
12
|
+
const rewrite = opts && typeof opts.rewriteHref === 'function' ? opts.rewriteHref : null;
|
|
12
13
|
const codes = [];
|
|
13
14
|
let s = String(text).replace(/`([^`]+)`/g, (m, code) => {
|
|
14
15
|
codes.push(`<code>${escapeHtml(code)}</code>`);
|
|
@@ -18,7 +19,9 @@ function inline(text) {
|
|
|
18
19
|
s = s.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g, (m, label, url) => {
|
|
19
20
|
// 只放行 http(s)、mailto、本站相对地址;别的协议(javascript: 之类)当文字显示
|
|
20
21
|
if (!/^(https?:|mailto:|\/|\.\/|\.\.\/|#)/i.test(url)) return m;
|
|
21
|
-
|
|
22
|
+
const href = rewrite ? rewrite(url) : url;
|
|
23
|
+
const safe = href === url ? url : escapeHtml(href);
|
|
24
|
+
return `<a href="${safe}">${label}</a>`;
|
|
22
25
|
});
|
|
23
26
|
s = s.replace(/\*\*([^*\n]+)\*\*/g, '<strong>$1</strong>');
|
|
24
27
|
s = s.replace(/(^|[\s((])\*([^*\s][^*\n]*)\*/g, '$1<em>$2</em>');
|
|
@@ -42,7 +45,7 @@ function isBlockStart(line) {
|
|
|
42
45
|
}
|
|
43
46
|
|
|
44
47
|
// 从第 i 行起解析一个列表,返回 [html, 下一个下标]。缩进更深的是上一项的子内容
|
|
45
|
-
function parseList(lines, i) {
|
|
48
|
+
function parseList(lines, i, opts) {
|
|
46
49
|
const first = /^(\s*)([-*+]|\d+[.)])\s+(.*)$/.exec(lines[i]);
|
|
47
50
|
const base = first[1].length;
|
|
48
51
|
const ordered = /\d/.test(first[2]);
|
|
@@ -78,13 +81,13 @@ function parseList(lines, i) {
|
|
|
78
81
|
box = `<input type="checkbox" disabled${cb[1] === ' ' ? '' : ' checked'}> `;
|
|
79
82
|
head = cb[2];
|
|
80
83
|
}
|
|
81
|
-
const inner = inline(head) + (it.body.trim() ? `\n${render(it.body)}` : '');
|
|
84
|
+
const inner = inline(head, opts) + (it.body.trim() ? `\n${render(it.body, opts)}` : '');
|
|
82
85
|
return `<li>${box}${inner}</li>`;
|
|
83
86
|
}).join('\n');
|
|
84
87
|
return [`<${ordered ? 'ol' : 'ul'}>\n${html}\n</${ordered ? 'ol' : 'ul'}>`, i];
|
|
85
88
|
}
|
|
86
89
|
|
|
87
|
-
function table(lines, i) {
|
|
90
|
+
function table(lines, i, opts) {
|
|
88
91
|
const head = cells(lines[i]);
|
|
89
92
|
const sep = cells(lines[i + 1]);
|
|
90
93
|
const align = sep.map((c) => (c.startsWith(':') && c.endsWith(':') ? 'center' : c.endsWith(':') ? 'right' : c.startsWith(':') ? 'left' : ''));
|
|
@@ -94,12 +97,12 @@ function table(lines, i) {
|
|
|
94
97
|
rows.push(cells(lines[i]));
|
|
95
98
|
i += 1;
|
|
96
99
|
}
|
|
97
|
-
const th = head.map((c, k) => `<th${align[k] ? ` style="text-align:${align[k]}"` : ''}>${inline(c)}</th>`).join('');
|
|
98
|
-
const tr = rows.map((r) => `<tr>${head.map((_, k) => `<td${align[k] ? ` style="text-align:${align[k]}"` : ''}>${inline(r[k] ?? '')}</td>`).join('')}</tr>`).join('\n');
|
|
99
|
-
return [`<table>\n<thead><tr>${th}</tr></thead>\n<tbody>\n${tr}\n</tbody>\n</table>`, i];
|
|
100
|
+
const th = head.map((c, k) => `<th${align[k] ? ` style="text-align:${align[k]}"` : ''}>${inline(c, opts)}</th>`).join('');
|
|
101
|
+
const tr = rows.map((r) => `<tr>${head.map((_, k) => `<td${align[k] ? ` style="text-align:${align[k]}"` : ''}>${inline(r[k] ?? '', opts)}</td>`).join('')}</tr>`).join('\n');
|
|
102
|
+
return [`<div class="table-wrap"><table>\n<thead><tr>${th}</tr></thead>\n<tbody>\n${tr}\n</tbody>\n</table></div>`, i];
|
|
100
103
|
}
|
|
101
104
|
|
|
102
|
-
function render(md) {
|
|
105
|
+
function render(md, opts) {
|
|
103
106
|
const lines = String(md).replace(/\r\n?/g, '\n').split('\n');
|
|
104
107
|
const n = lines.length;
|
|
105
108
|
const out = [];
|
|
@@ -125,7 +128,7 @@ function render(md) {
|
|
|
125
128
|
const h = /^(#{1,6})\s+(.*)$/.exec(line);
|
|
126
129
|
if (h) {
|
|
127
130
|
const level = h[1].length;
|
|
128
|
-
out.push(`<h${level}>${inline(h[2])}</h${level}>`);
|
|
131
|
+
out.push(`<h${level}>${inline(h[2], opts)}</h${level}>`);
|
|
129
132
|
i += 1;
|
|
130
133
|
continue;
|
|
131
134
|
}
|
|
@@ -140,17 +143,17 @@ function render(md) {
|
|
|
140
143
|
buf.push(lines[i].replace(/^>\s?/, ''));
|
|
141
144
|
i += 1;
|
|
142
145
|
}
|
|
143
|
-
out.push(`<blockquote>\n${render(buf.join('\n'))}\n</blockquote>`);
|
|
146
|
+
out.push(`<blockquote>\n${render(buf.join('\n'), opts)}\n</blockquote>`);
|
|
144
147
|
continue;
|
|
145
148
|
}
|
|
146
149
|
if (line.includes('|') && i + 1 < n && isSeparator(lines[i + 1])) {
|
|
147
|
-
const [html, next] = table(lines, i);
|
|
150
|
+
const [html, next] = table(lines, i, opts);
|
|
148
151
|
out.push(html);
|
|
149
152
|
i = next;
|
|
150
153
|
continue;
|
|
151
154
|
}
|
|
152
155
|
if (/^(\s*)([-*+]|\d+[.)])\s+/.test(line)) {
|
|
153
|
-
const [html, next] = parseList(lines, i);
|
|
156
|
+
const [html, next] = parseList(lines, i, opts);
|
|
154
157
|
out.push(html);
|
|
155
158
|
i = next;
|
|
156
159
|
continue;
|
|
@@ -161,45 +164,332 @@ function render(md) {
|
|
|
161
164
|
buf.push(lines[i]);
|
|
162
165
|
i += 1;
|
|
163
166
|
}
|
|
164
|
-
out.push(`<p>${buf.map(inline).join('<br>')}</p>`);
|
|
167
|
+
out.push(`<p>${buf.map((l) => inline(l, opts)).join('<br>')}</p>`);
|
|
165
168
|
}
|
|
166
169
|
return out.join('\n');
|
|
167
170
|
}
|
|
168
171
|
|
|
172
|
+
const BASE_CSS = `
|
|
173
|
+
:root{
|
|
174
|
+
--bg:#f4f3ef;
|
|
175
|
+
--surface:#ffffff;
|
|
176
|
+
--surface-2:#faf9f6;
|
|
177
|
+
--surface-3:#f1efe9;
|
|
178
|
+
--topbar:rgba(244,243,239,.86);
|
|
179
|
+
--ink:#1a1917;
|
|
180
|
+
--ink-2:#47443e;
|
|
181
|
+
--muted:#7d786f;
|
|
182
|
+
--border:#e5e2da;
|
|
183
|
+
--border-soft:#efede7;
|
|
184
|
+
--accent:#2563eb;
|
|
185
|
+
--accent-ink:#1d4ed8;
|
|
186
|
+
--accent-bg:#eff6ff;
|
|
187
|
+
--accent-bd:#bfdbfe;
|
|
188
|
+
--amber-bg:#fef8e7;
|
|
189
|
+
--amber-bd:#f3d485;
|
|
190
|
+
--amber-ink:#8f5407;
|
|
191
|
+
--green-bg:#ecfdf3;
|
|
192
|
+
--green-bd:#b7ebc9;
|
|
193
|
+
--green-ink:#166534;
|
|
194
|
+
--rose-bg:#fef2f2;
|
|
195
|
+
--rose-bd:#fecaca;
|
|
196
|
+
--rose-ink:#b42318;
|
|
197
|
+
--violet-bg:#f5f3ff;
|
|
198
|
+
--violet-ink:#5b21b6;
|
|
199
|
+
--sky-bg:#f0f9ff;
|
|
200
|
+
--sky-ink:#0369a1;
|
|
201
|
+
--indigo-bg:#eef2ff;
|
|
202
|
+
--indigo-ink:#3730a3;
|
|
203
|
+
--teal-bg:#f0fdfa;
|
|
204
|
+
--teal-ink:#0f766e;
|
|
205
|
+
--slate-bg:#f1f5f9;
|
|
206
|
+
--slate-ink:#475569;
|
|
207
|
+
--shadow:0 1px 2px rgba(20,18,14,.04),0 4px 16px rgba(20,18,14,.03);
|
|
208
|
+
--radius:14px;
|
|
209
|
+
--radius-sm:9px;
|
|
210
|
+
--max-w:980px;
|
|
211
|
+
--font:-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Helvetica Neue",Arial,sans-serif;
|
|
212
|
+
--mono:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,monospace;
|
|
213
|
+
}
|
|
214
|
+
@media (prefers-color-scheme:dark){
|
|
215
|
+
:root{
|
|
216
|
+
--bg:#131312;
|
|
217
|
+
--surface:#1c1c1a;
|
|
218
|
+
--surface-2:#23221f;
|
|
219
|
+
--surface-3:#2b2a26;
|
|
220
|
+
--topbar:rgba(19,19,18,.84);
|
|
221
|
+
--ink:#edece7;
|
|
222
|
+
--ink-2:#c7c3b8;
|
|
223
|
+
--muted:#8f8b81;
|
|
224
|
+
--border:#2e2d29;
|
|
225
|
+
--border-soft:#262522;
|
|
226
|
+
--accent:#60a5fa;
|
|
227
|
+
--accent-ink:#93c5fd;
|
|
228
|
+
--accent-bg:rgba(59,130,246,.14);
|
|
229
|
+
--accent-bd:rgba(96,165,250,.32);
|
|
230
|
+
--amber-bg:rgba(245,158,11,.13);
|
|
231
|
+
--amber-bd:rgba(245,158,11,.34);
|
|
232
|
+
--amber-ink:#fbbf24;
|
|
233
|
+
--green-bg:rgba(34,197,94,.13);
|
|
234
|
+
--green-bd:rgba(34,197,94,.3);
|
|
235
|
+
--green-ink:#4ade80;
|
|
236
|
+
--rose-bg:rgba(244,63,94,.14);
|
|
237
|
+
--rose-bd:rgba(244,63,94,.32);
|
|
238
|
+
--rose-ink:#fda4af;
|
|
239
|
+
--violet-bg:rgba(139,92,246,.16);
|
|
240
|
+
--violet-ink:#c4b5fd;
|
|
241
|
+
--sky-bg:rgba(14,165,233,.16);
|
|
242
|
+
--sky-ink:#7dd3fc;
|
|
243
|
+
--indigo-bg:rgba(99,102,241,.18);
|
|
244
|
+
--indigo-ink:#a5b4fc;
|
|
245
|
+
--teal-bg:rgba(20,184,166,.16);
|
|
246
|
+
--teal-ink:#5eead4;
|
|
247
|
+
--slate-bg:rgba(148,163,184,.14);
|
|
248
|
+
--slate-ink:#cbd5e1;
|
|
249
|
+
--shadow:0 1px 2px rgba(0,0,0,.28),0 6px 20px rgba(0,0,0,.22);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
*,*::before,*::after{box-sizing:border-box}
|
|
253
|
+
html{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
|
|
254
|
+
body{margin:0;padding:0 0 56px;background:var(--bg);color:var(--ink);font:15px/1.68 var(--font);font-feature-settings:"tnum"}
|
|
255
|
+
body.is-wide{--max-w:1160px}
|
|
256
|
+
a{color:var(--accent-ink);text-decoration:none;text-underline-offset:3px}
|
|
257
|
+
a:hover{text-decoration:underline}
|
|
258
|
+
|
|
259
|
+
/* 顶部导航栏 */
|
|
260
|
+
.topbar{position:sticky;top:0;z-index:20;background:var(--topbar);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-bottom:1px solid var(--border)}
|
|
261
|
+
.topbar-inner{max-width:var(--max-w);margin:0 auto;padding:11px 24px;display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
|
|
262
|
+
.brand{display:inline-flex;align-items:center;gap:9px;color:var(--ink);font-weight:650;font-size:14px;letter-spacing:-.01em;text-decoration:none}
|
|
263
|
+
.brand:hover{text-decoration:none;opacity:.85}
|
|
264
|
+
.brand-mark{width:18px;height:18px;border-radius:6px;background:linear-gradient(135deg,#2563eb 0%,#4f46e5 100%);display:inline-flex;align-items:center;justify-content:center;box-shadow:0 1px 3px rgba(37,99,235,.32)}
|
|
265
|
+
.brand-mark::after{content:"";width:7px;height:7px;border-radius:50%;background:#fff}
|
|
266
|
+
.topbar nav{display:flex;align-items:center;gap:3px;flex-wrap:wrap}
|
|
267
|
+
.topbar nav a{color:var(--ink-2);font-size:13.5px;font-weight:500;padding:5px 11px;border-radius:8px;transition:background .15s,color .15s}
|
|
268
|
+
.topbar nav a:hover{background:var(--surface-3);color:var(--ink);text-decoration:none}
|
|
269
|
+
.topbar nav a.is-active{background:var(--surface);color:var(--ink);font-weight:600;box-shadow:0 1px 2px rgba(0,0,0,.06),inset 0 0 0 1px var(--border)}
|
|
270
|
+
|
|
271
|
+
/* 主容器 */
|
|
272
|
+
.wrap{max-width:var(--max-w);margin:24px auto 0;padding:0 24px}
|
|
273
|
+
main.sheet{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:32px 36px;box-shadow:var(--shadow)}
|
|
274
|
+
main.stack{display:flex;flex-direction:column;gap:16px}
|
|
275
|
+
|
|
276
|
+
/* 通用排版 */
|
|
277
|
+
h1{font-size:25px;line-height:1.3;font-weight:700;letter-spacing:-.02em;margin:0 0 16px;color:var(--ink)}
|
|
278
|
+
h2{font-size:16.5px;line-height:1.4;font-weight:650;letter-spacing:-.01em;margin:28px 0 12px;padding-bottom:8px;border-bottom:1px solid var(--border-soft);color:var(--ink)}
|
|
279
|
+
main.sheet>h2:first-child{margin-top:0}
|
|
280
|
+
h3{font-size:14.5px;font-weight:650;margin:20px 0 8px;color:var(--ink)}
|
|
281
|
+
p{margin:0 0 11px;color:var(--ink-2)}
|
|
282
|
+
p:last-child{margin-bottom:0}
|
|
283
|
+
ul,ol{margin:8px 0 12px;padding-left:22px;color:var(--ink-2)}
|
|
284
|
+
li{margin:5px 0}
|
|
285
|
+
li>p{margin:4px 0}
|
|
286
|
+
li input[type="checkbox"]{accent-color:var(--accent);transform:translateY(1px);margin-right:4px}
|
|
287
|
+
strong{color:var(--ink);font-weight:620}
|
|
288
|
+
hr{border:0;border-top:1px solid var(--border-soft);margin:22px 0}
|
|
289
|
+
code{background:var(--surface-3);color:var(--ink);border-radius:5px;padding:1.5px 6px;font:12.5px/1.5 var(--mono)}
|
|
290
|
+
pre{background:var(--surface-2);border:1px solid var(--border);border-radius:10px;padding:14px 16px;overflow:auto;margin:12px 0}
|
|
291
|
+
pre code{background:none;padding:0;font-size:12.5px;line-height:1.6;color:var(--ink-2)}
|
|
292
|
+
blockquote{margin:12px 0;padding:10px 15px;border-left:3px solid var(--accent-bd);border-radius:0 8px 8px 0;color:var(--ink-2);background:var(--surface-2);font-size:14px}
|
|
293
|
+
blockquote p{margin:0}
|
|
294
|
+
.muted{color:var(--muted);font-size:13.5px}
|
|
295
|
+
|
|
296
|
+
/* 表格 */
|
|
297
|
+
.table-wrap{overflow-x:auto;margin:12px 0;border:1px solid var(--border);border-radius:10px;background:var(--surface)}
|
|
298
|
+
table{border-collapse:collapse;width:100%;font-size:13.5px}
|
|
299
|
+
th,td{padding:9px 13px;text-align:left;vertical-align:top;border-bottom:1px solid var(--border-soft)}
|
|
300
|
+
th{background:var(--surface-2);color:var(--muted);font-weight:600;font-size:12px;letter-spacing:.02em;white-space:nowrap}
|
|
301
|
+
tbody tr:last-child td{border-bottom:none}
|
|
302
|
+
tbody tr:hover{background:var(--surface-2)}
|
|
303
|
+
|
|
304
|
+
/* 卡片与通用组件 */
|
|
305
|
+
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:22px 24px;box-shadow:var(--shadow)}
|
|
306
|
+
.card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 14px;padding-bottom:11px;border-bottom:1px solid var(--border-soft)}
|
|
307
|
+
.card-head h2{margin:0;padding:0;border:0;font-size:16px;display:inline-flex;align-items:center;gap:8px}
|
|
308
|
+
.card.is-empty{padding:14px 22px;background:var(--surface-2);border-style:dashed;box-shadow:none;display:flex;align-items:center;justify-content:space-between;gap:12px}
|
|
309
|
+
.card.is-empty h2{margin:0;padding:0;border:0;font-size:14.5px;color:var(--muted);font-weight:600}
|
|
310
|
+
.empty-hint{font-size:13px;color:var(--muted)}
|
|
311
|
+
.pill{display:inline-flex;align-items:center;gap:5px;padding:2px 9px;border-radius:999px;font-size:12px;font-weight:560;line-height:1.5;white-space:nowrap;background:var(--surface-3);color:var(--ink-2)}
|
|
312
|
+
.pill.is-accent{background:var(--accent-bg);color:var(--accent-ink)}
|
|
313
|
+
.pill.is-amber{background:var(--amber-bg);color:var(--amber-ink)}
|
|
314
|
+
.pill.is-green{background:var(--green-bg);color:var(--green-ink)}
|
|
315
|
+
.pill.is-rose{background:var(--rose-bg);color:var(--rose-ink)}
|
|
316
|
+
.dot{width:7px;height:7px;border-radius:50%;display:inline-block;flex-shrink:0;background:var(--muted)}
|
|
317
|
+
.dot.is-green{background:#16a34a}
|
|
318
|
+
.dot.is-accent{background:var(--accent)}
|
|
319
|
+
.dot.is-amber{background:#d97706}
|
|
320
|
+
.dot.is-rose{background:#dc2626}
|
|
321
|
+
|
|
322
|
+
/* 每日页头部与日期切换 */
|
|
323
|
+
.day-hero{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:18px 22px 14px;box-shadow:var(--shadow)}
|
|
324
|
+
.day-hero-top{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
|
|
325
|
+
.day-eyebrow{font-size:12.5px;color:var(--muted);display:flex;align-items:center;gap:8px;margin-bottom:3px}
|
|
326
|
+
.day-title{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
|
|
327
|
+
.day-title h1{margin:0;font-size:26px;letter-spacing:-.03em}
|
|
328
|
+
.day-weekday{font-size:15px;font-weight:560;color:var(--ink-2)}
|
|
329
|
+
.day-arrows{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
|
|
330
|
+
.day-btn{display:inline-flex;align-items:center;gap:4px;padding:6px 11px;border-radius:8px;font-size:13px;font-weight:500;color:var(--ink-2);background:var(--surface-2);border:1px solid var(--border);cursor:pointer;font-family:inherit;line-height:1.4;transition:background .15s,border-color .15s,color .15s}
|
|
331
|
+
.day-btn:hover{background:var(--surface-3);color:var(--ink);text-decoration:none}
|
|
332
|
+
.day-btn.is-active{background:var(--accent-bg);border-color:var(--accent-bd);color:var(--accent-ink);font-weight:600}
|
|
333
|
+
.day-btn.is-disabled{opacity:.42;pointer-events:none}
|
|
334
|
+
.day-strip{display:flex;align-items:center;gap:6px;overflow-x:auto;margin-top:12px;padding-top:10px;border-top:1px solid var(--border-soft);scrollbar-width:none}
|
|
335
|
+
.day-strip::-webkit-scrollbar{display:none}
|
|
336
|
+
.day-chip{flex-shrink:0;padding:3px 10px;border-radius:7px;font-size:12.5px;font-family:var(--mono);color:var(--ink-2);background:var(--surface-2);border:1px solid transparent;transition:all .15s}
|
|
337
|
+
.day-chip:hover{background:var(--surface-3);color:var(--ink);text-decoration:none}
|
|
338
|
+
.day-chip.is-current{background:var(--ink);color:var(--surface);font-weight:600}
|
|
339
|
+
|
|
340
|
+
/* 可点击数字概览卡片 */
|
|
341
|
+
.kpi-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px}
|
|
342
|
+
.kpi-card{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:6px;width:100%;text-align:left;padding:15px 16px 14px;border-radius:var(--radius);background:var(--surface);border:1px solid var(--border);box-shadow:var(--shadow);cursor:pointer;font-family:inherit;color:inherit;transition:transform .14s,border-color .14s,background .14s,box-shadow .14s}
|
|
343
|
+
.kpi-card:hover{transform:translateY(-1px);border-color:var(--accent-bd);background:var(--surface-2)}
|
|
344
|
+
.kpi-card:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
|
|
345
|
+
.kpi-card.is-selected{border-color:var(--accent);background:var(--surface);box-shadow:0 0 0 1px var(--accent),0 6px 18px rgba(37,99,235,.12)}
|
|
346
|
+
.kpi-card.is-amber{background:var(--amber-bg);border-color:var(--amber-bd)}
|
|
347
|
+
.kpi-card.is-amber:hover{border-color:#d97706}
|
|
348
|
+
.kpi-card.is-amber.is-selected{border-color:#d97706;box-shadow:0 0 0 1px #d97706,0 6px 18px rgba(217,119,6,.16)}
|
|
349
|
+
.kpi-card.is-rose.is-selected{border-color:#dc2626;box-shadow:0 0 0 1px #dc2626,0 6px 18px rgba(220,38,38,.14)}
|
|
350
|
+
.kpi-card.is-empty-kpi{opacity:.72}
|
|
351
|
+
.kpi-top{width:100%;display:flex;align-items:center;justify-content:space-between;gap:8px}
|
|
352
|
+
.kpi-label{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;font-weight:620;color:var(--ink-2)}
|
|
353
|
+
.kpi-card.is-amber .kpi-label{color:var(--amber-ink)}
|
|
354
|
+
.kpi-arrow{font-size:11.5px;color:var(--muted);opacity:.7;transition:transform .14s,opacity .14s}
|
|
355
|
+
.kpi-card:hover .kpi-arrow,.kpi-card.is-selected .kpi-arrow{opacity:1;color:var(--accent-ink)}
|
|
356
|
+
.kpi-card.is-amber.is-selected .kpi-arrow,.kpi-card.is-amber:hover .kpi-arrow{color:var(--amber-ink)}
|
|
357
|
+
.kpi-num{font-size:30px;line-height:1.1;font-weight:750;letter-spacing:-.03em;color:var(--ink);font-feature-settings:"tnum"}
|
|
358
|
+
.kpi-card.is-amber .kpi-num{color:var(--amber-ink)}
|
|
359
|
+
.kpi-unit{font-size:13px;font-weight:500;color:var(--muted);margin-left:3px}
|
|
360
|
+
.kpi-sub{font-size:12px;color:var(--muted);line-height:1.45;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;width:100%}
|
|
361
|
+
.kpi-card.is-amber .kpi-sub{color:var(--amber-ink);opacity:.85}
|
|
362
|
+
|
|
363
|
+
/* 明细展示区与事件筛选 */
|
|
364
|
+
.day-panels{display:flex;flex-direction:column;gap:14px}
|
|
365
|
+
.day-panel{display:none;animation:panelIn .16s ease-out}
|
|
366
|
+
.day-panel.is-open,.day-panels.show-all .day-panel{display:block}
|
|
367
|
+
@keyframes panelIn{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
|
|
368
|
+
.filter-bar{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin:-2px 0 12px}
|
|
369
|
+
.filter-pill{padding:3px 10px;border-radius:999px;font-size:12px;font-weight:550;border:1px solid var(--border);background:var(--surface-2);color:var(--ink-2);cursor:pointer;font-family:inherit;transition:all .12s}
|
|
370
|
+
.filter-pill:hover{background:var(--surface-3);color:var(--ink)}
|
|
371
|
+
.filter-pill.is-active{background:var(--ink);border-color:var(--ink);color:var(--surface)}
|
|
372
|
+
.tl-row.is-hidden{display:none}
|
|
373
|
+
.pending-hint-link{display:inline-flex;align-items:center;gap:6px;margin-top:2px;padding:9px 13px;border-radius:10px;background:var(--amber-bg);border:1px solid var(--amber-bd);color:var(--amber-ink);font-size:13.5px;font-weight:560;cursor:pointer;font-family:inherit;width:100%;justify-content:space-between;transition:opacity .14s}
|
|
374
|
+
.pending-hint-link:hover{opacity:.88}
|
|
375
|
+
|
|
376
|
+
/* 计划 / 进展 / 复盘结构化块 */
|
|
377
|
+
.section-stack{display:flex;flex-direction:column;gap:14px}
|
|
378
|
+
.schedule-banner{display:flex;align-items:flex-start;gap:10px;padding:12px 14px;border-radius:10px;background:var(--accent-bg);border:1px solid var(--accent-bd);font-size:14px;color:var(--ink-2)}
|
|
379
|
+
.schedule-banner .kv-k{color:var(--accent-ink);margin-bottom:0;white-space:nowrap;flex-shrink:0}
|
|
380
|
+
.focus-box{background:var(--surface-2);border:1px solid var(--border);border-radius:12px;padding:15px 16px}
|
|
381
|
+
.focus-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
|
|
382
|
+
.focus-head .kv-k{margin:0;color:var(--ink);font-size:13.5px}
|
|
383
|
+
.focus-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:9px}
|
|
384
|
+
.focus-item{display:flex;align-items:flex-start;gap:12px;padding:12px 14px;border-radius:10px;background:var(--surface);border:1px solid var(--border-soft)}
|
|
385
|
+
.focus-num{width:24px;height:24px;border-radius:7px;background:var(--accent-bg);color:var(--accent-ink);font:650 12px/24px var(--mono);text-align:center;flex-shrink:0;margin-top:1px}
|
|
386
|
+
.focus-body{flex:1;min-width:0}
|
|
387
|
+
.focus-main{color:var(--ink);font-weight:540;line-height:1.58}
|
|
388
|
+
.focus-sub{margin-top:6px;font-size:13px;color:var(--muted);line-height:1.6}
|
|
389
|
+
.time-tag{display:inline-flex;align-items:center;padding:1px 7px;border-radius:6px;background:var(--surface-3);color:var(--ink-2);font:550 12px/1.5 var(--mono);white-space:nowrap;margin-right:8px;vertical-align:1px}
|
|
390
|
+
.circled-list{display:flex;flex-direction:column;gap:6px}
|
|
391
|
+
.circled-item{display:flex;align-items:baseline;gap:8px}
|
|
392
|
+
.circled-num{font-size:13px;color:var(--muted);flex-shrink:0}
|
|
393
|
+
.callout-amber{background:var(--amber-bg);border:1px solid var(--amber-bd);border-radius:12px;padding:15px 18px}
|
|
394
|
+
.callout-amber .kv-k{color:var(--amber-ink);font-size:13.5px;margin-bottom:8px;display:flex;align-items:center;gap:7px}
|
|
395
|
+
.callout-amber ol{margin:0;padding-left:20px;color:var(--ink)}
|
|
396
|
+
.callout-amber li{margin:6px 0;line-height:1.6}
|
|
397
|
+
.callout-tip{margin-top:10px;padding-top:9px;border-top:1px dashed var(--amber-bd);font-size:12.5px;color:var(--amber-ink);opacity:.9}
|
|
398
|
+
.kv-list{display:flex;flex-direction:column;gap:10px}
|
|
399
|
+
.kv-row{padding:11px 14px;border-radius:10px;background:var(--surface-2);border:1px solid var(--border-soft)}
|
|
400
|
+
.kv-row.is-amber{background:var(--amber-bg);border-color:var(--amber-bd)}
|
|
401
|
+
.kv-row.is-green{background:var(--green-bg);border-color:var(--green-bd)}
|
|
402
|
+
.kv-row.is-rose{background:var(--rose-bg);border-color:var(--rose-bd)}
|
|
403
|
+
.kv-k{font-size:12.5px;font-weight:650;color:var(--muted);margin-bottom:4px;display:flex;align-items:center;gap:6px}
|
|
404
|
+
.kv-row.is-amber .kv-k{color:var(--amber-ink)}
|
|
405
|
+
.kv-row.is-green .kv-k{color:var(--green-ink)}
|
|
406
|
+
.kv-row.is-rose .kv-k{color:var(--rose-ink)}
|
|
407
|
+
.kv-v{font-size:14.5px;color:var(--ink-2);line-height:1.65}
|
|
408
|
+
.kv-v ul,.kv-v ol{margin:6px 0 0}
|
|
409
|
+
.stat-chips{display:flex;flex-wrap:wrap;gap:7px;margin-top:4px}
|
|
410
|
+
.stat-chip{padding:4px 10px;border-radius:8px;background:var(--surface);border:1px solid var(--border);font-size:13px;color:var(--ink)}
|
|
411
|
+
|
|
412
|
+
/* 事件流时间线 */
|
|
413
|
+
.timeline{display:flex;flex-direction:column}
|
|
414
|
+
.tl-row{display:grid;grid-template-columns:56px 64px 1fr auto;align-items:baseline;gap:12px;padding:10px 4px;border-bottom:1px solid var(--border-soft);transition:background .12s}
|
|
415
|
+
.tl-row:last-child{border-bottom:none}
|
|
416
|
+
.tl-row:hover{background:var(--surface-2);border-radius:8px}
|
|
417
|
+
.tl-time{font:600 13px/1.5 var(--mono);color:var(--muted);padding-left:4px}
|
|
418
|
+
.tl-type{display:inline-flex;justify-content:center;padding:2px 8px;border-radius:6px;font-size:12px;font-weight:580;white-space:nowrap;background:var(--slate-bg);color:var(--slate-ink)}
|
|
419
|
+
.tl-type.t-meeting{background:var(--violet-bg);color:var(--violet-ink)}
|
|
420
|
+
.tl-type.t-comm{background:var(--sky-bg);color:var(--sky-ink)}
|
|
421
|
+
.tl-type.t-code{background:var(--indigo-bg);color:var(--indigo-ink)}
|
|
422
|
+
.tl-type.t-review{background:var(--teal-bg);color:var(--teal-ink)}
|
|
423
|
+
.tl-type.t-issue{background:var(--accent-bg);color:var(--accent-ink)}
|
|
424
|
+
.tl-type.t-approval{background:var(--amber-bg);color:var(--amber-ink)}
|
|
425
|
+
.tl-type.t-learn{background:var(--green-bg);color:var(--green-ink)}
|
|
426
|
+
.tl-type.t-alert{background:var(--rose-bg);color:var(--rose-ink)}
|
|
427
|
+
.tl-desc{color:var(--ink);font-size:14.5px;line-height:1.55;min-width:0}
|
|
428
|
+
.tl-meta{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end}
|
|
429
|
+
.meta-tag{padding:1px 7px;border-radius:5px;font-size:11.5px;font-family:var(--mono);background:var(--surface-3);color:var(--muted);white-space:nowrap}
|
|
430
|
+
.meta-tag.is-proj{font-family:var(--font);font-weight:550;color:var(--ink-2)}
|
|
431
|
+
|
|
432
|
+
/* 备注列表 */
|
|
433
|
+
.note-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
|
|
434
|
+
.note-item{display:flex;align-items:baseline;gap:10px;padding:9px 12px;border-radius:9px;background:var(--surface-2);border-left:3px solid var(--border);font-size:13.8px;color:var(--ink-2);line-height:1.6}
|
|
435
|
+
.note-item.is-alert{border-left-color:#dc2626;background:var(--rose-bg);color:var(--ink)}
|
|
436
|
+
.note-time{font:600 12px/1.5 var(--mono);color:var(--muted);white-space:nowrap;flex-shrink:0}
|
|
437
|
+
|
|
438
|
+
/* 报告列表与监控页 */
|
|
439
|
+
.report-list{display:flex;flex-direction:column;gap:8px}
|
|
440
|
+
.report-item{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-radius:10px;background:var(--surface-2);border:1px solid var(--border-soft);color:var(--ink);font-weight:540;transition:all .15s}
|
|
441
|
+
.report-item:hover{background:var(--surface-3);border-color:var(--border);text-decoration:none}
|
|
442
|
+
.mon-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:13px;color:var(--muted);padding:0 2px}
|
|
443
|
+
.mon-bar label{display:inline-flex;align-items:center;gap:6px;cursor:pointer}
|
|
444
|
+
.mon-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
|
|
445
|
+
.mon-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:18px 20px;box-shadow:var(--shadow)}
|
|
446
|
+
.mon-card h2{margin:0 0 10px;padding:0 0 8px;font-size:14.5px;border-bottom:1px solid var(--border-soft);display:flex;align-items:center;justify-content:space-between}
|
|
447
|
+
.mon-card p{font-size:13.5px;line-height:1.7}
|
|
448
|
+
.mon-kv{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}
|
|
449
|
+
.mon-log pre{max-height:360px;font-size:12px}
|
|
450
|
+
|
|
451
|
+
@media (max-width:780px){
|
|
452
|
+
.topbar-inner,.wrap{padding-left:14px;padding-right:14px}
|
|
453
|
+
main.sheet{padding:22px 18px}
|
|
454
|
+
.card,.day-hero{padding:18px 16px}
|
|
455
|
+
.kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
|
|
456
|
+
.tl-row{grid-template-columns:48px 58px 1fr;gap:8px}
|
|
457
|
+
.tl-meta{grid-column:1 / -1;justify-content:flex-start;padding-left:56px}
|
|
458
|
+
.mon-grid{grid-template-columns:1fr}
|
|
459
|
+
}
|
|
460
|
+
@media print{
|
|
461
|
+
body{background:#fff;padding:0}
|
|
462
|
+
.topbar,.day-arrows,.day-strip,.kpi-grid,.filter-bar,.pending-hint-link{display:none}
|
|
463
|
+
.day-panel{display:block !important}
|
|
464
|
+
.wrap{margin:0;padding:0;max-width:none}
|
|
465
|
+
.card,main.sheet,.day-hero{box-shadow:none;border-color:#ddd}
|
|
466
|
+
}
|
|
467
|
+
`;
|
|
468
|
+
|
|
169
469
|
// 整页:样式内联,不引外部资源(docs/formats.md 的「视图」)
|
|
170
|
-
function page(title, body, nav = '') {
|
|
470
|
+
function page(title, body, nav = '', opts = {}) {
|
|
471
|
+
const wide = opts.wide ? ' is-wide' : '';
|
|
472
|
+
const surface = opts.surface === 'plain' ? 'stack' : 'sheet';
|
|
473
|
+
const bodyClass = [wide.trim(), opts.bodyClass || ''].filter(Boolean).join(' ');
|
|
474
|
+
const header = nav
|
|
475
|
+
? `<header class="topbar"><div class="topbar-inner"><a class="brand" href="/"><span class="brand-mark" aria-hidden="true"></span><span>work-rhythm</span></a><nav aria-label="主导航">${nav}</nav></div></header>`
|
|
476
|
+
: '';
|
|
171
477
|
return `<!doctype html>
|
|
172
478
|
<html lang="zh-CN">
|
|
173
479
|
<head>
|
|
174
480
|
<meta charset="utf-8">
|
|
175
481
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
176
482
|
<meta name="robots" content="noindex, nofollow">
|
|
177
|
-
<title>${escapeHtml(title)}</title>
|
|
178
|
-
<style>
|
|
179
|
-
body{margin:0;padding:24px;background:#f6f7f9;color:#1f2328;font:16px/1.65 -apple-system,BlinkMacSystemFont,"PingFang SC","Helvetica Neue",Arial,sans-serif}
|
|
180
|
-
main{max-width:860px;margin:0 auto;background:#fff;border-radius:8px;padding:28px 32px;box-shadow:0 1px 3px rgba(0,0,0,.06)}
|
|
181
|
-
nav{max-width:860px;margin:0 auto 12px;font-size:14px;color:#57606a}
|
|
182
|
-
nav a{color:#0969da;text-decoration:none;margin-right:14px}
|
|
183
|
-
h1{font-size:26px;margin:0 0 16px}
|
|
184
|
-
h2{font-size:20px;margin:28px 0 10px;padding-bottom:6px;border-bottom:1px solid #d0d7de}
|
|
185
|
-
h3{font-size:17px;margin:20px 0 8px}
|
|
186
|
-
table{border-collapse:collapse;width:100%;margin:10px 0;font-size:14px}
|
|
187
|
-
th,td{border:1px solid #d0d7de;padding:6px 10px;text-align:left;vertical-align:top}
|
|
188
|
-
th{background:#f6f8fa}
|
|
189
|
-
tbody tr:nth-child(even){background:#fafbfc}
|
|
190
|
-
code{background:#eff1f3;border-radius:4px;padding:1px 5px;font:13px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace}
|
|
191
|
-
pre{background:#f6f8fa;border-radius:6px;padding:12px;overflow:auto}
|
|
192
|
-
pre code{background:none;padding:0}
|
|
193
|
-
blockquote{margin:10px 0;padding:6px 14px;border-left:4px solid #d0d7de;color:#57606a;background:#fafbfc}
|
|
194
|
-
hr{border:0;border-top:1px solid #d0d7de;margin:20px 0}
|
|
195
|
-
.muted{color:#57606a;font-size:14px}
|
|
196
|
-
</style>
|
|
483
|
+
<title>${escapeHtml(title)} · work-rhythm</title>
|
|
484
|
+
<style>${BASE_CSS}</style>
|
|
197
485
|
</head>
|
|
198
|
-
<body>
|
|
199
|
-
${
|
|
200
|
-
<
|
|
486
|
+
<body${bodyClass ? ` class="${escapeHtml(bodyClass)}"` : ''}>
|
|
487
|
+
${header}
|
|
488
|
+
<div class="wrap">
|
|
489
|
+
<main class="${surface}">
|
|
201
490
|
${body}
|
|
202
491
|
</main>
|
|
492
|
+
</div>
|
|
203
493
|
</body>
|
|
204
494
|
</html>
|
|
205
495
|
`;
|