/* ============================================================
   店小二聊天抽屉（前台首页 / 工具详情共用）
   - >720px：右侧停靠面板，页面主体让出等宽空间，左边缘可拖拽调宽；
     不加遮罩、不锁背景滚动 —— 聊天开着时左侧照常浏览
   - <=720px：整屏，键盘弹起时用 dvh 自适应
   - 颜色沿用 style.css 的设计令牌，不引入新主色
   ============================================================ */

body.cx-chat-open { overflow: hidden; }

.cx-chat-root {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  justify-content: flex-end;
  visibility: hidden;
  transition: visibility 0s linear 0.32s;
}
.cx-chat-root.is-open {
  visibility: visible;
  transition-delay: 0s;
}

/* 停靠模式：根容器铺满视口只为给面板定位，不能替面板吞掉左侧页面的点击 */
@media (min-width: 721px) {
  body.cx-chat-open {
    overflow: visible;
    padding-right: var(--cx-dock-w, 0px);
  }
  .cx-chat-root { pointer-events: none; }
  .cx-chat-panel { pointer-events: auto; }
  .cx-chat-mask { display: none; }
}

/* 详情浮层是覆盖在聊天上的模态：停靠形态下 body 本来是 overflow: visible，
   这里必须把页面滚动收掉，否则遮罩上的滚轮会滚到背后的正文。 */
body.cx-det-open { overflow: hidden; }

.cx-chat-mask {
  position: absolute;
  inset: 0;
  background: rgba(19, 26, 43, 0.22);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
  -webkit-backdrop-filter: blur(1.5px);
  backdrop-filter: blur(1.5px);
}
.cx-chat-root.is-open .cx-chat-mask { opacity: 1; }

.cx-chat-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: var(--cx-chat-w, 420px);
  height: 100%;
  background: #fff;
  box-shadow: -12px 0 40px -22px rgba(19, 26, 43, 0.45);
  transform: translateX(36px);
  opacity: 0.65;
  outline: none;
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.25, 1), opacity 0.24s ease;
}
.cx-chat-root.is-open .cx-chat-panel {
  transform: none;
  opacity: 1;
}
/* 拖宽时只改 --cx-chat-w，位移/淡入动画会让面板跟着晃，拖期间整条过渡关掉 */
.cx-chat-root.is-resizing .cx-chat-panel { transition: none; }

/* ---------- 左边缘拖拽把手 ---------- */
.cx-chat-resize {
  display: none;
  position: absolute;
  left: -5px; top: 0; bottom: 0;
  width: 10px;
  z-index: 3;
  padding: 0; border: 0; background: none;
  cursor: col-resize;
  touch-action: none;          /* 手机上别让浏览器把手势当成页面滚动/侧滑返回 */
}
.cx-chat-resize::after {
  content: '';
  position: absolute;
  left: 4px; top: 0; bottom: 0;
  width: 2px;
  background: var(--color-border-strong, #d9dcec);
  transition: background var(--duration-fast) var(--ease-out), width var(--duration-fast) var(--ease-out);
}
.cx-chat-resize:hover::after,
.cx-chat-resize.is-dragging::after,
.cx-chat-resize:focus-visible::after {
  background: var(--color-primary);
  width: 3px;
}
.cx-chat-resize:focus-visible { outline: none; }
@media (min-width: 721px) { .cx-chat-resize { display: block; } }

/* ---------- 头部 ---------- */
.cx-chat-head {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--color-border);
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(99, 102, 241, 0.12), transparent 58%),
    radial-gradient(100% 150% at 100% 0%, rgba(6, 182, 212, 0.1), transparent 60%),
    #fbfbff;
}
.cx-chat-id {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.cx-chat-avatar {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 32% 26%, #fde68a, #fbbf24 56%, #f59e0b);
  box-shadow: 0 7px 18px -9px rgba(245, 158, 11, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.cx-chat-avatar svg { width: 38px; height: 38px; transform: translateY(3px); }

.cx-chat-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--color-text);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.cx-chat-online {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}
.cx-chat-sub {
  margin: 2px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--color-text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cx-chat-head-ops {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}
.cx-chat-iconbtn {
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--color-text-3);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.cx-chat-iconbtn:hover {
  color: var(--color-primary);
  border-color: var(--color-border);
  background: rgba(255, 255, 255, 0.9);
}
.cx-chat-iconbtn svg { width: 17px; height: 17px; }

/* ---------- 对话区 ---------- */
.cx-chat-log {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 16px 22px;
  background:
    radial-gradient(110% 46% at 100% 0%, rgba(99, 102, 241, 0.06), transparent 62%),
    radial-gradient(90% 40% at 0% 100%, rgba(6, 182, 212, 0.045), transparent 60%),
    #fbfbfe;
  scrollbar-width: thin;
  scrollbar-color: #d9dcec transparent;
}
.cx-chat-log::-webkit-scrollbar { width: 6px; }
.cx-chat-log::-webkit-scrollbar-thumb { background: #d9dcec; border-radius: 99px; }

.cx-chat-day {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 14px;
  font-size: 10.5px;
  color: var(--color-text-3);
}
.cx-chat-day::before,
.cx-chat-day::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
}

.cx-msg {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 14px;
  animation: cxMsgIn 0.24s var(--ease-out);
}
.cx-msg.is-user {
  flex-direction: row-reverse;
  justify-content: flex-start;
}
.cx-msg-ava {
  flex: none;
  width: 28px;
  height: 28px;
  margin-top: 2px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 34% 28%, #fde68a, #fbbf24 60%, #f59e0b);
  box-shadow: 0 4px 10px -6px rgba(245, 158, 11, 0.8);
  font-size: 14px;
  line-height: 1;
}
.cx-msg-ava svg { width: 25px; height: 25px; transform: translateY(2px); }
.cx-msg.is-user .cx-msg-ava {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 4px 12px -7px rgba(79, 70, 229, 0.9);
}

.cx-msg-main {
  min-width: 0;
  max-width: 86%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}
.cx-msg.is-user .cx-msg-main { align-items: flex-end; }

.cx-bubble {
  position: relative;
  max-width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px 14px 14px 14px;
  background: #fff;
  color: var(--color-text);
  font-size: 13.5px;
  line-height: 1.72;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  box-shadow: var(--shadow-xs);
}
.cx-msg.is-user .cx-bubble {
  border: none;
  border-radius: 14px 4px 14px 14px;
  background: linear-gradient(135deg, var(--color-primary), #5b58ea 55%, #4f46e5);
  color: #fff;
  box-shadow: 0 6px 16px -12px rgba(79, 70, 229, 0.85);
}
.cx-msg.is-streaming .cx-bubble::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 0.95em;
  margin-left: 2px;
  vertical-align: -2px;
  border-radius: 1px;
  background: var(--color-primary);
  animation: cxCaret 1s steps(2, start) infinite;
}
@keyframes cxCaret { 50% { opacity: 0; } }
@keyframes cxMsgIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

/* 气泡里被识别出来的工具名：样式上与普通正文区分开，但别喧宾夺主 */
.cx-tlink {
  color: var(--color-primary-dark);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(79, 70, 229, 0.35);
  text-underline-offset: 2px;
  border-radius: 3px;
  cursor: pointer;
}
.cx-tlink:hover { text-decoration-color: currentColor; background: #eef0ff; }
.cx-tlink:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 1px; }

/* 打字中的三个点 */
.cx-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 16px;
  padding: 0 2px;
}
.cx-typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #a5b4fc;
  animation: cxTyping 1.15s infinite ease-in-out;
}
.cx-typing i:nth-child(2) { animation-delay: 0.15s; }
.cx-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes cxTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-3px); opacity: 1; }
}

/* ---------- 思考过程面板（仅 AI 模式，默认展开，可点标题折叠） ---------- */
.cx-think {
  width: 100%;
  border: 1px solid #e6e8f4;
  border-radius: 12px;
  background: linear-gradient(180deg, #f6f7ff, #fbfbff);
  overflow: hidden;
  animation: cxMsgIn 0.24s var(--ease-out);
}
.cx-think-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  background: transparent;
  color: var(--color-text-3);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.cx-think-ico {
  flex: none;
  display: inline-flex;
  width: 15px;
  height: 15px;
  color: var(--color-primary);
}
.cx-think-ico svg { width: 15px; height: 15px; }
.cx-think.is-active .cx-think-ico { animation: cxThinkPulse 1.5s ease-in-out infinite; }
.cx-think-title { letter-spacing: 0.01em; }
.cx-think.is-active .cx-think-title::after {
  content: '';
  animation: cxDots 1.3s steps(1, end) infinite;
}
.cx-think-chev {
  flex: none;
  margin-left: auto;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  color: var(--color-text-3);
}
.cx-think-chev::before {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform var(--duration-fast) var(--ease-out);
}
.cx-think.is-collapsed .cx-think-chev::before { transform: rotate(-135deg) translate(-1px, -1px); }
.cx-think-body {
  max-height: 260px;
  padding: 0 11px 9px;
  overflow: hidden;
  opacity: 1;
  transition: max-height 0.28s var(--ease-out), padding 0.28s var(--ease-out), opacity 0.2s ease;
}
.cx-think.is-collapsed .cx-think-body {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
}
.cx-think-line {
  margin: 0;
  padding: 3px 0;
  font-size: 11.5px;
  line-height: 1.62;
  color: var(--color-text-3);
  white-space: pre-wrap;
  word-break: break-word;
  animation: cxThinkLine 0.3s var(--ease-out);
}
.cx-think-line + .cx-think-line { border-top: 1px dashed #eceef8; }
@keyframes cxThinkPulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
@keyframes cxThinkLine { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }
@keyframes cxDots {
  0% { content: ''; } 25% { content: '·'; } 50% { content: '··'; } 75% { content: '···'; } 100% { content: ''; }
}

/* 系统提示（额度用尽 / 网络异常 / 已停止） */
.cx-sys {
  display: flex;
  justify-content: center;
  margin: 2px 0 14px;
}
.cx-sys span {
  max-width: 92%;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(19, 26, 43, 0.055);
  color: var(--color-text-3);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}
.cx-sys.is-err span {
  color: #b91c1c;
  background: #fef2f2;
}

/* ---------- 推荐卡 ---------- */
.cx-recs {
  display: grid;
  gap: 7px;
  width: 100%;
  margin-top: 1px;
}
.cx-recs-label {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 2px 1px;
  font-size: 10.5px;
  color: var(--color-text-3);
}
.cx-recs-label svg { width: 12px; height: 12px; color: var(--color-warning); }

.cx-rec {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}
.cx-rec:hover {
  border-color: #c7c9f5;
  box-shadow: 0 10px 22px -18px rgba(79, 70, 229, 0.7);
  transform: translateY(-1px);
}
.cx-rec-cover,
.cx-rec-ph {
  flex: none;
  width: 50px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--color-bg-mute);
}
.cx-rec-ph {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, hsl(var(--cx-h, 230) 65% 58%), hsl(var(--cx-h, 230) 72% 70%));
}
.cx-rec-body { min-width: 0; flex: 1; }
.cx-rec-name {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cx-rec-sum {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--color-text-3);
}
.cx-rec-cat {
  display: inline-block;
  margin-right: 4px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: rgba(79, 70, 229, 0.08);
  color: var(--color-primary);
  font-size: 10px;
  line-height: 1.6;
  vertical-align: 1px;
}
.cx-rec-arrow {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--color-text-3);
  font-size: 13px;
  transition: all var(--duration-fast) var(--ease-out);
}
.cx-rec:hover .cx-rec-arrow { color: var(--color-primary); background: rgba(79, 70, 229, 0.08); }

/* ---------- 开场白与快捷问法 ---------- */
.cx-chat-intro { margin-bottom: 12px; }
.cx-chat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 4px 37px;
}
.cx-chat-chip {
  padding: 5px 10px;
  border: 1px solid #dfe2f1;
  border-radius: var(--radius-full);
  background: #fff;
  color: var(--color-text-2);
  font-size: 11.5px;
  line-height: 1.5;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.cx-chat-chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: #f6f6ff;
}

/* ---------- 底部输入区 ---------- */
.cx-chat-foot {
  flex: none;
  padding: 9px 16px calc(11px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--color-border);
  background: #fff;
}
/* 今日额度行按需求已下线（内部限额信息不对外展示），样式一并移除；
   真撞每日限额时服务端会在对话里给出提示，见 chat.js loadStatus 的 catch 注释 */

.cx-chat-inputwrap {
  display: flex;
  align-items: center;   /* 单行时文字与发送键垂直居中；多行时随内容撑高也居中 */
  gap: 7px;
  padding: 7px 7px 7px 12px;
  border: 1.5px solid var(--color-border-strong);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}
.cx-chat-inputwrap:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.cx-chat-input {
  flex: 1;
  min-width: 0;
  min-height: 24px;
  max-height: 132px;
  padding: 3px 0;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--color-text);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  display: block;
}
.cx-chat-input::placeholder { color: #a3aabb; }
.cx-chat-input:disabled { cursor: not-allowed; }

.cx-chat-send {
  flex: none;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  box-shadow: 0 6px 14px -8px rgba(79, 70, 229, 0.95);
}
.cx-chat-send svg { width: 17px; height: 17px; }
.cx-chat-send:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
.cx-chat-send:active:not(:disabled) { transform: scale(0.95); }
.cx-chat-send:disabled {
  background: var(--color-bg-mute);
  color: var(--color-text-3);
  box-shadow: none;
  cursor: default;
}
.cx-chat-send.is-stop {
  background: #fee2e2;
  color: #b91c1c;
  box-shadow: none;
}
.cx-chat-send.is-stop:hover { background: #fecaca; }

.cx-chat-tip {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 5px 4px 0;
  font-size: 10px;
  line-height: 1.5;
  color: #a3aabb;
}
.cx-chat-tip .cx-chat-count.is-near { color: #b45309; }
.cx-chat-disc {
  margin: 5px 0 0;
  text-align: center;
  font-size: 10px;
  line-height: 1.5;
  color: #b0b6c6;
}

.cx-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 聊天内商品详情浮层 ---------- */
/* 叠在聊天抽屉里（root 自身是定位上下文），宽度按视口放开，手机整屏 */
.cx-det {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  /* 停靠模式下 .cx-chat-root 是 pointer-events: none，浮层必须自己收回点击/滚轮事件 */
  pointer-events: auto;
}
.cx-det[hidden] { display: none; }
.cx-det-mask { position: absolute; inset: 0; background: rgba(15, 18, 35, 0.45); }
.cx-det-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(880px, 100%);
  max-height: 100%;
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: cxDetIn 0.24s var(--ease-out);
}
@keyframes cxDetIn {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: none; }
}
.cx-det-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--color-border);
}
.cx-det-name {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 650;
  color: var(--color-text);
}
.cx-det-ops { flex: none; margin-left: auto; display: flex; align-items: center; gap: 6px; }
.cx-det-jump {
  padding: 4px 9px;
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--color-text-3);
  text-decoration: none;
}
.cx-det-jump:hover { color: var(--color-primary-dark); background: #f3f4f8; }
.cx-det-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: var(--radius-full);
  background: #f3f4f8;
  color: var(--color-text-3);
  cursor: pointer;
}
.cx-det-close:hover { color: var(--color-text); }
.cx-det-close:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.cx-det-close svg { width: 15px; height: 15px; }

.cx-det-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 18px 22px;
  -webkit-overflow-scrolling: touch;
}
.cx-det-loading { padding: 40px 0; text-align: center; font-size: 13px; color: var(--color-text-3); }

.cx-det-hero { display: flex; gap: 16px; align-items: flex-start; }
.cx-det-cover {
  flex: none;
  width: 132px;
  height: 132px;
  /* 必须contain：封面是宽幅拼接图，cover 会把上下裁掉只见中间一条（用户反馈过）。
     留白由背景色兜底，点封面可开灯箱看完整大图。 */
  object-fit: contain;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: linear-gradient(135deg, #f3f4fb 0%, #eef1f8 100%);
}
.cx-det-cover[data-zoom] { cursor: zoom-in; }
.cx-det-cover.is-empty {
  display: grid;
  place-items: center;
  border: none;
  color: #fff;
  font-size: 34px;
  font-weight: 700;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}
.cx-det-meta { min-width: 0; }
.cx-det-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.cx-det-tag {
  margin: 8px 0 6px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--color-text-2);
}
.cx-det-row {
  display: flex;
  gap: 10px;
  font-size: 12px;
  line-height: 1.9;
  color: var(--color-text-3);
}
.cx-det-row b { font-weight: 600; color: var(--color-text-2); }
.cx-det-get { margin-top: 10px; }
.cx-det-note { margin: 6px 0 0; font-size: 11.5px; color: var(--color-text-3); }

.cx-det-sec { margin-top: 20px; }
.cx-det-sec > h4 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 9px;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--color-text);
}
.cx-det-sec > h4::before {
  content: '';
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: var(--color-primary);
}
.cx-det-body .panel { padding: 12px 14px; }

/* 浮层开着时锁住背后的对话列表，滚轮不会带着聊天一起走 */
.cx-chat-root.has-det .cx-chat-log { overflow: hidden; }

/* ---------- 移动端：整屏 ---------- */
@media (max-width: 720px) {
  .cx-chat-root { display: block; }
  .cx-chat-panel {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    box-shadow: none;
    transform: translateY(18px);
    opacity: 0.8;
  }
  .cx-chat-root.is-open .cx-chat-panel { transform: none; opacity: 1; }
  .cx-chat-head {
    padding-top: calc(13px + env(safe-area-inset-top));
    padding-left: 14px;
    padding-right: 12px;
  }
  .cx-chat-log { padding: 13px 13px 18px; }
  .cx-msg-main { max-width: 88%; }
  .cx-bubble { font-size: 14px; }
  .cx-chat-quick { margin-left: 37px; }
  .cx-chat-foot { padding-left: 13px; padding-right: 13px; }
  .cx-chat-input { font-size: 16px; }
  /* 键盘快捷键说明是桌面物理键盘的事，手机软键盘上没有 Enter/Shift 组合，藏掉（字数计数保留） */
  .cx-chat-kbd { display: none; }
  .cx-rec-cover, .cx-rec-ph { width: 46px; height: 46px; }

  /* 详情浮层手机整屏：不留遮罩边，头部让开刘海 */
  .cx-det { padding: 0; }
  .cx-det-card { width: 100%; height: 100%; max-height: none; border-radius: 0; }
  .cx-det-head { padding-top: calc(11px + env(safe-area-inset-top)); }
  .cx-det-hero { flex-direction: column; gap: 12px; }
  .cx-det-cover { width: 100%; height: 170px; object-fit: contain; }
}

@media (prefers-reduced-motion: reduce) {
  .cx-chat-root,
  .cx-chat-mask,
  .cx-chat-panel,
  .cx-msg { transition: none !important; animation: none !important; }
  .cx-msg.is-streaming .cx-bubble::after { animation: none; }
  .cx-think,
  .cx-think-line,
  .cx-think.is-active .cx-think-ico,
  .cx-think.is-active .cx-think-title::after { animation: none !important; }
  .cx-think-body { transition: none; }
  .cx-det-card { animation: none; }
}

/* ---------- 迷你吉祥物（聊天头像）：与首页店小二同一套动作体系 ----------
   keyframes 全部复用 style.css「12c 吉祥物表情动作」（mascotBob/Breathe/Blink/WaveHi/Hop/CheerL/R/
   MouthPop/LookL/R/Once/Twice/armSwayL/R）；chat.css 只在 index/tool 两页加载，两页必带 style.css。
   SVG 坐标按 viewBox 等比缩放，首页同款幅度在小尺寸下天然成立，无需另做迷你关键帧。 */

.cx-chat-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.cm-svg {
  display: block;
  animation: mascotBob 3.2s ease-in-out infinite;
}

.cm-body {
  transform-box: fill-box;
  transform-origin: center;
  animation: mascotBreathe 3.8s ease-in-out infinite;
}

/* 眼睛：无 JS 排程时跑基础定时眨眼；消息行错峰，让每个小二不同步 */
.cm-eyes {
  transform-box: fill-box;
  transform-origin: center;
  animation: mascotBlink 4.4s ease-in-out infinite;
}
.cx-msg:nth-child(2n) .cm-eyes { animation-delay: -1.6s; }
.cx-msg:nth-child(2n+1) .cm-eyes { animation-delay: -2.9s; }

/* JS 排程（attach）接管后关掉基础眨眼，改由 mascot-motion.js 随机触发 */
.cx-mascot-mini.motion-on .cm-eyes { animation: none; }

.cm-arm { transform-box: fill-box; }
.cm-arm-l { transform-origin: 100% 50%; animation: armSwayL 3.6s ease-in-out infinite; }
.cm-arm-r { transform-origin: 0% 50%; animation: armSwayR 3.6s ease-in-out -1.8s infinite; }

.cm-pupils {
  transform-box: fill-box;
  transform-origin: center;
}
.cm-mouth { transition: opacity 0.12s linear; }
.cm-mouth-o {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

/* 手势动作（mascot-motion.js 在根上加 is-* class）：放在 motion-on 规则之后，
   等特异性下靠源序赢基础循环的层叠——与 style.css 12c 的排布同理 */
.cx-mascot-mini.is-blink .cm-eyes { animation: mascotBlinkOnce 0.38s ease-in-out; }
.cx-mascot-mini.is-blink2 .cm-eyes { animation: mascotBlinkTwice 0.76s ease-in-out; }
.cx-mascot-mini.is-look-l .cm-pupils { animation: mascotLookL 1.5s ease-in-out; }
.cx-mascot-mini.is-look-r .cm-pupils { animation: mascotLookR 1.5s ease-in-out; }
.cx-mascot-mini.is-wave .cm-arm-r { animation: mascotWaveHi 1.1s ease-in-out; }
.cx-mascot-mini.is-hop .cm-svg { animation: mascotHop 0.62s cubic-bezier(0.34, 1.56, 0.64, 1); }
.cx-mascot-mini.is-cheer .cm-arm-l { animation: mascotCheerL 0.95s ease-in-out; }
.cx-mascot-mini.is-cheer .cm-arm-r { animation: mascotCheerR 0.95s ease-in-out; }
.cx-mascot-mini.is-cheer .cm-svg { animation: mascotHop 0.62s cubic-bezier(0.34, 1.56, 0.64, 1) 0.14s; }
.cx-mascot-mini.is-cheer .cm-mouth-o {
  opacity: 1;
  animation: mascotMouthPop 0.42s var(--ease-out) 0.12s;
}
.cx-mascot-mini.is-cheer .cm-mouth { opacity: 0; }

/* reduced-motion：排程模块本身会整体空转（is-* 不会加上来），这里按 style.css 同款
   兜底把迷你版的基础循环与手势一并静默 */
@media (prefers-reduced-motion: reduce) {
  .cm-svg, .cm-body, .cm-eyes, .cm-arm-l, .cm-arm-r { animation: none !important; }
  .cx-mascot-mini.is-blink .cm-eyes,
  .cx-mascot-mini.is-blink2 .cm-eyes,
  .cx-mascot-mini.is-look-l .cm-pupils,
  .cx-mascot-mini.is-look-r .cm-pupils,
  .cx-mascot-mini.is-wave .cm-arm-r,
  .cx-mascot-mini.is-hop .cm-svg,
  .cx-mascot-mini.is-cheer .cm-arm-l,
  .cx-mascot-mini.is-cheer .cm-arm-r,
  .cx-mascot-mini.is-cheer .cm-svg,
  .cx-mascot-mini.is-cheer .cm-mouth-o { animation: none; }
  .cx-mascot-mini.is-cheer .cm-mouth { opacity: 1; }
  .cx-mascot-mini.is-cheer .cm-mouth-o { opacity: 0; }
  .cm-mouth { transition: none; }
}
