.ai-assistant { --ai-blue: #1762b4; --ai-ink: #213750; --ai-muted: #64778b; font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif; color: var(--ai-ink); position: fixed; right: 24px; bottom: 28px; z-index: 10010; }
.ai-assistant *, .ai-assistant *::before, .ai-assistant *::after { box-sizing: border-box; }
.ai-assistant [hidden] { display: none !important; }
.ai-assistant button, .ai-assistant textarea { font: inherit; }
.ai-assistant button { cursor: pointer; border: 0; }
.ai-assistant button:focus-visible, .ai-assistant a:focus-visible, .ai-assistant textarea:focus-visible { outline: 3px solid #69a7ed; outline-offset: 3px; }
.ai-assistant button:disabled { opacity: .5; cursor: default; }
.ai-launcher { background: var(--ai-blue); color: #fff; display: flex; align-items: center; gap: 10px; padding: 13px 20px; border-radius: 28px; box-shadow: 0 6px 24px #185eaa38; }
.ai-panel { position: absolute; right: 0; bottom: 66px; width: 420px; height: min(720px, calc(100dvh - 126px)); min-height: 300px; display: flex; flex-direction: column; background: #fff; border: 1px solid #dbe4ef; border-radius: 18px; overflow: hidden; box-shadow: 0 16px 64px #223c5c30; }
.ai-header { background: var(--ai-blue); color: white; padding: 9px 12px 9px 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0; }
.ai-header strong { font-size: 18px; font-weight: 600; }
.ai-header-tools { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.ai-header-tools button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; color: #fff; background: transparent; border-radius: 7px; }
.ai-header-tools button:hover { background: #ffffff22; }
.ai-header-tools .ai-close { font-size: 25px; line-height: 1; }
.ai-entry-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 10px 12px; border-bottom: 1px solid #e8edf3; flex-shrink: 0; background: #fff; }
.ai-entry-actions .ai-entry { color: var(--ai-ink); background: #f2f6fc; border: 1px solid #e4ecf7; border-radius: 7px; min-height: 36px; padding: 6px 2px; font-size: 12px; line-height: 1.4; }
.ai-entry-actions .ai-entry:hover, .ai-entry-actions .ai-entry[aria-pressed="true"] { color: #1156a1; border-color: #8db9e9; background: #e6f0fd; }
.ai-contact { background: #eef5fd; padding: 12px; border-radius: 8px; text-align: center; }
.ai-contact p { margin: 4px 0; font-size: 12px; }
.ai-contact img { width: 132px; height: 132px; object-fit: contain; margin: 8px auto 0; display: block; }
.ai-assistant a { color: var(--ai-blue); text-decoration: none; }
.ai-assistant a:hover { text-decoration: underline; }
.ai-messages { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; background: #f5f7fa; padding: 20px 16px; }
.ai-welcome { background: #fff; border: 1px solid #e3eaf2; padding: 18px; border-radius: 12px; }
.ai-welcome h3 { font-size: 16px; margin: 0 0 6px; }
.ai-welcome p { color: var(--ai-muted); margin: 0 0 14px; }
.ai-entry-guidance { margin-bottom: 2px; }
.ai-prompts { display: flex; flex-direction: column; gap: 8px; }
.ai-prompts button { background: #f2f6fc; color: var(--ai-blue); text-align: left; border-radius: 7px; padding: 8px 11px; }
.ai-turn { margin-bottom: 18px; }
.ai-turn-label { color: var(--ai-muted); font-size: 11px; margin-bottom: 5px; }
.ai-turn-user { display: flex; flex-direction: column; align-items: flex-end; }
.ai-bubble { white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 10px; padding: 12px 14px; background: #fff; border: 1px solid #e3eaf2; max-width: 100%; }
.ai-turn-user .ai-bubble { background: #e5effd; border-color: #dce8fa; max-width: 90%; }
.ai-assistant .ai-retry { margin-top: 6px; min-height: 40px; padding: 6px 12px; border: 1px solid #bdd5f2; border-radius: 7px; background: #fff; color: var(--ai-blue); }
.ai-assistant .ai-retry:hover:not(:disabled) { background: #edf4fd; }
.ai-result-card { border: 1px solid #dde5ef; border-radius: 10px; background: #fff; padding: 14px; margin-top: 9px; }
.ai-card-top { display: flex; align-items: flex-start; gap: 8px; }
.ai-position { flex-shrink: 0; min-width: 23px; text-align: center; color: var(--ai-blue); background: #edf4fd; border-radius: 5px; font-size: 12px; padding: 1px 4px; }
.ai-result-card h4 { margin: 0; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.ai-card-status { display: inline-block; color: #536d87; font-size: 11px; margin: 8px 0 0; }
.ai-facts { margin: 8px 0 0; font-size: 12px; }
.ai-facts > div { display: flex; gap: 9px; margin-top: 4px; }
.ai-facts dt { color: var(--ai-muted); min-width: 3em; flex-shrink: 0; font-weight: normal; }
.ai-facts dd { margin: 0; overflow-wrap: anywhere; }
.ai-card-reason { color: #64778b; font-size: 12px; margin: 7px 0 0; }
.ai-card-link { font-size: 12px; display: inline-block; margin-top: 10px; }
.ai-questions { padding: 10px 13px 10px 28px; margin: 8px 0 0; background: #eef4fd; border-radius: 8px; }
.ai-comparison { overflow-x: auto; margin-top: 10px; }
.ai-comparison table { border-collapse: collapse; background: white; font-size: 12px; min-width: 100%; }
.ai-comparison th, .ai-comparison td { border: 1px solid #dbe4ef; padding: 8px; min-width: 100px; text-align: left; vertical-align: top; }
.ai-comparison th { background: #edf3fa; font-weight: 500; }
.ai-comparison-note { color: var(--ai-muted); font-size: 12px; margin: 6px 0; }
.ai-notice { padding: 9px 18px; font-size: 12px; color: #806122; background: #fff9e9; flex-shrink: 0; }
.ai-composer { display: flex; align-items: flex-end; gap: 10px; background: #fff; padding: 10px 12px; border-top: 1px solid #e4eaf2; flex-shrink: 0; }
.ai-composer textarea { display: block; flex: 1; min-width: 0; width: auto; resize: none; padding: 7px 9px; border: 1px solid #dce6f1; border-radius: 8px; color: var(--ai-ink); background: #fff; line-height: 1.5; }
.ai-composer textarea::placeholder { color: #8292a4; }
.ai-send { flex: 0 0 74px; min-height: 40px; padding: 7px 8px; background: var(--ai-blue); color: #fff; border-radius: 7px; white-space: nowrap; }
.ai-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 520px) {
    .ai-assistant { right: 14px; bottom: 18px; }
    .ai-panel { position: fixed; left: 10px; right: 10px; top: max(12px, env(safe-area-inset-top)); bottom: calc(12px + env(safe-area-inset-bottom)); width: auto; height: auto; min-height: 0; }
    .ai-launcher { padding: 11px 16px; }
    .ai-assistant:has(.ai-panel:not([hidden])) .ai-launcher { visibility: hidden; }
}
@media (max-width: 360px) {
    .ai-entry-actions { gap: 4px; padding-left: 8px; padding-right: 8px; }
}
