/* ================= 设计变量 ================= */ :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; } * { 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 死守 height:100%, 于是竖横向滚动条一起出现、缩窗口页面不动。 */ 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 { height: 100%; 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; padding: 10px 12px; min-height: 56px; } .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; } /* ---------- 对话状态:对话内容区 ---------- */ /* 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 { flex: none; padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0px)); 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 { 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); } /* 文件面板展开时高亮 */ /* 发送按钮:蓝底白向上箭头 */ .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: env(safe-area-inset-bottom, 0px); 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 + env(safe-area-inset-bottom, 0px)); } .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 { position: fixed; top: 0; bottom: 0; left: 0; z-index: 50; 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; } /* 会话分组表头(按今天/昨天分组):滚动时吸顶,下一个 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 区,不吃标题宽度; 颜色与 schedule-bar 紫色体系呼应,区别于状态色(蓝/绿/黄) */ .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; width: 100%; } /* 桌面端 hover 删除按钮:鼠标经过会话行时右侧显示,点击弹删除确认 modal (触屏设备不显示,移动端删除仍走左滑手势) */ .conv-del { position: absolute; right: 8px; 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; } @media (hover: hover) and (pointer: fine) { .conv-wrap:hover .conv-item:not(.active) { background: #f5f6f8; } .conv-wrap:hover .conv-del { display: flex; } .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-user { flex: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); } .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 右下角导航浮动图标) ================= */ .scroll-bottom-btn { position: absolute; right: 14px; bottom: 140px; 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); } } /* ================= 会话状态栏(phase-bar,搬自 style.css) ================= */ .phase-bar { flex: none; display: flex; align-items: center; gap: 2px; padding: 6px 12px; background: var(--page); border-bottom: 1px solid var(--border); } /* 状态栏随会话状态染色:排队=淡蓝、执行中=绿底、保持中=黄底; 完成=中性浅灰、终止=淡红底,均与顶部白底标题栏区分 */ .phase-bar.queued { background: #f1f4ff; border-bottom-color: #dfe4fb; } .phase-bar.active { background: #f0f9f2; border-bottom-color: #cde8d3; } .phase-bar.held { background: #fffbe8; border-bottom-color: #f5e3b3; } .phase-bar.completed { background: #f4f5f8; border-bottom-color: #e3e6ed; } .phase-bar.cancelled { background: #fdf3f2; border-bottom-color: #f5d7d3; } .status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 10px; border-radius: 10px; background: #eceff5; color: #5c6674; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .status-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; } .status-pill.active { background: #e3f2e6; color: #1c7a2e; } .status-pill.active::before { animation: pill-pulse 1.2s ease-in-out infinite; } .status-pill.held { background: #fff4dc; color: #8a6400; } .status-pill.queued { background: #e9edff; color: var(--active); } .status-pill.cancelled { background: #fdecea; color: #b3382c; } /* 状态胶囊里的模型名 = 「更换模型」入口(held/cancelled 下可点,与独立「选择模型」同一弹窗,见 sessions.js updatePhaseBar) */ .status-pill .pill-model { cursor: pointer; border-bottom: 1px dashed currentColor; } .status-pill .pill-model:hover { opacity: .7; } @keyframes pill-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } } /* 微信绑定内联卡(账户页):登录码用服务端 SVG 内联渲染(非 ,无坏图帧);未就绪时占位不跳高 */ .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; } .stop-link { background: none; border: none; cursor: pointer; flex: none; color: #c33; font-size: 12px; padding: 4px 6px; } .stop-link.muted { color: #8a6400; } .stop-link:active { opacity: 0.6; } /* 「清空」钮推到状态栏最右 */ #clear-msg-btn { margin-left: auto; color: #b3382c; } /* ================= 工具调用卡片(样式/交互同步 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-viewer-img { max-width: 92vw; max-height: 88vh; touch-action: none; cursor: grab; user-select: none; -webkit-user-drag: 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-close { position: fixed; top: 12px; right: 14px; z-index: 131; width: 34px; height: 34px; border: none; border-radius: 50%; background: rgba(255,255,255,0.18); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; } /* 源码切换 eye 钮:与关闭钮同款,居其左;仅当前内容有源文本时显示(setFsSource 控显隐) */ .fs-eye { right: 58px; display: flex; align-items: center; justify-content: center; } .fs-eye svg { width: 17px; height: 17px; } .fs-eye.on { background: rgba(255,255,255,0.85); color: #333; } /* 源码面板:与 #fs-body 互斥显示(toggleFsSrc 切换);不参与双指缩放逻辑 */ .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 + env(safe-area-inset-bottom, 0px)); } .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); } /* ---------- 抽屉底部用户区:整行可点 ---------- */ .drawer-user { cursor: pointer; } .drawer-user:active { background: var(--surface); } /* ---------- 通用白卡与设置表单(搬自 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); } /* 禁用态卡片:背景转灰、名称/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); } .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; } /* 超时(ms)与「启用」同排。数字框单独成类,不吃 .mpe-ck input 那套 15px 无边框样式(那是给 checkbox 的); 选择器带 .modal 前缀是为了压过 .modal input{width:100%},否则会被撑满整行。 */ .modal .mpe-num { display: flex; align-items: center; gap: 5px; flex: none; font-size: 12.5px; color: var(--gray); } .modal .mpe-num input { width: 92px; padding: 5px 8px; margin: 0; font-size: 13px; border: 1px solid #dde1ea; border-radius: 8px; background: #fff; color: var(--ink); } .modal .mpe-num input:focus { border-color: var(--active); } .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; } /* ---------- 编辑器页(config.yml 原文 / 技能文件) ---------- */ .set-editor { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); } .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 { position: fixed; inset: 0; 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; } .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); } /* 模型选择弹窗(会话页 phase-bar「选择模型」入口) */ .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 32px 8px; } #chat-view > * { width: 100%; max-width: 860px; margin-left: auto; margin-right: auto; } /* 输入区与会话列同宽、居中 */ footer { padding-left: 32px; padding-right: 32px; } footer > * { max-width: 860px; margin-left: auto; margin-right: auto; } /* toast 相对会话区(而非整个视口)居中 */ body.drawer-open #toast { left: calc(50% + var(--sidebar-w) / 2); } }