Files
zhxg_app/static/scss/ai_index.css
2025-08-13 09:19:28 +08:00

363 lines
6.0 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;
}
.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;
padding: 16px 0 calc(env(safe-area-inset-bottom) + 80px) 0;
/* 增加底部内边距 */
background-color: #f5f5f5;
box-sizing: border-box;
overflow-y: auto;
/* 确保内容超出时可滚动 */
-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: 0;
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;
/* 增加图标之间的间距 */
}
.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);
}
/* ============= 小屏设备适配 ============= */
@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;
}
}