Files
AIclinicalresearch/frontend/src/pages/rvw/styles.css
HaHafeng 40c2f8e148 feat(rag): Complete RAG engine implementation with pgvector
Major Features:
- Created ekb_schema (13th schema) with 3 tables: KB/Document/Chunk
- Implemented EmbeddingService (text-embedding-v4, 1024-dim vectors)
- Implemented ChunkService (smart Markdown chunking)
- Implemented VectorSearchService (multi-query + hybrid search)
- Implemented RerankService (qwen3-rerank)
- Integrated DeepSeek V3 QueryRewriter for cross-language search
- Python service: Added pymupdf4llm for PDF-to-Markdown conversion
- PKB: Dual-mode adapter (pgvector/dify/hybrid)

Architecture:
- Brain-Hand Model: Business layer (DeepSeek) + Engine layer (pgvector)
- Cross-language support: Chinese query matches English documents
- Small Embedding (1024) + Strong Reranker strategy

Performance:
- End-to-end latency: 2.5s
- Cost per query: 0.0025 RMB
- Accuracy improvement: +20.5% (cross-language)

Tests:
- test-embedding-service.ts: Vector embedding verified
- test-rag-e2e.ts: Full pipeline tested
- test-rerank.ts: Rerank quality validated
- test-query-rewrite.ts: Cross-language search verified
- test-pdf-ingest.ts: Real PDF document tested (Dongen 2003.pdf)

Documentation:
- Added 05-RAG-Engine-User-Guide.md
- Added 02-Document-Processing-User-Guide.md
- Updated system status documentation

Status: Production ready
2026-01-21 20:24:29 +08:00

252 lines
4.1 KiB
CSS

/**
* RVW模块样式
* 基于原型图 V7 的高保真还原
*/
/* ==================== 状态标签 ==================== */
.tag {
display: inline-flex;
align-items: center;
padding: 2px 8px;
border-radius: 4px;
font-size: 11px;
font-weight: 600;
line-height: 1.5;
border: 1px solid transparent;
}
.tag-blue {
background: #eff6ff;
color: #1d4ed8;
border-color: #dbeafe;
}
.tag-purple {
background: #f5f3ff;
color: #6d28d9;
border-color: #ede9fe;
}
.tag-green {
background: #f0fdf4;
color: #15803d;
border-color: #dcfce7;
}
.tag-amber {
background: #fffbeb;
color: #b45309;
border-color: #fef3c7;
}
.tag-red {
background: #fef2f2;
color: #dc2626;
border-color: #fecaca;
}
.tag-gray {
background: #f8fafc;
color: #64748b;
border-color: #e2e8f0;
}
/* ==================== 筛选 Chips ==================== */
.filter-chip {
padding: 4px 12px;
border-radius: 9999px;
font-size: 13px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
border: 1px solid transparent;
color: #64748b;
background: transparent;
}
.filter-chip:hover {
background-color: #f1f5f9;
color: #0f172a;
}
.filter-chip.active {
background-color: #eff6ff;
color: #2563eb;
border-color: #bfdbfe;
font-weight: 600;
}
/* ==================== 侧边栏 Tooltip ==================== */
.sidebar-tooltip {
position: absolute;
left: 100%;
top: 50%;
transform: translateY(-50%);
margin-left: 12px;
background: #1e293b;
color: white;
padding: 6px 10px;
border-radius: 6px;
font-size: 12px;
white-space: nowrap;
z-index: 50;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
opacity: 0;
visibility: hidden;
transition: opacity 0.2s, visibility 0.2s;
pointer-events: none;
}
.sidebar-btn:hover .sidebar-tooltip {
opacity: 1;
visibility: visible;
}
/* ==================== 动画 ==================== */
.fade-in {
animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.slide-up {
animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* ==================== 表格悬停效果 ==================== */
.task-table tbody tr {
transition: background-color 0.15s ease;
}
.task-table tbody tr:hover {
background-color: #f8fafc;
}
.task-table tbody tr.selected {
background-color: #eff6ff;
}
/* ==================== 评分环 ==================== */
.score-circle {
width: 80px;
height: 80px;
border-radius: 50%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.score-circle.pass {
border-color: #22c55e;
background: #f0fdf4;
color: #15803d;
}
.score-circle.warn {
border-color: #f59e0b;
background: #fffbeb;
color: #b45309;
}
.score-circle.fail {
border-color: #ef4444;
background: #fef2f2;
color: #dc2626;
}
/* ==================== 按钮样式 ==================== */
.btn-primary {
background-color: #4f46e5;
color: white;
font-weight: 600;
padding: 8px 16px;
border-radius: 8px;
transition: all 0.2s;
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.btn-primary:hover {
background-color: #4338ca;
transform: translateY(-1px);
}
.btn-secondary {
background-color: white;
color: #374151;
font-weight: 500;
padding: 8px 16px;
border-radius: 8px;
border: 1px solid #d1d5db;
transition: all 0.2s;
}
.btn-secondary:hover {
background-color: #f9fafb;
border-color: #9ca3af;
}
/* ==================== 滚动条美化 ==================== */
.overflow-auto::-webkit-scrollbar {
width: 8px;
height: 8px;
}
.overflow-auto::-webkit-scrollbar-track {
background: #f1f5f9;
border-radius: 4px;
}
.overflow-auto::-webkit-scrollbar-thumb {
background: #cbd5e1;
border-radius: 4px;
}
.overflow-auto::-webkit-scrollbar-thumb:hover {
background: #94a3b8;
}
/* ==================== 响应式调整 ==================== */
@media (max-width: 1024px) {
.sidebar-tooltip {
display: none;
}
}