/* 完整知识包：固定中性底色，强调色随站点主题。 */
.kw-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; }
.kw-library { border-right: 1px solid var(--line); padding-right: 20px; min-width: 0; }
.kw-library .admin-list { max-height: 65vh; overflow-y: auto; }
.kw-library .admin-row { width: 100%; text-align: left; color: var(--tx-1); font: inherit; cursor: pointer; }
.kw-library .admin-row[aria-current="true"] { border-color: var(--accent); }
.kw-library .admin-row strong { display: block; overflow-wrap: anywhere; white-space: normal; }
.kw-workspace, .kw-panel, .kw-diff > section { min-width: 0; }
.kw-heading, .kw-section-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.kw-heading h3 { margin: 0; font-size: 22px; }
.kw-panel { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 20px; }
.kw-panel h3 { margin: 0 0 12px; }
.kw-section { border: 1px solid var(--line); padding: 16px; margin: 14px 0; }
.kw-block { padding: 12px 0; border-top: 1px solid var(--line); }
.kw-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.kw-workspace textarea, .kw-workspace select, .ai-model-card select { box-sizing: border-box; width: 100%; background: var(--bg-2); color: var(--tx-1); border: 1px solid var(--line-strong); font: inherit; padding: 10px; }
.kw-workspace textarea { line-height: 1.8; resize: vertical; }
.kw-workspace input, .kw-workspace textarea { font: inherit; }
.kw-workspace label { margin: 12px 0; }
.kw-inline-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.kw-inline-form label { margin: 0; }
.kw-rendered p { white-space: pre-wrap; line-height: 1.8; overflow-wrap: anywhere; }
.kw-rendered h4 { margin: 14px 0 8px; }
.kw-math { margin: 8px 0; overflow-x: auto; max-width: 100%; }
.kw-math .katex-display { margin: 8px 0; }
.kw-math-error { color: var(--warn); }
.kw-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.kw-diff > section { padding: 14px; border: 1px solid var(--line); background: var(--bg-2); }
.kw-diff > section:last-child { border-top: 2px solid var(--accent); }
.kw-diff h4 { margin-top: 0; }
.kw-link-row, .kw-source, .kw-history-row { border: 1px solid var(--line); padding: 12px; margin: 8px 0; overflow-wrap: anywhere; }
.kw-link-row[data-state="rejected"] { border-style: dashed; color: var(--tx-2); }
.kw-source[data-classification="conflict"] { border-left: 3px solid var(--warn); }
.kw-source a { color: var(--accent); }
.kw-review { border: 1px solid var(--accent); padding: 18px; }
.kw-review h3 { color: var(--accent); }
.kw-workspace button:disabled, .ai-model-card button:disabled { opacity: .5; cursor: not-allowed; }
.kw-workspace [hidden], .kw-library [hidden] { display: none !important; }
.kw-overview { border: 1px solid var(--line); padding: 20px; margin-top: 18px; }
.kw-overview h2 { font-size: 28px; overflow-wrap: anywhere; }
.kw-overview h3 { overflow-wrap: anywhere; }
.kw-outline { display: flex; flex-wrap: wrap; gap: 8px 18px; border-block: 1px solid var(--line); padding: 14px 0; margin: 16px 0; }
.kw-outline strong { width: 100%; }
.kw-outline a { color: var(--accent); overflow-wrap: anywhere; }
.kw-lead { border-left: 3px solid var(--accent); padding: 12px 16px; background: var(--bg-2); }
.kw-reader-section { padding: 18px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 90px; }
.kw-reader-section .kw-section-heading h3 { margin: 0; }
#kw-details > summary, #ai-operations > summary { cursor: pointer; font-weight: 600; padding: 12px 0; }
#kw-details[open] > summary, #ai-operations[open] > summary { color: var(--accent); }
.kw-candidate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kw-candidate { border: 1px solid var(--line); padding: 14px; min-width: 0; overflow-wrap: anywhere; }
.kw-candidate h4 { margin: 0; }
.kw-candidate .kw-candidate-overview { white-space: pre-wrap; line-height: 1.7; }
.kw-candidate-reasons { padding-left: 20px; color: var(--tx-2); font-size: 13px; line-height: 1.6; }
.kw-library select, .kw-library input { max-width: 100%; box-sizing: border-box; }
#kw-list[aria-busy="true"], #kw-relation-browser[aria-busy="true"] { opacity: .6; }
.kw-candidate button { white-space: normal; }
.kw-comparison { border: 1px solid var(--accent); padding: 18px; }
#kw-relation-document { max-height: 55vh; overflow-y: auto; }
#ai-operations[hidden] { display: none !important; }
@media (max-width: 960px) { .kw-layout { grid-template-columns: 1fr; } .kw-library { border-right: 0; padding: 0; border-bottom: 1px solid var(--line); padding-bottom: 16px; } .kw-library .admin-list { max-height: 220px; } }
@media (max-width: 620px) { .kw-diff, .kw-inline-form, .kw-candidate-grid { grid-template-columns: 1fr; } .kw-section, .kw-overview, .kw-comparison { padding: 10px; } .kw-actions button { max-width: 100%; white-space: normal; } }
