410 lines
6.8 KiB
CSS
410 lines
6.8 KiB
CSS
/* ai_index.css */
|
||
/* ============= 整体容器 ============= */
|
||
.chat-container {
|
||
display: flex;
|
||
flex-direction: column;
|
||
min-height: 100vh;
|
||
/* 改为最小高度,允许内容撑开 */
|
||
width: 100%;
|
||
overflow: hidden;
|
||
position: relative;
|
||
background-color: #f5f5f5;
|
||
padding-top: 10px;
|
||
/* 为固定导航栏预留空间 */
|
||
box-sizing: border-box;
|
||
/* 确保padding不会增加总宽度 */
|
||
}
|
||
|
||
/* ============= 状态栏占位 ============= */
|
||
.status-bar-placeholder {
|
||
height: var(--status-bar-height);
|
||
background-color: #fff;
|
||
}
|
||
|
||
/* ============= 自定义导航栏(固定在顶部) ============= */
|
||
.custom-nav-bar {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
width: 100%;
|
||
height: 44px;
|
||
padding: 0 16px;
|
||
background-color: #fff;
|
||
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
|
||
position: fixed;
|
||
top: 0;
|
||
left: 0;
|
||
z-index: 999;
|
||
border-bottom: 1px solid #eee;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
.nav-title {
|
||
font-size: 17px;
|
||
font-weight: 600;
|
||
color: #333;
|
||
text-align: center;
|
||
flex: 1;
|
||
margin-right: 45px;
|
||
}
|
||
|
||
.nav-icon {
|
||
width: 24px;
|
||
height: 24px;
|
||
}
|
||
|
||
.nav-left,
|
||
.nav-right {
|
||
width: 44px;
|
||
height: 44px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
/* ============= 消息列表(可滚动区域) ============= */
|
||
.message-list {
|
||
flex: 1;
|
||
height: calc(100vh - 120px);
|
||
/* 设置固定高度,为输入框和导航栏预留空间 */
|
||
padding: 16px 0 calc(env(safe-area-inset-bottom) + 80px) 0;
|
||
/* 增加底部内边距 */
|
||
background-color: #f5f5f5;
|
||
box-sizing: border-box;
|
||
/* 移除overflow-y: auto,因为scroll-view自己处理滚动 */
|
||
-webkit-overflow-scrolling: touch;
|
||
/* 增加iOS设备上的滚动流畅度 */
|
||
}
|
||
|
||
/* ============= 消息项 ============= */
|
||
.message-item {
|
||
display: flex;
|
||
align-items: flex-start;
|
||
margin-bottom: 16px;
|
||
max-width: 100%;
|
||
}
|
||
|
||
.user-message {
|
||
flex-direction: row-reverse;
|
||
margin-right: 20px;
|
||
}
|
||
|
||
.ai-message {
|
||
flex-direction: row;
|
||
margin-left: 20px;
|
||
}
|
||
|
||
.avatar {
|
||
width: 40px;
|
||
height: 40px;
|
||
border-radius: 8px;
|
||
margin: 0 8px;
|
||
}
|
||
|
||
.message-content {
|
||
max-width: 70%;
|
||
padding: 10px 12px;
|
||
border-radius: 10px;
|
||
word-wrap: break-word;
|
||
line-height: 1.5;
|
||
}
|
||
|
||
.user-message .message-content {
|
||
background-color: #e1f5fe;
|
||
}
|
||
|
||
.ai-message .message-content {
|
||
background-color: #fff;
|
||
border: 1px solid #eee;
|
||
}
|
||
|
||
.sent-image {
|
||
max-width: 200px;
|
||
max-height: 200px;
|
||
border-radius: 8px;
|
||
margin-top: 4px;
|
||
object-fit: cover;
|
||
}
|
||
|
||
/* ============= AI 提示区域 ============= */
|
||
.ai-hint {
|
||
margin-top: 8px;
|
||
font-size: 12px;
|
||
color: #666;
|
||
}
|
||
|
||
.quote-icon {
|
||
display: block;
|
||
margin-bottom: 4px;
|
||
color: #888;
|
||
}
|
||
|
||
.ai-actions {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
}
|
||
|
||
.ai-text {
|
||
color: #999;
|
||
}
|
||
|
||
.icon-group {
|
||
display: flex;
|
||
gap: 12px;
|
||
}
|
||
|
||
.btn-icon {
|
||
width: 16px;
|
||
height: 16px;
|
||
cursor: pointer;
|
||
}
|
||
|
||
/* ============= 输入框区域(固定在底部) ============= */
|
||
.input-container {
|
||
display: flex;
|
||
align-items: center;
|
||
padding: 8px 16px;
|
||
background-color: #fff;
|
||
border-top: 1px solid #eee;
|
||
position: fixed;
|
||
bottom: -1px;
|
||
left: 0;
|
||
width: 100%;
|
||
z-index: 10;
|
||
box-sizing: border-box;
|
||
padding-bottom: calc(env(safe-area-inset-bottom) + 10px);
|
||
padding-left: env(safe-area-inset-left);
|
||
padding-right: env(safe-area-inset-right);
|
||
}
|
||
|
||
.input-container input {
|
||
flex: 1;
|
||
max-width: 90%;
|
||
/* 缩短输入框 */
|
||
height: 40px;
|
||
padding: 0 16px;
|
||
background-color: #f5f5f5;
|
||
border-radius: 20px;
|
||
font-size: 14px;
|
||
margin: 0 10px;
|
||
outline: none;
|
||
}
|
||
|
||
.add-icon,
|
||
.send-icon {
|
||
width: 24px;
|
||
height: 24px;
|
||
cursor: pointer;
|
||
margin: 0 12px;
|
||
/* 增加图标之间的间距 */
|
||
}
|
||
|
||
.send-button {
|
||
height: 36px;
|
||
padding: 0 16px;
|
||
background-color: #4f46e5;
|
||
color: #fff;
|
||
border: none;
|
||
border-radius: 18px;
|
||
font-size: 14px;
|
||
font-weight: 500;
|
||
cursor: pointer;
|
||
margin: 0 8px;
|
||
transition: background-color 0.2s;
|
||
min-width: 60px;
|
||
}
|
||
|
||
.send-button:hover {
|
||
background-color: #337ecc;
|
||
}
|
||
|
||
.send-button:active {
|
||
background-color: #2b6cb0;
|
||
transform: scale(0.98);
|
||
}
|
||
|
||
.toggle-button {
|
||
margin-top: 10px;
|
||
color: blue;
|
||
cursor: pointer;
|
||
text-decoration: underline;
|
||
}
|
||
|
||
.reference-details {
|
||
margin-top: 10px;
|
||
padding-left: 20px;
|
||
border-left: 2px solid #ccc;
|
||
}
|
||
|
||
/* md格式 */
|
||
.markdown-content {
|
||
line-height: 1.6;
|
||
font-size: 14px;
|
||
}
|
||
|
||
.markdown-content h1,
|
||
.markdown-content h2,
|
||
.markdown-content h3 {
|
||
margin: 1em 0 0.5em;
|
||
}
|
||
|
||
.markdown-content p {
|
||
margin: 0.5em 0;
|
||
}
|
||
|
||
.markdown-content code {
|
||
background-color: #f3f4f6;
|
||
padding: 0.2em 0.4em;
|
||
border-radius: 3px;
|
||
font-family: monospace;
|
||
}
|
||
|
||
.markdown-content pre {
|
||
background-color: #f6f8fa;
|
||
border-radius: 5px;
|
||
padding: 10px;
|
||
overflow-x: auto;
|
||
margin: 10px 0;
|
||
}
|
||
|
||
.markdown-content pre code {
|
||
background-color: transparent;
|
||
padding: 0;
|
||
}
|
||
|
||
.markdown-content ul,
|
||
.markdown-content ol {
|
||
margin-left: 1em;
|
||
margin-bottom: 0.5em;
|
||
}
|
||
|
||
.markdown-content blockquote {
|
||
border-left: 4px solid #d0d7de;
|
||
color: #57606a;
|
||
margin: 1em 0;
|
||
padding-left: 1em;
|
||
}
|
||
|
||
/* 可点击文档名 */
|
||
.doc-name-link {
|
||
color: #007aff;
|
||
text-decoration: underline;
|
||
margin-right: 16rpx;
|
||
font-size: 10rpx;
|
||
}
|
||
|
||
/* 每个引用项容器 */
|
||
.reference-item-wrapper {
|
||
margin-top: 12rpx;
|
||
}
|
||
|
||
/* ============= 引用详情 - 自适应字体 ============= */
|
||
|
||
.reference-details-item {
|
||
margin-top: 12rpx;
|
||
padding: 20rpx;
|
||
background-color: #f9f9f9;
|
||
border-radius: 8rpx;
|
||
border: 1rpx solid #e0e0e0;
|
||
font-size: clamp(12px, 2.8vw, 16px);
|
||
color: #555;
|
||
line-height: 1.6;
|
||
}
|
||
|
||
.reference-meta {
|
||
font-weight: 500;
|
||
color: #333;
|
||
display: block;
|
||
margin-bottom: 8rpx;
|
||
font-size: clamp(13px, 3.2vw, 17px);
|
||
}
|
||
|
||
.reference-content {
|
||
color: #444;
|
||
line-height: 1.7;
|
||
}
|
||
|
||
.doc-name-link {
|
||
color: #007aff;
|
||
text-decoration: underline;
|
||
margin-right: 16rpx;
|
||
font-size: clamp(13px, 3vw, 15px);
|
||
font-weight: 500;
|
||
}
|
||
|
||
/* AI悬浮按钮样式 - 全局显示 */
|
||
.ai-hover {
|
||
position: fixed;
|
||
right: 40rpx;
|
||
bottom: 120rpx;
|
||
z-index: 9999;
|
||
width: 100rpx;
|
||
height: 100rpx;
|
||
border-radius: 50%;
|
||
background-color: #409eff;
|
||
color: #fff;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
|
||
cursor: pointer;
|
||
transition: transform 0.2s;
|
||
}
|
||
|
||
.ai-hover-content {
|
||
display: flex;
|
||
justify-content: center;
|
||
align-items: center;
|
||
width: 100%;
|
||
height: 100%;
|
||
}
|
||
|
||
.ai-hover-text {
|
||
font-size: 36rpx;
|
||
font-weight: bold;
|
||
}
|
||
|
||
.ai-hover:active {
|
||
transform: scale(0.95);
|
||
}
|
||
|
||
.loading-history {
|
||
text-align: center;
|
||
padding: 20rpx;
|
||
color: #999;
|
||
font-size: 28rpx;
|
||
}
|
||
|
||
.no-more-history {
|
||
text-align: center;
|
||
padding: 20rpx;
|
||
color: #ccc;
|
||
font-size: 24rpx;
|
||
}
|
||
|
||
.debug-info {
|
||
color: #888;
|
||
font-size: 12px;
|
||
margin-top: 5px;
|
||
border-top: 1px dashed #eee;
|
||
padding-top: 5px;
|
||
}
|
||
|
||
/* ============= 小屏设备适配 ============= */
|
||
@media (max-width: 600px) {
|
||
.message-content {
|
||
max-width: 65%;
|
||
font-size: 14px;
|
||
}
|
||
|
||
.nav-title {
|
||
font-size: 15px;
|
||
}
|
||
|
||
.btn-icon {
|
||
width: 14px;
|
||
height: 14px;
|
||
margin-left: 6px;
|
||
}
|
||
} |