/* 模态框样式 */
.modal-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(4px);
display: none;
align-items: center;
justify-content: center;
z-index: 9999;
animation: modalFadeIn 0.2s ease-out;
}
.modal-overlay.show {
display: flex;
}
@keyframes modalFadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
.modal-container {
background: var(--container-bg);
border-radius: 12px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
min-width: 320px;
max-width: 90vw;
width: 480px;
max-height: 80vh;
display: flex;
flex-direction: column;
animation: modalSlideIn 0.3s ease-out;
}
@keyframes modalSlideIn {
from {
opacity: 0;
transform: scale(0.9) translateY(-20px);
}
to {
opacity: 1;
transform: scale(1) translateY(0);
}
}
.modal-header {
padding: 20px 24px;
border-bottom: 1px solid var(--border-color);
display: flex;
align-items: center;
justify-content: space-between;
flex-shrink: 0;
}
.modal-title {
font-size: 18px;
font-weight: 600;
color: var(--assistant-msg-fg);
margin: 0;
}
.modal-close {
width: 32px;
height: 32px;
border-radius: 50%;
background: transparent;
border: none;
font-size: 28px;
line-height: 1;
color: var(--timestamp-fg);
cursor: pointer;
transition: color 0.2s, transform 0.2s;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
html[data-theme='dark'] .modal-close {
background: transparent;
}
.modal-close:hover {
color: var(--error-fg);
transform: rotate(90deg);
}
.modal-close:active {
transform: rotate(90deg) scale(0.9);
}
.modal-body {
padding: 24px;
overflow-y: auto;
flex: 1;
min-height: 0;
}
.modal-body::-webkit-scrollbar {
width: 6px;
}
.modal-body::-webkit-scrollbar-track {
background: var(--scrollbar-track) !important;
}
.modal-body::-webkit-scrollbar-thumb {
background: var(--scrollbar-thumb) !important;
border-radius: 3px !important;
}
.modal-body::-webkit-scrollbar-thumb:hover {
background: var(--scrollbar-thumb-hover) !important;
}
/* 滚动条样式 */
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-track {
background: var(--scrollbar-track) !important;
border-radius: 4px;
}
::-webkit-scrollbar-thumb {
background: var(--scrollbar-thumb) !important;
border-radius: 4px;
transition: background 0.2s ease !important;
}
::-webkit-scrollbar-thumb:hover {
background: var(--scrollbar-thumb-hover) !important;
}
/* 针对需要更细滚动条的元素进行覆盖 */
.modal-body::-webkit-scrollbar,
.session-list::-webkit-scrollbar {
width: 6px;
}
.modal-body::-webkit-scrollbar-thumb,
.session-list::-webkit-scrollbar-thumb {
border-radius: 3px;
}
#modalMessage {
margin: 0;
font-size: 15px;
line-height: 1.6;
color: var(--assistant-msg-fg);
word-wrap: break-word;
}
.modal-footer {
padding: 16px 24px;
border-top: 1px solid var(--border-color);
display: flex;
gap: 12px;
justify-content: flex-end;
flex-shrink: 0;
}
.modal-btn {
padding: 10px 24px;
border-radius: 8px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
border: none;
white-space: nowrap;
}
.modal-btn-cancel {
background: var(--session-item-hover);
color: var(--assistant-msg-fg);
}
.modal-btn-cancel:hover {
background: var(--border-color);
}
.modal-btn-confirm {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
}
html[data-theme='dark'] .modal-btn-confirm {
background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}
.modal-btn-confirm:hover {
transform: translateY(-2px);
box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}
.modal-btn-confirm:active {
transform: translateY(0);
}
/* 仅显示确定按钮的样式 */
.modal-footer.single-button {
justify-content: center;
}
.modal-footer.single-button .modal-btn-cancel {
display: none;
}
/* 移动端模态框优化 */
@media (max-width: 600px) {
.modal-container {
width: 90vw;
min-width: 280px;
}
.modal-header {
padding: 16px 20px;
}
.modal-title {
font-size: 16px;
}
.modal-body {
padding: 20px;
}
#modalMessage {
font-size: 14px;
}
.modal-footer {
padding: 12px 16px;
}
.modal-btn {
flex: 1;
padding: 10px 16px;
font-size: 14px;
}
}
:root {
--bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
--container-bg: #ffffff;
--header-fg: #ffffff;
--user-msg-bg: #667eea;
--assistant-msg-bg: #f0f0f0;
--assistant-msg-fg: #333;
--error-bg: #ffebee;
--error-fg: #c62828;
--border-color: #e0e0e0;
--input-border: #ddd;
--input-focus: #667eea;
--timestamp-fg: #999;
--timestamp-fg-user: rgba(255, 255, 255, 0.75);
--info-bg: #f9f9f9;
--scrollbar-thumb: rgba(0,0,0,.2);
--scrollbar-thumb-hover: rgba(0,0,0,.3);
--scrollbar-track: rgba(0,0,0,.05);
--select-bg: #ffffff;
--select-option-bg: #ffffff;
--select-option-hover: #f5f5f5;
--sidebar-bg: #f8f9fa;
--session-item-hover: #e9ecef;
--session-item-active: #667eea;
--loading-dot-color: #667eea;
/* 移动端视口高度变量 */
--vh: 1vh;
}
html[data-theme='dark'] {
--bg-gradient: linear-gradient(135deg, #1f2937 0%, #111827 100%);
--container-bg: #1e1e1e;
--header-fg: #e5e7eb;
--user-msg-bg: #0e1e54;
--assistant-msg-bg: #2d2d2d;
--assistant-msg-fg: #d1d5db;
--error-bg: #5c1b1b;
--error-fg: #f87171;
--border-color: #374151;
--input-border: #374151;
--input-focus: #6366f1;
--timestamp-fg: #6b7280;
--timestamp-fg-user: rgba(255, 255, 255, 0.9);
--info-bg: #111827;
--scrollbar-thumb: rgba(156, 163, 175, 0.3);
--scrollbar-thumb-hover: rgba(156, 163, 175, 0.5);
--scrollbar-track: rgba(55, 65, 81, 0.3);
--select-bg: #2d2d2d;
--select-option-bg: #1e1e1e;
--select-option-hover: #374151;
--sidebar-bg: #1a1a1a;
--session-item-hover: #2d2d2d;
--session-item-active: #4f46e5;
--loading-dot-color: #6366f1;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;
background: var(--bg-gradient);
/* 修改为固定全屏布局,支持移动端安全区域 */
height: 100vh;
/* 使用 dvh (动态视口高度) 代替 vh,适配移动端地址栏 */
height: 100dvh;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
color: var(--assistant-msg-fg);
}
/* 为不支持 dvh 的浏览器添加回退 */
@supports not (height: 100dvh) {
body {
height: 100vh;
}
}
/* 聊天容器布局 - 修改为全屏 */
.chat-container {
display: flex;
width: 100vw;
width: 100dvw;
height: 100vh;
height: 100dvh;
background: var(--container-bg);
box-shadow: 0 20px 60px rgba(0,0,0,.3);
overflow: hidden;
position: relative; /* 添加相对定位,作为子元素的定位参考 */
}
/* 为不支持 dvh 的浏览器添加回退 */
@supports not (height: 100dvh) {
.chat-container {
width: 100vw;
height: 100vh;
}
}
/* 会话侧边栏 */
.session-sidebar {
width: 280px;
min-width: 280px;
background: var(--sidebar-bg);
border-right: 1px solid var(--border-color);
display: flex;
flex-direction: column;
transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
z-index: 10; /* 确保侧边栏在正常层级 */
}
.session-sidebar.collapsed {
margin-left: -280px;
/* 移除 absolute,使用负 margin 隐藏 */
z-index: 100; /* 展开时提升层级 */
}
.session-header {
padding: 16px;
border-bottom: 1px solid var(--border-color);
display: flex;
align-items: center;
justify-content: space-between;
}
.session-header h2 {
font-size: 16px;
font-weight: 600;
color: var(--assistant-msg-fg);
}
.btn-new-session {
width: 32px;
height: 32px;
border-radius: 50%;
background: var(--user-msg-bg);
color: white;
border: none;
font-size: 20px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: transform 0.2s;
flex-shrink: 0;
}
.btn-new-session:hover {
transform: scale(1.1);
}
.session-list {
flex: 1;
overflow-y: auto;
padding: 8px;
}
.session-item {
padding: 12px;
margin-bottom: 8px;
border-radius: 8px;
cursor: pointer;
transition: background 0.2s;
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
position: relative;
}
.session-item:hover {
background: var(--session-item-hover);
}
.session-item.active {
background: var(--session-item-active);
color: white;
}
.session-item.active .session-name,
.session-item.active .session-meta {
color: white;
}
/* 待创建的会话样式 */
.session-item.pending {
opacity: 0.6;
cursor: default;
background: var(--session-item-hover);
border: 1px dashed var(--border-color);
}
.session-item.pending .session-name {
font-style: italic;
color: var(--timestamp-fg);
}
.session-item.pending:hover {
background: var(--session-item-hover);
}
.session-info {
flex: 1;
min-width: 0;
overflow: hidden;
position: relative;
}
.session-name {
font-size: 14px;
font-weight: 500;
color: var(--assistant-msg-fg);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-bottom: 4px;
position: relative;
padding-right: 4px;
}
.session-meta {
font-size: 11px;
color: var(--timestamp-fg);
display: flex;
gap: 8px;
}
.btn-delete-session {
width: 28px;
height: 28px;
min-width: 28px;
border-radius: 4px;
background: transparent;
border: none;
font-size: 14px;
cursor: pointer;
opacity: 0;
transition: opacity 0.2s, background-color 0.2s;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.session-item:hover .btn-delete-session {
opacity: 1;
}
.btn-delete-session:hover {
background-color: rgba(239, 68, 68, 0.15);
}
.session-item.active .btn-delete-session:hover {
background-color: rgba(255, 255, 255, 0.2);
}
.sidebar-toggle {
/* 改为 absolute,相对于 chat-main 定位 */
position: absolute;
left: 290px;
top: 20px;
width: 36px;
height: 36px;
background: var(--user-msg-bg);
border: none;
border-radius: 50%;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
font-weight: bold;
color: white;
z-index: 999;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
flex-shrink: 0;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}
html[data-theme='dark'] .sidebar-toggle {
background: var(--user-msg-bg);
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}
.sidebar-toggle:hover {
transform: scale(1.1);
box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}
html[data-theme='dark'] .sidebar-toggle:hover {
box-shadow: 0 4px 16px rgba(79, 70, 229, 0.5);
}
.sidebar-toggle:active {
transform: scale(0.95);
}
/* 收起状态下的按钮位置 */
.session-sidebar.collapsed + .chat-main .sidebar-toggle {
left: 20px;
}
/* 聊天主区域 */
.chat-main {
flex: 1;
display: flex;
flex-direction: column;
min-width: 0;
position: relative; /* 添加相对定位,作为 sidebar-toggle 的定位参考 */
}
.container {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}
.header {
padding: 16px 20px;
border-bottom: 1px solid var(--border-color);
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: var(--header-fg);
display: flex;
align-items: center;
gap: 16px;
flex-wrap: wrap;
}
html[data-theme='dark'] .header {
background: linear-gradient(135deg,#4f46e5 0%,#7c3aed 100%);
}
.header h1 {
font-size: 20px;
margin: 0;
flex: 1;
min-width: 150px;
}
.status {
font-size: 12px;
opacity: .9;
white-space: nowrap;
}
.status.connected::before {
content: '●';
color: #4caf50;
margin-right: 5px;
}
.status.disconnected::before {
content: '●';
color: #f44336;
margin-right: 5px;
}
.theme-toggle {
background: rgba(255,255,255,.15);
color: var(--header-fg);
padding: 6px 12px;
border: none;
border-radius: 6px;
cursor: pointer;
font-size: 12px;
white-space: nowrap;
flex-shrink: 0;
}
.theme-toggle:hover {
background: rgba(255,255,255,.25);
}
html[data-theme='dark'] .theme-toggle {
background: rgba(0,0,0,.3);
}
/* 模型选择器样式 */
.model-selector {
padding: 12px 20px;
border-bottom: 1px solid var(--border-color);
display: flex;
align-items: center;
gap: 12px;
flex-wrap: wrap;
background: var(--container-bg);
}
.model-selector label {
font-size: 14px;
font-weight: 500;
color: var(--assistant-msg-fg);
white-space: nowrap;
}
.model-select {
flex: 1;
min-width: 200px;
max-width: 400px;
padding: 8px 12px;
border: 1px solid var(--input-border);
border-radius: 6px;
font-size: 14px;
font-family: inherit;
background: var(--select-bg);
color: var(--assistant-msg-fg);
cursor: pointer;
transition: border-color 0.2s, box-shadow 0.2s;
}
.model-select:focus {
outline: none;
border-color: var(--input-focus);
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}
html[data-theme='dark'] .model-select:focus {
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.model-select:hover:not(:disabled) {
border-color: var(--input-focus);
}
.model-select:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.model-select optgroup {
font-weight: 600;
font-style: normal;
background: var(--select-option-bg);
color: var(--assistant-msg-fg);
}
.model-select option {
padding: 6px;
font-weight: 400;
background: var(--select-option-bg);
color: var(--assistant-msg-fg);
}
/* 深色模式下 select 的特殊处理 */
html[data-theme='dark'] .model-select {
color-scheme: dark;
}
.chat-area {
flex: 1;
overflow-y: auto;
overflow-x: hidden;
padding: 20px;
display: flex;
flex-direction: column;
gap: 12px;
min-height: 0;
}
.message {
display: flex;
gap: 12px;
animation: slideIn .3s ease-out;
width: 100%;
}
@keyframes slideIn {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.message.user {
justify-content: flex-end;
}
.message-content {
max-width: 70%;
padding: 12px 16px;
border-radius: 12px;
word-wrap: break-word;
word-break: break-word;
overflow-wrap: break-word;
line-height: 1.5;
position: relative;
min-width: 0;
}
.message.user .message-content {
background: var(--user-msg-bg);
color: #fff;
border-radius: 12px 4px 12px 12px;
}
.message.assistant .message-content {
background: var(--assistant-msg-bg);
color: var(--assistant-msg-fg);
border-radius: 4px 12px 12px 12px;
}
.message.error .message-content {
background: var(--error-bg);
color: var(--error-fg);
border-radius: 12px;
}
.avatar {
width: 32px;
height: 32px;
min-width: 32px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
font-size: 16px;
color: #fff;
flex-shrink: 0;
}
.message.user .avatar {
background: #667eea;
order: 2;
}
.message.assistant .avatar {
background: #764ba2;
order: -1;
}
html[data-theme='dark'] .message.user .avatar {
background: #4f46e5;
}
html[data-theme='dark'] .message.assistant .avatar {
background: #7c3aed;
}
.timestamp {
font-size: 11px;
color: var(--timestamp-fg);
margin-top: 6px;
opacity: 0.9;
}
/* 用户消息的时间戳使用不同颜色 */
.message.user .timestamp {
color: var(--timestamp-fg-user);
}
/* 加载动画样式 */
.loading-dots {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 4px 0;
}
.loading-dots span {
width: 8px;
height: 8px;
border-radius: 50%;
background-color: var(--loading-dot-color);
animation: loading-bounce 1.4s infinite ease-in-out both;
}
.loading-dots span:nth-child(1) {
animation-delay: -0.32s;
}
.loading-dots span:nth-child(2) {
animation-delay: -0.16s;
}
@keyframes loading-bounce {
0%, 80%, 100% {
transform: scale(0);
opacity: 0.5;
}
40% {
transform: scale(1);
opacity: 1;
}
}
/* 流式响应中的加载指示器 */
.streaming-indicator {
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
background-color: var(--loading-dot-color);
animation: pulse 1.5s ease-in-out infinite;
margin-left: 4px;
}
@keyframes pulse {
0%, 100% {
opacity: 1;
transform: scale(1);
}
50% {
opacity: 0.3;
transform: scale(0.8);
}
}
.input-area {
padding: 16px 20px;
border-top: 1px solid var(--border-color);
display: flex;
gap: 12px;
flex-wrap: wrap;
align-items: flex-end;
}
.input-group {
flex: 1;
min-width: 200px;
display: flex;
gap: 12px;
align-items: flex-end;
}
textarea {
flex: 1;
padding: 12px 16px;
border: 1px solid var(--input-border);
border-radius: 8px;
font-size: 14px;
font-family: inherit;
resize: vertical;
min-height: 60px;
max-height: 200px;
background: transparent;
color: inherit;
min-width: 0;
}
button {
padding: 12px 20px;
background: linear-gradient(135deg,#667eea 0%,#764ba2 100%);
color: #fff;
border: none;
border-radius: 8px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: transform .2s, box-shadow .2s;
white-space: nowrap;
}
html[data-theme='dark'] button {
background: linear-gradient(135deg,#4f46e5 0%,#7c3aed 100%);
}
button:hover:not(:disabled) {
box-shadow: 0 10px 20px rgba(102,126,234,.3);
}
button:active:not(:disabled) {
transform: translateY(0);
}
button:disabled {
opacity: .6;
cursor: not-allowed;
}
.info {
font-size: 12px;
color: var(--timestamp-fg);
text-align: center;
padding: 10px;
background: var(--info-bg);
}
/* Markdown 样式覆盖 - 确保不会横向溢出 */
.markdown-body {
overflow-wrap: break-word;
word-break: break-word;
}
.markdown-body pre {
overflow-x: auto;
max-width: 100%;
}
.markdown-body code {
word-break: break-all;
}
.markdown-body pre code {
word-break: normal;
}
.markdown-body img {
max-width: 100%;
height: auto;
}
.markdown-body table {
display: block;
overflow-x: auto;
max-width: 100%;
}
/* 平板设备响应式优化 */
@media (max-width: 900px) {
.message-content {
max-width: 75%;
}
}
/* 移动设备响应式优化 */
@media (max-width: 600px) {
body {
/* 确保移动端使用完整可用高度 */
height: 100vh;
height: 100dvh;
/* 使用 JavaScript 计算的真实视口高度 */
height: calc(var(--vh, 1vh) * 100);
min-height: -webkit-fill-available;
}
.chat-container {
flex-direction: column;
height: 100vh;
height: 100dvh;
height: calc(var(--vh, 1vh) * 100);
min-height: -webkit-fill-available;
overflow: hidden;
/* 移除 fixed,使用正常文档流 */
position: relative;
/* 不再需要 top/left/right/bottom */
}
.session-sidebar {
/* 使用 absolute 替代 fixed,相对于 chat-container 定位 */
position: absolute;
left: 0;
top: 0;
width: 280px;
height: 100%;
z-index: 1000;
margin-left: 0;
transform: translateX(-100%);
transition: transform 0.3s ease;
/* 防止内容被挤压 */
pointer-events: none;
}
.session-sidebar.show {
transform: translateX(0);
pointer-events: auto;
}
.session-sidebar.collapsed {
margin-left: 0;
transform: translateX(-100%);
}
/* 显示侧边栏关闭按钮 */
.session-sidebar .sidebar-close-btn {
display: flex;
}
/* 移动端会话名称支持长按显示完整标题 */
.session-name {
-webkit-touch-callout: default;
-webkit-user-select: text;
user-select: text;
}
/* 为长标题添加渐变淡出效果 */
.session-name::after {
content: '';
position: absolute;
right: 0;
top: 0;
width: 30px;
height: 100%;
background: linear-gradient(to left, var(--sidebar-bg), transparent);
pointer-events: none;
}
.session-item.active .session-name::after {
background: linear-gradient(to left, var(--session-item-active), transparent);
}
.session-item:hover .session-name::after {
background: linear-gradient(to left, var(--session-item-hover), transparent);
}
.sidebar-toggle {
/* 改为 absolute,相对于父容器定位 */
position: absolute;
left: 16px;
top: 16px;
width: 40px;
height: 40px;
font-size: 20px;
z-index: 998;
}
.chat-main {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
position: relative;
}
.container {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
position: relative;
}
.header {
padding: 12px 16px;
gap: 8px;
min-height: 64px;
display: flex;
grid-template-columns: 1fr auto auto;
grid-template-rows: 1fr;
align-items: center;
flex-wrap: nowrap;
flex-shrink: 0;
}
.header h1 {
font-size: 16px;
grid-column: 1;
grid-row: 1;
min-width: 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin: 0;
}
.status {
font-size: 11px;
grid-column: 2;
grid-row: 1;
margin: 0;
}
.theme-toggle {
padding: 8px;
font-size: 18px;
grid-column: 3;
grid-row: 1;
min-width: 36px;
width: 36px;
height: 36px;
display: flex;
align-items: center;
justify-content: center;
margin: 0;
}
.model-selector {
padding: 10px 12px;
gap: 8px;
flex-shrink: 0;
}
.model-selector label {
font-size: 13px;
width: 100%;
}
.model-select {
width: 100%;
min-width: 0;
max-width: none;
font-size: 13px;
padding: 8px 10px;
}
.chat-area {
padding: 16px 12px;
gap: 10px;
flex: 1;
overflow-y: auto;
overflow-x: hidden;
-webkit-overflow-scrolling: touch;
min-height: 0;
/* 优化移动端滚动性能 */
will-change: scroll-position;
transform: translateZ(0);
-webkit-transform: translateZ(0);
}
.message {
gap: 8px;
}
.message-content {
max-width: 80%;
padding: 10px 14px;
font-size: 14px;
}
.avatar {
width: 28px;
height: 28px;
min-width: 28px;
font-size: 14px;
}
.timestamp {
font-size: 10px;
margin-top: 4px;
}
.input-area {
padding: 12px;
gap: 8px;
flex-shrink: 0;
/* 确保输入框不被键盘遮挡 */
position: relative;
background: var(--container-bg);
}
.input-group {
min-width: 0;
width: 100%;
flex-direction: column;
gap: 8px;
}
textarea {
min-height: 50px;
max-height: 120px;
font-size: 14px;
padding: 10px 12px;
width: 100%;
/* 防止输入时页面缩放 */
font-size: 16px;
}
button {
width: 100%;
padding: 10px 16px;
font-size: 14px;
}
.info {
font-size: 11px;
padding: 8px;
}
.sidebar-toggle-mobile {
width: 36px;
font-size: 18px;
}
}
/* 会话侧边栏遮罩层(仅移动端) */
.sidebar-overlay {
/* 改为 absolute,相对于 chat-container 定位 */
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(4px);
display: none;
z-index: 999;
animation: modalFadeIn 0.2s ease-out;
}
.sidebar-overlay.show {
display: block;
}
/* 消息操作栏容器 */
.message-actions {
display: flex;
align-items: center;
justify-content: flex-start;
gap: 4px;
margin-top: 8px; /* 与内容保持间距 */
padding-top: 4px;
border-top: 1px solid rgba(0,0,0,0.05); /* 可选:加个分割线 */
}
html[data-theme='dark'] .message-actions {
border-top-color: rgba(255,255,255,0.05);
}
/* 取消按钮样式 - 修改为内嵌样式 */
.cancel-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
padding: 0;
margin: 0;
background: transparent;
color: var(--error-fg);
border: 1px solid var(--error-fg);
border-radius: 4px;
cursor: pointer;
transition: all 0.2s;
vertical-align: middle;
}
html[data-theme='dark'] .cancel-btn {
background: transparent;
border-color: var(--error-fg);
}
.cancel-btn:hover {
background: var(--error-fg);
color: white;
transform: none;
box-shadow: none;
}
.cancel-btn:active {
transform: scale(0.95);
}
/* 复制按钮样式补充 */
.btn-copy-markdown {
display: inline-flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
padding: 0;
margin: 0;
background: transparent !important;
border: 1px solid var(--border-color);
border-radius: 4px;
color: var(--timestamp-fg);
cursor: pointer;
transition: all 0.2s;
vertical-align: middle;
}
.btn-copy-markdown:hover {
background: var(--border-color);
color: var(--assistant-msg-fg);
}
/* 删除按钮样式 */
.btn-delete-message {
display: inline-flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
padding: 0;
margin: 0;
background: transparent !important;
border: 1px solid var(--border-color);
border-radius: 4px;
color: var(--timestamp-fg);
cursor: pointer;
transition: all 0.2s;
vertical-align: middle;
}
.btn-delete-message:hover {
background: rgba(239, 68, 68, 0.1) !important;
color: var(--error-fg);
border-color: var(--error-fg);
}