/* ============================================================
   投资+AI大脑 · AI 抽屉样式（跟随工具深色主题）
   ============================================================ */
#ai-fab{
  position:fixed; right:20px; bottom:22px; z-index:900;
  display:flex; align-items:center; gap:8px;
  padding:11px 18px; border:none; border-radius:999px; cursor:pointer;
  color:#06111f; font-size:14px; font-weight:700; letter-spacing:.3px;
  background:linear-gradient(135deg,#6ee7ff 0%,#4093ff 100%);
  box-shadow:0 10px 30px -10px rgba(64,147,255,.8), 0 0 0 1px rgba(110,231,255,.35) inset;
  transition:transform .18s ease, box-shadow .18s ease;
}
#ai-fab:hover{transform:translateY(-2px); box-shadow:0 14px 36px -10px rgba(64,147,255,.95)}
#ai-fab .dot{width:7px;height:7px;border-radius:50%;background:#0b7a4b;box-shadow:0 0 0 3px rgba(11,122,75,.25)}
#ai-fab.busy .dot{background:#b45309;animation:ai-pulse 1s infinite}
@keyframes ai-pulse{0%,100%{opacity:1}50%{opacity:.25}}

#ai-drawer{
  position:fixed; top:0; right:0; height:100vh; width:440px; max-width:100vw; z-index:901;
  display:flex; flex-direction:column;
  background:linear-gradient(180deg,#0d1424 0%,#0a1120 100%);
  border-left:1px solid var(--line2,#2d3f63);
  box-shadow:-20px 0 60px -30px rgba(0,0,0,.9);
  transform:translateX(102%); transition:transform .26s cubic-bezier(.2,.7,.2,1);
}
#ai-drawer.on{transform:translateX(0)}
#ai-drawer .ai-h{
  display:flex; align-items:center; gap:9px; padding:13px 15px;
  border-bottom:1px solid var(--line,#22304e); background:#111a2c;
}
#ai-drawer .ai-h b{font-size:14px}
#ai-drawer .ai-h .tag{
  font-size:10px; font-weight:700; padding:2px 7px; border-radius:999px;
  color:#ffd9a8; background:rgba(246,196,69,.14); border:1px solid rgba(246,196,69,.4);
}
#ai-drawer .ai-h .mdl{font-size:10px;color:#5d7099;font-family:ui-monospace,Consolas,monospace}
#ai-drawer .ai-h .x{
  margin-left:auto; background:transparent; border:1px solid var(--line2,#2d3f63); color:#8ba0c4;
  width:26px; height:26px; border-radius:7px; cursor:pointer; font-size:13px; line-height:1;
}
#ai-msgs{
  flex:1; overflow-y:auto; padding:14px; display:flex; flex-direction:column; gap:11px;
  scroll-behavior:smooth;
}
.ai-m{max-width:88%; padding:10px 12px; border-radius:12px; font-size:13px; line-height:1.65;
  white-space:pre-wrap; word-break:break-word;}
.ai-m.user{align-self:flex-end; background:linear-gradient(135deg,#1d4ed8,#2563eb); color:#eaf3ff;
  border-bottom-right-radius:4px;}
.ai-m.ai{align-self:flex-start; background:#16223a; color:#dbe6f7; border:1px solid var(--line,#22304e);
  border-bottom-left-radius:4px;}
.ai-m.sys{align-self:center; background:transparent; color:#5d7099; font-size:11.5px; text-align:center;}
.ai-m .who{display:block; font-size:10px; color:#7f97bd; margin-bottom:4px; letter-spacing:.4px;}
.ai-chips{display:flex; flex-wrap:wrap; gap:7px; padding:0 14px 10px}
.ai-chips button{
  font-size:11.5px; padding:6px 11px; border-radius:999px; cursor:pointer;
  background:#16223a; color:#a8bfe0; border:1px solid var(--line2,#2d3f63);
}
.ai-chips button:hover{background:#1c2b47; color:#dbe6f7; border-color:#4093ff}
#ai-in{display:flex; gap:8px; padding:11px 13px; border-top:1px solid var(--line,#22304e); background:#0e1626}
#ai-txt{
  flex:1; resize:none; min-height:42px; max-height:140px; padding:10px 12px; font-size:13px;
  color:#e8eefb; background:#111a2c; border:1px solid var(--line2,#2d3f63); border-radius:10px;
  font-family:inherit; line-height:1.5;
}
#ai-txt:focus{outline:none; border-color:#4093ff; box-shadow:0 0 0 3px rgba(64,147,255,.15)}
#ai-send{
  padding:0 16px; border:none; border-radius:10px; cursor:pointer; font-weight:700; font-size:13px;
  color:#06111f; background:linear-gradient(135deg,#6ee7ff,#4093ff);
}
#ai-send:disabled{opacity:.5; cursor:not-allowed}
.ai-card{
  align-self:flex-start; width:100%; background:#101b2e; border:1px solid rgba(246,196,69,.35);
  border-radius:12px; padding:12px; font-size:12.5px;
}
.ai-card h4{font-size:13px; color:#ffd9a8; margin-bottom:7px}
.ai-card .row{display:flex; gap:8px; margin-bottom:6px; color:#a8bfe0}
.ai-card .row b{color:#dbe6f7; font-weight:600}
.ai-card ul{margin:4px 0 0 16px; color:#a8bfe0}
.ai-card ul li{margin:2px 0}
.ai-card .ops{display:flex; gap:8px; margin-top:9px}
.ai-card .ops button{
  font-size:11.5px; padding:5px 10px; border-radius:7px; cursor:pointer;
  background:#16223a; border:1px solid var(--line2,#2d3f63); color:#a8bfe0;
}
.ai-card .ops button:hover{color:#dbe6f7; border-color:#4093ff}
.ai-card .pri{font-size:10px; font-weight:700; padding:1px 6px; border-radius:5px; margin-left:6px}
.ai-card .pri.P0{background:rgba(242,69,92,.16); color:#ff8497; border:1px solid rgba(242,69,92,.45)}
.ai-card .pri.P1{background:rgba(245,165,36,.14); color:#f5c06b; border:1px solid rgba(245,165,36,.4)}
.ai-card .pri.P2{background:rgba(64,147,255,.14); color:#8db8ff; border:1px solid rgba(64,147,255,.4)}
.ai-typing i{display:inline-block; width:5px; height:5px; margin-right:3px; border-radius:50%;
  background:#5d7099; animation:ai-bounce 1s infinite}
.ai-typing i:nth-child(2){animation-delay:.15s}
.ai-typing i:nth-child(3){animation-delay:.3s}
@keyframes ai-bounce{0%,80%,100%{transform:translateY(0);opacity:.4}40%{transform:translateY(-4px);opacity:1}}
@media (max-width:520px){
  #ai-drawer{width:100vw}
  #ai-fab{right:12px; bottom:14px; padding:10px 15px; font-size:13px}
}
