feat(ai): AI 助手增加「更多」菜单并重排底部操作区
常见问题与清空聊天收进「更多」菜单,底部不再常驻两行低频操作; 页面禁止整页滚动、消息区独立滚动,欢迎区与输入面板按新版纸面/白面重构。
This commit is contained in:
@@ -39,6 +39,8 @@ Page({
|
||||
messages: [],
|
||||
inputValue: '',
|
||||
inputFocus: false,
|
||||
// 「更多」菜单:常见问题与清空聊天收进同一个低频入口
|
||||
showMoreMenu: false,
|
||||
isTyping: false,
|
||||
// 登录态:先判完再渲染提示条,避免静默登录成功前闪一下「未登录」
|
||||
authChecked: false,
|
||||
@@ -437,6 +439,27 @@ Page({
|
||||
this.sendMessage()
|
||||
},
|
||||
|
||||
// 「更多」菜单:语音/图片之外的低频动作统一收在这里,避免底部再占一行
|
||||
toggleMoreMenu() {
|
||||
this.setData({ showMoreMenu: !this.data.showMoreMenu })
|
||||
},
|
||||
|
||||
onCloseMoreMenu() {
|
||||
if (this.data.showMoreMenu) {
|
||||
this.setData({ showMoreMenu: false })
|
||||
}
|
||||
},
|
||||
|
||||
onMoreQuickQuestions() {
|
||||
this.setData({ showMoreMenu: false })
|
||||
this.showQuickQuestions()
|
||||
},
|
||||
|
||||
onMoreClearChat() {
|
||||
this.setData({ showMoreMenu: false })
|
||||
this.clearChat()
|
||||
},
|
||||
|
||||
// 把常见问题清单作为一条 AI 消息铺进会话流(可随时唤起、可重复点选)
|
||||
showQuickQuestions() {
|
||||
const questions = this.data.quickQuestions || []
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"navigationBarTitleText": "AI陪诊助手",
|
||||
"navigationBarBackgroundColor": "#F0EBE3",
|
||||
"navigationBarBackgroundColor": "#FAF8F5",
|
||||
"navigationBarTextStyle": "black",
|
||||
"disableScroll": true,
|
||||
"usingComponents": {
|
||||
"t-icon": "tdesign-miniprogram/icon/icon",
|
||||
"t-chat-markdown": "tdesign-miniprogram/chat-markdown/chat-markdown"
|
||||
|
||||
+54
-61
@@ -12,15 +12,12 @@
|
||||
scroll-y
|
||||
scroll-into-view="{{scrollToMessage}}"
|
||||
enhanced
|
||||
show-scrollbar
|
||||
show-scrollbar="{{false}}"
|
||||
>
|
||||
<!-- 欢迎区:空会话时的落点 -->
|
||||
<view class="welcome-area" wx:if="{{messages.length === 0}}">
|
||||
<view class="welcome-icon">
|
||||
<image class="welcome-icon-img" src="/images/ai-ink.png" mode="aspectFit" />
|
||||
</view>
|
||||
<text class="welcome-title">陪诊助手</text>
|
||||
<text class="welcome-desc">我是您的智能陪诊助手,可以为您解答陪诊相关问题</text>
|
||||
<text class="welcome-title">陪诊服务咨询</text>
|
||||
<view class="question-heading"><text>您可以这样问</text><text class="question-heading-sub">点选即发送</text></view>
|
||||
<view class="question-list">
|
||||
<view
|
||||
class="quick-item"
|
||||
@@ -28,11 +25,16 @@
|
||||
wx:key="id"
|
||||
bindtap="onQuickQuestionTap"
|
||||
data-question="{{item.text}}"
|
||||
hover-class="question-hover"
|
||||
aria-role="button"
|
||||
aria-label="{{item.text}}"
|
||||
>
|
||||
<view class="question-mark" aria-hidden="true">?</view>
|
||||
<text>{{item.text}}</text>
|
||||
<t-icon name="chevron-right" size="26rpx" color="#9B4508" />
|
||||
</view>
|
||||
</view>
|
||||
<text class="welcome-note">AI 助手不替代医生诊断,紧急情况请及时就医。</text>
|
||||
</view>
|
||||
|
||||
<!-- 消息:头像在上、气泡在下,时间紧跟头像右侧;用户消息整条靠右 -->
|
||||
@@ -61,8 +63,9 @@
|
||||
</view>
|
||||
<!-- 用户:人像图标(暖陶土) -->
|
||||
<view wx:else class="avatar">
|
||||
<t-icon name="user-1" size="36rpx" color="#9B4508" />
|
||||
<t-icon name="user" size="30rpx" color="#6F655C" />
|
||||
</view>
|
||||
<text class="message-author">{{item.type === 'ai' ? '暖橙助手' : '我'}}</text>
|
||||
<!-- 时间只在与上一条相隔 ≥5 分钟时出现(首条必出现),
|
||||
每条都挂时间会把对话读成日志;显隐由 stampMessageTimes 统一计算 -->
|
||||
<text class="message-time" wx:if="{{item.showTime}}">{{item.time}}</text>
|
||||
@@ -75,7 +78,7 @@
|
||||
class="message-markdown"
|
||||
content="{{item.content}}"
|
||||
/>
|
||||
<text wx:elif="{{item.contentType === 'text'}}" class="message-text">{{item.content}}</text>
|
||||
<text wx:elif="{{item.contentType === 'text'}}" class="message-text" user-select>{{item.content}}</text>
|
||||
<image
|
||||
wx:if="{{item.contentType === 'image' && item.content}}"
|
||||
class="message-image"
|
||||
@@ -97,6 +100,9 @@
|
||||
wx:key="id"
|
||||
bindtap="onQuickQuestionTap"
|
||||
data-question="{{question.text}}"
|
||||
hover-class="question-hover"
|
||||
aria-role="button"
|
||||
aria-label="{{question.text}}"
|
||||
>
|
||||
<text>{{question.text}}</text>
|
||||
<t-icon name="chevron-right" size="26rpx" color="#9B4508" />
|
||||
@@ -106,7 +112,7 @@
|
||||
<text
|
||||
wx:if="{{item.type === 'ai' && item.contentType !== 'questions'}}"
|
||||
class="message-note"
|
||||
>内容由AI生成,仅供参考</text>
|
||||
>AI 生成,仅供参考,不替代医生诊断</text>
|
||||
<text
|
||||
wx:if="{{item.type === 'user' && item.status === 'failed'}}"
|
||||
class="message-retry"
|
||||
@@ -123,6 +129,7 @@
|
||||
<view class="avatar">
|
||||
<image class="avatar-img" src="/images/home-ink.png" mode="aspectFit" />
|
||||
</view>
|
||||
<text class="message-author">暖橙助手</text>
|
||||
</view>
|
||||
<view class="message-content">
|
||||
<view class="message-bubble typing-bubble">
|
||||
@@ -131,6 +138,7 @@
|
||||
<view class="dot"></view>
|
||||
<view class="dot"></view>
|
||||
</view>
|
||||
<text class="typing-text">{{isRecognizing ? '正在识别,请稍候' : '正在为您整理'}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -159,16 +167,13 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 输入区:文字输入 + 语音 + 发送。
|
||||
语音与发送在输入框右侧组成一条竖排控制,同宽同高、共用外框、同色图标
|
||||
(未触发时都是暖灰 --muted,只有录音/可发时才翻成实心橙 + 白图标);
|
||||
两个输入动作收成一列;语音识别结果实时回填到这里,结束时直接发送,
|
||||
手动输入仍走发送键 -->
|
||||
<!-- 一个完整输入面板:上方文字,下方输入方式与发送;保留原录音发送逻辑。 -->
|
||||
<view class="composer">
|
||||
<view class="input-area">
|
||||
<textarea
|
||||
class="message-input {{recording || isRecognizing ? 'is-readonly' : ''}}"
|
||||
value="{{inputValue}}"
|
||||
placeholder="请输入您的问题..."
|
||||
placeholder="说说您的问题或需要…"
|
||||
placeholder-class="input-placeholder"
|
||||
auto-height
|
||||
maxlength="-1"
|
||||
@@ -179,62 +184,50 @@
|
||||
bindconfirm="sendMessage"
|
||||
focus="{{inputFocus}}"
|
||||
/>
|
||||
<view class="action-group {{recording ? 'is-recording' : ''}}">
|
||||
</view>
|
||||
<view class="composer-actions">
|
||||
<view class="input-tools">
|
||||
<view class="input-tool {{recording ? 'is-recording' : ''}}" bindtap="onMicTap" aria-role="button" aria-label="{{recording ? '结束并发送语音' : '语音输入'}}">
|
||||
<t-icon name="microphone" size="34rpx" color="{{recording ? '#9B4508' : '#6F655C'}}" />
|
||||
<text>{{recording ? '结束' : '语音'}}</text>
|
||||
</view>
|
||||
<view class="input-tool" bindtap="onImageTap" aria-role="button" aria-label="拍照或选择图片">
|
||||
<t-icon name="image" size="34rpx" color="#6F655C" />
|
||||
<text>图片</text>
|
||||
</view>
|
||||
<!-- 更多:常见问题与清空聊天收进同一入口,输入区不再为低频动作单占一行 -->
|
||||
<view class="input-tool {{showMoreMenu ? 'is-open' : ''}}" bindtap="toggleMoreMenu" aria-role="button" aria-label="更多功能" aria-expanded="{{showMoreMenu}}">
|
||||
<view class="more-dots" aria-hidden="true">
|
||||
<view class="more-dot"></view>
|
||||
<view class="more-dot"></view>
|
||||
<view class="more-dot"></view>
|
||||
</view>
|
||||
<text>更多</text>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="action-btn send-btn {{inputValue && !isRecognizing ? 'active' : ''}}"
|
||||
class="send-btn {{inputValue && !isRecognizing ? 'active' : ''}}"
|
||||
bindtap="sendMessage"
|
||||
aria-role="button"
|
||||
aria-label="发送消息"
|
||||
aria-disabled="{{!inputValue || isRecognizing}}"
|
||||
>
|
||||
<t-icon name="send" size="40rpx" color="{{inputValue && !isRecognizing ? '#FFFFFF' : '#6F655C'}}" />
|
||||
<text>发送</text>
|
||||
<t-icon name="chevron-right" size="30rpx" color="{{inputValue && !isRecognizing ? '#FFFFFF' : '#6F655C'}}" />
|
||||
</view>
|
||||
<view
|
||||
class="action-btn voice-btn {{recording ? 'active' : ''}}"
|
||||
bindtap="onMicTap"
|
||||
aria-role="button"
|
||||
aria-label="{{recording ? '发送或结束语音输入' : '语音输入'}}"
|
||||
>
|
||||
<t-icon
|
||||
name="microphone"
|
||||
size="40rpx"
|
||||
color="{{recording ? '#FFFFFF' : '#6F655C'}}"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 辅助入口:紧贴输入区下方——拇指最容易够到的位置,操作方便。
|
||||
左侧是会话动作(常见问题 / 清空聊天),常驻显示;材质与输入区右侧
|
||||
的语音/发送键完全一致(浅橙衬底 + 浅橙描边 + 暖灰图标/文字、圆角 20rpx),
|
||||
只是更矮一行,读成同一族的次级动作,不抢发送键的视线。
|
||||
靠左与上方输入框、消息气泡同一条左边线。
|
||||
右侧是图片输入,同一材质,靠右放置 -->
|
||||
<view class="tool-bar">
|
||||
<view class="tool-group">
|
||||
<view class="tool-btn" bindtap="showQuickQuestions">
|
||||
<t-icon name="help-circle" size="26rpx" color="#6F655C" />
|
||||
<text class="tool-btn-text">常见问题</text>
|
||||
<!-- 更多菜单:向上展开,点遮罩关闭;清空仅在已有记录时出现,仍走原有二次确认 -->
|
||||
<view class="more-mask" wx:if="{{showMoreMenu}}" bindtap="onCloseMoreMenu" aria-hidden="true"></view>
|
||||
<view class="more-menu" wx:if="{{showMoreMenu}}" aria-role="menu">
|
||||
<view class="more-item" bindtap="onMoreQuickQuestions" aria-role="menuitem">
|
||||
<t-icon name="help-circle" size="30rpx" color="#6F655C" />
|
||||
<text class="more-item-text">常见问题</text>
|
||||
</view>
|
||||
<view
|
||||
class="tool-btn"
|
||||
bindtap="clearChat"
|
||||
aria-role="button"
|
||||
aria-label="清空聊天"
|
||||
>
|
||||
<t-icon name="delete" size="26rpx" color="#6F655C" />
|
||||
<text class="tool-btn-text">清空聊天</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tool-group tool-group-end">
|
||||
<view
|
||||
class="tool-btn"
|
||||
bindtap="onImageTap"
|
||||
aria-role="button"
|
||||
aria-label="拍照或选择图片"
|
||||
>
|
||||
<t-icon name="image" size="26rpx" color="#6F655C" />
|
||||
<text class="tool-btn-text">图片</text>
|
||||
<view class="more-divider" wx:if="{{messages.length}}"></view>
|
||||
<view class="more-item more-item-muted" wx:if="{{messages.length}}" bindtap="onMoreClearChat" aria-role="menuitem">
|
||||
<t-icon name="delete" size="30rpx" color="#6F655C" />
|
||||
<text class="more-item-text">清空聊天记录</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
+111
-646
@@ -1,663 +1,128 @@
|
||||
/* 配色与页面底色统一使用 app.wxss 的全局令牌,与首页等其他页面保持一致。 */
|
||||
|
||||
/* 页面底色交给全局 --paper,底部整片留白也走它 */
|
||||
/* 与首页同源:暖白纸面、清晰左基线、克制的暖橙强调。
|
||||
页面不滚动,唯一滚动容器是消息区;底部为自定义 tabBar 留位。 */
|
||||
.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;
|
||||
padding-bottom: calc(104rpx + env(safe-area-inset-bottom));
|
||||
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);
|
||||
}
|
||||
.login-notice { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 16rpx; margin: 16rpx 32rpx 0; padding: 4rpx 20rpx; border: 2rpx solid var(--brand-line); border-radius: 20rpx; background: var(--brand-soft); }
|
||||
.login-notice-text { flex: 1; min-width: 0; color: var(--ink-2); font-size: var(--fs-26); line-height: 1.6; }
|
||||
.login-notice-link { display: flex; align-items: center; flex-shrink: 0; min-height: 88rpx; color: var(--brand-ink); font-size: var(--fs-28); font-weight: 500; }
|
||||
|
||||
/* ===== 语音 / 识别状态条 ===== */
|
||||
/* 左侧计时与提示、右侧取消;不盖住输入框,也不替换输入框。
|
||||
只在录音阶段出现,识别阶段改用 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);
|
||||
}
|
||||
.message-list { flex: 1; height: 0; min-height: 0; box-sizing: border-box; }
|
||||
.welcome-area { padding: 32rpx 32rpx 24rpx; }
|
||||
.welcome-title { display: block; color: var(--ink); font-size: 44rpx; font-weight: 600; line-height: 1.45; }
|
||||
.question-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12rpx; margin: 32rpx 0 16rpx; color: var(--ink); font-size: var(--fs-28); font-weight: 500; }
|
||||
.question-heading-sub { color: var(--muted); font-size: var(--fs-24); font-weight: 400; }
|
||||
.question-list { display: flex; flex-direction: column; gap: 12rpx; width: 100%; box-sizing: border-box; }
|
||||
.quick-item { display: flex; align-items: center; justify-content: space-between; gap: 16rpx; min-height: 96rpx; box-sizing: border-box; padding: 20rpx; border: 2rpx solid var(--line); border-radius: 20rpx; background: var(--white); color: var(--ink-2); font-size: var(--fs-28); line-height: 1.6; }
|
||||
.quick-item > text { flex: 1; min-width: 0; word-break: break-all; }
|
||||
.question-mark { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 40rpx; height: 40rpx; border-radius: 12rpx; background: var(--paper); color: var(--brand-ink); font-size: var(--fs-26); }
|
||||
.quick-item.question-hover, .quick-item:active { background: var(--brand-soft); border-color: var(--brand-line); }
|
||||
.welcome-note { display: block; margin-top: 20rpx; color: var(--muted); font-size: var(--fs-24); line-height: 1.7; }
|
||||
|
||||
.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;
|
||||
/* 对话正文占据主要宽度,避免头像左右分栏挤压长回答和报告表格。 */
|
||||
.message-item { display: flex; flex-direction: column; padding: 20rpx 32rpx; }
|
||||
.message-item.user { align-items: flex-end; }
|
||||
.message-head { display: flex; align-items: center; gap: 10rpx; margin-bottom: 12rpx; }
|
||||
.message-item.user .message-head { flex-direction: row-reverse; }
|
||||
.avatar { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44rpx; height: 44rpx; border-radius: 14rpx; background: var(--white); border: 2rpx solid var(--line); }
|
||||
.avatar-img { width: 30rpx; height: 30rpx; }
|
||||
.message-item.user .avatar { background: transparent; border-color: transparent; }
|
||||
.message-author { color: var(--ink-2); font-size: var(--fs-24); font-weight: 500; }
|
||||
.message-time { color: var(--muted); font-size: var(--fs-24); margin: 0 6rpx; }
|
||||
.message-content { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; max-width: 100%; }
|
||||
.message-item.ai .message-content { width: 100%; }
|
||||
.message-item.user .message-content { align-items: flex-end; max-width: 90%; }
|
||||
.message-bubble { box-sizing: border-box; min-width: 0; max-width: 100%; padding: 24rpx; border-radius: 24rpx; word-wrap: break-word; word-break: break-word; }
|
||||
.message-item.ai .message-bubble { width: 100%; border: 2rpx solid var(--line); border-top-left-radius: 8rpx; background: var(--white); }
|
||||
.message-item.user .message-bubble { border: 2rpx solid var(--brand-line); border-top-right-radius: 8rpx; background: var(--brand-soft); }
|
||||
.message-text { font-size: var(--fs-30); line-height: 1.75; white-space: pre-wrap; color: var(--ink-2); }
|
||||
.message-item.user .message-text { color: var(--brand-ink); }
|
||||
.message-markdown {
|
||||
display: block;
|
||||
width: 100%;
|
||||
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;
|
||||
font-size: var(--fs-30);
|
||||
line-height: 1.75;
|
||||
color: var(--ink-2);
|
||||
/* 组件内的色彩通过实际消费的 TDesign 变量传入,不依赖跨组件选择器。 */
|
||||
--td-text-color-primary: var(--ink-2);
|
||||
--td-bg-color-component: var(--brand-soft);
|
||||
--td-bg-color-page: var(--paper);
|
||||
--td-bg-color-secondarycontainer: var(--paper);
|
||||
--td-component-border: var(--line);
|
||||
}
|
||||
.message-markdown .t-chat-markdown-table { max-width: 100%; overflow-x: auto; border: 2rpx solid var(--line); border-radius: 12rpx; }
|
||||
.message-markdown .t-chat-markdown-table__container { display: table; min-width: 100%; border-collapse: collapse; }
|
||||
.message-markdown .t-chat-markdown-table__container-th, .message-markdown .t-chat-markdown-table__container-td { padding: 12rpx; font-size: var(--fs-26); line-height: 1.6; word-break: break-word; }
|
||||
.message-markdown .t-chat-markdown-table__container-th { background: var(--brand-soft); color: var(--ink); }
|
||||
.message-markdown .t-chat-markdown-table__container-tr:nth-child(2n) { background: var(--paper); }
|
||||
.message-markdown .t-chat-markdown-code, .message-markdown .t-chat-markdown-codespan { font-size: var(--fs-26); word-break: break-all; }
|
||||
.message-image { display: block; width: 400rpx; max-width: 100%; border-radius: 16rpx; }
|
||||
.message-image-placeholder { font-size: var(--fs-28); color: var(--muted); line-height: 1.6; }
|
||||
.message-note { margin-top: 10rpx; color: var(--muted); font-size: var(--fs-24); line-height: 1.6; }
|
||||
.message-retry { display: flex; align-items: center; min-height: 88rpx; color: var(--brand-ink); font-size: var(--fs-26); }
|
||||
.message-item.system { align-items: center; }
|
||||
.system-message { max-width: 100%; padding: 8rpx 16rpx; color: var(--muted); font-size: var(--fs-26); line-height: 1.7; text-align: center; }
|
||||
.system-login-link { display: inline-block; padding: 16rpx; color: var(--brand-ink); font-size: var(--fs-28); }
|
||||
.message-item.ai .typing-bubble { display: flex; align-items: center; gap: 20rpx; width: auto; min-height: 88rpx; }
|
||||
.typing-indicator { display: flex; align-items: center; gap: 8rpx; }
|
||||
.dot { width: 10rpx; height: 10rpx; border-radius: 50%; background: 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; }
|
||||
.typing-text { font-size: var(--fs-26); color: var(--muted); line-height: 1.6; }
|
||||
|
||||
/* 默认说明如何发出;实时链路不可用时改为「结束后整段转写」 */
|
||||
.voice-status-sub {
|
||||
font-size: var(--fs-24);
|
||||
line-height: 1.4;
|
||||
color: var(--muted);
|
||||
}
|
||||
/* 统一白色输入面板,语音/图片/更多在左,发送在右,所有操作横向展开。
|
||||
position: relative 供「更多」菜单定位(菜单从按钮上方展开) */
|
||||
.composer { position: relative; flex-shrink: 0; margin: 12rpx 24rpx 8rpx; padding: 20rpx 20rpx 12rpx; border: 2rpx solid var(--line); border-radius: 28rpx; background: var(--white); box-shadow: var(--shadow-card); }
|
||||
.input-area { padding: 0 4rpx; }
|
||||
.message-input { display: block; box-sizing: border-box; width: 100%; min-height: 76rpx; max-height: 180rpx; padding: 4rpx 0 12rpx; color: var(--ink); font-size: var(--fs-30); line-height: 1.6; background: transparent; }
|
||||
.message-input.is-readonly { color: var(--muted); }
|
||||
.input-placeholder { color: var(--muted); font-size: var(--fs-28); }
|
||||
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 16rpx; }
|
||||
.input-tools { display: flex; align-items: center; gap: 8rpx; }
|
||||
.input-tool { display: flex; align-items: center; justify-content: center; gap: 8rpx; box-sizing: border-box; min-width: 104rpx; min-height: 88rpx; padding: 12rpx; border-radius: 16rpx; color: var(--muted); font-size: var(--fs-24); }
|
||||
.input-tool.is-recording { color: var(--brand-ink); background: var(--brand-soft); }
|
||||
.input-tool.is-open { color: var(--brand-ink); background: var(--brand-soft); }
|
||||
.input-tool:active { background: var(--paper); }
|
||||
/* 三个点用 CSS 画,不依赖图标名;与「语音/图片」同一条文字基线 */
|
||||
.more-dots { display: flex; align-items: center; justify-content: center; gap: 5rpx; width: 34rpx; height: 34rpx; }
|
||||
.more-dot { width: 8rpx; height: 8rpx; border-radius: 50%; background: var(--muted); }
|
||||
.input-tool.is-open .more-dot { background: var(--brand-ink); }
|
||||
.send-btn { display: flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 10rpx; box-sizing: border-box; min-width: 136rpx; min-height: 88rpx; padding: 16rpx 20rpx; border-radius: 20rpx; background: var(--paper); color: var(--muted); font-size: var(--fs-28); font-weight: 500; }
|
||||
.send-btn.active { background: var(--brand-strong); color: var(--white); }
|
||||
.send-btn.active:active { background: var(--brand-ink); }
|
||||
/* ===== 「更多」菜单 =====
|
||||
透明遮罩负责点外部关闭;菜单锚在输入面板上方左侧,向上展开,
|
||||
不挤占输入区、也不与自定义 tabBar 重叠(层级高于 tabBar) */
|
||||
.more-mask { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 120; background: transparent; }
|
||||
.more-menu { position: absolute; left: 20rpx; bottom: calc(100% + 8rpx); z-index: 121; box-sizing: border-box; min-width: 320rpx; padding: 8rpx 0; border: 2rpx solid var(--line); border-radius: 20rpx; background: var(--white); box-shadow: var(--shadow-card); animation: more-menu-in 0.16s ease-out; }
|
||||
@keyframes more-menu-in { from { opacity: 0; transform: translateY(8rpx); } to { opacity: 1; transform: translateY(0); } }
|
||||
.more-item { display: flex; align-items: center; gap: 14rpx; box-sizing: border-box; min-height: 88rpx; padding: 0 24rpx; color: var(--ink-2); font-size: var(--fs-28); line-height: 1.4; }
|
||||
.more-item:active { background: var(--brand-soft); }
|
||||
.more-item-muted { color: var(--muted); }
|
||||
.more-divider { height: 2rpx; margin: 0 20rpx; background: var(--line); }
|
||||
|
||||
.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);
|
||||
}
|
||||
.voice-status { display: flex; align-items: center; flex-shrink: 0; gap: 16rpx; margin: 8rpx 24rpx 0; padding: 8rpx 16rpx; border: 2rpx solid var(--brand-line); border-radius: 20rpx; background: var(--brand-soft); }
|
||||
.voice-dot { flex-shrink: 0; width: 12rpx; height: 12rpx; border-radius: 50%; background: var(--brand-strong); }
|
||||
.voice-dot.recording { animation: record-pulse 1.2s infinite ease-in-out; }
|
||||
.voice-status-main { display: flex; flex: 1; flex-direction: column; gap: 4rpx; min-width: 0; }
|
||||
.voice-status-text { font-size: var(--fs-26); font-weight: 500; color: var(--ink-2); line-height: 1.5; }
|
||||
.voice-status-sub { font-size: var(--fs-24); color: var(--muted); line-height: 1.5; }
|
||||
.voice-cancel { display: flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 8rpx; min-width: 88rpx; min-height: 88rpx; padding: 0 8rpx; color: var(--brand-ink); font-size: var(--fs-26); }
|
||||
@keyframes typing { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }
|
||||
@keyframes record-pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
|
||||
@media (prefers-reduced-motion: reduce) { .dot, .voice-dot.recording, .more-menu { animation: none; } }
|
||||
@media (max-width: 340px) {
|
||||
.input-tool { min-width: 88rpx; padding: 8rpx; }
|
||||
.composer-actions { gap: 8rpx; }
|
||||
}
|
||||
Reference in New Issue
Block a user