Files
agent/app/server/public/css/style.css
T
kicer 728b213821 fix(ui): 会话列左右内边距 32px 收窄到 20px
桌面端 #chat-view 与 footer 的左右 32px 留白偏大,内容区两侧显得空;统一收到 20px,输入区与会话列仍然等宽。
2026-11-13 10:16:13 +08:00

1852 lines
97 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* ================= 设计变量 ================= */
:root {
--active: rgb(57, 100, 254); /* 激活状态颜色 */
--ink: rgb(15, 17, 21); /* 默认状态颜色 */
--active-soft: rgba(57, 100, 254, 0.1); /* 激活浅蓝背景 */
--active-light: rgba(237, 243, 254);
--gray: #8a8f99;
--gray-light: #c2c7d0;
--surface: #f2f3f7; /* 浅色面(输入框/胶囊控件/用户气泡) */
--page: #ffffff;
--drawer-bg: rgb(249, 250, 251); /* 侧边栏底色(与页面白底区分;分组表头吸顶同色) */
--border: #ececf1;
--radius-lg: 24px;
/* 安全区与软键盘(成因与注入约定见 js/viewport.js 顶部注释):
--sat / --sab 默认取 env()——iOS 独立 PWA 下有效;安卓 WebView 的 env() 只反映
屏幕挖孔(display cutout),不含状态栏/导航栏高度,基本恒为 0,需由套壳 App 用
documentElement.style.setProperty 注入真实高度覆盖。
--kb 是键盘占用的高度,取两个来源的较大值:--kb-page 由 viewport.js 按 visualViewport
算(壳不注入时也能工作),--kb-native 由壳按 IME insets 注入(WebView 完全感知不到
键盘时只能走这条)。两个变量分开放,避免页面与壳互相覆盖同一个值。 */
--sat: env(safe-area-inset-top, 0px);
--sab: env(safe-area-inset-bottom, 0px);
--kb-page: 0px;
--kb-native: 0px;
--kb: max(var(--kb-page), var(--kb-native));
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* 整站是视口锁定的 app shell:文档本身永不滚动,滚动只发生在内部容器
(消息流 #chat-view / 抽屉列表 .drawer-list / 设置页 .set-scroll,均已 overflow-y:auto)。
不写 overflow:hidden 时,桌面端只要有一行内容没收缩下(nowrap 胶囊/代码块/宽表格),
浏览器就给窗口加横向滚动条;横向条又吃掉一屏高度,而 #app 死守视口高度,
于是竖横向滚动条一起出现、缩窗口页面不动。 */
html, body { height: 100%; overflow: hidden; }
body {
font-family: "PingFang SC", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Microsoft YaHei", sans-serif;
color: var(--ink);
background: var(--page);
overscroll-behavior: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; border: 0; outline: none; background: none; }
.hidden { display: none !important; }
/* svg 图标统一描边风格(与 index.html 一致) */
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.sm { width: 17px; height: 17px; }
/* ================= 应用骨架 ================= */
#app {
/* 减去 --kb:键盘弹起时整块 shell 收缩,footer 才会落在键盘上沿。
壳已正确 resize(adjustResize / resizes-content)时 --kb 恒为 0,不重复收缩。 */
height: calc(100% - var(--kb));
max-width: 760px;
margin: 0 auto;
display: flex;
flex-direction: column;
position: relative;
background: var(--page);
overflow: hidden; /* 裁掉底部浮层收起时滑出屏幕的部分 */
}
/* ================= 顶部导航栏 ================= */
.header {
flex: none;
display: flex;
align-items: center;
gap: 8px;
/* 顶栏自己吃下状态栏高度(背景跟着铺上去,不留白条);设置页顶栏同用 .header */
padding: calc(10px + var(--sat)) 12px 10px;
min-height: 56px;
background: var(--drawer-bg);
}
.header .icon-btn {
width: 36px; height: 36px; border-radius: 50%;
display: flex; align-items: center; justify-content: center;
color: var(--ink);
}
.header .icon-btn:active { background: var(--surface); }
.header-center {
flex: 1; min-width: 0;
display: flex; align-items: center; justify-content: center;
text-align: center;
}
.header-title {
font-size: 15px; line-height: 1.3;
min-width: 0; max-width: 100%; overflow: hidden;
white-space: nowrap;
display: flex; align-items: center; gap: 5px; justify-content: center;
}
/* 文字层可收缩,过长时末尾省略号(flex 容器本身不响应 text-overflow,须包 span) */
.header-title-text {
min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.header-mode-icon {
width: 17px; height: 17px; flex: none; color: var(--active);
fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
/* ================= 主内容区 ================= */
main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* ---------- 未对话状态:欢迎页 ---------- */
#welcome-view {
flex: 1; overflow-y: auto; overflow-x: hidden;
display: flex; flex-direction: column; align-items: center; justify-content: center;
padding: 24px;
}
.logo-badge {
width: auto;
height: auto;
background: none;
border-radius: 0;
display: inline-flex;
align-items: center;
justify-content: center;
color: var(--active);
}
.logo-badge .ic { width: 40px; height: 40px; }
.welcome-slogan { font-size: 18px; }
/* 两行竖排:上 logo、下提示词,整体由 #welcome-view 垂直居中 */
.welcome-head {
display: flex;
flex-direction: column;
align-items: center;
gap: 14px;
}
/* 本地端:新建会话手选工作目录(服务器形态由 JS 整块隐藏)。 */
.welcome-dir {
margin-top: 18px;
max-width: min(90vw, 560px);
display: inline-flex;
align-items: center;
gap: 6px;
padding: 6px 10px;
border: 1px solid var(--border);
border-radius: 999px;
background: var(--surface);
font-size: 13px;
color: var(--ink);
}
.welcome-dir-cap { flex: 0 0 auto; opacity: .6; }
.welcome-dir-pick {
min-width: 0;
display: inline-flex;
align-items: center;
gap: 6px;
margin: 0;
padding: 0;
border: 0;
background: none;
color: inherit;
font: inherit;
cursor: pointer;
}
.welcome-dir-pick:disabled { opacity: .6; cursor: default; }
.welcome-dir-pick .ic { flex: 0 0 auto; color: var(--active); }
.welcome-dir-path {
max-width: 44ch;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.welcome-dir.is-set .welcome-dir-path { color: var(--active); }
.welcome-dir-clear {
flex: 0 0 auto;
width: 18px;
height: 18px;
padding: 0;
border: 0;
border-radius: 50%;
background: none;
color: var(--ink);
opacity: .5;
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
}
.welcome-dir-clear:hover { opacity: 1; background: var(--border); }
.welcome-dir-clear .ic { width: 12px; height: 12px; }
/* ---------- 对话状态:对话内容区 ---------- */
/* overflow-x 显式 hidden:overflow-y:auto 会把 visible 的 overflow-x 计算成 auto,
宽代码块/表格自带横向滚动,不该再让消息流整体横向溢出 */
#chat-view { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 16px 16px 8px; }
.msg { display: flex; flex-direction: column; margin-bottom: 18px; max-width: 100%; }
.msg.me { align-items: flex-end; }
.msg.other { align-items: flex-start; }
/* 思考过程折叠面板:位于 AI 气泡上方。summary 小圆点+灰文字,body 等宽字体淡背景 */
.msg-think {
width: 100%; max-width: 100%;
margin: 0 0 6px; padding: 0;
background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
font-size: 13px; color: var(--ink);
overflow: hidden;
}
.msg-think > summary {
list-style: none; cursor: pointer; user-select: none;
padding: 6px 10px; display: flex; align-items: center; gap: 6px;
color: var(--gray); font-size: 12px;
}
.msg-think > summary::-webkit-details-marker { display: none; }
.msg-think > summary::before {
content: '▸'; font-size: 10px; color: var(--gray-light);
transition: transform .15s; display: inline-block;
}
.msg-think[open] > summary::before { transform: rotate(90deg); }
/* summary 右侧复制按钮:靠右对齐,点击只复制不折叠(onCopyClick 里 preventDefault) */
.msg-think > summary .act-copy { margin-left: auto; display: inline-flex; color: var(--gray-light); padding: 2px; border-radius: 4px; }
.msg-think > summary .act-copy svg { width: 12px; height: 12px; }
.msg-think > summary .act-copy:hover { color: var(--ink); }
.msg-think > summary .act-copy.copied { color: #2e7d32; }
.msg-think-body {
padding: 4px 12px 10px;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 12.5px; line-height: 1.55;
color: var(--ink); white-space: pre-wrap; word-break: break-word;
border-top: 1px solid var(--border);
background: #fafbfd;
}
/* 流式阶段给一点视觉提示:边色稍亮,收尾(assistant_message)后去除 */
.msg-think.streaming { border-color: #d8e0f5; }
/* 用户气泡:右侧,浅色背景,圆角矩形 */
.bubble-user {
background: var(--active-soft); color: var(--ink);
padding: 10px 14px; border-radius: 16px 16px 4px 16px;
font-size: 15px; line-height: 1.6;
max-width: 82%; white-space: pre-wrap; word-break: break-word;
}
.attach-line { font-size: 12px; color: var(--active); margin-bottom: 4px; }
/* AI 气泡:左侧,无边框/白色背景,大段文字 */
.bubble-ai {
background: var(--page); color: var(--ink);
padding: 2px 0; font-size: 16px; line-height: 1.75;
max-width: 100%; white-space: pre-wrap; word-break: break-word;
}
/* markdown 排版(v1 同款;仅当 marked 渲染成功时加 .md 类,否则保留 pre-wrap 原文) */
.bubble-ai.md, .bubble-user.md { white-space: normal; }
.bubble-ai.md > :first-child, .bubble-user.md > :first-child { margin-top: 0; }
.bubble-ai.md > :last-child, .bubble-user.md > :last-child { margin-bottom: 0; }
.bubble-ai.md p, .bubble-user.md p { margin: 6px 0; }
.bubble-ai.md h1, .bubble-ai.md h2, .bubble-ai.md h3,
.bubble-user.md h1, .bubble-user.md h2, .bubble-user.md h3 {
margin: 12px 0 6px; line-height: 1.35; font-weight: 600;
}
.bubble-ai.md h1 { font-size: 1.3em; }
.bubble-ai.md h2 { font-size: 1.18em; }
.bubble-ai.md h3 { font-size: 1.08em; }
.bubble-user.md h1, .bubble-user.md h2, .bubble-user.md h3 { font-size: 1.05em; }
.bubble-ai.md ul, .bubble-ai.md ol,
.bubble-user.md ul, .bubble-user.md ol { padding-left: 1.5em; margin: 6px 0; }
.bubble-ai.md li, .bubble-user.md li { margin: 2px 0; }
.bubble-ai.md pre, .bubble-user.md pre {
background: var(--surface); border: 1px solid var(--border);
padding: 8px 10px; border-radius: 8px; margin: 6px 0;
overflow-x: auto; max-width: 100%; font-size: 13px; line-height: 1.5;
}
.bubble-ai.md code, .bubble-user.md code {
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
background: var(--surface); padding: 1px 4px; border-radius: 4px; font-size: 0.92em;
}
.bubble-ai.md pre code, .bubble-user.md pre code { background: none; padding: 0; }
/* 代码块逐块复制(decorateCodePre 注入):wrapper 接管 pre 的上下间距,按钮落在滚动区外,
pre 横向滚动时不被带走;桌面悬停显现,触屏(hover:none)常显 */
.md .code-wrap { position: relative; margin: 6px 0; }
.md .code-wrap > pre { margin: 0; }
.md .code-wrap > .act-copy {
position: absolute; top: 5px; right: 5px;
display: inline-flex; line-height: 0; cursor: pointer;
color: var(--gray-light); background: var(--page);
border: 1px solid var(--border); border-radius: 6px; padding: 4px;
opacity: 0; transition: opacity .15s;
}
.md .code-wrap > .act-copy svg { width: 13px; height: 13px; }
.md .code-wrap:hover > .act-copy, .md .code-wrap > .act-copy:focus-visible { opacity: 1; }
.md .code-wrap > .act-copy:hover { color: var(--ink); }
.md .code-wrap > .act-copy.copied { opacity: 1; color: #2e7d32; }
@media (hover: none) { .md .code-wrap > .act-copy { opacity: 1; } }
.bubble-ai.md img, .bubble-user.md img { max-width: 100%; border-radius: 8px; }
.bubble-ai.md table, .bubble-user.md table {
border-collapse: collapse; margin: 6px 0; display: block; overflow-x: auto;
}
.bubble-ai.md th, .bubble-ai.md td,
.bubble-user.md th, .bubble-user.md td {
border: 1px solid var(--border); padding: 4px 8px; font-size: 13px; text-align: left;
}
.bubble-ai.md blockquote, .bubble-user.md blockquote {
border-left: 3px solid var(--gray-light); padding-left: 8px;
color: var(--gray); margin: 6px 0;
}
.bubble-ai.md a, .bubble-user.md a { color: var(--active); }
.bubble-ai.md hr, .bubble-user.md hr {
border: 0; border-top: 1px solid var(--border); margin: 10px 0;
}
/* AI 思考过程折叠模块 */
.think {
align-self: stretch; max-width: 100%;
margin-bottom: 8px; border-radius: 12px;
}
.think-head {
display: inline-flex; align-items: center; gap: 6px;
font-size: 13px; color: var(--gray); padding: 6px 8px; margin-left: -8px;
border-radius: 8px;
}
.think-head:active { background: var(--surface); }
.think-head .chev { transition: transform .18s; }
.think.open .think-head { color: var(--ink); }
.think.open .think-head .chev { transform: rotate(180deg); }
.think-body { display: none; padding: 4px 8px 8px 8px; }
.think.open .think-body { display: block; }
.think-body ul { list-style: none; }
.think-body li {
position: relative; padding: 5px 0 5px 16px;
font-size: 13px; line-height: 1.6; color: var(--gray);
}
.think-body li::before {
content: ""; position: absolute; left: 2px; top: 12px;
width: 5px; height: 5px; border-radius: 50%; background: var(--gray-light);
}
/* 输出中占位(打字点) */
.typing { display: inline-flex; gap: 4px; padding: 8px 2px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--gray-light); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100% { opacity: .25; } 40% { opacity: 1; } }
/* 操作栏:时间 + 复制/删除 */
.msg-actions {
display: flex; align-items: center; gap: 10px;
margin-top: 6px; font-size: 12px; color: var(--gray-light);
}
.msg-actions .act { display: flex; color: var(--gray-light); padding: 3px; border-radius: 6px; }
/* token 用量小字(In/Out/缓存命中率),不抢时间戳视觉 */
.msg-actions .act-usage { font-size: 11px; white-space: nowrap; }
.msg-actions .act:active, .msg-actions .act:hover { color: var(--ink); }
.msg-actions .act.copied { color: var(--active); }
/* 删除本条:悬停变红点明破坏性;禁用态(请求中)半透且不响应 */
.msg-actions .act-del:hover { color: #c0392b; }
.act-del[disabled] { opacity: .4; pointer-events: none; }
/* 工具卡时间行的删除按钮:同样红示警 */
.tool-card .tool-time .act-del:hover { color: #c0392b; }
/* ================= 底部输入区 ================= */
footer { position: relative; flex: none; padding: 8px 12px calc(10px + var(--sab)); background: var(--page); }
.attach-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.attach-chip {
display: inline-flex; align-items: center; gap: 6px;
background: var(--surface); border-radius: 8px; padding: 5px 8px;
font-size: 12px; color: var(--ink); max-width: 100%;
}
.attach-chip .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.attach-chip .rm { color: var(--gray); display: flex; }
/* 工具卡参数流式生成中:◌ 呼吸提示(收尾后随 .tool-generating 移除) */
.tool-card.tool-generating .spin { display: inline-block; color: var(--active); animation: tool-gen-pulse 1s ease-in-out infinite; }
@keyframes tool-gen-pulse { 0%, 100% { opacity: 1 } 50% { opacity: .2 } }
/* 上传文件卡片行(嵌在输入框内部顶端,由 .input-shell 的 gap 提供间距;逐卡进度遮罩;卡多时横向滚动) */
.up-cards {
display: flex; gap: 6px;
overflow-x: auto; overflow-y: hidden;
scrollbar-width: none; /* Firefox 隐藏滚动条,保留拖动/滚轮滑动 */
-ms-overflow-style: none;
-webkit-overflow-scrolling: touch;
}
.up-cards::-webkit-scrollbar { display: none; }
.up-card {
position: relative; flex: 0 0 auto;
display: flex; align-items: center; gap: 8px;
width: 158px; max-width: 56vw;
background: var(--surface); border: 1px solid #e3e6ee; border-radius: 16px;
padding: 10px 11px; overflow: hidden;
}
.up-ico { color: var(--gray); display: flex; flex: none; }
.up-ico .ic { width: 18px; height: 18px; }
.up-info { flex: 1; min-width: 0; padding-right: 14px; } /* 给右上 × 让位,避免压住文件名省略号 */
.up-name { font-size: 12px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-meta { font-size: 10.5px; color: var(--gray); margin-top: 3px; }
/* 卡片右上 ×:上传完成/失败后可见,点掉=发送时不再告知该文件(不删任务目录里的文件) */
.up-x {
position: absolute; right: 5px; top: 5px; z-index: 2;
width: 16px; height: 16px; border-radius: 50%; border: none; cursor: pointer; padding: 0;
background: rgba(0, 0, 0, .06); color: var(--gray);
display: flex; align-items: center; justify-content: center;
}
.up-x:hover { background: rgba(0, 0, 0, .12); color: var(--ink); }
.up-x .ic { width: 10px; height: 10px; stroke-width: 2.4; }
.up-mask {
position: absolute; inset: 0; z-index: 1;
background: rgba(255, 255, 255, .78);
display: flex; align-items: center; justify-content: center;
}
.up-pct { font-size: 11px; font-weight: 600; color: var(--active); }
.up-card.err .up-pct { color: #c0392b; }
/* 底部进度线:宽度由 --up-p 驱动;终态(完成/失败)收起 */
.up-card::after {
content: ''; position: absolute; left: 0; bottom: 0; height: 3px; z-index: 1;
width: var(--up-p, 0%); background: var(--active);
border-radius: 0 2px 2px 0; transition: width .25s;
}
.up-card.done::after, .up-card.err::after { display: none; }
.input-shell {
position: relative; /* 按住说话的遮罩以它为定位基准 */
display: flex;
flex-direction: column;
align-items: stretch;
gap: 6px;
border-radius: var(--radius-lg);
padding: 6px 8px;
box-shadow: 0 4px 10px rgba(0,0,0,.02),0 2px 4px rgba(0,0,0,.04);
border: 1px solid rgba(0,0,0,0.1);
}
.input-shell textarea {
width: 100%;
flex: none;
resize: none;
background: none;
font-size: 15px;
line-height: 22px;
height: 44px; /* 初始2行 */
max-height: 120px; /* 限制最大高度 */
padding: 6px 12px;
min-width: 0;
}
.input-shell textarea::placeholder { color: var(--gray-light); }
.input-actions {
display: flex;
align-items: center;
gap: 6px;
padding-top: 6px;
}
/* 左右侧栏:左侧放开关,右侧放附件+发送(gap 拉开两钮间距) */
.ia-side {
flex: 1 1 0;
min-width: 0;
display: flex;
align-items: center;
}
.ia-left { justify-content: flex-start; }
.ia-right { justify-content: flex-end; gap: 12px; }
/* 深度思考开关(左侧功能开关) */
.think-toggle {
flex: none;
display: inline-flex;
align-items: center;
gap: 5px;
height: 32px;
padding: 0 12px;
border-radius: 999px;
border: 1px solid var(--gray-light);
font-size: 13px;
color: var(--ink);
background: transparent;
transition: border-color .18s, background .18s, color .18s;
}
.think-toggle.on {
border-color: var(--active);
background: var(--active-soft);
color: var(--active);
}
.plus-btn {
flex: none; width: 36px; height: 36px; border-radius: 50%;
display: flex; align-items: center; justify-content: center;
background: var(--surface); color: var(--ink);
}
.plus-btn:active { background: #dde0e6; }
.plus-btn.active { background: var(--active-soft); color: var(--active); } /* 文件面板展开时高亮 */
/* 语音模式:输入框位置换成「按住 说话」——只有居中文字,不做出按钮外观 */
#voice-hold {
position: relative;
height: 44px; border-radius: 8px;
display: flex; align-items: center; justify-content: center;
font-size: 15px; color: var(--ink); cursor: pointer;
user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
touch-action: none; transition: background .12s;
}
/* 按住区与下方操作栏之间的分隔线(用伪元素画,避开录音态底色的圆角) */
#voice-hold::after {
content: '';
position: absolute; left: 0; right: 0; bottom: -1px;
height: 1px; background: var(--border);
}
/* 录音中给一个极浅底色作反馈(文字同时变成「松开 结束」) */
#voice-hold.recording { background: var(--surface); }
/* 录音期间:输入卡内容整体让位给遮罩(遮罩不再透光,按钮/文字留着会和提示叠字) */
body.voice-active .input-shell { border-color: transparent; box-shadow: none; }
/* #voice-hold 不能一起藏:它是 pointerdown 时 setPointerCapture 的持有者,一按下就变成
visibility:hidden 时鸿蒙 ArkWeb 会释放捕获并补一个 pointercancel,页面把它当成“松手”
→ 按住不到 500ms → 误报“说话时间太短”。遮罩覆盖这一段本来就不透明(var(--page)),
留着按住区视觉上没有差别。 */
body.voice-active .input-shell > *:not(#voice-overlay):not(#voice-hold) { visibility: hidden; }
body.voice-active .attach-chips { visibility: hidden; }
body.voice-active .scroll-bottom-btn { display: none; }
/* 按住说话的遮罩:左右贴屏幕两边;底部一直铺到屏幕底(含 footer 的 10px 内边距与安全区),
向上多铺 72px 把输入卡上方那一条会话流也盖住。
声波中心对齐「按住 说话」那一行:padding-bottom 70px + 安全区 =
59(声波中心到输入卡底部)+ 11(遮罩底边向下外扩的 1px 边框 + 10px footer 内边距)。 */
#voice-overlay {
position: absolute;
top: -72px;
bottom: calc(-11px - var(--sab));
left: -13px; right: -13px;
z-index: 6;
display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
gap: 20px;
padding-bottom: calc(70px + var(--sab));
/* 底色必须是**不透明**的 var(--page):早先只铺一层 9% 蓝渐变,遮罩伸进会话流的那一段
会把底下的消息文字透出来,「松手传送」看着就成了半透明。
顶层那 20px 由透明渐变到 --page 只是把上边缘与会话流接上,别把整块都做成渐变。 */
background:
linear-gradient(to top, rgba(57, 100, 254, .09), rgba(57, 100, 254, 0) 70%),
linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--page) 20px);
color: var(--active);
pointer-events: auto; touch-action: none;
transition: background .15s linear, color .15s linear;
}
/* 上滑取消态:整体换成极淡的红调,声波/文案同步变红 */
#voice-overlay.cancel {
background:
linear-gradient(to top, rgba(192, 57, 43, .09), rgba(192, 57, 43, 0) 70%),
linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--page) 20px);
color: #c0392b;
}
/* 提示文案落在外挂层上,用比 --gray 深一档的中灰:13px 的字在浅灰上发虚 */
.vo-hint { font-size: 13px; line-height: 18px; color: #5f6672; letter-spacing: .2px; }
.vo-wave { display: flex; align-items: center; justify-content: center; gap: 3px; height: 34px; max-width: 100%; }
/* 柱子高度用 scaleY 而不是 height:只走合成层,不触发重排 */
.vo-wave i {
display: block; width: 3px; height: 34px; border-radius: 2px;
background: currentColor;
transform: scaleY(.12); transform-origin: center;
transition: transform 70ms linear;
}
/* 上滑取消态:声波与文案统一转警示色 */
#voice-overlay.cancel .vo-hint { color: #c0392b; }
@media (prefers-reduced-motion: reduce) { .vo-wave i { transition: none; } }
/* 发送键四态:发送 / 停止 / 语音 / 键盘。语音与键盘用中性底色,和蓝色「发送」区分开 */
.send-btn > svg { display: none; }
.send-btn[data-state="send"] .ic-send { display: block; }
.send-btn[data-state="voice"] .ic-voice,
.send-btn[data-state="keyboard"] .ic-kb { display: block; }
.send-btn[data-state="voice"],
.send-btn[data-state="keyboard"] { background: var(--surface); color: var(--ink); box-shadow: none; }
.send-btn[data-state="voice"]:active,
.send-btn[data-state="keyboard"]:active { background: #dde0e6; opacity: 1; }
/* 发送按钮:蓝底白向上箭头 */
.send-btn {
flex: none; width: 36px; height: 36px; border-radius: 50%;
display: flex; align-items: center; justify-content: center;
background: var(--active); color: #fff;
box-shadow: 0 2px 6px rgba(57, 100, 254, 0.35);
}
.send-btn:active { opacity: 0.85; }
/* ================= 任务文件面板浮层(底部弹出:盖住输入区,背景遮罩;scroll-bottom-btn 在其下方) ================= */
#files-mask {
position: absolute; inset: 0; z-index: 44;
background: rgba(10, 14, 30, 0.38);
opacity: 0; pointer-events: none; transition: opacity .22s;
}
#files-mask.show { opacity: 1; pointer-events: auto; }
.files-panel {
position: absolute; left: 0; right: 0; bottom: 0; z-index: 45;
display: flex; flex-direction: column;
/* 固定高度不随内容变化:切目录/删文件不再跳动,列表内部消化溢出;
拖拽手柄可调(JS 写 inline height),min/max 兜底防撑爆/防缩没 */
height: 46%; min-height: 240px; max-height: 85%;
background: var(--page);
border-radius: 16px 16px 0 0;
box-shadow: 0 -6px 24px rgba(20, 30, 70, 0.16);
transform: translateY(105%); transition: transform .25s ease; /* 收起时滑出屏幕 */
padding-bottom: var(--sab);
overflow: hidden;
}
.files-panel.open { transform: translateY(0); }
/* 拖拽手柄:与标题/上传钮同行,行内水平居中的透明热区(宽 120px,此区域无其他控件);
上拉放大(封顶 85% 视口),拉到最低后继续下拉整块下滑 → 收起面板 */
.files-drag-handle {
position: absolute; top: 0; bottom: 0; left: 50%; transform: translateX(-50%);
width: 120px;
display: flex; align-items: center; justify-content: center;
cursor: ns-resize; touch-action: none; user-select: none;
}
.files-drag-handle::before {
content: ''; width: 40px; height: 4px; border-radius: 2px; background: var(--gray-light);
}
.files-panel-header {
flex: none; position: relative; /* 拖拽手柄绝对定位贴顶,不占额外垂直高度 */
display: flex; align-items: center; justify-content: space-between;
padding: 12px 14px; font-size: 14px; font-weight: 600;
border-bottom: 1px solid var(--border);
background: var(--page);
}
.files-panel-header .files-panel-title {
flex: 1; min-width: 0;
}
/* 标题内紧跟「任务文件」的当前目录总大小(含隐藏的 .tmp/.venv);无内容时置空不占位 */
.files-panel-header .files-panel-size {
margin-left: 6px; white-space: nowrap;
font-size: 12px; font-weight: 400; color: var(--gray);
}
/* 上传总进度条(.files-panel-header 中间,上传中显示):[轨道 | 百分比] 横排,
百分比走正常文档流,不再悬浮在 6px 高的轨道里,避免各种裁剪/像素取整导致文字显示不全 */
.files-panel-progress {
flex: none; min-width: 0; display: flex; align-items: center; gap: 6px; margin: 0 10px;
padding: 6px 14px;
border-top: 1px solid var(--border);
background: var(--page);
}
.files-panel-progress .fp-track {
flex: 1; min-width: 0; height: 6px;
background: var(--surface); border-radius: 3px; overflow: hidden;
}
.files-panel-progress .bar {
height: 100%; width: 0;
background: linear-gradient(90deg, var(--active) 0%, #6b8cff 100%);
border-radius: 3px;
transition: width .12s linear;
}
.files-panel-progress .pct {
flex: none; font-size: 10px; color: var(--gray); line-height: 1; white-space: nowrap;
}
.files-panel-header .file-upload {
width: 32px; height: 32px; border-radius: 50%;
display: flex; align-items: center; justify-content: center;
background: var(--active-soft); color: var(--active); cursor: pointer;
}
.files-panel-header .file-upload:active { background: var(--active); color: #fff; }
.files-panel-header .file-upload svg {
width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2;
stroke-linecap: round; stroke-linejoin: round;
}
/* 文件列表区:占据中部所有可用高度 */
.files-panel .files-list {
overflow-y: auto; padding: 4px 6px;
flex: 1 1 auto; min-height: 0;
}
/* 面包屑路径栏:仅进入子目录后显示(/ > a > b);点任意节点回跳,末尾当前层为纯文本 */
.files-crumbs {
flex: none; display: flex; flex-wrap: wrap; align-items: center;
gap: 2px; padding: 7px 14px 8px;
font-size: 12.5px; background: var(--surface);
/* 上沿贴 header 自带分隔线,这里只补下沿:与文件列表拉开,不再糊成一片 */
border-bottom: 1px solid var(--border);
}
.files-crumbs .crumb {
display: inline-flex; align-items: center; gap: 3px;
color: var(--active); cursor: pointer;
padding: 2px 5px; border-radius: 6px;
max-width: 45vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.files-crumbs .crumb-ic {
width: 13px; height: 13px; flex: none;
fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.files-crumbs .crumb:active { background: var(--active-soft); }
.files-crumbs .crumb.cur { color: var(--text, #223); font-weight: 600; cursor: default; }
.files-crumbs .crumb.cur:active { background: none; }
.files-crumbs .crumb-sep { color: var(--gray-light); user-select: none; }
/* 底部固定操作栏:固定在面板最下方 */
.files-panel-footer {
flex: none;
display: flex; align-items: center; justify-content: space-between;
padding: 10px 14px;
border-top: 1px solid var(--border);
background: var(--page);
padding-bottom: calc(10px + var(--sab));
}
.files-panel-count {
font-size: 13px; color: var(--gray);
}
.files-panel-footer-left {
display: flex; align-items: center; gap: 10px; min-width: 0;
}
.files-panel-actions {
display: flex; align-items: center; gap: 12px;
}
.files-fab {
width: 40px; height: 40px; border-radius: 50%;
display: flex; align-items: center; justify-content: center;
border: none; cursor: pointer;
background: var(--active-soft); color: var(--active);
transition: opacity .15s ease, background .15s ease, color .15s ease;
}
.files-fab svg {
width: 20px; height: 20px; fill: none; stroke: currentColor;
stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.files-fab:active:not([disabled]) { opacity: .75; }
.files-fab.del {
background: #fdecea; color: #c0392b;
}
.files-fab[disabled] {
background: var(--surface); color: var(--gray-light);
cursor: not-allowed; opacity: .6;
}
/* 单个文件行:复选框 | 中间区域(名称 + 副行) */
.files-panel .file-row {
display: flex; align-items: flex-start; gap: 10px;
padding: 10px 8px; border-radius: 10px; font-size: 14px; cursor: default;
border-bottom: 1px dashed var(--border);
}
.files-panel .file-row:last-child { border-bottom: none; }
.files-panel .file-row:active { background: var(--surface); }
.files-panel .file-row.clickable { cursor: pointer; } /* 默认状态:可点名称预览/下载 */
.files-panel .file-row.selected { background: var(--active-soft); }
/* 目录行(单层列表,无折叠):勾选框 + 文件夹图标 + 名称 + 文件数 + 进入箭头;点行进入该目录 */
.files-panel .file-dir-head {
display: flex; align-items: center; gap: 8px;
padding: 9px 8px; border-radius: 10px; font-size: 14px; cursor: pointer;
border-bottom: 1px dashed var(--border);
}
.files-panel .file-dir-head:active { background: var(--surface); }
.files-panel .file-dir-head.selected { background: var(--active-soft); }
.files-panel .file-dir-ico {
width: 16px; height: 16px; flex: none;
fill: none; stroke: #f2b544; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.files-panel .file-dir-name {
flex: 1; min-width: 0; font-weight: 600; color: var(--text, #223);
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.files-panel .file-dir-count { flex: none; font-size: 12px; color: var(--gray); }
.files-panel .file-dir-go {
width: 14px; height: 14px; flex: none;
fill: none; stroke: var(--gray-light); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
/* 列表末尾行(可能是无文件的目录行)去掉分隔虚线 */
.files-panel .files-list > .file-row:last-child,
.files-panel .files-list > .file-dir-head:last-child { border-bottom: none; }
/* 复选框:圆形,点击区域够大 */
.files-panel .file-check {
flex: none;
width: 16px; height: 16px; border-radius: 50%;
border: 1px solid #c8cee0; background: var(--page);
display: inline-flex; align-items: center; justify-content: center;
cursor: pointer; box-sizing: border-box;
margin-top: 2px;
transition: border-color .15s ease, background .15s ease;
}
.files-panel .file-check::after {
content: '';
display: block;
width: 5px; height: 9px;
border-right: 2px solid #fff;
border-bottom: 2px solid #fff;
transform: rotate(45deg) translate(-1px, -2px);
opacity: 0;
}
.files-panel .file-row.selected .file-check {
background: var(--active); border-color: var(--active);
}
.files-panel .file-row.selected .file-check::after { opacity: 1; }
/* 目录头勾选框:复用 .file-check 圆形样式;选中态直接看 aria-checked(目录不在 .file-row 内) */
.files-panel .file-dir-head .file-check { margin-top: 0; }
.files-panel .file-dir-head .file-check[aria-checked="true"] {
background: var(--active); border-color: var(--active);
}
.files-panel .file-dir-head .file-check[aria-checked="true"]::after { opacity: 1; }
/* 底部"全选"复选框:复用 .file-check 的尺寸与对勾伪元素(通过同时加 file-check class),
区别是这里用方角、与行内圆区分开。状态由 data-state 决定,不进 .file-row。 */
.files-panel .files-panel-check {
border-radius: 5px; /* 覆盖行内 50%,变方角 */
margin-top: 0; /* 覆盖行内 2px 偏移 */
}
.files-panel-check[data-state="all"] {
background: var(--active); border-color: var(--active);
}
.files-panel-check[data-state="all"]::after { opacity: 1; }
.files-panel-check[data-state="some"] {
background: var(--active); border-color: var(--active);
}
.files-panel-check[data-state="some"]::after { opacity: 1; } /* 部分选中:同一表现,避免误导 */
.files-panel-check[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
/* 主区域:名称 + 副信息(图标 + 大小) */
.files-panel .file-main {
flex: 1; min-width: 0;
display: flex; flex-direction: column; gap: 4px;
}
/* 文件名:最多两行 + 省略号,占据除复选框外所有横向空间 */
.files-panel .file-name {
font-weight: 500; color: var(--text, #223);
display: -webkit-box; -webkit-box-orient: vertical;
-webkit-line-clamp: 2; line-clamp: 2;
overflow: hidden; word-break: break-all;
line-height: 1.35;
}
.files-panel .file-meta {
display: flex; align-items: center; gap: 6px;
font-size: 12px; color: var(--gray);
}
.files-panel .file-ico {
width: 14px; height: 14px; flex-shrink: 0;
fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.files-panel .file-ico.eye { stroke: #5b8def; }
.files-panel .file-ico.doc { stroke: #f2994a; }
.files-panel .file-size {
flex: none; color: var(--gray);
font-size: 12px;
}
.files-panel .empty-tip {
padding: 20px 10px; text-align: center; font-size: 13px; color: var(--gray-light);
}
/* ================= 历史记录抽屉 ================= */
#scrim {
position: fixed; inset: 0; background: rgba(0, 0, 0, .4);
opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 40;
}
#scrim.show { opacity: 1; pointer-events: auto; }
#drawer {
/* 抽屉是 fixed 全屏层:顶部让出状态栏,底部随键盘收缩(搜索框输入时列表不被盖住) */
position: fixed; top: 0; bottom: var(--kb); left: 0; z-index: 50;
padding-top: var(--sat);
width: min(78vw, 320px);
background: var(--drawer-bg);
display: flex; flex-direction: column;
transform: translateX(-102%); transition: transform .25s ease;
box-shadow: 4px 0 24px rgba(0, 0, 0, .08);
}
#drawer.open { transform: translateX(0); }
.drawer-search { flex: none; padding: 14px 14px 10px; }
.search-box {
display: flex; align-items: center; gap: 8px;
background: var(--page); border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px;
color: var(--gray);
box-shadow: 0 1px 2px rgba(15, 17, 21, .08), 0 4px 12px rgba(15, 17, 21, .07);
}
.search-box input { flex: 1; min-width: 0; font-size: 14px; background: none; }
.search-box input::placeholder { color: var(--gray-light); }
.drawer-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 12px; }
/* ---------- 抽屉底部图标操作栏(会话/文件树/预览/设置) + 只读文件树 ----------
操作栏替代了原来整行可点的用户区:4 个图标,当前生效的那一项高亮(active)。 */
.drawer-actions {
flex: none; display: flex; align-items: center; justify-content: space-around; gap: 4px;
padding: 6px 10px calc(6px + var(--sab)); border-top: 1px solid var(--border);
background: var(--drawer-bg);
}
.drawer-act {
flex: 1; height: 40px; display: inline-flex; align-items: center; justify-content: center;
border: 0; background: none; border-radius: 10px; color: var(--gray); cursor: pointer;
transition: background .12s, color .12s;
}
.drawer-act:hover { background: var(--surface); color: var(--ink); }
.drawer-act.active { color: var(--active); background: var(--active-soft); }
.drawer-act svg {
width: 20px; height: 20px; fill: none; stroke: currentColor;
stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
/* 窄屏:没有右侧预览分栏(预览走全屏 #fs-viewer);文件浏览只保留输入行右侧的
旧「任务文件」面板,左栏不再出现文件树(不做两套文件 UI)。所以文件树钮也隐藏。 */
@media (max-width: 959px) { #da-files { display: none !important; } }
.files-tree { display: none; flex: 1; min-height: 0; flex-direction: column; }
#drawer.drawer-mode-files .drawer-search,
#drawer.drawer-mode-files .drawer-list { display: none; }
#drawer.drawer-mode-files .files-tree { display: flex; }
/* 左栏树头部复用预览栏的 .pv-head / .pv-actions / .icon-btn:
它俩在桌面上左右并排,高一点点或图标小一号都会明显错位。
不放地址条:侧栏只有 280px,路径必然被截断,没有信息量。 */
.tree-head .pv-actions { gap: 4px; margin-left: auto; } /* 靠右,与预览栏的操作钮同一侧 */
/* 头部图标的「开启中」态(如显示隐藏文件) */
.pv-actions .icon-btn.active { color: var(--active); background: var(--active-soft); }
.tree-body { flex: 1; min-height: 0; overflow: auto; padding: 4px 6px 12px; }
.tree-row {
display: flex; align-items: center; gap: 5px;
padding: 5px 6px; border-radius: 8px; cursor: pointer;
font-size: 13px; color: var(--ink); white-space: nowrap;
}
.tree-row:hover { background: var(--surface); }
.tree-row.is-ignored { color: var(--gray-light); cursor: default; }
.tree-row.is-link { color: var(--gray); }
.tree-ico { flex: none; width: 16px; height: 16px; display: inline-flex; color: var(--gray); }
.tree-ico svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tree-row.is-dir .tree-ico { color: var(--active); }
.tree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tree-act {
flex: none; width: 20px; height: 20px; display: none; align-items: center; justify-content: center;
border: 0; background: none; color: var(--gray); cursor: pointer; border-radius: 6px;
}
.tree-row:hover .tree-act { display: inline-flex; }
.tree-act:hover { background: var(--border); color: var(--active); }
.tree-act.danger:hover { background: #fdf3f2; color: #c0392b; }
.tree-act svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tree-empty, .tree-loading, .tree-more { padding: 10px 12px; font-size: 12px; color: var(--gray); }
/* 行内勾选框:hover 或已选中才淡入;但占位始终在,hover 时文件名不会左右跳。
目录行同样可勾:勾中 = 整个目录参加批量下载(打包成 zip)/ 批量删除。 */
.tree-check {
flex: none; width: 14px; height: 14px; border-radius: 50%;
border: 1px solid #c8cee0; background: var(--page);
display: inline-flex; align-items: center; justify-content: center;
box-sizing: border-box; cursor: pointer;
opacity: 0; transition: opacity .12s, border-color .15s, background .15s;
}
.tree-check::after {
content: ''; display: block; width: 4px; height: 8px;
border-right: 2px solid #fff; border-bottom: 2px solid #fff;
transform: rotate(45deg) translate(-1px, -1px); opacity: 0;
}
.tree-row:hover .tree-check, .tree-row.selected .tree-check { opacity: 1; }
.tree-check[aria-checked="true"] { background: var(--active); border-color: var(--active); opacity: 1; }
.tree-check[aria-checked="true"]::after { opacity: 1; }
.tree-row.selected { background: var(--surface); }
/* 底部批量条:全选框 + 计数 + 下载/删除 */
.tree-foot {
flex: none; display: flex; align-items: center; gap: 6px;
padding: 6px 8px; border-top: 1px solid var(--border);
}
.tree-check-all {
flex: none; width: 14px; height: 14px; border-radius: 4px;
border: 1px solid #c8cee0; background: var(--page);
display: inline-flex; align-items: center; justify-content: center;
box-sizing: border-box; cursor: pointer;
transition: border-color .15s, background .15s;
}
.tree-check-all::after {
content: ''; display: block; width: 4px; height: 8px;
border-right: 2px solid #fff; border-bottom: 2px solid #fff;
transform: rotate(45deg) translate(-1px, -1px); opacity: 0;
}
.tree-check-all[aria-checked="true"],
.tree-check-all[aria-checked="mixed"] { background: var(--active); border-color: var(--active); }
.tree-check-all[aria-checked="true"]::after { opacity: 1; }
.tree-check-all[aria-checked="mixed"]::after {
width: 7px; height: 0; opacity: 1;
border-right: 0; border-bottom: 2px solid #fff; transform: none;
}
.tree-sel-count {
flex: 1; min-width: 0; font-size: 12px; color: var(--gray);
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tree-foot-btn {
flex: none; width: 24px; height: 24px;
display: inline-flex; align-items: center; justify-content: center;
border: 0; background: none; color: var(--gray); cursor: pointer; border-radius: 6px;
}
.tree-foot-btn:hover { background: var(--border); color: var(--active); }
.tree-foot-btn.danger:hover { background: #fdf3f2; color: #c0392b; }
.tree-foot-btn:disabled { opacity: .35; cursor: default; background: none; color: var(--gray); }
.tree-foot-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* 桌面端:文件浏览交给左栏文件树,隐藏输入行右侧的旧「任务文件」浮层入口。
手机端仍用它(窄屏放不下树)。 */
@media (min-width: 960px) { #files-btn { display: none !important; } }
/* 会话分组表头(按今天/昨天分组):滚动时吸顶,下一个 group-label 滚过来时把它顶走
背景色与抽屉一致,避免 sticky 时下面会话透过看到上一组的尾巴 */
.group-label {
position: sticky; top: 0; z-index: 1;
margin-top: 8px;
padding: 8px 10px 4px;
font-size: 11px; color: var(--gray);
background: var(--drawer-bg);
}
.conv-item {
display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
padding: 12px 10px; border-radius: 12px;
font-size: 14px; color: var(--ink);
overflow: hidden;
}
.conv-title {
flex: 1; min-width: 0;
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.conv-item:active { background: var(--surface); }
.conv-item.active { background: var(--active-soft); color: var(--active); }
/* 会话行内状态指示:状态色圆点(排队=蓝/活跃=绿/保持=黄;活跃呼吸闪烁) */
.conv-item .st-dot {
flex: none; width: 8px; height: 8px; border-radius: 50%;
background: var(--gray-light);
}
.conv-item .st-dot.queued { background: var(--active); }
.conv-item .st-dot.active { background: #1c7a2e; animation: pill-pulse 1.2s ease-in-out infinite; }
.conv-item .st-dot.held { background: #b8860b; }
/* 会话行包装:为桌面端 hover 的内联 × 提供定位;移动端不需要 swiped 类
(滑到位直接弹 modal,不再保留 swiped 状态) */
.conv-wrap {
position: relative;
border-radius: 12px;
}
/* 定时任务会话标记:左缘紫色短竖条,绝对定位压在 conv-item 左 padding 区,不吃标题宽度;
紫色体系与「定时任务」动作项同语义,区别于状态色(蓝/绿/黄) */
.conv-wrap.scheduled::before {
content: ""; position: absolute; left: 2px; top: 24%; bottom: 24%;
width: 3px; border-radius: 2px; background: #7048e8;
pointer-events: none;
}
.conv-item {
position: relative;
transition: background .12s, padding-right .12s;
width: 100%;
}
/* 桌面端 hover 行内按钮:右侧两个并排(新窗口 / 删除),触屏设备不显示(移动端删除走左滑手势) */
.conv-pop, .conv-del {
position: absolute; top: 50%; transform: translateY(-50%);
width: 24px; height: 24px; border-radius: 7px;
display: none; align-items: center; justify-content: center;
color: var(--gray); background: var(--surface); border: 1px solid var(--border);
z-index: 2;
}
.conv-pop { right: 36px; }
.conv-del { right: 8px; }
@media (hover: hover) and (pointer: fine) {
.conv-wrap:hover .conv-item:not(.active) { background: #f5f6f8; }
/* hover 时标题让出右侧按钮位,防两个按钮压住文字 */
.conv-wrap:hover .conv-item { padding-right: 68px; }
.conv-wrap:hover .conv-pop, .conv-wrap:hover .conv-del { display: flex; }
.conv-pop:hover { color: var(--active); background: var(--active-soft); border-color: currentColor; }
.conv-del:hover { color: #c0392b; background: #fdf3f2; border-color: #eac2bd; }
}
.drawer-empty { padding: 24px 10px; font-size: 13px; color: var(--gray-light); text-align: center; }
/* 历史懒加载的消息流顶部内联轻提示:拉更早页时占一行,补上内容后自动被顶掉移除 */
.chat-load-earlier { padding-bottom:10px; font-size: 12px; color: var(--gray-light); text-align: center; }
/* 删除会话 modal 副标题:会话 ID 等二级说明,字号小、灰色 */
.confirm-sub { font-size: 12px; color: var(--gray); margin-top: 6px; }
/* 底部图标操作栏见上方 .drawer-actions(原用户区整行可点已废弃) */
.avatar {
width: 36px; height: 36px; border-radius: 50%; flex: none;
background: var(--active); /* 真实用户名下的头像:JS 按用户名取色内联覆盖,与设置页 user-card 一致 */
color: #fff; display: flex; align-items: center; justify-content: center;
font-size: 15px; font-weight: 600;
}
.user-name { flex: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-more { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--gray); }
.user-more:active { background: var(--surface); }
/* ================= Toast ================= */
#toast {
position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
background: rgba(15, 17, 21, .88); color: #fff;
padding: 9px 16px; border-radius: 10px; font-size: 13px;
z-index: 200; pointer-events: none; transition: opacity .2s;
}
/* ================= 回到底部浮动按钮(同步 index 右下角导航浮动图标) ================= */
/* 停靠在输入区上方:包含块是 footer,bottom:100% = footer 顶边,
输入框长高/编辑条出现时随 footer 一起上移,不再用固定值 140px 遮挡输入区。 */
.scroll-bottom-btn {
position: absolute; right: 14px; bottom: calc(100% + 6px); margin: 0;
width: 38px; height: 38px; border-radius: 50%;
border: none; cursor: pointer; padding: 0;
display: flex; align-items: center; justify-content: center;
background: #fff; box-shadow: 0 2px 8px rgba(30,40,90,0.18);
z-index: 30; opacity: 0.95;
}
.scroll-bottom-btn:active { opacity: 1; }
.scroll-bottom-btn svg { width: 20px; height: 20px; fill: none; stroke: #556; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.scroll-bottom-btn .sb-spinner { animation: sb-spin 0.8s linear infinite; }
.scroll-bottom-btn .sb-spinner circle { stroke: #dde; stroke-width: 2.5; fill: none; }
.scroll-bottom-btn .sb-spinner path { stroke: #3964FE; stroke-width: 2.5; stroke-linecap: round; fill: none; }
@keyframes sb-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
/* 微信绑定内联卡(账户页):登录码用服务端 SVG 内联渲染(非 <img>,无坏图帧);未就绪时占位不跳高 */
.wx-qr { display: flex; justify-content: center; align-items: center; margin: 10px 0 4px; min-height: 236px; }
.wx-qr svg { width: 220px; height: 220px; background: #fff; padding: 8px; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.wx-qr-wait { color: var(--gray-light); font-size: 13px; }
.wx-id { float: right; font-weight: 400; font-size: 11px; color: var(--gray-light); margin-top: 5px; }
/* ================= 工具调用卡片(样式/交互同步 index 的 .tool-card) ================= */
.tool-card {
align-self: stretch; max-width: 100%;
background: #fbf7ee; border: 1px solid #eadfc4; border-radius: 10px;
padding: 8px 12px; font-size: 13px; color: #6b5b2a;
margin-bottom: 10px;
}
.tool-card .tool-name { font-weight: 600; }
.tool-card summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: center; }
.tool-card summary::-webkit-details-marker { display: none; }
.tool-card .tool-args { color: #8a763b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; font-size: 12px; }
.tool-card pre {
background: #f6f1e3; padding: 8px; border-radius: 8px; margin-top: 6px;
white-space: pre-wrap; overflow-x: auto; max-height: 300px; overflow-y: auto;
font-size: 12px; color: #55492a;
}
.tool-card .tool-time {
color: #b3a97f; margin-top: 6px; font-size: 11px;
display: flex; align-items: center; gap: 6px;
}
.tool-card .tool-time .act { display: inline-flex; color: #b3a97f; padding: 2px; border-radius: 4px; }
.tool-card .tool-time .act svg { width: 12px; height: 12px; }
.tool-card .tool-time .act.copied { color: #2e7d32; }
.tool-card.error { background: #fdecea; border-color: #f2c4bd; color: #a3352a; }
.tool-card .spin { display: inline-block; width: 1em; text-align: center; }
.tool-card .tool-args-full { color: #6b5b2a; }
/* 工具结果里的图片(read_file 读图回传;点击放大查看) */
.tool-img {
display: block; max-width: 240px; max-height: 240px;
border-radius: 6px; margin-top: 6px; cursor: zoom-in;
}
/* ================= 全屏查看器(搬自 index;图片单点放大+缩放,消息双击放大) ================= */
#img-viewer { position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,0.93); display: flex; align-items: center; justify-content: center; overflow: hidden; }
#img-viewer.hidden { display: none; }
/* 两层 img 绝对定位居中叠放:滑动切换时旧图滑出、新图同步滑入(见 js/stream.js 的 slideTo) */
#img-viewer img { position: absolute; inset: 0; margin: auto; max-width: 100vw; max-height: 88vh; touch-action: none; cursor: grab; user-select: none; -webkit-user-drag: none; will-change: transform; }
/* 组内页码:底部居中悬浮,不参与命中测试(点它等于点背景会关闭) */
#img-count { position: fixed; left: 50%; bottom: calc(18px + var(--sab)); transform: translateX(-50%); z-index: 151; padding: 3px 12px; border-radius: 999px; background: rgba(0,0,0,0.5); color: #fff; font-size: 12px; letter-spacing: .5px; pointer-events: none; }
#fs-viewer { position: fixed; inset: 0; z-index: 130; background: rgba(8,10,20,0.88); padding: 40px 14px 24px; overflow: auto; /* 缩放后支持横纵滚动 */ }
#fs-viewer.hidden { display: none; }
.fs-panel { max-width: 860px; margin: 0 auto; background: var(--page); border-radius: 14px; padding: 18px 20px; font-size: 15.5px; }
/* 顶部操作区:默认右上角悬浮(消息全屏用);文件预览走 fs-bar 模式时独立成一行 */
.fs-actions { position: fixed; top: calc(2px + var(--sat)); right: 14px; z-index: 131; display: flex; align-items: center; gap: 8px; }
.fs-name { display: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--ink); }
.fs-btn {
flex: none; display: flex; align-items: center; justify-content: center;
width: 34px; height: 34px; border: none; border-radius: 50%;
background: rgba(0,0,0,0.42); color: #fff; box-shadow: 0 1px 5px rgba(0,0,0,0.22);
font-size: 15px; line-height: 1; cursor: pointer;
}
.fs-btn svg { width: 17px; height: 17px; }
.fs-btn.on { background: rgba(255,255,255,0.85); color: #333; }
/* 文件预览沉浸模式:40px 操作条 + 全宽内容。内容从条下开始,不会叠在页面自己的顶部按钮上;
宽度一点不让(手机横向最贵),只牺牲一条操作栏的高度。 */
#fs-viewer.fs-bar { display: flex; flex-direction: column; padding: 0; overflow: auto; background: var(--page); }
#fs-viewer.fs-bar .fs-actions {
position: sticky; top: 0; z-index: 1;
flex: none; width: 100%;
height: calc(40px + var(--sat));
padding: var(--sat) 10px 0 14px;
justify-content: flex-end; gap: 6px;
background: var(--page); border-bottom: 1px solid var(--border);
}
#fs-viewer.fs-bar .fs-name { display: block; flex: 1; }
#fs-viewer.fs-bar .fs-btn { width: 32px; height: 32px; border-radius: 8px; background: transparent; color: var(--ink); box-shadow: none; }
#fs-viewer.fs-bar .fs-btn:active { background: var(--surface); }
#fs-viewer.fs-bar .fs-btn.on { background: var(--active); color: #fff; }
#fs-viewer.fs-bar .fs-panel { flex: 1; min-height: 0; width: 100%; max-width: none; margin: 0; padding: 0; border-radius: 0; background: var(--page); }
#fs-viewer.fs-bar #fs-body { position: relative; overflow: auto; }
#fs-viewer.fs-bar #fs-body .fs-html-frame { height: 100%; min-height: 0; border-radius: 0; }
/* 文本/源码直排:去掉气泡卡片的内外边距,只留 12px 阅读边距 */
#fs-viewer.fs-bar #fs-body .bubble-ai,
#fs-viewer.fs-bar #fs-body .bubble-user {
max-width: 100%; margin: 0; border-radius: 0; box-shadow: none; background: var(--page);
padding: 14px 12px calc(28px + var(--sab)); font-size: 15.5px;
}
#fs-viewer.fs-bar #fs-src-pane { overflow: auto; }
#fs-viewer.fs-bar #fs-src-code { max-height: none; border: 0; border-radius: 0; padding: 12px 14px calc(28px + var(--sab)); }
#fs-viewer.fs-bar .fs-img-frame { max-width: 100%; max-height: 100%; border-radius: 0; margin: 0 auto; }
.fs-close {
/* 顶到视口最上沿(避开刘海),不再压住预览面板顶部 */
position: fixed; top: calc(2px + var(--sat)); right: 14px; z-index: 131; width: 34px; height: 34px;
border: none; border-radius: 50%; background: rgba(0,0,0,0.42); color: #fff;
box-shadow: 0 1px 5px rgba(0,0,0,0.22);
font-size: 15px; line-height: 1; cursor: pointer;
}
/* 源码面板:与 #fs-body 互斥显示(toggleFsSrc 切换);bar 模式下占满操作条以下区域 */
.fs-src-panel { padding: 14px 16px; }
#fs-src-code {
margin: 0; white-space: pre-wrap; word-break: break-word;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 12.5px; line-height: 1.55; color: var(--ink);
background: #fafbfd; border: 1px solid var(--border); border-radius: 8px;
padding: 10px 12px; max-height: 76vh; overflow: auto;
}
#fs-body .bubble-ai, #fs-body .bubble-user { max-width: 100%; box-shadow: none; }
#fs-body .tool-card { max-width: 100%; }
#fs-body .tool-card pre { max-height: 65vh; }
/* HTML 预览:沙箱 iframe 铺满全屏查看器 */
.fs-html-frame { width: 100%; height: 100%; min-height: 70vh; border: 0; background: #fff; border-radius: 12px; }
/* 图片预览:fs-viewer 居中缩放显示原图,大图可滚动 */
.fs-img-frame { display: block; max-width: 100%; max-height: 80vh; margin: 0 auto; border-radius: 8px; object-fit: contain; background: #fff; }
/* ================= 设置区(覆盖层页面;卡片/表单样式搬自 style.css 适配 v2 变量) ================= */
#settings-page {
position: absolute; inset: 0; z-index: 60;
background: var(--page);
display: flex; flex-direction: column;
}
/* 当前页层:右滑返回时只平移它,底下露出 #set-under 垫底的父页快照 */
#set-top {
position: relative; z-index: 1;
flex: 1; min-height: 0;
display: flex; flex-direction: column;
background: var(--page); /* 不透明,滑动前完全盖住垫底层 */
}
/* 垫底静态快照层:仅返回滑动动画期间显示,不可交互 */
#set-under { display: none; }
#set-under.show {
display: flex; flex-direction: column;
position: absolute; inset: 0; z-index: 0;
background: var(--page);
pointer-events: none;
}
.set-under-body { flex: 1; min-height: 0; background: var(--surface); display: flex; flex-direction: column; overflow: hidden; }
.header-right { flex: none; min-width: 40px; display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.header-right .icon-btn, .header-right label.icon-btn { color: var(--ink); }
.header-right .icon-btn:active, .header-right label.icon-btn:active { background: var(--surface); }
label.icon-btn { cursor: pointer; }
#set-body { flex: 1; min-height: 0; background: var(--surface); display: flex; flex-direction: column; }
.set-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 12px 12px calc(16px + var(--sab)); }
.empty-tip { color: var(--gray-light); text-align: center; padding: 18px; font-size: 13px; }
/* ---------- 设置主页卡片 ---------- */
.set-home { display: flex; flex-direction: column; gap: 12px; }
.set-card {
display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
background: var(--page); border: 1px solid var(--border); border-radius: 16px; padding: 15px 16px;
}
.set-card:active { background: var(--surface); }
.set-ico {
width: 42px; height: 42px; border-radius: 12px; flex: none;
display: flex; align-items: center; justify-content: center;
background: var(--active-soft); color: var(--active);
}
.set-tt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.set-name { font-size: 15px; font-weight: 600; }
.set-desc { font-size: 12px; color: var(--gray); }
.set-arrow { color: var(--gray-light); }
/* ---------- 通用白卡与设置表单(搬自 style.css 设置页) ---------- */
.settings-card {
background: var(--page); border: 1px solid var(--border); border-radius: 12px;
padding: 10px 14px 12px; margin-bottom: 12px;
}
.settings-card h4 { font-size: 14px; color: var(--ink); margin: 4px 0 2px; display: flex; align-items: center; gap: 8px; }
.cfg-kv {
display: flex; align-items: baseline; gap: 10px;
font-size: 13px; padding: 7px 0; border-bottom: 1px dashed var(--border);
}
.cfg-kv:last-of-type { border-bottom: none; }
.cfg-kv label { color: var(--gray); flex: none; max-width: 42%; }
.cfg-kv b {
font-weight: 500; flex: 1; text-align: right; color: var(--ink);
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
font-variant-numeric: tabular-nums;
}
.cfg-note { font-size: 11.5px; color: var(--gray-light); line-height: 1.5; margin-top: 6px; }
.cfg-input {
flex: 1; min-width: 0; text-align: right; font-size: 13px; color: var(--ink);
background: var(--surface); border: 1px solid transparent; border-radius: 8px;
padding: 6px 10px; font-variant-numeric: tabular-nums; font-family: inherit;
-webkit-appearance: none; appearance: none;
}
.cfg-input:focus { border-color: var(--active); background: #fff; }
.cfg-input::-webkit-outer-spin-button, .cfg-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cfg-input.cfg-dirty { color: #c0392b; border-color: #e8b4b0; background: #fdf3f2; }
.cfg-err {
margin: 0 0 8px; padding: 8px 12px; border-radius: 8px;
background: #fdecea; color: #a3352a; font-size: 12.5px;
white-space: pre-wrap; word-break: break-all;
}
/* ---------- 账户卡(搬自 index 用户卡) ---------- */
.user-card { display: flex; flex-direction: column; align-items: center; padding: 20px 16px 16px; }
.user-avatar {
width: 64px; height: 64px; border-radius: 50%; border: none;
color: #fff; font-size: 26px; font-weight: 600; letter-spacing: 1px;
display: flex; align-items: center; justify-content: center;
box-shadow: 0 2px 6px rgba(30, 40, 90, 0.18); user-select: none;
}
.set-user-name { margin-top: 10px; font-size: 16px; font-weight: 600; word-break: break-all; text-align: center; }
.user-acts { display: flex; gap: 10px; width: 100%; max-width: 360px; margin-top: 14px; }
.user-acts .ghost-btn { flex: 1; }
/* ---------- 徽章 ---------- */
.badge { font-size: 11px; padding: 1px 7px; border-radius: 8px; white-space: nowrap; }
.badge.active { background: #e3f2e6; color: #217a34; }
.badge.held { background: #fff4dc; color: #a06a00; }
.badge.cancelled { background: #fdecea; color: #b3382c; }
/* ---------- 列表卡(技能)与操作钮 ---------- */
.session-card {
background: var(--page); border: 1px solid var(--border); border-radius: 12px;
padding: 12px 14px; margin-bottom: 10px;
display: flex; align-items: center; gap: 10px; cursor: pointer;
}
.session-card:active { background: var(--surface); }
.session-main { flex: 1; overflow: hidden; }
.session-name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-meta { font-size: 12px; color: var(--gray); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.skill-desc {
font-size: 12px; color: var(--gray); margin-top: 3px;
display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-acts { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; flex-shrink: 0; }
.card-act { background: var(--active-soft); color: var(--active); border: none; border-radius: 8px; font-size: 12px; padding: 5px 10px; cursor: pointer; }
.card-act.del { background: #fdecea; color: #c0392b; }
.card-act:active { opacity: 0.7; }
/* ---------- 技能详情文件列表 ---------- */
.skill-files { background: var(--page); border: 1px solid var(--border); border-radius: 12px; padding: 6px 8px; }
.skill-files .file-row {
display: flex; align-items: center; gap: 8px; padding: 8px;
border-radius: 8px; font-size: 13.5px; cursor: pointer;
border-bottom: 1px dashed var(--border);
}
.skill-files .file-row:last-child { border-bottom: none; }
.skill-files .file-row:active { background: var(--surface); }
.skill-files .file-ico {
width: 16px; height: 16px; flex-shrink: 0;
stroke: #7f8db0; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.skill-files .file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.skill-files .file-size { background: var(--surface); color: var(--gray); font-size: 11px; padding: 2px 8px; border-radius: 9px; flex: none; }
.skill-files .file-act { background: var(--active-soft); color: var(--active); border: none; border-radius: 7px; padding: 4px 9px; font-size: 13px; flex: none; cursor: pointer; }
.skill-files .file-act.del { background: #fdecea; color: #c0392b; }
/* ---------- 模型池分组与卡片 ---------- */
.model-group { background: var(--page); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.model-group-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; user-select: none; }
.model-group-head:active { opacity: 0.7; }
.model-group-caret {
width: 15px; height: 15px; flex-shrink: 0;
stroke: #7f8db0; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
transition: transform 0.15s ease;
}
.model-group.open .model-group-caret { transform: rotate(90deg); }
.model-group-name { font-weight: 600; font-size: 14.5px; }
.model-group-key {
font-size: 11.5px; color: var(--gray); word-break: break-all;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.model-group-meta { margin-left: auto; flex-shrink: 0; font-size: 12px; color: var(--gray); white-space: nowrap; }
.model-group-body { padding: 0 10px 10px; border-top: 1px dashed var(--border); }
.model-group-bal { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 10px 4px 0; font-size: 12.5px; color: #556; }
.mbal-refresh { border: none; background: none; padding: 2px; margin: 0; cursor: pointer; display: flex; color: #7f8db0; }
.mbal-refresh svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mbal-refresh:active { opacity: 0.6; }
.mbal-refresh.spin svg { animation: mbal-spin 0.8s linear infinite; }
@keyframes mbal-spin { to { transform: rotate(360deg); } }
.model-group-empty { font-size: 12px; color: var(--gray-light); padding: 12px 4px 2px; text-align: center; }
.model-group-badge { font-size: 11px; color: var(--gray); background: var(--surface); border-radius: 9px; padding: 1px 7px; flex-shrink: 0; }
/* 待重启横幅:模型池列表顶部常驻(配置已落盘但未生效时展示) */
.restart-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff8e6; border: 1px solid #f2dfae; border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; font-size: 13px; color: #7a5b00; }
.restart-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.restart-bar .primary-btn { flex: none; width: auto; padding: 7px 16px; font-size: 13px; white-space: nowrap; }
/* 每 Key 一行余额:左脱敏 key、右余额+刷新 */
.mbal-row { display: flex; align-items: center; gap: 8px; padding: 8px 4px 0; font-size: 12.5px; color: #556; }
.mbal-row:first-child { padding-top: 10px; }
.mbal-key { font-size: 11.5px; color: var(--gray); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mbal-val { margin-left: auto; flex-shrink: 0; }
.model-card { background: #fafbfd; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 10px 0 0; cursor: pointer; }
.model-card:last-child { margin-bottom: 2px; }
.model-card-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
/* 名字过长时省略号收尾(原 flex-shrink:0 会把长模型名撑出卡片) */
.model-card-name { font-weight: 600; font-size: 15px; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.model-card-name:active { opacity: 0.55; }
.model-card-meta { font-size: 12px; color: var(--gray); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-card-state { font-size: 11px; padding: 2px 8px; border-radius: 9px; flex-shrink: 0; }
.model-card-state.idle { background: #e3f2e6; color: #217a34; }
.model-card-state.busy { background: #fdecea; color: #b3382c; }
.model-card-state.pending { background: #fff4dc; color: #a06a00; }
.model-card-state.off { background: var(--surface); color: var(--gray); }
/* MCP 页分段标题:内置服务 / 其它服务 */
.mcp-sec-title { margin: 16px 4px 0; font-size: 12.5px; font-weight: 600; color: var(--gray); }
.mcp-list > .mcp-sec-title:first-child { margin-top: 10px; }
/* 禁用态卡片:背景转灰、名称/token 区淡化,开关保持正常亮度可点 */
.model-card.off { background: #f5f6f8; }
.model-card.off .model-card-name, .model-card.off .cfg-kv { opacity: 0.5; }
/* 启用/禁用小开关:卡片头部最右侧;勾选=启用(蓝),取消=禁用(灰) */
.model-en-sw { position: relative; flex-shrink: 0; width: 34px; height: 20px; display: inline-block; }
.model-en-sw input { position: absolute; left: 0; top: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.model-en-sw .sw-track { position: absolute; left: 0; top: 0; right: 0; bottom: 0; background: var(--gray-light); border-radius: 999px; transition: background .15s; }
.model-en-sw .sw-track::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.model-en-sw input:checked + .sw-track { background: var(--active); }
.model-en-sw input:checked + .sw-track::after { transform: translateX(14px); }
/* ---------- 平台编辑/新增弹窗(模型池共用) ----------
注:选择器均带 .modal 前缀提权——.modal input{width:100%}(0,1,1) 会盖过
单类(0,1,0)与同权但位置靠前的规则,导致行内输入框撑出卡片。 */
.modal.modal-wide { max-width: 480px; }
/* 三段分区:平台字段 / Keys / 模型,用虚线分隔 + 留白,避免挤在一起 */
.modal .mpe-sec { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--border); }
.modal .mpe-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--ink); }
/* 标题右侧的说明(如内置服务的 desc):跟 flex 靠右,去掉 .cfg-note 的上边距;min-width 让它在窄屏可折行 */
.modal .mpe-sec-head .cfg-note { margin: 0; text-align: right; min-width: 0; font-weight: 400; }
.modal .mpe-foot { margin-top: 18px; }
.modal .mpe-sec-head .ghost-btn.sm { flex: none; padding: 4px 12px; font-size: 12.5px; border-radius: 8px; }
.modal .mpe-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.modal .mpe-row input { width: auto; margin-bottom: 0; padding: 8px 10px; font-size: 13px; }
.modal .mpe-grow { flex: 1; min-width: 0; }
/* 模型子卡片:上行 id+删除,下行 vision/enable 勾选 */
.modal .mpe-mcard { border: 1px solid var(--border); border-radius: 10px; padding: 9px 10px; margin-bottom: 8px; background: #fafbfd; }
.modal .mpe-mcard .mpe-row { margin-bottom: 0; }
.modal .mpe-cks { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
/* 单行设置项:左标签 / 右控件(与上面 header 那排同一种「一左一右」的节奏)
选择器带 .modal 前缀是为了压过 .modal input{width:100%},否则输入框会撑满整行。 */
.modal .mpe-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 12.5px; color: var(--gray); }
.modal .mpe-line:last-child { margin-bottom: 0; }
.modal .mpe-line > span { flex: none; white-space: nowrap; }
.modal .mpe-line input { flex: 1; min-width: 0; margin: 0; }
.modal .mpe-line select { width: auto; min-width: 180px; margin: 0; }
/* 预设字段:一行(可选带说明)作为一个整体留间距 */
.modal .mpe-item { margin-bottom: 10px; }
.modal .mpe-item:last-child { margin-bottom: 0; }
.modal .mpe-item .mpe-line { margin-bottom: 0; }
.modal .mpe-item .cfg-note { margin-top: 4px; text-align: right; }
/* ms 作为输入框内的后缀:定位在框内右侧,pointer-events:none 保证点击穿给输入框 */
.modal .mpe-unit { position: relative; flex: none; width: 118px; }
.modal .mpe-unit input { width: 100%; margin: 0; padding: 8px 30px 8px 10px; }
.modal .mpe-unit i { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 11.5px; color: var(--gray-light); pointer-events: none; }
/* 预设模式下 name 是契约值(只读),压暗以区别于可编辑输入框 */
.modal input[readonly] { background: #f1f3f7; color: var(--gray); }
.modal .mpe-ck { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--gray); }
.modal .mpe-ck input { width: 15px; height: 15px; padding: 0; margin: 0; border: none; background: none; accent-color: var(--active); cursor: pointer; }
.modal .mpe-del { flex: none; border: none; background: none; margin: 0; padding: 2px 7px; cursor: pointer; color: var(--gray-light); font-size: 18px; line-height: 1.2; }
.modal .mpe-del:active { color: #c0392b; }
/* 平台预设:新增平台时点一下填好 url/类型,模型卡带上该平台的参数缺省 */
.modal .mpe-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.modal .mpe-chip { flex: none; width: auto; padding: 5px 12px; border: 1px solid #dde1ea; border-radius: 999px; background: #fff; color: var(--gray); font-size: 12.5px; line-height: 1.4; }
.modal .mpe-chip:active { background: var(--surface); }
.modal .mpe-chip.on { border-color: var(--active); color: var(--active); background: var(--active-light); }
/* 模型卡「高级」折叠区:沿用左标签/右控件;JSON 用等宽小字,高度可拖 */
.modal .mpe-adv-btn { margin-left: auto; flex: none; padding: 0; font-size: 12px; color: var(--gray); }
.modal .mpe-adv { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.modal .mpe-adv .mpe-line { margin-bottom: 8px; }
.modal .mpe-adv .mpe-line:last-child { margin-bottom: 0; }
.modal .mpe-line textarea {
flex: 1; min-width: 0; margin: 0; height: 46px; padding: 6px 9px;
border: 1px solid #dde1ea; border-radius: 10px; background: #fff; color: var(--ink);
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.45;
resize: vertical;
}
.modal .mpe-line textarea:focus { border-color: var(--active); }
/* ---------- 编辑器页(config.yml 原文 / 技能文件) ---------- */
.set-editor {
flex: 1; min-height: 0; display: flex; flex-direction: column;
padding: 10px 12px calc(12px + var(--sab));
}
.set-editor textarea {
flex: 1; width: 100%; resize: none; background: #fff; color: var(--ink);
border: 1px solid #dde1ea; border-radius: 10px; padding: 10px 12px;
font-size: 12.5px; line-height: 1.55; tab-size: 4;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
white-space: pre; overflow: auto;
}
/* ---------- 按钮与弹窗(搬自 style.css,按 v2 调性去渐变) ---------- */
.primary-btn {
width: 100%; background: var(--active); color: #fff; border: none; border-radius: 10px;
padding: 11px; font-size: 15px; font-weight: 600; cursor: pointer;
}
.primary-btn:active { opacity: 0.9; }
.primary-btn:disabled { opacity: 0.5; cursor: default; }
.ghost-btn {
flex:1; background: var(--surface); color: #445; border: 1px solid #dde; border-radius: 10px;
padding: 11px; font-size: 15px; cursor: pointer;
}
.ghost-btn:active { background: #e8eaf0; }
.ghost-btn.danger { background: #fdf3f2; color: #c0392b; border-color: #eac2bd; }
.btn-row { display: flex; gap: 10px; }
.btn-row .primary-btn { flex: 1; }
.modal-overlay {
/* bottom 让出键盘:弹窗内的输入框(定时任务提示词等)不被软键盘压住 */
position: fixed; inset: 0; bottom: var(--kb); background: rgba(20, 25, 50, 0.45);
display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
background: var(--page); border-radius: 14px; padding: 20px; width: 84%; max-width: 360px;
position: relative; max-height: 88%; overflow-y: auto;
}
/* 移动端:表单是「左标签 + 右输入」双列,84% 宽度下输入框太窄 */
@media (max-width: 639px) {
#mcp-edit-modal .modal, #model-edit-modal .modal { width: calc(100% - 24px); padding: 18px 14px; }
}
.modal h3 { margin-bottom: 12px; font-size: 16px; }
.modal input {
width: 100%; border: 1px solid #dde1ea; border-radius: 10px;
padding: 10px 12px; font-size: 15px; margin-bottom: 10px; background: #fff; color: var(--ink);
}
.modal input:focus { border-color: var(--active); }
.modal input:disabled { background: var(--surface); color: var(--gray-light); }
.modal select {
width: 100%; border: 1px solid #dde1ea; border-radius: 10px;
padding: 10px 12px; font-size: 15px; margin-bottom: 10px;
background: #fff; color: var(--ink); appearance: none; -webkit-appearance: none;
}
.modal select:focus { border-color: var(--active); }
.modal-close-btn {
position: absolute; right: 10px; top: 10px;
background: none; border: none; cursor: pointer; color: var(--gray-light);
width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
}
.modal-close-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.modal .modal-text { font-size: 14px; color: #556; margin-bottom: 12px; white-space: pre-wrap; }
.modal .del-dir { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--ink); margin-bottom: 14px; cursor: pointer; }
.modal .del-dir input { width: 16px; height: 16px; padding: 0; margin: 0; flex: none; accent-color: var(--active); }
/* 模型选择弹窗(顶部动作区「切换模型」/欢迎页头像入口) */
.msw-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.msw-titles h3 { margin: 0 0 4px 0; font-size: 16px; }
.msw-sub { font-size: 13px; color: var(--gray-light); margin: 0; }
.msw-list { max-height: 420px; overflow-y: auto; margin: 0 -4px; padding-right: 4px; }
.msw-footer { text-align: center; font-size: 13px; color: var(--gray-light); margin-top: 12px; }
.msw-group { margin-bottom: 16px; }
.msw-group-header { display: flex; align-items: center; gap: 8px; padding: 6px 4px; font-size: 13px; font-weight: 600; color: var(--ink); }
.msw-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.msw-group-keys { font-size: 11px; color: var(--gray-light); margin-left: auto; background: var(--surface); border-radius: 10px; padding: 1px 6px; }
.msw-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; cursor: pointer; transition: background 0.15s; }
.msw-item:hover:not(.disabled) { background: var(--surface); }
.msw-item.disabled { opacity: 0.45; cursor: not-allowed; }
.msw-item.selected { background: color-mix(in srgb, var(--active) 8%, transparent); }
.msw-radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #dde1ea; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: border-color 0.15s, background 0.15s; }
.msw-item.selected .msw-radio { border-color: var(--active); background: var(--active); }
.msw-item.selected .msw-radio::after { content: '✓'; color: #fff; font-size: 11px; font-weight: 700; }
.msw-info { flex: 1; min-width: 0; }
.msw-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msw-busy { font-size: 12px; font-weight: 400; color: var(--gray-light); }
.msw-tags { display: flex; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.msw-tag { font-size: 11px; padding: 1px 6px; border-radius: 4px; }
.msw-tag.vision { background: #dbeafe; color: #1d4ed8; }
.msw-tag.thinking { background: #fef3c7; color: #92400e; }
/* ================= 桌面端布局(≥960px) =================
历史侧边栏常驻左侧(由 body.drawer-open 控制展开/折叠,不用遮罩);
对话区占满右侧剩余宽度,内容限宽并水平居中。移动端(<960px)不受影响。 */
@media (min-width: 960px) {
:root { --sidebar-w: 280px; }
/* 会话区占满侧栏右侧;折叠时占满整个窗口。
宽度显式算出来(calc(100% - 侧栏)),不靠 max-width/margin auto 推导,
保证窗口任意缩放都实时跟着缩,内容不会被顶出视口。 */
#app {
max-width: none;
width: calc(100% - var(--sidebar-w));
margin: 0 0 0 var(--sidebar-w);
transition: width .25s ease, margin-left .25s ease;
}
body:not(.drawer-open) #app { width: 100%; margin-left: 0; }
/* 侧边栏:常驻左列,轻边框与页面区隔 */
#drawer { width: var(--sidebar-w); box-shadow: none; border-right: 1px solid var(--border); }
/* 桌面端开合不走遮罩 */
#scrim { display: none !important; }
/* 对话内容限宽居中 */
#chat-view { padding: 16px 20px 8px; }
#chat-view > * { width: 100%; max-width: 860px; margin-left: auto; margin-right: auto; }
/* 输入区与会话列同宽、居中 */
footer { padding-left: 20px; padding-right: 20px; }
footer > * { max-width: 860px; margin-left: auto; margin-right: auto; }
/* toast 相对会话区(而非整个视口)居中 */
body.drawer-open #toast { left: calc(50% + var(--sidebar-w) / 2); }
}
/* ---------- 文档预览分栏(桌面端≥960px;紧贴左侧文件树,移动端 office 走全屏 #fs-viewer,本栏隐藏) ---------- */
#pv-pane { display: none; }
@media (min-width: 960px) {
body.pv-open #pv-pane {
display: flex; flex-direction: column;
position: fixed; top: 0; left: 0; right: auto; bottom: 0;
width: var(--pv-w, min(50vw, 900px)); min-width: 320px;
background: var(--page); border-right: 1px solid var(--border);
z-index: 55;
}
/* 侧栏展开时预览紧贴文件树右侧:文件树 | 预览 | 会话(IDE 习惯,点文件后内容就在旁边) */
body.pv-open.drawer-open #pv-pane { left: var(--sidebar-w); }
body.pv-open.pv-max #pv-pane { left: 0; right: 0; width: auto; border-right: none; z-index: 120; }
/* 挤压式分栏:会话列往右让位 */
body.pv-open #app { width: calc(100% - var(--pv-w, min(50vw, 900px))); margin-left: var(--pv-w, min(50vw, 900px)); }
body.pv-open.drawer-open #app {
width: calc(100% - var(--sidebar-w) - var(--pv-w, min(50vw, 900px)));
margin-left: calc(var(--sidebar-w) + var(--pv-w, min(50vw, 900px)));
}
body.pv-open.pv-max #app { width: 100%; margin-left: 0; }
/* toast 相对会话列居中(预览开着时会话列被挤到右边) */
body.pv-open.drawer-open #toast { left: calc(50% + (var(--sidebar-w) + var(--pv-w, min(50vw, 900px))) / 2); }
}
/* 头部高度定死:预览栏里有地址条(内容更高)、文件树只有 32px 图标钮,
靠内容撑会让两栏的头部差几像素、下边框对不齐。
49 = 32 控件 + 上下各 8 内边距 + 1 下边框(全局 box-sizing:border-box)。 */
.pv-head { flex: none; position: relative; display: flex; align-items: center; gap: 8px; height: 49px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--border); background: var(--drawer-bg); }
/* 地址条胶囊:路径 input + 内嵌动作钮,模拟浏览器地址栏 */
.pv-addr { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid transparent; border-radius: 10px; padding: 2px 2px 2px 4px; }
.pv-addr:focus-within { border-color: var(--border); background: var(--page); }
.pv-title { flex: 1; min-width: 0; padding: 5px 6px; font-size: 13px; font-weight: 600; cursor: text; }
.pv-addr .icon-btn { flex: none; width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; color: var(--gray); }
.pv-addr .icon-btn:hover { color: var(--ink); }
.pv-addr .icon-btn:active { background: rgba(0, 0, 0, .06); }
/* 地址条补全下拉:挂在头部下方,候选只显示末段,目录候选带尾斜杠 */
.pv-suggest { position: absolute; top: calc(100% + 2px); left: 12px; z-index: 8; min-width: 200px; max-width: 420px; max-height: 240px; overflow: auto; background: var(--page); border: 1px solid var(--border); border-radius: 10px; padding: 4px; box-shadow: 0 10px 28px rgba(0, 0, 0, .14); }
.pv-suggest .it { padding: 6px 9px; font-size: 12.5px; border-radius: 7px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.pv-suggest .it:hover, .pv-suggest .it.sel { background: var(--surface); }
.pv-actions { flex: none; display: flex; align-items: center; gap: 10px; margin-left: 12px; padding-right: 2px; }
.pv-actions .icon-btn { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--ink); }
.pv-actions .icon-btn:active { background: var(--surface); }
.pv-body { flex: 1; min-height: 0; position: relative; overflow: auto; display: flex; flex-direction: column; background: #fff; }
.pv-frame { flex: 1; width: 100%; height: 100%; border: 0; background: #fff; }
.pv-doc { width: 100%; max-width: 860px; margin: 0 auto; padding: 16px 20px 40px; }
.pv-img { margin: auto; max-width: 92%; max-height: 92%; object-fit: contain; cursor: zoom-in; }
.pv-err { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 32px; text-align: center; color: var(--gray-light); font-size: 13px; line-height: 1.7; }
.pv-err button { border: 0; background: var(--active); color: #fff; border-radius: 8px; padding: 8px 20px; font-size: 13px; cursor: pointer; }
.pv-err button:hover { opacity: .88; }
.pv-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #fff; }
.pv-loading::after { content: ''; width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--active); border-radius: 50%; animation: pvspin 0.8s linear infinite; }
@keyframes pvspin { to { transform: rotate(360deg); } }
/* ---------- preview pane v2: drag resize / info card / plain text ---------- */
/* 拖拽调宽的手柄:预览在左半侧,所以手柄在它的右缘(与会话列的分界) */
.pv-resizer { position: absolute; right: 0; top: 0; bottom: 0; width: 6px; cursor: col-resize; z-index: 6; touch-action: none; }
.pv-resizer:hover, .pv-resizer:active { background: var(--active); opacity: .3; }
body.pv-resizing { cursor: col-resize; user-select: none; }
body.pv-resizing #pv-pane iframe { pointer-events: none; }
.pv-plain { width: 100%; }
.pv-pre { width: 100%; max-width: 920px; margin: 0 auto; padding: 14px 20px 40px; font: 12.5px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
.pv-trunc { max-width: 880px; margin: 12px auto 0; padding: 0 20px; font-size: 12px; color: var(--gray-light); }
.pv-loading.inline { position: static; background: transparent; padding: 56px 0; }
.pv-none { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 44px 24px; text-align: center; }
.pv-none svg { width: 54px; height: 54px; color: var(--gray-light); opacity: .8; }
.pv-none .nm { font-size: 15px; font-weight: 600; word-break: break-all; }
.pv-none .meta { font-size: 12px; color: var(--gray-light); }
.pv-none .hint { font-size: 13px; color: var(--gray-light); line-height: 1.7; max-width: 420px; }
.pv-none button { margin-top: 8px; border: 0; background: var(--active); color: #fff; border-radius: 8px; padding: 9px 22px; font-size: 13px; cursor: pointer; }
.pv-none button:hover { opacity: .88; }
/* 通用 UI 卡片:SSE ui_card → 聊天流可点卡片(动作注册表驱动,见 preview.js) */
.ui-card { display: flex; align-items: center; gap: 10px; max-width: 420px; margin: 8px 0; padding: 10px 14px;
border: 1px solid var(--border); border-radius: 12px; background: var(--page); cursor: pointer; }
.ui-card:hover { border-color: var(--active); background: var(--active-light); }
.ui-card .ico { color: var(--gray-light); flex-shrink: 0; }
.ui-card .ico svg { width: 22px; height: 22px; display: block; }
.ui-card .main { flex: 1; min-width: 0; }
.ui-card .name { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-card .sub { display: block; font-size: 12px; color: var(--gray); }
.ui-card .go { font-size: 13px; color: var(--active); white-space: nowrap; }
/* ================= 顶部动作区(切换模型 / 定时任务 / 压缩上下文 / 新建会话) =================
桌面端平铺 4 个圆形图标(与 header 左侧历史钮同款 .header .icon-btn);
移动端收进右上角「更多」下拉菜单,菜单项与图标共用 data-act,事件统一由 sessions.js 分发。 */
.header-actions { flex: none; position: relative; display: flex; align-items: center; gap: 2px; }
.ha-icons { display: flex; align-items: center; gap: 2px; }
.header-actions .icon-btn:disabled { opacity: .35; cursor: default; }
/* 「更多」钮:窄屏才出现(.header .icon-btn 已给尺寸/圆形,这里只控制显隐) */
.header .ha-more { display: none; }
/* 下拉菜单:锚在动作区右下,轻边框 + 浮层阴影,风格与 .pv-suggest 一致 */
.ha-menu {
position: absolute; top: calc(100% + 8px); right: 0; z-index: 70;
min-width: 202px; max-width: min(78vw, 280px);
display: flex; flex-direction: column; gap: 2px;
padding: 6px; background: var(--page); border: 1px solid var(--border);
border-radius: 14px; box-shadow: 0 12px 32px rgba(15, 17, 21, .16);
animation: ha-menu-in .14s ease-out;
}
@keyframes ha-menu-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.ha-item {
display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px;
padding: 0 10px; border-radius: 10px; font-size: 14px; color: var(--ink); text-align: left;
}
.ha-item .ic { width: 18px; height: 18px; color: var(--gray); }
.ha-item:active { background: var(--surface); }
.ha-item:disabled { opacity: .38; cursor: default; }
.ha-item-main { flex: 1 1 auto; min-width: 0; white-space: nowrap; }
/* 副标题(当前模型名 / 定时任务频次):过长省略号截断,不把菜单撑宽 */
.ha-item-sub {
flex: 0 1 auto; min-width: 0; max-width: 54%;
font-size: 12px; color: var(--gray);
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (hover: hover) and (pointer: fine) {
.ha-item:hover { background: var(--surface); }
.header-actions .ha-btn:hover { background: var(--surface); }
}
@media (max-width: 639px) {
.ha-icons { display: none; }
/* 「更多」钮:移动端扩到 44px 触控热区(图标尺寸不变) */
.header .ha-more { display: flex; width: 44px; height: 44px; }
}
/* 宽屏下下拉菜单不参与布局(窗口从窄拖宽时残留的展开态也不会挡住内容) */
@media (min-width: 640px) {
.header .ha-menu { display: none; }
}
/* ---------- 桌面端(≥640px):标题左对齐,属性区紧随标题,右侧只留「新建会话」 ----------
作用域限定在 #chat-header:设置页也用 .header/.header-center,不能跟着左对齐。 */
@media (min-width: 640px) {
/* margin-left:标题与左侧「历史/侧边栏」钮拉开距离,避免文字贴上按钮 */
#chat-header .header-center { flex: 0 1 auto; justify-content: flex-start; text-align: left; margin-left: 10px; }
#chat-header .header-title { justify-content: flex-start; }
#chat-header .header-meta { display: flex; }
#chat-header .header-actions { margin-left: auto; }
}
/* 会话属性区(默认隐藏;桌面端才展开):模型名 / 定时任务 / 压缩 */
.header-meta { display: none; flex: none; align-items: center; gap: 4px; min-width: 0; }
.hdr-chip {
position: relative; display: inline-flex; align-items: center; gap: 5px;
height: 26px; padding: 0 9px; border-radius: 10px;
font-size: 12.5px; color: var(--gray); white-space: nowrap;
}
.hdr-chip .ic { width: 14px; height: 14px; }
.hdr-chip .hdr-label { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdr-chip:active { opacity: .75; }
.hdr-chip:disabled { opacity: .38; cursor: default; }
/* hover/按下态的 opacity<1 会给胶囊自己创建层叠上下文(把气泡内部的 z-index 关在里面);
而 main 里带 opacity 的 .msg-archived 也是层叠上下文且 DOM 在 header 之后,
会盖住气泡。这里给交互态整体抬一层,保证气泡始终在消息内容之上。 */
.hdr-chip:hover, .hdr-chip:focus-visible, .hdr-chip:active { z-index: 10; }
/* 模型位兼做会话状态指示:浅底 + 同色文字 + 圆点(做法同旧 schedule-bar 的「浅底同色字」,
色值取自旧状态胶囊;active 的圆点做呼吸动画,代替已移除的 phase-bar 转圈) */
.hdr-model {
max-width: 200px;
padding: 0 13px; /* 带状态底色的胶囊,左右留白比纯文字位稍大,文字不贴边 */
background: #eceff5; color: #5c6674;
}
.hdr-model::before {
content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%;
background: currentColor;
}
.hdr-model .hdr-label { border-bottom: 1px dashed currentColor; }
.hdr-model[data-status="active"] { background: #e3f2e6; color: #1c7a2e; }
.hdr-model[data-status="active"]::before { animation: hdr-pulse 1.2s ease-in-out infinite; }
.hdr-model[data-status="held"] { background: #fff4dc; color: #8a6400; }
.hdr-model[data-status="cancelled"] { background: #fdecea; color: #b3382c; }
.hdr-model[data-status="completed"] { background: #f4f5f8; color: #5c6674; }
@keyframes hdr-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
/* 定时任务:无任务=只留灰色时钟图标(点击新建);有任务=紫色频次文字(点击编辑,配色同原 schedule-bar) */
.hdr-sched { max-width: 190px; }
.hdr-sched:not(.on) { padding: 0 7px; } /* 纯图标时收紧内边距,不显得空 */
/* 图标尺寸/描边对齐压缩键的圆柱图标(.hdr-compact 也是 19px / 1.6 描边) */
#header-meta .hdr-sched .ic { width: 19px; height: 19px; stroke-width: 1.7; }
.hdr-sched.on { background: #f8f5ff; color: #5f3dc4; }
/* 压缩:沿用原状态栏的蓝色圆柱图标 */
#header-meta .hdr-compact { color: var(--active); }
#header-meta .hdr-compact .ic { width: 19px; height: 19px; }
#header-meta .icon-btn:disabled { opacity: .35; cursor: default; }
/* 桌面图标/文字位的悬停提示:原生 title 有 ~1s 延迟,改用 CSS 气泡(hover / 键盘焦点立即出现) */
.ha-btn, .hdr-chip { position: relative; }
@media (hover: hover) and (pointer: fine) {
.ha-btn::after, .hdr-chip::after {
content: attr(data-tip);
position: absolute; top: calc(100% + 6px); left: 50%;
transform: translateX(-50%) translateY(-2px);
max-width: 240px; overflow: hidden; text-overflow: ellipsis;
padding: 5px 9px; border-radius: 8px;
background: rgba(15, 17, 21, .9); color: #fff;
font-size: 12px; line-height: 1.2; white-space: nowrap;
opacity: 0; pointer-events: none; z-index: 80;
transition: opacity .12s ease, transform .12s ease;
}
.ha-btn:hover::after, .ha-btn:focus-visible::after,
.hdr-chip:hover::after, .hdr-chip:focus-visible::after {
opacity: 1; transform: translateX(-50%) translateY(0);
}
/* 最右侧「新建会话」气泡改右对齐,避免被 #app 的 overflow:hidden 裁掉 */
.ha-icons .ha-btn:last-child::after { left: auto; right: 0; transform: translateY(-2px); }
.ha-icons .ha-btn:last-child:hover::after,
.ha-icons .ha-btn:last-child:focus-visible::after { transform: translateY(0); }
/* 属性文字位的悬停反馈:模型位已有状态底色,只降透明度不改色 */
.hdr-model:hover { opacity: .82; }
.hdr-sched:hover { background: var(--surface); }
.hdr-sched.on:hover { background: #f1ecff; color: #4c2fa8; }
#header-meta .hdr-compact:hover { background: var(--surface); }
.header-actions .ha-btn:hover { background: var(--surface); }
/* 模型位的提示带「状态 + 模型 id」,比另外两个稍长,宽度上限放宽一档 */
#header-meta .hdr-model::after { max-width: 300px; }
}
/* 发送键 = 发送⇄停止:生成中只换图标(白色方块),底色保持 --active 不变,输入区不跳动 */
.send-btn .stop-sq { display: none; width: 11px; height: 11px; border-radius: 2px; background: #fff; }
.send-btn[data-state="stop"] > svg { display: none; }
.send-btn[data-state="stop"] .stop-sq { display: block; }
/* ================= 拖拽上传提示层 ================= */
/* window 级 dragenter/dragover 期间显示。pointer-events:none 保证遮罩不抢 drop 目标,
drop 仍由 window 监听器接管(见 js/files.js)。
视觉沿用站内弹窗语言:与 .modal-overlay 同一底色,白底卡片 + 16px 圆角 + 投影,
图标用品牌蓝的浅色圆底,虚线框只作为「可投放」的轻提示。 */
#drop-overlay {
position: fixed; inset: 0; z-index: 190;
display: flex; align-items: center; justify-content: center;
background: rgba(20, 25, 50, 0.45);
pointer-events: none;
animation: drop-overlay-in .14s ease-out;
}
#drop-overlay .drop-hint {
display: flex; flex-direction: column; align-items: center; gap: 12px;
padding: 24px 36px;
max-width: 80vw; text-align: center;
border: 1.5px dashed rgba(57, 100, 254, 0.32);
border-radius: 16px;
background: var(--page); color: var(--ink);
font-size: 15px; font-weight: 600;
box-shadow: 0 12px 32px rgba(15, 17, 21, 0.18);
}
#drop-overlay .drop-hint .ic {
width: 50px; height: 50px; padding: 12px;
border-radius: 50%;
background: var(--active-soft); color: var(--active);
}
@keyframes drop-overlay-in { from { opacity: 0; } to { opacity: 1; } }
/* ================= 待发送条幅(运行中排队 / 干预 / 立即发送) ================= */
/* 输入卡上方一行小条:正文单行省略 + 动作按钮。多条时逐条堆叠,每条仍是一行。
配色刻意与「编辑提示条」的蓝色区分:排队是“稍后执行”的提示态,不是输入态。 */
.send-queue { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.sq-item {
display: flex; align-items: center; gap: 6px;
padding: 5px 5px 5px 11px;
border-radius: 12px; background: #fff4dc; color: #a06a00; font-size: 12.5px;
}
.sq-item .sq-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq-item .sq-tag { flex: none; font-size: 11.5px; opacity: .75; }
.sq-item button {
flex: none; padding: 2px 9px; border-radius: 8px;
font-size: 12.5px; font-weight: 600; color: inherit; background: none; border: none;
}
.sq-item button:active { background: rgba(160, 106, 0, 0.12); }
.sq-item button:disabled { opacity: .45; }
.sq-item .sq-x { padding: 2px 7px; font-weight: 500; }
/* 已升级为「干预/立即发送」但还没到边界:按钮置灰,显示“等待当前步骤” */
.sq-item.sq-busy button:not(.sq-x) { opacity: .45; }
/* ================= 编辑已发送消息提示条 ================= */
/* 覆盖式重发:输入框内部的浅蓝提示条(嵌在 .input-shell 顶端,间距由 shell 的 gap 提供)。 */
.edit-bar {
display: flex; align-items: center; gap: 8px;
padding: 6px 6px 6px 12px;
border-radius: 12px; background: var(--active-soft);
color: var(--active); font-size: 12.5px;
}
.edit-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edit-bar button { flex: none; padding: 2px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--active); }
.edit-bar button:active { background: rgba(57, 100, 254, 0.12); }