/* ================= 设计变量 ================= */ :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)); /* 主题色板(亮色 = 原值):暗色主题只覆盖这些变量,不改任何渲染规则 */ --bg-fff: #fff; --fg-c0392b: #c0392b; --fg-fff: #fff; --bg-fdecea: #fdecea; --bd-fff: #fff; --bd-dde1ea: #dde1ea; --bg-fdf3f2: #fdf3f2; --bg-fafbfd: #fafbfd; --bg-fff4dc: #fff4dc; --fg-556: #556; --bd-c8cee0: #c8cee0; --bg-ddf4ff: #ddf4ff; --bg-e3f2e6: #e3f2e6; --fg-1a7f37: #1a7f37; --fg-223: #223; --fg-2e7d32: #2e7d32; --fg-7f8db0: #7f8db0; --fg-a06a00: #a06a00; --fg-b3382c: #b3382c; --fg-cf222e: #cf222e; --bd-dbe4fb: #dbe4fb; --bd-eac2bd: #eac2bd; --bg-dde0e6: #dde0e6; --bg-f5f6f8: #f5f6f8; --bg-fafbfc: #fafbfc; --bg-ffebe9: #ffebe9; --bg-fff8c5: #fff8c5; --fg-0550ae: #0550ae; --fg-217a34: #217a34; --fg-5c6674: #5c6674; --fg-6b5b2a: #6b5b2a; --fg-9a6700: #9a6700; --fg-a3352a: #a3352a; --fg-b0b6bd: #b0b6bd; --fg-b3a97f: #b3a97f; --fg-d73a49: #d73a49; --bd-d8e0f5: #d8e0f5; --bd-dde: #dde; --bd-e3e6ee: #e3e6ee; --bd-e8b4b0: #e8b4b0; --bd-eadfc4: #eadfc4; --bd-f2c4bd: #f2c4bd; --bd-f2dfae: #f2dfae; --bg-1c7a2e: #1c7a2e; --bg-6b8cff: #6b8cff; --bg-7048e8: #7048e8; --bg-b8860b: #b8860b; --bg-ccffd8: #ccffd8; --bg-dafbe1: #dafbe1; --bg-dbeafe: #dbeafe; --bg-e3ecfe: #e3ecfe; --bg-e6ffec: #e6ffec; --bg-e8eaf0: #e8eaf0; --bg-eceff5: #eceff5; --bg-f1ecff: #f1ecff; --bg-f1f3f7: #f1f3f7; --bg-f3e8ff: #f3e8ff; --bg-f4f5f8: #f4f5f8; --bg-f6f1e3: #f6f1e3; --bg-f7f9ff: #f7f9ff; --bg-f8f5ff: #f8f5ff; --bg-fbf7ee: #fbf7ee; --bg-fbfcff: #fbfcff; --bg-fef3c7: #fef3c7; --bg-ffd7d5: #ffd7d5; --bg-fff8e6: #fff8e6; --fg-005cc5: #005cc5; --fg-032f62: #032f62; --fg-1c7a2e: #1c7a2e; --fg-1d4ed8: #1d4ed8; --fg-24292e: #24292e; --fg-333: #333; --fg-444: #444; --fg-445: #445; --fg-4c2fa8: #4c2fa8; --fg-55492a: #55492a; --fg-5b8def: #5b8def; --fg-5f3dc4: #5f3dc4; --fg-5f6672: #5f6672; --fg-6639ba: #6639ba; --fg-6a737d: #6a737d; --fg-6f42c1: #6f42c1; --fg-7a5b00: #7a5b00; --fg-8a6400: #8a6400; --fg-8a763b: #8a763b; --fg-92400e: #92400e; --fg-e36209: #e36209; --fg-f2994a: #f2994a; --fg-f2b544: #f2b544; } :root[data-theme="dark"] { color-scheme: dark; /* 原生滚动条/输入框/下拉也转暗,否则白控件嵌在暗底里刺眼 */ /* ---- 暗色:只覆盖变量,渲染规则一行不动 ---- */ --active: rgb(88, 166, 255); --ink: #e6edf3; --active-soft: rgba(88, 166, 255, 0.16); --active-light: rgba(56, 139, 253, 0.12); --gray: #8b949e; --gray-light: #6e7681; --surface: #21262d; --page: #0d1117; --drawer-bg: #010409; --border: #30363d; --bg-fff: #161b22; --bg-fdecea: #3c1618; --bg-fdf3f2: #3c1618; --bg-fafbfd: #0d1117; --bg-fff4dc: #3a2d12; --bg-ddf4ff: #0c2d4a; --bg-e3f2e6: #0d2818; --bg-dde0e6: #21262d; --bg-f5f6f8: #0d1117; --bg-fafbfc: #0d1117; --bg-ffebe9: #3c1618; --bg-fff8c5: #3a2d12; --bg-1c7a2e: #238636; --bg-6b8cff: #1f6feb; --bg-7048e8: #6e40c9; --bg-b8860b: #9e6a03; --bg-ccffd8: #1b3a24; --bg-dafbe1: #0d2818; --bg-dbeafe: #0c2d4a; --bg-e3ecfe: #10161f; --bg-e6ffec: #0d2818; --bg-e8eaf0: #21262d; --bg-eceff5: #21262d; --bg-f1ecff: #2a1f3d; --bg-f1f3f7: #0d1117; --bg-f3e8ff: #2a1f3d; --bg-f4f5f8: #0d1117; --bg-f6f1e3: #241c0a; --bg-f7f9ff: #10161f; --bg-f8f5ff: #2a1f3d; --bg-fbf7ee: #332713; --bg-fbfcff: #10161f; --bg-fef3c7: #3a2d12; --bg-ffd7d5: #4a1c1c; --bg-fff8e6: #3a2d12; --fg-c0392b: #ff7b72; --fg-fff: #ffffff; --fg-556: #8b949e; --fg-1a7f37: #3fb950; --fg-223: #c9d1d9; --fg-2e7d32: #3fb950; --fg-7f8db0: #8b949e; --fg-a06a00: #d29922; --fg-b3382c: #ff7b72; --fg-cf222e: #ff7b72; --fg-0550ae: #79c0ff; --fg-217a34: #3fb950; --fg-5c6674: #8b949e; --fg-6b5b2a: #e3b341; --fg-9a6700: #d29922; --fg-a3352a: #ff7b72; --fg-b0b6bd: #6e7681; --fg-b3a97f: #a6976a; --fg-d73a49: #ff7b72; --fg-005cc5: #79c0ff; --fg-032f62: #a5d6ff; --fg-1c7a2e: #3fb950; --fg-1d4ed8: #79c0ff; --fg-24292e: #e6edf3; --fg-333: #c9d1d9; --fg-444: #8b949e; --fg-445: #8b949e; --fg-4c2fa8: #bc8cff; --fg-55492a: #d7cfc0; --fg-5b8def: #79c0ff; --fg-5f3dc4: #bc8cff; --fg-5f6672: #8b949e; --fg-6639ba: #bc8cff; --fg-6a737d: #8b949e; --fg-6f42c1: #bc8cff; --fg-7a5b00: #d29922; --fg-8a6400: #d29922; --fg-8a763b: #d0a63a; --fg-92400e: #d29922; --fg-e36209: #ffa657; --fg-f2994a: #ffa657; --fg-f2b544: #e3b341; --bd-fff: #30363d; --bd-dde1ea: #30363d; --bd-c8cee0: #30363d; --bd-dbe4fb: #1f6feb55; --bd-eac2bd: #6e2a26; --bd-d8e0f5: #1f6feb55; --bd-dde: #30363d; --bd-e3e6ee: #30363d; --bd-e8b4b0: #6e2a26; --bd-eadfc4: #5c4a20; --bd-f2c4bd: #6e2a26; --bd-f2dfae: #6e5a2a; } /* 暗色下的滚动到底部按钮 spinner(局部变量,不跟色板走) */ :root[data-theme="dark"] .scroll-bottom-btn .sb-spinner { --sb-ring: #30363d; --sb-arc: #79c0ff; } /* 暗色下黑色半透明边框几乎不可见:输入框与两处行号分隔线换成实色 */ :root[data-theme="dark"] .input-shell { border-color: #3d444d; } :root[data-theme="dark"] .pv-cl .n, :root[data-theme="dark"] .vcs-line .n { border-right-color: #21262d; } /* 暗色下的代码高亮配色(GitHub dark) */ :root[data-theme="dark"] :is(.pv-code, .pv-doc, .vcs-line, .md) :is(.token.comment, .token.prolog, .token.doctype, .token.cdata) { color: #8b949e; } :root[data-theme="dark"] :is(.pv-code, .pv-doc, .vcs-line, .md) .token.punctuation { color: #c9d1d9; } :root[data-theme="dark"] :is(.pv-code, .pv-doc, .vcs-line, .md) :is(.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol, .token.deleted) { color: #79c0ff; } :root[data-theme="dark"] :is(.pv-code, .pv-doc, .vcs-line, .md) :is(.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted) { color: #a5d6ff; } :root[data-theme="dark"] :is(.pv-code, .pv-doc, .vcs-line, .md) :is(.token.operator, .token.entity, .token.url, .token.atrule, .token.attr-value, .token.keyword) { color: #ff7b72; } :root[data-theme="dark"] :is(.pv-code, .pv-doc, .vcs-line, .md) :is(.token.function, .token.class-name) { color: #d2a8ff; } :root[data-theme="dark"] :is(.pv-code, .pv-doc, .vcs-line, .md) :is(.token.regex, .token.important, .token.variable) { color: #ffa657; } * { 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: var(--fg-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: var(--bg-fafbfd); } /* 流式阶段给一点视觉提示:边色稍亮,收尾(assistant_message)后去除 */ .msg-think.streaming { border-color: var(--bd-d8e0f5); } /* 上下文卡片:只发给模型看的注入行(画像快照 / 渠道说明 / 开场记忆)折叠展示, 视觉与压缩摘要卡片一致:淡蓝底、蓝边蓝字、三角箭头、虚线分隔,不用渐变/阴影 */ .msg-ctx { margin: 0 0 12px; border: 1px solid var(--bd-dbe4fb); border-radius: 12px; overflow: hidden; background: var(--bg-f7f9ff); } .msg-ctx > summary { list-style: none; cursor: pointer; user-select: none; display: flex; align-items: center; gap: 7px; padding: 9px 12px; font-size: 13px; font-weight: 600; color: var(--active); } .msg-ctx > summary::-webkit-details-marker { display: none; } .msg-ctx > summary::before { content: ''; flex: none; width: 0; height: 0; margin-left: 1px; border-left: 5px solid var(--active); border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .15s ease; } .msg-ctx[open] > summary::before { transform: rotate(90deg); } .msg-ctx-body { /* 比标题区(#f7f9ff)再淡一档,分隔开又不跳色 */ border-top: 1px dashed var(--bd-dbe4fb); background: var(--bg-fbfcff); padding: 10px 13px 12px; } .msg-ctx-body .bubble-ai { margin: 0; background: transparent; font-size: 14px; line-height: 1.7; } /* errAck:这一轮工具参数非法、已从上下文移除,气泡上方标一行 */ .msg-note { margin: 0 0 6px; padding: 3px 9px; border-radius: 6px; background: var(--bg-fff8c5); color: var(--fg-9a6700); font-size: 12px; } /* 用户气泡:右侧,浅色背景,圆角矩形 */ .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; } /* KaTeX 公式:块级单独占行、超宽可横滚;行内不折行避免断在半截 */ .math-block { display: block; margin: 12px 0; overflow-x: auto; overflow-y: hidden; } .math-block .katex-display { margin: 0; } .math-inline { display: inline; white-space: nowrap; } .math-fallback, .math-error { font-family: ui-monospace, Menlo, Consolas, monospace; color: #b45309; } .math-error { text-decoration: underline dotted; } .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: var(--fg-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: var(--fg-c0392b); } .act-del[disabled] { opacity: .4; pointer-events: none; } /* 工具卡时间行的删除按钮:同样红示警 */ .tool-card .tool-time .act-del:hover { color: var(--fg-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 var(--bd-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: var(--fg-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: var(--bg-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; } /* 桌面点击模式:遮罩里自带一行「取消 / 发送」(.vo-actions),输入卡那个按钮不必浮上来。 手机端按住说话时看不到按钮也不影响(松手即发送)。 */ /* 按住区与下方操作栏之间的分隔线(用伪元素画,避开录音态底色的圆角) */ #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: var(--fg-c0392b); } /* 提示文案落在外挂层上,用比 --gray 深一档的中灰:13px 的字在浅灰上发虚 */ .vo-hint { font-size: 13px; line-height: 18px; color: var(--fg-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: var(--fg-c0392b); } @media (prefers-reduced-motion: reduce) { .vo-wave i { transition: none; } } /* 桌面点击模式:遮罩底部自带「取消 / 发送」一行(手机端按住说话用不到,默认不显示)。 波形在上、按钮在下由遮罩的 flex 布局自然排开,不再把输入卡那个按钮浮上来压住波形。 */ .vo-actions { display: none; gap: 12px; } .vo-btn { padding: 9px 24px; border-radius: 10px; font-size: 14px; cursor: pointer; border: 1px solid var(--border); background: var(--page); color: var(--ink); } .vo-btn.ghost { background: var(--bg-e8eaf0); border-color: transparent; color: var(--ink); } /* 桌面端休息态不显示 hint(文案为空),别白占一行高度 */ .vo-hint:empty { display: none; } .vo-btn.primary { background: var(--active); border-color: var(--active); color: var(--fg-fff); } .vo-btn:active { opacity: .88; } @media (hover: hover) and (pointer: fine) { .vo-actions { display: flex; } /* 有按钮行了,底部不再留出对齐输入卡那 70px 的空 */ #voice-overlay { padding-bottom: calc(24px + var(--sab)); } } /* 识别中:操作行隐身(此时点发送/取消都没意义) */ #voice-overlay.busy .vo-actions { visibility: hidden; } /* 发送键四态:发送 / 停止 / 语音 / 键盘。语音与键盘用中性底色,和蓝色「发送」区分开 */ .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: var(--bg-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: var(--fg-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%, var(--bg-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: var(--fg-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, var(--fg-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: var(--bg-fdecea); color: var(--fg-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: var(--fg-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, var(--fg-223)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .files-panel .file-dir-count, .files-panel .file-dir-time { 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 var(--bd-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 var(--bd-fff); border-bottom: 2px solid var(--bd-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, var(--fg-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: var(--fg-5b8def); } .files-panel .file-ico.doc { stroke: var(--fg-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,路径必然被截断,没有信息量。 */ /* 操作钮分两组分居两端:左边是树内只读操作(显示隐藏文件/刷新/Git),右边是外部打开 */ .tree-head { justify-content: space-between; } .tree-head .pv-actions { gap: 4px; margin-left: 0; } /* 组内间距按侧栏收紧;两端由 space-between 拉开 */ /* 头部图标的「开启中」态(如显示隐藏文件) */ .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-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: var(--bg-fdf3f2); color: var(--fg-c0392b); } .tree-act svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; } .tree-act .at-glyph { font-size: 13px; font-weight: 700; line-height: 1; } .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 var(--bd-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 var(--bd-fff); border-bottom: 2px solid var(--bd-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 var(--bd-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 var(--bd-fff); border-bottom: 2px solid var(--bd-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 var(--bd-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: var(--bg-fdf3f2); color: var(--fg-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: var(--bg-1c7a2e); animation: pill-pulse 1.2s ease-in-out infinite; } .conv-item .st-dot.held { background: var(--bg-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: var(--bg-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: var(--bg-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: var(--fg-c0392b); background: var(--bg-fdf3f2); border-color: var(--bd-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: var(--fg-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: var(--fg-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: var(--bg-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: var(--fg-556); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; } .scroll-bottom-btn .sb-spinner { --sb-ring: #dde; --sb-arc: #3964FE; animation: sb-spin 0.8s linear infinite; } /* 圆环与蓝色进度弧的颜色用自定义属性传进 的 shadow tree: 后代选择器(.sb-spinner circle)选不中 symbol 里的元素,只有 CSS 变量能继承穿透。 */ @keyframes sb-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } } /* 微信绑定内联卡(账户页):登录码用服务端 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: var(--bg-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: var(--bg-fbf7ee); border: 1px solid var(--bd-eadfc4); border-radius: 10px; padding: 8px 12px; font-size: 13px; color: var(--fg-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: var(--fg-8a763b); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; font-size: 12px; } .tool-card pre { background: var(--bg-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: var(--fg-55492a); } .tool-card .tool-time { color: var(--fg-b3a97f); margin-top: 6px; font-size: 11px; display: flex; align-items: center; gap: 6px; } .tool-card .tool-time .act { display: inline-flex; color: var(--fg-b3a97f); padding: 2px; border-radius: 4px; } .tool-card .tool-time .act svg { width: 12px; height: 12px; } .tool-card .tool-time .act.copied { color: var(--fg-2e7d32); } .tool-card.error { background: var(--bg-fdecea); border-color: var(--bd-f2c4bd); color: var(--fg-a3352a); } .tool-card .spin { display: inline-block; width: 1em; text-align: center; } .tool-card .tool-args-full { color: var(--fg-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: var(--fg-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: var(--fg-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: var(--fg-333); } /* 文件预览沉浸模式:40px 操作条 + 全宽内容。内容从条下开始,不会叠在页面自己的顶部按钮上; 宽度一点不让(手机横向最贵),只牺牲一条操作栏的高度。 */ #fs-viewer.fs-bar { display: flex; flex-direction: column; padding: 0; overflow: hidden; 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: var(--fg-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: var(--fg-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: var(--bg-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 铺满全屏查看器 */ /* iframe 默认是 inline:不改成 block 会在底部留一条行盒基线间隙(手机端滑动时露出白条) */ .fs-html-frame { display: block; width: 100%; height: 100%; min-height: 70vh; border: 0; background: var(--bg-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: var(--bg-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: var(--bg-fff); } .cfg-input::-webkit-outer-spin-button, .cfg-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; } .cfg-input.cfg-dirty { color: var(--fg-c0392b); border-color: var(--bd-e8b4b0); background: var(--bg-fdf3f2); } .cfg-err { margin: 0 0 8px; padding: 8px 12px; border-radius: 8px; background: var(--bg-fdecea); color: var(--fg-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: var(--fg-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: var(--bg-e3f2e6); color: var(--fg-217a34); } .badge.held { background: var(--bg-fff4dc); color: var(--fg-a06a00); } .badge.cancelled { background: var(--bg-fdecea); color: var(--fg-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: var(--bg-fdecea); color: var(--fg-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: var(--fg-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: var(--bg-fdecea); color: var(--fg-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: var(--fg-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: var(--fg-556); } .mbal-refresh { border: none; background: none; padding: 2px; margin: 0; cursor: pointer; display: flex; color: var(--fg-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: var(--bg-fff8e6); border: 1px solid var(--bd-f2dfae); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; font-size: 13px; color: var(--fg-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: var(--fg-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: var(--bg-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: var(--bg-e3f2e6); color: var(--fg-217a34); } .model-card-state.busy { background: var(--bg-fdecea); color: var(--fg-b3382c); } .model-card-state.pending { background: var(--bg-fff4dc); color: var(--fg-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: var(--bg-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: var(--bg-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: var(--bg-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: var(--bg-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: var(--fg-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 var(--bd-dde1ea); border-radius: 999px; background: var(--bg-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 var(--bd-dde1ea); border-radius: 10px; background: var(--bg-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: var(--bg-fff); color: var(--ink); border: 1px solid var(--bd-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: var(--fg-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: var(--fg-445); border: 1px solid var(--bd-dde); border-radius: 10px; padding: 11px; font-size: 15px; cursor: pointer; } .ghost-btn:active { background: var(--bg-e8eaf0); } .ghost-btn.danger { background: var(--bg-fdf3f2); color: var(--fg-c0392b); border-color: var(--bd-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 var(--bd-dde1ea); border-radius: 10px; padding: 10px 12px; font-size: 15px; margin-bottom: 10px; background: var(--bg-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 var(--bd-dde1ea); border-radius: 10px; padding: 10px 12px; font-size: 15px; margin-bottom: 10px; background: var(--bg-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: var(--fg-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 var(--bd-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: var(--fg-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: var(--bg-dbeafe); color: var(--fg-1d4ed8); } .msw-tag.thinking { background: var(--bg-fef3c7); color: var(--fg-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: var(--bg-fff); } .pv-frame { flex: 1; width: 100%; height: 100%; border: 0; background: var(--bg-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: var(--fg-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: var(--bg-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: 10px; cursor: col-resize; z-index: 6; touch-action: none; } .pv-resizer:hover, .pv-resizer:active { background: var(--active); opacity: .25; } body.pv-resizing { cursor: col-resize; user-select: none; } /* 拖动期间把重排/重绘圈在各自列里:会话列宽度跟着变,不 contain 就是整页重排 */ body.pv-resizing #app { pointer-events: none; } body.pv-resizing #chat-view { contain: paint; } body.pv-resizing #pv-pane { contain: layout paint; } 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; } body.pv-max .pv-pre { max-width: none; } /* 放大时源码面板同样铺满 */ .pv-code { width: 100%; max-width: 920px; margin: 0 auto; padding: 10px 0 40px; overflow-x: auto; counter-reset: pvline; font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 4; } /* 单行:行号用 ::before + counter 生成。伪元素不参与选区,复制代码时不会把行号带进去 */ .pv-cl { display: flex; min-height: 1.6em; counter-increment: pvline; white-space: pre; padding-right: 12px; } /* 代码必须落在显式元素里:flex 容器的裸文本是匿名 flex 项,前导空白会被折叠、纯缩进行会被丢掉 */ .pv-cl .c { flex: 1 0 auto; white-space: pre; } .pv-cl::before { content: counter(pvline); flex: none; width: calc(var(--nw, 3ch) + 18px); margin-right: 10px; padding-right: 8px; text-align: right; color: var(--fg-b0b6bd); user-select: none; background: var(--bg-fafbfc); border-right: 1px solid rgba(0,0,0,.04); } /* 放大预览时铺满:#pv-pane 已经是全屏,内容别再卡在 920px 的阅读宽度里 */ body.pv-max .pv-code { max-width: none; padding-left: 16px; padding-right: 16px; } /* 窄屏(手机):行号列收窄,别把正文宽度挤掉 */ @media (max-width: 959px) { .pv-cl::before { width: 28px; margin-right: 6px; padding-right: 4px; } } /* Prism token 配色(GitHub 亮色系):代码预览、md 围栏代码块(预览与对话正文)、Git 面板 diff 共用 */ :is(.pv-code, .pv-doc, .vcs-line, .md) :is(.token.comment, .token.prolog, .token.doctype, .token.cdata) { color: var(--fg-6a737d); font-style: italic; } :is(.pv-code, .pv-doc, .vcs-line, .md) .token.punctuation { color: var(--fg-24292e); } :is(.pv-code, .pv-doc, .vcs-line, .md) .token.namespace { opacity: .7; } :is(.pv-code, .pv-doc, .vcs-line, .md) :is(.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol, .token.deleted) { color: var(--fg-005cc5); } :is(.pv-code, .pv-doc, .vcs-line, .md) :is(.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted) { color: var(--fg-032f62); } :is(.pv-code, .pv-doc, .vcs-line, .md) :is(.token.operator, .token.entity, .token.url) { color: var(--fg-d73a49); } :is(.pv-code, .pv-doc, .vcs-line, .md) :is(.token.atrule, .token.attr-value, .token.keyword) { color: var(--fg-d73a49); } :is(.pv-code, .pv-doc, .vcs-line, .md) :is(.token.function, .token.class-name) { color: var(--fg-6f42c1); } :is(.pv-code, .pv-doc, .vcs-line, .md) :is(.token.regex, .token.important, .token.variable) { color: var(--fg-e36209); } :is(.pv-code, .pv-doc, .vcs-line, .md) .token.bold { font-weight: 600; } :is(.pv-code, .pv-doc, .vcs-line, .md) .token.italic { font-style: italic; } .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: var(--fg-fff); border-radius: 8px; padding: 9px 22px; font-size: 13px; cursor: pointer; } .pv-none button:hover { opacity: .88; } /* ---------- Git 面板(复用预览栏:body.pv-mode-vcs。列表 / 提交详情 / 未提交改动)---------- */ /* 文件树头的 Git 钮开启时高亮用通用的 .icon-btn.active(如显示隐藏文件那种),不另造类 */ .vcs-list { padding-bottom: 24px; } /* 列表顶部的仓库行:会话目录可能只是仓库的某个子目录,所以显式写出 root */ .vcs-repo { padding: 9px 16px; border-bottom: 1px solid var(--border); background: var(--drawer-bg); font: 11.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--gray); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* 列表头里的 remote 名:悬停看 URL(已脱敏);没配 remote 时灰色注明 */ .vcs-repo .vcs-remote { color: var(--fg-0550ae); cursor: help; } .vcs-repo .vcs-remote.none { color: var(--gray); } .vcs-empty { padding: 44px 24px; text-align: center; font-size: 13px; color: var(--gray-light); } .vcs-item { padding: 10px 16px; border-bottom: 1px solid var(--border); cursor: pointer; } .vcs-item:hover { background: var(--surface); } .vcs-item .t { font-size: 13.5px; font-weight: 600; color: var(--ink); word-break: break-word; line-height: 1.45; } /* 远端分支(origin/master)指向的那条提交:标题后挂一枚小标签,一眼看出本地领先几条 */ .vcs-up { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; font: 600 10.5px/17px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--fg-0550ae); background: var(--bg-dbeafe); vertical-align: 1px; } .vcs-item.at-up { box-shadow: inset 3px 0 0 var(--active); } .vcs-item .m { margin-top: 3px; font-size: 12px; color: var(--gray); } .vcs-item .m code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; } /* 「未提交的改动」入口:列表顶部单独一行,与提交行区分 */ .vcs-item.wt { background: var(--active-light); } .vcs-item.wt:hover { background: var(--bg-e3ecfe); } .vcs-more { display: block; margin: 14px auto 0; padding: 7px 18px; font-size: 12.5px; color: var(--ink); background: var(--page); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; } .vcs-more:hover { background: var(--surface); } .vcs-back { display: flex; align-items: center; gap: 6px; padding: 8px 14px; font-size: 12.5px; color: var(--active); background: var(--page); border-bottom: 1px solid var(--border); cursor: pointer; position: sticky; top: 0; z-index: 2; } .vcs-back:hover { background: var(--surface); } .vcs-commit { padding: 12px 16px 14px; border-bottom: 1px solid var(--border); background: var(--drawer-bg); } .vcs-subject { font-size: 14px; font-weight: 700; line-height: 1.5; word-break: break-word; } .vcs-meta { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--gray); } .vcs-meta code { padding: 1px 6px; border-radius: 5px; background: var(--surface); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; } .vcs-meta .vcs-hash { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--active); } .vcs-err-t { max-width: 420px; } .vcs-msg { margin: 8px 0 0; font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; color: var(--fg-444); } .vcs-sum { display: flex; align-items: center; gap: 10px; padding: 8px 16px; font-size: 12px; color: var(--gray); border-bottom: 1px solid var(--border); } .vcs-sum b.a { color: var(--fg-1a7f37); } .vcs-sum b.d { color: var(--fg-cf222e); } .vcs-file { border-bottom: 1px solid var(--border); } .vcs-fh { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 12.5px; cursor: pointer; user-select: none; } .vcs-fh:hover { background: var(--surface); } .vcs-caret { flex: none; width: 10px; color: var(--gray); transition: transform .12s ease; } .vcs-file.open .vcs-caret { transform: rotate(90deg); } .vcs-path { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--ink); } .vcs-badge { flex: none; padding: 0 5px; border-radius: 4px; font-size: 11px; line-height: 17px; background: var(--surface); color: var(--gray); } .vcs-badge.m { color: var(--fg-9a6700); background: var(--bg-fff8c5); } .vcs-badge.a { color: var(--fg-1a7f37); background: var(--bg-dafbe1); } .vcs-badge.d { color: var(--fg-cf222e); background: var(--bg-ffebe9); } .vcs-badge.r { color: var(--fg-0550ae); background: var(--bg-ddf4ff); } .vcs-badge.u { color: var(--fg-6639ba); background: var(--bg-f3e8ff); } .vcs-stat { flex: none; font-size: 11.5px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; } .vcs-stat .a { color: var(--fg-1a7f37); } .vcs-stat .d { color: var(--fg-cf222e); } .vcs-fb { display: none; border-top: 1px solid var(--border); overflow-x: auto; background: var(--bg-fff); } .vcs-file.open .vcs-fb { display: block; } /* 滚动内容包一层:inline-block 的宽度由内容决定(max-content),行再撑满它。 否则块级行只有容器宽,横向滚动后短行右侧露白,红绿底色盖不住 */ .vcs-fb-in { display: block; min-width: 100%; } /* 行:旧号 / 新号 / 代码三列。代码不换行,横向滚动(diff 语义上就该逐行对齐) */ .vcs-line { display: grid; grid-template-columns: 44px 44px minmax(0, 1fr); width: 100%; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; } .vcs-line .n { padding: 0 6px; text-align: right; color: var(--fg-b0b6bd); user-select: none; background: var(--bg-fafbfc); border-right: 1px solid rgba(0,0,0,.04); } .vcs-line .c { padding: 0 8px; white-space: pre; color: var(--ink); } .vcs-line.a { background: var(--bg-e6ffec); } .vcs-line.a .n { background: var(--bg-ccffd8); } .vcs-line.d { background: var(--bg-ffebe9); } .vcs-line.d .n { background: var(--bg-ffd7d5); } .vcs-line.h { background: var(--bg-ddf4ff); } .vcs-line.h .c { color: var(--fg-0550ae); } .vcs-line.h .n { background: var(--bg-ddf4ff); } .vcs-line.meta .c { color: var(--gray); font-style: italic; } .vcs-nodiff { padding: 12px 16px; font-size: 12px; color: var(--gray); } .vcs-note { padding: 8px 16px; font-size: 12px; color: var(--gray); background: var(--drawer-bg); } /* 通用 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: var(--bg-eceff5); color: var(--fg-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: var(--bg-e3f2e6); color: var(--fg-1c7a2e); } .hdr-model[data-status="active"]::before { animation: hdr-pulse 1.2s ease-in-out infinite; } .hdr-model[data-status="held"] { background: var(--bg-fff4dc); color: var(--fg-8a6400); } .hdr-model[data-status="cancelled"] { background: var(--bg-fdecea); color: var(--fg-b3382c); } .hdr-model[data-status="completed"] { background: var(--bg-f4f5f8); color: var(--fg-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: var(--bg-f8f5ff); color: var(--fg-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: var(--fg-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: var(--bg-f1ecff); color: var(--fg-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: var(--bg-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; max-height: 100px; overflow-y: auto; } .sq-item { flex: none; /* 多条时容器限高滚动,别把条目压扁 */ display: flex; align-items: center; gap: 6px; padding: 5px 5px 5px 11px; border-radius: 12px; background: var(--bg-fff4dc); color: var(--fg-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-act { padding: 0; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 7px; } /* 已升级为「干预/立即发送」但还没到边界:按钮置灰,显示“等待当前步骤” */ .sq-item.sq-busy button:not(.sq-act) { 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); }