mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-05-07 05:02:52 +08:00
在路径拦截 + sanitize 的基础上再加一道保险:用户粘贴的不只是 markdown 本地图片、而是其他 API 不接受的内容时(如意外内容格式、 鉴权失败、quota 耗尽),单纯清洗无法解决,用户反复点"重试"会陷 入同样的错误循环。 熔断机制: - 2 分钟滑动窗口内,同一错误指纹累计 ≥3 次触发熔断 - 错误指纹归一化:去掉数字(时间戳/请求 ID)、URL、多余空白, 只对比核心语义 - 熔断状态下重试按钮禁用 + 警告色样式,hint 文案改为"请先检查 API 配置或网络",点击后 toast 提示而非触发重试 - 自动恢复:修改配置(saveConfig)或新建会话(createSession)时 调用 resetCircuit() 清空失败历史 UI 共用:抽出 createRetryBar(session, circuitOpen) 供 sendMessageDirect 和 retryAIResponse 两处复用,消除原本重复的 30 行错误处理代码。 新增 .ast-retry-bar-circuit CSS 变体(warning 色 + 禁用态)。 翻译键(11 语言): - retryCircuitHint — 熔断状态下的重试栏 hint - retryCircuitBlocked — 点击已禁用重试按钮时的 toast Refs: #226
1791 lines
36 KiB
CSS
1791 lines
36 KiB
CSS
/**
|
||
* AI 助手页面样式
|
||
*/
|
||
|
||
.ast-page {
|
||
display: flex;
|
||
flex-direction: row;
|
||
height: 100%;
|
||
overflow: hidden;
|
||
padding: 0 !important;
|
||
}
|
||
|
||
/* ── 侧边栏 ── */
|
||
.ast-sidebar {
|
||
width: 0;
|
||
min-width: 0;
|
||
border-right: none;
|
||
background: var(--bg-primary);
|
||
display: flex;
|
||
flex-direction: column;
|
||
flex-shrink: 0;
|
||
overflow: hidden;
|
||
transition: width 0.2s ease, min-width 0.2s ease, border-right 0.2s ease;
|
||
}
|
||
|
||
.ast-sidebar.open {
|
||
width: 240px;
|
||
min-width: 240px;
|
||
border-right: 1px solid var(--border-primary);
|
||
}
|
||
|
||
.ast-sidebar-header {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
padding: 10px 12px;
|
||
font-size: 13px;
|
||
font-weight: 600;
|
||
color: var(--text-secondary);
|
||
border-bottom: 1px solid var(--border-primary);
|
||
}
|
||
|
||
.ast-sidebar-btn {
|
||
background: none;
|
||
border: none;
|
||
color: var(--text-secondary);
|
||
cursor: pointer;
|
||
padding: 4px;
|
||
border-radius: 4px;
|
||
display: flex;
|
||
}
|
||
|
||
.ast-sidebar-btn:hover {
|
||
background: var(--bg-card-hover);
|
||
color: var(--text-primary);
|
||
}
|
||
|
||
.ast-session-list {
|
||
flex: 1;
|
||
overflow-y: auto;
|
||
padding: 4px;
|
||
}
|
||
|
||
.ast-session-item {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
padding: 8px 10px;
|
||
border-radius: var(--radius-sm);
|
||
cursor: pointer;
|
||
transition: background var(--transition-fast);
|
||
gap: 4px;
|
||
}
|
||
|
||
.ast-session-item:hover {
|
||
background: var(--bg-card-hover);
|
||
}
|
||
|
||
.ast-session-item.active {
|
||
background: var(--accent-muted);
|
||
color: var(--accent);
|
||
}
|
||
|
||
.ast-session-title {
|
||
flex: 1;
|
||
font-size: 13px;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.ast-session-delete {
|
||
opacity: 0;
|
||
background: none;
|
||
border: none;
|
||
color: var(--text-tertiary);
|
||
cursor: pointer;
|
||
font-size: 16px;
|
||
padding: 0 4px;
|
||
border-radius: 4px;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.ast-session-item:hover .ast-session-delete {
|
||
opacity: 1;
|
||
}
|
||
|
||
.ast-session-delete:hover {
|
||
color: var(--error);
|
||
background: var(--error-muted);
|
||
}
|
||
|
||
.ast-empty {
|
||
text-align: center;
|
||
color: var(--text-tertiary);
|
||
font-size: 13px;
|
||
padding: 20px;
|
||
}
|
||
|
||
/* ── 主区域 ── */
|
||
.ast-main {
|
||
flex: 1;
|
||
display: flex;
|
||
flex-direction: column;
|
||
min-width: 0;
|
||
position: relative;
|
||
}
|
||
|
||
.ast-header {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
padding: var(--space-sm) var(--space-md);
|
||
border-bottom: 1px solid var(--border-primary);
|
||
flex-shrink: 0;
|
||
gap: 8px;
|
||
}
|
||
|
||
.ast-header-left {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: var(--space-sm);
|
||
}
|
||
|
||
.ast-header-actions {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 4px;
|
||
}
|
||
|
||
.ast-toggle-sidebar {
|
||
background: none;
|
||
border: none;
|
||
color: var(--text-secondary);
|
||
cursor: pointer;
|
||
padding: 4px;
|
||
border-radius: var(--radius-sm);
|
||
display: flex;
|
||
}
|
||
|
||
.ast-toggle-sidebar:hover {
|
||
background: var(--bg-card-hover);
|
||
color: var(--text-primary);
|
||
}
|
||
|
||
.ast-title {
|
||
font-size: 15px;
|
||
font-weight: 600;
|
||
color: var(--text-primary);
|
||
}
|
||
|
||
.ast-model-badge {
|
||
font-size: 11px;
|
||
padding: 2px 8px;
|
||
border-radius: 10px;
|
||
font-family: var(--font-mono);
|
||
}
|
||
|
||
.ast-model-badge.configured {
|
||
background: var(--success-muted);
|
||
color: var(--success);
|
||
}
|
||
|
||
.ast-model-badge.unconfigured {
|
||
background: var(--warning-muted);
|
||
color: var(--warning);
|
||
}
|
||
|
||
/* ── 消息区域 ── */
|
||
.ast-messages {
|
||
flex: 1;
|
||
overflow-y: auto;
|
||
padding: var(--space-lg) var(--space-xl);
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: var(--space-md);
|
||
}
|
||
|
||
.ast-msg {
|
||
display: flex;
|
||
max-width: 85%;
|
||
}
|
||
|
||
.ast-msg-user {
|
||
align-self: flex-end;
|
||
}
|
||
|
||
.ast-msg-ai {
|
||
align-self: flex-start;
|
||
flex-direction: column;
|
||
max-width: 85%;
|
||
}
|
||
|
||
.ast-msg-bubble {
|
||
padding: 10px 14px;
|
||
border-radius: var(--radius-lg);
|
||
font-size: 14px;
|
||
line-height: 1.6;
|
||
word-break: break-word;
|
||
}
|
||
|
||
.ast-msg-bubble-user {
|
||
background: var(--accent);
|
||
color: var(--text-inverse);
|
||
border-bottom-right-radius: 4px;
|
||
white-space: pre-wrap;
|
||
}
|
||
|
||
.ast-msg-bubble-ai {
|
||
background: var(--bg-card);
|
||
color: var(--text-primary);
|
||
border: 1px solid var(--border-primary);
|
||
border-bottom-left-radius: 4px;
|
||
}
|
||
|
||
.ast-msg-bubble-ai p {
|
||
margin: 0 0 8px 0;
|
||
}
|
||
|
||
.ast-msg-bubble-ai p:last-child {
|
||
margin-bottom: 0;
|
||
}
|
||
|
||
.ast-msg-bubble-ai pre {
|
||
background: var(--bg-tertiary);
|
||
border-radius: var(--radius-sm);
|
||
padding: 10px 12px;
|
||
overflow-x: auto;
|
||
font-size: 13px;
|
||
margin: 8px 0;
|
||
}
|
||
|
||
.ast-msg-bubble-ai code {
|
||
font-family: var(--font-mono);
|
||
font-size: 13px;
|
||
}
|
||
|
||
.ast-msg-bubble-ai code:not(pre code) {
|
||
background: var(--bg-tertiary);
|
||
padding: 1px 5px;
|
||
border-radius: 3px;
|
||
}
|
||
|
||
.ast-msg-bubble-ai ul, .ast-msg-bubble-ai ol {
|
||
margin: 4px 0;
|
||
padding-left: 20px;
|
||
}
|
||
|
||
.ast-msg-bubble-ai li {
|
||
margin: 2px 0;
|
||
}
|
||
|
||
.ast-msg-bubble-ai strong {
|
||
font-weight: 600;
|
||
}
|
||
|
||
.ast-msg-bubble-ai h1, .ast-msg-bubble-ai h2, .ast-msg-bubble-ai h3 {
|
||
margin: 12px 0 6px 0;
|
||
font-weight: 600;
|
||
}
|
||
|
||
.ast-msg-bubble-ai h1 { font-size: 18px; }
|
||
.ast-msg-bubble-ai h2 { font-size: 16px; }
|
||
.ast-msg-bubble-ai h3 { font-size: 14px; }
|
||
|
||
/* 消息元信息 + 复制按钮 */
|
||
.ast-msg-meta {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
font-size: 11px;
|
||
color: var(--text-tertiary);
|
||
margin-top: 4px;
|
||
padding: 0 4px;
|
||
}
|
||
.ast-msg-user .ast-msg-meta { justify-content: flex-end; }
|
||
.ast-msg-ai .ast-msg-meta { justify-content: flex-start; }
|
||
|
||
.ast-msg .msg-copy-btn {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
background: none;
|
||
border: none;
|
||
color: var(--text-tertiary);
|
||
cursor: pointer;
|
||
padding: 2px 4px;
|
||
border-radius: 4px;
|
||
opacity: 0;
|
||
transition: opacity 0.15s, color 0.15s, background 0.15s;
|
||
}
|
||
.ast-msg:hover .msg-copy-btn,
|
||
.ast-msg .msg-copy-btn:focus { opacity: 1; }
|
||
.ast-msg .msg-copy-btn:hover { color: var(--text-primary); background: var(--bg-tertiary); }
|
||
.ast-msg .msg-copy-btn.copied { opacity: 1; color: var(--success); }
|
||
|
||
/* 流式光标 */
|
||
.ast-cursor {
|
||
animation: ast-blink 1s infinite;
|
||
color: var(--accent);
|
||
}
|
||
|
||
@keyframes ast-blink {
|
||
0%, 50% { opacity: 1; }
|
||
51%, 100% { opacity: 0; }
|
||
}
|
||
|
||
.ast-typing {
|
||
color: var(--text-tertiary);
|
||
font-style: italic;
|
||
}
|
||
|
||
/* ── 输入区 ── */
|
||
.ast-input-area {
|
||
padding: var(--space-md) var(--space-xl) var(--space-lg);
|
||
border-top: 1px solid var(--border-primary);
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.ast-input-wrap {
|
||
display: flex;
|
||
align-items: flex-end;
|
||
gap: 8px;
|
||
background: var(--bg-card);
|
||
border: 1px solid var(--border-primary);
|
||
border-radius: var(--radius-lg);
|
||
padding: 8px 12px;
|
||
transition: border-color var(--transition-fast);
|
||
}
|
||
|
||
.ast-input-wrap:focus-within {
|
||
border-color: var(--border-focus);
|
||
box-shadow: 0 0 0 3px var(--accent-muted);
|
||
}
|
||
|
||
.ast-textarea {
|
||
flex: 1;
|
||
border: none;
|
||
background: none;
|
||
resize: none;
|
||
font-size: 14px;
|
||
font-family: var(--font-sans);
|
||
color: var(--text-primary);
|
||
line-height: 1.5;
|
||
outline: none;
|
||
min-height: 24px;
|
||
max-height: 200px;
|
||
}
|
||
|
||
.ast-textarea::placeholder {
|
||
color: var(--text-tertiary);
|
||
}
|
||
|
||
.ast-send-btn {
|
||
background: var(--accent);
|
||
color: white;
|
||
border: none;
|
||
border-radius: var(--radius-sm);
|
||
width: 36px;
|
||
height: 36px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
cursor: pointer;
|
||
flex-shrink: 0;
|
||
transition: background var(--transition-fast);
|
||
}
|
||
|
||
.ast-send-btn:hover {
|
||
background: var(--accent-hover);
|
||
}
|
||
|
||
.ast-send-btn:disabled {
|
||
opacity: 0.5;
|
||
cursor: not-allowed;
|
||
}
|
||
|
||
.ast-input-hint {
|
||
font-size: 11px;
|
||
color: var(--text-tertiary);
|
||
margin-top: 6px;
|
||
text-align: center;
|
||
}
|
||
|
||
/* ── 欢迎页 ── */
|
||
.ast-welcome {
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
justify-content: center;
|
||
flex: 1;
|
||
gap: 12px;
|
||
padding: 40px 20px;
|
||
text-align: center;
|
||
}
|
||
|
||
.ast-welcome-icon {
|
||
color: var(--accent);
|
||
opacity: 0.7;
|
||
}
|
||
|
||
.ast-welcome h3 {
|
||
font-size: 20px;
|
||
font-weight: 600;
|
||
color: var(--text-primary);
|
||
margin: 0;
|
||
}
|
||
|
||
.ast-welcome p {
|
||
color: var(--text-secondary);
|
||
font-size: 14px;
|
||
margin: 0;
|
||
}
|
||
|
||
.ast-quick-actions {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
gap: 8px;
|
||
margin-top: 16px;
|
||
justify-content: center;
|
||
}
|
||
|
||
.ast-quick-btn {
|
||
background: var(--bg-card);
|
||
border: 1px solid var(--border-primary);
|
||
color: var(--text-secondary);
|
||
padding: 8px 16px;
|
||
border-radius: var(--radius-lg);
|
||
font-size: 13px;
|
||
cursor: pointer;
|
||
transition: all var(--transition-fast);
|
||
}
|
||
|
||
.ast-quick-btn:hover {
|
||
background: var(--bg-card-hover);
|
||
color: var(--text-primary);
|
||
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;
|
||
grid-template-columns: repeat(2, 1fr);
|
||
gap: 10px;
|
||
margin-top: 20px;
|
||
width: 100%;
|
||
max-width: 560px;
|
||
}
|
||
|
||
.ast-skill-card {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 12px;
|
||
padding: 14px 16px;
|
||
background: var(--bg-card);
|
||
border: 1px solid var(--border-secondary);
|
||
border-radius: var(--radius-md);
|
||
cursor: pointer;
|
||
transition: all var(--transition-fast);
|
||
text-align: left;
|
||
}
|
||
|
||
.ast-skill-card:hover {
|
||
border-color: var(--accent);
|
||
background: var(--accent-muted);
|
||
transform: translateY(-2px);
|
||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
|
||
}
|
||
|
||
.ast-skill-icon {
|
||
font-size: 24px;
|
||
flex-shrink: 0;
|
||
width: 40px;
|
||
height: 40px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
background: var(--bg-tertiary);
|
||
border-radius: var(--radius-sm);
|
||
}
|
||
|
||
.ast-skill-card:hover .ast-skill-icon {
|
||
background: var(--accent-muted);
|
||
}
|
||
|
||
.ast-skill-info {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 2px;
|
||
min-width: 0;
|
||
}
|
||
|
||
.ast-skill-info strong {
|
||
font-size: 13px;
|
||
font-weight: 600;
|
||
color: var(--text-primary);
|
||
}
|
||
|
||
.ast-skill-info span {
|
||
font-size: 11px;
|
||
color: var(--text-tertiary);
|
||
line-height: 1.3;
|
||
}
|
||
|
||
/* ── 设置 Tab ── */
|
||
.ast-settings-tabs {
|
||
display: flex;
|
||
gap: 0;
|
||
border-bottom: 1px solid var(--border-secondary);
|
||
margin: 8px 0 0;
|
||
}
|
||
|
||
.ast-tab {
|
||
padding: 8px 16px;
|
||
font-size: 13px;
|
||
font-weight: 500;
|
||
color: var(--text-tertiary);
|
||
background: none;
|
||
border: none;
|
||
border-bottom: 2px solid transparent;
|
||
cursor: pointer;
|
||
transition: all var(--transition-fast);
|
||
}
|
||
|
||
.ast-tab:hover {
|
||
color: var(--text-primary);
|
||
}
|
||
|
||
.ast-tab.active {
|
||
color: var(--accent);
|
||
border-bottom-color: var(--accent);
|
||
}
|
||
|
||
.ast-tab-panel {
|
||
display: none;
|
||
}
|
||
|
||
.ast-tab-panel.active {
|
||
display: block;
|
||
}
|
||
|
||
/* ── 设置表单 ── */
|
||
.ast-settings-form {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 12px;
|
||
padding-top: 4px;
|
||
}
|
||
|
||
.ast-settings-form .form-group {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 4px;
|
||
}
|
||
|
||
.ast-settings-form label {
|
||
font-size: 13px;
|
||
font-weight: 600;
|
||
color: var(--text-secondary);
|
||
}
|
||
|
||
.ast-settings-form .form-input {
|
||
padding: 8px 12px;
|
||
border: 1px solid var(--border-primary);
|
||
border-radius: var(--radius-sm);
|
||
background: var(--bg-primary);
|
||
color: var(--text-primary);
|
||
font-size: 14px;
|
||
font-family: var(--font-mono);
|
||
outline: none;
|
||
transition: border-color var(--transition-fast);
|
||
}
|
||
|
||
.ast-settings-form .form-input:focus {
|
||
border-color: var(--border-focus);
|
||
box-shadow: 0 0 0 3px var(--accent-muted);
|
||
}
|
||
|
||
.ast-settings-form .form-hint {
|
||
font-size: 12px;
|
||
color: var(--text-tertiary);
|
||
}
|
||
|
||
/* 模型下拉列表 */
|
||
.ast-model-dropdown {
|
||
position: absolute;
|
||
top: 100%;
|
||
left: 0;
|
||
right: 0;
|
||
max-height: 240px;
|
||
overflow-y: auto;
|
||
background: var(--bg-secondary);
|
||
border: 1px solid var(--border-primary);
|
||
border-radius: var(--radius-sm);
|
||
box-shadow: var(--shadow-md);
|
||
z-index: 100;
|
||
margin-top: 4px;
|
||
}
|
||
|
||
.ast-model-option {
|
||
padding: 8px 12px;
|
||
font-size: 13px;
|
||
font-family: var(--font-mono);
|
||
cursor: pointer;
|
||
transition: background var(--transition-fast);
|
||
border-bottom: 1px solid var(--border-secondary);
|
||
}
|
||
|
||
.ast-model-option:last-child {
|
||
border-bottom: none;
|
||
}
|
||
|
||
.ast-model-option:hover {
|
||
background: var(--accent-muted);
|
||
color: var(--accent);
|
||
}
|
||
|
||
/* ── 模式选择器(高级版) ── */
|
||
.ast-mode-selector {
|
||
display: flex;
|
||
gap: 2px;
|
||
margin-right: 8px;
|
||
padding: 3px;
|
||
background: var(--bg-tertiary);
|
||
border-radius: 10px;
|
||
position: relative;
|
||
border: 1px solid var(--border-secondary);
|
||
backdrop-filter: blur(8px);
|
||
-webkit-backdrop-filter: blur(8px);
|
||
}
|
||
|
||
/* 滑动指示器 */
|
||
.ast-mode-slider {
|
||
position: absolute;
|
||
top: 3px;
|
||
height: calc(100% - 6px);
|
||
border-radius: 8px;
|
||
background: var(--accent);
|
||
opacity: 0;
|
||
transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1),
|
||
width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
|
||
background 0.3s ease,
|
||
box-shadow 0.3s ease;
|
||
z-index: 0;
|
||
pointer-events: none;
|
||
}
|
||
|
||
.ast-mode-btn {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 4px;
|
||
padding: 5px 12px;
|
||
font-size: 12px;
|
||
border: none;
|
||
border-radius: 8px;
|
||
background: transparent;
|
||
color: var(--text-tertiary);
|
||
cursor: pointer;
|
||
transition: color 0.25s ease, transform 0.15s ease;
|
||
white-space: nowrap;
|
||
line-height: 1.4;
|
||
position: relative;
|
||
z-index: 1;
|
||
letter-spacing: 0.3px;
|
||
}
|
||
|
||
.ast-mode-btn svg {
|
||
flex-shrink: 0;
|
||
transition: transform 0.2s ease;
|
||
}
|
||
|
||
.ast-mode-btn:hover {
|
||
color: var(--text-primary);
|
||
}
|
||
|
||
.ast-mode-btn:hover svg {
|
||
transform: scale(1.15);
|
||
}
|
||
|
||
.ast-mode-btn:active {
|
||
transform: scale(0.95);
|
||
}
|
||
|
||
.ast-mode-btn.active {
|
||
color: #fff;
|
||
font-weight: 600;
|
||
text-shadow: 0 1px 2px rgba(0,0,0,0.2);
|
||
}
|
||
|
||
/* 模式配色 — 滑块 + 光晕 */
|
||
.ast-main[data-mode="chat"] .ast-mode-slider {
|
||
background: linear-gradient(135deg, #6b7280, #4b5563);
|
||
box-shadow: 0 2px 8px rgba(107,114,128,0.4);
|
||
}
|
||
.ast-main[data-mode="plan"] .ast-mode-slider {
|
||
background: linear-gradient(135deg, #3b82f6, #2563eb);
|
||
box-shadow: 0 2px 12px rgba(59,130,246,0.45);
|
||
}
|
||
.ast-main[data-mode="execute"] .ast-mode-slider {
|
||
background: linear-gradient(135deg, #8b5cf6, #7c3aed);
|
||
box-shadow: 0 2px 12px rgba(139,92,246,0.45);
|
||
}
|
||
.ast-main[data-mode="unlimited"] .ast-mode-slider {
|
||
background: linear-gradient(135deg, #f59e0b, #d97706);
|
||
box-shadow: 0 2px 12px rgba(245,158,11,0.5);
|
||
}
|
||
|
||
/* 模式环境光 — header 底部辉光 */
|
||
.ast-header {
|
||
position: relative;
|
||
overflow: hidden;
|
||
}
|
||
.ast-header::after {
|
||
content: '';
|
||
position: absolute;
|
||
bottom: 0;
|
||
left: 0;
|
||
right: 0;
|
||
height: 2px;
|
||
transition: background 0.4s ease, box-shadow 0.4s ease;
|
||
}
|
||
.ast-main[data-mode="chat"] .ast-header::after {
|
||
background: linear-gradient(90deg, transparent, #6b7280, transparent);
|
||
box-shadow: 0 0 8px rgba(107,114,128,0.3);
|
||
}
|
||
.ast-main[data-mode="plan"] .ast-header::after {
|
||
background: linear-gradient(90deg, transparent, #3b82f6, transparent);
|
||
box-shadow: 0 0 12px rgba(59,130,246,0.4);
|
||
}
|
||
.ast-main[data-mode="execute"] .ast-header::after {
|
||
background: linear-gradient(90deg, transparent, #8b5cf6, transparent);
|
||
box-shadow: 0 0 12px rgba(139,92,246,0.4);
|
||
}
|
||
.ast-main[data-mode="unlimited"] .ast-header::after {
|
||
background: linear-gradient(90deg, transparent, #f59e0b, transparent);
|
||
box-shadow: 0 0 16px rgba(245,158,11,0.5);
|
||
}
|
||
|
||
/* 切换脉冲动画 */
|
||
.ast-header.ast-mode-pulse::after {
|
||
animation: mode-glow-pulse 0.6s ease-out;
|
||
}
|
||
@keyframes mode-glow-pulse {
|
||
0% { height: 2px; opacity: 1; }
|
||
40% { height: 40px; opacity: 0.6; }
|
||
100% { height: 2px; opacity: 1; }
|
||
}
|
||
|
||
/* 模式简介浮现提示 */
|
||
.ast-mode-toast {
|
||
position: absolute;
|
||
top: 52px;
|
||
left: 50%;
|
||
transform: translateX(-50%) translateY(-8px);
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
padding: 8px 18px;
|
||
border-radius: 20px;
|
||
font-size: 13px;
|
||
pointer-events: none;
|
||
opacity: 0;
|
||
transition: opacity 0.3s ease, transform 0.3s ease;
|
||
z-index: 50;
|
||
backdrop-filter: blur(12px);
|
||
-webkit-backdrop-filter: blur(12px);
|
||
border: 1px solid rgba(255,255,255,0.1);
|
||
white-space: nowrap;
|
||
}
|
||
.ast-mode-toast.show {
|
||
opacity: 1;
|
||
transform: translateX(-50%) translateY(0);
|
||
}
|
||
.ast-mode-toast-label {
|
||
font-weight: 700;
|
||
color: #fff;
|
||
}
|
||
.ast-mode-toast-desc {
|
||
font-size: 11px;
|
||
color: rgba(255,255,255,0.8);
|
||
}
|
||
.ast-mode-toast.mode-chat {
|
||
background: rgba(107,114,128,0.85);
|
||
box-shadow: 0 4px 20px rgba(107,114,128,0.3);
|
||
}
|
||
.ast-mode-toast.mode-plan {
|
||
background: rgba(59,130,246,0.85);
|
||
box-shadow: 0 4px 20px rgba(59,130,246,0.3);
|
||
}
|
||
.ast-mode-toast.mode-execute {
|
||
background: rgba(139,92,246,0.85);
|
||
box-shadow: 0 4px 20px rgba(139,92,246,0.3);
|
||
}
|
||
.ast-mode-toast.mode-unlimited {
|
||
background: rgba(245,158,11,0.85);
|
||
box-shadow: 0 4px 20px rgba(245,158,11,0.3);
|
||
}
|
||
|
||
/* ── 全屏涟漪扩散 ── */
|
||
.ast-mode-ripple {
|
||
position: absolute;
|
||
top: 0; left: 0; right: 0; bottom: 0;
|
||
z-index: 40;
|
||
pointer-events: none;
|
||
overflow: hidden;
|
||
}
|
||
.ast-mode-ripple::after {
|
||
content: '';
|
||
position: absolute;
|
||
left: var(--ripple-x, 50%);
|
||
top: var(--ripple-y, 0);
|
||
width: 0;
|
||
height: 0;
|
||
border-radius: 50%;
|
||
background: radial-gradient(circle, var(--ripple-color) 0%, transparent 70%);
|
||
opacity: 0.18;
|
||
transform: translate(-50%, -50%);
|
||
animation: mode-ripple-expand 0.7s cubic-bezier(0.2, 0, 0.2, 1) forwards;
|
||
}
|
||
@keyframes mode-ripple-expand {
|
||
0% { width: 0; height: 0; opacity: 0.25; }
|
||
100% { width: 200vmax; height: 200vmax; opacity: 0; }
|
||
}
|
||
|
||
/* ── 粒子爆发 ── */
|
||
.ast-mode-particle {
|
||
position: absolute;
|
||
left: var(--px);
|
||
top: var(--py);
|
||
width: var(--size);
|
||
height: var(--size);
|
||
border-radius: 50%;
|
||
background: var(--color);
|
||
box-shadow: 0 0 6px var(--color), 0 0 12px var(--color);
|
||
pointer-events: none;
|
||
z-index: 41;
|
||
opacity: 1;
|
||
animation: mode-particle-fly var(--duration) var(--delay) cubic-bezier(0.2, 0, 0.3, 1) forwards;
|
||
}
|
||
@keyframes mode-particle-fly {
|
||
0% { transform: translate(0, 0) scale(1); opacity: 1; }
|
||
70% { opacity: 0.8; }
|
||
100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
|
||
}
|
||
|
||
/* ── 模式环境渐变背景 ── */
|
||
.ast-messages {
|
||
position: relative;
|
||
}
|
||
.ast-messages::before {
|
||
content: '';
|
||
position: absolute;
|
||
top: 0; left: 0; right: 0;
|
||
height: 120px;
|
||
pointer-events: none;
|
||
z-index: 0;
|
||
transition: opacity 0.5s ease;
|
||
opacity: 0;
|
||
}
|
||
.ast-main[data-mode="plan"] .ast-messages::before {
|
||
background: linear-gradient(180deg, rgba(59,130,246,0.06) 0%, transparent 100%);
|
||
opacity: 1;
|
||
}
|
||
.ast-main[data-mode="execute"] .ast-messages::before {
|
||
background: linear-gradient(180deg, rgba(139,92,246,0.06) 0%, transparent 100%);
|
||
opacity: 1;
|
||
}
|
||
.ast-main[data-mode="unlimited"] .ast-messages::before {
|
||
background: linear-gradient(180deg, rgba(245,158,11,0.08) 0%, transparent 100%);
|
||
opacity: 1;
|
||
}
|
||
|
||
/* ── 无限模式特效:脉冲边框 ── */
|
||
.ast-main[data-mode="unlimited"] {
|
||
position: relative;
|
||
}
|
||
.ast-main[data-mode="unlimited"]::before {
|
||
content: '';
|
||
position: absolute;
|
||
top: 0; left: 0; right: 0; bottom: 0;
|
||
border: 1px solid transparent;
|
||
border-image: linear-gradient(
|
||
var(--unlimited-angle, 0deg),
|
||
rgba(245,158,11,0.5),
|
||
rgba(239,68,68,0.3),
|
||
rgba(245,158,11,0.5)
|
||
) 1;
|
||
pointer-events: none;
|
||
z-index: 0;
|
||
animation: unlimited-border-rotate 3s linear infinite;
|
||
}
|
||
@keyframes unlimited-border-rotate {
|
||
0% { --unlimited-angle: 0deg; }
|
||
100% { --unlimited-angle: 360deg; }
|
||
}
|
||
@property --unlimited-angle {
|
||
syntax: '<angle>';
|
||
inherits: false;
|
||
initial-value: 0deg;
|
||
}
|
||
|
||
/* 模式简介 toast 图标 */
|
||
.ast-mode-toast-icon {
|
||
display: flex;
|
||
align-items: center;
|
||
}
|
||
.ast-mode-toast-icon svg {
|
||
width: 16px;
|
||
height: 16px;
|
||
stroke: #fff;
|
||
filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
|
||
}
|
||
|
||
/* 输入区模式色 */
|
||
.ast-main[data-mode="unlimited"] .ast-input-area { border-top-color: rgba(245,158,11,0.3); }
|
||
.ast-main[data-mode="plan"] .ast-input-area { border-top-color: rgba(59,130,246,0.3); }
|
||
.ast-main[data-mode="execute"] .ast-input-area { border-top-color: rgba(139,92,246,0.3); }
|
||
|
||
/* 工具开关行 */
|
||
.ast-switch-row {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
padding: 10px 0;
|
||
border-bottom: 1px solid var(--border-secondary);
|
||
cursor: pointer;
|
||
font-size: 13px;
|
||
color: var(--text-primary);
|
||
}
|
||
.ast-switch-row:last-of-type { border-bottom: none; }
|
||
.ast-switch-row input[type="checkbox"] { display: none; }
|
||
|
||
.ast-switch-track {
|
||
position: relative;
|
||
width: 36px;
|
||
height: 20px;
|
||
background: var(--bg-tertiary);
|
||
border-radius: 10px;
|
||
transition: background var(--transition-fast);
|
||
flex-shrink: 0;
|
||
}
|
||
.ast-switch-track::after {
|
||
content: '';
|
||
position: absolute;
|
||
top: 2px;
|
||
left: 2px;
|
||
width: 16px;
|
||
height: 16px;
|
||
background: #fff;
|
||
border-radius: 50%;
|
||
transition: transform var(--transition-fast);
|
||
box-shadow: 0 1px 2px rgba(0,0,0,0.2);
|
||
}
|
||
.ast-switch-row input:checked + .ast-switch-track {
|
||
background: var(--accent);
|
||
}
|
||
.ast-switch-row input:checked + .ast-switch-track::after {
|
||
transform: translateX(16px);
|
||
}
|
||
|
||
/* ask_user 交互卡片 */
|
||
.ast-ask-card {
|
||
margin: 8px 0;
|
||
padding: 14px 16px;
|
||
border: 1px solid var(--accent);
|
||
border-radius: var(--radius-md);
|
||
background: var(--bg-secondary);
|
||
animation: msg-in 0.2s ease-out;
|
||
}
|
||
.ast-ask-card.answered {
|
||
border-color: var(--border-secondary);
|
||
opacity: 0.7;
|
||
}
|
||
|
||
.ast-ask-question {
|
||
font-size: 13px;
|
||
font-weight: 500;
|
||
color: var(--text-primary);
|
||
margin-bottom: 10px;
|
||
line-height: 1.5;
|
||
}
|
||
|
||
.ast-ask-options {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 6px;
|
||
margin-bottom: 10px;
|
||
}
|
||
|
||
.ast-ask-option {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
padding: 8px 12px;
|
||
border: 1px solid var(--border-secondary);
|
||
border-radius: var(--radius-sm);
|
||
cursor: pointer;
|
||
font-size: 13px;
|
||
color: var(--text-secondary);
|
||
transition: all var(--transition-fast);
|
||
}
|
||
.ast-ask-option:hover {
|
||
border-color: var(--accent);
|
||
color: var(--text-primary);
|
||
background: var(--accent-muted);
|
||
}
|
||
.ast-ask-option input {
|
||
accent-color: var(--accent);
|
||
}
|
||
.ast-ask-option:has(input:checked) {
|
||
border-color: var(--accent);
|
||
background: var(--accent-muted);
|
||
color: var(--accent);
|
||
font-weight: 500;
|
||
}
|
||
|
||
.ast-ask-custom {
|
||
margin-bottom: 10px;
|
||
}
|
||
.ast-ask-custom-input {
|
||
width: 100%;
|
||
padding: 8px 12px;
|
||
border: 1px dashed var(--border-secondary);
|
||
border-radius: var(--radius-sm);
|
||
background: transparent;
|
||
color: var(--text-primary);
|
||
font-size: 12px;
|
||
outline: none;
|
||
transition: border-color var(--transition-fast);
|
||
}
|
||
.ast-ask-custom-input:focus {
|
||
border-color: var(--accent);
|
||
}
|
||
|
||
.ast-ask-text {
|
||
width: 100%;
|
||
padding: 8px 12px;
|
||
border: 1px solid var(--border-secondary);
|
||
border-radius: var(--radius-sm);
|
||
background: transparent;
|
||
color: var(--text-primary);
|
||
font-size: 13px;
|
||
resize: vertical;
|
||
outline: none;
|
||
margin-bottom: 10px;
|
||
font-family: inherit;
|
||
}
|
||
.ast-ask-text:focus {
|
||
border-color: var(--accent);
|
||
}
|
||
|
||
.ast-ask-actions {
|
||
display: flex;
|
||
gap: 8px;
|
||
margin-top: 2px;
|
||
}
|
||
|
||
.ast-ask-answered {
|
||
padding: 2px 0;
|
||
}
|
||
.ast-ask-answered .ast-ask-question {
|
||
margin-bottom: 4px;
|
||
font-size: 12px;
|
||
color: var(--text-tertiary);
|
||
}
|
||
.ast-ask-answer {
|
||
font-size: 13px;
|
||
color: var(--success);
|
||
font-weight: 500;
|
||
}
|
||
|
||
/* 会话状态指示点 */
|
||
.ast-status-dot {
|
||
width: 7px;
|
||
height: 7px;
|
||
border-radius: 50%;
|
||
flex-shrink: 0;
|
||
margin-right: 2px;
|
||
}
|
||
.ast-status-dot.streaming {
|
||
background: var(--success);
|
||
animation: status-pulse 1.2s ease-in-out infinite;
|
||
}
|
||
.ast-status-dot.waiting {
|
||
background: var(--warning);
|
||
animation: status-pulse 1.5s ease-in-out infinite;
|
||
}
|
||
.ast-status-dot.error {
|
||
background: var(--error);
|
||
}
|
||
@keyframes status-pulse {
|
||
0%, 100% { opacity: 1; }
|
||
50% { opacity: 0.3; }
|
||
}
|
||
|
||
/* 重试栏 */
|
||
.ast-retry-bar {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
padding: 10px 14px;
|
||
margin: 8px 0;
|
||
background: var(--bg-secondary);
|
||
border: 1px solid var(--error);
|
||
border-radius: var(--radius-md);
|
||
animation: msg-in 0.2s ease-out;
|
||
}
|
||
.ast-retry-hint {
|
||
font-size: 11px;
|
||
color: var(--text-tertiary);
|
||
margin-left: auto;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 4px;
|
||
}
|
||
/* 熔断状态:连续错误时的警告变体(Fix #226) */
|
||
.ast-retry-bar-circuit {
|
||
background: color-mix(in srgb, var(--warning, #f59e0b) 10%, var(--bg-secondary));
|
||
border-color: var(--warning, #f59e0b);
|
||
}
|
||
.ast-retry-bar-circuit .ast-retry-hint {
|
||
color: var(--warning, #f59e0b);
|
||
font-weight: 500;
|
||
}
|
||
.ast-retry-bar-circuit .ast-btn-retry[disabled] {
|
||
opacity: 0.5;
|
||
cursor: not-allowed;
|
||
}
|
||
.ast-retry-bar-circuit .ast-btn-retry[disabled]:hover {
|
||
filter: none;
|
||
}
|
||
|
||
/* 发送队列 */
|
||
.ast-queue {
|
||
display: none;
|
||
padding: 0 var(--space-md);
|
||
flex-shrink: 0;
|
||
}
|
||
.ast-queue-header {
|
||
font-size: 11px;
|
||
color: var(--text-tertiary);
|
||
padding: 4px 0;
|
||
font-weight: 500;
|
||
}
|
||
.ast-queue-item {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
padding: 6px 10px;
|
||
margin-bottom: 4px;
|
||
background: var(--bg-secondary);
|
||
border: 1px solid var(--border-secondary);
|
||
border-radius: var(--radius-sm);
|
||
font-size: 12px;
|
||
animation: msg-in 0.15s ease-out;
|
||
}
|
||
.ast-queue-num {
|
||
width: 18px;
|
||
height: 18px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
background: var(--accent-muted);
|
||
color: var(--accent);
|
||
border-radius: 50%;
|
||
font-size: 10px;
|
||
font-weight: 600;
|
||
flex-shrink: 0;
|
||
}
|
||
.ast-queue-text {
|
||
flex: 1;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
color: var(--text-primary);
|
||
}
|
||
.ast-queue-actions {
|
||
display: flex;
|
||
gap: 4px;
|
||
flex-shrink: 0;
|
||
}
|
||
.ast-queue-btn {
|
||
background: none;
|
||
border: none;
|
||
cursor: pointer;
|
||
padding: 2px 4px;
|
||
border-radius: 3px;
|
||
font-size: 12px;
|
||
opacity: 0.5;
|
||
transition: opacity var(--transition-fast), background var(--transition-fast);
|
||
}
|
||
.ast-queue-btn:hover {
|
||
opacity: 1;
|
||
}
|
||
.ast-queue-btn.send:hover {
|
||
background: var(--accent-muted);
|
||
}
|
||
.ast-queue-btn.edit:hover {
|
||
background: var(--accent-muted);
|
||
}
|
||
.ast-queue-btn.delete:hover {
|
||
background: var(--error-muted);
|
||
color: var(--error);
|
||
}
|
||
.ast-queue-edit-input {
|
||
flex: 1;
|
||
background: var(--bg-primary);
|
||
border: 1px solid var(--accent);
|
||
border-radius: var(--radius-sm);
|
||
color: var(--text-primary);
|
||
font-size: 12px;
|
||
padding: 4px 8px;
|
||
resize: none;
|
||
outline: none;
|
||
font-family: inherit;
|
||
}
|
||
.ast-queue-item.editing {
|
||
border-color: var(--accent);
|
||
}
|
||
.ast-queue-header {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 4px;
|
||
}
|
||
.ast-queue-header svg {
|
||
flex-shrink: 0;
|
||
}
|
||
.ast-retry-bar .btn svg {
|
||
vertical-align: -2px;
|
||
margin-right: 2px;
|
||
}
|
||
|
||
/* 工具调用块 */
|
||
.ast-tool-block {
|
||
margin-bottom: 8px;
|
||
border: 1px solid var(--border-secondary);
|
||
border-radius: var(--radius-sm);
|
||
font-size: 12px;
|
||
overflow: hidden;
|
||
width: 100%;
|
||
}
|
||
|
||
.ast-tool-block.ok {
|
||
border-left: 3px solid var(--success);
|
||
}
|
||
|
||
.ast-tool-block.denied {
|
||
border-left: 3px solid var(--warning);
|
||
}
|
||
|
||
.ast-tool-block.pending {
|
||
border-left: 3px solid var(--accent);
|
||
animation: ast-pulse 1.5s ease-in-out infinite;
|
||
}
|
||
|
||
@keyframes ast-pulse {
|
||
0%, 100% { opacity: 1; }
|
||
50% { opacity: 0.7; }
|
||
}
|
||
|
||
.ast-tool-summary {
|
||
padding: 8px 12px;
|
||
cursor: pointer;
|
||
user-select: none;
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
background: var(--bg-tertiary);
|
||
transition: background var(--transition-fast);
|
||
}
|
||
|
||
.ast-tool-summary:hover {
|
||
background: var(--bg-secondary);
|
||
}
|
||
|
||
.ast-tool-summary code {
|
||
font-size: 11px;
|
||
background: var(--bg-secondary);
|
||
padding: 1px 6px;
|
||
border-radius: 3px;
|
||
max-width: 300px;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.ast-tool-status {
|
||
margin-left: auto;
|
||
font-size: 11px;
|
||
color: var(--text-tertiary);
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.ast-tool-block.ok .ast-tool-status {
|
||
color: var(--success);
|
||
}
|
||
|
||
.ast-tool-block.denied .ast-tool-status {
|
||
color: var(--warning);
|
||
}
|
||
|
||
.ast-tool-result {
|
||
margin: 0;
|
||
padding: 8px 12px;
|
||
font-size: 11px;
|
||
font-family: var(--font-mono);
|
||
line-height: 1.5;
|
||
max-height: 200px;
|
||
overflow: auto;
|
||
background: var(--bg-primary);
|
||
white-space: pre-wrap;
|
||
word-break: break-all;
|
||
border-top: 1px solid var(--border-secondary);
|
||
}
|
||
|
||
/* ── 图片附件 ── */
|
||
|
||
/* 附件按钮 */
|
||
.ast-attach-btn {
|
||
background: none;
|
||
border: none;
|
||
color: var(--text-tertiary);
|
||
cursor: pointer;
|
||
padding: 4px;
|
||
border-radius: var(--radius-sm);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
flex-shrink: 0;
|
||
transition: color var(--transition-fast), background var(--transition-fast);
|
||
}
|
||
.ast-attach-btn:hover {
|
||
color: var(--accent);
|
||
background: var(--accent-muted);
|
||
}
|
||
|
||
/* 输入框布局调整 */
|
||
.ast-input-wrap {
|
||
display: flex;
|
||
align-items: flex-end;
|
||
gap: 4px;
|
||
}
|
||
|
||
/* 图片预览区 */
|
||
.ast-image-preview {
|
||
display: none;
|
||
flex-wrap: wrap;
|
||
gap: 8px;
|
||
padding: 8px 12px 4px;
|
||
animation: msg-in 0.15s ease-out;
|
||
}
|
||
|
||
.ast-img-thumb {
|
||
position: relative;
|
||
border-radius: var(--radius-sm);
|
||
overflow: hidden;
|
||
border: 2px solid var(--border-secondary);
|
||
transition: border-color var(--transition-fast);
|
||
cursor: pointer;
|
||
animation: msg-in 0.2s ease-out;
|
||
}
|
||
.ast-img-thumb:hover {
|
||
border-color: var(--accent);
|
||
}
|
||
.ast-img-thumb img {
|
||
display: block;
|
||
height: 64px;
|
||
max-width: 120px;
|
||
object-fit: cover;
|
||
}
|
||
.ast-img-thumb-del {
|
||
position: absolute;
|
||
top: 2px;
|
||
right: 2px;
|
||
background: rgba(0,0,0,0.65);
|
||
color: #fff;
|
||
border: none;
|
||
border-radius: 50%;
|
||
width: 18px;
|
||
height: 18px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
cursor: pointer;
|
||
opacity: 0;
|
||
transition: opacity var(--transition-fast);
|
||
padding: 0;
|
||
}
|
||
.ast-img-thumb:hover .ast-img-thumb-del {
|
||
opacity: 1;
|
||
}
|
||
.ast-img-thumb-del:hover {
|
||
background: var(--error);
|
||
}
|
||
|
||
/* 消息中的图片 */
|
||
.ast-msg-images {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
gap: 6px;
|
||
margin-bottom: 6px;
|
||
}
|
||
.ast-msg-img {
|
||
border-radius: var(--radius-sm);
|
||
max-height: 240px;
|
||
object-fit: contain;
|
||
cursor: pointer;
|
||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||
}
|
||
.ast-msg-img:hover {
|
||
transform: scale(1.02);
|
||
box-shadow: 0 4px 16px rgba(0,0,0,0.15);
|
||
}
|
||
.ast-msg-img-placeholder,
|
||
.ast-msg-img-loading {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
padding: 8px 12px;
|
||
background: var(--bg-tertiary);
|
||
border: 1px dashed var(--border-secondary);
|
||
border-radius: var(--radius-sm);
|
||
color: var(--text-tertiary);
|
||
font-size: 11px;
|
||
}
|
||
.ast-msg-img-placeholder svg,
|
||
.ast-msg-img-loading svg {
|
||
flex-shrink: 0;
|
||
opacity: 0.5;
|
||
}
|
||
.ast-msg-img-loading svg {
|
||
animation: status-pulse 1.2s ease-in-out infinite;
|
||
}
|
||
|
||
/* 拖拽覆盖层 */
|
||
.ast-main.ast-drag-over {
|
||
position: relative;
|
||
}
|
||
.ast-main.ast-drag-over::after {
|
||
content: '释放以添加图片';
|
||
position: absolute;
|
||
top: 0; left: 0; right: 0; bottom: 0;
|
||
background: rgba(var(--accent-rgb, 139,92,246), 0.08);
|
||
border: 2px dashed var(--accent);
|
||
border-radius: var(--radius-md);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
font-size: 16px;
|
||
font-weight: 600;
|
||
color: var(--accent);
|
||
z-index: 100;
|
||
pointer-events: none;
|
||
backdrop-filter: blur(4px);
|
||
-webkit-backdrop-filter: blur(4px);
|
||
animation: msg-in 0.15s ease-out;
|
||
}
|
||
|
||
/* 右键调试菜单 */
|
||
.ast-ctx-menu {
|
||
position: fixed;
|
||
z-index: 99999;
|
||
min-width: 160px;
|
||
background: var(--bg-secondary);
|
||
border: 1px solid var(--border-primary);
|
||
border-radius: var(--radius-sm);
|
||
box-shadow: 0 8px 24px rgba(0,0,0,0.15);
|
||
padding: 4px 0;
|
||
animation: msg-in 0.12s ease-out;
|
||
}
|
||
.ast-ctx-menu button {
|
||
display: block;
|
||
width: 100%;
|
||
padding: 7px 14px;
|
||
border: none;
|
||
background: none;
|
||
color: var(--text-primary);
|
||
font-size: 13px;
|
||
text-align: left;
|
||
cursor: pointer;
|
||
white-space: nowrap;
|
||
}
|
||
.ast-ctx-menu button:hover {
|
||
background: var(--accent-muted);
|
||
color: var(--accent);
|
||
}
|
||
.ast-ctx-menu hr {
|
||
border: none;
|
||
border-top: 1px solid var(--border-secondary);
|
||
margin: 4px 0;
|
||
}
|
||
|
||
/* 调试弹窗 */
|
||
.ast-debug-overlay {
|
||
position: fixed;
|
||
inset: 0;
|
||
z-index: 99999;
|
||
background: rgba(0,0,0,0.4);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
animation: msg-in 0.15s ease-out;
|
||
}
|
||
.ast-debug-modal {
|
||
background: var(--bg-secondary);
|
||
border: 1px solid var(--border-primary);
|
||
border-radius: var(--radius-md);
|
||
box-shadow: 0 16px 48px rgba(0,0,0,0.2);
|
||
width: min(640px, 90vw);
|
||
max-height: 80vh;
|
||
display: flex;
|
||
flex-direction: column;
|
||
}
|
||
.ast-debug-header {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
padding: 12px 16px;
|
||
border-bottom: 1px solid var(--border-secondary);
|
||
font-weight: 600;
|
||
font-size: 14px;
|
||
}
|
||
.ast-debug-close {
|
||
border: none;
|
||
background: none;
|
||
font-size: 20px;
|
||
color: var(--text-tertiary);
|
||
cursor: pointer;
|
||
padding: 0 4px;
|
||
line-height: 1;
|
||
}
|
||
.ast-debug-close:hover { color: var(--text-primary); }
|
||
.ast-debug-content {
|
||
flex: 1;
|
||
overflow: auto;
|
||
padding: 16px;
|
||
margin: 0;
|
||
font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;
|
||
font-size: 12px;
|
||
line-height: 1.6;
|
||
color: var(--text-secondary);
|
||
white-space: pre-wrap;
|
||
word-break: break-all;
|
||
background: var(--bg-tertiary);
|
||
}
|
||
.ast-debug-actions {
|
||
padding: 10px 16px;
|
||
border-top: 1px solid var(--border-secondary);
|
||
display: flex;
|
||
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); }
|
||
}
|
||
|
||
/* === 移动端响应式 === */
|
||
@media (max-width: 768px) {
|
||
.ast-header {
|
||
flex-wrap: wrap;
|
||
padding: var(--space-sm) var(--space-sm);
|
||
gap: 6px;
|
||
}
|
||
.ast-header-left {
|
||
gap: 6px;
|
||
}
|
||
.ast-toggle-sidebar {
|
||
width: 36px;
|
||
height: 36px;
|
||
min-width: 36px;
|
||
border: 1px solid var(--border-primary);
|
||
border-radius: 8px;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
.ast-header-actions button,
|
||
.ast-header-actions a {
|
||
min-width: 34px;
|
||
min-height: 34px;
|
||
padding: 6px;
|
||
}
|
||
.ast-mode-tabs {
|
||
gap: 2px;
|
||
}
|
||
.ast-mode-tab {
|
||
padding: 4px 8px;
|
||
font-size: 12px;
|
||
}
|
||
.ast-skill-grid {
|
||
grid-template-columns: repeat(2, 1fr);
|
||
gap: var(--space-sm);
|
||
padding: 0 var(--space-sm);
|
||
}
|
||
.ast-sidebar.open {
|
||
position: fixed;
|
||
left: 0;
|
||
top: 0;
|
||
z-index: 850;
|
||
height: 100vh;
|
||
width: 240px;
|
||
min-width: 240px;
|
||
box-shadow: 4px 0 24px rgba(0,0,0,.15);
|
||
}
|
||
.ast-input-area {
|
||
padding: var(--space-sm);
|
||
gap: var(--space-xs);
|
||
}
|
||
}
|
||
@media (max-width: 480px) {
|
||
.ast-skill-grid {
|
||
grid-template-columns: 1fr;
|
||
}
|
||
}
|