初始化仓库及v1.0.0提交

This commit is contained in:
2026-05-05 03:21:58 +08:00
commit 813bb02672
67 changed files with 5263 additions and 0 deletions

0
assets/css/.gitkeep Normal file
View File

345
assets/css/chat.css Normal file
View File

@@ -0,0 +1,345 @@
/* 聊天布局 */
.chat-layout {
display: flex;
height: 100vh;
overflow: hidden;
}
/* 侧边栏 */
.sidebar {
width: var(--sidebar-width);
background: var(--bg-secondary);
border-right: 1px solid var(--border-color);
display: flex;
flex-direction: column;
transition: transform 0.3s;
flex-shrink: 0;
}
.sidebar.collapsed {
transform: translateX(-100%);
width: 0;
border: none;
}
.sidebar-header {
padding: 16px;
border-bottom: 1px solid var(--border-color);
display: flex;
gap: 8px;
}
.sidebar-header .btn {
flex: 1;
}
.session-list {
flex: 1;
overflow-y: auto;
padding: 8px;
}
.session-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px;
border-radius: var(--radius);
cursor: pointer;
transition: background 0.2s;
margin-bottom: 4px;
}
.session-item:hover {
background: var(--bg-card);
}
.session-item.active {
background: var(--primary);
color: white;
}
.session-item .session-name {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 14px;
}
.session-item .session-delete {
opacity: 0;
background: none;
border: none;
color: inherit;
cursor: pointer;
padding: 4px;
font-size: 16px;
}
.session-item:hover .session-delete {
opacity: 1;
}
/* 主区域 */
.chat-main {
flex: 1;
display: flex;
flex-direction: column;
min-width: 0;
}
/* 工具栏 */
.toolbar {
height: var(--toolbar-height);
background: var(--bg-secondary);
border-bottom: 1px solid var(--border-color);
display: flex;
align-items: center;
padding: 0 16px;
gap: 12px;
flex-shrink: 0;
}
.toolbar select {
padding: 6px 10px;
background: var(--bg-input);
border: 1px solid var(--border-color);
border-radius: var(--radius);
color: var(--text-primary);
font-size: 13px;
}
.toolbar .toggle-sidebar {
background: none;
border: none;
color: var(--text-primary);
cursor: pointer;
font-size: 20px;
padding: 4px;
}
/* 思考模式开关 */
.toggle-switch {
position: relative;
display: inline-block;
width: 40px;
height: 20px;
}
.toggle-switch input {
opacity: 0;
width: 0;
height: 0;
}
.toggle-switch .slider {
position: absolute;
cursor: pointer;
top: 0; left: 0; right: 0; bottom: 0;
background-color: var(--border-color);
border-radius: 20px;
transition: 0.3s;
}
.toggle-switch .slider:before {
position: absolute;
content: "";
height: 16px;
width: 16px;
left: 2px;
bottom: 2px;
background-color: white;
border-radius: 50%;
transition: 0.3s;
}
.toggle-switch input:checked + .slider {
background-color: var(--primary);
}
.toggle-switch input:checked + .slider:before {
transform: translateX(20px);
}
/* 消息区域 */
.messages-container {
flex: 1;
overflow-y: auto;
padding: 20px;
display: flex;
flex-direction: column;
gap: 16px;
}
.message {
max-width: 80%;
padding: 12px 16px;
border-radius: var(--radius);
line-height: 1.6;
font-size: 14px;
word-wrap: break-word;
}
.message.user {
align-self: flex-end;
background: var(--primary);
color: white;
border-bottom-right-radius: 2px;
}
.message.assistant {
align-self: flex-start;
background: var(--bg-card);
border-bottom-left-radius: 2px;
}
.message .message-role {
font-size: 12px;
color: var(--text-secondary);
margin-bottom: 4px;
}
/* 思考内容折叠 */
.thinking-toggle {
font-size: 12px;
color: var(--primary);
cursor: pointer;
margin-top: 8px;
display: flex;
align-items: center;
gap: 4px;
}
.thinking-content {
display: none;
margin-top: 8px;
padding: 12px;
background: rgba(0,0,0,0.2);
border-radius: var(--radius);
font-size: 13px;
color: var(--text-secondary);
border-left: 3px solid var(--primary);
}
.thinking-content.expanded {
display: block;
}
/* 打字机光标 */
.typing-cursor::after {
content: '▊';
animation: blink 1s step-end infinite;
color: var(--primary);
}
@keyframes blink {
50% { opacity: 0; }
}
/* 输入区域 */
.input-area {
padding: 16px;
background: var(--bg-secondary);
border-top: 1px solid var(--border-color);
flex-shrink: 0;
}
.input-wrapper {
display: flex;
align-items: flex-end;
gap: 8px;
background: var(--bg-input);
border: 1px solid var(--border-color);
border-radius: var(--radius);
padding: 8px 12px;
}
.input-wrapper textarea {
flex: 1;
background: none;
border: none;
color: var(--text-primary);
font-size: 14px;
line-height: 1.5;
resize: none;
max-height: 120px;
min-height: 24px;
font-family: var(--font-family);
}
.input-wrapper textarea:focus {
outline: none;
}
.input-wrapper button {
background: var(--primary);
border: none;
color: white;
padding: 8px 12px;
border-radius: var(--radius);
cursor: pointer;
font-size: 14px;
white-space: nowrap;
}
.input-wrapper button:hover {
background: var(--primary-hover);
}
.input-wrapper button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
/* 文件预览 */
.file-preview {
display: flex;
gap: 8px;
padding: 8px 0;
flex-wrap: wrap;
}
.file-preview-item {
display: flex;
align-items: center;
gap: 6px;
padding: 4px 8px;
background: var(--bg-card);
border-radius: 4px;
font-size: 12px;
}
.file-preview-item .remove-file {
cursor: pointer;
color: var(--danger);
font-weight: bold;
}
/* 空状态 */
.empty-state {
text-align: center;
color: var(--text-secondary);
padding: 60px 20px;
}
.empty-state h3 {
margin-bottom: 8px;
}
/* 响应式 */
@media (max-width: 768px) {
.sidebar {
position: fixed;
z-index: 100;
height: 100vh;
}
.message {
max-width: 95%;
}
.toolbar {
flex-wrap: wrap;
height: auto;
padding: 8px 12px;
}
}

127
assets/css/markdown.css Normal file
View File

@@ -0,0 +1,127 @@
/* 消息中的 Markdown 内容 */
.message.assistant .markdown-body {
font-size: 14px;
line-height: 1.7;
}
.markdown-body p {
margin-bottom: 12px;
}
.markdown-body p:last-child {
margin-bottom: 0;
}
.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
margin-top: 16px;
margin-bottom: 8px;
font-weight: 600;
}
.markdown-body h1 { font-size: 1.4em; }
.markdown-body h2 { font-size: 1.3em; }
.markdown-body h3 { font-size: 1.2em; }
.markdown-body ul, .markdown-body ol {
margin: 8px 0;
padding-left: 24px;
}
.markdown-body li {
margin-bottom: 4px;
}
.markdown-body code {
background: rgba(255,255,255,0.1);
padding: 2px 6px;
border-radius: 3px;
font-size: 0.9em;
font-family: 'Consolas', 'Monaco', monospace;
}
.markdown-body pre {
background: #1e1e2e;
border-radius: var(--radius);
padding: 0;
margin: 12px 0;
overflow: hidden;
position: relative;
}
.markdown-body pre code {
display: block;
padding: 16px;
background: none;
overflow-x: auto;
font-size: 13px;
line-height: 1.5;
}
.markdown-body pre .copy-btn {
position: absolute;
top: 8px;
right: 8px;
background: rgba(255,255,255,0.1);
border: none;
color: var(--text-secondary);
padding: 4px 8px;
border-radius: 4px;
cursor: pointer;
font-size: 12px;
transition: background 0.2s;
}
.markdown-body pre .copy-btn:hover {
background: rgba(255,255,255,0.2);
}
.markdown-body blockquote {
border-left: 4px solid var(--primary);
margin: 12px 0;
padding: 8px 16px;
background: rgba(74, 144, 217, 0.05);
color: var(--text-secondary);
}
.markdown-body table {
width: 100%;
border-collapse: collapse;
margin: 12px 0;
font-size: 13px;
}
.markdown-body th, .markdown-body td {
border: 1px solid var(--border-color);
padding: 8px 12px;
text-align: left;
}
.markdown-body th {
background: var(--bg-secondary);
font-weight: 600;
}
.markdown-body tr:nth-child(even) {
background: rgba(255,255,255,0.02);
}
.markdown-body a {
color: var(--primary);
text-decoration: none;
}
.markdown-body a:hover {
text-decoration: underline;
}
.markdown-body hr {
border: none;
border-top: 1px solid var(--border-color);
margin: 16px 0;
}
.markdown-body img {
max-width: 100%;
border-radius: var(--radius);
}

230
assets/css/style.css Normal file
View File

@@ -0,0 +1,230 @@
/* CSS 变量 */
:root {
--primary: #4a90d9;
--primary-hover: #357abd;
--bg-primary: #1a1a2e;
--bg-secondary: #16213e;
--bg-card: #1e2a45;
--bg-input: #0f1b33;
--text-primary: #e0e0e0;
--text-secondary: #a0a0a0;
--border-color: #2a3a5c;
--success: #4caf50;
--danger: #f44336;
--warning: #ff9800;
--sidebar-width: 260px;
--toolbar-height: 50px;
--input-height: 120px;
--radius: 8px;
--font-family: system-ui, -apple-system, sans-serif;
}
/* Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: var(--font-family);
background: var(--bg-primary);
color: var(--text-primary);
line-height: 1.6;
min-height: 100vh;
}
/* 登录页样式 */
.login-container {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
padding: 20px;
}
.login-card {
background: var(--bg-card);
border-radius: var(--radius);
padding: 40px;
width: 100%;
max-width: 400px;
box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.login-card h1 {
text-align: center;
margin-bottom: 30px;
font-size: 24px;
color: var(--primary);
}
/* 安装向导样式 */
.install-container {
max-width: 700px;
margin: 40px auto;
padding: 0 20px;
}
.step-indicator {
display: flex;
justify-content: space-between;
margin-bottom: 30px;
padding: 0;
list-style: none;
}
.step-indicator .step {
flex: 1;
text-align: center;
padding: 10px;
font-size: 14px;
color: var(--text-secondary);
border-bottom: 3px solid var(--border-color);
transition: all 0.3s;
}
.step-indicator .step.active {
color: var(--primary);
border-bottom-color: var(--primary);
}
.step-indicator .step.completed {
color: var(--success);
border-bottom-color: var(--success);
}
/* 通用表单样式 */
.form-group {
margin-bottom: 16px;
}
.form-group label {
display: block;
margin-bottom: 6px;
font-size: 14px;
color: var(--text-secondary);
}
.form-group input,
.form-group select,
.form-group textarea {
width: 100%;
padding: 10px 12px;
background: var(--bg-input);
border: 1px solid var(--border-color);
border-radius: var(--radius);
color: var(--text-primary);
font-size: 14px;
transition: border-color 0.3s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
outline: none;
border-color: var(--primary);
}
/* 按钮 */
.btn {
display: inline-block;
padding: 10px 20px;
border: none;
border-radius: var(--radius);
font-size: 14px;
cursor: pointer;
transition: all 0.3s;
text-decoration: none;
}
.btn-primary {
background: var(--primary);
color: white;
}
.btn-primary:hover {
background: var(--primary-hover);
}
.btn-secondary {
background: var(--bg-secondary);
color: var(--text-primary);
border: 1px solid var(--border-color);
}
.btn-danger {
background: var(--danger);
color: white;
}
.btn-sm {
padding: 6px 12px;
font-size: 12px;
}
.btn-block {
display: block;
width: 100%;
text-align: center;
}
.btn-group {
display: flex;
gap: 10px;
margin-top: 20px;
justify-content: flex-end;
}
/* 消息提示 */
.alert {
padding: 12px 16px;
border-radius: var(--radius);
margin-bottom: 16px;
font-size: 14px;
}
.alert-error {
background: rgba(244, 67, 54, 0.1);
border: 1px solid var(--danger);
color: var(--danger);
}
.alert-success {
background: rgba(76, 175, 80, 0.1);
border: 1px solid var(--success);
color: var(--success);
}
/* 配置页样式 */
.config-container {
max-width: 900px;
margin: 40px auto;
padding: 0 20px;
}
.config-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30px;
}
.config-section {
background: var(--bg-card);
border-radius: var(--radius);
padding: 24px;
margin-bottom: 24px;
}
.config-section h2 {
margin-bottom: 16px;
font-size: 18px;
}
/* 响应式 */
@media (max-width: 768px) {
.login-card {
padding: 24px;
}
.install-container,
.config-container {
margin: 20px auto;
}
}