Skip to content

Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.

4.4 KB
Raw Blame
@suggested-ease: cubic-bezier(0.16, 1, 0.3, 1);

// Shared hover for starter / follow-up suggestion chips.
.suggestion-chip-hover() {
    border-color: color-mix(in srgb, var(--td-text-color-primary) 10%, var(--td-component-stroke));
    background: color-mix(in srgb, var(--td-text-color-primary) 4%, var(--td-bg-color-container));
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.suggestion-chip-active() {
    background: color-mix(in srgb, var(--td-text-color-primary) 6%, var(--td-bg-color-container));
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.suggested-questions-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 16px 12px;
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
    min-height: 0;

    &.has-questions {
        min-height: 64px;
    }
}

.suggested-questions-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
}

.suggested-questions-title-row {
    margin-bottom: 12px;
    text-align: center;
}

.suggested-questions-caption {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    line-height: 1;
}

.suggested-questions-title {
    font-size: var(--app-text-md);
    color: var(--td-text-color-placeholder);
    font-weight: 400;
    letter-spacing: 0.01em;
}

.suggested-questions-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    border-radius: var(--app-radius-sm);
    background: transparent;
    color: var(--td-text-color-placeholder);
    cursor: pointer;
    transition: color var(--app-motion-base) @suggested-ease, background var(--app-motion-base) @suggested-ease;

    :deep(.t-icon) {
        font-size: var(--app-text-sm);
    }

    &:hover:not(:disabled) {
        color: var(--td-brand-color);
        background: var(--td-bg-color-secondarycontainer);
    }

    &:active:not(:disabled) {
        background: var(--td-bg-color-secondarycontainer);
    }

    &:disabled {
        cursor: default;
        opacity: 0.7;
    }
}

.sq-refresh-spin {
    animation: wk-spin 0.8s linear infinite;
}

.suggested-questions-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.suggested-question-card {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    width: auto;
    box-sizing: border-box;
    padding: 8px 14px;
    border-radius: var(--app-radius-lg);
    border: 1px solid var(--td-component-stroke);
    background: var(--td-bg-color-container);
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: border-color var(--app-motion-base) ease, box-shadow var(--app-motion-base) ease, background var(--app-motion-base) ease;

    &:not(.sq-card-skeleton):hover {
        .suggestion-chip-hover();
    }

    &:not(.sq-card-skeleton):active {
        .suggestion-chip-active();
    }

    &.sq-card-skeleton {
        width: 180px;
        max-width: 100%;
        pointer-events: none;
        cursor: default;
        flex-shrink: 0;
        border-color: transparent;
        background: var(--td-bg-color-secondarycontainer);
        box-shadow: none;

        // 不等宽的骨架,呼应错落的标签云布局
        &:nth-child(2n) {
            width: 240px;
        }

        &:nth-child(3n) {
            width: 150px;
        }

        &:nth-child(5n) {
            width: 210px;
        }

        :deep(.t-skeleton) {
            width: 100%;
        }

        :deep(.t-skeleton__row) {
            margin: 0;
        }

        :deep(.t-skeleton__col) {
            border-radius: 3px;
        }

    }
}

.suggested-question-text {
    position: relative;
    flex: 0 1 auto;
    min-width: 0;
    font-size: var(--app-text-md);
    line-height: 1.5;
    color: var(--td-text-color-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggested-question-badge {
    position: relative;
    flex-shrink: 0;
    padding: 1px 6px;
    border-radius: var(--app-radius-sm);
    border: none;
    background: var(--td-brand-color-light);
    font-size: var(--app-text-2xs);
    font-weight: 600;
    line-height: 1.6;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--td-brand-color);
}