.assistant-workspace,
.assistant-workspace * { box-sizing: border-box; }

.assistant-workspace {
  --assistant-accent: #2f8a69;
  --assistant-accent-strong: #176048;
  --assistant-accent-soft: #e4f4ec;
  --assistant-accent-pale: #f4fbf7;
  --assistant-line: #dcebe3;
  --assistant-text: #1c2d25;
  --assistant-muted: #74867d;
  --assistant-shadow: 0 12px 30px rgba(35, 92, 67, .08);
  display: grid;
  gap: 18px;
  color: var(--assistant-text);
}

.assistant-banner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
  gap: 26px;
  align-items: stretch;
  padding: 28px 30px;
  border: 1px solid #cfe7d9;
  border-radius: 20px;
  background: linear-gradient(135deg, #eff9f3 0%, #f9fcfa 100%);
  box-shadow: var(--assistant-shadow);
}

.assistant-banner-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.assistant-banner-title { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.assistant-banner-title .pill { color: var(--assistant-accent-strong); background: var(--assistant-accent-soft); }
.assistant-banner h2 { margin: 0 0 9px; color: var(--assistant-accent-strong); font-size: clamp(24px, 2.4vw, 32px); letter-spacing: -.02em; }
.assistant-banner p { max-width: 680px; margin: 0; color: #5f776b; line-height: 1.75; font-size: 14px; }

.assistant-steps {
  display: grid;
  align-content: center;
  gap: 2px;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 15px;
  background: rgba(255, 255, 255, .76);
}

.assistant-step { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 11px 12px; }
.assistant-step:not(:last-child) { border-bottom: 1px solid #e1eee7; }
.assistant-step-index {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid #b9ddca;
  border-radius: 50%;
  color: var(--assistant-accent-strong);
  background: var(--assistant-accent-soft);
  font-weight: 800;
}
.assistant-step strong { display: block; color: var(--assistant-text); font-size: 13px; }
.assistant-step small { display: block; margin-top: 3px; color: var(--assistant-muted); line-height: 1.45; }

.assistant-workspace-card {
  min-width: 0;
  padding: 22px 24px;
  border: 1px solid var(--assistant-line);
  border-radius: 17px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--assistant-shadow);
}

.assistant-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.assistant-card-head h2, .assistant-card-head h3 { margin: 0; color: var(--assistant-text); letter-spacing: -.01em; }
.assistant-card-head h2 { font-size: 18px; }
.assistant-card-head p { margin: 6px 0 0; color: var(--assistant-muted); font-size: 13px; line-height: 1.6; }

.assistant-wizard { display: grid; gap: 16px; }
.assistant-wizard-progress { display: flex; align-items: center; gap: 8px; color: #9aa9a1; font-size: 12px; }
.assistant-wizard-progress span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.assistant-wizard-progress i { color: #b2c2b9; font-style: normal; }
.assistant-wizard-progress .current { color: var(--assistant-accent-strong); font-weight: 700; }
.assistant-wizard-progress b { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--assistant-line); border-radius: 50%; background: #f6faf8; font-size: 11px; }
.assistant-wizard-progress .current b { border-color: var(--assistant-accent); color: #fff; background: var(--assistant-accent); }
.assistant-wizard > .assistant-actions { padding-top: 14px; border-top: 1px solid #edf4ef; }
.assistant-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.assistant-actions.left { justify-content: flex-start; }

.assistant-private-knowledge-step { gap: 18px; }
.assistant-private-kicker { display: block; margin-bottom: 6px; color: #6c9b84; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.assistant-private-library-card { display: flex; align-items: center; gap: 13px; padding: 15px 16px; border: 1px solid #cfe7d9; border-radius: 14px; background: #f5fbf7; }
.assistant-private-library-icon { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border-radius: 12px; color: #2d805f; background: #e2f3e9; }
.assistant-private-library-icon svg { width: 19px; height: 19px; }
.assistant-private-library-card strong { display: block; color: #285843; font-size: 14px; }
.assistant-private-library-card p { margin: 4px 0 0; color: #789084; font-size: 11px; line-height: 1.5; }
.assistant-private-library-badge { margin-left: auto; padding: 5px 9px; border-radius: 999px; color: #3c7b5d; background: #e5f5eb; font-size: 10px; font-weight: 700; white-space: nowrap; }
.assistant-private-upload-dropzone { position: relative; display: grid; min-height: 170px; place-items: center; align-content: center; gap: 8px; padding: 24px; border: 1.5px dashed #9dcdb0; border-radius: 16px; color: #416b56; background: #fbfefc; cursor: pointer; text-align: center; transition: border-color .18s, background .18s, box-shadow .18s; }
.assistant-private-upload-dropzone:hover, .assistant-private-upload-dropzone:focus-within { border-color: #4eaa79; background: #f3fbf6; box-shadow: 0 0 0 4px #e8f6ed; }
.assistant-private-upload-dropzone.is-dragging { border-color: #2f8a69; background: #e8f6ee; box-shadow: 0 0 0 4px #d9f0e2; }
.assistant-private-upload-dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.assistant-private-upload-icon { display: grid; width: 46px; height: 46px; place-items: center; margin-bottom: 3px; border-radius: 14px; color: #2f8a69; background: #e5f5eb; }
.assistant-private-upload-icon svg { width: 22px; height: 22px; }
.assistant-private-upload-dropzone strong { color: #2e624a; font-size: 14px; }
.assistant-private-upload-dropzone small { color: #81978b; font-size: 11px; line-height: 1.5; }
.assistant-private-file-list { display: grid; gap: 8px; }
.assistant-private-file-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #deece4; border-radius: 11px; background: #fff; }
.assistant-private-file-icon { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 9px; color: #4b896a; background: #eaf6ee; }
.assistant-private-file-icon svg { width: 15px; height: 15px; }
.assistant-private-file-copy { min-width: 0; }
.assistant-private-file-copy strong { display: block; overflow: hidden; color: #385847; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.assistant-private-file-copy small { display: block; margin-top: 3px; color: #8a9d92; font-size: 10px; }
.assistant-private-uploaded { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; color: #3f7b5e; background: #edf8f1; font-size: 11px; }
.assistant-private-uploaded svg { width: 15px; height: 15px; }
.assistant-private-actions { padding-top: 14px; border-top: 1px solid #edf4ef; }

.assistant-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.assistant-form-grid label { display: grid; gap: 7px; color: #3e5b4d; font-size: 13px; font-weight: 700; }
.assistant-form-grid label.wide { grid-column: 1 / -1; }
.assistant-form-grid input,
.assistant-form-grid textarea,
.assistant-form-grid select,
.assistant-inline-select {
  width: 100%;
  border: 1px solid #d5e7dc;
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--assistant-text);
  background: #fff;
  font: inherit;
  font-weight: 400;
}
.assistant-form-grid textarea { min-height: 84px; resize: vertical; line-height: 1.65; }
.assistant-form-grid input:focus, .assistant-form-grid textarea:focus, .assistant-form-grid select:focus { outline: 3px solid #e4f4ec; border-color: var(--assistant-accent); }
.assistant-hint { color: var(--assistant-muted); font-weight: 400; font-size: 12px; line-height: 1.55; }

.assistant-scope-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 2px 0; }
.assistant-scope-option { display: flex; align-items: center; gap: 8px; padding: 10px 11px; border: 1px solid var(--assistant-line); border-radius: 10px; color: #466455; font-weight: 500; cursor: pointer; }
.assistant-scope-option:hover { border-color: #a5d1b7; background: var(--assistant-accent-pale); }
.assistant-scope-option:has(input:checked) { border-color: #8fc5a6; color: var(--assistant-accent-strong); background: var(--assistant-accent-soft); }
.assistant-scope-option input { width: auto; accent-color: var(--assistant-accent); }

.assistant-business-summary { display: grid; gap: 0; border: 1px solid var(--assistant-line); border-radius: 13px; overflow: hidden; }
.assistant-summary-row { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 15px; padding: 14px 16px; border-bottom: 1px solid #e8f1eb; }
.assistant-summary-row:last-child { border-bottom: 0; }
.assistant-summary-row strong { color: #71867a; font-size: 13px; }
.assistant-summary-row span { color: #2b4637; line-height: 1.65; white-space: pre-wrap; }

.assistant-agent-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.assistant-agent-card { display: flex; flex-direction: column; gap: 9px; min-height: 150px; padding: 17px; border: 1px solid var(--assistant-line); border-radius: 14px; background: #fff; }
.assistant-agent-card h3 { margin: 0; color: var(--assistant-text); font-size: 16px; }
.assistant-agent-card p { flex: 1; margin: 0; color: var(--assistant-muted); font-size: 12px; line-height: 1.6; }
.assistant-agent-card .agent-meta { color: #688374; font-size: 12px; }

.assistant-empty { display: grid; place-items: center; min-height: 220px; padding: 30px; color: #84968c; text-align: center; }
.assistant-empty h3 { margin: 0 0 8px; color: #3a5748; }
.assistant-empty p { max-width: 390px; margin: 0; line-height: 1.7; }

.assistant-knowledge-workspace,
.assistant-knowledge-workspace * { box-sizing: border-box; }
.assistant-knowledge-card { min-width: 0; padding: 25px 26px 30px; border: 1px solid #dcebe3; border-radius: 20px; background: rgba(255, 255, 255, .96); box-shadow: var(--assistant-shadow); }
.assistant-knowledge-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 18px; }
.assistant-knowledge-header h2 { margin: 5px 0 0; color: #183c2f; font-size: 24px; letter-spacing: -.03em; }
.assistant-knowledge-header p { margin: 7px 0 0; color: #758a80; font-size: 13px; line-height: 1.6; }
.assistant-knowledge-kicker { color: #7b9d8d; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.assistant-knowledge-scope { margin-top: 5px; padding: 7px 11px; border-radius: 999px; color: #4c7c65; background: #eef8f2; font-size: 11px; font-weight: 700; white-space: nowrap; }
.assistant-knowledge-agent { display: grid; min-width: 190px; gap: 6px; color: #537165; font-size: 11px; font-weight: 700; }
.assistant-knowledge-agent .assistant-inline-select { min-width: 190px; padding: 9px 11px; }
.assistant-knowledge-tabs { display: flex; gap: 5px; margin: 0; border-bottom: 1px solid #dcebe3; }
.assistant-knowledge-tab { margin-bottom: -1px; padding: 11px 15px; border: 0; border-bottom: 2px solid transparent; color: #82948b; background: transparent; cursor: pointer; font-size: 13px; }
.assistant-knowledge-tab:hover { color: var(--assistant-accent-strong); }
.assistant-knowledge-tab.active { border-color: var(--assistant-accent); color: var(--assistant-accent-strong); font-weight: 700; }
.assistant-knowledge-section { min-width: 0; padding-top: 22px; }
.assistant-knowledge-section + .assistant-knowledge-section { margin-top: 22px; border-top: 1px solid #edf4ef; }
.assistant-knowledge-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.assistant-knowledge-section-heading h3 { margin: 0; color: #294d3d; font-size: 16px; }
.assistant-knowledge-section-heading p { margin: 5px 0 0; color: #84978d; font-size: 12px; line-height: 1.55; }
.assistant-knowledge-permission { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; color: #2e795a; background: #e8f6ed; font-size: 10px; font-weight: 700; }
.assistant-knowledge-permission.readonly { color: #71877b; background: #f1f5f2; }
.assistant-knowledge-library-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.assistant-knowledge-library-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 11px; min-width: 0; padding: 15px; border: 1px solid #dcebe3; border-radius: 13px; color: var(--assistant-text); background: #fff; text-align: left; cursor: pointer; transition: border-color .18s, background .18s, box-shadow .18s, transform .18s; }
.assistant-knowledge-library-card:hover { border-color: #9fcdb1; background: #f7fcf9; transform: translateY(-1px); }
.assistant-knowledge-library-card.selected { border-color: #83bd9a; background: #f5fbf7; box-shadow: 0 0 0 3px #e6f4ec; }
.assistant-knowledge-library-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: #2b7e5e; background: #e4f4ec; }
.assistant-knowledge-library-icon svg { width: 17px; height: 17px; }
.assistant-knowledge-library-copy { min-width: 0; }
.assistant-knowledge-library-copy strong { display: block; overflow: hidden; color: #2f4a3b; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.assistant-knowledge-library-copy small { display: block; margin-top: 5px; overflow: hidden; color: #84968c; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.assistant-knowledge-library-access { grid-column: 1 / -1; color: #6d8c7c; font-size: 10px; }
.assistant-knowledge-document-list, .assistant-knowledge-wiki-list { display: grid; gap: 9px; }
.assistant-knowledge-document-row, .assistant-knowledge-wiki-row { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 15px; border: 1px solid #e0ede6; border-radius: 12px; background: #fff; }
.assistant-knowledge-document-row:hover, .assistant-knowledge-wiki-row:hover { border-color: #b9dcc7; background: #fbfefc; }
.assistant-knowledge-document-copy, .assistant-knowledge-wiki-row > span:first-child { min-width: 0; }
.assistant-knowledge-document-copy strong, .assistant-knowledge-wiki-row strong { display: block; overflow: hidden; color: #385545; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.assistant-knowledge-document-copy small, .assistant-knowledge-wiki-row small { display: block; margin-top: 5px; overflow: hidden; color: #8a9b92; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.assistant-knowledge-readonly { flex: 0 0 auto; color: #869890; font-size: 10px; }
.assistant-knowledge-delete { flex: 0 0 auto; padding: 6px 9px; font-size: 11px; }
.assistant-knowledge-view-link { flex: 0 0 auto; color: #317a5a; font-size: 11px; font-weight: 700; }
.assistant-knowledge-wiki-detail { margin-top: 14px; padding: 18px; border: 1px solid #dcebe3; border-radius: 13px; background: #f9fcfa; }
.assistant-knowledge-wiki-detail h3 { margin: 4px 0 0; color: #2e4e3d; font-size: 16px; }
.assistant-knowledge-wiki-detail h4 { margin: 16px 0 6px; color: #5d7868; font-size: 13px; }
.assistant-knowledge-wiki-detail p { margin: 0; color: #506c5c; line-height: 1.7; white-space: pre-wrap; }
.assistant-knowledge-upload { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 16px; padding: 13px 15px; border: 1px dashed #9fcbb1; border-radius: 12px; background: #f5fbf7; }
.assistant-knowledge-upload > div { display: grid; flex: 1; min-width: 220px; gap: 4px; }
.assistant-knowledge-upload strong { color: #35634f; font-size: 12px; }
.assistant-knowledge-upload small { color: #6e8878; font-size: 11px; line-height: 1.45; }
.assistant-knowledge-upload input[type="file"] { min-width: 220px; flex: 1; border: 0; padding: 0; background: transparent; color: #668275; font-size: 11px; }
.assistant-knowledge-empty { display: grid; min-height: 130px; place-items: center; gap: 6px; padding: 22px; border: 1px dashed #dcebe3; border-radius: 12px; background: #fbfefc; color: #84968c; text-align: center; }
.assistant-knowledge-empty strong { color: #4b6c5b; font-size: 13px; }
.assistant-knowledge-empty span { max-width: 430px; font-size: 11px; line-height: 1.55; }
.assistant-knowledge-empty-compact { min-height: 100px; }

@media (max-width: 1180px) {
  .assistant-banner { grid-template-columns: 1fr; gap: 18px; }
  .assistant-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
  .assistant-step:not(:last-child) { border-right: 1px solid #e1eee7; border-bottom: 0; }
  .assistant-agent-list, .assistant-knowledge-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .assistant-banner { padding: 22px 18px 18px; }
  .assistant-workspace-card { padding: 18px; }
  .assistant-steps, .assistant-form-grid { grid-template-columns: 1fr; }
  .assistant-step:not(:last-child) { border-right: 0; border-bottom: 1px solid #e1eee7; }
  .assistant-agent-list, .assistant-knowledge-library-grid, .assistant-scope-list { grid-template-columns: 1fr; }
  .assistant-summary-row { grid-template-columns: 1fr; gap: 4px; }
  .assistant-card-head { flex-direction: column; }
  .assistant-private-library-card { align-items: flex-start; flex-wrap: wrap; }
  .assistant-private-library-badge { margin-left: 53px; }
  .assistant-private-actions { align-items: stretch; flex-direction: column-reverse; }
  .assistant-private-actions button { width: 100%; }
  .assistant-knowledge-card { padding: 20px 18px 24px; }
  .assistant-knowledge-header { flex-direction: column; }
  .assistant-knowledge-agent, .assistant-knowledge-agent .assistant-inline-select { width: 100%; min-width: 0; }
  .assistant-knowledge-tabs { overflow-x: auto; }
  .assistant-knowledge-tab { flex: 0 0 auto; }
}

/* Knowledge workspace v2: library navigator, document index and reader. */
.assistant-knowledge-card { padding: 28px; border-color: #d8e8df; background: #fbfdfc; }
.assistant-knowledge-header { padding-bottom: 20px; }
.assistant-knowledge-header h2 { font-size: clamp(24px, 2vw, 30px); }
.assistant-knowledge-tabs { margin-bottom: 22px; }
.assistant-knowledge-overview { margin: 0 0 14px; padding: 0; border: 0; }
.assistant-knowledge-stage {
  display: grid;
  grid-template-columns: minmax(220px, .68fr) minmax(320px, 1fr) minmax(380px, 1.28fr);
  min-height: 680px;
  overflow: hidden;
  border: 1px solid #dbe9e1;
  border-radius: 17px;
  background: #f4f8f5;
  box-shadow: 0 9px 26px rgba(35, 92, 67, .06);
}
.assistant-knowledge-library-pane,
.assistant-knowledge-document-pane,
.assistant-knowledge-reader { min-width: 0; }
.assistant-knowledge-library-pane { display: flex; flex-direction: column; gap: 13px; padding: 18px 14px; border-right: 1px solid #dbe9e1; background: #f2f8f4; }
.assistant-knowledge-document-pane { padding: 20px 18px; overflow: auto; background: #f8fbf9; }
.assistant-knowledge-reader { overflow: hidden; background: #fff; }
.assistant-knowledge-pane-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-width: 0; }
.assistant-knowledge-pane-head h3 { margin: 2px 0 0; color: #254c3a; font-size: 16px; letter-spacing: -.015em; }
.assistant-knowledge-pane-head p { margin: 5px 0 0; color: #85998e; font-size: 11px; line-height: 1.45; }
.assistant-knowledge-pane-kicker { color: #84a596; font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.assistant-knowledge-pane-count { display: grid; min-width: 28px; height: 28px; place-items: center; border: 1px solid #d1e5d9; border-radius: 9px; color: #35745a; background: #e8f4ec; font-size: 11px; font-weight: 800; }
.assistant-knowledge-library-list { display: grid; align-content: start; gap: 7px; overflow: auto; }
.assistant-knowledge-library-item { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 9px; min-width: 0; padding: 11px 9px; border: 1px solid transparent; border-radius: 11px; color: #315343; background: transparent; text-align: left; cursor: pointer; transition: border-color .16s, background .16s, box-shadow .16s; }
.assistant-knowledge-library-item:hover { border-color: #c7dfd0; background: #fff; }
.assistant-knowledge-library-item.selected { border-color: #9dcab0; background: #fff; box-shadow: 0 4px 12px rgba(35, 92, 67, .08); }
.assistant-knowledge-library-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; color: #2f815f; background: #e0f1e7; }
.assistant-knowledge-library-icon svg { width: 15px; height: 15px; }
.assistant-knowledge-library-copy { min-width: 0; }
.assistant-knowledge-library-copy strong { display: block; overflow: hidden; color: #2d4e3d; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.assistant-knowledge-library-copy small { display: block; margin-top: 4px; overflow: hidden; color: #83978d; font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.assistant-knowledge-library-access { grid-column: 2 / 3; margin-top: -3px; color: #68917b; font-size: 9px; }
.assistant-knowledge-library-arrow { display: grid; align-self: center; color: #91aa9d; }
.assistant-knowledge-library-arrow svg { width: 14px; height: 14px; }
.assistant-knowledge-document-head { margin-bottom: 14px; }
.assistant-knowledge-filters { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 8px; margin-bottom: 13px; }
.assistant-knowledge-search { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 0 10px; border: 1px solid #d7e7dd; border-radius: 9px; background: #fff; }
.assistant-knowledge-search:focus-within { border-color: #72b48e; box-shadow: 0 0 0 3px #e9f6ee; }
.assistant-knowledge-search svg { flex: 0 0 auto; width: 15px; height: 15px; color: #7d9e8d; }
.assistant-knowledge-search input { width: 100%; min-width: 0; padding: 9px 0; border: 0; outline: 0; color: #274838; background: transparent; font: inherit; font-size: 11px; }
.assistant-knowledge-filters .assistant-inline-select { min-width: 0; padding: 8px 8px; border-radius: 9px; font-size: 11px; }
.assistant-knowledge-document-list { gap: 7px; }
.assistant-knowledge-document-row { align-items: stretch; gap: 5px; padding: 0; border-color: #dfebe4; border-radius: 11px; background: #fff; transition: border-color .16s, box-shadow .16s, background .16s; }
.assistant-knowledge-document-row:hover { border-color: #b9d8c5; background: #fff; }
.assistant-knowledge-document-row.selected { border-color: #7fbc99; box-shadow: 0 0 0 3px #e8f5ed; }
.assistant-knowledge-document-select { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; flex: 1; min-width: 0; min-height: 68px; padding: 10px 11px; border: 0; color: #365746; background: transparent; text-align: left; cursor: pointer; }
.assistant-knowledge-document-icon { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 8px; color: #438265; background: #e9f5ed; }
.assistant-knowledge-document-icon.wiki { color: #6c6a9b; background: #f0effb; }
.assistant-knowledge-document-icon svg { width: 15px; height: 15px; }
.assistant-knowledge-document-copy { min-width: 0; }
.assistant-knowledge-document-copy strong { display: block; overflow: hidden; color: #2d4f3d; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.assistant-knowledge-document-copy small { display: block; margin-top: 5px; overflow: hidden; color: #899c92; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.assistant-knowledge-status { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; padding: 4px 6px; border-radius: 999px; color: #6e8378; background: #f0f4f1; font-size: 9px; font-weight: 700; white-space: nowrap; }
.assistant-knowledge-status-succeeded { color: #2e7c58; background: #e5f5eb; }
.assistant-knowledge-status-processing, .assistant-knowledge-status-queued { color: #8a6a28; background: #fff5dc; }
.assistant-knowledge-status-failed, .assistant-knowledge-status-partially_failed { color: #a24d4d; background: #fff0ef; }
.assistant-knowledge-document-row .assistant-knowledge-delete { align-self: center; margin-right: 9px; padding: 5px 7px; border: 0; background: transparent; }
.assistant-knowledge-document-row .assistant-knowledge-delete:hover { background: #fff0ef; }
.assistant-knowledge-reader-scroll { height: 680px; padding: 25px 28px 34px; overflow: auto; }
.assistant-knowledge-reader-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 17px; border-bottom: 1px solid #e9f0eb; }
.assistant-knowledge-reader-header h3 { margin: 6px 0 0; color: #214734; font-size: 20px; line-height: 1.35; letter-spacing: -.02em; }
.assistant-knowledge-reader-header p { margin: 6px 0 0; color: #85998e; font-size: 11px; }
.assistant-knowledge-content { max-width: 760px; padding-top: 18px; }
.assistant-knowledge-content h4 { margin: 0 0 12px; color: #315744; font-size: 14px; }
.assistant-knowledge-document-content { color: #455f51; font-size: 13px; line-height: 1.9; white-space: pre-wrap; word-break: break-word; }
.assistant-knowledge-reader-meta { display: flex; flex-wrap: wrap; gap: 7px 15px; padding: 14px 0; color: #6f887b; font-size: 10px; }
.assistant-knowledge-reader-meta span { position: relative; }
.assistant-knowledge-reader-meta span:not(:last-child)::after { position: absolute; top: 1px; right: -9px; color: #c0d2c7; content: '·'; }
.assistant-knowledge-reader-notice { display: flex; align-items: center; gap: 8px; margin-bottom: 22px; padding: 10px 12px; border: 1px solid #e0eee5; border-radius: 9px; color: #5e806d; background: #f6fbf7; font-size: 11px; }
.assistant-knowledge-reader-notice svg { width: 14px; height: 14px; color: #3d956b; }
.assistant-knowledge-reader-section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.assistant-knowledge-reader-section-title h4 { margin: 0; color: #315744; font-size: 14px; }
.assistant-knowledge-reader-section-title span { color: #8da095; font-size: 10px; }
.assistant-knowledge-chunks { max-width: 760px; }
.assistant-knowledge-chunk { padding: 15px 0 17px; border-bottom: 1px solid #edf3ef; }
.assistant-knowledge-chunk:last-child { border-bottom: 0; }
.assistant-knowledge-chunk-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.assistant-knowledge-chunk-head strong { color: #39805f; font-size: 10px; }
.assistant-knowledge-chunk-head span { color: #8b9e94; font-size: 10px; }
.assistant-knowledge-chunk p, .assistant-knowledge-wiki-content { margin: 0; color: #455f51; font-size: 13px; line-height: 1.85; white-space: pre-wrap; }
.assistant-knowledge-reader-empty, .assistant-knowledge-reader-loading { display: grid; min-height: 680px; place-content: center; justify-items: center; gap: 9px; padding: 30px; color: #8a9c93; text-align: center; }
.assistant-knowledge-reader-empty strong { color: #527263; font-size: 14px; }
.assistant-knowledge-reader-empty > span:last-child { max-width: 230px; font-size: 11px; line-height: 1.6; }
.assistant-knowledge-reader-empty-icon { display: grid; width: 48px; height: 48px; place-items: center; margin-bottom: 3px; border-radius: 15px; color: #4b9a71; background: #e9f6ee; }
.assistant-knowledge-reader-empty-icon svg { width: 22px; height: 22px; }
.assistant-knowledge-reader-loading { align-content: center; justify-items: stretch; }
.assistant-knowledge-skeleton { display: block; width: 78%; height: 13px; border-radius: 999px; background: linear-gradient(90deg, #edf4ef, #f8fbf9, #edf4ef); background-size: 220% 100%; animation: assistant-knowledge-shimmer 1.2s infinite; }
.assistant-knowledge-skeleton.wide { width: 100%; height: 24px; margin-bottom: 12px; }
.assistant-knowledge-skeleton.short { width: 48%; }
.assistant-knowledge-stage-empty { grid-column: 1 / -1; display: grid; place-items: center; min-height: 680px; padding: 30px; }
.assistant-knowledge-stage-empty .assistant-knowledge-empty { width: min(100%, 480px); }
.assistant-knowledge-upload { align-items: stretch; flex-direction: column; gap: 9px; margin-top: auto; padding: 13px; }
.assistant-knowledge-upload > div { min-width: 0; }
.assistant-knowledge-upload input[type="file"] { min-width: 0; width: 100%; }
.assistant-knowledge-upload button { align-self: flex-start; min-height: 34px; }
.assistant-knowledge-workspace button:focus-visible, .assistant-knowledge-workspace input:focus-visible, .assistant-knowledge-workspace select:focus-visible { outline: 3px solid #c7ead5; outline-offset: 2px; }

@keyframes assistant-knowledge-shimmer { from { background-position: 200% 0; } to { background-position: -20% 0; } }

@media (max-width: 1200px) {
  .assistant-knowledge-stage { grid-template-columns: minmax(200px, .62fr) minmax(280px, 1fr) minmax(330px, 1.2fr); }
  .assistant-knowledge-reader-scroll { padding-left: 21px; padding-right: 21px; }
}

@media (max-width: 920px) {
  .assistant-knowledge-stage { grid-template-columns: minmax(190px, .65fr) minmax(300px, 1fr); }
  .assistant-knowledge-reader { grid-column: 1 / -1; border-top: 1px solid #dbe9e1; }
  .assistant-knowledge-reader-scroll, .assistant-knowledge-reader-empty, .assistant-knowledge-reader-loading { min-height: 520px; height: auto; }
}

@media (max-width: 620px) {
  .assistant-knowledge-card { padding: 20px 15px 18px; border-radius: 15px; }
  .assistant-knowledge-stage { display: block; min-height: 0; }
  .assistant-knowledge-library-pane { max-height: 300px; border-right: 0; border-bottom: 1px solid #dbe9e1; }
  .assistant-knowledge-document-pane { border-bottom: 1px solid #dbe9e1; }
  .assistant-knowledge-filters { grid-template-columns: 1fr; }
  .assistant-knowledge-reader-scroll { min-height: 460px; padding: 20px 17px 25px; }
  .assistant-knowledge-reader-empty, .assistant-knowledge-reader-loading { min-height: 420px; }
  .assistant-knowledge-reader-header { flex-direction: column; }
  .assistant-knowledge-document-select { min-height: 62px; }
}

.assistant-customizer-draft, .assistant-customizer-preview { margin: 0 17px 14px; padding: 15px; border: 1px solid #cfe6d8; border-radius: 13px; background: #f8fcf9; }
.assistant-customizer-draft-head, .assistant-customizer-preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.assistant-customizer-draft h3, .assistant-customizer-preview h3 { margin: 0; color: #285640; font-size: 14px; }
.assistant-customizer-draft p, .assistant-customizer-preview p { margin: 5px 0 0; color: #728c7e; font-size: 11px; line-height: 1.55; }
.assistant-rule-list { display: grid; gap: 6px; margin-top: 13px; }
.assistant-rule-row { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 10px; padding: 8px 10px; border-radius: 8px; color: #6f887a; background: #edf8f1; font-size: 11px; line-height: 1.5; }
.assistant-rule-row strong { color: #365f4b; font-weight: 600; white-space: pre-wrap; }
.assistant-rule-empty { margin-top: 12px; color: #82988c; font-size: 11px; }
.assistant-rule-intents { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 11px; color: #718b7d; font-size: 11px; }
.assistant-rule-intents > div { display: flex; flex-wrap: wrap; gap: 5px; }
.assistant-customizer-example { margin-top: 13px; padding-top: 12px; border-top: 1px solid #e3eee7; }
.assistant-customizer-example-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.assistant-customizer-example-head > span { color: #6f887a; font-size: 11px; font-weight: 700; }
.assistant-customizer-example-head small { color: #91a79a; font-size: 10px; }
.assistant-customizer-example-question { display: flex; align-items: flex-start; gap: 7px; margin-bottom: 7px; padding: 7px 9px; border-radius: 9px; color: #728c7e; background: #f4faf6; font-size: 10px; line-height: 1.5; }
.assistant-customizer-example-question span { flex: 0 0 auto; color: #4e8066; font-weight: 700; }
.assistant-customizer-example-question p { margin: 0; white-space: pre-wrap; }
.assistant-customizer-example-empty { padding: 10px; border: 1px dashed #cfe6d8; border-radius: 10px; color: #789184; background: #f7fcf9; font-size: 11px; line-height: 1.6; text-align: center; }
.assistant-customizer-example .message-bubble { max-width: 100%; padding: 9px 10px; color: #315b48; background: #edf8f1; font-size: 11px; line-height: 1.6; white-space: pre-wrap; }
.assistant-customizer-draft-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.assistant-customizer-preview { border-color: #d7e6ef; background: #f8fbfd; }
.assistant-customizer-preview-form { display: flex; align-items: flex-end; gap: 8px; margin-top: 12px; }
.assistant-customizer-preview-form textarea { flex: 1; min-width: 0; min-height: 55px; resize: vertical; }
.assistant-customizer-preview-form button { min-width: 92px; }
.assistant-customizer-preview-answer { margin-top: 14px; padding-top: 12px; border-top: 1px solid #e6eef2; }
.assistant-customizer-preview-answer > span { display: block; margin-bottom: 7px; color: #688294; font-size: 11px; font-weight: 700; }
.assistant-profile-drawer-mask { position: fixed; inset: 0; z-index: 130; display: flex; justify-content: flex-end; background: rgba(18, 38, 29, .3); }
.assistant-profile-drawer { display: flex; width: min(520px, calc(100vw - 20px)); height: 100%; flex-direction: column; overflow: hidden; background: #fff; box-shadow: -10px 0 30px rgba(18, 38, 29, .18); animation: assistantProfileDrawerIn .22s ease-out; }
.assistant-profile-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 19px 21px 16px; border-bottom: 1px solid var(--line); }
.assistant-profile-drawer-head h2 { margin: 0; color: var(--text); font-size: 16px; }
.assistant-profile-drawer-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.assistant-profile-drawer-close { width: 30px; height: 30px; flex: 0 0 auto; padding: 0; font-size: 20px; line-height: 1; }
.assistant-profile-drawer-body { display: flex; min-height: 0; flex: 1; flex-direction: column; }
.assistant-profile-drawer-body .profile-form { padding: 18px 21px; }
.assistant-profile-drawer-body .profile-action-row { padding: 13px 21px; }
@keyframes assistantProfileDrawerIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* 联调台三列布局：智能体列表、对话链和固定患者画像栏。 */
.assistant-debug-workspace.agent-workspace-v2 {
  --agent-list: 228px;
  display: grid !important;
  grid-template-columns: minmax(190px, var(--agent-list)) minmax(0, 1fr) minmax(280px, .38fr) !important;
  gap: 12px;
  height: calc(100vh - 132px);
  min-height: 640px;
}
.assistant-debug-workspace.agent-workspace-v2 .agent-main {
  grid-column: 2;
  display: flex !important;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  gap: 12px;
}
.assistant-debug-workspace .conversation-stream { flex: 1 1 auto; height: auto; min-height: 0; }
.assistant-debug-profile-panel {
  grid-column: 3;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}
.assistant-debug-profile-head { padding: 16px 17px 13px; border-bottom: 1px solid var(--line); }
.assistant-debug-profile-head h3 { margin: 0; color: var(--text); font-size: 15px; }
.assistant-debug-profile-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.assistant-debug-profile-body { min-height: 0; flex: 1; overflow: auto; }
.assistant-debug-profile-body .profile-form { padding: 17px; }
.assistant-debug-profile-body .profile-action-row { padding: 13px 17px; }

/* 联调台底部滑动窗口：草案和 AI 修改对话在中间区域展开。 */
.assistant-customizer-window {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 0 1 auto;
  max-height: min(58vh, 620px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #cfe6d8;
  border-radius: 15px;
  background: #fbfdfc;
  box-shadow: 0 12px 28px rgba(35, 92, 67, .1);
  transition: max-height .24s ease, box-shadow .24s ease;
}
.assistant-customizer-window.is-collapsed { max-height: 78px; box-shadow: 0 7px 16px rgba(35, 92, 67, .07); }
.assistant-customizer-window-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  padding: 11px 14px 10px 17px;
  border-bottom: 1px solid #dcebe3;
  background: linear-gradient(135deg, #f3fbf6, #fff);
}
.assistant-customizer-window-toolbar > div:first-child { position: relative; min-width: 0; padding-left: 16px; }
.assistant-customizer-window-grip { position: absolute; top: 4px; left: 0; width: 4px; height: 40px; border-radius: 99px; background: #a9d8bb; }
.assistant-customizer-window-toolbar strong { display: block; color: #294d3d; font-size: 13px; }
.assistant-customizer-window-toolbar small { display: block; margin-top: 3px; color: #84988d; font-size: 10px; }
.assistant-customizer-window-actions { display: flex; flex: 0 0 auto; gap: 6px; }
.assistant-customizer-window-actions button { min-height: 29px; padding: 4px 8px; font-size: 10px; }
.assistant-customizer-window-content { display: flex; min-height: 0; height: min(52vh, 552px); flex: 1 1 auto; }
.assistant-customizer-window-collapsed { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 0; padding: 8px 15px 10px 33px; }
.assistant-customizer-window-collapsed p { margin: 0; color: #728c7e; font-size: 11px; }
.assistant-customizer-window-collapsed button { min-height: 29px; padding: 4px 9px; font-size: 10px; }
.assistant-customizer-window button:focus-visible, .assistant-debug-profile-panel button:focus-visible, .assistant-debug-profile-panel input:focus-visible, .assistant-debug-profile-panel textarea:focus-visible { outline: 3px solid #c7ead5; outline-offset: 2px; }

.assistant-customizer-module { display: flex; min-height: 0; height: 100%; flex: 1; flex-direction: column; overflow: hidden; background: #fbfdfc; }
.assistant-customizer-module-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; padding: 15px 14px 12px; border-bottom: 1px solid var(--line); }
.assistant-customizer-kicker { display: block; margin-bottom: 4px; color: #5b9b7a; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.assistant-customizer-module-head h3 { margin: 0; color: #294d3d; font-size: 15px; }
.assistant-customizer-module-head p { margin: 4px 0 0; overflow: hidden; color: #84988d; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.assistant-customizer-module-head button { flex: 0 0 auto; min-height: 30px; padding: 5px 9px; font-size: 11px; }
.assistant-customizer-module-main { display: flex; min-height: 0; flex: 1 1 auto; flex-direction: column; overflow: hidden; }
.assistant-customizer-chat-view { display: flex; min-height: 0; flex: 1 1 auto; flex-direction: column; overflow: hidden; }
.assistant-customizer-mini-stream { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 10px; overflow: auto; padding: 13px 12px; background: radial-gradient(circle at 50% 0, rgba(218,245,233,.35), transparent 42%); }
.assistant-customizer-mini-stream .message-bubble { max-width: 94%; padding: 9px 10px; font-size: 11px; line-height: 1.55; }
.assistant-customizer-mini-form { display: flex; align-items: flex-end; gap: 7px; padding: 10px 12px 12px; border-top: 1px solid var(--line); background: #fff; }
.assistant-customizer-mini-form textarea { min-width: 0; min-height: 50px; flex: 1; resize: vertical; font-size: 11px; line-height: 1.45; }
.assistant-customizer-mini-form button { min-width: 48px; min-height: 34px; padding: 5px 8px; font-size: 11px; }
.assistant-customizer-module .assistant-customizer-draft, .assistant-customizer-module .assistant-customizer-preview { margin: 0 12px 10px; padding: 11px; }
.assistant-customizer-module .assistant-customizer-draft, .assistant-customizer-module .assistant-customizer-preview { flex: 0 1 auto; max-height: 240px; overflow: auto; }
.assistant-customizer-module .assistant-customizer-draft-head, .assistant-customizer-module .assistant-customizer-preview-head { gap: 7px; }
.assistant-customizer-module .assistant-customizer-draft h4, .assistant-customizer-module .assistant-customizer-preview h4 { margin: 0; color: #285640; font-size: 12px; }
.assistant-customizer-module .assistant-customizer-draft p, .assistant-customizer-module .assistant-customizer-preview p { font-size: 10px; }
.assistant-customizer-module .assistant-rule-list { margin-top: 9px; }
.assistant-customizer-module .assistant-rule-row { grid-template-columns: 56px minmax(0, 1fr); gap: 6px; padding: 6px 7px; font-size: 10px; }
.assistant-customizer-module .assistant-rule-intents { margin-top: 8px; font-size: 10px; }
.assistant-customizer-module .assistant-customizer-example { margin-top: 9px; padding-top: 9px; }
.assistant-customizer-module .assistant-customizer-example-head { margin-bottom: 5px; }
.assistant-customizer-module .assistant-customizer-example-head > span { font-size: 10px; }
.assistant-customizer-module .assistant-customizer-example-head small { font-size: 9px; }
.assistant-customizer-module .assistant-customizer-example-question { margin-bottom: 5px; padding: 6px 7px; font-size: 9px; }
.assistant-customizer-module .assistant-customizer-example-empty { padding: 8px 7px; font-size: 10px; }
.assistant-customizer-module .assistant-customizer-example .message-bubble { font-size: 11px; }
.assistant-customizer-module .assistant-customizer-draft-actions { gap: 5px; margin-top: 9px; }
.assistant-customizer-module .assistant-customizer-draft-actions button { min-height: 28px; padding: 4px 7px; font-size: 10px; }
.assistant-customizer-module .assistant-customizer-preview-form { align-items: stretch; flex-direction: column; gap: 6px; margin-top: 9px; }
.assistant-customizer-module .assistant-customizer-preview-form textarea { min-height: 48px; font-size: 11px; }
.assistant-customizer-module .assistant-customizer-preview-form button { min-height: 29px; font-size: 10px; }
.assistant-customizer-module .assistant-customizer-preview-answer { margin-top: 9px; padding-top: 9px; }
.assistant-customizer-module .assistant-customizer-preview-answer > span { margin-bottom: 5px; font-size: 10px; }
.assistant-customizer-module .assistant-customizer-preview-answer .message-bubble { max-width: 100%; font-size: 11px; }

/* 问答批量导入草案：原文优先、按场景筛选、固定底部批量操作。 */
.assistant-qa-import-entry,
.assistant-qa-import-progress,
.assistant-qa-draft-window {
  margin: 0 12px 10px;
  border: 1px solid #cfe6d8;
  border-radius: 12px;
  background: #f8fcf9;
}
.assistant-qa-import-entry { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px; }
.assistant-qa-import-entry-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: #2f8a69; background: #e1f3e8; font-size: 10px; font-weight: 800; }
.assistant-qa-import-entry-copy { min-width: 0; }
.assistant-qa-import-entry-copy strong { display: block; color: #315d48; font-size: 12px; }
.assistant-qa-import-entry-copy p { margin: 3px 0 0; color: #6f887a; font-size: 10px; line-height: 1.5; }
.assistant-qa-import-entry-copy small, .assistant-qa-import-entry-file { color: #91a79a; font-size: 9px; }
.assistant-qa-import-entry button, .assistant-qa-import-window button { min-height: 29px; padding: 4px 8px; font-size: 10px; }
.assistant-qa-import-entry-file, .assistant-qa-import-error { grid-column: 2 / -1; }
.assistant-qa-import-error { color: #a35e50; font-size: 10px; }
.assistant-qa-import-progress { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 9px; min-height: 78px; padding: 13px; }
.assistant-qa-progress-spinner { width: 22px; height: 22px; border: 2px solid #cfe6d8; border-top-color: #2f8a69; border-radius: 50%; animation: assistantQaSpin .8s linear infinite; }
.assistant-qa-import-progress strong { display: block; color: #315d48; font-size: 12px; }
.assistant-qa-import-progress p { grid-column: 2; margin: -4px 0 0; color: #728c7e; font-size: 10px; line-height: 1.5; }
@keyframes assistantQaSpin { to { transform: rotate(360deg); } }
.assistant-qa-file-toolbar { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 14px; border-bottom: 1px solid #e3eee7; background: #fbfefc; }
.assistant-qa-file-toolbar-title { flex: 0 0 auto; color: #557466; font-size: 11px; white-space: nowrap; }
.assistant-qa-file-list { display: flex; min-width: 0; flex: 1 1 auto; gap: 7px; overflow-x: auto; padding: 2px 0; }
.assistant-qa-file-tab { display: grid; min-width: 150px; max-width: 230px; gap: 2px; padding: 7px 10px; border: 1px solid #dcebe3; border-radius: 9px; color: #557466; background: #fff; text-align: left; box-shadow: none; }
.assistant-qa-file-tab strong { overflow: hidden; color: #315d48; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.assistant-qa-file-tab small { color: #92a59b; font-size: 8px; font-weight: 500; }
.assistant-qa-file-tab.is-active { border-color: #83bf99; background: #eaf7ef; box-shadow: 0 2px 7px rgba(48, 120, 84, .08); }
.assistant-qa-file-upload { flex: 0 0 auto; min-height: 28px; padding: 4px 8px; font-size: 10px; }
.assistant-qa-draft-window { display: flex; min-height: 0; flex-direction: column; overflow: hidden; background: #fff; }
.assistant-qa-import-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; padding: 9px 10px; background: #fbfefc; }
.assistant-qa-import-summary > div { min-width: 0; padding: 5px 3px; border: 1px solid #e0eee6; border-radius: 8px; text-align: center; }
.assistant-qa-import-summary strong { display: block; color: #315d48; font-size: 12px; }
.assistant-qa-import-summary small { display: block; margin-top: 2px; overflow: hidden; color: #84988d; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.assistant-qa-import-summary .is-warn strong { color: #a46f2d; }
.assistant-qa-import-summary .is-ok strong { color: #2f8a69; }
.assistant-qa-consistency-summary { display: flex !important; grid-column: 1 / -1; align-items: center; gap: 8px; padding: 6px 2px 1px; border-top: 1px solid #edf4ef; color: #82988d; font-size: 8px; }
.assistant-qa-consistency-summary span { display: inline-flex; align-items: center; min-height: 20px; padding: 2px 6px; border-radius: 99px; background: #f3f8f5; }
.assistant-qa-consistency-summary .duplicate { color: #7a6a3e; background: #fbf6e9; }
.assistant-qa-consistency-summary .conflict { color: #a25c52; background: #fff0ee; }
.assistant-qa-consistency-summary .similar { color: #5f6f9b; background: #f0f3ff; }
.assistant-qa-draft-filters { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 7px; padding: 0 10px 8px; }
.assistant-qa-scene-tabs { display: flex; min-width: 0; gap: 4px; overflow: auto; }
.assistant-qa-scene-tab { min-height: 25px; padding: 3px 7px; border: 1px solid transparent; border-radius: 99px; color: #728c7e; background: #f4faf6; box-shadow: none; font-size: 9px; white-space: nowrap; }
.assistant-qa-scene-tab.is-active { border-color: #afd9bd; color: #2f7455; background: #e5f5eb; font-weight: 700; }
.assistant-qa-draft-filters label { display: flex; align-items: center; flex: 0 0 auto; gap: 4px; color: #82988d; font-size: 9px; }
.assistant-qa-draft-filters select { min-height: 25px; padding: 3px 5px; border: 1px solid #dcebe3; border-radius: 7px; color: #476a57; background: #fff; font-size: 9px; }
.assistant-qa-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; min-height: 0; overflow: auto; padding: 0 10px 8px; }
.assistant-qa-rule-card { min-width: 0; padding: 10px; border: 1px solid #e2eee7; border-radius: 10px; background: #fbfefc; }
.assistant-qa-rule-card.is-needs-review { border-color: #ead7b5; background: #fffdf8; }
.assistant-qa-rule-card.is-consistency-conflict { border-color: #e9c4bd; background: #fffafa; }
.assistant-qa-rule-card.is-consistency-duplicate { border-color: #e5d9b8; background: #fffdf8; }
.assistant-qa-rule-card.is-consistency-similar { border-color: #cfd7f0; background: #fcfcff; }
.assistant-qa-rule-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; padding-bottom: 8px; border-bottom: 1px solid #edf4ef; }
.assistant-qa-select { display: flex; align-items: center; min-width: 0; gap: 6px; color: #718b7d; font-size: 9px; }
.assistant-qa-select input { margin: 0; accent-color: #2f8a69; }
.assistant-qa-rule-index { color: #315d48; font-size: 10px; font-weight: 800; white-space: nowrap; }
.assistant-qa-status-pill { flex: 0 0 auto; padding: 2px 5px; border-radius: 99px; color: #668271; background: #edf6f0; font-size: 8px; }
.assistant-qa-status-pill.warn { color: #9b6a2f; background: #fff2d5; }
.assistant-qa-status-pill.ok { color: #2f7657; background: #e4f5ea; }
.assistant-qa-status-pill.off { color: #7d8b84; background: #eef2ef; }
.assistant-qa-scene { min-width: 0; margin-left: auto; overflow: hidden; color: #6f897b; font-size: 8px; font-weight: 700; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.assistant-qa-consistency-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.assistant-qa-consistency-pill { display: inline-flex; align-items: center; min-height: 18px; padding: 2px 6px; border-radius: 99px; font-size: 8px; font-weight: 700; }
.assistant-qa-consistency-pill.duplicate { color: #7a6a3e; background: #fbf1d7; }
.assistant-qa-consistency-pill.conflict { color: #a25c52; background: #ffe8e4; }
.assistant-qa-consistency-pill.similar { color: #5f6f9b; background: #e9edff; }
.assistant-qa-consistency-note { margin: 6px 0 0; color: #927568; font-size: 8px; line-height: 1.45; }
.assistant-qa-card-fields { display: grid; gap: 9px; margin-top: 10px; }
.assistant-qa-field { display: grid; gap: 4px; margin: 0; color: #82988d; font-size: 8px; }
.assistant-qa-field-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.assistant-qa-field-label strong { color: #557466; font-size: 9px; }
.assistant-qa-field-label small { color: #a0b0a7; font-size: 8px; }
.assistant-qa-field textarea { display: block; width: 100%; min-height: 30px; margin: 0; padding: 7px 8px; border: 1px solid #dcebe3; border-radius: 7px; color: #476a57; background: #fff; font: inherit; font-size: 9px; line-height: 1.5; resize: vertical; overflow: auto; }
.assistant-qa-question-field textarea { min-height: 58px; }
.assistant-qa-answer-field textarea { min-height: 100px; }
.assistant-qa-field textarea:focus { outline: 2px solid #d6efdf; border-color: #83bf99; }
.assistant-qa-source { margin-top: 9px; padding-top: 8px; border-top: 1px solid #edf4ef; color: #84988d; font-size: 8px; }
.assistant-qa-source summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; list-style: none; }
.assistant-qa-source summary::-webkit-details-marker { display: none; }
.assistant-qa-source summary::after { flex: 0 0 auto; color: #74a489; content: '+'; font-size: 13px; line-height: 1; }
.assistant-qa-source[open] summary::after { content: '−'; }
.assistant-qa-source summary span { color: #5f8370; font-weight: 700; }
.assistant-qa-source summary small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assistant-qa-source-body { display: grid; gap: 7px; padding: 8px 0 1px; }
.assistant-qa-source-body > div { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 7px; }
.assistant-qa-source-body span { color: #9aac9f; }
.assistant-qa-source-body p { min-width: 0; margin: 0; overflow: hidden; color: #6e887a; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.assistant-qa-empty { grid-column: 1 / -1; padding: 18px; color: #82988d; text-align: center; font-size: 10px; }
.assistant-qa-draft-pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-top: 1px solid #edf4ef; color: #84988d; font-size: 9px; }
.assistant-qa-draft-pager > div { display: flex; gap: 5px; }
.assistant-qa-draft-pager button { min-height: 24px; padding: 3px 6px; font-size: 9px; }
.assistant-qa-draft-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-top: 1px solid #dcebe3; background: #f5fbf7; color: #718b7d; font-size: 9px; }
.assistant-qa-draft-actions > div { display: flex; gap: 5px; }
.assistant-qa-draft-actions button { min-height: 27px; padding: 4px 7px; font-size: 9px; }
.assistant-qa-publish-hint { align-self: center; color: #a25c52; font-size: 8px; white-space: nowrap; }
.assistant-qa-select-all { display: inline-flex; align-items: center; gap: 5px; margin-right: auto; color: #557466; font-size: 9px; font-weight: 700; }
.assistant-qa-select-all input { width: auto; margin: 0; accent-color: #2f8a69; }
.assistant-customizer-module .assistant-qa-draft-window { flex: 0 1 auto; max-height: 360px; }
.assistant-customizer-module.is-qa-mode .assistant-qa-draft-window { flex: 1 1 auto; min-height: 0; max-height: none; }
.assistant-customizer-module.is-qa-mode .assistant-qa-draft-window.is-compact { flex: 0 1 auto; max-height: min(420px, 52vh); }
.assistant-customizer-module.is-qa-mode .assistant-qa-card-grid { flex: 1 1 auto; }

/* 历史会话入口：AI 修改助手只在需要时从右侧抽屉打开。 */
.assistant-customizer-drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 170;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 16px;
  background: rgba(18, 38, 29, .3);
  backdrop-filter: blur(2px);
}
.assistant-customizer-drawer {
  display: flex;
  width: min(1040px, calc(100vw - 32px));
  height: min(calc(100vh - 32px), 920px);
  margin-left: auto;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #d7e9de;
  border-radius: 20px;
  background: #fff;
  box-shadow: -16px 0 42px rgba(18, 38, 29, .2);
  animation: assistantCustomizerDrawerIn .22s ease-out;
}
.assistant-customizer-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #f4fbf7, #fff);
}
.assistant-customizer-drawer-head h2 { margin: 2px 0 0; color: #244b38; font-size: 22px; }
.assistant-customizer-drawer-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.assistant-customizer-drawer-close { width: 32px; height: 32px; flex: 0 0 auto; padding: 0; font-size: 20px; line-height: 1; }
.assistant-customizer-drawer-agent { display: grid; gap: 5px; padding: 13px 22px; border-bottom: 1px solid #e8f1eb; background: #fbfefc; }
.assistant-customizer-drawer-agent label { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: 8px; color: #5b7567; font-size: 13px; font-weight: 700; }
.assistant-customizer-drawer-agent select { min-height: 38px; padding: 7px 10px; }
.assistant-customizer-drawer-agent small { margin-left: 92px; color: #82988d; font-size: 11px; }
.assistant-customizer-drawer-body { display: flex; min-height: 0; flex: 1; overflow: hidden; }
.assistant-customizer-drawer-body > .assistant-customizer-module { width: 100%; height: 100%; border: 0; border-radius: 0; }
.assistant-customizer-drawer-body .assistant-customizer-module-head { padding: 20px 28px 16px; }
.assistant-customizer-drawer-body .assistant-customizer-module-head h3 { font-size: 18px; }
.assistant-customizer-drawer-body .assistant-customizer-module-head p { font-size: 13px; }
.assistant-customizer-drawer-body .assistant-customizer-mini-stream { padding: 20px 28px; }
.assistant-customizer-drawer-body .assistant-qa-import-entry,
.assistant-customizer-drawer-body .assistant-qa-import-progress,
.assistant-customizer-drawer-body .assistant-qa-draft-window,
.assistant-customizer-drawer-body .assistant-customizer-draft,
.assistant-customizer-drawer-body .assistant-customizer-preview { margin-left: 28px; margin-right: 28px; }
.assistant-customizer-drawer-body .assistant-customizer-module .assistant-qa-draft-window {
  flex: 1 1 auto;
  min-height: min(600px, 68vh);
  max-height: min(680px, 72vh);
}
.assistant-customizer-drawer-body .assistant-customizer-module.is-qa-mode .assistant-qa-draft-window {
  min-height: 0;
  max-height: none;
}
.assistant-customizer-drawer-body .assistant-customizer-module.is-qa-mode .assistant-qa-draft-window.is-compact {
  flex: 0 1 auto;
  min-height: 0;
  max-height: min(420px, 52vh);
}
.assistant-customizer-drawer-body .assistant-qa-card-grid { gap: 14px; padding: 0 22px 14px; }
.assistant-customizer-drawer-body .assistant-qa-rule-card { padding: 16px; }
.assistant-customizer-drawer-body .assistant-qa-field { margin-top: 9px; font-size: 12px; }
.assistant-customizer-drawer-body .assistant-qa-field textarea { min-height: 84px; padding: 10px 11px; font-size: 13px; }
.assistant-customizer-drawer-body .assistant-qa-card-fields { gap: 14px; margin-top: 13px; }
.assistant-customizer-drawer-body .assistant-qa-field { margin-top: 0; }
.assistant-customizer-drawer-body .assistant-qa-question-field textarea { min-height: 88px; }
.assistant-customizer-drawer-body .assistant-qa-answer-field textarea { min-height: 142px; }
.assistant-customizer-drawer-body .assistant-qa-source { margin-top: 13px; padding-top: 10px; font-size: 11px; }
.assistant-customizer-drawer-body .assistant-customizer-mini-form { padding: 16px 28px 22px; }
.assistant-customizer-drawer-empty { display: grid; flex: 1; place-items: center; padding: 30px; color: var(--muted); text-align: center; }
.assistant-customizer-entry { flex: 0 0 auto; min-height: 32px; padding: 6px 10px; color: #2d7657; border-color: #cfe5d8; background: #f7fcf9; font-size: 11px; white-space: nowrap; }
.assistant-customizer-entry:hover { color: #1d694b; background: #eaf7ef; }
@keyframes assistantCustomizerDrawerIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* AI 修改助手独立页面：页面保持稳定，只有规则卡列表在模块内部滚动。 */
#assistant-customizer.view.active { display: flex; min-height: 0; height: calc(100vh - 132px); max-height: calc(100vh - 132px); overflow: hidden; }
.assistant-customizer-page { display: flex; min-width: 0; min-height: 0; width: 100%; height: 100%; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.assistant-customizer-page-toolbar { display: flex; align-items: center; justify-content: flex-end; min-height: 56px; padding: 9px 18px; border-bottom: 1px solid var(--line); background: #fbfefc; }
.assistant-customizer-page-head h2 { margin: 2px 0 0; color: #244b38; font-size: 22px; }
.assistant-customizer-page-head p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.assistant-customizer-page-actions { display: flex; align-items: flex-end; gap: 10px; flex: 0 0 auto; }
.assistant-customizer-page-toolbar .assistant-customizer-page-actions { align-items: center; gap: 8px; }
.assistant-customizer-page-toolbar .assistant-customizer-page-actions label { display: flex; align-items: center; gap: 8px; min-width: 0; color: #5b7567; font-size: 14px; }
.assistant-customizer-page-toolbar .assistant-customizer-page-actions select { width: 220px; }
.assistant-customizer-page-toolbar .assistant-customizer-page-actions select { font-size: 14px; }
.assistant-customizer-page-actions select { min-height: 35px; padding: 6px 9px; }
.assistant-customizer-page-toolbar .assistant-customizer-page-actions button { font-size: 14px; }
.assistant-customizer-page-actions button { min-height: 35px; white-space: nowrap; }
.assistant-customizer-page-body { display: flex; min-width: 0; min-height: 0; flex: 1; overflow: hidden; }
.assistant-customizer-page-body > .assistant-customizer-module { width: 100%; height: 100%; min-height: 0; border: 0; border-radius: 0; background: #f5f8f6; }
.assistant-customizer-page .assistant-customizer-module-head { padding: 20px 28px 15px; }
.assistant-customizer-page .assistant-customizer-module-head h3 { font-size: 17px; }
.assistant-customizer-page .assistant-customizer-module-main { min-height: 0; }
.assistant-customizer-page .assistant-customizer-mini-stream .message-bubble { font-size: 14px; }
.assistant-customizer-page .assistant-qa-import-entry-copy strong { font-size: 15px; }
.assistant-customizer-page .assistant-qa-import-entry-copy p { font-size: 13px; }
.assistant-customizer-page .assistant-qa-import-entry-copy small { font-size: 11px; }
.assistant-customizer-page .assistant-qa-import-entry button { font-size: 13px; }
.assistant-customizer-page .assistant-customizer-mini-form textarea { font-size: 14px; }
.assistant-customizer-page .assistant-customizer-mini-form button { font-size: 14px; }
.assistant-customizer-page .assistant-qa-draft-window { flex: 1 1 auto; min-height: 0; max-height: none; margin: 0; border: 0; border-radius: 0; background: transparent; }
.assistant-customizer-page .assistant-qa-draft-window.is-compact { flex: 0 1 auto; max-height: min(420px, 52vh); }
.assistant-customizer-page .assistant-qa-file-toolbar { min-height: 46px; gap: 10px; padding: 6px 18px; border-bottom-color: #dbe7e0; background: #fff; }
.assistant-customizer-page .assistant-qa-file-toolbar-title { font-size: 13px; }
.assistant-customizer-page .assistant-qa-file-tab { min-width: 132px; padding: 5px 8px; }
.assistant-customizer-page .assistant-qa-file-tab strong { font-size: 11px; }
.assistant-customizer-page .assistant-qa-file-tab small { font-size: 9px; }
.assistant-customizer-page .assistant-qa-file-upload { min-height: 28px; font-size: 11px; }
.assistant-customizer-page .assistant-qa-import-summary { display: flex; align-items: stretch; gap: 0; padding: 10px 18px; background: transparent; }
.assistant-customizer-page .assistant-qa-import-summary > div { flex: 1 1 0; padding: 2px 12px; border: 0; border-right: 1px solid #dfe9e3; border-radius: 0; text-align: left; }
.assistant-customizer-page .assistant-qa-import-summary > div:first-child { flex: 1.35 1 0; padding-left: 0; }
.assistant-customizer-page .assistant-qa-import-summary > div:nth-child(5) { border-right: 0; }
.assistant-customizer-page .assistant-qa-import-summary strong { font-size: 16px; }
.assistant-customizer-page .assistant-qa-import-summary small { font-size: 11px; }
.assistant-customizer-page .assistant-qa-consistency-summary { flex: 0 0 auto; gap: 5px; padding: 0 0 0 12px; border-top: 0; font-size: 10px; }
.assistant-customizer-page .assistant-qa-consistency-summary span { min-height: 22px; padding: 2px 7px; }
.assistant-customizer-page .assistant-qa-draft-filters { gap: 8px; margin: 0 18px; padding: 8px 0; border-top: 1px solid #e0e9e3; border-bottom: 1px solid #e0e9e3; }
.assistant-customizer-page .assistant-qa-draft-filters label { font-size: 11px; }
.assistant-customizer-page .assistant-qa-draft-filters select { min-height: 29px; font-size: 11px; }
.assistant-customizer-page .assistant-qa-card-grid { flex: 1 1 auto; min-height: 0; overflow: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px 18px; }
.assistant-customizer-page .assistant-qa-rule-card { padding: 12px; border-color: #dfe9e3; border-radius: 12px; background: #fff; box-shadow: 0 2px 8px rgba(38, 80, 59, .045); }
.assistant-customizer-page .assistant-qa-rule-index { font-size: 12px; }
.assistant-customizer-page .assistant-qa-status-pill { font-size: 11px; }
.assistant-customizer-page .assistant-qa-scene { font-size: 11px; }
.assistant-customizer-page .assistant-qa-field { gap: 3px; font-size: 12px; }
.assistant-customizer-page .assistant-qa-field-label strong { font-size: 13px; }
.assistant-customizer-page .assistant-qa-field-label small { font-size: 10px; }
.assistant-customizer-page .assistant-qa-card-fields { gap: 7px; margin-top: 8px; }
.assistant-customizer-page .assistant-qa-field textarea { border-color: #e1ebe5; background: #f8fbf9; font-size: 13px; }
.assistant-customizer-page .assistant-qa-question-field textarea { min-height: 64px; }
.assistant-customizer-page .assistant-qa-answer-field textarea { min-height: 96px; }
.assistant-customizer-page .assistant-qa-source { margin-top: 7px; padding-top: 7px; font-size: 10px; }
.assistant-customizer-page .assistant-qa-draft-pager { margin: 0 18px; padding: 7px 0; border-top-color: #dfe9e3; font-size: 11px; }
.assistant-customizer-page .assistant-qa-draft-actions { padding: 10px 18px; border-top-color: #d5e4db; background: #f1f7f3; font-size: 11px; }
.assistant-customizer-page .assistant-qa-draft-actions button { min-height: 32px; padding: 5px 11px; font-size: 12px; }
.assistant-customizer-page-empty { display: grid; min-height: 320px; place-items: center; color: var(--muted); }

@media (max-width: 800px) {
  .assistant-debug-profile-panel { min-height: 420px; }
}

/* 联调台窄屏布局：侧栏、对话和 AI 修改助手纵向排列，避免横向裁切。 */
@media (max-width: 1120px) {
  body { min-width: 0; }
  .content { min-width: 0; overflow: auto; padding: 16px; }
  .assistant-debug-workspace.agent-workspace-v2 {
    display: flex;
    height: auto;
    min-height: 0;
    flex-direction: column;
    gap: 12px;
  }
  .assistant-debug-workspace.agent-workspace-v2 .agent-rail {
    flex: 0 0 auto;
    min-height: 0;
    max-height: 170px;
  }
  .assistant-debug-workspace.agent-workspace-v2 .agent-main {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    gap: 12px;
  }
  .assistant-debug-workspace .conversation-stream {
    height: calc(100vh - 220px);
    min-height: 520px;
  }
  .assistant-debug-workspace .assistant-debug-profile-panel {
    order: 3;
    height: auto;
    min-height: 420px;
  }
  .assistant-debug-workspace .assistant-customizer-window {
    order: 2;
    max-height: none;
  }
  .assistant-debug-workspace .assistant-customizer-window.is-collapsed {
    max-height: 78px;
  }
  .assistant-debug-workspace .assistant-customizer-window-content {
    height: 420px;
  }
  .assistant-customizer-module .assistant-qa-draft-window { max-height: 420px; }
}

@media (max-width: 720px) {
  .topbar { padding: 0 16px; }
  .content { padding: 12px; }
  .assistant-debug-workspace.agent-workspace-v2 .agent-rail { max-height: 150px; }
  .assistant-debug-workspace .conversation-stream { height: auto; min-height: 560px; }
  .assistant-debug-workspace .assistant-customizer-window-toolbar { align-items: flex-start; }
  .assistant-debug-workspace .assistant-customizer-window-toolbar strong { max-width: 170px; }
  .assistant-qa-card-grid { grid-template-columns: minmax(0, 1fr); }
  .assistant-customizer-page-toolbar { min-height: 50px; padding: 8px 12px; }
  .assistant-customizer-page-toolbar .assistant-customizer-page-actions { width: 100%; justify-content: space-between; }
  .assistant-customizer-page-toolbar .assistant-customizer-page-actions label { flex: 1; }
  .assistant-customizer-page-toolbar .assistant-customizer-page-actions select { width: auto; flex: 1; }
  .assistant-customizer-page .assistant-qa-card-grid { grid-template-columns: minmax(0, 1fr); }
  .assistant-customizer-page .assistant-qa-draft-window { margin-left: 12px; margin-right: 12px; }
  .assistant-qa-import-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .assistant-qa-import-summary > div:nth-child(n+4) { display: none; }
  .assistant-debug-workspace .workspace-head { flex-direction: column; }
  .assistant-debug-workspace .workspace-head .actions { width: 100%; }
  .assistant-debug-workspace .workspace-head .actions button { flex: 1 1 auto; }
}

/* Create workspace: keep the primary path compact and move secondary selections into drawers. */
.assistant-creation-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 18px;
  border: 1px solid #dcebe3;
  border-radius: 16px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 8px 20px rgba(35, 92, 67, .05);
}
.assistant-creation-toolbar > div { min-width: 0; }
.assistant-creation-toolbar-kicker,
.assistant-form-eyebrow {
  display: block;
  color: #79a18f;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .13em;
}
.assistant-creation-toolbar strong { display: block; margin-top: 4px; color: #285843; font-size: 14px; }
.assistant-creation-toolbar p { margin: 3px 0 0; color: #81968b; font-size: 11px; }
.assistant-creation-toolbar button { flex: 0 0 auto; min-height: 36px; padding: 7px 11px; border-color: #cfe5d8; color: #2d7657; background: #f7fcf9; }
.assistant-creation-toolbar button svg { width: 15px; height: 15px; flex: 0 0 auto; }
.assistant-creation-toolbar button:hover { color: #1d694b; background: #eaf7ef; }
.assistant-creation-toolbar-count { display: inline-grid; min-width: 20px; height: 20px; place-items: center; margin-left: 1px; padding: 0 5px; border-radius: 999px; color: #2f805f; background: #e1f3e8; font-size: 10px; }
.assistant-form-eyebrow { margin-bottom: 5px; }
.assistant-form-field { display: grid; gap: 8px; min-width: 0; }
.assistant-form-label { display: grid; gap: 4px; color: #3e5b4d; font-size: 13px; font-weight: 700; }
.assistant-form-label .assistant-hint { font-weight: 400; }
.assistant-form-grid { gap: 13px 15px; }
.assistant-form-grid textarea { min-height: 76px; }
.assistant-creation-selection-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; padding: 13px 14px; border: 1px solid #d7e9de; border-radius: 13px; background: #f9fdfb; }
.assistant-creation-selection-copy { display: flex; align-items: center; gap: 10px; min-width: 0; }
.assistant-creation-selection-icon { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: #2f815f; background: #e3f4ea; }
.assistant-creation-selection-icon svg { width: 16px; height: 16px; }
.assistant-creation-selection-copy > span:last-child { display: grid; gap: 3px; min-width: 0; }
.assistant-creation-selection-copy strong { color: #2d5743; font-size: 12px; }
.assistant-creation-selection-copy small { overflow: hidden; color: #81968b; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.assistant-creation-selection-meta { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex: 0 0 auto; }
.assistant-creation-selection-meta > span { color: #6e897b; font-size: 10px; white-space: nowrap; }
.assistant-creation-selection-meta button { min-height: 30px; padding: 5px 9px; border-color: #d5e8dc; color: #317457; background: #fff; font-size: 11px; }
.assistant-creation-selection-meta button svg { width: 14px; height: 14px; }

.assistant-creation-drawer-mask { position: fixed; inset: 0; z-index: 280; display: flex; justify-content: flex-end; background: rgba(18, 38, 29, .32); backdrop-filter: blur(2px); }
.assistant-creation-drawer { display: flex; width: min(520px, calc(100vw - 20px)); height: 100%; flex-direction: column; overflow: hidden; border-left: 1px solid #dcebe3; background: #fff; box-shadow: -14px 0 38px rgba(18, 38, 29, .2); animation: assistantCreationDrawerIn .22s ease-out; }
.assistant-creation-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 22px 22px 17px; border-bottom: 1px solid #e5efe9; background: linear-gradient(135deg, #fbfefc, #f1faf5); }
.assistant-creation-drawer-kicker { display: block; color: #75a18c; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.assistant-creation-drawer-head h2 { margin: 5px 0 0; color: #1f4939; font-size: 19px; letter-spacing: -.02em; }
.assistant-creation-drawer-head p { margin: 6px 0 0; color: #6e877b; font-size: 11px; line-height: 1.55; }
.assistant-creation-drawer-close { width: 30px; height: 30px; flex: 0 0 auto; padding: 0; border-color: #d8eae0; color: #729085; }
.assistant-creation-drawer-close svg { width: 15px; height: 15px; }
.assistant-creation-drawer-toolbar { display: flex; align-items: center; gap: 10px; padding: 13px 22px; border-bottom: 1px solid #eaf2ed; }
.assistant-creation-search { display: flex; align-items: center; gap: 7px; min-width: 0; flex: 1; padding: 0 10px; border: 1px solid #d7e7dd; border-radius: 9px; background: #fff; }
.assistant-creation-search:focus-within { border-color: #72b48e; box-shadow: 0 0 0 3px #e9f6ee; }
.assistant-creation-search svg { width: 15px; height: 15px; flex: 0 0 auto; color: #7d9e8d; }
.assistant-creation-search input { min-width: 0; padding: 8px 0; border: 0; outline: 0; background: transparent; font-size: 11px; }
.assistant-creation-selection-count { flex: 0 0 auto; color: #6d877b; font-size: 10px; white-space: nowrap; }
.assistant-creation-selection-count strong { color: #277452; font-size: 16px; }
.assistant-creation-drawer-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 14px 22px; border-bottom: 1px solid #eaf2ed; color: #6d877b; font-size: 11px; }
.assistant-creation-drawer-summary strong { color: #267452; font-size: 21px; line-height: 1; }
.assistant-creation-drawer-body { min-height: 0; flex: 1; overflow: auto; padding: 16px; background: #f8fcfa; }
.assistant-creation-library-list, .assistant-creation-agent-list { display: grid; gap: 9px; align-content: start; }
.assistant-creation-library-row { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 13px; border: 1px solid #dcebe3; border-radius: 12px; background: #fff; cursor: pointer; transition: border-color .16s, box-shadow .16s, background .16s; }
.assistant-creation-library-row:hover, .assistant-creation-library-row.selected { border-color: #8fc5a6; background: #f7fcf9; box-shadow: 0 5px 14px rgba(35, 92, 67, .07); }
.assistant-creation-library-row input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.assistant-creation-library-row input:focus-visible + .assistant-creation-library-icon { outline: 3px solid #d8f0e1; outline-offset: 2px; }
.assistant-creation-library-icon, .assistant-creation-agent-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: #39866a; background: #e8f6ed; }
.assistant-creation-library-icon svg, .assistant-creation-agent-icon svg { width: 16px; height: 16px; }
.assistant-creation-library-copy { min-width: 0; }
.assistant-creation-library-copy strong, .assistant-creation-library-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assistant-creation-library-copy strong { color: #2b5544; font-size: 12px; }
.assistant-creation-library-copy small { margin-top: 4px; color: #80958b; font-size: 10px; }
.assistant-creation-library-check { color: #a3b9ad; }
.assistant-creation-library-row.selected .assistant-creation-library-check { color: #2f8a69; }
.assistant-creation-library-check svg { width: 17px; height: 17px; }
.assistant-creation-agent-row { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 13px; border: 1px solid #dcebe3; border-radius: 12px; background: #fff; box-shadow: 0 2px 7px rgba(35, 76, 58, .035); }
.assistant-creation-agent-copy { min-width: 0; }
.assistant-creation-agent-copy strong, .assistant-creation-agent-copy small, .assistant-creation-agent-copy p { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assistant-creation-agent-copy strong { color: #2b5544; font-size: 13px; }
.assistant-creation-agent-copy small { margin-top: 4px; color: #6f897d; font-size: 10px; }
.assistant-creation-agent-copy p { margin: 7px 0 0; color: #81968b; font-size: 11px; }
.assistant-creation-agent-actions { grid-column: 2; display: flex; gap: 7px; padding-top: 10px; border-top: 1px solid #edf3ef; }
.assistant-creation-agent-actions button { min-height: 29px; padding: 5px 9px; font-size: 10px; }
.assistant-creation-drawer-empty { display: grid; min-height: 240px; place-items: center; align-content: center; gap: 8px; padding: 26px; color: #6e877b; text-align: center; }
.assistant-creation-drawer-empty svg { width: 28px; height: 28px; color: #4d9270; }
.assistant-creation-drawer-empty strong { color: #3b6251; font-size: 14px; }
.assistant-creation-drawer-empty span { max-width: 260px; font-size: 11px; line-height: 1.6; }
.assistant-creation-drawer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 22px; border-top: 1px solid #e9f1ec; background: #fbfdfc; }
.assistant-creation-drawer-foot > span { color: #789086; font-size: 10px; }
.assistant-creation-drawer-foot button { min-height: 32px; padding: 6px 11px; font-size: 11px; }
@keyframes assistantCreationDrawerIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

@media (max-width: 800px) {
  .assistant-creation-toolbar { align-items: flex-start; flex-direction: column; }
  .assistant-creation-toolbar button { width: 100%; }
  .assistant-creation-selection-card { align-items: flex-start; flex-direction: column; }
  .assistant-creation-selection-meta { width: 100%; justify-content: space-between; }
  .assistant-creation-drawer { width: calc(100vw - 8px); }
  .assistant-creation-drawer-head, .assistant-creation-drawer-toolbar { padding-left: 16px; padding-right: 16px; }
  .assistant-creation-drawer-foot { padding-left: 16px; padding-right: 16px; }
}

/* 创建页桌面紧凑布局：让引导、工具条、表单和主操作在同一视窗内完成。 */
@media (min-width: 801px) {
  .content:has(.assistant-creation-workspace) { padding-top: 16px; padding-bottom: 18px; }
  .assistant-creation-workspace { gap: 14px; }
  .assistant-creation-workspace .assistant-banner { gap: 22px; padding: 22px 26px; border-radius: 18px; }
  .assistant-creation-workspace .assistant-banner h2 { margin-bottom: 7px; font-size: clamp(24px, 2.4vw, 32px); }
  .assistant-creation-workspace .assistant-banner p { font-size: 13px; line-height: 1.6; }
  .assistant-creation-workspace .assistant-steps { padding: 7px; border-radius: 14px; }
  .assistant-creation-workspace .assistant-step { gap: 10px; padding: 9px 11px; }
  .assistant-creation-workspace .assistant-step-index { width: 28px; height: 28px; }
  .assistant-creation-workspace .assistant-step strong { font-size: 13px; }
  .assistant-creation-workspace .assistant-step small { margin-top: 2px; font-size: 11px; line-height: 1.4; }
  .assistant-creation-workspace .assistant-creation-toolbar { padding: 12px 16px; border-radius: 14px; }
  .assistant-creation-workspace .assistant-creation-toolbar strong { font-size: 14px; }
  .assistant-creation-workspace .assistant-creation-toolbar p { margin-top: 3px; font-size: 11px; }
  .assistant-creation-workspace .assistant-creation-toolbar button { min-height: 34px; padding: 6px 10px; }
  .assistant-creation-workspace .assistant-workspace-card { padding: 18px 22px; border-radius: 16px; }
  .assistant-creation-workspace .assistant-wizard { gap: 13px; }
  .assistant-creation-workspace .assistant-card-head { margin-bottom: 14px; }
  .assistant-creation-workspace .assistant-card-head h2 { font-size: 18px; }
  .assistant-creation-workspace .assistant-card-head p { margin-top: 4px; font-size: 12px; line-height: 1.5; }
  .assistant-creation-workspace .assistant-wizard-progress { gap: 7px; font-size: 12px; }
  .assistant-creation-workspace .assistant-wizard-progress span { gap: 6px; }
  .assistant-creation-workspace .assistant-wizard-progress b { width: 22px; height: 22px; font-size: 11px; }
  .assistant-creation-workspace .assistant-form-grid { gap: 11px 14px; }
  .assistant-creation-workspace .assistant-form-grid label { gap: 5px; font-size: 13px; }
  .assistant-creation-workspace .assistant-form-grid input,
  .assistant-creation-workspace .assistant-form-grid select { height: 38px; padding: 8px 10px; }
  .assistant-creation-workspace .assistant-form-grid textarea { min-height: 70px; padding: 8px 10px; line-height: 1.55; }
  .assistant-creation-workspace .assistant-hint { font-size: 11px; line-height: 1.45; }
  .assistant-creation-workspace .assistant-form-field { gap: 6px; }
  .assistant-creation-workspace .assistant-form-label { gap: 4px; font-size: 13px; }
  .assistant-creation-workspace .assistant-creation-selection-card { gap: 12px; padding: 11px 13px; }
  .assistant-creation-workspace .assistant-creation-selection-icon { width: 30px; height: 30px; }
  .assistant-creation-workspace .assistant-creation-selection-copy strong { font-size: 12px; }
  .assistant-creation-workspace .assistant-creation-selection-copy small { font-size: 11px; }
  .assistant-creation-workspace .assistant-creation-selection-meta { gap: 9px; }
  .assistant-creation-workspace .assistant-creation-selection-meta > span { font-size: 10px; }
  .assistant-creation-workspace .assistant-creation-selection-meta button { min-height: 30px; padding: 5px 9px; font-size: 11px; }
  .assistant-creation-workspace .assistant-wizard > .assistant-actions { padding-top: 10px; }
  .assistant-creation-workspace .assistant-actions { gap: 8px; }
  .assistant-creation-workspace .assistant-actions button { min-height: 36px; padding: 8px 11px; }
}
