重构物流客服模块并完善会话接待工作台

- 拆分应用工厂、业务服务与路由,保留原有 HTTP/SSE 和存储入口
- 分离页面资源,重排客服工作台并完善响应式导航、草稿和附件交互
- 整理维护脚本、请求示例和贡献指南,移除启动脚本中的密钥配置
- 上传文件改为仅本地保留,补充隔离的后端与前端回归验证

验证:46 项 Python 测试通过,含 14 个已有子测试;12 个 Node 前端场景通过。
This commit is contained in:
2026-10-29 10:59:29 +08:00
parent 761c629788
commit 805675f8db
79 changed files with 5737 additions and 4625 deletions
+186
View File
@@ -0,0 +1,186 @@
/* A conversation-first console: compact header, session inbox and full-height chat. */
body { height: 100dvh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--surface); }
.topbar { height: 56px; min-height: 56px; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 0 22px; background: var(--surface); border-bottom: 1px solid var(--border); z-index: 30; }
.app-identity, .topbar-actions { display: flex; align-items: center; gap: 20px; min-width: 0; }
.brand { gap: 10px; }
.topbar .brand-mark { width: 30px; height: 30px; border-radius: 8px; }
.topbar .brand-mark svg { width: 19px; height: 19px; }
.topbar .brand-name { font-size: 15px; white-space: nowrap; }
.nav-divider { height: 18px; width: 1px; background: var(--border); }
.app-identity h1 { font-size: 14px; font-weight: 500; color: var(--secondary); white-space: nowrap; }
.workspace-link { font-size: 12px; color: var(--secondary); text-decoration: none; white-space: nowrap; }
.workspace-link:hover { color: var(--brand); }
.data-overview { position: relative; }
.data-overview summary { display: flex; align-items: center; gap: 7px; padding: 6px 10px; font-size: 12px; color: var(--secondary); cursor: pointer; border-radius: 7px; list-style: none; border: 1px solid var(--border); }
.data-overview summary::-webkit-details-marker { display: none; }
.data-overview summary svg { width: 15px; height: 15px; }
.data-overview[open] summary, .data-overview summary:hover { color: var(--brand); border-color: #bacbf2; background: var(--brand-soft); }
.stats { position: absolute; top: calc(100% + 11px); right: 0; width: 310px; padding: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); box-shadow: 0 12px 40px #19263d1a; }
.stats h2 { grid-column: 1 / -1; font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.stat { display: flex; flex-direction: column; padding: 10px 12px; background: var(--surface-soft); border-radius: 7px; }
.stat > span { font-size: 11px; color: var(--secondary); }
.stat b { font-size: 23px; font-weight: 600; line-height: 1.5; font-variant-numeric: tabular-nums; }
.export-link { display: grid; place-items: center; border: 1px solid var(--border); border-radius: 7px; font-size: 12px; color: var(--brand); text-decoration: none; }
.export-link:hover { background: var(--brand-soft); }
.sync-status { flex-shrink: 0; background: var(--danger-soft); color: var(--danger); border-bottom: 1px solid #eed0d3; padding: 7px 22px; font-size: 12px; }
.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr); overflow: hidden; }
.conv-list { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border); }
.list-heading { padding: 23px 20px 18px; }
.list-heading h2 { font-size: 17px; font-weight: 650; }
.list-heading p { font-size: 12px; color: var(--muted); margin-top: 4px; }
.session-search-wrap { position: relative; margin-top: 17px; }
.session-search-wrap svg { position: absolute; top: 12px; left: 11px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
#session-search { width: 100%; height: 38px; padding: 8px 10px 8px 34px; border: 1px solid transparent; border-radius: 7px; background: var(--surface-soft); color: var(--text); font-size: 13px; }
#session-search::placeholder { color: var(--muted); }
#session-search:focus { outline: none; border-color: #9ab4ed; background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft); }
.session-tabs { display: flex; gap: 22px; padding: 0 20px; border-bottom: 1px solid var(--border); }
.session-tabs button { position: relative; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 43px; padding: 7px 0 12px; border: 0; background: transparent; color: var(--secondary); font-size: 13px; }
.session-tabs button[aria-selected="true"] { color: var(--brand); font-weight: 600; }
.session-tabs button[aria-selected="true"]::after { position: absolute; content: ""; height: 2px; background: var(--brand); inset: auto 0 -1px; }
.section-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 5px; color: var(--muted); background: var(--surface-soft); font-size: 10px; font-variant-numeric: tabular-nums; }
[aria-selected="true"] .section-count { background: var(--brand-soft); color: var(--brand); }
.session-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 10px; }
.list-empty { padding: 33px 14px; text-align: center; font-size: 12px; line-height: 1.8; color: var(--muted); }
.conv-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 14px 12px; margin-bottom: 4px; border: 1px solid transparent; border-radius: 8px; text-align: left; background: transparent; }
.conv-item:hover { background: var(--surface-soft); }
.conv-item.active { background: #edf3ff; border-color: #e3ebfc; }
.avatar { flex-shrink: 0; display: grid; place-items: center; width: 39px; height: 39px; border-radius: 11px; color: #60728f; background: #eaf0f7; font-size: 14px; font-weight: 600; }
.active .avatar { color: var(--brand); background: #dce7fe; }
.conv-item .info { min-width: 0; flex: 1; }
.conv-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.conv-item .name { display: block; font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; }
.conv-time { flex-shrink: 0; color: var(--muted); font-size: 10px; font-weight: 400; }
.conv-item .preview { display: block; margin-top: 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--secondary); font-size: 12px; }
.badge { flex-shrink: 0; padding: 0 5px; border-radius: 5px; background: var(--brand); color: white; font-size: 10px; }
.queue-item { border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-bottom: 8px; background: var(--surface); }
.queue-item .qt { font-size: 13px; font-weight: 600; color: var(--text); }
.queue-item small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; margin-top: 5px; }
.queue-item button { margin-top: 13px; padding: 7px 12px; min-height: 34px; width: 100%; border: 0; border-radius: 6px; background: var(--brand); color: white; font-size: 12px; }
.list-footer { flex-shrink: 0; display: flex; align-items: center; gap: 7px; padding: 14px 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; }
.list-footer-mark { width: 6px; height: 6px; border-radius: 50%; background: #91a2bc; }
.list-footer > span { display: flex; align-items: center; gap: 7px; }
#tools-from-list { display: none; }
.chat-area { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #f5f7fa; }
.chat-header { display: flex; flex-shrink: 0; align-items: center; gap: 12px; min-height: 72px; padding: 13px 28px; background: var(--surface); border-bottom: 1px solid var(--border); }
.participant-avatar { display: grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px; background: #edf2fa; color: #6a7b96; font-size: 14px; }
.participant-copy { flex: 1; min-width: 0; }
.participant-copy h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 650; }
.participant-copy p { margin-top: 2px; color: var(--muted); font-size: 11px; }
.has-active-session .participant-copy p { color: #4b796b; }
.chat-header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.tools-toggle, .close { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 33px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; background: var(--surface); color: var(--secondary); white-space: nowrap; }
.tools-toggle svg { width: 16px; height: 16px; }
.tools-toggle[aria-expanded="true"], .tools-toggle:hover { border-color: #bacbf2; color: var(--brand); background: var(--brand-soft); }
.close:hover:enabled { border-color: #ecc5ca; background: var(--danger-soft); color: var(--danger); }
.close:disabled { cursor: default; opacity: .45; }
.has-active-session .participant-avatar { color: var(--brand); background: var(--brand-soft); }
body:not(.has-active-session) .close { display: none; }
.empty { flex: 1; display: grid; place-items: center; text-align: center; min-height: 0; padding: 30px; }
.empty-illustration { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 18px; border: 1px solid #e0e6ee; border-radius: 15px; background: var(--surface); color: #879bb9; }
.empty-illustration svg { width: 26px; height: 26px; }
.empty h2 { margin-bottom: 8px; font-size: 18px; font-weight: 600; }
.empty p { font-size: 13px; line-height: 1.9; color: var(--muted); }
.session-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
#chatBox { flex: 1; min-height: 0; overflow-y: auto; padding: 26px clamp(22px, 4vw, 60px); }
.msg { display: flex; align-items: flex-start; gap: 10px; max-width: 1040px; margin: 0 auto 24px; }
.msg.agent { flex-direction: row-reverse; }
.message-avatar { flex-shrink: 0; display: grid; place-items: center; width: 32px; height: 32px; margin-top: 24px; border-radius: 9px; background: #e6ecf4; color: #6e7e97; font-size: 12px; }
.message-avatar svg { width: 17px; height: 17px; }
.msg.agent .message-avatar { background: var(--brand); color: white; }
.message-stack { max-width: min(76%, 720px); min-width: 0; }
.meta { margin-bottom: 6px; font-size: 11px; line-height: 1.5; color: var(--muted); }
.msg.agent .meta { text-align: right; }
.bubble { padding: 12px 16px; border-radius: 3px 10px 10px; border: 1px solid #e4e9f0; background: var(--surface); color: var(--text); font-size: 15px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.agent .bubble { background: #eaf1ff; border-color: #dce6fb; color: #213858; border-radius: 10px 3px 10px 10px; }
.message-image { display: block; max-width: min(240px, 100%); max-height: 320px; object-fit: contain; border-radius: 6px; }
.message-file { color: inherit; text-underline-offset: 3px; font-size: 13px; }
.agent-composer { flex-shrink: 0; padding: 13px 28px 16px; background: var(--surface); border-top: 1px solid var(--border); }
.composer-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; color: var(--secondary); font-size: 12px; }
.composer-heading span { color: var(--muted); font-size: 11px; }
.input-bar { padding: 10px 12px 9px; border: 1px solid #dce3ed; border-radius: 8px; background: var(--surface); }
.input-bar:focus-within { border-color: #8ba8eb; box-shadow: 0 0 0 2px var(--brand-soft); }
#replyText { display: block; width: 100%; min-height: 56px; max-height: 180px; padding: 0; border: 0; resize: none; outline: none; background: transparent; color: var(--text); font-size: 14px; line-height: 1.7; }
#replyText::placeholder { color: #8b98ab; }
.input-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 7px; }
.input-actions > span { color: var(--muted); font-size: 11px; }
#reply-send { min-width: 78px; min-height: 34px; padding: 6px 20px; border: 0; border-radius: 6px; background: var(--brand); color: white; font-size: 13px; }
#reply-send:hover:enabled { background: var(--brand-hover); }
.reply-status { font-size: 12px; line-height: 1.6; color: var(--success); padding-top: 7px; }
.reply-status.is-error { color: var(--danger); }
.side { display: none; min-height: 0; min-width: 0; overflow-y: auto; background: var(--surface); border-left: 1px solid var(--border); }
.tools-open .layout { grid-template-columns: 300px minmax(0, 1fr) 310px; }
.tools-open .side { display: block; }
.side-heading { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; border-bottom: 1px solid var(--border); background: var(--surface); }
.side-heading h2 { font-size: 15px; font-weight: 600; }
.side-heading .icon-button { width: 28px; height: 28px; border: 0; font-size: 20px; }
.card { padding: 20px 18px; border-bottom: 1px solid var(--border); }
.card:last-child { border-bottom: 0; }
.card h3 { margin-bottom: 13px; font-size: 13px; font-weight: 600; }
.card-caption { color: var(--muted); font-size: 11px; margin: -5px 0 12px; }
.info-row { font-size: 12px; line-height: 1.8; color: var(--secondary); }
.info-hint { margin-top: 13px; padding: 10px; font-size: 11px; line-height: 1.9; background: var(--surface-soft); color: var(--secondary); border-radius: 6px; }
.quick { display: block; width: 100%; margin-bottom: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; text-align: left; background: var(--surface); color: var(--secondary); font-size: 12px; }
.quick:hover:enabled { border-color: #a5bdee; color: var(--brand); background: var(--brand-soft); }
.quick:disabled { cursor: default; opacity: .5; }
.ticket-item { padding: 11px; margin-bottom: 9px; border: 1px solid var(--border); border-radius: 6px; color: var(--secondary); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.ticket-item span { display: block; margin-top: 6px; font-size: 10px; color: var(--muted); }
.tools-backdrop, .sessions-back { display: none; }
@media (max-width: 1200px) {
.layout, .tools-open .layout { grid-template-columns: 280px minmax(0, 1fr); }
.side { display: block; position: fixed; top: 0; bottom: 0; right: 0; z-index: 51; width: min(330px, 88vw); border-left: 1px solid var(--border); transform: translateX(105%); visibility: hidden; box-shadow: -10px 0 40px #19263d22; transition: transform .2s; }
.tools-open .side { transform: translateX(0); visibility: visible; }
.tools-open .tools-backdrop { display: block; position: fixed; inset: 0; z-index: 50; border: 0; background: #19263d55; }
.chat-header { padding-left: 22px; padding-right: 22px; }
.agent-composer { padding-left: 22px; padding-right: 22px; }
}
@media (max-width: 900px) and (min-width: 721px) {
.layout, .tools-open .layout { grid-template-columns: 248px minmax(0, 1fr); }
.list-heading { padding-left: 16px; padding-right: 16px; }
.session-tabs { padding-left: 16px; padding-right: 16px; gap: 17px; }
.tools-toggle span { display: none; }
#chatBox { padding-left: 18px; padding-right: 18px; }
}
@media (max-width: 720px) {
.topbar { height: 52px; min-height: 52px; padding: 0 16px; }
.app-identity h1, .nav-divider { display: none; }
.topbar .brand-name { font-size: 14px; }
.topbar-actions { gap: 12px; }
.data-overview summary { font-size: 11px; padding: 5px 8px; }
.stats { width: min(310px, calc(100vw - 32px)); }
.layout, .tools-open .layout { display: flex; flex-direction: column; }
.conv-list { flex: 1; min-height: 0; border-right: 0; }
.list-footer { justify-content: space-between; }
#tools-from-list { display: inline-block; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--secondary); font-size: 11px; }
.list-heading { padding: 20px 18px 15px; }
.session-tabs { padding-left: 18px; }
.list-heading h2 { font-size: 18px; }
.conv-item { padding-top: 16px; padding-bottom: 16px; }
.chat-area { display: none; flex: 1; min-height: 0; }
.chat-view .conv-list { display: none; }
.chat-view .chat-area { display: flex; }
.sessions-back { display: grid; place-items: center; flex-shrink: 0; width: 30px; height: 34px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--secondary); font-size: 28px; line-height: 1; }
.participant-avatar { display: none; }
.chat-header { min-height: 65px; padding: 11px 13px 11px 9px; gap: 8px; }
.participant-copy h2 { font-size: 14px; }
.participant-copy p { font-size: 10px; }
.chat-header-actions { gap: 7px; }
.tools-toggle { width: 33px; padding: 6px; }
.tools-toggle span { display: none; }
.close { padding: 6px 8px; font-size: 11px; }
#chatBox { padding: 21px 14px; }
.msg { gap: 7px; margin-bottom: 20px; }
.message-avatar { width: 27px; height: 27px; border-radius: 8px; }
.message-stack { max-width: calc(100% - 40px); }
.bubble { padding: 10px 12px; font-size: 15px; }
.agent-composer { padding: 11px 13px calc(11px + env(safe-area-inset-bottom)); }
.composer-heading { margin-bottom: 6px; font-size: 11px; }
.composer-heading span { font-size: 10px; }
#replyText { font-size: 16px; min-height: 54px; }
.input-actions > span { font-size: 10px; max-width: 210px; }
#reply-send { min-width: 66px; min-height: 38px; padding: 7px 14px; font-size: 12px; }
.reply-status { font-size: 11px; }
}
@media (max-width: 420px) {
.workspace-link { display: none; }
.input-actions > span { max-width: 185px; }
}
+57
View File
@@ -0,0 +1,57 @@
/* Split welcome and sign-in card, with a compact mobile fallback. */
.auth-page { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 36px; background: #edf2f8; }
.auth-shell { width: min(1050px, 100%); min-height: 620px; display: grid; grid-template-columns: 1.08fr 1fr; overflow: hidden; border: 1px solid #dde5ef; border-radius: 19px; box-shadow: 0 24px 75px rgba(31, 53, 87, .1); background: white; }
.auth-story { position: relative; display: flex; flex-direction: column; padding: 38px 40px; background: #17345e; color: white; overflow: hidden; }
.auth-story::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 40px 40px; pointer-events: none; }
.auth-story > * { position: relative; }
.auth-story .brand { color: white; }
.auth-story .brand-mark { background: #315c9c; }
.auth-story .brand-caption { color: #a9bedb; }
.story-copy { margin-top: 65px; }
.story-copy .eyebrow { color: #a7c3eb; font-size: 11px; }
.story-copy h1 { font-size: 30px; font-weight: 550; line-height: 1.55; letter-spacing: -.03em; margin: 15px 0 14px; }
.story-copy > p { color: #b9cbe3; font-size: 13px; line-height: 1.95; max-width: 340px; }
.service-points { display: grid; gap: 17px; margin-top: 34px; }
.service-point { display: flex; align-items: flex-start; gap: 12px; }
.service-point > span { width: 29px; height: 29px; border: 1px solid #49658b; color: #c8d9f0; border-radius: 8px; display: grid; place-items: center; font-size: 13px; }
.service-point strong { display: block; color: #eaf2ff; font-size: 12px; font-weight: 550; }
.service-point p { color: #aebfd8; font-size: 11px; margin-top: 2px; }
.route-line { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 40px; font-size: 11px; color: #afc6e5; }
.route-line i { height: 1px; flex: 1; background: #506e97; position: relative; }
.route-line i::after { content: ""; position: absolute; right: 0; top: -2px; border-radius: 50%; width: 5px; height: 5px; background: #96b6e2; }
.auth-content { display: flex; flex-direction: column; justify-content: center; padding: 48px 50px 28px; }
.box { width: 100%; max-width: 330px; margin: auto; }
.box .eyebrow { margin-bottom: 10px; }
.box h2 { color: var(--text); font-size: 27px; font-weight: 650; letter-spacing: -.03em; }
.login-description { font-size: 12px; color: var(--muted); margin: 9px 0 30px; line-height: 1.8; }
.field-label { display: block; color: var(--secondary); font-size: 12px; font-weight: 550; margin: 18px 0 8px; }
.field-wrap { position: relative; }
.field-wrap svg { position: absolute; left: 13px; top: 14px; width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.box input { width: 100%; height: 45px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: white; padding: 10px 13px 10px 40px; outline: none; font-size: 13px; }
.box input:focus { border-color: #8ba7e8; box-shadow: 0 0 0 3px var(--brand-soft); }
.box input::placeholder { color: var(--muted); }
.box input[aria-invalid="true"] { border-color: #df8d98; }
#loginButton { display: block; width: 100%; height: 44px; border: 0; border-radius: 8px; background: var(--brand); color: white; font-size: 13px; font-weight: 600; margin-top: 24px; box-shadow: 0 4px 12px rgba(49,95,213,.16); }
#loginButton:hover { background: var(--brand-hover); }
.err { color: var(--danger); background: var(--danger-soft); border-radius: 7px; font-size: 12px; line-height: 1.7; padding: 9px 11px; margin-top: 14px; }
.login-back { display: block; text-align: center; font-size: 12px; color: var(--muted); text-decoration: none; margin-top: 20px; }
.login-back:hover { color: var(--brand-text); }
.auth-footer { color: var(--muted); text-align: center; font-size: 10px; margin-top: 30px; }
.mobile-brand { display: none; }
@media (max-width: 900px) {
.auth-page { padding: 24px; }
.auth-shell { min-height: 590px; grid-template-columns: 1fr 1fr; }
.auth-story { padding: 30px; }
.story-copy h1 { font-size: 27px; }
.story-copy { margin-top: 50px; }
.auth-content { padding: 38px 30px 25px; }
}
@media (max-width: 650px) {
.auth-page { padding: 20px; }
.auth-shell { display: block; max-width: 430px; min-height: 0; border-radius: 14px; }
.auth-story { display: none; }
.auth-content { padding: 30px 28px 22px; }
.mobile-brand { display: flex; margin-bottom: 38px; }
.box h2 { font-size: 25px; }
.auth-footer { margin-top: 35px; }
}
+240
View File
@@ -0,0 +1,240 @@
/* Customer workspace: navigation, welcome, conversation and composer. */
body { padding: 20px; height: 100dvh; overflow: hidden; }
.chat-container {
display: flex; width: min(1440px, 100%); height: 100%; margin: auto;
overflow: hidden; position: relative; border: 1px solid var(--border);
border-radius: 16px; background: var(--surface); box-shadow: var(--shadow);
}
.left-panel {
width: 248px; min-width: 0; flex-shrink: 0; display: flex; flex-direction: column;
padding: 28px 18px 18px; background: var(--surface-soft); border-right: 1px solid var(--border);
transition: width .2s, padding .2s, transform .2s; overflow: hidden;
}
.left-panel .brand { margin: 0 7px 30px; white-space: nowrap; }
.new-chat-btn {
min-height: 43px; width: 100%; padding: 10px; border: 0; border-radius: 9px;
color: white; background: var(--brand); font-weight: 600; white-space: nowrap;
box-shadow: 0 3px 8px rgba(49, 95, 213, .13);
}
.new-chat-btn::before { content: "+"; font-size: 20px; font-weight: 400; margin-right: 9px; line-height: 1; }
.new-chat-btn:hover { background: var(--brand-hover); }
.panel-title { color: var(--secondary); font-size: 12px; font-weight: 600; margin: 29px 9px 10px; letter-spacing: .05em; }
.history-search-wrap { position: relative; margin-bottom: 13px; }
.history-search-wrap svg { position: absolute; left: 12px; top: 12px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.history-search {
width: 100%; height: 38px; padding: 8px 10px 8px 35px; border: 1px solid var(--border);
border-radius: 8px; color: var(--text); background: var(--surface); font-size: 12px;
}
.history-search::placeholder { color: var(--muted); }
.history-search:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.history-wrap { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -5px; padding: 0 3px; }
.history-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 34px 5px; }
.history-empty::before { content: "◌"; display: block; font-size: 26px; color: var(--secondary); margin-bottom: 7px; }
.history-item { display: flex; align-items: center; gap: 3px; padding: 11px 9px; margin-bottom: 4px; border-radius: 9px; border: 1px solid transparent; cursor: pointer; }
.history-item:hover { background: var(--surface); border-color: var(--border); }
.history-item.active { background: var(--brand-soft); border-color: var(--border); }
.history-text-wrap { flex: 1; min-width: 0; }
.history-title { color: var(--text); font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.history-time { color: var(--muted); font-size: 10px; margin-top: 4px; }
.del-history-btn { flex-shrink: 0; width: 23px; height: 25px; padding: 0; border: 0; background: transparent; color: var(--muted); border-radius: 5px; font-size: 13px; opacity: 0; }
.history-item:hover .del-history-btn, .history-item:focus-within .del-history-btn { opacity: 1; }
.del-history-btn:hover { background: var(--surface-hover); color: var(--danger); }
.sidebar-footer { border-top: 1px solid var(--border); padding: 15px 7px 0; margin-top: 13px; white-space: nowrap; }
.clear-all-btn { border: 0; color: var(--muted); background: transparent; padding: 5px 0; font-size: 11px; }
.clear-all-btn:hover { color: var(--danger); }
.sidebar-note { display: flex; align-items: center; gap: 7px; margin-top: 10px; color: var(--muted); font-size: 10px; }
.left-panel-hide { width: 0 !important; padding-left: 0 !important; padding-right: 0 !important; visibility: hidden; border: 0; }
.main-chat { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.chat-title { flex-shrink: 0; min-height: 75px; padding: 16px 26px; display: flex; align-items: center; gap: 13px; border-bottom: 1px solid var(--border); background: var(--surface); z-index: 31; }
.header-copy { min-width: 0; flex: 1; }
.header-kicker { font-size: 10px; color: var(--muted); letter-spacing: .06em; margin-bottom: 3px; }
#app-title { display: block; color: var(--text); font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toggle-divider { width: 32px; height: 32px; padding: 0; flex-shrink: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--secondary); font-size: 0; }
.toggle-divider::before { content: "☰"; font-size: 16px; }
.toggle-divider:hover { background: var(--surface-soft); color: var(--brand-text); }
.title-actions { display: flex; gap: 7px; align-items: center; flex-shrink: 0; }
.theme-toggle { height: 32px; min-width: 33px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; color: var(--secondary); background: var(--surface); font-size: 11px; }
.theme-toggle:hover { border-color: var(--brand); color: var(--brand-text); background: var(--brand-soft); }
.service-label { display: flex; gap: 7px; align-items: center; color: var(--secondary); font-size: 11px; margin-right: 8px; }
#chatDom { flex: 1; min-height: 0; overflow: auto; overflow-x: hidden; padding: 30px 38px 20px; }
.ai-welcome-card, .hot-questions, .recent-chat { max-width: 760px; margin-left: auto; margin-right: auto; }
.ai-welcome-card { padding-top: 22px; }
.ai-welcome-top { display: flex; flex-direction: column; align-items: center; text-align: center; }
.ai-avatar { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; color: var(--brand-text); background: var(--brand-soft); margin-bottom: 18px; }
.ai-avatar svg { width: 27px; height: 27px; }
.welcome-eyebrow { color: var(--brand-text); font-size: 11px; font-weight: 600; letter-spacing: .06em; margin-bottom: 9px; }
.ai-welcome-card h3 { font-size: clamp(22px, 2.2vw, 30px); line-height: 1.4; letter-spacing: -.035em; font-weight: 650; color: var(--text); }
.ai-welcome-card p { color: var(--secondary); font-size: 13px; line-height: 1.8; margin-top: 10px; }
.suggest-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 28px 0 0; }
.suggest-item { display: flex; align-items: center; gap: 13px; min-height: 83px; padding: 17px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); color: var(--text); text-align: left; width: 100%; }
.suggest-item:hover { border-color: #9ab6f5; background: var(--brand-soft); box-shadow: 0 3px 12px rgba(49, 95, 213, .04); }
.suggest-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--brand-text); background: var(--brand-soft); flex-shrink: 0; }
.suggest-icon svg { width: 19px; height: 19px; }
.suggest-copy { min-width: 0; }
.suggest-copy strong { display: block; font-size: 14px; font-weight: 600; }
.suggest-copy small { display: block; color: var(--secondary); font-size: 12px; margin-top: 4px; line-height: 1.6; }
.suggest-arrow { margin-left: auto; color: var(--muted); font-size: 17px; }
.hot-questions { margin-top: 24px; }
.hot-questions h4, .recent-chat h4 { color: var(--secondary); font-size: 12px; font-weight: 600; margin-bottom: 10px; }
.hot-capsule-wrap { display: flex; flex-wrap: wrap; gap: 7px; }
.hot-capsule { display: inline-flex; align-items: center; border: 1px solid var(--border); background: var(--surface); border-radius: 7px; padding: 6px 10px; color: var(--secondary); font-size: 11px; cursor: pointer; }
.hot-capsule:hover { color: var(--brand-text); background: var(--brand-soft); border-color: #a8bfef; }
.recent-chat { margin-top: 24px; }
#recentChatWrap { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.recent-item { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); padding: 9px 0; font-size: 11px; color: var(--secondary); cursor: pointer; }
.recent-item > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item:hover { color: var(--brand-text); }
.recent-date { white-space: nowrap; color: var(--muted); font-size: 10px; }
.composer { flex-shrink: 0; align-self: center; width: min(820px, calc(100% - 76px)); padding: 12px 0 15px; background: var(--surface); }
.hot-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 10px; }
.hot-bar-label { font-size: 10px; color: var(--muted); margin-right: 3px; }
.hot-bar .hot-capsule { border: 0; padding: 4px 8px; background: var(--surface-soft); font-size: 10px; }
.input-area { display: flex; align-items: flex-end; gap: 10px; border: 1px solid var(--border); border-radius: 12px; padding: 9px; background: var(--surface); box-shadow: 0 3px 15px rgba(28, 47, 80, .035); }
.input-area:focus-within { border-color: #7f9fe8; box-shadow: 0 0 0 3px var(--brand-soft); }
#upload-btn { flex: 0 0 36px; height: 38px; padding: 0; border: 0; border-radius: 7px; background: var(--surface-soft); color: var(--secondary); font-size: 18px; }
#upload-btn:hover { color: var(--brand-text); }
#input-text { flex: 1; min-width: 0; min-height: 38px; max-height: 170px; padding: 9px 1px; border: 0; background: transparent; color: var(--text); font-size: 1em; line-height: 1.6; resize: none; outline: none; }
#input-text::placeholder { color: var(--muted); }
#send-button { min-width: 66px; height: 38px; flex-shrink: 0; padding: 0 15px; border: 0; border-radius: 8px; background: var(--brand); color: white; font-size: 12px; font-weight: 600; }
#send-button:hover { background: var(--brand-hover); }
#send-button.stop { background: var(--danger); }
.composer-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 2px 0; }
.disclaimer, .keyboard-hint { color: var(--muted); font-size: 11px; }
.keyboard-hint { white-space: nowrap; }
.msg-row { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: 820px; margin: 0 auto 24px; }
.msg-row.user-line { align-items: flex-end; }
.message-author { display: flex; align-items: center; gap: 8px; min-height: 24px; margin-bottom: 4px; color: var(--secondary); font-size: 12px; font-weight: 600; }
.author-mark { width: 26px; height: 26px; display: grid; place-items: center; color: var(--brand-text); background: var(--brand-soft); border-radius: 8px; }
.author-mark svg { width: 16px; height: 16px; }
.user-message, .robot-message { max-width: 88%; border-radius: 12px; padding: 14px 17px; font-size: 1em; line-height: 1.8; overflow-wrap: anywhere; min-width: 0; }
.user-message { background: var(--brand); color: white; border-top-right-radius: 4px; white-space: pre-wrap; }
.robot-message { background: var(--surface-soft); border: 1px solid var(--border); color: var(--text); border-top-left-radius: 4px; }
.msg-time { color: var(--muted); font-size: 10px; padding: 0 3px; }
.robot-message p { margin: 4px 0; }
.robot-message ul, .robot-message ol { margin: 7px 0 7px 20px; padding: 0; }
.robot-message li { margin: 5px 0; }
.robot-message code { background: var(--surface-hover); color: var(--brand-text); padding: 2px 5px; border-radius: 4px; font-size: .93em; }
.msg-actions { display: flex; gap: 5px; flex-wrap: wrap; padding-top: 12px; margin-top: 10px; border-top: 1px solid var(--border); }
.msg-action-btn { min-height: 30px; border: 0; padding: 3px 8px; color: var(--secondary); background: transparent; border-radius: 5px; font-size: 12px; }
.msg-action-btn:hover, .msg-action-btn.voted { background: var(--surface-hover); color: var(--brand-text); }
.error-bubble { border-color: #e9b4bb; background: var(--danger-soft); color: var(--danger); }
.err-line { margin-bottom: 9px; }
.retry-btn { border: 1px solid currentColor; border-radius: 6px; padding: 4px 9px; color: inherit; background: transparent; font-size: 11px; }
.hint-bubble, .stopped-hint { color: var(--muted); font-size: 11px; }
.followup-list { display: grid; gap: 6px; margin-top: 13px; }
.followup-item { cursor: pointer; border: 1px solid var(--border); border-radius: 7px; padding: 6px 10px; color: var(--brand-text); font-size: 11px; background: var(--surface); }
.followup-item:hover { border-color: var(--brand); }
.robot-message.track-card { width: min(560px, 100%); max-width: 100%; background: var(--surface); padding: 16px 20px; }
.track-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 14px; }
.track-no { font-weight: 650; font-size: 17px; letter-spacing: .02em; }
.track-no span { display: block; font-size: 10px; letter-spacing: 0; font-weight: 400; color: var(--muted); margin-bottom: 3px; }
.track-status { padding: 4px 10px; color: var(--success); background: var(--success-soft); border-radius: 6px; font-size: 12px; white-space: nowrap; }
.track-node { position: relative; padding: 0 0 12px 22px; font-size: 13px; color: var(--secondary); }
.track-node::before { content: ""; position: absolute; top: 12px; bottom: 0; left: 3px; width: 1px; background: var(--border); }
.track-node:last-child { padding-bottom: 0; }
.track-node:last-child::before { display: none; }
.track-dot { position: absolute; left: 0; top: 7px; width: 7px; height: 7px; border: 2px solid var(--muted); border-radius: 50%; background: var(--surface); }
.track-node.active .track-dot { border-color: var(--brand); background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.track-node.active .track-text { color: var(--text); font-weight: 600; }
.track-text { display: grid; grid-template-columns: 126px 1fr; column-gap: 12px; line-height: 1.7; }
.track-event { font-size: 13px; font-weight: 500; }
.active .track-event { font-weight: 650; }
.track-time { color: var(--muted); font-size: 11px; font-weight: 400; padding-top: 2px; }
.track-place { grid-column: 2; color: var(--muted); font-size: 11px; font-weight: 400; margin-top: 2px; }
.track-expand { width: 100%; margin-top: 3px; padding: 7px 10px; border: 0; border-radius: 7px; background: var(--surface-soft); color: var(--brand-text); font-size: 12px; }
.track-expand:hover { background: var(--brand-soft); }
.track-card .msg-actions { margin-top: 8px; padding-top: 8px; }
.to-bottom { display: none; position: absolute; right: 24px; bottom: calc(var(--composer-height, 150px) + 12px); z-index: 4; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--secondary); box-shadow: var(--shadow); }
.to-bottom.show { display: block; }
.to-bottom:hover { color: var(--brand-text); border-color: var(--brand); }
.typing::after { content: " ···"; color: var(--brand-text); }
.sidebar-backdrop { display: none; }
.attachment-preview { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 9px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); color: var(--text); }
.attachment-preview img { height: 42px; width: 42px; object-fit: cover; border: 1px solid var(--border); border-radius: 7px; }
.attachment-file-icon { display: grid; place-items: center; flex-shrink: 0; width: 42px; height: 42px; font-size: 10px; font-weight: 650; border-radius: 7px; background: var(--brand-soft); color: var(--brand-text); }
.attachment-copy { flex: 1; min-width: 0; }
.attachment-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 500; }
.attachment-copy small { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }
.attachment-remove { flex-shrink: 0; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 7px; color: var(--secondary); background: transparent; font-size: 21px; }
.attachment-remove:hover { color: var(--danger); background: var(--danger-soft); }
.composer-status { font-size: 12px; color: var(--secondary); padding: 7px 3px 0; }
.composer-status.is-error { color: var(--danger); }
.message-image { display: block; max-width: min(240px, 100%); max-height: 320px; object-fit: contain; border-radius: 8px; }
.message-file { display: block; max-width: 100%; overflow-wrap: anywhere; color: inherit; padding: 6px 0; font-size: 13px; text-underline-offset: 3px; }
@media (min-width: 901px) and (max-height: 780px) {
#chatDom { padding-top: 22px; }
.ai-welcome-card { padding-top: 0; }
.ai-avatar { width: 42px; height: 42px; margin-bottom: 12px; }
.welcome-eyebrow { margin-bottom: 6px; }
.ai-welcome-card p { margin-top: 8px; }
.suggest-grid { margin-top: 20px; gap: 10px; }
.suggest-item { min-height: 72px; padding: 13px 16px; }
.hot-questions { margin-top: 18px; }
}
@media (min-width: 1500px) { #chatDom { padding-top: 48px; } .ai-welcome-card { padding-top: 35px; } }
@media (max-width: 1100px) {
body { padding: 12px; }
.left-panel { width: 220px; padding-left: 14px; padding-right: 14px; }
#chatDom { padding: 22px 25px; }
.composer { width: calc(100% - 50px); }
.service-label { display: none; }
.suggest-item { padding: 13px; gap: 10px; }
.suggest-copy small { font-size: 11px; }
}
@media (max-width: 900px) {
body { padding: 0; }
.chat-container { border: 0; border-radius: 0; height: 100dvh; }
.left-panel { position: absolute; left: 0; top: 72px; bottom: 0; width: 270px; max-width: 85vw; z-index: 30; box-shadow: 15px 0 40px rgba(20, 35, 60, .12); }
.left-panel .brand { display: none; }
.side-closed .left-panel { transform: translateX(-105%); visibility: hidden; pointer-events: none; }
.chat-container:not(.side-closed) .sidebar-backdrop { display: block; position: absolute; inset: 72px 0 0; border: 0; z-index: 20; background: rgba(16, 30, 52, .25); }
.main-chat { width: 100%; }
.chat-title { min-height: 72px; height: 72px; padding: 13px 18px; gap: 11px; }
#chatDom { padding: 24px 20px 15px; }
.ai-welcome-card { padding-top: 20px; }
.composer { width: calc(100% - 40px); }
.user-message, .robot-message { max-width: 94%; }
.del-history-btn { opacity: 1; }
}
@media (max-width: 520px) {
.header-kicker { font-size: 9px; }
#app-title { font-size: 13px; }
.chat-title { padding: 12px; gap: 8px; }
.title-actions { gap: 4px; }
.theme-toggle { padding: 0 6px; min-width: 29px; font-size: 10px; }
#font-toggle { display: none; }
#chatDom { padding: 20px 16px; }
.ai-avatar { display: none; }
.ai-welcome-card { padding-top: 12px; }
.ai-welcome-card h3 { font-size: 23px; }
.ai-welcome-card p { max-width: 300px; margin: 10px auto 0; font-size: 12px; }
.suggest-grid { gap: 9px; margin-top: 22px; }
.suggest-item { flex-direction: column; align-items: flex-start; justify-content: flex-start; min-height: 114px; padding: 13px; gap: 9px; }
.suggest-icon { width: 32px; height: 32px; border-radius: 8px; }
.suggest-copy strong { font-size: 13px; }
.suggest-copy small { font-size: 11px; }
.suggest-arrow { display: none; }
.hot-questions { margin-top: 22px; }
.hot-questions .hot-capsule-wrap { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 3px; }
.hot-questions .hot-capsule { flex-shrink: 0; white-space: nowrap; }
.hot-capsule { font-size: 10px; padding: 6px 8px; }
#recentChatWrap { grid-template-columns: 1fr; gap: 0; }
.composer { width: calc(100% - 24px); padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
.hot-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 5px; margin-bottom: 8px; }
.hot-bar-label { display: none; }
.hot-bar .hot-capsule { white-space: nowrap; flex-shrink: 0; }
.input-area { gap: 7px; padding: 7px; }
#send-button { min-width: 57px; padding: 0 12px; }
#upload-btn { flex-basis: 36px; height: 42px; }
#input-text { font-size: 16px; }
#send-button { min-height: 42px; }
.attachment-remove { width: 40px; height: 40px; }
.keyboard-hint { display: none; }
.composer-footer { justify-content: center; padding-top: 7px; }
.disclaimer { font-size: 10px; }
.track-text { grid-template-columns: 1fr; gap: 2px; }
.track-place { grid-column: 1; }
.robot-message.track-card { padding: 16px; }
.track-no { font-size: 15px; }
.to-bottom { right: 15px; }
}
+85
View File
@@ -0,0 +1,85 @@
/* Shared visual tokens and accessible controls. */
:root {
color-scheme: light;
--page: #edf1f7;
--surface: #ffffff;
--surface-soft: #f6f8fc;
--surface-hover: #edf2fa;
--text: #19263d;
--secondary: #566780;
--muted: #64748b;
--border: #e2e8f1;
--brand: #315fd5;
--brand-hover: #254fbe;
--brand-soft: #edf2ff;
--brand-text: #315fd5;
--success: #148462;
--success-soft: #eaf7f1;
--danger: #c74650;
--danger-soft: #fff0f1;
--shadow: 0 10px 40px rgba(28, 47, 80, .06);
}
body.dark {
color-scheme: dark;
--page: #0c1422;
--surface: #151f30;
--surface-soft: #1a273c;
--surface-hover: #21314b;
--text: #e7eef9;
--secondary: #b2c0d5;
--muted: #95a5bd;
--border: #2a3a53;
--brand: #426bd4;
--brand-hover: #4772db;
--brand-soft: #223759;
--brand-text: #a6c2ff;
--success: #75d7b3;
--success-soft: #193b35;
--danger: #ff9ca4;
--danger-soft: #412b38;
--shadow: 0 10px 40px rgba(0, 0, 0, .2);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
color: var(--text);
background: var(--page);
font-size: 14px;
line-height: 1.6;
-webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button, input, textarea, a { outline-offset: 3px; }
:focus-visible { outline: 3px solid #92b3ff; }
button { transition: background .16s, border-color .16s, color .16s, box-shadow .16s; }
a { color: var(--brand-text); }
h1, h2, h3, h4, p { margin: 0; }
svg { display: block; flex-shrink: 0; }
[hidden] { display: none !important; }
::selection { background: #cddcff; color: #122b59; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); }
.brand-mark {
display: grid; place-items: center; width: 38px; height: 38px;
background: var(--brand); color: white; border-radius: 11px; flex-shrink: 0;
}
.brand-mark svg { width: 23px; height: 23px; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: .02em; line-height: 1.3; }
.brand-caption { display: block; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: .12em; margin-top: 3px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .1em; color: var(--brand-text); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); display: inline-block; flex-shrink: 0; }
.icon-button {
display: inline-grid; place-items: center; width: 36px; height: 36px;
border: 1px solid var(--border); border-radius: 9px; color: var(--secondary); background: var(--surface);
}
.icon-button:hover { color: var(--brand-text); background: var(--brand-soft); }
.empty-caption { color: var(--muted); font-size: 12px; line-height: 1.8; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: #b7c3d5; border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}