zcbot/web/static/style.css

194 lines
10 KiB
CSS

/* zcbot web — minimal sane defaults. Phase G 渐进扩。 */
:root {
--bg: #fafafa;
--surface: #ffffff;
--fg: #1a1a1a;
--muted: #888;
--border: #e5e5e5;
--accent: #c00; /* 商务红,延续 ppt skill 配色 */
--accent-soft: #fceaea;
--link: #0a58ca;
--mono: ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
font: 14px/1.5 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
background: var(--bg);
color: var(--fg);
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); background: var(--accent-soft); padding: 0 .25em; border-radius: 3px; color: var(--accent); }
small.muted, .muted { color: var(--muted); font-weight: normal; }
.topbar {
display: flex;
align-items: center;
gap: 1.25rem;
padding: .65rem 1.25rem;
background: var(--surface);
border-bottom: 1px solid var(--border);
}
.brand {
font-weight: 700;
color: var(--accent);
font-size: 1.1rem;
}
.brand:hover { text-decoration: none; }
.navlinks { display: flex; gap: 1rem; flex: 1; }
.user-tag {
font-size: .75rem;
color: var(--muted);
border: 1px solid var(--border);
padding: .1em .5em;
border-radius: 3px;
}
.container {
max-width: 960px;
margin: 0 auto;
padding: 1.5rem 1.25rem;
}
h1 { font-size: 1.5rem; margin: 0 0 .5rem; display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }
.lead { font-size: 1rem; color: #444; }
.mono { font-family: var(--mono); }
.small { font-size: .8rem; }
/* page head + filters */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.filters { display: flex; gap: .5rem; align-items: center; font-size: .9rem; color: var(--muted); }
.filters select { padding: .25em .5em; font-size: .9rem; }
.btn { padding: .25em .75em; border: 1px solid var(--border); border-radius: 3px; color: var(--fg); background: var(--surface); display: inline-block; line-height: 1.4; }
.btn:hover { text-decoration: none; background: #f4f4f4; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: white; font-weight: 600; }
.btn-primary:hover { background: var(--accent); filter: brightness(1.05); color: white; }
.head-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
/* navlinks active state */
.navlinks a { color: var(--muted); padding: .15em .4em; border-radius: 3px; }
.navlinks a.active, .navlinks a:hover { color: var(--fg); background: #f4f4f4; text-decoration: none; }
/* new task form */
.new-task-form { display: flex; flex-direction: column; gap: 1rem; max-width: 640px; margin-top: 1rem; }
.new-task-form label { display: flex; flex-direction: column; gap: .3rem; }
.new-task-form .field-label { font-weight: 600; font-size: .9rem; color: #444; }
.new-task-form input[type="text"] {
padding: .55rem .7rem; font: inherit; border: 1px solid var(--border); border-radius: 4px;
background: var(--surface); color: var(--fg); font-size: .95rem;
}
.new-task-form input[type="text"]:focus { outline: 2px solid var(--accent-soft); outline-offset: 1px; border-color: var(--accent); }
.new-task-form .muted.small { font-weight: normal; }
.form-actions { display: flex; gap: .5rem; justify-content: flex-end; align-items: center; margin-top: .5rem; }
.form-actions button {
padding: .55rem 1.3rem; border: 1px solid var(--accent); border-radius: 4px;
background: var(--accent); color: white; cursor: pointer; font: inherit; font-weight: 600;
}
.form-actions button:hover { filter: brightness(1.05); }
/* task list table */
.empty { padding: 2rem 0; }
table.task-list { width: 100%; border-collapse: collapse; margin-top: .5rem; }
table.task-list th, table.task-list td { text-align: left; padding: .5rem .65rem; border-bottom: 1px solid var(--border); vertical-align: top; }
table.task-list th { background: #f4f4f4; font-weight: 600; color: #555; font-size: .85rem; white-space: nowrap; }
table.task-list td { font-size: .9rem; }
table.task-list .num { text-align: right; font-variant-numeric: tabular-nums; }
table.task-list tr:hover { background: #fdf6f6; }
.task-id { font-family: var(--mono); font-weight: 600; }
.dir .desc { margin-bottom: .15em; }
.dir .small { word-break: break-all; }
/* status badge */
.status { font-size: .75rem; padding: .1em .55em; border-radius: 3px; font-weight: 500; }
.status-active { background: #dff7e0; color: #196b3a; }
.status-completed { background: #e0eaf7; color: #1a3d6b; }
.status-abandoned { background: #f0f0f0; color: #777; }
/* task meta line + badges */
.task-meta { font-size: .85rem; }
.badge { font-size: .75rem; padding: .1em .55em; background: #eee; color: #555; border-radius: 3px; }
.mt-1 { margin-top: 1rem; }
/* chat 视图 */
.chat { margin-top: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.msg { padding: .75rem 1rem; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); }
.msg-user { background: #f4f7fb; border-color: #d8e3f0; }
.msg-assistant { background: var(--surface); }
.msg .role { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin-bottom: .35rem; }
.msg .body { font-size: .95rem; line-height: 1.55; }
.msg .body p { margin: .5em 0; }
.msg .body p:first-child { margin-top: 0; }
.msg .body p:last-child { margin-bottom: 0; }
.msg .body pre, .msg .body .codehilite { background: #f7f7f7; padding: .75rem; border-radius: 4px; overflow-x: auto; font-family: var(--mono); font-size: .85rem; margin: .5em 0; }
.msg .body code { font-family: var(--mono); font-size: .9em; background: #f4f4f4; padding: 0 .25em; border-radius: 3px; color: #333; }
.msg .body pre code, .msg .body .codehilite code { background: transparent; padding: 0; color: inherit; font-size: 1em; }
.msg .body table { border-collapse: collapse; margin: .5em 0; font-size: .9rem; }
.msg .body table th, .msg .body table td { border: 1px solid var(--border); padding: .3em .6em; text-align: left; }
.msg .body table th { background: #f4f4f4; }
.msg .body a { color: var(--link); }
.msg .body blockquote { border-left: 3px solid var(--border); padding-left: 1em; margin: .5em 0; color: #555; }
/* tool_call <details> 折叠 */
.tool { margin-top: .75rem; border: 1px solid var(--border); border-radius: 4px; background: #fafafa; }
.tool summary { padding: .5rem .75rem; cursor: pointer; user-select: none; list-style: none; display: flex; gap: .5rem; align-items: center; font-size: .85rem; }
.tool summary::-webkit-details-marker { display: none; }
.tool summary::before { content: ">"; color: var(--muted); transition: transform .15s; display: inline-block; font-family: var(--mono); font-weight: bold; }
.tool[open] summary::before { transform: rotate(90deg); }
.tool-badge { background: var(--accent-soft); color: var(--accent); padding: .1em .4em; border-radius: 3px; font-size: .7rem; font-weight: 600; letter-spacing: .03em; }
.tool-name { font-family: var(--mono); font-weight: 600; color: #333; }
.tool-args-preview { color: var(--muted); font-family: var(--mono); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.tool-body { padding: 0 .75rem .75rem; border-top: 1px solid var(--border); background: #fff; }
.tool-section { margin-top: .5rem; }
.tool-label { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin-bottom: .15rem; }
.tool-pre { background: #fafafa; padding: .5rem .65rem; border: 1px solid var(--border); border-radius: 3px; max-height: 400px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: .8rem; line-height: 1.4; margin: 0; color: #333; }
/* 流式状态指示 + send form (G4) */
.streaming .run-indicator {
display: inline-block; width: 6px; height: 6px; border-radius: 50%;
background: var(--accent); margin-left: .35rem; vertical-align: middle;
animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
0%, 100% { opacity: .35; transform: scale(.9); }
50% { opacity: 1; transform: scale(1.15); }
}
.send-form { display: flex; gap: .5rem; margin-top: 1rem; align-items: flex-end; }
.send-form textarea {
flex: 1; font: inherit; padding: .5rem .65rem; border: 1px solid var(--border);
border-radius: 4px; resize: vertical; min-height: 2.4rem; max-height: 14rem;
background: var(--surface); color: var(--fg); font-size: .95rem; line-height: 1.4;
}
.send-form textarea:focus { outline: 2px solid var(--accent-soft); outline-offset: 1px; border-color: var(--accent); }
.send-form button {
padding: .55rem 1.1rem; border: 1px solid var(--accent); border-radius: 4px;
background: var(--accent); color: white; cursor: pointer; font: inherit; font-weight: 600;
}
.send-form button:hover { filter: brightness(1.05); }
.send-form button:disabled { background: var(--muted); border-color: var(--muted); cursor: wait; }
/* tool_result append-only 片段(G4 流式来:跟在上一个 tool_call 后) */
.tool-result-inline { margin: .5rem 0 .25rem 1rem; padding-left: .65rem; border-left: 2px solid var(--border); }
.tool-result-tag { font-family: var(--mono); font-size: .75rem; color: var(--muted); font-weight: 600; }
.tool-pending { color: var(--muted); font-style: italic; }
/* error 片段 */
.msg-error {
display: flex; gap: .5rem; align-items: baseline;
margin-top: .5rem; padding: .5rem .75rem;
background: #fceaea; border-left: 3px solid var(--accent); border-radius: 3px;
font-size: .85rem; color: #5c0a0a;
}
.err-tag { font-weight: 600; text-transform: uppercase; font-size: .7rem; letter-spacing: .05em; }
/* pygments codehilite (轻量配色,选少数高频 token,余下走默认黑色) */
.codehilite .k, .codehilite .kn, .codehilite .kr { color: #c00; } /* keyword */
.codehilite .s, .codehilite .s1, .codehilite .s2, .codehilite .sb, .codehilite .sd { color: #1a3d6b; } /* string */
.codehilite .c, .codehilite .c1, .codehilite .cm { color: #888; font-style: italic; } /* comment */
.codehilite .nb { color: #5e3092; } /* builtin */
.codehilite .nf, .codehilite .nc { color: #1a3d6b; font-weight: 600; } /* function/class name */
.codehilite .mi, .codehilite .mf { color: #008080; } /* number */
.codehilite .o, .codehilite .ow { color: #555; } /* operator */