/* 健康 AI 助手 */
#health-ai-fab{position:fixed;right:22px;bottom:26px;z-index:1200;display:flex;align-items:center;gap:8px;padding:12px 20px;border:none;border-radius:999px;background:linear-gradient(135deg,#2f6bff,#7a4dff);color:#fff;font-size:14px;font-weight:600;cursor:pointer;box-shadow:0 10px 28px rgba(58,86,255,.35);transition:transform .18s ease,box-shadow .18s ease}
#health-ai-fab:hover{transform:translateY(-2px);box-shadow:0 14px 34px rgba(58,86,255,.45)}
#health-ai-fab .hai-fab-icon{font-size:16px}
#health-ai-fab.hidden,#health-ai-fab.offscreen{display:none}
#health-ai-panel{position:fixed;top:14px;right:14px;bottom:14px;width:min(430px,calc(100vw - 28px));z-index:1300;display:flex;flex-direction:column;background:#fff;border:1px solid #e5e9f2;border-radius:16px;box-shadow:0 24px 64px rgba(24,39,75,.22);transform:translateX(calc(100% + 24px));transition:transform .24s ease}
#health-ai-panel.open{transform:translateX(0)}
#health-ai-panel.offscreen{visibility:hidden;pointer-events:none}
.hai-head{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid #edf0f7;background:linear-gradient(135deg,#f4f7ff,#faf6ff);border-radius:16px 16px 0 0}
.hai-head-title{display:flex;align-items:center;gap:10px}
.hai-head-title b{display:block;font-size:15px;color:#1c2b4a}
.hai-logo{width:34px;height:34px;border-radius:10px;background:linear-gradient(135deg,#2f6bff,#7a4dff);color:#fff;display:flex;align-items:center;justify-content:center;font-size:16px}
.hai-badge{display:inline-block;margin-top:2px;padding:1px 8px;border-radius:999px;background:#e8efff;color:#2f5bd6;font-size:11px}
.hai-close{border:none;background:transparent;color:#8593ad;font-size:15px;cursor:pointer;padding:6px}
.hai-close:hover{color:#33456e}
.hai-toolbar{padding:10px 16px 4px}
.hai-analyze{width:100%;padding:10px 12px;border:none;border-radius:10px;background:linear-gradient(135deg,#2f6bff,#7a4dff);color:#fff;font-size:13.5px;font-weight:600;cursor:pointer;transition:opacity .15s}
.hai-analyze:hover{opacity:.92}
.hai-analyze:disabled{opacity:.55;cursor:default}
.hai-messages{flex:1;overflow-y:auto;padding:14px 16px;display:flex;flex-direction:column;gap:10px}
.hai-empty{text-align:center;color:#7c8aa5;font-size:13px;margin-top:36px;line-height:1.9}
.hai-empty-icon{font-size:30px;color:#a7b6d8;margin-bottom:6px}
.hai-msg{display:flex}
.hai-msg.user{justify-content:flex-end}
.hai-bubble{max-width:86%;padding:9px 12px;border-radius:12px;font-size:13.5px;line-height:1.75;color:#25334f;word-break:break-word}
.hai-msg.user .hai-bubble{background:#2f6bff;color:#fff;border-bottom-right-radius:4px}
.hai-msg.assistant .hai-bubble{background:#f2f5fb;border-bottom-left-radius:4px}
.hai-msg.error .hai-bubble{background:#fff2f2;color:#a33}
.hai-bubble .hai-h{display:block;margin:6px 0 2px;color:#1c2b4a}
.hai-bubble .hai-li{display:block;padding-left:4px}
.hai-bubble .hai-hint{font-size:12px;color:#98a4bd}
.hai-caret{display:inline-block;width:7px;height:14px;margin-left:2px;background:#2f6bff;vertical-align:-2px;animation:hai-blink 1s steps(2) infinite}
@keyframes hai-blink{50%{opacity:0}}
.hai-chips{display:flex;flex-wrap:wrap;gap:8px;padding:0 16px 10px}
.hai-chips-label{font-size:12px;color:#8b98b3;width:100%}
.hai-chip{padding:6px 12px;border:1px solid #d8e0f0;border-radius:999px;background:#fafbff;color:#3a4c74;font-size:12.5px;cursor:pointer;transition:all .15s}
.hai-chip:hover{border-color:#2f6bff;color:#2f6bff;background:#f2f6ff}
.hai-foot{display:flex;gap:8px;padding:10px 16px 14px;border-top:1px solid #edf0f7}
#hai-input{flex:1;resize:none;border:1px solid #d8e0f0;border-radius:10px;padding:9px 12px;font-size:13.5px;line-height:1.5;font-family:inherit;max-height:110px;outline:none}
#hai-input:focus{border-color:#2f6bff}
.hai-send{padding:0 18px;border:none;border-radius:10px;background:#2f6bff;color:#fff;font-size:13.5px;cursor:pointer}
.hai-send:disabled{background:#9db1e8;cursor:default}
.health-ai-topbtn{padding:6px 14px;border:none;border-radius:999px;background:linear-gradient(135deg,#2f6bff,#7a4dff);color:#fff;font-size:13px;font-weight:600;cursor:pointer;margin-right:8px}
.health-ai-topbtn:hover{opacity:.92}
@media (max-width:640px){#health-ai-fab .hai-fab-text{display:none}#health-ai-fab{padding:14px}}