style(web): 前端 UI 美化(Aura Space 规范,功能零改动)

- 按 Aura Space 暗色洁净混合美学 v2.0 重排 chat.html:google 色板令牌、Inter 字体、
  12/16px 圆角、玻璃拟态 header(sticky + backdrop-blur)、品牌 logo 蓝色光晕、
  助手消息前置 auraPulse 蓝色脉冲点、Material 多层阴影、全量 200ms 过渡动画
- 侧边栏改白底洁净风:品牌块、会话项 hover/active 蓝 50 态 + 左侧指示条、
  项目配置面板卡片化;文件选择改用 label + 隐藏 input(上传逻辑不变)
- JS 逐字节不变(已程序化校验一致);test_root_serves_frontend 通过
This commit is contained in:
lhl
2026-08-27 23:16:48 +08:00
parent 916c5beed7
commit d6361cf025
2 changed files with 257 additions and 48 deletions
+256 -48
View File
@@ -2,62 +2,268 @@
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Genesis — 概要设计书自动生成(对话)</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&display=swap" rel="stylesheet">
<style>
:root {
/* Aura Space 设计令牌(v2.0 */
--blue: #1a73e8; /* google-blue 主操作/品牌色 */
--blue-dark: #1967d2;
--blue-soft: #d2e3fc;
--red: #ea4335; /* 警告/错误 */
--red-soft: #fce8e6;
--yellow: #fbbc05; /* 待处理 */
--green: #34a853; /* 成功/实时状态 */
--gray-50: #f8f9fa;
--gray-100: #f1f3f4;
--gray-200: #e8eaed;
--gray-300: #dadce0;
--gray-500: #5f6368;
--gray-700: #3c4043;
--gray-900: #202124;
--blue-50: #e8f0fe;
--blue-100: #d2e3fc;
--radius-lg: 12px; /* 主按钮 / 侧边栏项 */
--radius-xl: 16px; /* 容器卡片 */
--shadow-1: 0 1px 2px rgba(60,64,67,.30), 0 1px 3px 1px rgba(60,64,67,.15);
--shadow-2: 0 1px 2px rgba(60,64,67,.30), 0 2px 6px 2px rgba(60,64,67,.15);
--shadow-3: 0 1px 3px rgba(60,64,67,.30), 0 4px 8px 3px rgba(60,64,67,.15);
--glow-blue: 0 0 0 1px rgba(26,115,232,.12), 0 8px 24px rgba(26,115,232,.18);
--ease: all .2s cubic-bezier(.2,0,0,1);
}
* { box-sizing: border-box; }
body { font-family: "Microsoft YaHei", sans-serif; margin: 0; height: 100vh; display: flex; flex-direction: row; background: #f5f6f8; }
/* 左侧边栏 */
#sidebar { width: 250px; background: #16384d; color: #e6eef4; display: flex; flex-direction: column; flex-shrink: 0; }
#sidebar h2 { font-size: 13px; margin: 12px 14px 6px; color: #9fc2d6; letter-spacing: 1px; }
#new-chat { margin: 12px 14px 6px; background: #2e86c1; color: #fff; border: none; padding: 8px; border-radius: 8px; cursor: pointer; font-size: 14px; }
#new-chat:hover { background: #3498db; }
#session-list { flex: 1; overflow-y: auto; padding: 0 8px; }
.sess { padding: 8px 10px; border-radius: 8px; margin: 4px 0; cursor: pointer; border: 1px solid transparent; }
.sess:hover { background: #1f4d68; }
.sess.active { background: #2e86c1; }
html, body { height: 100%; }
body {
font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', 'Microsoft YaHei', sans-serif;
margin: 0; height: 100vh; display: flex; flex-direction: row;
background: var(--gray-50); color: var(--gray-900);
-webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-500); }
::-webkit-scrollbar-track { background: transparent; }
/* ========== 左侧边栏(w-64,白底洁净) ========== */
#sidebar {
width: 264px; background: #fff; color: var(--gray-900);
display: flex; flex-direction: column; flex-shrink: 0;
border-right: 1px solid var(--gray-200);
}
.brand {
display: flex; align-items: center; gap: 12px;
padding: 16px 16px 12px; margin: 0 12px 8px;
border-bottom: 1px solid var(--gray-100);
}
.brand-logo {
width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
display: flex; align-items: center; justify-content: center;
color: #fff; font-size: 17px; font-weight: 900;
background: linear-gradient(135deg, #1a73e8, #4285f4);
box-shadow: var(--glow-blue);
transition: var(--ease);
}
.brand:hover .brand-logo { transform: scale(1.1); }
.brand-name { font-size: 17px; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; }
.brand-sub { font-size: 9px; font-weight: 900; letter-spacing: .2em; text-transform: uppercase; color: var(--gray-500); }
#new-chat {
margin: 6px 16px 10px; background: var(--blue); color: #fff;
border: none; padding: 10px 14px; border-radius: var(--radius-lg);
cursor: pointer; font-size: 14px; font-weight: 600; letter-spacing: .01em;
box-shadow: 0 1px 2px rgba(26,115,232,.4);
transition: var(--ease);
}
#new-chat:hover { background: var(--blue-dark); box-shadow: 0 2px 6px rgba(26,115,232,.45); transform: translateY(-1px); }
#new-chat:active { transform: translateY(0); }
#sidebar h2 {
font-size: 9px; font-weight: 900; letter-spacing: .2em; text-transform: uppercase;
color: var(--gray-500); margin: 10px 16px 6px;
}
#session-list { flex: 1; overflow-y: auto; padding: 0 8px 8px; }
.sess {
padding: 9px 12px; border-radius: var(--radius-lg); margin: 2px 0;
cursor: pointer; position: relative; border: 1px solid transparent;
transition: var(--ease);
}
.sess:hover { background: var(--gray-50); }
.sess.active { background: var(--blue-50); border-color: var(--blue-100); }
.sess.active::before {
content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
border-radius: 0 3px 3px 0; background: var(--blue);
}
.sess .name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess .meta { font-size: 11px; color: #9fc2d6; }
#proj-panel { border-top: 1px solid #2c5872; padding: 8px 12px; max-height: 42%; overflow-y: auto; }
#proj-panel summary { cursor: pointer; font-size: 13px; color: #9fc2d6; outline: none; }
#proj-list { list-style: none; padding: 0; margin: 8px 0; }
#proj-list li { font-size: 12px; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
#proj-list li:hover, #proj-list li.active { background: #1f4d68; }
.sess.active .name { font-weight: 700; }
.sess .meta { font-size: 11px; color: var(--gray-500); margin-top: 1px; }
/* 项目配置面板(玻璃卡片风格) */
#proj-panel { border-top: 1px solid var(--gray-100); padding: 10px 12px; max-height: 42%; overflow-y: auto; }
#proj-panel summary {
cursor: pointer; font-size: 11px; font-weight: 700; letter-spacing: .02em;
color: var(--gray-700); outline: none; border-radius: 8px; padding: 6px 8px;
transition: var(--ease);
}
#proj-panel summary:hover { background: var(--gray-50); color: var(--blue); }
#proj-list { list-style: none; padding: 4px 0 0; margin: 4px 0; }
#proj-list li {
font-size: 12px; padding: 6px 10px; border-radius: 8px; cursor: pointer;
color: var(--gray-700); transition: var(--ease);
}
#proj-list li:hover, #proj-list li.active { background: var(--blue-50); color: var(--blue-dark); font-weight: 600; }
#proj-new-btn {
width: 100%; background: var(--gray-100); color: var(--gray-700);
border: 1px solid var(--gray-200); padding: 7px; border-radius: 8px;
cursor: pointer; font-size: 12px; font-weight: 600; margin-top: 4px; transition: var(--ease);
}
#proj-new-btn:hover { background: var(--blue-50); color: var(--blue-dark); border-color: var(--blue-100); }
#proj-form { display: none; margin-top: 8px; }
#proj-form.show { display: block; }
#proj-form input { width: 100%; margin: 3px 0; padding: 5px; border-radius: 5px; border: 1px solid #2c5872; background: #0f2a3b; color: #e6eef4; font-size: 12px; }
#proj-form button { margin-top: 6px; width: 100%; background: #2e86c1; color: #fff; border: none; padding: 6px; border-radius: 6px; cursor: pointer; }
/* 主区域 */
#main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
header { background: #1a5276; color: #fff; padding: 10px 20px; display: flex; align-items: center; gap: 12px; }
header h1 { font-size: 17px; margin: 0; }
#sid-badge { background: rgba(255,255,255,.18); border-radius: 12px; padding: 2px 10px; font-size: 12px; }
#chat { flex: 1; overflow-y: auto; padding: 20px; max-width: 860px; width: 100%; margin: 0 auto; }
.msg { display: flex; margin: 10px 0; }
.msg .bubble { max-width: 72%; padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; line-height: 1.55; font-size: 14px; }
#proj-form.show { display: block; animation: zoomIn .3s ease; }
#proj-form input {
width: 100%; margin: 3px 0; padding: 6px 9px; border-radius: 8px;
border: 1px solid var(--gray-200); background: #fff; color: var(--gray-900); font-size: 12px;
transition: var(--ease);
}
#proj-form input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-50); }
#proj-form button {
margin-top: 6px; width: 100%; background: var(--blue); color: #fff;
border: none; padding: 7px; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 600;
transition: var(--ease);
}
#proj-form button:hover { background: var(--blue-dark); }
/* ========== 主区域 ========== */
#main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--gray-50); }
header {
height: 56px; position: sticky; top: 0; z-index: 10;
padding: 0 24px; display: flex; align-items: center; gap: 14px;
background: rgba(255,255,255,.78); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
border-bottom: 1px solid var(--gray-200);
}
header h1 { font-size: 16px; font-weight: 900; letter-spacing: -.02em; margin: 0; color: var(--gray-900); }
.crumb { font-size: 11px; font-weight: 700; color: var(--gray-500); display: flex; align-items: center; gap: 6px; }
.crumb::before { content: "AURA /"; color: var(--gray-300); letter-spacing: .1em; }
#sid-badge {
margin-left: auto;
background: var(--blue-50); color: var(--blue-dark);
border: 1px solid var(--blue-100);
border-radius: 999px; padding: 4px 14px; font-size: 12px; font-weight: 600;
max-width: 46%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 聊天区 */
#chat { flex: 1; overflow-y: auto; padding: 24px 24px 32px; max-width: 880px; width: 100%; margin: 0 auto; }
.msg { display: flex; margin: 12px 0; animation: zoomIn .25s ease; }
.msg .bubble {
max-width: 74%; padding: 11px 16px; border-radius: var(--radius-xl);
white-space: pre-wrap; line-height: 1.6; font-size: 14px; letter-spacing: .01em;
}
.msg.user { justify-content: flex-end; }
.msg.user .bubble { background: #1a5276; color: #fff; border-bottom-right-radius: 4px; }
.msg.assistant .bubble { background: #fff; border: 1px solid #e0e0e0; border-bottom-left-radius: 4px; }
.msg.progress .bubble { background: #eaf2f8; border: 1px dashed #7fb3d5; font-size: 13px; color: #2c3e50; }
.msg.error .bubble { background: #fdecea; border: 1px solid #e6b4b0; color: #922b21; }
.msg.user .bubble {
background: linear-gradient(135deg, #1a73e8, #4285f4); color: #fff;
border-bottom-right-radius: 6px; box-shadow: var(--shadow-2);
}
.msg.assistant { align-items: flex-start; }
.msg.assistant .bubble {
background: #fff; border: 1px solid var(--gray-200);
border-bottom-left-radius: 6px; box-shadow: var(--shadow-1);
}
/* Aura Pulse:助手消息前置蓝色脉冲点(象征后台感知) */
.msg.assistant::before {
content: ""; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
margin: 16px 8px 0 0; background: var(--blue);
box-shadow: 0 0 0 0 rgba(26,115,232,.4);
animation: auraPulse 2.2s ease-in-out infinite;
}
.msg.progress .bubble {
background: var(--blue-50); border: 1px dashed var(--blue-soft); font-size: 13px; color: var(--gray-700);
}
.msg.error .bubble { background: var(--red-soft); border: 1px solid #f5c6c0; color: #b31412; }
.progress-item { display: block; }
.progress-item.ok::before { content: "✔ "; color: #1e8449; }
.progress-item.warn::before { content: "⚠ "; color: #b7950b; }
.actions a { display: inline-block; margin: 4px 6px 0 0; background: #1a5276; color: #fff; padding: 5px 12px; border-radius: 12px; text-decoration: none; font-size: 13px; }
#composer { border-top: 1px solid #ddd; background: #fff; padding: 12px 20px; }
#composer-inner { max-width: 860px; margin: 0 auto; display: flex; gap: 8px; align-items: center; }
#input { flex: 1; border: 1px solid #ccc; border-radius: 18px; padding: 10px 16px; font-size: 14px; outline: none; }
#send { background: #1a5276; color: #fff; border: none; border-radius: 18px; padding: 10px 20px; cursor: pointer; }
#send:disabled { opacity: .5; cursor: not-allowed; }
#upload-bar { background: #fff; border-top: 1px solid #eee; padding: 8px 20px; font-size: 13px; }
#upload-bar-inner { max-width: 860px; margin: 0 auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#upload-bar select, #upload-bar input[type=file] { font-size: 13px; }
#upload-btn { background: #f0f3f5; border: 1px solid #ccc; border-radius: 12px; padding: 5px 12px; cursor: pointer; }
#proj-hint { color: #b7950b; font-size: 12px; }
.typing { color: #888; font-size: 13px; font-style: italic; }
.progress-item.ok::before { content: "✔ "; color: var(--green); font-weight: 700; }
.progress-item.warn::before { content: "⚠ "; color: #b06000; font-weight: 700; }
.actions { margin-top: 8px; }
.actions a {
display: inline-block; margin: 4px 6px 0 0; background: var(--blue); color: #fff;
padding: 6px 14px; border-radius: 999px; text-decoration: none; font-size: 13px; font-weight: 600;
box-shadow: 0 1px 2px rgba(26,115,232,.4); transition: var(--ease);
}
.actions a:hover { background: var(--blue-dark); transform: translateY(-1px); }
.typing { color: var(--gray-500); font-size: 13px; font-style: italic; animation: auraPulse 1.4s ease-in-out infinite; }
/* 上传条 */
#upload-bar { background: #fff; border-top: 1px solid var(--gray-200); padding: 10px 24px; font-size: 13px; }
#upload-bar-inner { max-width: 880px; margin: 0 auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#upload-bar select {
font-size: 13px; padding: 8px 12px; border: 1px solid var(--gray-300); border-radius: var(--radius-lg);
background: #fff; color: var(--gray-900); cursor: pointer; outline: none; transition: var(--ease);
}
#upload-bar select:focus { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-50); }
.file-pick {
display: inline-block; padding: 8px 14px; border: 1px solid var(--gray-300); border-radius: var(--radius-lg);
background: var(--gray-50); color: var(--gray-700); font-size: 13px; font-weight: 600;
cursor: pointer; transition: var(--ease);
}
.file-pick:hover { background: var(--blue-50); color: var(--blue-dark); border-color: var(--blue-100); }
#upload-btn {
background: var(--gray-100); border: 1px solid var(--gray-200); color: var(--gray-700);
border-radius: var(--radius-lg); padding: 8px 16px; cursor: pointer; font-size: 13px; font-weight: 600;
transition: var(--ease);
}
#upload-btn:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
#upload-status { color: var(--gray-500); font-size: 12px; }
#proj-hint {
color: #b06000; font-size: 12px; background: #fef7e0; border: 1px solid #fde293;
border-radius: 8px; padding: 4px 10px;
}
/* 输入区 */
#composer { border-top: 1px solid var(--gray-200); background: #fff; padding: 14px 24px 18px; }
#composer-inner { max-width: 880px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
#input {
flex: 1; border: 1px solid var(--gray-300); border-radius: 999px;
padding: 11px 18px; font-size: 14px; outline: none; background: var(--gray-50);
transition: var(--ease); color: var(--gray-900);
}
#input:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px var(--blue-50); }
#input::placeholder { color: var(--gray-500); }
#send {
background: var(--blue); color: #fff; border: none; border-radius: 999px;
padding: 11px 24px; cursor: pointer; font-size: 14px; font-weight: 700;
box-shadow: 0 1px 2px rgba(26,115,232,.4); transition: var(--ease);
}
#send:hover:not(:disabled) { background: var(--blue-dark); box-shadow: var(--shadow-2); transform: translateY(-1px); }
#send:active:not(:disabled) { transform: translateY(0); }
#send:disabled { opacity: .45; cursor: not-allowed; }
@keyframes auraPulse {
0%, 100% { opacity: 1; }
50% { opacity: .45; }
}
@keyframes zoomIn {
from { opacity: 0; transform: scale(.97); }
to { opacity: 1; transform: scale(1); }
}
@media (max-width: 860px) {
#sidebar { width: 220px; }
#sid-badge { display: none; }
}
</style>
</head>
<body>
<div id="sidebar">
<div class="brand">
<div class="brand-logo">G</div>
<div>
<div class="brand-name">Genesis</div>
<div class="brand-sub">Aura Pipeline</div>
</div>
</div>
<button id="new-chat">+ 新会话</button>
<h2>会话历史</h2>
<div id="session-list"></div>
@@ -65,7 +271,7 @@
<details>
<summary>项目配置(模板/规则/代码库/设计文档)</summary>
<ul id="proj-list"></ul>
<button id="proj-new-btn" style="width:100%;background:#2e86c1;color:#fff;border:none;padding:6px;border-radius:6px;cursor:pointer;font-size:12px;">新建项目</button>
<button id="proj-new-btn">新建项目</button>
<div id="proj-form">
<input id="pf-name" placeholder="项目名(英文/唯一)">
<input id="pf-display" placeholder="显示名(可选)">
@@ -82,6 +288,7 @@
<div id="main">
<header>
<span class="crumb">Pipeline</span>
<h1>Genesis 概要设计书 Agent</h1>
<span id="sid-badge">未创建会话</span>
</header>
@@ -99,9 +306,10 @@
<option value="rules">记入/图表规则 docx/xlsx</option>
<option value="existing_system">既有系统 zip(追加改修)</option>
</select>
<input type="file" id="file-input">
<label class="file-pick" for="file-input">选择文件</label>
<input type="file" id="file-input" style="display:none">
<button id="upload-btn">上传</button>
<span id="upload-status" style="color:#888"></span>
<span id="upload-status"></span>
</div>
</div>