/* AI 命理解读：手机端自适应弹层 */
.ai-fab { position:fixed; right:14px; bottom:176px; z-index:9990; display:flex; flex-direction:column; align-items:center; justify-content:center; width:52px; height:52px; border-radius:50%; background:linear-gradient(145deg,#9E3328,#7C211A); color:#fff; text-decoration:none; box-shadow:0 6px 18px rgba(110,30,22,.35); font-size:10px; line-height:1.1; }
.ai-fab-ico { font-size:15px; font-weight:700; letter-spacing:.5px; margin-bottom:2px; }
.ai-mask { position:fixed; left:0; top:0; right:0; bottom:0; z-index:99998; display:none; align-items:center; justify-content:center; background:rgba(0,0,0,.58); padding:14px; box-sizing:border-box; }
.ai-dialog { width:min(92vw,480px); max-height:88vh; display:flex; flex-direction:column; background:#FFFDF8; border-radius:16px; overflow:hidden; box-shadow:0 16px 40px rgba(0,0,0,.28); box-sizing:border-box; }
.ai-dialog, .ai-dialog * { box-sizing:border-box; }
.ai-head { display:flex; align-items:flex-start; justify-content:space-between; padding:16px 16px 12px; border-bottom:1px solid #EFE1CC; background:#FFF9F0; }
.ai-head b { display:block; font-size:17px; color:#3E2C1C; }
.ai-sub { display:block; font-size:11px; color:#A08B70; margin-top:3px; }
.ai-close { border:0; background:transparent; color:#8A735B; font-size:26px; line-height:1; padding:0 4px; }
.ai-body { flex:1 1 auto; min-height:0; padding:14px 16px calc(16px + env(safe-area-inset-bottom)); overflow-y:auto; overflow-x:hidden; -webkit-overflow-scrolling:touch; }
.ai-cost-line { font-size:12px; color:#8A6A45; background:#FFF3DC; border:1px solid #EAD1A8; border-radius:9px; padding:8px 10px; line-height:1.6; }
.ai-cost-line b { color:#8E2F26; }
.ai-chips { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0 8px; }
.ai-chips a { font-size:12px; color:#7A4A32; border:1px solid #E1C8AA; background:#FFF8EC; border-radius:14px; padding:5px 12px; text-decoration:none; }
.ai-chips a:active { background:#F7E6CE; }
#ai-question { width:100%; box-sizing:border-box; min-height:64px; max-height:120px; resize:vertical; border:1px solid #E4D4BE; border-radius:10px; background:#fff; padding:10px; font-size:13px; line-height:1.6; color:#3E2C1C; }
.ai-submit { width:100%; margin-top:10px; border:0; border-radius:22px; background:#8E2F26; color:#fff; padding:10px 0; font-size:15px; }
.ai-submit:disabled { opacity:.6; }
.ai-loading { display:none; text-align:center; color:#A08B70; font-size:12px; padding:14px 0; }
.ai-composer-toggle { width:100%; margin:12px 0 0; border:1px solid #D8BC98; border-radius:20px; background:#FFF8EC; color:#7A4A32; padding:9px 0; font-size:13px; }
.ai-answer { display:none; margin-top:12px; }
.ai-turn { max-width:100%; background:#fff; border:1px solid #EADCC6; border-radius:10px; padding:10px 12px; margin-bottom:10px; }
.ai-turn:last-child { margin-bottom:0; }
.ai-q { max-width:100%; font-size:12px; color:#8A5A36; background:#FFF3DC; border-radius:8px; padding:6px 9px; line-height:1.55; margin-bottom:8px; overflow-wrap:anywhere; word-break:break-word; }
.ai-a { max-width:100%; white-space:pre-wrap; overflow-wrap:anywhere; word-break:break-word; font-size:13px; line-height:1.85; color:#3E2C1C; }
.ai-turn-error .ai-a { color:#8E2F26; }
.ai-disclaimer { font-size:11px; color:#8A735B; background:#FFF8EC; border:1px dashed #DCC4A2; border-radius:8px; padding:8px 10px; line-height:1.65; margin-top:10px; }
.ai-note { font-size:10px; color:#A08B70; line-height:1.7; margin-top:10px; }
@media (max-width:640px) {
  .ai-fab { right:10px; bottom:168px; width:50px; height:50px; }
  .ai-dialog { width:100%; max-width:480px; max-height:92vh; }
  .ai-head { padding:14px 14px 10px; }
  .ai-body { padding:12px 14px calc(14px + env(safe-area-inset-bottom)); }
}
@media (max-width:360px) {
  .ai-dialog { width:96vw; }

}
