/* AI 助手设置页（#assistantView）：消息发送、主动派发、帮我批准审查模型与自定义规则。 */
#assistantView .asst-form fieldset { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 16px; }
#assistantView .asst-panel { padding: 20px 22px; border: 1px solid var(--hui-border); border-radius: 14px; background: var(--hui-surface); box-shadow: var(--hui-panel-shadow); }
#assistantView .asst-panel-head h2 { margin: 0; color: var(--hui-text); font: 600 15px/1.4 var(--hui-sans); }
#assistantView .asst-panel-head p { margin: 4px 0 0; color: var(--hui-secondary); font-size: 13px; line-height: 1.6; }
#assistantView .asst-rows { margin-top: 12px; }
#assistantView .asst-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px 0; border-top: 1px solid var(--hui-border-soft); cursor: pointer; }
#assistantView .asst-switch-row:first-child { border-top: 0; }
#assistantView .asst-switch-row > input { flex: none; }
#assistantView .asst-switch-row > select,
#assistantView .asst-switch-row > .hui-select-trigger { flex: none; width: 140px; }
#assistantView .asst-switch-row > select { flex: none; width: 140px; }
#assistantView .asst-switch-row b { display: block; color: var(--hui-text); font-size: 13px; font-weight: 500; }
#assistantView .asst-switch-row small { display: block; margin-top: 3px; color: var(--hui-tertiary); font-size: 12px; line-height: 1.6; }
#assistantView .asst-review-block { display: grid; gap: 14px; margin-top: 14px; }
#assistantView .asst-review-sub { display: grid; gap: 12px; padding: 14px 16px; border: 1px solid var(--hui-border-soft); border-radius: 10px; background: var(--hui-canvas); }
#assistantView .asst-review-sub[hidden],
#assistantView .asst-custom-wrap[hidden],
#assistantView .asst-picker-menu[hidden],
#assistantView .asst-probe-panel[hidden] { display: none; }
#assistantView .asst-review-sub-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
#assistantView .asst-review-meta { color: var(--hui-tertiary); font-size: 12px; line-height: 1.4; }
#assistantView .asst-review-sub-actions { display: inline-flex; align-items: center; gap: 12px; }
#assistantView .asst-review-empty-cli { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
#assistantView .asst-review-note { margin: 0; color: var(--hui-secondary); font-size: 12.5px; line-height: 1.6; }
#assistantView .asst-model-grid { display: grid; grid-template-columns: minmax(210px, 1fr) minmax(260px, 1.4fr); gap: 12px; }
#assistantView .asst-api-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
#assistantView .asst-field { display: grid; gap: 6px; min-width: 0; }
#assistantView .asst-field > span,
#assistantView .asst-field-head label { color: var(--hui-secondary); font-size: 12px; font-weight: 500; }
#assistantView .asst-field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#assistantView .asst-key-clear,
#assistantView .asst-link-btn { padding: 0; border: 0; background: none; color: var(--hui-accent); font: 500 12px/1.2 var(--hui-sans); cursor: pointer; }
#assistantView .asst-key-clear { color: var(--hui-tertiary); }
#assistantView .asst-key-clear:hover,
#assistantView .asst-key-clear[data-clear-state="1"],
#assistantView .asst-link-btn:hover { color: var(--hui-accent); text-decoration: underline; }
#assistantView .asst-link-btn:disabled { opacity: .5; cursor: not-allowed; text-decoration: none; }
#assistantView .asst-select,
#assistantView .asst-model-input { width: 100%; height: 36px; box-sizing: border-box; padding: 0 10px; border: 1px solid var(--hui-border-strong); border-radius: 8px; background-color: var(--hui-surface); color: var(--hui-text); font: 400 13px/1.4 var(--hui-sans); }
#assistantView .asst-select { -webkit-appearance: none; appearance: none; }
#assistantView .asst-model-input:focus { outline: 0; border-color: var(--hui-accent); box-shadow: 0 0 0 3px var(--hui-accent-soft); }
#assistantView .hui-select-trigger { display: flex; align-items: center; width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--hui-border-strong); border-radius: 8px; background: var(--hui-surface); color: var(--hui-text); font: 400 13px/1 var(--hui-sans); }
#assistantView .hui-select-trigger.is-filtered { border-color: var(--hui-border-strong); background: var(--hui-surface); color: var(--hui-text); }
#assistantView .hui-select-trigger:hover { border-color: color-mix(in srgb, var(--hui-accent) 30%, var(--hui-border-strong)); }
#assistantView .hui-select-trigger[aria-expanded="true"],
#assistantView .hui-select-trigger:focus-visible { outline: 0; border-color: var(--hui-accent); box-shadow: 0 0 0 3px var(--hui-accent-soft); }

/* Homepage-style live CLI & Model pickers */
#assistantView .asst-picker-anchor { position: relative; min-width: 0; }
#assistantView .asst-picker-trigger { display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--hui-border-strong); border-radius: 8px; background: var(--hui-surface); color: var(--hui-text); font: 400 13px/1 var(--hui-sans); text-align: left; cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease; }
#assistantView .asst-picker-trigger:hover { border-color: color-mix(in srgb, var(--hui-accent) 35%, var(--hui-border-strong)); }
#assistantView .asst-picker-trigger[aria-expanded="true"],
#assistantView .asst-picker-trigger:focus-visible { outline: 0; border-color: var(--hui-accent); box-shadow: 0 0 0 3px var(--hui-accent-soft); }
#assistantView .asst-picker-trigger-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
#assistantView .asst-picker-trigger-label.is-placeholder { color: var(--hui-tertiary); font-weight: 400; }
#assistantView .asst-picker-trigger-meta { flex: none; color: var(--hui-tertiary); font-size: 11.5px; }
#assistantView .asst-picker-chevron { flex: none; color: var(--hui-tertiary); transition: transform .18s var(--hui-ease-flow); }
#assistantView .asst-picker-trigger[aria-expanded="true"] .asst-picker-chevron { transform: rotate(180deg); }
#assistantView .asst-cli-icon { width: 18px; height: 18px; border-radius: 5px; flex: none; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; background: var(--hui-canvas); }
#assistantView .asst-cli-icon img { width: 16px; height: 16px; display: block; object-fit: contain; }
#assistantView .asst-cli-icon.is-letter { background: var(--hui-border-strong); color: var(--hui-text); font-size: 10px; font-weight: 700; }
#assistantView .asst-picker-menu { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40; display: flex; flex-direction: column; max-height: 320px; padding: 6px; border: 1px solid var(--hui-border); border-radius: 12px; background: var(--hui-surface); box-shadow: 0 12px 32px color-mix(in srgb, var(--hui-text) 14%, transparent); overflow: hidden; }
#assistantView .asst-picker-search-wrap { flex: none; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; margin-bottom: 4px; border: 1px solid var(--hui-border); border-radius: 8px; background: var(--hui-canvas); color: var(--hui-tertiary); }
#assistantView .asst-picker-search { width: 100%; min-width: 0; height: 100%; border: 0; padding: 0; background: transparent; color: var(--hui-text); font: 400 12.5px/1 var(--hui-sans); outline: 0; box-shadow: none; }
#assistantView .asst-picker-search:focus { box-shadow: none; }
#assistantView .asst-picker-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
#assistantView .asst-picker-foot { flex: none; margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--hui-border-soft); }
#assistantView .asst-picker-option { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 9px; border: 0; border-radius: 8px; background: transparent; color: var(--hui-text); font: 400 13px/1.3 var(--hui-sans); text-align: left; cursor: pointer; }
#assistantView .asst-picker-option[hidden] { display: none; }
#assistantView .asst-picker-option:hover,
#assistantView .asst-picker-option:focus-visible { background: var(--hui-canvas); outline: 0; }
#assistantView .asst-picker-option.is-selected { background: var(--hui-accent-soft); }
#assistantView .asst-picker-copy { flex: 1 1 auto; min-width: 0; display: grid; gap: 1px; }
#assistantView .asst-picker-copy strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#assistantView .asst-picker-copy small { color: var(--hui-tertiary); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#assistantView .asst-picker-check { flex: none; color: var(--hui-accent); }
#assistantView .asst-picker-empty { margin: 0; padding: 12px 8px; color: var(--hui-tertiary); font-size: 12px; text-align: center; }

/* Custom API live model probe panel */
#assistantView .asst-probe-panel { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--hui-border); border-radius: 10px; background: var(--hui-surface); }
#assistantView .asst-probe-status { margin: 0; color: var(--hui-secondary); font-size: 12.5px; }
#assistantView .asst-probe-error { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
#assistantView .asst-probe-error p { margin: 0; color: var(--hui-error, #dc2626); font-size: 12.5px; }
#assistantView .asst-probe-error-actions { display: inline-flex; align-items: center; gap: 12px; }
#assistantView .asst-probe-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#assistantView .asst-probe-search { flex: 1 1 180px; margin-bottom: 0; height: 32px; }
#assistantView .asst-probe-count { color: var(--hui-tertiary); font-size: 12px; white-space: nowrap; }
#assistantView .asst-probe-list { max-height: 220px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px; }
#assistantView .asst-probe-option { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--hui-text); font: 400 12.5px/1.3 var(--hui-sans); text-align: left; cursor: pointer; min-width: 0; }
#assistantView .asst-probe-option[hidden] { display: none; }
#assistantView .asst-probe-option:hover { background: var(--hui-canvas); border-color: var(--hui-border); }
#assistantView .asst-probe-option.is-selected { background: var(--hui-accent-soft); border-color: color-mix(in srgb, var(--hui-accent) 35%, transparent); }
#assistantView .asst-probe-copy { flex: 1 1 auto; min-width: 0; display: grid; gap: 1px; }
#assistantView .asst-probe-copy code { font: 500 12px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#assistantView .asst-probe-copy small { color: var(--hui-tertiary); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#assistantView .asst-rules-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#assistantView .asst-rules { display: block; box-sizing: border-box; width: 100%; min-height: 160px; margin-top: 14px; padding: 10px 12px; resize: vertical; font: 13px/1.6 var(--hui-sans); }
#assistantView .asst-rules-foot { display: flex; justify-content: flex-end; margin-top: 6px; }
#assistantView .asst-count { color: var(--hui-tertiary); font-size: 12px; font-variant-numeric: tabular-nums; }
#assistantView .asst-actions { display: flex; justify-content: flex-end; }
#assistantView .asst-empty { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--hui-secondary); font-size: 13px; }
#assistantView .asst-empty p { margin: 0; }
@media (max-width: 640px) {
  #assistantView .asst-panel { padding: 16px; }
  #assistantView .asst-switch-row { gap: 16px; }
  #assistantView .asst-switch-row:has(select) { align-items: flex-start; flex-direction: column; }
  #assistantView .asst-model-grid,
  #assistantView .asst-api-grid { grid-template-columns: 1fr; }
}
