/* 忆锦记AI助手 · 网页 AI 客服浮窗 */
#cs-widget-btn {
  position: fixed; right: 16px; bottom: 64px; z-index: 13000;
  width: 52px; height: 52px; border-radius: 14px;
  background: #2B59FF; color: #fff; border: none; cursor: pointer;
  box-shadow: 0 4px 14px rgba(43, 89, 255, .35);
  font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease, box-shadow .15s ease;
  padding: 0;
}
#cs-widget-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(43, 89, 255, .45); }
#cs-widget-btn:active { transform: scale(.96); }
#cs-widget-btn.cs-hidden { display: none; }

#cs-widget-panel {
  position: fixed; right: 16px; bottom: 128px; z-index: 13001;
  width: 320px; max-width: 84vw;
  max-height: calc(100vh - 120px);
  background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .16);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  transform: translateY(12px) scale(.98); opacity: 0; pointer-events: none;
  transition: transform .18s ease, opacity .18s ease;
  display: flex; flex-direction: column;
}
#cs-widget-panel.cs-open { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }

#cs-head {
  background: #2B59FF; color: #fff; padding: 11px 14px;
  display: flex; align-items: center; justify-content: space-between;
}
#cs-head .cs-title { font-size: 14px; font-weight: 700; }
#cs-head .cs-sub { font-size: 11.5px; opacity: .85; margin-top: 2px; }
#cs-head .cs-close { background: rgba(255,255,255,.22); border: none; color: #fff; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 15px; line-height: 1; }

#cs-body { flex: 1; overflow-y: auto; padding: 14px; background: #f8fafc; }
.cs-msg { margin-bottom: 12px; display: flex; }
.cs-msg .cs-bubble {
  max-width: 80%; padding: 9px 12px; border-radius: 12px; font-size: 14px;
  line-height: 1.55; white-space: pre-wrap; word-break: break-word;
}
.cs-msg.cs-user { justify-content: flex-end; }
.cs-msg.cs-user .cs-bubble { background: #2B59FF; color: #fff; border-bottom-right-radius: 4px; }
.cs-msg.cs-bot { justify-content: flex-start; }
.cs-msg.cs-bot .cs-bubble { background: #fff; color: #1e293b; border: 1px solid #e2e8f0; border-bottom-left-radius: 4px; }
.cs-typing span { display: inline-block; width: 6px; height: 6px; margin: 0 1px; background: #cbd5e1; border-radius: 50%; animation: csblink 1.2s infinite both; }
.cs-typing span:nth-child(2) { animation-delay: .2s; }
.cs-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes csblink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

#cs-foot { border-top: 1px solid #eef0f4; padding: 10px; background: #fff; display: flex; gap: 8px; }
#cs-input {
  flex: 1; border: 1px solid #e2e8f0; border-radius: 10px; padding: 9px 12px;
  font-size: 14px; outline: none; resize: none; font-family: inherit; max-height: 80px;
}
#cs-input:focus { border-color: #2B59FF; }
#cs-send {
  background: #2B59FF; color: #fff; border: none; border-radius: 10px;
  padding: 0 16px; font-size: 14px; cursor: pointer; font-weight: 600;
}
#cs-send:disabled { opacity: .5; cursor: default; }
.cs-foot-tip { font-size: 11px; color: #94a3b8; text-align: center; padding: 0 10px 6px; background: #fff; }
