Files
gemini_boy/static/css/style.css

1531 lines
32 KiB
CSS

/* 通用样式 - 现代科技感设计 */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Space+Grotesk:wght@300;400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');
:root {
--primary-color: #2563eb;
/* 深蓝主色调 */
--primary-light: #3b82f6;
--primary-dark: #1d4ed8;
--accent-color: #10b981;
/* 绿色强调色 */
--accent-light: #34d399;
--danger-color: #ef4444;
/* 危险色/错误色 */
--warning-color: #f59e0b;
/* 警告色 */
--info-color: #0ea5e9;
/* 信息色 */
--dark-bg: #0f172a;
/* 深色背景 */
--darker-bg: #020617;
/* 更深色背景 */
--light-bg: #f8fafc;
/* 浅色背景 */
--border-color: #334155;
/* 边框色 */
--text-light: #f1f5f9;
/* 浅色文本 */
--text-dark: #1e293b;
/* 深色文本 */
--text-muted: #94a3b8;
/* 次要文本 */
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
--shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
--shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
--shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
--glow: 0 0 15px rgba(59, 130, 246, 0.5);
--transition-fast: 0.2s ease;
--transition-normal: 0.3s ease;
--transition-slow: 0.5s ease;
--border-radius-sm: 6px;
--border-radius-md: 10px;
--border-radius-lg: 16px;
--border-radius-xl: 24px;
--border-radius-full: 9999px;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html,
body {
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
body {
font-family: 'Poppins', 'Noto Sans SC', sans-serif;
background: linear-gradient(to bottom right, var(--darker-bg), var(--dark-bg));
color: var(--text-light);
display: flex;
flex-direction: column;
min-height: 100vh;
width: 100vw;
overflow-x: hidden;
overflow-y: auto;
line-height: 1.6;
font-weight: 400;
}
.container {
display: flex;
flex-grow: 1;
width: 100%;
max-width: 1400px;
padding: 24px;
margin: 24px auto;
box-shadow: var(--shadow-xl);
border-radius: var(--border-radius-lg);
overflow: hidden;
background-color: rgba(15, 23, 42, 0.7);
/* 半透明背景 */
backdrop-filter: blur(10px);
/* 背景模糊效果 */
border: 1px solid rgba(255, 255, 255, 0.05);
min-height: calc(100vh - 48px);
transition: all var(--transition-normal);
}
/* 侧边栏样式 */
.sidebar {
flex-basis: 300px;
flex-shrink: 0;
background: linear-gradient(to bottom, var(--dark-bg), var(--darker-bg));
color: var(--text-light);
padding: 30px 20px;
display: flex;
flex-direction: column;
border-right: 1px solid rgba(255, 255, 255, 0.05);
box-shadow: var(--shadow-md);
border-radius: var(--border-radius-md) 0 0 var(--border-radius-md);
position: relative;
overflow: hidden;
}
/* 科技感装饰元素 */
.sidebar::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background:
radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
radial-gradient(circle at 80% 70%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
z-index: 0;
}
.sidebar .logo {
font-size: 32px;
font-weight: 600;
text-align: center;
margin-bottom: 40px;
color: var(--text-light);
display: flex;
align-items: center;
justify-content: center;
gap: 12px;
position: relative;
z-index: 1;
font-family: 'Space Grotesk', sans-serif;
letter-spacing: 1px;
}
.sidebar .logo i {
color: var(--primary-color);
font-size: 36px;
filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.6));
animation: pulse 3s infinite ease-in-out;
}
@keyframes pulse {
0% {
opacity: 0.8;
}
50% {
opacity: 1;
}
100% {
opacity: 0.8;
}
}
.nav-menu {
flex-grow: 1;
margin-bottom: 30px;
position: relative;
z-index: 1;
}
.nav-item {
display: flex;
align-items: center;
padding: 15px 20px;
color: var(--text-muted);
text-decoration: none;
font-size: 16px;
font-weight: 500;
border-radius: var(--border-radius-md);
margin-bottom: 12px;
transition: all var(--transition-normal);
position: relative;
overflow: hidden;
}
.nav-item::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 4px;
height: 100%;
background-color: var(--primary-color);
transform: scaleY(0);
transition: transform var(--transition-normal);
}
.nav-item i {
margin-right: 15px;
font-size: 20px;
transition: all var(--transition-normal);
}
.nav-item:hover,
.nav-item.active {
background-color: rgba(59, 130, 246, 0.1);
color: var(--text-light);
transform: translateX(4px);
}
.nav-item:hover::before,
.nav-item.active::before {
transform: scaleY(1);
}
.nav-item:hover i,
.nav-item.active i {
color: var(--primary-light);
transform: scale(1.1);
}
.session-info {
background: linear-gradient(145deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.7));
padding: 20px;
border-radius: var(--border-radius-md);
font-size: 14px;
line-height: 1.6;
border: 1px solid rgba(255, 255, 255, 0.05);
box-shadow: var(--shadow-md);
position: relative;
z-index: 1;
backdrop-filter: blur(4px);
}
.session-info h4 {
margin-top: 0;
color: var(--text-light);
font-size: 18px;
margin-bottom: 15px;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
padding-bottom: 10px;
font-weight: 600;
letter-spacing: 0.5px;
}
.session-info p {
margin-bottom: 8px;
color: var(--text-muted);
}
.session-info p span {
font-weight: 500;
color: var(--text-light);
}
.status-indicator {
display: flex;
align-items: center;
margin-top: 15px;
padding-top: 10px;
border-top: 1px solid rgba(255, 255, 255, 0.1);
}
/* 记忆更新状态容器 */
#memory-update-status {
display: none;
/* 默认隐藏 */
align-items: center;
margin-top: 10px;
padding: 8px 10px;
background-color: #e0e0e0;
border-radius: 5px;
font-size: 0.9em;
color: #333;
}
#memory-update-status .memory-status-dot {
width: 8px;
height: 8px;
border-radius: 50%;
margin-right: 5px;
display: inline-block;
}
#memory-update-status .status-dot {
width: 8px;
height: 8px;
border-radius: 50%;
margin-right: 5px;
display: inline-block;
}
#memory-update-status .status-dot.updating {
background-color: #f39c12;
/* 黄色,表示更新中 */
}
#memory-update-status .status-dot.success {
background-color: #27ae60;
/* 绿色,表示更新成功 */
}
#memory-update-status .status-dot.error {
background-color: #e74c3c;
/* 红色,表示更新失败 */
}
#memory-update-status .status-text {
color: #555;
font-size: 0.9em;
}
/* 通用状态点样式,如果其他地方需要,可以保留 */
.status-dot {
width: 12px;
height: 12px;
border-radius: 50%;
margin-right: 10px;
display: inline-block;
/* 默认颜色,如果需要 */
background-color: #ccc;
}
.status-text {
color: #bdc3c7;
font-size: 15px;
}
/* 主内容区样式 */
.main-content {
flex-grow: 1;
padding: 25px;
display: flex;
flex-direction: column;
background: linear-gradient(145deg, rgba(15, 23, 42, 0.7), rgba(30, 41, 59, 0.7));
overflow-y: auto;
min-height: 0;
border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
transition: all var(--transition-normal);
box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
backdrop-filter: blur(4px);
position: relative;
color: var(--text-light);
}
/* 科技感背景元素 */
.main-content::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background:
radial-gradient(circle at 70% 20%, rgba(16, 185, 129, 0.05) 0%, transparent 40%),
radial-gradient(circle at 30% 80%, rgba(59, 130, 246, 0.05) 0%, transparent 40%);
z-index: 0;
pointer-events: none;
}
/* 全屏与窄屏切换 */
.main-content.full-width {
max-width: 100%;
padding: 35px;
}
.container.full-width {
max-width: 100%;
margin: 0;
border-radius: 0;
padding: 15px;
}
.content-section {
display: none;
flex-direction: column;
flex-grow: 1;
/* 允许内容部分占据可用空间 */
}
.content-section.active {
display: flex;
}
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 25px;
padding-bottom: 15px;
border-bottom: 1px solid #eee;
}
.section-header h2 {
margin: 0;
font-size: 28px;
color: #2c3e50;
display: flex;
align-items: center;
gap: 10px;
}
.section-header h2 i {
color: #3498db;
}
.header-actions {
display: flex;
gap: 10px;
}
/* 按钮样式 */
.action-button {
padding: 12px 25px;
border: none;
border-radius: 8px;
cursor: pointer;
font-size: 16px;
font-weight: 600;
transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
display: inline-flex;
align-items: center;
gap: 8px;
}
.action-button i {
font-size: 18px;
}
.action-button.primary {
background-color: #3498db;
color: #fff;
box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
}
.action-button.primary:hover {
background-color: #2980b9;
transform: translateY(-2px);
box-shadow: 0 6px 15px rgba(52, 152, 219, 0.4);
}
.action-button.secondary {
background-color: #95a5a6;
color: #fff;
box-shadow: 0 4px 10px rgba(149, 165, 166, 0.3);
}
.action-button.secondary:hover {
background-color: #7f8c8d;
transform: translateY(-2px);
box-shadow: 0 6px 15px rgba(149, 165, 166, 0.4);
}
.action-button:active {
transform: translateY(0);
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
/* 聊天区特定样式 */
.chat-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 25px;
padding-bottom: 15px;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
position: relative;
z-index: 1;
}
.chat-header h2 {
margin: 0;
font-size: 28px;
color: var(--text-light);
display: flex;
align-items: center;
gap: 12px;
font-weight: 600;
letter-spacing: 0.5px;
font-family: 'Space Grotesk', sans-serif;
}
.chat-header h2 i {
color: var(--accent-color);
filter: drop-shadow(0 0 5px rgba(16, 185, 129, 0.5));
}
.chat-window {
flex-grow: 1;
background: rgba(10, 15, 30, 0.4);
border: 1px solid rgba(255, 255, 255, 0.05);
border-radius: var(--border-radius-lg);
padding: 25px;
overflow-y: auto;
margin-bottom: 25px;
display: flex;
flex-direction: column;
gap: 20px;
box-shadow: var(--shadow-md);
height: auto;
min-height: 350px;
position: relative;
backdrop-filter: blur(5px);
scrollbar-width: thin;
scrollbar-color: var(--primary-color) rgba(15, 23, 42, 0.3);
}
.chat-window::-webkit-scrollbar {
width: 6px;
}
.chat-window::-webkit-scrollbar-track {
background: rgba(15, 23, 42, 0.3);
border-radius: var(--border-radius-full);
}
.chat-window::-webkit-scrollbar-thumb {
background-color: var(--primary-color);
border-radius: var(--border-radius-full);
}
.chat-message {
display: flex;
margin-bottom: 20px;
align-items: flex-start;
position: relative;
opacity: 1;
transition: opacity 0.3s ease;
}
.chat-message.user {
justify-content: flex-end;
}
.chat-message.bot {
justify-content: flex-start;
}
.message-avatar {
width: 42px;
height: 42px;
border-radius: var(--border-radius-full);
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
color: #fff;
flex-shrink: 0;
position: relative;
z-index: 2;
box-shadow: var(--shadow-md);
}
.chat-message.user .message-avatar {
background: linear-gradient(145deg, var(--primary-color), var(--primary-dark));
order: 2;
margin-left: 15px;
}
.chat-message.bot .message-avatar {
background: linear-gradient(145deg, var(--accent-color), #0d9669);
order: 0;
margin-right: 15px;
}
/* 添加头像内的图标 */
.message-avatar::after {
font-family: "Font Awesome 5 Free";
font-weight: 900;
}
.chat-message.user .message-avatar::after {
content: "\f007";
/* 用户图标 */
}
.chat-message.bot .message-avatar::after {
content: "\f544";
/* 机器人图标 */
}
.message-content-wrapper {
display: flex;
flex-direction: column;
max-width: 75%;
position: relative;
z-index: 1;
}
.chat-message.user .message-content-wrapper {
align-items: flex-end;
}
.chat-message.bot .message-content-wrapper {
align-items: flex-start;
}
.message-bubble {
padding: 15px 20px;
border-radius: var(--border-radius-lg);
font-size: 16px;
line-height: 1.6;
word-wrap: break-word;
position: relative;
backdrop-filter: blur(10px);
transition: transform 0.3s ease, box-shadow 0.3s ease;
overflow: hidden;
}
.chat-message.user .message-bubble {
background: linear-gradient(145deg, rgba(37, 99, 235, 0.2), rgba(59, 130, 246, 0.15));
color: var(--text-light);
border: 1px solid rgba(59, 130, 246, 0.2);
border-bottom-right-radius: 4px;
box-shadow: 0 3px 15px rgba(37, 99, 235, 0.1);
}
.chat-message.bot .message-bubble {
background: linear-gradient(145deg, rgba(16, 185, 129, 0.15), rgba(52, 211, 153, 0.1));
color: var(--text-light);
border: 1px solid rgba(16, 185, 129, 0.2);
border-bottom-left-radius: 4px;
box-shadow: 0 3px 15px rgba(16, 185, 129, 0.1);
}
/* 添加科技感装饰元素 */
.message-bubble::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(90deg,
transparent 0%,
rgba(255, 255, 255, 0.05) 25%,
transparent 50%);
transform: translateX(-100%);
animation: shimmer 3s infinite;
pointer-events: none;
}
@keyframes shimmer {
0% {
transform: translateX(-100%);
}
100% {
transform: translateX(100%);
}
}
/* 消息气泡尖角 */
.chat-message.user .message-bubble::after {
content: '';
position: absolute;
right: -10px;
bottom: 0;
width: 0;
height: 0;
border-left: 10px solid rgba(59, 130, 246, 0.2);
border-top: 10px solid transparent;
}
.chat-message.bot .message-bubble::after {
content: '';
position: absolute;
left: -10px;
bottom: 0;
width: 0;
height: 0;
border-right: 10px solid rgba(16, 185, 129, 0.2);
border-top: 10px solid transparent;
}
.message-content p {
margin: 0 0 5px 0;
}
.message-content pre {
background-color: #eef;
border: 1px solid #ddd;
padding: 10px;
border-radius: 5px;
overflow-x: auto;
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
font-size: 14px;
white-space: pre-wrap;
word-break: break-all;
}
.message-content code {
background-color: #eef;
padding: 2px 4px;
border-radius: 3px;
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
font-size: 14px;
}
.message-timestamp {
font-size: 12px;
color: #999;
margin-top: 5px;
/* 时间戳与气泡的间距 */
}
.chat-message.user .message-timestamp {
text-align: right;
}
.chat-message.bot .message-timestamp {
text-align: left;
}
.chat-input-area {
display: flex;
gap: 15px;
padding-top: 20px;
border-top: 1px solid #eee;
}
#user-input {
flex-grow: 1;
padding: 15px;
border: 1px solid #ccc;
border-radius: 8px;
font-size: 16px;
resize: vertical;
min-height: 60px;
max-height: 150px;
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
#user-input:focus {
border-color: #3498db;
box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
outline: none;
}
#send-btn {
padding: 15px 30px;
font-size: 18px;
}
/* 配置区特定样式 */
.config-form {
background-color: #fdfdfd;
border: 1px solid #e0e0e0;
border-radius: 10px;
padding: 30px;
display: flex;
flex-direction: column;
gap: 20px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
max-width: 800px;
/* 设置最大宽度 */
margin: 0 auto;
/* 居中 */
}
.config-form h3 {
margin-top: 0;
margin-bottom: 15px;
color: #2c3e50;
font-size: 22px;
border-bottom: 1px solid #eee;
padding-bottom: 10px;
}
.config-form label {
font-weight: 600;
color: #555;
margin-bottom: 5px;
display: block;
}
.config-form input[type="text"],
.config-form input[type="password"],
.config-form input[type="number"],
.config-form select {
width: calc(100% - 22px);
/* Adjust for padding and border */
padding: 12px;
border: 1px solid #ccc;
border-radius: 6px;
font-size: 16px;
margin-bottom: 15px;
box-sizing: border-box;
/* Include padding and border in the element's total width and height */
transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.config-form input:focus,
.config-form select:focus {
border-color: #3498db;
box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
outline: none;
}
.password-toggle {
display: flex;
align-items: center;
margin-top: -10px;
margin-bottom: 15px;
}
.password-toggle input[type="checkbox"] {
margin-right: 8px;
width: auto;
}
/* 特征和记忆管理通用样式 */
.role-management,
.memory-management {
background-color: #fdfdfd;
border: 1px solid #e0e0e0;
border-radius: 10px;
padding: 25px;
margin-bottom: 25px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
max-width: 800px;
/* 设置最大宽度 */
margin: 0 auto 25px auto;
/* 居中并保持底部外边距 */
}
.role-management h3,
.memory-management h3 {
margin-top: 0;
margin-bottom: 20px;
color: #2c3e50;
font-size: 22px;
border-bottom: 1px solid #eee;
padding-bottom: 10px;
}
.role-list,
.memory-list {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-bottom: 20px;
max-height: 200px;
/* 限制高度,允许滚动 */
overflow-y: auto;
padding-right: 10px;
/* 为滚动条留出空间 */
}
.role-item,
.memory-item {
background-color: #e8f4fd;
border: 1px solid #d0eafc;
padding: 10px 15px;
border-radius: 20px;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.2s ease;
font-size: 15px;
color: #3498db;
font-weight: 500;
display: flex;
align-items: center;
gap: 8px;
}
.role-item.active,
.memory-item.active {
background-color: #3498db;
color: #fff;
border-color: #2980b9;
}
.role-item:hover,
.memory-item:hover {
transform: translateY(-2px);
box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}
.new-role-form,
.new-memory-form {
display: flex;
gap: 10px;
margin-top: 20px;
padding-top: 15px;
border-top: 1px solid #eee;
}
.new-role-form input,
.new-memory-form input {
flex-grow: 1;
padding: 10px 15px;
border: 1px solid #ccc;
border-radius: 6px;
font-size: 16px;
}
.new-role-form button,
.new-memory-form button {
padding: 10px 20px;
font-size: 16px;
}
.code-editor {
width: 100%;
padding: 15px;
border: 1px solid #e0e0e0;
border-radius: 10px;
background-color: #fdfdfd;
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
font-size: 14px;
line-height: 1.5;
resize: vertical;
min-height: 200px;
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.code-editor:focus {
border-color: #3498db;
box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
outline: none;
}
/* 日志区特定样式 */
.log-viewer {
flex-grow: 1;
background-color: #2d2d2d;
color: #f8f8f2;
border: 1px solid #3a3a3a;
border-radius: 10px;
padding: 20px;
overflow: auto;
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
font-size: 14px;
line-height: 1.4;
white-space: pre-wrap;
word-break: break-all;
box-shadow: inset 0 1px 5px rgba(0, 0, 0, 0.2);
height: auto;
/* 调整为自适应高度 */
min-height: 400px;
/* 设置最小高度 */
}
/* Toast 消息样式 */
#toast-container {
position: fixed;
top: 20px;
right: 20px;
z-index: 1000;
display: flex;
flex-direction: column;
gap: 10px;
}
.toast {
background-color: #333;
color: #fff;
padding: 12px 20px;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
opacity: 0;
transform: translateY(-20px);
animation: fadeInOut 3s forwards;
min-width: 250px;
font-size: 15px;
display: flex;
/* 使内容水平居中 */
align-items: center;
justify-content: center;
/* 文本和图标居中 */
gap: 10px;
/* 图标和文本之间的间距 */
}
.toast i {
font-size: 18px;
}
.toast.success {
background-color: #28a745;
}
.toast.error {
background-color: #dc3545;
}
.toast.info {
background-color: #17a2b8;
}
.toast.warning {
background-color: #f39c12;
/* 警告色 */
}
@keyframes fadeInOut {
0% {
opacity: 0;
transform: translateY(-20px);
}
10% {
opacity: 1;
transform: translateY(0);
}
90% {
opacity: 1;
transform: translateY(0);
}
100% {
opacity: 0;
transform: translateY(-20px);
}
}
/* Toast 消息图标样式 */
.toast.success i::before {
content: "\f058";
/* Font Awesome check-circle icon */
}
.toast.error i::before {
content: "\f06a";
/* Font Awesome exclamation-circle icon */
}
.toast.warning i::before {
content: "\f071";
/* Font Awesome exclamation-triangle icon */
}
.toast.info i::before {
content: "\f05a";
/* Font Awesome info-circle icon */
}
/* 模态框样式 */
.modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.6);
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
opacity: 0;
visibility: hidden;
transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.active {
opacity: 1;
visibility: visible;
}
.modal-content {
background-color: #fff;
padding: 30px;
border-radius: 12px;
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
text-align: center;
max-width: 450px;
width: 90%;
transform: translateY(-50px);
transition: transform 0.3s ease;
}
.modal-overlay.active .modal-content {
transform: translateY(0);
}
.modal-content h3 {
margin-top: 0;
color: #2c3e50;
font-size: 24px;
margin-bottom: 15px;
}
.modal-content p {
color: #555;
font-size: 17px;
line-height: 1.6;
margin-bottom: 30px;
}
.modal-buttons {
display: flex;
justify-content: center;
gap: 15px;
}
.modal-buttons .action-button {
min-width: 120px;
}
/* Markdown 渲染样式 */
.message-bubble h1,
.message-bubble h2,
.message-bubble h3,
.message-bubble h4,
.message-bubble h5,
.message-bubble h6 {
color: #2c3e50;
margin-top: 1em;
margin-bottom: 0.5em;
font-weight: bold;
line-height: 1.2;
}
.message-bubble h1 {
font-size: 2em;
border-bottom: 1px solid #eee;
padding-bottom: 0.3em;
}
.message-bubble h2 {
font-size: 1.75em;
border-bottom: 1px solid #eee;
padding-bottom: 0.3em;
}
.message-bubble h3 {
font-size: 1.5em;
}
.message-bubble h4 {
font-size: 1.25em;
}
.message-bubble h5 {
font-size: 1em;
}
.message-bubble h6 {
font-size: 0.875em;
color: #777;
}
.message-bubble p {
margin: 0.5em 0;
}
.message-bubble ul,
.message-bubble ol {
margin: 0.5em 0 0.5em 20px;
padding: 0;
}
.message-bubble li {
margin-bottom: 0.25em;
}
.message-bubble blockquote {
border-left: 4px solid #ccc;
padding: 0 15px;
color: #777;
margin: 0.5em 0;
}
.message-bubble pre {
background-color: #eef;
border: 1px solid #ddd;
padding: 10px;
border-radius: 5px;
overflow-x: auto;
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
font-size: 0.9em;
white-space: pre-wrap;
word-break: break-all;
margin: 0.5em 0;
}
.message-bubble code {
background-color: #eef;
padding: 2px 4px;
border-radius: 3px;
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
font-size: 0.9em;
}
.message-bubble pre code {
background-color: transparent;
padding: 0;
border-radius: 0;
}
.message-bubble table {
width: 100%;
border-collapse: collapse;
margin: 1em 0;
}
.message-bubble th,
.message-bubble td {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
}
.message-bubble th {
background-color: #f2f2f2;
font-weight: bold;
}
.message-bubble a {
color: #3498db;
text-decoration: none;
}
.message-bubble a:hover {
text-decoration: underline;
}
.message-bubble strong,
.message-bubble b {
font-weight: bold;
}
.message-bubble em,
.message-bubble i {
font-style: italic;
}
/* 响应式设计 */
@media (max-width: 1024px) {
.sidebar {
flex-basis: 220px;
/* 中等屏幕下侧边栏宽度略小 */
padding: 20px 15px;
}
.sidebar .logo {
font-size: 24px;
margin-bottom: 30px;
}
.nav-item {
font-size: 16px;
padding: 12px 15px;
}
.nav-item i {
font-size: 18px;
}
.main-content {
padding: 20px;
}
.section-header h2,
.chat-header h2 {
font-size: 24px;
}
.action-button {
padding: 10px 20px;
font-size: 15px;
}
.chat-message .message-avatar {
width: 35px;
height: 35px;
font-size: 16px;
}
.message-bubble {
padding: 10px 15px;
font-size: 15px;
}
#user-input {
padding: 12px;
font-size: 15px;
}
#send-btn {
padding: 12px 25px;
font-size: 16px;
}
.config-form h3 {
font-size: 20px;
}
.config-form input,
.config-form select {
padding: 10px;
font-size: 15px;
}
.role-item,
.memory-item {
padding: 8px 12px;
font-size: 14px;
}
.new-role-form input,
.new-memory-form input {
padding: 8px 12px;
font-size: 15px;
}
.new-role-form button,
.new-memory-form button {
padding: 8px 15px;
font-size: 15px;
}
.code-editor {
padding: 12px;
font-size: 13px;
}
.log-viewer {
padding: 15px;
font-size: 13px;
}
}
@media (max-width: 768px) {
body {
overflow-y: auto;
/* 允许在小屏幕上垂直滚动 */
min-height: auto;
/* 在小屏幕上允许body高度自应内容 */
}
.container {
flex-direction: column;
/* 垂直堆叠 */
border-radius: 0;
/* 小屏幕下移除圆角 */
box-shadow: none;
/* 移除阴影 */
margin: 0;
/* 移除外边距 */
padding: 0;
/* 移除内边距 */
width: 100%;
/* 确保容器在小屏幕下占据全部宽度 */
min-height: 100vh;
/* 确保容器在小屏幕下占据整个视口高度 */
}
.sidebar {
flex-basis: auto;
/* 允许侧边栏根据内容调整高度 */
width: 100%;
/* 侧边栏全宽 */
border-right: none;
border-bottom: 1px solid #34495e;
/* 底部边框 */
padding: 20px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.sidebar .logo {
margin-bottom: 20px;
}
.nav-menu {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 10px;
margin-bottom: 20px;
}
.nav-item {
flex-grow: 1;
justify-content: center;
text-align: center;
padding: 10px;
font-size: 16px;
margin-bottom: 0;
}
.nav-item i {
margin-right: 0;
margin-bottom: 5px;
/* 图标和文字垂直排列 */
}
.session-info {
display: none;
/* 小屏幕下隐藏会话信息 */
}
.main-content {
padding: 15px;
flex-grow: 1;
/* 允许主内容区占据剩余空间 */
overflow-y: auto;
/* 允许主内容区滚动 */
min-height: calc(100vh - 100px);
/* 确保主内容区在小屏幕下有足够高度 */
}
.chat-window {
padding: 15px;
margin-bottom: 15px;
}
.chat-message .message-content-wrapper {
max-width: 85%;
/* 小屏幕下消息宽度更大 */
}
.chat-input-area {
flex-direction: column;
gap: 10px;
padding-top: 15px;
}
#user-input {
min-height: 50px;
}
#send-btn {
width: 100%;
padding: 12px;
}
.modal-content {
width: 95%;
padding: 20px;
}
.modal-content h3 {
font-size: 20px;
}
.modal-content p {
font-size: 15px;
}
.modal-buttons {
flex-direction: column;
gap: 10px;
}
.modal-buttons .action-button {
width: 100%;
min-width: auto;
}
}
@media (max-width: 480px) {
.sidebar {
padding: 15px;
}
.sidebar .logo {
font-size: 22px;
}
.nav-item {
font-size: 14px;
padding: 8px;
}
.main-content {
padding: 10px;
}
.section-header h2,
.chat-header h2 {
font-size: 20px;
}
.action-button {
padding: 8px 15px;
font-size: 14px;
}
.chat-message .message-avatar {
width: 30px;
height: 30px;
font-size: 14px;
}
.message-bubble {
padding: 8px 12px;
font-size: 14px;
}
#user-input {
padding: 10px;
font-size: 14px;
}
#send-btn {
font-size: 15px;
}
.config-form h3 {
font-size: 18px;
}
.config-form input,
.config-form select {
font-size: 14px;
}
.role-item,
.memory-item {
font-size: 13px;
}
.new-role-form input,
.new-memory-form input {
font-size: 14px;
}
.new-role-form button,
.new-memory-form button {
font-size: 14px;
}
.code-editor {
font-size: 12px;
}
.log-viewer {
font-size: 12px;
}
}