@import url("mascot.css");      /* 吉祥物结构与动画：与后台工作台共用一份 */
/* ============================================================
   乐荐网 · AI 小荐挂件样式
   配色与后台一致：主色 #1e6fff，点缀青绿 #1fbf92
   ============================================================ */
#szcs-fab,
#szcs-panel {
  position: fixed;
  right: 24px;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  box-sizing: border-box;
}
#szcs-fab *, #szcs-panel *, #szcs-panel *:before, #szcs-panel *:after { box-sizing: border-box; }

/* ---------- 悬浮入口（A2 形态）：透明底吉祥物 + 常驻小名牌 ----------
   去掉大色块胶囊，让吉祥物自己站在右下角；名牌常驻是为了"一眼看得出这是什么"，
   悬停/键盘聚焦时名牌换成蓝绿渐变并显示「在线咨询」这个动作提示。 */
#szcs-fab {
  bottom: 20px;
  padding: 0; border: 0; background: none; box-shadow: none;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: transform .18s ease;
}
#szcs-fab:hover { transform: none; }          /* 动效交给吉祥物，按钮本身不再整体缩放 */
#szcs-fab .szcs-mascot { width: 62px; }
#szcs-fab .szcs-mascot .ms-svg { width: 62px; height: 81px; }
.szcs-plate {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(255,255,255,.95); border: 1px solid #e3e8ef; color: #1f2329;
  font-size: 12.5px; font-weight: 600; line-height: 1.5; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(18,33,58,.14);
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.szcs-plate-cta { display: none; }
#szcs-fab:hover .szcs-plate,
#szcs-fab:focus-visible .szcs-plate {
  background: linear-gradient(135deg, #1256c4 0%, #0f7a8c 60%, #0b7d66 100%);
  color: #fff; border-color: transparent;
}
#szcs-fab:hover .szcs-plate-name, #szcs-fab:focus-visible .szcs-plate-name { display: none; }
#szcs-fab:hover .szcs-plate-cta,  #szcs-fab:focus-visible .szcs-plate-cta { display: inline; }
#szcs-fab:focus-visible { outline: 2px solid #1256c4; outline-offset: 3px; border-radius: 14px; }
#szcs-fab:hover { transform: scale(1.06); box-shadow: 0 8px 22px rgba(30, 111, 255, .5); }
#szcs-fab .szcs-badge {
  position: absolute; top: -3px; right: 4px;
  min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 10px; background: #ff4d4f; color: #fff;
  font-size: 11px; line-height: 19px; text-align: center;
  border: 2px solid #fff; display: none;
}
#szcs-fab.szcs-has-new .szcs-badge { display: block; }

/* ---------- 气泡里的站内链接 ---------- */
.szcs-link {
  color: #1e6fff; text-decoration: none; border-bottom: 1px dashed rgba(30,111,255,.45);
  word-break: break-all; cursor: pointer;
}
.szcs-link:hover { text-decoration: none; border-bottom-color: #1e6fff; background: rgba(30,111,255,.07); }

/* ---------- 可拖动 / 可缩放 ---------- */
#szcs-fab { touch-action: none; }                 /* 手机上按住图标拖动时不顺手滚页面 */
.szcs-grabbing, .szcs-grabbing * { user-select: none !important; }
.szcs-grabbing #szcs-fab { cursor: grabbing; }
/* 四条边的把手：只显示"与图标相对"的那两条（锚点由 JS 写在面板 class 上） */
#szcs-rz-l, #szcs-rz-t, #szcs-rz-r, #szcs-rz-b {
  position: absolute; z-index: 6; touch-action: none;
  background: transparent; transition: background .15s ease; display: none;
}
#szcs-rz-l, #szcs-rz-r { top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
#szcs-rz-l { left: 0; } #szcs-rz-r { right: 0; }
#szcs-rz-t, #szcs-rz-b { left: 0; right: 0; height: 8px; cursor: ns-resize; }
#szcs-rz-t { top: 0; } #szcs-rz-b { bottom: 0; }
#szcs-rz-l:hover, #szcs-rz-r:hover, #szcs-rz-t:hover, #szcs-rz-b:hover { background: rgba(30,111,255,.16); }
/* 竖把手的"抓手"刻痕 */
#szcs-rz-l:after, #szcs-rz-r:after {
  content: ""; position: absolute; top: 50%; transform: translateY(-50%);
  width: 2px; height: 26px; border-radius: 2px; background: rgba(31,45,61,.18);
}
#szcs-rz-l:after { left: 3px; } #szcs-rz-r:after { right: 3px; }
/* 横把手的刻痕 */
#szcs-rz-t:after, #szcs-rz-b:after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  height: 2px; width: 26px; border-radius: 2px; background: rgba(31,45,61,.18);
}
#szcs-rz-t:after { top: 3px; } #szcs-rz-b:after { bottom: 3px; }
/* ax-r = 右边贴图标（窗口向左长）→ 用左把手；ax-l 反之 */
#szcs-panel.ax-r #szcs-rz-l, #szcs-panel.ax-l #szcs-rz-r,
#szcs-panel.ay-b #szcs-rz-t, #szcs-panel.ay-t #szcs-rz-b { display: block; }
/* 没定锚点前的兜底：按默认（图标在右下）显示左/上 */
#szcs-panel:not(.ax-l):not(.ax-r) #szcs-rz-l,
#szcs-panel:not(.ay-t):not(.ay-b) #szcs-rz-t { display: block; }
/* 手机端面板本来就全屏，把手没必要露出来 */
@media (max-width: 480px) { #szcs-rz-l, #szcs-rz-t, #szcs-rz-r, #szcs-rz-b { display: none !important; } }

/* ---------- 面板 ---------- */
#szcs-panel {
  bottom: 96px;
  /* 业务要求：宽度 +25%（384 -> 480）；窄窗口下不贴边溢出 */
  width: 480px; max-width: calc(100vw - 28px); height: 568px;
  max-height: calc(100vh - 120px);
  background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 14px 44px rgba(18, 33, 58, .22);
  display: none; flex-direction: column;
}
#szcs-panel.szcs-open { display: flex; }

/* ---------- 头部：机器人头像 + 标题 + 最小化/收起 ---------- */
#szcs-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 12px 12px 14px;
  background: linear-gradient(120deg, #1e6fff 0%, #12a6e8 100%);
  color: #fff;
}
#szcs-header .szcs-avatar {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: #1e6fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .14);
}
#szcs-header .szcs-headtext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#szcs-header .szcs-title {
  font-size: 15px; font-weight: 600; letter-spacing: .2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#szcs-header .szcs-sub { font-size: 11px; opacity: .88; display: flex; align-items: center; gap: 5px; }
#szcs-header .szcs-dot { width: 6px; height: 6px; border-radius: 50%; background: #6ef2b6; display: inline-block; }
#szcs-header .szcs-dot.human { background: #ffd54d; }
#szcs-header .szcs-hbtn {
  width: 28px; height: 28px; border: 0; border-radius: 7px; padding: 0;
  background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
#szcs-header .szcs-hbtn:hover { background: rgba(255, 255, 255, .28); }

/* ---------- 提示条 ---------- */
#szcs-notice {
  display: flex; align-items: flex-start; gap: 6px;
  background: #fff7e6; border-bottom: 1px solid #ffe0a8; color: #ad6800;
  font-size: 12px; line-height: 1.55; padding: 9px 10px 9px 12px;
}
#szcs-notice:before { content: "📢"; flex-shrink: 0; }
#szcs-notice .szcs-notice-text { flex: 1; }
#szcs-notice .szcs-notice-close {
  border: 0; background: none; color: #ad6800; opacity: .65;
  cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px;
}
#szcs-notice .szcs-notice-close:hover { opacity: 1; }

/* ---------- 消息区 ---------- */
#szcs-body { flex: 1; overflow-y: auto; padding: 14px 14px 6px; background: #f5f7fb; }
.szcs-msg { display: flex; flex-direction: column; margin-bottom: 14px; max-width: 86%; }
.szcs-msg.bot { align-items: flex-start; }
.szcs-msg.me  { align-items: flex-end; margin-left: auto; }
.szcs-label { font-size: 11px; color: #98a2b3; margin-bottom: 4px; }
.szcs-bubble {
  padding: 9px 12px; font-size: 14px; line-height: 1.62;
  border-radius: 11px; white-space: pre-wrap; word-break: break-word;
}
.szcs-msg.bot .szcs-bubble { background: #fff; color: #1f2329; border-top-left-radius: 4px; box-shadow: 0 1px 3px rgba(18, 33, 58, .08); }
.szcs-msg.me  .szcs-bubble { background: #1e6fff; color: #fff; border-top-right-radius: 4px; }
.szcs-read { font-size: 11px; color: #98a2b3; margin-top: 3px; align-self: flex-end; }
.szcs-sys {
  align-self: center; margin: 2px 0 14px; font-size: 11.5px; color: #8b93a1;
  background: #eaeef5; padding: 3px 10px; border-radius: 10px; text-align: center;
}
.szcs-typing { display: flex; gap: 4px; align-items: center; margin: 0 0 14px; padding: 10px 12px; background: #fff; border-radius: 11px; border-top-left-radius: 4px; width: max-content; box-shadow: 0 1px 3px rgba(18,33,58,.08); }
.szcs-typing span { width: 6px; height: 6px; border-radius: 50%; background: #b6c0cf; animation: szcs-blink 1.2s infinite; }
.szcs-typing span:nth-child(2) { animation-delay: .2s; }
.szcs-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes szcs-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ---------- 快捷问句 ---------- */
#szcs-quicks {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px 8px 12px; border-top: 1px solid #eef1f6; background: #fff;
}
#szcs-quicks[hidden] { display: none; }
.szcs-quicks-list { display: flex; gap: 6px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.szcs-quicks-list::-webkit-scrollbar { display: none; }
.szcs-chip {
  flex-shrink: 0; border: 1px solid #bcd3ff; background: #f5f9ff; color: #1e6fff;
  font-size: 12.5px; padding: 5px 11px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.szcs-chip:hover { background: #e8f1ff; border-color: #1e6fff; }
.szcs-quicks-x { border: 0; background: none; color: #b0b8c4; font-size: 16px; line-height: 1; cursor: pointer; padding: 0 4px; }
.szcs-quicks-x:hover { color: #6b7684; }

/* ---------- 电话留资 ---------- */

/* ---------- 输入区 ---------- */
#szcs-inputbar { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid #eef1f6; background: #fff; }
#szcs-input {
  flex: 1; border: 1px solid #dfe4ec; border-radius: 10px; padding: 8px 11px;
  font-size: 14px; line-height: 1.5; outline: none; resize: none; max-height: 84px;
  font-family: inherit; color: #1f2329; background: #f7f9fc;
}
#szcs-input:focus { border-color: #1e6fff; background: #fff; }
#szcs-send {
  height: 36px; padding: 0 18px; border: 0; border-radius: 10px;
  background: #1e6fff; color: #fff; font-size: 14px; cursor: pointer; flex-shrink: 0;
}
#szcs-send:hover { background: #0f57d9; }
#szcs-send:disabled { background: #9ab8ff; cursor: not-allowed; }

/* ---------- 小屏 ---------- */
@media (max-width: 480px) {
  #szcs-panel { right: 0; bottom: 0; width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  #szcs-fab { right: 14px; bottom: 12px; }
  #szcs-fab .szcs-mascot, #szcs-fab .szcs-mascot .ms-svg { width: 46px; }
  #szcs-fab .szcs-mascot .ms-svg { height: 60px; }
  .szcs-plate { font-size: 11.5px; padding: 2px 8px; }
}

/* ---------- 顶部常驻提示语 ---------- */
#szcs-greet {
  padding: 10px 14px;
  font-size: 12.5px; line-height: 1.6; color: #33445c;
  background: linear-gradient(180deg, #f2f7ff 0%, #f7fbff 100%);
  border-bottom: 1px solid #e6eefb;
}
#szcs-greet[hidden] { display: none; }
#szcs-header .szcs-title { font-size: 15px; }