feat: v0.6.0 — 公益AI接口 + Agent灵魂借尸还魂 + 知识库 + 全局AI诊断 + 官网改版

This commit is contained in:
晴天
2026-03-07 19:36:25 +08:00
parent b09f48f0dd
commit 0752dc2a71
55 changed files with 4346 additions and 480 deletions

156
src/style/ai-drawer.css Normal file
View File

@@ -0,0 +1,156 @@
/* ── 全局 AI 助手浮动按钮 ── */
.ai-fab {
position: fixed;
bottom: 24px;
right: 24px;
z-index: 9000;
width: 48px;
height: 48px;
border-radius: 50%;
background: var(--accent);
color: #fff;
border: none;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
transition: transform 0.2s, box-shadow 0.2s;
touch-action: none; /* 拖动时禁止浏览器默认手势 */
user-select: none;
}
.ai-fab:hover {
transform: scale(1.08);
box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}
.ai-fab.dragging {
opacity: 0.85;
transform: scale(1.12);
box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5);
cursor: grabbing;
}
.ai-fab svg {
width: 22px;
height: 22px;
fill: none;
stroke: currentColor;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
pointer-events: none; /* 防止 SVG 吃掉 pointer 事件 */
}
/* FAB 红点:有待处理的错误上下文 */
.ai-fab.has-error::after {
content: '';
position: absolute;
top: 2px;
right: 2px;
width: 12px;
height: 12px;
border-radius: 50%;
background: var(--error, #ef4444);
border: 2px solid #fff;
animation: fab-pulse 1.5s ease-in-out infinite;
}
@keyframes fab-pulse {
0%, 100% { transform: scale(1); opacity: 1; }
50% { transform: scale(1.2); opacity: 0.8; }
}
/* ── 错误上下文 Banner助手页面内 ── */
.ast-error-banner {
margin: 0 0 12px;
padding: 10px 14px;
background: var(--error-muted, rgba(239, 68, 68, 0.08));
border: 1px solid var(--error-border, rgba(239, 68, 68, 0.25));
border-radius: var(--radius-lg, 12px);
font-size: 12px;
line-height: 1.5;
color: var(--text-secondary);
position: relative;
}
.ast-error-banner-header {
display: flex;
align-items: center;
gap: 8px;
}
.ast-error-banner-icon {
flex-shrink: 0;
color: var(--error, #ef4444);
font-size: 16px;
}
.ast-error-banner-title {
flex: 1;
font-weight: 600;
color: var(--text-primary);
font-size: 13px;
}
.ast-error-banner-actions {
display: flex;
gap: 6px;
flex-shrink: 0;
}
.ast-error-banner-actions button {
padding: 3px 10px;
border-radius: 6px;
border: 1px solid transparent;
font-size: 11px;
cursor: pointer;
transition: background 0.15s;
}
.ast-error-banner .btn-analyze {
background: var(--error, #ef4444);
color: #fff;
border-color: var(--error, #ef4444);
}
.ast-error-banner .btn-analyze:hover {
opacity: 0.9;
}
.ast-error-banner .btn-dismiss {
background: var(--bg-tertiary);
color: var(--text-secondary);
}
.ast-error-banner .btn-dismiss:hover {
background: var(--bg-secondary);
}
.ast-error-banner-hint {
margin-top: 6px;
color: var(--text-tertiary);
}
.ast-error-banner-detail {
margin-top: 8px;
max-height: 0;
overflow: hidden;
transition: max-height 0.3s ease;
}
.ast-error-banner-detail.expanded {
max-height: 300px;
}
.ast-error-banner-detail pre {
margin: 0;
padding: 8px 10px;
background: var(--bg-tertiary);
border-radius: 6px;
font-size: 11px;
line-height: 1.5;
white-space: pre-wrap;
word-break: break-all;
max-height: 280px;
overflow-y: auto;
color: var(--text-secondary);
}
.ast-error-toggle {
background: none;
border: none;
color: var(--text-tertiary);
font-size: 11px;
cursor: pointer;
padding: 0;
margin-top: 4px;
text-decoration: underline;
}
.ast-error-toggle:hover {
color: var(--text-primary);
}

View File

@@ -426,6 +426,57 @@
border-color: var(--accent);
}
/* 首次引导提示 */
.ast-page-guide {
display: flex;
align-items: center;
gap: 10px;
margin-top: 16px;
padding: 10px 14px;
background: var(--accent-muted, rgba(99, 102, 241, 0.08));
border: 1px solid var(--accent-border, rgba(99, 102, 241, 0.2));
border-radius: var(--radius-lg);
font-size: 12px;
line-height: 1.5;
color: var(--text-secondary);
text-align: left;
width: 100%;
max-width: 560px;
position: relative;
}
.ast-guide-badge {
flex-shrink: 0;
background: var(--accent);
color: #fff;
font-size: 11px;
font-weight: 600;
padding: 2px 8px;
border-radius: 10px;
white-space: nowrap;
}
.ast-guide-text {
flex: 1;
min-width: 0;
}
.ast-guide-text b {
color: var(--text-primary);
}
.ast-guide-close {
flex-shrink: 0;
background: none;
border: none;
color: var(--text-tertiary);
font-size: 18px;
cursor: pointer;
padding: 2px 6px;
border-radius: 4px;
line-height: 1;
}
.ast-guide-close:hover {
background: var(--bg-tertiary);
color: var(--text-primary);
}
/* ── Skills 网格 ── */
.ast-skills-grid {
display: grid;
@@ -1520,3 +1571,112 @@
justify-content: flex-end;
gap: 8px;
}
/* ── 灵魂移植卡片 ── */
.ast-soul-card {
border: 1px solid var(--border-secondary);
border-radius: var(--radius-md);
background: var(--bg-primary);
overflow: hidden;
}
.ast-soul-header {
display: flex;
align-items: center;
gap: 8px;
padding: 10px 14px;
background: var(--bg-tertiary);
border-bottom: 1px solid var(--border-secondary);
font-size: 12px;
font-weight: 600;
color: var(--text-secondary);
}
.ast-soul-header svg { flex-shrink: 0; }
.ast-soul-files {
display: flex;
flex-direction: column;
}
.ast-soul-file {
display: flex;
align-items: center;
gap: 10px;
padding: 7px 14px;
font-size: 12px;
border-bottom: 1px solid var(--border-secondary);
transition: background var(--transition-fast);
}
.ast-soul-file:last-child { border-bottom: none; }
.ast-soul-file:hover { background: var(--bg-card-hover); }
.ast-soul-file-icon {
width: 20px;
height: 20px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.ast-soul-file.loaded .ast-soul-file-icon {
background: var(--success-muted, rgba(34,197,94,0.1));
color: var(--success);
}
.ast-soul-file.missing .ast-soul-file-icon {
background: var(--error-muted, rgba(239,68,68,0.1));
color: var(--error);
}
.ast-soul-file-info {
flex: 1;
display: flex;
flex-direction: column;
gap: 1px;
min-width: 0;
}
.ast-soul-file-name {
font-weight: 600;
color: var(--text-primary);
font-family: var(--font-mono);
font-size: 12px;
}
.ast-soul-file.missing .ast-soul-file-name {
color: var(--text-tertiary);
}
.ast-soul-file-desc {
font-size: 11px;
color: var(--text-tertiary);
line-height: 1.2;
}
.ast-soul-file-size {
font-size: 11px;
color: var(--text-tertiary);
font-family: var(--font-mono);
flex-shrink: 0;
}
/* 按钮样式补充 */
.btn-ghost {
background: transparent;
border: 1px solid var(--border-secondary);
color: var(--text-secondary);
}
.btn-ghost:hover {
background: var(--bg-card-hover);
border-color: var(--border-primary);
color: var(--text-primary);
}
.btn svg { vertical-align: -2px; }
/* 加载旋转动画 */
.ast-spin {
animation: ast-spin 1s linear infinite;
}
@keyframes ast-spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}

View File

@@ -783,6 +783,54 @@
color: var(--text-tertiary);
}
/* 首次引导提示 */
.chat-page-guide {
margin: 0 16px 8px;
flex-shrink: 0;
}
.chat-guide-inner {
display: flex;
align-items: flex-start;
gap: 12px;
padding: 12px 14px;
background: var(--accent-muted, rgba(99, 102, 241, 0.08));
border: 1px solid var(--accent-border, rgba(99, 102, 241, 0.2));
border-radius: var(--radius-lg);
font-size: 12px;
line-height: 1.6;
color: var(--text-secondary);
position: relative;
}
.chat-guide-icon {
flex-shrink: 0;
color: var(--accent);
margin-top: 2px;
}
.chat-guide-content b {
color: var(--text-primary);
font-size: 13px;
}
.chat-guide-content p {
margin: 4px 0 0;
}
.chat-guide-close {
position: absolute;
top: 6px;
right: 8px;
background: none;
border: none;
color: var(--text-tertiary);
font-size: 18px;
cursor: pointer;
padding: 2px 6px;
border-radius: 4px;
line-height: 1;
}
.chat-guide-close:hover {
background: var(--bg-tertiary);
color: var(--text-primary);
}
.chat-lightbox-img {
max-width: 90%;
max-height: 90%;

View File

@@ -140,6 +140,12 @@
font-size: var(--font-size-xs);
}
.btn-xs {
padding: 2px 8px;
font-size: 11px;
border-radius: var(--radius-sm);
}
/* 表单 */
.form-group {
margin-bottom: var(--space-lg);
@@ -275,8 +281,16 @@ mark {
padding: var(--space-xl);
min-width: 360px;
max-width: 500px;
max-height: calc(100vh - 60px);
display: flex;
flex-direction: column;
box-shadow: var(--shadow-lg);
}
.modal-body {
flex: 1;
overflow-y: auto;
min-height: 0;
}
.modal-title {
font-size: var(--font-size-lg);

View File

@@ -50,6 +50,17 @@
color: var(--text-tertiary);
}
.overview-actions {
display: flex;
align-items: center;
gap: 8px;
}
.overview-status {
font-size: var(--font-size-sm);
font-weight: 600;
margin-right: 4px;
}
.overview-value {
display: flex;
align-items: center;