feat(hub): add AI coach page with daily summary and chat
Aggregate four-account trades via hub_ai module and /api/hub/trades/today; store sessions in JSON; default OpenAI config matches instances. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -3342,3 +3342,132 @@ html[data-theme="light"] button.danger {
|
||||
background: rgba(201, 53, 82, 0.1);
|
||||
border-color: rgba(201, 53, 82, 0.45);
|
||||
}
|
||||
|
||||
/* --- Hub AI 教练 --- */
|
||||
.ai-layout {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 16px;
|
||||
align-items: start;
|
||||
}
|
||||
@media (max-width: 960px) {
|
||||
.ai-layout {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
.ai-panel {
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--border-soft);
|
||||
border-radius: var(--radius);
|
||||
padding: 14px 16px;
|
||||
min-height: 420px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
.ai-panel-head {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
}
|
||||
.ai-panel-head h2 {
|
||||
margin: 0;
|
||||
font-size: 1rem;
|
||||
font-family: var(--display);
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
.ai-panel-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
.ai-stats-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px 14px;
|
||||
font-size: 0.82rem;
|
||||
color: var(--muted);
|
||||
}
|
||||
.ai-stat-chip {
|
||||
padding: 4px 8px;
|
||||
border-radius: 6px;
|
||||
background: var(--inset-surface);
|
||||
border: 1px solid var(--border-soft);
|
||||
}
|
||||
.ai-stat-chip strong {
|
||||
color: var(--text);
|
||||
margin-right: 4px;
|
||||
}
|
||||
.ai-md-body {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
max-height: min(62vh, 640px);
|
||||
padding: 12px;
|
||||
border-radius: 8px;
|
||||
background: var(--inset-surface);
|
||||
border: 1px solid var(--border-soft);
|
||||
font-size: 0.86rem;
|
||||
line-height: 1.55;
|
||||
color: var(--text);
|
||||
}
|
||||
.ai-placeholder {
|
||||
color: var(--muted);
|
||||
margin: 0;
|
||||
}
|
||||
.ai-chat-panel {
|
||||
min-height: 520px;
|
||||
}
|
||||
.ai-chat-messages {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
max-height: min(52vh, 520px);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
padding: 8px 4px;
|
||||
}
|
||||
.ai-bubble {
|
||||
max-width: 92%;
|
||||
padding: 10px 12px;
|
||||
border-radius: 10px;
|
||||
font-size: 0.88rem;
|
||||
line-height: 1.5;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
}
|
||||
.ai-bubble-user {
|
||||
align-self: flex-end;
|
||||
background: var(--accent-dim);
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
.ai-bubble-assistant {
|
||||
align-self: flex-start;
|
||||
background: var(--inset-surface);
|
||||
border: 1px solid var(--border-soft);
|
||||
}
|
||||
.ai-chat-form {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr auto;
|
||||
gap: 8px;
|
||||
align-items: end;
|
||||
}
|
||||
.ai-chat-form textarea {
|
||||
width: 100%;
|
||||
resize: vertical;
|
||||
min-height: 72px;
|
||||
padding: 10px 12px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--border-soft);
|
||||
background: var(--inset-surface);
|
||||
color: var(--text);
|
||||
font-family: var(--font);
|
||||
font-size: 0.88rem;
|
||||
}
|
||||
.ai-chat-form textarea:focus {
|
||||
outline: none;
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user