/* ==========================================================================
   AI Bot Widget styles — 桌面悬浮 / 手机端 bottom sheet
   ========================================================================== */
.bot-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 80;
  width: 68px; height: 68px; border-radius: var(--radius-lg); border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--brand), var(--violet)); color: #fff; box-shadow: var(--shadow-lg), 0 10px 30px rgba(61,111,224,.4);
  display: flex; align-items: center; justify-content: center; transition: transform var(--t), box-shadow var(--t-fast);
  animation: botPulse 2.6s ease-in-out infinite;
}
.bot-fab svg { width: 30px; height: 30px; }
.bot-fab:hover { transform: translateY(-3px) scale(1.05); box-shadow: var(--shadow-lg), 0 16px 40px rgba(61,111,224,.5); }
.bot-fab.hidden { transform: scale(0); opacity: 0; pointer-events: none; }
@keyframes botPulse { 0%,100%{box-shadow: var(--shadow-lg), 0 10px 30px rgba(61,111,224,.4), 0 0 0 0 rgba(61,111,224,.35)} 50%{box-shadow: var(--shadow-lg), 0 10px 30px rgba(61,111,224,.4), 0 0 0 12px rgba(61,111,224,0)} }

.bot-panel {
  position: fixed; right: 24px; bottom: 24px; z-index: 85;
  width: 440px; max-width: calc(100vw - 32px); height: 640px; max-height: calc(100dvh - 48px);
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; transform: translateY(16px) scale(.98); pointer-events: none;
  transition: opacity var(--t), transform var(--t);
}
.bot-panel.open { opacity: 1; transform: none; pointer-events: auto; }

.bot-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line); background: var(--bg-tint); }
.bot-title { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: .95rem; }
.bot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.bot-head-actions { display: flex; align-items: center; gap: .4rem; }
.bot-model { font-size: .78rem; padding: .3rem .4rem; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--bg-elev); color: var(--ink-soft); cursor: pointer; }
.bot-x { border: none; background: transparent; color: var(--ink-mute); font-size: 1rem; cursor: pointer; width: 30px; height: 30px; border-radius: var(--radius-sm); }
.bot-x:hover { background: var(--bg-elev); color: var(--ink); }

.bot-body { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .7rem; }
.bot-msg { max-width: 88%; padding: .65rem .85rem; border-radius: var(--radius); font-size: .9rem; line-height: 1.55; word-wrap: break-word; }
.bot-msg.ai { background: var(--bg-tint); color: var(--ink); border-top-left-radius: 3px; align-self: flex-start; }
.bot-msg.user { background: var(--brand); color: #fff; border-top-right-radius: 3px; align-self: flex-end; }
.bot-msg.typing::after { content: "▋"; animation: blink 1s steps(2) infinite; color: var(--brand); }
@keyframes blink { 50% { opacity: 0; } }
.bot-msg code { font-family: var(--font-mono); font-size: .82em; background: rgba(59,110,165,.12); padding: .1em .35em; border-radius: 3px; }
.bot-offline { color: var(--warn); }

.bot-quick { display: flex; flex-wrap: wrap; gap: .4rem; }
.qq { font-size: .8rem; padding: .4rem .65rem; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--bg-elev); color: var(--brand-ink); cursor: pointer; transition: all var(--t-fast); text-decoration: none; }
.qq:hover { border-color: var(--brand); background: var(--brand-soft); }

.bot-foot { border-top: 1px solid var(--line); padding: .65rem .8rem calc(.65rem + env(safe-area-inset-bottom)); background: var(--bg-elev); }
.bot-input-row { display: flex; gap: .5rem; align-items: flex-end; }
.bot-input { flex: 1; resize: none; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: .55rem .7rem; font-family: inherit; font-size: .9rem; background: var(--bg); color: var(--ink); max-height: 120px; line-height: 1.4; }
.bot-input:focus { outline: none; border-color: var(--brand); }
.bot-send { flex-shrink: 0; width: 40px; height: 40px; border: none; border-radius: var(--radius); background: var(--brand); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background var(--t-fast); }
.bot-send:hover { background: var(--brand-ink); }
.bot-disc { font-size: .72rem; color: var(--ink-mute); margin-top: .45rem; text-align: center; }

/* 手机端：接近全屏 bottom sheet */
@media (max-width: 560px) {
  .bot-panel {
    right: 0; left: 0; bottom: 0; width: 100%; max-width: 100%;
    height: 88dvh; max-height: 88dvh; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(100%);
  }
  .bot-panel.open { transform: none; }
  .bot-fab { right: 16px; bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .bot-panel, .bot-fab { transition: none !important; animation: none !important; }
  .bot-msg.typing::after { animation: none; }
}
