Files
metona-ollama-desktop/css/style.css
T
Metona Desktop 9542a224db style: 重构 UI 为 Windows 11 Fluent Design
- 配色: Mica 材质暗色 (#202020),替代赛博朋克霓虹风
- 字体: Segoe UI Variable,WinUI 3 标准
- 圆角: 4px 控件 / 8px 卡片 / 12px 弹窗
- 按钮: WinUI Button 风格,移除渐变发光
- 开关: WinUI ToggleSwitch 风格
- 输入框: 聚焦时 border-focus 蓝色边框
- 弹窗: ContentDialog 风格,scale 入场动画
- 移除: 霓虹渐变、毛玻璃光效、脉冲动画
- 保持: 所有功能不变,纯样式重构
2026-04-05 23:16:29 +08:00

2157 lines
42 KiB
CSS

/* ═══════════════════════════════════════════════════════════════
Metona Ollama — Windows 11 Fluent Design 暗色主题
Mica 材质 · Segoe UI Variable · WinUI 3 控件风格
═══════════════════════════════════════════════════════════════ */
/* ── CSS 变量 ── */
:root {
/* Windows 11 暗色调色板 */
--bg-solid: #202020;
--bg-card: #2d2d2d;
--bg-card-hover: #323232;
--bg-layer: #383838;
--bg-layer-alt: #2a2a2a;
--bg-smoke: rgba(0, 0, 0, 0.3);
--bg-mica: rgba(32, 32, 32, 0.72);
--bg-acrylic: rgba(32, 32, 32, 0.8);
--border-subtle: rgba(255, 255, 255, 0.06);
--border-default: rgba(255, 255, 255, 0.08);
--border-strong: rgba(255, 255, 255, 0.12);
--border-focus: #60CDFF;
--text-primary: #FFFFFF;
--text-secondary: #999999;
--text-tertiary: #666666;
--text-disabled: #505050;
--accent: #60CDFF;
--accent-hover: #7AD8FF;
--accent-subtle: rgba(96, 205, 255, 0.06);
--accent-subtle-hover: rgba(96, 205, 255, 0.1);
--critical: #F1707B;
--critical-bg: rgba(241, 112, 123, 0.06);
--success: #6CCB5F;
--success-bg: rgba(108, 203, 95, 0.06);
--caution: #FCE100;
--caution-bg: rgba(252, 225, 0, 0.06);
/* 圆角 — Windows 11 标准 */
--radius-control: 4px;
--radius-sm: 8px;
--radius-md: 8px;
--radius-lg: 12px;
--radius-xl: 16px;
/* 阴影 — Fluent Design 深度 */
--shadow-flyout: 0 8px 16px rgba(0, 0, 0, 0.14);
--shadow-dialog: 0 24px 48px rgba(0, 0, 0, 0.18);
--shadow-tooltip: 0 4px 8px rgba(0, 0, 0, 0.14);
/* 字体 */
--font: 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, sans-serif;
--font-mono: 'Cascadia Mono', 'Cascadia Code', 'Consolas', monospace;
--transition: 167ms cubic-bezier(0, 0, 0, 1);
--transition-fast: 83ms cubic-bezier(0, 0, 0, 1);
}
/* ── 全局重置 ── */
*, *::before, *::after {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html, body {
height: 100%;
overflow: hidden;
background: var(--bg-solid);
color: var(--text-primary);
font-family: var(--font);
font-size: 14px;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
#app {
display: flex;
flex-direction: column;
height: 100vh;
}
/* ═══ 顶部导航 ═══ */
.app-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 16px;
background: var(--bg-mica);
backdrop-filter: saturate(180%) blur(20px);
-webkit-backdrop-filter: saturate(180%) blur(20px);
border-bottom: 1px solid var(--border-subtle);
flex-shrink: 0;
z-index: 10;
}
.header-left {
display: flex;
align-items: center;
gap: 10px;
min-width: 0;
flex: 1;
}
.logo {
font-size: 20px;
flex-shrink: 0;
}
.app-title {
font-size: 14px;
font-weight: 600;
color: var(--text-primary);
white-space: nowrap;
}
.app-version {
font-size: 10px;
font-weight: 600;
color: var(--text-secondary);
background: var(--bg-layer);
border: 1px solid var(--border-default);
border-radius: 12px;
padding: 1px 8px;
white-space: nowrap;
user-select: none;
}
.header-right {
display: flex;
align-items: center;
gap: 4px;
}
/* ── 连接状态 ── */
.conn-status {
display: flex;
align-items: center;
gap: 6px;
padding: 4px 10px;
border-radius: var(--radius-control);
font-size: 12px;
color: var(--text-secondary);
}
.status-dot {
width: 8px;
height: 8px;
border-radius: 50%;
transition: var(--transition);
}
.status-label {
white-space: nowrap;
}
.conn-status.connected .status-dot {
background: var(--success);
box-shadow: 0 0 4px var(--success);
}
.conn-status.disconnected .status-dot {
background: var(--critical);
}
.conn-status.pending .status-dot {
background: var(--caution);
animation: blink 1s ease-in-out infinite;
}
@keyframes blink {
0%, 100% { opacity: 1; }
50% { opacity: 0.4; }
}
/* ── 图标按钮 (WinUI 3 风格) ── */
.icon-btn {
display: flex;
align-items: center;
justify-content: center;
width: 36px;
height: 36px;
border: none;
background: transparent;
color: var(--text-secondary);
border-radius: var(--radius-control);
cursor: pointer;
transition: var(--transition);
position: relative;
}
.icon-btn::before {
content: '';
position: absolute;
inset: 0;
border-radius: var(--radius-control);
background: currentColor;
opacity: 0;
transition: var(--transition);
}
.icon-btn:hover::before {
opacity: 0.06;
}
.icon-btn:active::before {
opacity: 0.04;
}
.icon-btn:hover {
color: var(--text-primary);
}
.icon-btn:active {
transform: scale(0.97);
}
.icon-btn svg {
width: 18px;
height: 18px;
position: relative;
z-index: 1;
}
.icon-btn.disabled,
.icon-btn:disabled {
opacity: 0.36;
cursor: not-allowed;
pointer-events: none;
}
.icon-btn.sm {
width: 28px;
height: 28px;
}
.icon-btn.sm svg {
width: 14px;
height: 14px;
}
.icon-btn.danger:hover {
color: var(--critical);
}
.help-btn {
margin-left: 2px;
opacity: 0.5;
}
.help-btn:hover {
opacity: 1;
}
/* ═══ 模型选择栏 ═══ */
.model-bar {
display: flex;
align-items: center;
gap: 10px;
padding: 8px 16px;
background: var(--bg-layer-alt);
border-bottom: 1px solid var(--border-subtle);
flex-shrink: 0;
}
.model-bar-icon {
width: 28px;
height: 28px;
border-radius: var(--radius-control);
background: var(--accent-subtle);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.model-bar-icon svg {
width: 14px;
height: 14px;
color: var(--accent);
}
.model-select-wrap {
position: relative;
flex: 1;
min-width: 0;
display: flex;
align-items: center;
}
.model-select {
width: 100%;
padding: 6px 32px 6px 12px;
background: var(--bg-layer);
border: 1px solid var(--border-default);
border-radius: var(--radius-control);
color: var(--text-primary);
font-size: 13px;
font-family: var(--font);
outline: none;
cursor: pointer;
transition: var(--transition);
appearance: none;
-webkit-appearance: none;
}
.model-select:focus {
border-color: var(--border-focus);
box-shadow: 0 0 0 1px var(--border-focus);
}
.model-select:hover {
border-color: var(--border-strong);
}
.model-select option {
background: var(--bg-card);
color: var(--text-primary);
}
.model-select-arrow {
position: absolute;
right: 8px;
top: 50%;
transform: translateY(-50%);
pointer-events: none;
color: var(--text-tertiary);
}
.model-select-arrow svg {
width: 14px;
height: 14px;
}
.model-badges {
display: flex;
gap: 6px;
flex-shrink: 0;
}
.model-badge {
font-size: 11px;
font-weight: 500;
white-space: nowrap;
padding: 3px 8px;
border-radius: var(--radius-control);
border: 1px solid;
}
.think-badge {
color: var(--accent);
background: var(--accent-subtle);
border-color: rgba(96, 205, 255, 0.15);
}
.vision-badge {
color: var(--success);
background: var(--success-bg);
border-color: rgba(108, 203, 95, 0.15);
}
.rag-badge {
color: #B388FF;
background: rgba(179, 136, 255, 0.06);
border-color: rgba(179, 136, 255, 0.15);
}
/* ── 预设栏 ── */
.preset-bar {
display: flex;
align-items: center;
gap: 8px;
padding: 6px 16px;
background: var(--bg-layer-alt);
border-bottom: 1px solid var(--border-subtle);
flex-shrink: 0;
}
.preset-list {
display: flex;
gap: 6px;
flex: 1;
overflow-x: auto;
overflow-y: hidden;
scrollbar-width: none;
-ms-overflow-style: none;
padding: 2px 0;
}
.preset-list::-webkit-scrollbar { display: none; }
.preset-chip {
display: flex;
align-items: center;
gap: 5px;
padding: 4px 12px;
border-radius: var(--radius-control);
border: 1px solid var(--border-default);
background: var(--bg-layer);
color: var(--text-secondary);
font-size: 12px;
font-family: var(--font);
white-space: nowrap;
cursor: pointer;
transition: var(--transition);
flex-shrink: 0;
user-select: none;
}
.preset-chip:hover {
background: var(--bg-card-hover);
border-color: var(--border-strong);
color: var(--text-primary);
}
.preset-chip.active {
background: var(--accent-subtle);
border-color: var(--accent);
color: var(--accent);
font-weight: 600;
}
.preset-chip.active:hover {
background: var(--accent-subtle-hover);
}
.preset-chip-icon {
font-size: 13px;
line-height: 1;
}
.preset-chip-name {
line-height: 1;
}
.preset-add-btn {
width: 28px;
height: 28px;
border-radius: var(--radius-control);
border: 1px dashed var(--border-default);
background: transparent;
color: var(--text-tertiary);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: var(--transition);
flex-shrink: 0;
}
.preset-add-btn:hover {
border-color: var(--accent);
color: var(--accent);
background: var(--accent-subtle);
}
.preset-add-btn svg {
width: 14px;
height: 14px;
}
/* ── 预设模态框 ── */
.preset-name-row {
display: flex;
gap: 8px;
align-items: center;
}
.preset-icon-input {
width: 52px !important;
text-align: center;
font-size: 16px;
flex-shrink: 0;
padding: 6px 4px !important;
}
.preset-temp-slider {
width: 100%;
-webkit-appearance: none;
appearance: none;
height: 4px;
border-radius: 2px;
background: var(--bg-layer);
outline: none;
margin: 8px 0;
}
.preset-temp-slider::-webkit-slider-thumb {
-webkit-appearance: none;
width: 16px;
height: 16px;
border-radius: 50%;
background: var(--accent);
cursor: pointer;
box-shadow: 0 0 0 4px transparent;
transition: box-shadow var(--transition);
}
.preset-temp-slider::-webkit-slider-thumb:hover {
box-shadow: 0 0 0 3px var(--accent-subtle);
}
.preset-temp-slider::-moz-range-thumb {
width: 16px;
height: 16px;
border-radius: 50%;
background: var(--accent);
cursor: pointer;
border: none;
}
.preset-modal-actions {
display: flex;
gap: 8px;
align-items: center;
margin-top: 16px;
padding-top: 12px;
border-top: 1px solid var(--border-subtle);
}
/* ── Think 按钮 ── */
.think-toggle {
display: flex;
align-items: center;
cursor: pointer;
flex-shrink: 0;
user-select: none;
}
.think-toggle input { display: none; }
.think-btn {
width: 36px;
height: 36px;
border-radius: var(--radius-control);
background: var(--bg-layer);
border: 1px solid var(--border-default);
display: flex;
align-items: center;
justify-content: center;
transition: var(--transition);
color: var(--text-tertiary);
}
.think-btn svg {
width: 18px;
height: 18px;
}
.think-toggle:not(.unavailable):hover .think-btn {
border-color: var(--border-strong);
color: var(--text-secondary);
}
.think-toggle input:checked + .think-btn {
background: var(--accent-subtle);
border-color: var(--accent);
color: var(--accent);
}
.think-toggle input:checked + .think-btn:hover {
background: var(--accent-subtle-hover);
}
.think-toggle.unavailable .think-btn {
opacity: 0.36;
cursor: not-allowed;
}
/* ── 开关控件 (WinUI ToggleSwitch) ── */
.toggle-label {
display: flex;
align-items: center;
gap: 8px;
font-size: 12px;
color: var(--text-secondary);
cursor: pointer;
user-select: none;
white-space: nowrap;
}
.toggle-label input { display: none; }
.toggle-slider {
position: relative;
width: 40px;
height: 20px;
background: var(--bg-layer);
border: 1px solid var(--border-default);
border-radius: 10px;
transition: var(--transition);
}
.toggle-slider::after {
content: '';
position: absolute;
top: 2px;
left: 2px;
width: 14px;
height: 14px;
background: var(--text-secondary);
border-radius: 50%;
transition: var(--transition);
}
.toggle-label input:checked + .toggle-slider {
background: var(--accent);
border-color: var(--accent);
}
.toggle-label input:checked + .toggle-slider::after {
transform: translateX(20px);
background: var(--bg-solid);
}
/* ═══ 聊天区域 ═══ */
.chat-area {
flex: 1;
overflow-y: auto;
overflow-x: hidden;
padding: 16px;
scroll-behavior: smooth;
}
.chat-area::-webkit-scrollbar {
width: 8px;
}
.chat-area::-webkit-scrollbar-track {
background: transparent;
}
.chat-area::-webkit-scrollbar-thumb {
background: var(--border-default);
border-radius: 4px;
}
.chat-area::-webkit-scrollbar-thumb:hover {
background: var(--border-strong);
}
/* ── 回到底部按钮 ── */
.scroll-to-bottom {
position: sticky;
bottom: 16px;
float: right;
margin-right: 4px;
display: flex;
align-items: center;
gap: 6px;
padding: 6px 14px;
border: 1px solid var(--border-default);
background: var(--bg-card);
backdrop-filter: blur(20px);
border-radius: var(--radius-control);
color: var(--text-secondary);
font-size: 12px;
font-family: var(--font);
cursor: pointer;
z-index: 5;
box-shadow: var(--shadow-flyout);
transition: var(--transition);
animation: fadeSlideUp 167ms ease;
}
.scroll-to-bottom:hover {
background: var(--bg-card-hover);
border-color: var(--border-strong);
color: var(--text-primary);
}
.scroll-to-bottom:active {
transform: scale(0.98);
}
.scroll-to-bottom svg {
width: 14px;
height: 14px;
}
@keyframes fadeSlideUp {
from { opacity: 0; transform: translateY(8px); }
to { opacity: 1; transform: translateY(0); }
}
/* ── 空状态 ── */
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
gap: 12px;
color: var(--text-tertiary);
}
.empty-icon svg {
width: 80px;
height: 80px;
opacity: 0.3;
color: var(--text-tertiary);
}
.empty-state h2 {
font-size: 20px;
font-weight: 600;
color: var(--text-primary);
}
.empty-state p {
font-size: 14px;
color: var(--text-tertiary);
}
/* ── 消息气泡 ── */
.messages {
display: flex;
flex-direction: column;
gap: 12px;
max-width: 780px;
margin: 0 auto;
}
.message {
display: flex;
gap: 12px;
animation: fadeSlideUp 167ms ease;
}
.msg-avatar {
flex-shrink: 0;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
border-radius: var(--radius-control);
background: var(--bg-layer);
border: 1px solid var(--border-subtle);
}
.msg-body {
flex: 1;
min-width: 0;
}
.msg-role {
font-size: 12px;
font-weight: 600;
color: var(--text-tertiary);
margin-bottom: 4px;
display: flex;
align-items: center;
gap: 8px;
}
.model-tag {
display: inline-block;
font-size: 11px;
font-weight: 600;
color: var(--accent);
background: var(--accent-subtle);
border: 1px solid rgba(96, 205, 255, 0.15);
border-radius: var(--radius-control);
padding: 1px 8px;
line-height: 1.5;
white-space: nowrap;
}
.message.user .msg-body {
background: var(--bg-layer);
border: 1px solid var(--border-subtle);
border-radius: var(--radius-md);
padding: 10px 14px;
}
.message.assistant .msg-body {
background: var(--bg-card);
border: 1px solid var(--border-subtle);
border-radius: var(--radius-md);
padding: 10px 14px;
}
.msg-content {
font-size: 14px;
line-height: 1.65;
word-break: break-word;
}
.msg-content pre {
background: var(--bg-solid);
border: 1px solid var(--border-default);
border-radius: var(--radius-control);
padding: 12px 14px;
overflow-x: auto;
font-family: var(--font-mono);
font-size: 13px;
margin: 8px 0;
}
.msg-content code {
background: rgba(255, 255, 255, 0.06);
padding: 1px 5px;
border-radius: 3px;
font-family: var(--font-mono);
font-size: 0.9em;
}
.msg-content pre code {
background: none;
padding: 0;
}
.msg-content p { margin-bottom: 8px; }
.msg-content p:last-child { margin-bottom: 0; }
/* 思考块 */
.think-block {
margin-bottom: 8px;
border: 1px solid rgba(252, 225, 0, 0.12);
border-radius: var(--radius-control);
overflow: hidden;
}
.think-header {
display: flex;
align-items: center;
gap: 6px;
padding: 6px 10px;
background: var(--caution-bg);
color: var(--caution);
font-size: 12px;
cursor: pointer;
user-select: none;
}
.think-header .chevron {
margin-left: auto;
transition: transform var(--transition);
}
.think-header .chevron.expanded {
transform: rotate(180deg);
}
.think-content {
padding: 8px 12px;
background: rgba(252, 225, 0, 0.02);
}
.think-content pre {
font-size: 12px;
color: var(--text-secondary);
white-space: pre-wrap;
word-break: break-word;
margin: 0;
background: none;
border: none;
padding: 0;
}
/* 打字光标 */
.typing-cursor {
display: inline-block;
width: 2px;
height: 1em;
background: var(--accent);
animation: caretBlink 1s step-end infinite;
vertical-align: text-bottom;
margin-left: 1px;
}
@keyframes caretBlink {
0%, 100% { opacity: 1; }
50% { opacity: 0; }
}
/* ═══ Loading 动画 ═══ */
.loading-dots {
display: inline-flex;
align-items: center;
gap: 5px;
padding: 8px 0;
}
.loading-dots span {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--text-tertiary);
animation: dotPulse 1.4s ease-in-out infinite;
}
.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
40% { transform: scale(1); opacity: 1; }
}
.loading-text {
font-size: 12px;
color: var(--text-tertiary);
animation: loadingFade 1.5s ease-in-out infinite;
}
@keyframes loadingFade {
0%, 100% { opacity: 0.4; }
50% { opacity: 0.8; }
}
/* 消息图片 */
.msg-images {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-top: 8px;
}
.msg-img {
max-width: 200px;
max-height: 200px;
border-radius: var(--radius-control);
border: 1px solid var(--border-subtle);
object-fit: cover;
}
.msg-img[data-lightbox] {
cursor: zoom-in;
transition: var(--transition);
}
.msg-img[data-lightbox]:hover {
opacity: 0.85;
}
/* 文件 chip */
.msg-files {
display: flex;
flex-wrap: wrap;
gap: 6px;
margin-top: 8px;
}
.msg-files .file-chip {
background: var(--accent-subtle);
border-color: rgba(96, 205, 255, 0.12);
}
/* 统计信息 */
.msg-stats {
display: flex;
gap: 12px;
margin-top: 6px;
font-size: 11px;
color: var(--text-tertiary);
}
/* RAG 知识库来源 */
.rag-sources {
margin-top: 8px;
padding: 8px 12px;
background: var(--accent-subtle);
border: 1px solid rgba(96, 205, 255, 0.1);
border-radius: var(--radius-control);
font-size: 12px;
}
.rag-sources-header {
color: var(--accent);
font-weight: 600;
margin-bottom: 4px;
font-size: 11px;
}
.rag-source-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 3px 0;
color: var(--text-tertiary);
}
.rag-source-item + .rag-source-item {
border-top: 1px solid var(--border-subtle);
}
.rag-source-name {
color: var(--text-secondary);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.rag-source-score {
color: var(--success);
font-weight: 500;
margin-left: 8px;
flex-shrink: 0;
}
/* ═══ 输入区域 ═══ */
.input-area {
flex-shrink: 0;
padding: 10px 16px 14px;
background: var(--bg-mica);
backdrop-filter: saturate(180%) blur(20px);
-webkit-backdrop-filter: saturate(180%) blur(20px);
border-top: 1px solid var(--border-subtle);
}
.image-preview {
display: flex;
gap: 8px;
padding: 8px 0;
flex-wrap: wrap;
}
.preview-thumb {
position: relative;
width: 56px;
height: 56px;
border-radius: var(--radius-control);
overflow: hidden;
border: 1px solid var(--border-default);
}
.preview-thumb img {
width: 100%;
height: 100%;
object-fit: cover;
}
.remove-img {
position: absolute;
top: 2px;
right: 2px;
width: 18px;
height: 18px;
border: none;
background: var(--critical);
color: white;
border-radius: 50%;
font-size: 12px;
line-height: 1;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
}
/* 文件预览 */
.file-preview {
display: flex;
flex-wrap: wrap;
gap: 6px;
padding: 8px 0;
}
.file-chip {
display: flex;
align-items: center;
gap: 6px;
padding: 4px 10px;
border-radius: var(--radius-control);
background: var(--accent-subtle);
border: 1px solid rgba(96, 205, 255, 0.12);
font-size: 12px;
line-height: 1;
transition: var(--transition);
animation: fadeSlideUp 167ms ease;
}
.file-chip:hover {
background: var(--accent-subtle-hover);
border-color: rgba(96, 205, 255, 0.2);
}
.file-icon {
font-size: 13px;
flex-shrink: 0;
}
.file-name {
font-weight: 600;
color: var(--text-primary);
max-width: 160px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.file-size {
color: var(--text-tertiary);
flex-shrink: 0;
}
.remove-file {
background: none;
border: none;
color: var(--text-tertiary);
cursor: pointer;
font-size: 14px;
line-height: 1;
padding: 0 2px;
border-radius: 3px;
transition: var(--transition);
}
.remove-file:hover {
color: var(--critical);
background: var(--critical-bg);
}
.input-row {
display: flex;
align-items: flex-end;
gap: 8px;
}
.attach-btn {
flex-shrink: 0;
}
.chat-input {
flex: 1;
padding: 8px 12px;
background: var(--bg-layer);
border: 1px solid var(--border-default);
border-radius: var(--radius-control);
color: var(--text-primary);
font-family: var(--font);
font-size: 14px;
resize: none;
outline: none;
min-height: 36px;
max-height: 120px;
line-height: 1.5;
transition: var(--transition);
}
.chat-input:focus {
border-color: var(--border-focus);
box-shadow: 0 0 0 1px var(--border-focus);
}
.chat-input::placeholder {
color: var(--text-disabled);
}
.send-btn {
flex-shrink: 0;
width: 36px;
height: 36px;
border: none;
border-radius: var(--radius-control);
background: var(--accent);
color: #1a1a1a;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: var(--transition);
}
.send-btn:hover {
background: var(--accent-hover);
}
.send-btn:active {
transform: scale(0.96);
}
.send-btn.disabled {
opacity: 0.36;
cursor: not-allowed;
pointer-events: none;
}
.send-btn svg {
width: 16px;
height: 16px;
}
.send-btn.stop-btn {
background: var(--critical);
color: white;
}
.send-btn.stop-btn:hover {
opacity: 0.9;
}
.spinner {
width: 16px;
height: 16px;
border: 2px solid rgba(255, 255, 255, 0.3);
border-top-color: white;
border-radius: 50%;
animation: spin 0.8s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
/* ═══ 历史只读提示栏 ═══ */
.history-view-bar {
display: flex;
align-items: center;
gap: 10px;
padding: 6px 16px;
background: rgba(96, 205, 255, 0.04);
border-top: 1px solid rgba(96, 205, 255, 0.1);
font-size: 13px;
color: var(--accent);
flex-shrink: 0;
}
/* ═══ 模态框 (WinUI ContentDialog 风格) ═══ */
.modal-overlay {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(16px);
-webkit-backdrop-filter: blur(16px);
display: flex;
align-items: center;
justify-content: center;
z-index: 100;
animation: overlayIn 167ms ease;
padding: 20px;
}
@keyframes overlayIn {
from { opacity: 0; }
to { opacity: 1; }
}
.modal {
background: var(--bg-card);
border: 1px solid var(--border-default);
border-radius: var(--radius-lg);
box-shadow: var(--shadow-dialog);
width: 100%;
max-width: 480px;
max-height: 80vh;
display: flex;
flex-direction: column;
animation: dialogIn 200ms cubic-bezier(0, 0, 0, 1);
overflow: hidden;
}
@keyframes dialogIn {
from { opacity: 0; transform: scale(0.96) translateY(8px); }
to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-lg {
max-width: 860px;
width: 96vw;
max-height: 85vh;
}
.modal-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 20px;
border-bottom: 1px solid var(--border-subtle);
flex-shrink: 0;
}
.modal-header h3 {
font-size: 16px;
font-weight: 600;
color: var(--text-primary);
}
.modal-body {
padding: 16px 20px;
overflow-y: auto;
flex: 1;
}
/* ── 设置项 ── */
.setting-group {
margin-bottom: 16px;
padding-bottom: 16px;
border-bottom: 1px solid var(--border-subtle);
}
.setting-group:last-child {
border-bottom: none;
margin-bottom: 0;
}
.setting-label {
display: flex;
align-items: center;
font-size: 13px;
font-weight: 600;
color: var(--text-secondary);
margin-bottom: 6px;
}
.setting-input {
width: 100%;
padding: 8px 10px;
background: var(--bg-layer);
border: 1px solid var(--border-default);
border-radius: var(--radius-control);
color: var(--text-primary);
font-size: 13px;
font-family: var(--font);
outline: none;
margin-bottom: 6px;
transition: var(--transition);
}
.setting-input:focus {
border-color: var(--border-focus);
box-shadow: 0 0 0 1px var(--border-focus);
}
.setting-input::placeholder {
color: var(--text-disabled);
}
/* ── 按钮 (WinUI Button 风格) ── */
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 6px 16px;
border: 1px solid transparent;
border-radius: var(--radius-control);
font-size: 13px;
font-weight: 400;
font-family: var(--font);
cursor: pointer;
transition: var(--transition);
gap: 6px;
position: relative;
outline: none;
}
.btn::before {
content: '';
position: absolute;
inset: 0;
border-radius: inherit;
background: currentColor;
opacity: 0;
transition: var(--transition);
}
.btn:hover::before { opacity: 0.06; }
.btn:active::before { opacity: 0.04; }
.btn:active {
transform: scale(0.98);
}
.btn-primary {
background: var(--accent);
color: #1a1a1a;
border-color: transparent;
}
.btn-primary:hover {
background: var(--accent-hover);
}
.btn-primary::before { display: none; }
.btn-outline {
background: var(--bg-layer);
border: 1px solid var(--border-default);
color: var(--text-secondary);
}
.btn-outline:hover {
border-color: var(--border-strong);
color: var(--text-primary);
}
.btn-danger {
background: var(--critical-bg);
border: 1px solid rgba(241, 112, 123, 0.15);
color: var(--critical);
}
.btn-danger:hover {
background: rgba(241, 112, 123, 0.1);
}
.btn-sm {
padding: 4px 10px;
font-size: 12px;
}
/* ── 连接信息 ── */
.connection-info {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 8px;
}
.status-badge {
padding: 3px 10px;
border-radius: var(--radius-control);
font-size: 12px;
font-weight: 500;
}
.status-badge.success {
background: var(--success-bg);
color: var(--success);
border: 1px solid rgba(108, 203, 95, 0.15);
}
.status-badge.error {
background: var(--critical-bg);
color: var(--critical);
border: 1px solid rgba(241, 112, 123, 0.15);
}
.status-badge.warning {
background: var(--caution-bg);
color: var(--caution);
border: 1px solid rgba(252, 225, 0, 0.15);
}
.server-version {
font-size: 12px;
color: var(--text-tertiary);
font-family: var(--font-mono);
}
.cors-hint {
padding: 10px;
background: var(--caution-bg);
border: 1px solid rgba(252, 225, 0, 0.1);
border-radius: var(--radius-control);
margin-top: 8px;
}
.cors-hint p {
font-size: 12px;
color: var(--caution);
margin-bottom: 6px;
}
.cors-hint code {
display: block;
padding: 8px;
background: var(--bg-solid);
border-radius: 3px;
font-family: var(--font-mono);
font-size: 12px;
color: var(--accent);
user-select: all;
}
/* ── 运行中的模型 ── */
.running-models {
display: flex;
flex-direction: column;
gap: 6px;
margin-bottom: 10px;
}
.running-model {
display: flex;
align-items: center;
gap: 10px;
padding: 8px 10px;
background: var(--bg-layer);
border-radius: var(--radius-control);
border: 1px solid var(--border-subtle);
}
.running-model .model-name {
flex: 1;
font-size: 13px;
font-weight: 500;
}
.running-model .model-vram {
font-size: 12px;
color: var(--text-tertiary);
font-family: var(--font-mono);
}
.text-muted {
color: var(--text-tertiary);
font-size: 13px;
}
/* ── 历史记录 ── */
.history-list {
display: flex;
flex-direction: column;
gap: 2px;
}
.history-search-wrap {
position: relative;
margin-bottom: 10px;
}
.history-search-input {
width: 100%;
padding: 8px 32px 8px 12px;
background: var(--bg-layer);
border: 1px solid var(--border-default);
border-radius: var(--radius-control);
color: var(--text-primary);
font-size: 13px;
font-family: var(--font);
outline: none;
transition: var(--transition);
}
.history-search-input::placeholder {
color: var(--text-disabled);
}
.history-search-input:focus {
border-color: var(--border-focus);
box-shadow: 0 0 0 1px var(--border-focus);
}
.history-search-clear {
position: absolute;
right: 6px;
top: 50%;
transform: translateY(-50%);
background: none;
border: none;
color: var(--text-tertiary);
cursor: pointer;
font-size: 14px;
padding: 4px;
line-height: 1;
}
.history-search-clear:hover {
color: var(--text-primary);
}
.history-item {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 10px;
border-radius: var(--radius-control);
transition: var(--transition);
}
.history-item:hover {
background: var(--bg-layer);
}
.history-info {
flex: 1;
min-width: 0;
cursor: pointer;
}
.history-title {
font-size: 13px;
font-weight: 500;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.history-meta {
display: flex;
gap: 10px;
font-size: 11px;
color: var(--text-tertiary);
margin-top: 2px;
}
.history-actions {
display: flex;
gap: 2px;
flex-shrink: 0;
}
/* ── 历史分页 ── */
.history-pagination {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 0 4px;
border-top: 1px solid var(--border-subtle);
margin-top: 8px;
}
.page-info {
font-size: 12px;
color: var(--text-tertiary);
}
.page-buttons {
display: flex;
align-items: center;
gap: 4px;
}
.page-btn {
min-width: 30px;
height: 30px;
border: 1px solid var(--border-default);
background: var(--bg-layer);
color: var(--text-secondary);
border-radius: var(--radius-control);
font-size: 12px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: var(--transition);
}
.page-btn:hover:not(.disabled):not(.active) {
border-color: var(--border-strong);
color: var(--text-primary);
}
.page-btn.active {
background: var(--accent-subtle);
border-color: var(--accent);
color: var(--accent);
font-weight: 600;
}
.page-btn.disabled {
opacity: 0.3;
cursor: not-allowed;
}
.page-ellipsis {
color: var(--text-disabled);
font-size: 12px;
padding: 0 2px;
}
/* ═══ Lightbox ═══ */
.lightbox-overlay {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.75);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
display: flex;
align-items: center;
justify-content: center;
z-index: 300;
cursor: zoom-out;
animation: overlayIn 167ms ease;
}
.lightbox-img {
max-width: 90vw;
max-height: 90vh;
border-radius: var(--radius-md);
box-shadow: var(--shadow-dialog);
object-fit: contain;
cursor: default;
}
.lightbox-close {
position: fixed;
top: 16px;
right: 20px;
width: 36px;
height: 36px;
border: 1px solid var(--border-default);
background: var(--bg-card);
color: var(--text-primary);
font-size: 16px;
border-radius: var(--radius-control);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: var(--transition);
z-index: 301;
}
.lightbox-close:hover {
background: var(--bg-card-hover);
}
/* ═══ 帮助弹框 ═══ */
#helpModal .modal {
max-width: 600px;
max-height: 85vh;
}
.help-section {
margin-bottom: 16px;
padding: 12px 14px;
background: var(--bg-layer);
border-radius: var(--radius-control);
border-left: 2px solid var(--border-strong);
transition: border-color var(--transition);
}
.help-section:hover {
border-left-color: var(--accent);
}
.help-section:last-child {
margin-bottom: 0;
}
.help-section h4 {
font-size: 14px;
font-weight: 600;
margin-bottom: 8px;
color: var(--text-primary);
}
.help-section ul,
.help-section ol {
padding-left: 18px;
font-size: 13px;
color: var(--text-secondary);
line-height: 1.7;
}
.help-section li {
margin-bottom: 3px;
}
.help-section code {
background: rgba(255, 255, 255, 0.06);
color: var(--accent);
padding: 1px 6px;
border-radius: 3px;
font-size: 12px;
}
.help-section kbd {
background: var(--bg-layer);
border: 1px solid var(--border-default);
border-bottom-width: 2px;
border-radius: 3px;
padding: 1px 6px;
font-size: 12px;
font-family: inherit;
color: var(--text-primary);
}
.help-shortcuts {
width: 100%;
font-size: 13px;
border-collapse: collapse;
border-radius: var(--radius-control);
overflow: hidden;
border: 1px solid var(--border-default);
}
.help-shortcuts td {
padding: 6px 10px;
border-bottom: 1px solid var(--border-subtle);
}
.help-shortcuts tr:last-child td {
border-bottom: none;
}
.help-shortcuts td:first-child {
width: 140px;
text-align: center;
background: var(--bg-layer);
}
.help-shortcuts tr:hover td {
background: var(--bg-layer-alt);
}
/* ═══ 知识库管理 ═══ */
#kbModal .modal-body {
padding: 16px 20px;
overflow: hidden;
display: flex;
flex-direction: column;
}
.kb-layout {
display: flex;
gap: 16px;
flex: 1;
min-height: 0;
overflow: hidden;
}
.kb-sidebar {
width: 240px;
flex-shrink: 0;
display: flex;
flex-direction: column;
gap: 8px;
min-height: 0;
overflow: hidden;
padding-right: 16px;
border-right: 1px solid var(--border-subtle);
}
.kb-new-collection {
display: flex;
gap: 6px;
}
.kb-new-collection .setting-input {
flex: 1;
margin-bottom: 0;
font-size: 13px;
padding: 6px 10px;
}
.kb-collection-list {
flex: 1;
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 2px;
min-height: 0;
}
.kb-collection-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 12px;
border-radius: var(--radius-control);
cursor: pointer;
transition: var(--transition);
}
.kb-collection-item:hover {
background: var(--bg-layer);
}
.kb-collection-item.active {
background: var(--accent-subtle);
border: 1px solid rgba(96, 205, 255, 0.12);
}
.kb-col-info {
display: flex;
flex-direction: column;
gap: 2px;
min-width: 0;
}
.kb-col-name {
font-size: 13px;
font-weight: 500;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.kb-col-stats {
font-size: 11px;
color: var(--text-tertiary);
}
.kb-col-delete {
opacity: 0;
transition: opacity var(--transition);
}
.kb-collection-item:hover .kb-col-delete {
opacity: 1;
}
.kb-main {
flex: 1;
display: flex;
flex-direction: column;
gap: 10px;
min-width: 0;
min-height: 0;
overflow: hidden;
}
.kb-toolbar {
display: flex;
align-items: center;
gap: 8px;
flex-shrink: 0;
flex-wrap: wrap;
padding: 8px 12px;
background: var(--bg-layer);
border-radius: var(--radius-control);
border: 1px solid var(--border-subtle);
}
.kb-embed-select {
flex: 1;
min-width: 0;
max-width: 200px;
padding: 5px 8px;
font-size: 12px;
background: var(--bg-layer-alt);
color: var(--text-primary);
border: 1px solid var(--border-default);
border-radius: var(--radius-control);
outline: none;
cursor: pointer;
font-family: var(--font);
}
.kb-embed-select:focus {
border-color: var(--border-focus);
}
.kb-rag-toggle {
display: flex;
align-items: center;
gap: 6px;
margin-left: auto;
white-space: nowrap;
padding-left: 8px;
border-left: 1px solid var(--border-subtle);
}
.kb-progress {
display: inline-flex;
align-items: center;
gap: 6px;
font-size: 12px;
color: var(--text-tertiary);
padding: 3px 8px;
background: var(--accent-subtle);
border-radius: var(--radius-control);
}
.kb-doc-list {
flex: 1;
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 2px;
min-height: 0;
}
.kb-doc-item {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 12px;
border-radius: var(--radius-control);
transition: var(--transition);
}
.kb-doc-item:hover {
background: var(--bg-layer);
}
.kb-doc-icon {
font-size: 16px;
flex-shrink: 0;
}
.kb-doc-info {
flex: 1;
display: flex;
flex-direction: column;
gap: 1px;
min-width: 0;
}
.kb-doc-name {
font-size: 13px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.kb-doc-meta {
font-size: 11px;
color: var(--text-tertiary);
}
.kb-doc-delete {
opacity: 0;
transition: opacity var(--transition);
}
.kb-doc-item:hover .kb-doc-delete {
opacity: 1;
}
/* ── 移动端响应式 ── */
@media (max-width: 640px) {
.kb-layout {
flex-direction: column;
}
.kb-sidebar {
width: 100%;
max-height: 160px;
border-right: none;
padding-right: 0;
padding-bottom: 10px;
border-bottom: 1px solid var(--border-subtle);
}
.kb-main {
min-height: 180px;
}
.modal-lg {
max-height: 92vh;
}
}
/* ═══ Toast 通知 ═══ */
.toast-container {
position: fixed;
top: 56px;
right: 16px;
z-index: 200;
display: flex;
flex-direction: column;
gap: 6px;
pointer-events: none;
}
.toast {
display: flex;
align-items: center;
gap: 8px;
padding: 10px 14px;
border-radius: var(--radius-control);
background: var(--bg-card);
border: 1px solid var(--border-default);
box-shadow: var(--shadow-flyout);
font-size: 13px;
color: var(--text-primary);
pointer-events: auto;
animation: toastIn 167ms ease;
max-width: 320px;
}
.toast.removing {
animation: toastOut 167ms ease forwards;
}
.toast-icon {
font-size: 14px;
flex-shrink: 0;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--critical); }
.toast.warning { border-left: 3px solid var(--caution); }
.toast.info { border-left: 3px solid var(--accent); }
@keyframes toastIn {
from { opacity: 0; transform: translateX(24px); }
to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
from { opacity: 1; transform: translateX(0); }
to { opacity: 0; transform: translateX(24px); }
}
/* ═══ 响应式 ═══ */
@media (min-width: 768px) {
.app-header { padding: 8px 24px; }
.model-bar { padding: 8px 24px; }
.chat-area { padding: 20px 24px; }
.messages { max-width: 820px; }
.input-area { padding: 10px 24px 16px; }
.modal { max-width: 500px; }
}
@media (min-width: 1024px) {
.messages { max-width: 900px; }
#historyModal .modal { max-width: 620px; }
}
/* ── 选中文本 ── */
::selection {
background: rgba(96, 205, 255, 0.3);
}
/* ── 链接 ── */
.msg-content a {
color: var(--accent);
text-decoration: none;
}
.msg-content a:hover {
text-decoration: underline;
}
.msg-content .blocked-link {
color: var(--critical);
text-decoration: line-through;
cursor: not-allowed;
opacity: 0.7;
}
/* ── 列表 ── */
.msg-content ul, .msg-content ol {
padding-left: 20px;
margin: 8px 0;
}
.msg-content li { margin-bottom: 3px; }
/* ── 表格 ── */
.msg-content table {
width: 100%;
border-collapse: collapse;
margin: 8px 0;
font-size: 13px;
}
.msg-content th, .msg-content td {
padding: 6px 10px;
border: 1px solid var(--border-default);
text-align: left;
}
.msg-content th {
background: var(--bg-layer);
font-weight: 600;
}
/* ── 引用块 ── */
.msg-content blockquote {
border-left: 2px solid var(--border-strong);
padding-left: 12px;
margin: 8px 0;
color: var(--text-secondary);
}