.bk-theme-xiaokun{--bk-bg:#111827;--bk-fg:#e5e7eb;--bk-muted:#9ca3af;--bk-accent:#4c6ef5;--bk-border:#303a50;--bk-soft:#0a0f1e;--bk-radius:10px;--bk-warn:#fbbf24;--bk-error:#fca5a5}
.bk-theme-chongming{--bk-bg:#14141a;--bk-fg:#e5e5ed;--bk-muted:#a6a6b8;--bk-accent:#f39c12;--bk-border:#33333d;--bk-soft:#0a0a0f;--bk-radius:16px;--bk-warn:#f8c66b;--bk-error:#fca5a5}
.bk-theme-admin{--bk-bg:#fff;--bk-fg:#1f2937;--bk-muted:#64748b;--bk-accent:#4f46e5;--bk-border:#e2e8f0;--bk-soft:#f8fafc;--bk-radius:16px;--bk-warn:#92400e;--bk-error:#b91c1c}
.bk-theme-feihuang{--bk-bg:#fff;--bk-fg:#1c1917;--bk-muted:#6b7280;--bk-accent:#b45309;--bk-border:#e7e5e4;--bk-soft:#f7f6f3;--bk-radius:12px;--bk-warn:#92400e;--bk-error:#b91c1c}
.bk-root,.bk-overlay,.bk-citations{box-sizing:border-box;color:var(--bk-fg);font-family:inherit;font-size:14px;line-height:1.6;overflow-wrap:anywhere;min-width:0}
.bk-root *,.bk-overlay *{box-sizing:border-box;min-width:0;max-width:100%}.bk-root{margin:16px 0;padding:12px;border:1px solid var(--bk-border);border-radius:var(--bk-radius);background:var(--bk-bg)}
.bk-row,.bk-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.bk-row{justify-content:space-between}.bk-toolbar{margin-top:12px;align-items:flex-end}.bk-field{display:flex;flex:1 1 170px;flex-direction:column;gap:4px;color:var(--bk-muted);font-size:12px}
.bk-root h3.bk-title,.bk-root h4.bk-subtitle,.bk-modal h3{margin:0;font-weight:600;color:var(--bk-fg);font-size:15px}.bk-root .bk-subtitle{margin:12px 0 8px}.bk-root p,.bk-modal p{margin:8px 0}.bk-muted{color:var(--bk-muted);font-size:12px}.bk-notice{color:var(--bk-warn);font-size:13px}.bk-error{color:var(--bk-error);font-size:13px}.bk-tag{display:inline-block;color:var(--bk-accent);font-size:12px;font-weight:600}
.bk-root .bk-button,.bk-overlay .bk-button,.bk-citations .bk-button{width:auto;min-height:44px;padding:8px 12px;border:1px solid var(--bk-border);border-radius:8px;background:var(--bk-soft);color:var(--bk-accent);font:inherit;cursor:pointer;white-space:normal}.bk-button:disabled{opacity:.55;cursor:wait}.bk-root :is(button,input,select,textarea,summary):focus-visible,.bk-overlay button:focus-visible,.bk-citations button:focus-visible{outline:2px solid var(--bk-accent);outline-offset:3px}
.bk-root :is(input,select,textarea){width:100%;min-height:44px;padding:8px;border:1px solid var(--bk-border);border-radius:8px;background:var(--bk-soft);color:var(--bk-fg);font:inherit}.bk-root textarea{resize:vertical}.bk-root input[type=datetime-local]{color-scheme:dark}.bk-theme-feihuang input[type=datetime-local],.bk-theme-admin input[type=datetime-local]{color-scheme:light}.bk-upload{display:block;margin-top:16px}.bk-upload input{display:block;margin-top:8px}.bk-content{margin-top:16px}.bk-entry{border:1px solid var(--bk-border);border-radius:var(--bk-radius);padding:12px;margin-top:12px;background:var(--bk-bg)}.bk-question{border-top:1px solid var(--bk-border);padding-top:12px;margin-top:12px}.bk-question .bk-row{margin-top:8px;justify-content:flex-start}.bk-link{margin-top:16px}.bk-link summary{min-height:44px;cursor:pointer;color:var(--bk-accent);padding:8px 0}.bk-link input{margin-bottom:8px}.bk-quote{white-space:pre-wrap;overflow-wrap:anywhere;margin:8px 0}.bk-citations{margin-top:12px;border-top:1px solid var(--bk-border);padding-top:8px;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.bk-overlay{position:fixed;inset:0;z-index:10000;background:#0009;display:flex;align-items:center;justify-content:center;padding:16px}.bk-modal{width:560px;max-width:100%;max-height:84dvh;display:flex;flex-direction:column;background:var(--bk-bg);padding:16px;border:1px solid var(--bk-border);border-radius:var(--bk-radius)}.bk-modal-body{overflow-y:auto;overscroll-behavior:contain;margin-top:12px}.bk-modal .bk-row{flex-shrink:0}.bk-modal blockquote{padding-left:12px;border-left:2px solid var(--bk-accent)}
#chat-business-knowledge{flex-shrink:0;max-height:48dvh;overflow:auto;margin:8px 12px}#fh-business-knowledge{flex-shrink:0;max-height:48dvh;overflow:auto;margin:8px 16px}
@media(max-width:600px){.bk-overlay{padding:0}.bk-modal{width:100%;height:100dvh;max-height:100dvh;border-radius:0;padding:16px;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom))}.bk-field{flex-basis:100%}.bk-root{max-width:100%}.bk-root .bk-toolbar{gap:8px}.bk-modal-body{flex:1}}
@media(prefers-reduced-motion:reduce){.bk-root *,.bk-overlay *{scroll-behavior:auto}}

/* Purpose confirmation controls share the existing application palette. */
.bk-overlay :is(input,select,textarea) { width:100%; min-height:44px; padding:8px; border:1px solid var(--bk-border); border-radius:8px; background:var(--bk-soft); color:var(--bk-fg); font:inherit; font-size:16px; }
.bk-overlay textarea { resize:vertical; }
.bk-purpose { margin:16px 0; font-size:16px; }
.bk-purpose summary,.bk-modal .bk-link summary { min-height:44px; padding:8px 0; cursor:pointer; }
.bk-overlay :is(select,input,textarea):focus-visible { outline:2px solid var(--bk-accent); outline-offset:3px; }

.bk-root :is(input,select,textarea) { font-size:16px; }
