Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.
Go agentagenticaichatbotdsh-pluginembeddingsevaluationgenerative-aigolangknowledge-basellmmulti-tenantollamaopenaiquestion-answeringragrerankingsemantic-searchvector-searchwiki
// Resource cards share the artifact page's toolbar, with their own compact grid.
// Page-specific classes retain existing actions and permission gates.
.resource-card-grid() {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
gap: 10px;
align-items: stretch;
}
.resource-card() {
position: relative;
display: flex;
flex-direction: column;
box-sizing: border-box;
min-width: 0;
min-height: 132px;
padding: 12px;
border: 1px solid var(--td-component-stroke);
border-radius: var(--app-radius-md);
background: var(--td-bg-color-container);
cursor: pointer;
transition: border-color var(--app-motion-fast) ease, box-shadow var(--app-motion-fast) ease;
@media (hover: hover) and (pointer: fine) {
&:hover {
border-color: var(--td-component-border);
box-shadow:
0 1px 2px color-mix(in srgb, var(--td-text-color-primary) 3%, transparent),
0 3px 10px color-mix(in srgb, var(--td-text-color-primary) 4%, transparent);
}
}
&:focus-visible {
outline: 2px solid var(--td-brand-color);
outline-offset: -2px;
}
.card-header {
display: flex;
align-items: center;
gap: 8px;
min-width: 0;
min-height: 28px;
padding-right: 28px;
margin-bottom: 6px;
}
&:has(.kb-favorite-star, .agent-favorite-star) .card-header { padding-right: 60px; }
.card-header-left,
.card-title-block { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.card-title {
display: block;
flex: 1;
min-width: 0;
color: var(--td-text-color-primary);
font-size: var(--app-text-base);
font-weight: 600;
line-height: 20px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.card-title:has(.card-title-text) { display: flex; align-items: center; gap: 6px; }
.card-title-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.card-content {
flex: 1;
min-width: 0;
min-height: 36px;
margin-bottom: 8px;
overflow: hidden;
}
.card-description {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
line-clamp: 2;
color: var(--td-text-color-secondary);
font-size: var(--app-text-sm);
line-height: 18px;
overflow: hidden;
&.is-empty { color: var(--td-text-color-placeholder); }
}
.card-bottom {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 8px;
min-width: 0;
margin-top: auto;
padding-top: 6px;
border-top: 1px solid color-mix(in srgb, var(--td-component-stroke) 60%, transparent);
}
.feature-badges { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.builtin-avatar,
.org-avatar,
:deep(.agent-avatar) {
flex-shrink: 0;
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
}
.more-wrap,
.shared-detail-trigger {
position: absolute;
right: 8px;
top: 12px;
display: flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
padding: 0;
border: 0;
border-radius: var(--app-radius-sm);
background: transparent;
color: var(--td-text-color-secondary);
cursor: pointer;
&:hover, &.active-more { background: var(--td-bg-color-secondarycontainer); }
&:focus-visible { outline: 2px solid var(--td-brand-color); outline-offset: 1px; }
.more-icon { width: 16px; height: 16px; }
}
&.is-skeleton {
cursor: default;
&:hover { border-color: var(--td-component-stroke); box-shadow: none; }
.card-header { padding-right: 0; }
}
@media (prefers-reduced-motion: reduce) { transition: none; }
}
.resource-card-quiet() {
.card-description {
font-size: var(--app-text-md);
line-height: 20px;
&.is-empty { font-size: var(--app-text-sm); }
}
.card-bottom { border-top: 0; padding-top: 4px; }
.resource-card-footer();
:deep(.resource-origin-badge) {
background: transparent;
color: var(--td-text-color-secondary);
font-weight: 400;
}
.agent-favorite-star { .resource-favorite-button(); right: 8px; }
&:has(.agent-favorite-star) .more-wrap { right: 38px; }
.agent-favorite-star:not(.is-favorited), .more-wrap {
opacity: 0;
pointer-events: none;
transition: opacity var(--app-motion-fast), background var(--app-motion-fast);
}
&:hover, &:focus-visible, &:has(:focus-visible) {
.agent-favorite-star, .more-wrap { opacity: 1; pointer-events: auto; }
:deep(.resource-card-avatar) { color: var(--td-text-color-primary); }
}
.more-wrap.active-more { opacity: 1; pointer-events: auto; }
@media (hover: hover) and (pointer: fine) {
&:hover {
--resource-avatar-transform: translateY(-1px) scale(1.12);
--resource-member-left: -2px;
--resource-member-right: 2px;
--resource-member-up: -2px;
}
}
@media (hover: none) {
.agent-favorite-star, .more-wrap { opacity: 1; pointer-events: auto; }
}
@media (prefers-reduced-motion: reduce) {
.agent-favorite-star, .more-wrap { transition: none; }
}
}
// Shared footer metrics and capabilities; scoped to list cards, not dialog previews.
.resource-card-footer() {
.card-bottom {
:deep(.resource-origin-badge .badge-icon) { width: 14px; height: 14px; }
.builtin-badge .t-icon { width: 14px; height: 14px; }
.bottom-left { min-width: 0; flex-wrap: wrap; }
.feature-badges { align-items: center; gap: 6px 8px; min-width: 0; }
.feature-badge {
display: inline-flex;
align-items: center;
justify-content: center;
flex: 0 0 auto;
gap: 4px;
width: 20px;
min-width: 20px;
height: 22px;
padding: 0;
background: transparent;
color: var(--td-text-color-placeholder);
transition: color var(--app-motion-fast);
// Optical sizing: these glyphs have more internal whitespace than the
// document, image and help icons. Keep their 20px targets unchanged.
&.knowledge, &.stat-kb, &.mcp, &.mode-normal { --footer-icon-size: 15px; }
&.web-search { --footer-icon-size: 16px; }
.t-icon { color: inherit; font-size: var(--footer-icon-size, 14px); }
:deep(svg) {
display: block;
width: var(--footer-icon-size, 14px);
height: var(--footer-icon-size, 14px);
flex-shrink: 0;
}
:deep(.kb-wiki-badge) { color: inherit; }
&.is-count {
width: auto;
min-width: 0;
color: var(--td-text-color-secondary);
white-space: nowrap;
}
.badge-count {
font-size: var(--app-text-sm);
font-weight: 400;
line-height: 20px;
font-variant-numeric: tabular-nums;
}
&:not(.is-count):hover, &:not(.is-count):focus-visible {
color: var(--td-text-color-primary);
}
&:focus-visible { outline: 2px solid var(--td-brand-color); outline-offset: 2px; }
}
}
@media (prefers-reduced-motion: reduce) {
.card-bottom .feature-badge { transition: none; }
}
}
.resource-feature-badge() {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 3px;
height: 20px;
min-width: 20px;
padding: 0 5px;
box-sizing: border-box;
border-radius: 5px;
background: var(--td-bg-color-secondarycontainer);
color: var(--td-text-color-secondary);
font-size: var(--app-text-xs);
font-weight: 500;
font-variant-numeric: tabular-nums;
cursor: default;
.t-icon { flex-shrink: 0; }
.badge-count { font-size: var(--app-text-xs); font-weight: 500; line-height: 1; }
}
.resource-section-header() {
grid-column: 1 / -1;
display: flex;
align-items: center;
gap: 6px;
margin-top: 8px;
padding: 4px 4px 2px;
color: var(--td-text-color-secondary);
font-size: var(--app-text-sm);
font-weight: 500;
line-height: 20px;
cursor: pointer;
user-select: none;
&:first-child { margin-top: 0; }
&:hover { color: var(--td-text-color-primary); }
&:focus-visible { outline: 2px solid var(--td-brand-color); outline-offset: -2px; border-radius: 4px; }
[class$='-section-count'] { font-variant-numeric: tabular-nums; color: var(--td-text-color-placeholder); }
[class$='-section-toggle'] { margin-left: 2px; opacity: 0.6; }
[class$='-section-subicon'] { margin-left: -4px; }
}
.resource-list-content() {
flex: 1;
min-width: 0;
min-height: 0;
height: 100%;
box-sizing: border-box;
display: flex;
flex-direction: column;
margin: 0;
padding: 20px 28px 0;
html.wails-desktop & { padding-top: 42px; }
@media (max-width: 720px) { padding: var(--app-space-4) var(--app-space-4) 0; }
}
.resource-list-main() {
flex: 1;
min-height: 0;
min-width: 0;
overflow-y: auto;
overflow-x: hidden;
padding: var(--app-space-3) 0 var(--app-space-6);
}
.resource-list-header() {
.header {
margin-bottom: 16px;
padding-right: 0;
flex-shrink: 0;
.header-title { width: 100%; gap: 4px; }
.title-row { flex-wrap: wrap; gap: 12px; }
h2 { margin-right: auto; }
.header-actions-lite {
max-width: 100%;
flex-wrap: wrap;
@media (max-width: 720px) {
width: 100%;
.resource-toolbar { width: 100%; }
}
}
.header-subtitle { color: var(--td-text-color-secondary); font-size: var(--app-text-base); }
.header-action-btn {
width: auto;
min-height: 32px;
padding: 0 12px;
gap: 6px;
font-size: var(--app-text-md);
box-shadow: none;
color: var(--td-text-color-primary);
background: var(--td-bg-color-container);
&:hover:not(:disabled) { background: var(--td-bg-color-container-hover); }
&:focus-visible { outline: 2px solid var(--td-brand-color); outline-offset: 2px; }
}
}
}
.resource-favorite-button() {
position: absolute;
top: 12px;
right: 38px;
display: flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
padding: 0;
border: 0;
border-radius: var(--app-radius-sm);
background: transparent;
color: var(--td-text-color-placeholder);
cursor: pointer;
&:hover { background: var(--td-bg-color-secondarycontainer); color: var(--td-warning-color); }
&.is-favorited { color: var(--td-warning-color); }
&:focus-visible { outline: 2px solid var(--td-brand-color); outline-offset: 1px; }
}