.knowledge-detail {
    padding-top: 16px;
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
}

.knowledge-detail-header {
    margin-bottom: 12px;
}

.knowledge-detail-title {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

.knowledge-detail-meta {
    margin-left: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 400;
}

.raw-document {
    margin-bottom: 12px;
}

.raw-document summary {
    padding: 6px 0;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
}

.raw-document pre {
    padding: 16px;
    margin-top: 8px;
    color: var(--text-primary);
    background: rgb(0 0 0 / 30%);
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.rule-preview {
    margin-top: 12px;
}

.preview-heading span {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 400;
}

.rule-preview-grid {
    display: grid;
    margin-bottom: 12px;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.rule-preview-card {
    padding: 10px 14px;
    border: 1px solid;
    border-radius: 8px;
}

.rule-preview-card.banned {
    background: rgb(245 108 108 / 8%);
    border-color: rgb(245 108 108 / 20%);
}

.rule-preview-card.required {
    background: rgb(103 194 58 / 8%);
    border-color: rgb(103 194 58 / 20%);
}

.rule-preview-card.length {
    background: rgb(230 162 60 / 8%);
    border-color: rgb(230 162 60 / 20%);
}

.rule-preview-card.format {
    background: rgb(64 158 255 / 8%);
    border-color: rgb(64 158 255 / 20%);
}

.rule-preview-label,
.rule-group-label {
    margin-bottom: 6px;
    font-size: 12px;
}

.rule-preview-label.banned,
.rule-group-label.banned {
    color: var(--danger);
}

.rule-preview-label.required,
.rule-group-label.allowed {
    color: var(--success);
}

.rule-preview-label.length {
    color: var(--warning);
}

.rule-preview-label.format {
    color: var(--primary);
}

.rule-token-container {
    font-size: 12px;
}

.rule-token {
    margin: 2px;
    font-size: 12px;
}

.rule-token.banned {
    background: rgb(245 108 108 / 10%);
}

.rule-token.required,
.rule-token.allowed {
    background: rgb(103 194 58 / 10%);
}

.rule-token.length {
    background: rgb(230 162 60 / 10%);
}

.rule-token.format {
    background: rgb(64 158 255 / 10%);
}

.rule-group {
    margin-bottom: 8px;
}

.rule-group-label {
    margin-bottom: 4px;
}

.rule-pattern {
    padding: 2px 8px;
    margin: 2px 0;
    border-radius: 4px;
    font-size: 12px;
}

.rule-pattern.banned {
    background: rgb(245 108 108 / 5%);
}

.rule-pattern.allowed {
    background: rgb(103 194 58 / 5%);
}

.rule-list-heading {
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}

.rule-list-item {
    display: flex;
    padding: 6px 12px;
    margin-bottom: 3px;
    background: rgb(0 0 0 / 15%);
    border-radius: 6px;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.rule-type-badge.banned {
    color: var(--danger);
    background: rgb(245 108 108 / 15%);
}

.rule-type-badge.required {
    color: var(--success);
    background: rgb(103 194 58 / 15%);
}

.rule-type-badge.length {
    color: var(--warning);
    background: rgb(230 162 60 / 15%);
}

.rule-type-badge.other {
    color: var(--primary);
    background: rgb(64 158 255 / 15%);
}

.file-input {
    color: var(--text-primary);
}

.empty-action {
    padding: 8px 20px;
    margin-top: 16px;
}

@media (width <= 760px) {
    .rule-preview-grid {
        grid-template-columns: 1fr;
    }
}
