/* AI 問答頁 */
.ai-chat-layout { display: flex; gap: 1rem; align-items: flex-start; }
.ai-chat-side { flex: 0 0 280px; }
.ai-chat-main { flex: 1 1 auto; min-width: 0; }
.ai-chat-messages { max-height: 60vh; overflow-y: auto; padding: 0.5rem; background: var(--ho-bg); border-radius: 12px; }
.ai-chat-turn { margin-bottom: 1rem; }
.ai-chat-question { background: linear-gradient(135deg, #6366f1, #4f46e5); color: #fff; border-radius: 14px 14px 4px 14px; margin-left: 15%; padding: 0.6rem 0.9rem; margin-bottom: 0.4rem; white-space: pre-wrap; }
.ai-chat-answer { background: #fff; border: 1px solid var(--ho-line); border-radius: 14px 14px 14px 4px; margin-right: 8%; box-shadow: var(--ho-shadow); padding: 0.7rem 0.9rem; }
.ai-chat-answer-text { white-space: pre-wrap; word-break: break-word; }
.ai-chat-meta { font-size: 0.8rem; color: #6c757d; margin-bottom: 0.4rem; }
.ai-chat-meta .badge { margin-right: 0.25rem; }
.ai-chat-citations { margin-top: 0.6rem; border-top: 1px dashed var(--ho-line); padding-top: 0.5rem; }
.ai-chat-citation { font-size: 0.85rem; margin-bottom: 0.35rem; }
.ai-chat-citation .ai-chat-excerpt { color: #495057; display: block; margin-left: 1.4rem; }
.ai-chat-unresolved { margin-top: 0.5rem; font-size: 0.85rem; color: #856404; background: #fff3cd; border-radius: 0.25rem; padding: 0.4rem 0.6rem; }
.ai-chat-error { margin-top: 0.5rem; font-size: 0.9rem; color: #721c24; background: #f8d7da; border-radius: 0.25rem; padding: 0.4rem 0.6rem; }
.ai-chat-cursor::after { content: "▍"; animation: ai-chat-blink 1s step-end infinite; }
@keyframes ai-chat-blink { 50% { opacity: 0; } }
.ai-chat-guided .btn { margin: 0 0.25rem 0.4rem 0; white-space: normal; text-align: left; }
.ai-chat-sessions .list-group-item { padding: 0.5rem 0.75rem; font-size: 0.9rem; }
.ai-chat-sessions .list-group-item.active a { color: #fff; }
.ai-chat-scope-note { font-size: 0.8rem; color: #6c757d; }
@media (max-width: 991px) { .ai-chat-layout { flex-direction: column; } .ai-chat-side { flex-basis: auto; width: 100%; } }
/* 浮動 AI 問答入口（右下角按鈕與 modal） */
.ai-fab { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1035; display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.65rem 1rem; border: 0; border-radius: 2rem; background: linear-gradient(135deg, #6366f1, #0ea5e9); color: #fff; font-size: 0.95rem; font-weight: 600; box-shadow: 0 10px 24px rgba(79, 70, 229, 0.35); cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.ai-fab:hover, .ai-fab:focus { background: linear-gradient(135deg, #4f46e5, #0284c7); color: #fff; transform: translateY(-2px); box-shadow: 0 14px 30px rgba(79, 70, 229, 0.45); outline: 0; }
.ai-fab i { font-size: 1.2rem; }
.ai-fab-modal .modal-body { display: flex; flex-direction: column; }
.ai-fab-modal .ai-fab-messages { max-height: 50vh; min-height: 12rem; }
.ai-fab-modal .modal-title small { font-size: 0.75rem; }
@media (max-width: 575px) { .ai-fab .ai-fab-label { display: none; } .ai-fab { padding: 0.75rem; border-radius: 50%; } }
/* 淺色主題（2026-10-16）：導引問題改膠囊樣式 */
.ai-chat-guided .btn { border-radius: 999px; background: var(--ho-primary-soft); border: 1px solid var(--ho-primary-line); color: var(--ho-primary); font-size: 0.85rem; }
.ai-chat-guided .btn:hover { background: #e0e7ff; color: var(--ho-primary-hover); }
