/* ── 左下角哈吉蜂助手（2026-11-12 WREN）────────────────────────────────────
   动画吉祥物直接贴屏幕左下角：没有圆形容器、外边框、白底和阴影。
   点它弹出一枚单条消息气泡（带尾巴），不是聊天记录面板。 */
.sq-dock {
  position: fixed;
  left: 12px;
  bottom: 16px;   /* 与底栏底边同一条线（body.paper .spectate-bar bottom:16px） */
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
/* 3D 视图不显示吉祥物（引擎切 3D 时会给 <html> 加 .m3d-on） */
html.m3d-on .sq-dock { display: none !important; }

.sq-btn {
  width: auto;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  line-height: 0;
  cursor: pointer;
  flex: 0 0 auto;
  transition: transform .18s ease;
}
.sq-pet {
  display: block;
  width: 108px;
  height: auto;
  pointer-events: none;
}
.sq-btn:hover { transform: translateY(-2px); }
.sq-btn:active { transform: scale(.97); }
.sq-btn:focus-visible { outline: 2px solid rgba(0, 113, 227, .55); outline-offset: 2px; }

/* ── 单条消息气泡（不是对话记录面板）────────────────────────────────────── */
.sq-pop {
  position: relative;
  margin-left: 4px;
  width: min(300px, calc(100vw - 40px));
  padding: 11px 13px 10px;
  background: #fff;
  color: #1d1d1f;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18), 0 0 0 1px rgba(0, 0, 0, .04);
  font: 400 12.5px/1.6 'Microsoft YaHei UI', 'PingFang SC', system-ui, sans-serif;
  overflow-wrap: break-word;
  opacity: 0;
  transform: translateY(8px) scale(.94);
  transform-origin: 26px calc(100% + 8px);
  transition: opacity .16s ease, transform .24s cubic-bezier(.22, 1, .36, 1);
  pointer-events: none;
  will-change: opacity, transform;
}
.sq-pop[hidden] { display: none; }
.sq-pop.show { opacity: 1; transform: none; pointer-events: auto; }
/* 主动气泡：只有一句话，没有快捷问题 */
.sq-pop.active { width: min(260px, calc(100vw - 40px)); }
.sq-pop.active .sq-chips { display: none; }
/* 小尾巴指向吉祥物 */
.sq-pop::after {
  content: '';
  position: absolute;
  left: 18px;
  bottom: -6px;
  width: 13px;
  height: 13px;
  background: #fff;
  border-radius: 2px;
  transform: rotate(45deg);
  box-shadow: 2px 2px 4px rgba(0, 0, 0, .05);
}
.sq-text { min-height: 20px; }
/* 密码：大号等宽 + 字距，和正文明显区分 */
.sq-code {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(0, 113, 227, .10);
  color: #0071e3;
  font: 800 16px/1.35 ui-monospace, Consolas, monospace;
  letter-spacing: .18em;
  vertical-align: 1px;
}
.sq-fade .sq-text { animation: sqIn .22s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes sqIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* 打开时问题胶囊依次浮入 */
.sq-pop .sq-chip { opacity: 0; }
.sq-pop.show .sq-chip { animation: sqChipIn .3s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes sqChipIn { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }

/* 点问题 / 打开时吉祥物的小反应 */
.sq-btn.sq-nudge { animation: sqNudge .32s cubic-bezier(.22, 1, .36, 1); }
@keyframes sqNudge { 0% { transform: none; } 35% { transform: translateY(-3px) scale(1.03); } 100% { transform: none; } }

.sq-typing { display: inline-flex; align-items: center; gap: 3px; padding: 4px 0; }
.sq-typing i {
  width: 5px; height: 5px; border-radius: 50%;
  background: #b0b0b6;
  animation: sqDot 1.05s infinite ease-in-out;
}
.sq-typing i:nth-child(2) { animation-delay: .15s; }
.sq-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes sqDot { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

.sq-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid rgba(0, 0, 0, .07);
}
.sq-chip {
  border: 1px solid rgba(0, 0, 0, .10);
  background: #f5f5f7;
  color: #3a3a3c;
  border-radius: 999px;
  padding: 5px 9px;
  font: 500 11px/1 'Microsoft YaHei UI', 'PingFang SC', system-ui, sans-serif;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.sq-chip:hover:not(:disabled) { background: #e8f0fe; border-color: #0071e3; color: #0071e3; }
.sq-chip.on { background: #0071e3; border-color: #0071e3; color: #fff; }
.sq-chip:disabled { opacity: .5; cursor: default; }

/* 深色主题 */
html[data-theme="dark"] .sq-pop {
  background: #1f2024;
  color: #f5f5f7;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .07);
}
html[data-theme="dark"] .sq-pop::after { background: #1f2024; }
html[data-theme="dark"] .sq-code { background: rgba(10, 132, 255, .16); color: #6cb6ff; }
html[data-theme="dark"] .sq-typing i { background: #8e8e93; }
html[data-theme="dark"] .sq-chips { border-top-color: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .sq-chip { background: #2a2b30; color: #e6e7ea; border-color: rgba(255, 255, 255, .12); }
html[data-theme="dark"] .sq-chip:hover:not(:disabled) { background: #252a33; border-color: #0a84ff; color: #6cb6ff; }
html[data-theme="dark"] .sq-chip.on { background: #0a84ff; border-color: #0a84ff; color: #fff; }

/* 减少动效偏好：只保留内容切换，不做位移/缩放 */
@media (prefers-reduced-motion: reduce) {
  .sq-pop, .sq-pop.show, .sq-btn, .sq-btn.sq-nudge, .sq-fade .sq-text,
  .sq-pop.show .sq-chip { animation: none !important; transition: none !important; }
  .sq-pop.show { opacity: 1; transform: none; }
  .sq-pop.show .sq-chip { opacity: 1; }
}

/* 手机 / 窄屏 */
@media (max-width: 900px) {
  .sq-dock { left: 0; bottom: 0; }   /* 手机底栏贴屏幕底：吉祥物底边和它同一线 */
  .sq-pet { width: 96px; }
  .sq-pop { margin-left: 6px; width: min(300px, calc(100vw - 18px)); }
}
