/* 配色与页面底色统一使用 app.wxss 的全局令牌,与首页等其他页面保持一致。 */ /* 页面底色交给全局 --paper,底部整片留白也走它 */ .chat-container { display: flex; flex-direction: column; height: 100vh; box-sizing: border-box; /* 页面自身不滚,滚动只交给中间的消息区; overflow: hidden 是兜底,避免任何子项溢出到视口外变成"看得见滑不到" */ overflow: hidden; /* 给 fixed 的自定义 tabBar 留位;安全区由这里统一承担,输入区不再重复加。 tabBar 总高 100rpx(12+12 内距 + 44 图标 + 6 间距 + 24 文字 + 2 边框), 页面占位与它同用 rpx 体系:tabBar 高度 + 2px 恒定缓冲, 任何屏幕宽度上工具条与 tabBar 的间隙都一致,不会大屏贴住、小屏偏空 */ padding-bottom: calc(100rpx + 2px + env(safe-area-inset-bottom)); background-color: var(--paper); } /* ===== 未登录提示条 ===== */ /* 浅橙衬底 + 2rpx --brand-line 描边托形(浅橙块落在纸面上没有边界感), 与欢迎区图标、工具条同属浅橙家族,不额外引入新色。 右侧「去登录」是裸文字链,与消息区的白卡、气泡区分开 */ .login-notice { display: flex; align-items: center; justify-content: space-between; gap: 16rpx; flex-shrink: 0; margin: 20rpx 24rpx 0; padding: 18rpx 24rpx; border-radius: 20rpx; background: var(--brand-soft); border: 2rpx solid var(--brand-line); } .login-notice-text { font-size: var(--fs-28); line-height: 1.5; color: var(--ink-2); } /* 热区靠上下 padding 撑到约 60rpx;「去登录」比正文再大一档, 它是这条提示里唯一可点的动作,字色与浅橙衬底保持清晰对比。 */ .login-notice-link { flex-shrink: 0; padding: 10rpx 4rpx; font-size: var(--fs-30); font-weight: 600; color: var(--brand-ink); } .login-notice-link:active { opacity: 0.6; } /* ===== 辅助入口(在输入区下方:左侧常见问题/清空聊天,右侧图片)===== */ /* 与输入区右侧语音/发送键同一套材质:浅橙衬底 + 2rpx --brand-line 描边, 文字与图标同为 --muted;暖橙只留给「正在动作」的态。 圆角 20rpx 与输入框、发送键、气泡同档——全页统一为圆角矩形,不再有胶囊。 整行铺满后左组贴左、右组贴右,左右 24rpx 与输入区、消息气泡同一条边线 */ .tool-bar { align-self: stretch; display: flex; align-items: center; gap: 16rpx; flex-shrink: 0; /* 上 6 贴住输入区(输入区底部内距 8rpx,合计 14rpx);下不留边距, 底部空气统一交给容器(容器 padding-bottom 已按 tabBar 覆盖下限预留) */ margin: 6rpx 24rpx 0; } /* 两组内部各用 gap 排布;右组 margin-left:auto 把图片按钮单独推到最右, 左组常驻,空会话时也不会滑位 */ .tool-group { display: flex; align-items: center; gap: 16rpx; } .tool-group-end { margin-left: auto; flex-shrink: 0; } .tool-btn { display: flex; align-items: center; gap: 8rpx; padding: 10rpx 26rpx; border-radius: 20rpx; border: 2rpx solid var(--brand-line); background: var(--brand-soft); transition: background 0.15s ease; } /* 按下态与语音/发送键一致:不缩放,只垫一层极浅的暖橙 */ .tool-btn:active { background: rgba(184, 82, 10, 0.08); } .tool-btn-text { font-size: var(--fs-24); font-weight: 500; /* 与语音/发送键的默认图标同色:待发状态统一用暖灰收声, 暖橙只在按下/可发/录音这些「正在动作」的时刻出现。 图标是 t-icon 硬编码(读不到变量),只能跟同一个色值走,故此处不改 --ink-2 */ color: var(--muted); letter-spacing: 1rpx; } /* ===== 消息列表 ===== */ .message-list { flex: 1; /* 关键:flex 子项的自动最小高度是「内容高度」,消息多于一屏后它就不肯收缩, 会把 100vh 的容器撑破、把下方输入区顶出视口(且因容器锁死高度而滑不回来)。 置 0 后它才能正确收缩到剩余空间,并触发 scroll-view 自身滚动 */ min-height: 0; padding: 20rpx 0; } /* ===== 欢迎区 ===== */ .welcome-area { display: flex; flex-direction: column; align-items: center; /* 上方留白收小:消息区本身已有 20rpx 内距,这里 80rpx 会显得图标吊得太低 */ padding: 40rpx 40rpx 80rpx; text-align: center; } /* 空态图标:浅橙衬底 + 暖陶土图标,替代原橙/绿渐变与彩色辉光 */ .welcome-icon { width: 140rpx; height: 140rpx; margin-bottom: 32rpx; display: flex; align-items: center; justify-content: center; border-radius: 40rpx; background: var(--brand-soft); border: 2rpx solid var(--brand-line); } /* 空态图标改为 ai-ink.png(暖墨线稿的 AI 气泡):与头像区的 home-ink.png 同源, 落在浅橙衬底上仍清晰(暖陶土线稿约 6.8:1)。 88rpx 略大于原 t-icon 的 72rpx,因为该图是满画布的气泡轮廓,缩小会显弱 */ .welcome-icon-img { width: 88rpx; height: 88rpx; } .welcome-title { margin-bottom: 12rpx; /* 空会话的主标题:走全站「页面主标题 44rpx」档 */ font-size: 44rpx; font-weight: 700; color: var(--ink); } .welcome-desc { margin-bottom: 56rpx; font-size: var(--fs-28); line-height: 1.6; color: var(--muted); } /* 常见问题清单:整块收成一张白卡,行与行之间只用横线分隔、不留间隙。 空会话的欢迎区与会话流里由「常见问题」按钮唤起的清单共用同一套语言—— 都是一份"可点的清单",不该一处是散卡、一处才收成块 */ .question-list { width: 100%; display: flex; flex-direction: column; background: var(--white); border: 2rpx solid var(--line); border-radius: 20rpx; box-shadow: var(--shadow-card); /* 裁掉行的直角与点按底色,保住卡片自身的圆角 */ overflow: hidden; } /* 清单行:文字 + 右侧 chevron 做点击暗示 */ .quick-item { display: flex; align-items: center; justify-content: space-between; gap: 16rpx; padding: 26rpx 28rpx; font-size: var(--fs-28); color: var(--ink-2); text-align: left; transition: background 0.15s ease; } /* 行分隔线用 --sep(比 --line 深一档,白面上才看得见) */ .quick-item + .quick-item { border-top: 2rpx solid var(--sep); } /* 行嵌在整块里,不能像独立卡那样整体缩放(会撕裂分隔线), 点按反馈改由底色承担 */ .quick-item:active { background: var(--brand-soft); } /* ===== 消息项 ===== */ /* 头像在上、气泡在下;用户消息整条靠右 */ .message-item { display: flex; flex-direction: column; padding: 16rpx 24rpx; } .message-item.user { align-items: flex-end; } /* 系统错误只承担状态提示,不伪装成任一会话角色。 */ .message-item.system { align-items: center; } .system-message { max-width: 90%; padding: 8rpx 20rpx; font-size: var(--fs-26); line-height: 1.5; color: var(--muted); text-align: center; } /* 未登录提示里的登录入口:同一行居中的裸文字链,热区由上下 padding 撑起; 字号比系统提示正文大一档,字色统一使用 --brand-ink。 */ .system-login-link { display: inline-block; margin-left: 8rpx; padding: 10rpx 8rpx; font-size: var(--fs-30); font-weight: 600; color: var(--brand-ink); } .system-login-link:active { opacity: 0.6; } /* 重试使用与其他文字入口一致的 --brand-ink */ .message-retry { padding: 12rpx 0; font-size: var(--fs-24); line-height: 1.5; color: var(--brand-ink); } /* 头像行:头像在左,时间紧跟其右 */ .message-head { display: flex; align-items: center; gap: 12rpx; margin-bottom: 10rpx; } /* 用户侧镜像为「时间 → 头像」:整行仍贴右边缘,于是头像正好落在气泡右边缘上, 与 AI 侧头像对齐气泡左边缘形成对称;时间退到头像左侧,不再顶在最右 */ .message-item.user .message-head { flex-direction: row-reverse; } /* 头像底座:AI 与用户同构——浅橙衬底 + 2rpx 暖橙描边 (浅橙块落在纸面上只有约 1.03:1,必须靠描边托形)。 身份只由图形区分:AI 是品牌标记,用户是人像图标; 左右位置本来就把两者分开了,不必再用"实心橙 vs 浅橙"区分, 否则同一列里两种底板并排出现会读成没做完 */ .avatar { width: 64rpx; height: 64rpx; display: flex; align-items: center; justify-content: center; border-radius: 20rpx; background: var(--brand-soft); border: 2rpx solid var(--brand-line); flex-shrink: 0; } /* AI 的品牌标记用暖墨版 home-ink.png:白色版 home-w.png 只能压在实心色块上, 落在浅橙底会看不见。 36rpx 与用户侧的 t-icon 同尺寸(两个图形的笔画都约占画布 95%),视觉齐平 */ .avatar-img { width: 36rpx; height: 36rpx; } /* 头像行里的时间:放头像右侧 */ .message-time { font-size: var(--fs-24); color: var(--muted); } /* 头像已移到气泡上方,气泡不再被头像占位挤压,版心随之放宽: 84% → 92%(约 646rpx),仍留一档余量不顶到屏幕边缘 */ .message-content { display: flex; flex-direction: column; min-width: 0; max-width: 92%; } .message-item.user .message-content { align-items: flex-end; } /* ===== 气泡 ===== */ .message-bubble { padding: 20rpx 24rpx; border-radius: 20rpx; word-wrap: break-word; word-break: break-all; } /* AI:白卡(白面 + 发丝边 + 中性阴影),安静、不与用户消息争色。 与其他页面卡片一致使用全局 --shadow-card。 */ .message-item.ai .message-bubble { background: var(--white); border: 2rpx solid var(--line); border-top-left-radius: 6rpx; box-shadow: var(--shadow-card); } /* 用户:全局浅橙衬底 + 暖陶土字,与 AI 白卡区分; 2rpx --brand-line 描边让气泡在暖白纸面上保持清晰边界。 */ .message-item.user .message-bubble { background: var(--brand-soft); border: 2rpx solid var(--brand-line); border-top-right-radius: 6rpx; } /* 气泡正文 28 → 30rpx(15px):长回答连续阅读时 14px 偏吃力,上调一号。 markdown 与纯文本两条路径同步,避免同一气泡里两种字号 */ .message-text { font-size: var(--fs-30); line-height: 1.6; } .message-item.ai .message-text { color: var(--ink-2); } .message-item.user .message-text { color: var(--brand-ink); } /* Markdown 渲染区:字号与 .message-text 对齐(30rpx) */ .message-markdown { width: 100%; font-size: var(--fs-30); line-height: 1.6; color: var(--ink-2); } /* 表格在聊天气泡中的样式覆盖 */ .message-markdown .t-chat-markdown-table { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 2rpx solid var(--line); border-radius: 8rpx; } .message-markdown .t-chat-markdown-table__container { display: table; min-width: 100%; max-width: max-content; border-collapse: collapse; white-space: normal; table-layout: fixed; word-break: break-word; } .message-markdown .t-chat-markdown-table__th, .message-markdown .t-chat-markdown-table__td { padding: 8rpx 12rpx; font-size: var(--fs-24); line-height: 1.4; white-space: normal; word-break: break-word; word-wrap: break-word; overflow-wrap: break-word; max-width: 240rpx; } .message-markdown .t-chat-markdown-table__th { background-color: var(--brand-soft); font-weight: 600; color: var(--ink); } .message-markdown .t-chat-markdown-table__tr:nth-child(2n) { background-color: var(--paper); } /* 代码块 */ .message-markdown .t-chat-markdown-codespan, .message-markdown .t-chat-markdown-code { font-size: var(--fs-24); word-break: break-all; } .message-image { max-width: 400rpx; border-radius: 12rpx; } /* 历史里的图片只剩占位(临时路径不落 storage),用一行弱化的说明撑住上下文 */ .message-image-placeholder { font-size: var(--fs-28); line-height: 1.6; color: var(--muted); } /* ===== 正在输入 ===== */ .typing-bubble { padding: 24rpx 32rpx; } .typing-indicator { display: flex; align-items: center; gap: 12rpx; } .dot { width: 14rpx; height: 14rpx; border-radius: 50%; background-color: var(--brand-ink); animation: typing 1.4s infinite ease-in-out both; } .dot:nth-child(1) { animation-delay: -0.32s; } .dot:nth-child(2) { animation-delay: -0.16s; } @keyframes typing { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; } 40% { transform: scale(1); opacity: 1; } } /* ===== 输入区 ===== */ .input-area { display: flex; /* 输入框与右侧按钮列底边对齐:按钮始终贴在拇指侧,输入框长高时向上生长 */ align-items: flex-end; gap: 16rpx; /* 钉在容器底部,不被消息区挤压 */ flex-shrink: 0; /* 底部内距收窄到 8rpx:与下方工具条合计 14rpx 间隙 */ padding: 16rpx 24rpx 8rpx; background: var(--white); border-top: 2rpx solid var(--line); } /* 输入框改为自增高 textarea:语音识别结果通常是一整句话, 单行 input 会把内容截断,导致用户看不到自己说了什么。 默认高度与右侧竖排按钮列同为 156rpx(约 3 行),两边上下边线对齐成 一整块输入条,不再是一高一低的两个独立块;内容再长继续随 auto-height 增长,最多约 4 行,不把消息区挤没 */ .message-input { flex: 1; width: auto; min-height: 156rpx; max-height: 220rpx; padding: 18rpx 28rpx; box-sizing: border-box; background: var(--paper); border: 2rpx solid var(--line); /* 20rpx = 10px:与气泡、常见问题卡、用户徽记的统一圆角档, 比原 999rpx 胶囊更贴合"输入条"的体量,长条上同样克制 */ border-radius: 20rpx; font-size: var(--fs-28); line-height: 1.5; color: var(--ink); } /* 录音/识别中只读:内容仍要清楚可读,不能被原生 disabled 灰掉 */ .message-input.is-readonly { opacity: 1; -webkit-text-fill-color: var(--ink); } .input-placeholder { color: var(--muted); } /* ===== 语音 / 识别状态条 ===== */ /* 左侧计时与提示、右侧取消;不盖住输入框,也不替换输入框。 只在录音阶段出现,识别阶段改用 AI 回复区等待气泡 */ .voice-status { display: flex; align-items: center; gap: 12rpx; flex-shrink: 0; margin: 8rpx 24rpx 0; padding: 10rpx 16rpx 10rpx 20rpx; border-radius: 16rpx; background: var(--brand-soft); border: 2rpx solid var(--brand-line); } .voice-dot { width: 14rpx; height: 14rpx; border-radius: 50%; flex-shrink: 0; background: var(--brand-strong); } .voice-dot.recording { animation: record-pulse 1.2s infinite ease-in-out; } /* 两处无限循环动画(AI 等待点、录音脉冲)在系统开启「减弱动态效果」时停住, 状态仍由静态图形与文字承担,不靠动画传达 */ @media (prefers-reduced-motion: reduce) { .dot, .voice-dot.recording { animation: none; } } .voice-status-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2rpx; } .voice-status-text { font-size: var(--fs-26); font-weight: 700; line-height: 1.4; color: var(--ink-2); } /* 默认说明如何发出;实时链路不可用时改为「结束后整段转写」 */ .voice-status-sub { font-size: var(--fs-24); line-height: 1.4; color: var(--muted); } .voice-cancel { align-self: stretch; display: flex; align-items: center; justify-content: center; gap: 4rpx; flex-shrink: 0; min-width: 88rpx; min-height: 88rpx; margin-left: 4rpx; padding: 0 12rpx 0 16rpx; border-left: 2rpx solid var(--sep); border-radius: 12rpx; font-size: var(--fs-26); font-weight: 700; color: var(--brand-ink); } .voice-cancel:active { background: rgba(184, 82, 10, 0.08); } @keyframes record-pulse { 0%, 100% { transform: scale(0.7); opacity: 0.4; } 50% { transform: scale(1); opacity: 1; } } /* 语音/发送在输入框右侧组成一条竖排控制: 2rpx --brand-line 外描边 + 浅橙衬底,内部用分隔线切成上下两段; 与输入框同高(156rpx)、上下边线对齐,读成一整块输入条, 而不是两枚悬空的小方块。未触发时两枚图标同为 --muted(#6F655C), 与下方工具条同色;录音时整条控制外再套一层浅橙光环 */ .action-group { width: 76rpx; height: 156rpx; display: flex; flex-direction: column; flex-shrink: 0; box-sizing: border-box; border: 2rpx solid var(--brand-line); border-radius: 20rpx; background: var(--brand-soft); overflow: hidden; transition: box-shadow 0.2s ease; } .action-group.is-recording { box-shadow: 0 0 0 6rpx var(--brand-line); } /* 上下两段共用外圈的描边与圆角,内部不再各自画边框; 默认透明底,按下时垫一层极浅的暖橙,触发态(录音 / 有内容可发) 整段转实心暖橙 —— 全页唯一的实心橙块。 两段都触发时把分隔线也转成实心橙,整条控制读成一个整体 */ .action-btn { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; box-sizing: border-box; background: transparent; transition: background 0.15s ease; } .action-btn:active { background: rgba(184, 82, 10, 0.08); } .action-btn + .action-btn { /* 分隔线用 --sep:它比 --line 深一档,在浅橙衬底上才看得见 */ border-top: 2rpx solid var(--sep); } .action-btn.active { background: var(--brand-strong); } .action-btn.active + .action-btn.active { border-top-color: var(--brand-strong); } /* ===== AI 声明注释 ===== */ /* 原为页面底部一行常驻声明,改为挂在每条 AI 回复的气泡正下方: 既省下底部固定高度,又让声明紧贴它要限定的内容。 无背景无边框,靠 muted 小字安静收尾; 24rpx 是中文最小可用字号下限(12px),不能再小 */ .message-note { margin-top: 8rpx; font-size: var(--fs-24); line-height: 1.5; color: var(--muted); }