样式修改

This commit is contained in:
2025-12-17 15:32:58 +08:00
parent ded3eddc56
commit aa8ce553b0
52 changed files with 3145 additions and 2010 deletions

View File

@@ -1,247 +1,569 @@
.ai-chat-system {
display: flex;
height: 100vh;
background: #f5f7fa;
// 品牌色
$brand-color: #0055AA;
$brand-color-light: #EBF5FF;
$brand-color-hover: #004488;
// 左侧边栏
.chat-sidebar {
width: 200px;
background: #fff;
border-right: 1px solid #e4e7ed;
.ai-chat-container {
display: flex;
height: 100%;
background: #f8fafc;
position: relative;
overflow: hidden;
font-family: 'Inter', 'Noto Sans SC', sans-serif;
}
// ==================== 折叠状态的历史栏 ====================
.history-collapsed {
position: absolute;
left: 0;
top: 0;
height: 100%;
width: 48px;
background: #fff;
border-right: 1px solid #e2e8f0;
display: flex;
flex-direction: column;
align-items: center;
padding: 16px 0;
z-index: 10;
.history-toggle-btn {
padding: 8px;
color: #64748b;
background: transparent;
border: none;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s;
margin-bottom: 8px;
&:hover {
color: $brand-color;
background: $brand-color-light;
}
}
.history-icons {
flex: 1;
overflow-y: auto;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
padding: 8px 0;
}
.sidebar-header {
padding: 20px 16px;
border-bottom: 1px solid #e4e7ed;
.history-icon-btn {
padding: 8px;
color: #94a3b8;
background: transparent;
border: none;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s;
h1 {
font-size: 16px;
margin: 0;
color: #303133;
}
&:hover {
color: #64748b;
background: #f1f5f9;
}
.nav-section {
padding: 12px 8px;
&.active {
color: $brand-color;
background: $brand-color-light;
}
}
.nav-item.new-chat {
background: #409eff;
color: #fff;
.expand-btn {
padding: 8px;
color: #94a3b8;
background: transparent;
border: none;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s;
&:hover {
background: #66b1ff;
}
}
&:hover {
color: #64748b;
background: #f1f5f9;
}
}
}
.nav-item {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 12px;
margin-bottom: 2px;
border-radius: 6px;
cursor: pointer;
color: #606266;
transition: all 0.2s;
// ==================== 展开时的关闭按钮 ====================
.history-close-btn {
position: absolute;
left: 256px;
top: 50%;
transform: translateY(-50%);
z-index: 20;
background: #fff;
border: 1px solid #e2e8f0;
border-left: none;
border-radius: 0 8px 8px 0;
padding: 8px;
cursor: pointer;
box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
transition: all 0.2s;
color: #64748b;
&:hover {
background: #f5f7fa;
}
&:hover {
background: #f8fafc;
box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
}
}
&.active {
background: #ecf5ff;
color: #409eff;
}
// ==================== 历史对话侧边栏 ====================
.history-sidebar {
position: absolute;
left: 0;
top: 0;
height: 100%;
width: 0;
background: #fff;
border-right: 1px solid #e2e8f0;
z-index: 10;
transition: all 0.3s ease;
overflow: hidden;
box-shadow: 4px 0 16px rgba(0, 0, 0, 0.08);
span {
font-size: 14px;
}
}
&.open {
width: 256px;
}
.sidebar-inner {
width: 256px;
height: 100%;
display: flex;
flex-direction: column;
}
.sidebar-header {
height: 56px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 16px;
border-bottom: 1px solid #f1f5f9;
.title {
font-weight: 500;
color: #1e293b;
}
.sidebar-footer {
margin-top: auto;
.new-chat-btn {
padding: 6px;
color: #64748b;
background: transparent;
border: none;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s;
&:hover {
color: $brand-color;
background: $brand-color-light;
}
}
}
.conversation-list {
flex: 1;
overflow-y: auto;
padding: 8px;
.empty-tip {
padding: 16px;
text-align: center;
font-size: 12px;
color: #c0c4cc;
border-top: 1px solid #e4e7ed;
color: #94a3b8;
font-size: 14px;
}
}
// 主内容区
.chat-main {
flex: 1;
.conversation-item {
display: flex;
flex-direction: column;
overflow: hidden;
background: #f5f7fa;
align-items: flex-start;
gap: 12px;
padding: 10px 12px;
margin-bottom: 4px;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s;
.chat-header {
padding: 24px 32px;
background: #fff;
border-bottom: 1px solid #e4e7ed;
&:hover {
background: #f8fafc;
h1 {
font-size: 24px;
margin: 0 0 8px 0;
color: #303133;
}
.subtitle {
font-size: 14px;
color: #909399;
margin: 0;
.delete-btn {
opacity: 1;
}
}
.chat-area {
&.active {
background: $brand-color-light;
color: $brand-color;
}
.conv-icon {
flex-shrink: 0;
margin-top: 2px;
}
.conv-info {
flex: 1;
background: #fff;
margin: 24px 32px;
min-width: 0;
}
.conv-title {
font-size: 14px;
font-weight: 500;
color: #374151;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.conv-time {
font-size: 12px;
color: #94a3b8;
margin-top: 2px;
}
.delete-btn {
padding: 4px;
color: #94a3b8;
background: transparent;
border: none;
border-radius: 4px;
cursor: pointer;
opacity: 0;
transition: all 0.2s;
&:hover {
color: #ef4444;
}
}
}
}
// ==================== 主聊天区域 ====================
.chat-main {
flex: 1;
display: flex;
flex-direction: column;
height: 100%;
transition: all 0.3s ease;
margin-left: 48px;
&.sidebar-open {
margin-left: 256px;
}
}
// ==================== 消息容器 ====================
.messages-container {
flex: 1;
overflow-y: auto;
}
// ==================== 空状态 ====================
.empty-state {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
padding: 32px;
.empty-content {
text-align: center;
max-width: 600px;
}
.logo-wrapper {
width: 80px;
height: 80px;
background: linear-gradient(135deg, $brand-color 0%, $brand-color-hover 100%);
border-radius: 20px;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 24px;
box-shadow: 0 8px 24px rgba($brand-color, 0.3);
.logo-icon {
font-size: 40px;
color: #fff;
}
}
.title {
font-size: 24px;
font-weight: 700;
color: #1e293b;
margin: 0 0 8px;
}
.desc {
font-size: 14px;
color: #64748b;
margin: 0 0 32px;
line-height: 1.6;
}
.quick-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 12px;
max-width: 480px;
margin: 0 auto;
}
.quick-card {
display: flex;
align-items: center;
gap: 12px;
padding: 16px;
background: #fff;
border: 1px solid #e2e8f0;
border-radius: 12px;
cursor: pointer;
transition: all 0.2s;
text-align: left;
&:hover {
border-color: $brand-color;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.quick-icon {
width: 36px;
height: 36px;
background: $brand-color-light;
border-radius: 8px;
display: flex;
flex-direction: column;
overflow: hidden;
align-items: center;
justify-content: center;
color: $brand-color;
transition: all 0.2s;
}
.ai-info {
display: flex;
align-items: center;
gap: 12px;
padding: 16px 20px;
border-bottom: 1px solid #e4e7ed;
&:hover .quick-icon {
background: $brand-color;
color: #fff;
}
.ai-avatar {
width: 48px;
height: 48px;
border-radius: 50%;
background: #f0f2f5;
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
}
.ai-details {
flex: 1;
}
.ai-name {
font-size: 16px;
font-weight: 600;
color: #303133;
margin-bottom: 4px;
}
.ai-status {
font-size: 12px;
color: #67c23a;
display: flex;
align-items: center;
gap: 6px;
.status-dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: #67c23a;
animation: pulse 2s infinite;
}
}
}
.messages {
flex: 1;
padding: 20px;
overflow-y: auto;
background: #f5f7fa;
.message {
display: flex;
margin-bottom: 16px;
&.user {
justify-content: flex-end;
.message-content {
background: #409eff;
color: #fff;
}
}
.message-content {
max-width: 60%;
padding: 12px 16px;
background: #fff;
border-radius: 8px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.message-text {
line-height: 1.6;
word-wrap: break-word;
}
.message-time {
font-size: 11px;
color: #c0c4cc;
margin-top: 6px;
}
}
}
.quick-actions {
display: flex;
gap: 12px;
padding: 12px 20px;
border-top: 1px solid #e4e7ed;
border-bottom: 1px solid #e4e7ed;
background: #fff;
.quick-btn {
display: flex;
align-items: center;
gap: 6px;
padding: 8px 16px;
background: #f5f7fa;
border: 1px solid #e4e7ed;
border-radius: 16px;
font-size: 13px;
color: #606266;
cursor: pointer;
transition: all 0.2s;
&:hover {
background: #ecf5ff;
border-color: #409eff;
color: #409eff;
}
}
}
.input-area {
display: flex;
align-items: center;
gap: 12px;
padding: 16px 20px;
background: #fff;
.attach-icon {
font-size: 20px;
color: #909399;
cursor: pointer;
}
}
.quick-label {
font-size: 14px;
font-weight: 500;
color: #374151;
}
}
}
@keyframes pulse {
0%, 100% {
opacity: 1;
// ==================== 消息列表 ====================
.messages-list {
max-width: 768px;
margin: 0 auto;
padding: 24px 16px;
.message-row {
display: flex;
gap: 12px;
margin-bottom: 24px;
&.user {
flex-direction: row-reverse;
.message-bubble {
background: $brand-color;
color: #fff;
border-radius: 16px 16px 4px 16px;
.message-time {
text-align: right;
color: rgba(255, 255, 255, 0.7);
}
}
}
}
50% {
opacity: 0.5;
.avatar {
width: 32px;
height: 32px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
&.user {
background: $brand-color;
color: #fff;
}
&.assistant {
background: linear-gradient(135deg, $brand-color 0%, $brand-color-hover 100%);
color: #fff;
}
}
.message-bubble {
max-width: 80%;
padding: 12px 16px;
border-radius: 16px 16px 16px 4px;
background: #fff;
border: 1px solid #f1f5f9;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
.message-text {
font-size: 14px;
line-height: 1.6;
white-space: pre-wrap;
word-wrap: break-word;
}
.message-time {
font-size: 12px;
color: #94a3b8;
margin-top: 8px;
}
}
}
// ==================== 快捷命令栏 ====================
.quick-bar {
padding: 8px 16px;
border-top: 1px solid #f1f5f9;
background: #fff;
.quick-bar-inner {
max-width: 768px;
margin: 0 auto;
display: flex;
gap: 8px;
overflow-x: auto;
&::-webkit-scrollbar {
display: none;
}
}
.quick-pill {
display: flex;
align-items: center;
gap: 6px;
padding: 6px 12px;
background: #f8fafc;
border: 1px solid #e2e8f0;
border-radius: 20px;
font-size: 12px;
color: #64748b;
cursor: pointer;
white-space: nowrap;
transition: all 0.2s;
&:hover {
border-color: $brand-color;
background: $brand-color-light;
color: $brand-color;
}
.el-icon {
color: $brand-color;
}
}
}
// ==================== 输入区域 ====================
.input-area {
padding: 24px;
background: #f8fafc;
.input-wrapper {
max-width: 768px;
margin: 0 auto;
}
.input-card {
background: #fff;
border-radius: 16px;
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
border: 1px solid #e2e8f0;
overflow: hidden;
}
.input-row {
padding: 12px 16px;
}
.chat-textarea {
width: 100%;
border: none;
outline: none;
resize: none;
font-size: 14px;
color: #374151;
background: transparent;
line-height: 1.5;
max-height: 120px;
&::placeholder {
color: #94a3b8;
}
}
.toolbar-row {
padding: 12px 16px;
display: flex;
justify-content: flex-end;
border-top: 1px solid #f8fafc;
}
.toolbar-actions {
display: flex;
align-items: center;
gap: 8px;
}
.tool-btn {
padding: 8px;
color: #94a3b8;
background: transparent;
border: none;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s;
&:hover {
color: #64748b;
background: #f1f5f9;
}
}
.send-btn {
padding: 10px;
background: #e2e8f0;
color: #94a3b8;
border: none;
border-radius: 12px;
cursor: not-allowed;
transition: all 0.2s;
&.active {
background: $brand-color;
color: #fff;
cursor: pointer;
box-shadow: 0 2px 8px rgba($brand-color, 0.3);
&:hover {
background: $brand-color-hover;
}
}
}
.disclaimer {
text-align: center;
font-size: 12px;
color: #94a3b8;
margin: 12px 0 0;
}
}