- 安全:AI聊天历史、患者档案、设备同步数据统一走 secureSet/secureGet 加密存储 - 合规:TabBar "消息" 改为 "助手" 消除命名误导 - 合规:新增 .env.production 模板配置 HTTPS API URL - UX:AI发送按钮 40→44px、反馈按钮 32→44px、协议勾选框 44px 点击热区 - UX:5处硬编码 10-12px 字号替换为 design token(DoctorTabBar/ShortcutButton/TodoAlert/mall) - UX:6处安全区域写法统一(全部使用 --tk-page-padding/--tk-tabbar-space + env fallback) - 新增 safe-bottom-padded / safe-bottom-tabbar 两个 mixin Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
301 lines
5.1 KiB
SCSS
301 lines
5.1 KiB
SCSS
@import '../../styles/variables.scss';
|
|
@import '../../styles/mixins.scss';
|
|
|
|
.ai-chat-page {
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: 100vh;
|
|
background: $bg;
|
|
}
|
|
|
|
/* ─── 导航栏 ─── */
|
|
.ai-chat-nav {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 16px 20px 12px;
|
|
background: $card;
|
|
border-bottom: 1px solid $bd-l;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.ai-chat-nav__title-wrap {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
}
|
|
|
|
.ai-chat-nav__title {
|
|
font-family: Georgia, 'Times New Roman', serif;
|
|
font-size: var(--tk-font-body);
|
|
font-weight: 700;
|
|
color: $tx;
|
|
}
|
|
|
|
.ai-chat-nav__online {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
margin-top: 2px;
|
|
}
|
|
|
|
.ai-chat-nav__dot {
|
|
width: 6px;
|
|
height: 6px;
|
|
border-radius: 3px;
|
|
background: $acc;
|
|
}
|
|
|
|
.ai-chat-nav__online-text {
|
|
font-size: var(--tk-font-micro);
|
|
color: $acc;
|
|
}
|
|
|
|
/* ─── 欢迎状态 ─── */
|
|
.ai-chat-welcome {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 24px 20px;
|
|
}
|
|
|
|
.ai-chat-welcome__avatar {
|
|
width: 72px;
|
|
height: 72px;
|
|
border-radius: 36px;
|
|
background: linear-gradient(135deg, $pri, $pri-d);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
box-shadow: 0 8px 24px rgba(196, 98, 58, 0.25);
|
|
}
|
|
|
|
.ai-chat-welcome__avatar-char {
|
|
color: $white;
|
|
font-size: var(--tk-font-num-lg);
|
|
font-weight: 600;
|
|
font-family: Georgia, 'Times New Roman', serif;
|
|
}
|
|
|
|
.ai-chat-welcome__greeting {
|
|
font-size: var(--tk-font-body);
|
|
font-weight: 600;
|
|
color: $tx;
|
|
margin-top: 16px;
|
|
}
|
|
|
|
.ai-chat-welcome__desc {
|
|
font-size: var(--tk-font-cap);
|
|
color: $tx3;
|
|
text-align: center;
|
|
margin-top: 6px;
|
|
line-height: 1.6;
|
|
white-space: pre-line;
|
|
}
|
|
|
|
.ai-chat-welcome__divider {
|
|
width: 32px;
|
|
height: 1px;
|
|
background: $bd;
|
|
margin: 20px 0 16px;
|
|
}
|
|
|
|
.ai-chat-welcome__hint {
|
|
font-size: var(--tk-font-micro);
|
|
color: $tx3;
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
.ai-chat-welcome__actions {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 8px;
|
|
justify-content: center;
|
|
max-width: 320px;
|
|
}
|
|
|
|
.ai-chat-welcome__pill {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
padding: 8px 14px;
|
|
background: $card;
|
|
border-radius: $r;
|
|
border: 1px solid $bd-l;
|
|
|
|
&:active {
|
|
opacity: var(--tk-touch-feedback-opacity);
|
|
}
|
|
}
|
|
|
|
.ai-chat-welcome__pill-icon {
|
|
font-size: var(--tk-font-body-sm);
|
|
}
|
|
|
|
.ai-chat-welcome__pill-text {
|
|
font-size: var(--tk-font-cap);
|
|
color: $tx2;
|
|
}
|
|
|
|
/* ─── 对话区域 ─── */
|
|
.ai-chat-body {
|
|
flex: 1;
|
|
width: 100%;
|
|
box-sizing: border-box;
|
|
padding: 16px;
|
|
}
|
|
|
|
/* ─── 消息行 ─── */
|
|
.ai-msg {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
margin-bottom: 8px;
|
|
width: 100%;
|
|
|
|
&--self {
|
|
justify-content: flex-end;
|
|
}
|
|
|
|
&--ai {
|
|
gap: 10px;
|
|
}
|
|
}
|
|
|
|
/* ─── AI 头像 ─── */
|
|
.ai-msg__avatar {
|
|
width: 36px;
|
|
height: 36px;
|
|
border-radius: 18px;
|
|
background: linear-gradient(135deg, $pri, $pri-d);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.ai-msg__avatar-char {
|
|
color: $white;
|
|
font-size: var(--tk-font-body-sm);
|
|
font-weight: 600;
|
|
}
|
|
|
|
/* ─── 消息气泡 ─── */
|
|
.ai-msg__bubble {
|
|
max-width: 75%;
|
|
padding: 10px 14px;
|
|
box-sizing: border-box;
|
|
|
|
&--ai {
|
|
background: $card;
|
|
border-radius: 4px 16px 16px 16px;
|
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
|
|
}
|
|
|
|
&--self {
|
|
background: $pri-l;
|
|
border-radius: 16px 4px 16px 16px;
|
|
max-width: 80%;
|
|
}
|
|
}
|
|
|
|
.ai-msg__text {
|
|
display: block;
|
|
width: 100%;
|
|
font-size: var(--tk-font-body-sm);
|
|
color: $tx;
|
|
line-height: 1.6;
|
|
word-break: break-word;
|
|
overflow-wrap: break-word;
|
|
white-space: pre-wrap;
|
|
}
|
|
|
|
/* ─── 打字指示器 ─── */
|
|
.ai-msg__typing {
|
|
display: flex;
|
|
gap: 4px;
|
|
align-items: center;
|
|
padding: 4px 0;
|
|
}
|
|
|
|
.ai-msg__dot {
|
|
width: 6px;
|
|
height: 6px;
|
|
border-radius: 3px;
|
|
background: $tx3;
|
|
animation: ai-typing-pulse 1.4s infinite;
|
|
|
|
&:nth-child(2) {
|
|
animation-delay: 0.2s;
|
|
}
|
|
|
|
&:nth-child(3) {
|
|
animation-delay: 0.4s;
|
|
}
|
|
}
|
|
|
|
@keyframes ai-typing-pulse {
|
|
0%, 80%, 100% {
|
|
opacity: 0.3;
|
|
transform: scale(0.8);
|
|
}
|
|
40% {
|
|
opacity: 1;
|
|
transform: scale(1);
|
|
}
|
|
}
|
|
|
|
/* ─── 底部输入栏 ─── */
|
|
.ai-chat-bar {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
padding: 10px 16px;
|
|
padding-bottom: calc(var(--tk-tabbar-space) + env(safe-area-inset-bottom, 0px));
|
|
background: $card;
|
|
border-top: 1px solid $bd-l;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.ai-chat-bar__input {
|
|
flex: 1;
|
|
height: 40px;
|
|
background: $surface-alt;
|
|
border: none;
|
|
border-radius: 20px;
|
|
padding: 0 14px;
|
|
font-size: var(--tk-font-body-sm);
|
|
color: $tx;
|
|
}
|
|
|
|
.ai-chat-bar__placeholder {
|
|
color: $tx3;
|
|
font-size: var(--tk-font-body-sm);
|
|
}
|
|
|
|
.ai-chat-bar__send {
|
|
width: 44px;
|
|
height: 44px;
|
|
border-radius: 22px;
|
|
background: $pri;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
flex-shrink: 0;
|
|
|
|
&--disabled {
|
|
opacity: 0.5;
|
|
}
|
|
|
|
&:active:not(&--disabled) {
|
|
opacity: var(--tk-touch-feedback-opacity);
|
|
}
|
|
}
|
|
|
|
.ai-chat-bar__send-icon {
|
|
color: $white;
|
|
font-size: var(--tk-font-body-lg);
|
|
font-weight: 700;
|
|
}
|