/* =========================================================
   玖壹小助理 · 全局 AI 助手样式
   风格：专业 SaaS / 轻量商务 / 降低 AI 味
   ========================================================= */

.ai-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--brand-200);
  border-radius: var(--r-full);
  background: #fff;
  color: var(--brand-700);
  font-size: 13px;
  cursor: pointer;
  transition: all .18s;
  margin-right: 8px;
}
.ai-nav-btn:hover {
  background: var(--brand-50);
  border-color: var(--brand-400);
  box-shadow: 0 2px 8px rgba(31,111,178,.12);
}
.ai-nav-btn svg { width: 16px; height: 16px; }

/* 右下角入口 */
.ai-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--brand-700);
  border: 1px solid var(--brand-200);
  box-shadow: 0 6px 20px rgba(31,111,178,.16);
  cursor: pointer;
  z-index: 999;
  transition: all .2s;
  font-size: 13px;
  font-weight: 500;
}
.ai-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(31,111,178,.22);
  border-color: var(--brand-400);
}
.ai-fab.hidden { display: none; }
.ai-fab-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--brand-500);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.ai-fab-icon svg { width: 16px; height: 16px; }

/* 聊天面板 */
.ai-panel {
  position: fixed;
  right: 20px;
  bottom: 90px;
  width: 460px;
  max-width: calc(100vw - 32px);
  height: 760px;
  max-height: calc(100vh - 110px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(16,24,40,.18);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  border: 1px solid #e4e9f0;
}
.ai-panel.open { display: flex; }

/* 头部 */
.ai-header {
  padding: 12px 14px;
  background: #fff;
  border-bottom: 1px solid #eef1f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ai-header-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.ai-avatar {
  width: 38px; height: 38px;
  border-radius: 10px;
  overflow: hidden;
  background: #eef2f7;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #e2e8f0;
}
.ai-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ai-header-info { min-width: 0; }
.ai-title {
  font-size: 15px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.3;
}
.ai-subtitle {
  font-size: 11px;
  color: #6b7280;
  line-height: 1.3;
}
.ai-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.ai-header-actions button {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .18s;
}
.ai-header-actions button:hover { background: #f3f4f6; color: #4b5563; }
.ai-header-actions button.ai-hide-pet-btn:hover { color: #ef4444; }
.ai-header-actions svg { width: 14px; height: 14px; }

/* 模型选择 */
.ai-model-select select {
  appearance: none;
  -webkit-appearance: none;
  padding: 4px 22px 4px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f9fafb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 7px center;
  color: #374151;
  font-size: 12px;
  cursor: pointer;
  outline: none;
  max-width: 120px;
}
.ai-model-select select:hover { border-color: #d1d5db; }
.ai-model-select select:focus { border-color: var(--brand-400); box-shadow: 0 0 0 2px var(--brand-50); }

/* 消息区 */
.ai-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f8fafc;
  scroll-behavior: smooth;
}
.ai-body::-webkit-scrollbar { width: 6px; }
.ai-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

/* 欢迎页 */
.ai-greeting {
  font-size: 22px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 8px;
  letter-spacing: .3px;
}
.ai-welcome-sub {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.7;
  margin-bottom: 16px;
}

/* 猜你想问 */
.ai-suggest-card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(16,24,40,.04);
}
.ai-suggest-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.ai-suggest-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.ai-suggest-label .bulb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #eff6ff;
  color: var(--brand-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.ai-suggest-refresh {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--brand-600);
  background: none;
  border: none;
  cursor: pointer;
  transition: color .18s;
}
.ai-suggest-refresh:hover { color: var(--brand-700); }
.ai-suggest-refresh svg { width: 12px; height: 12px; }
.ai-suggest-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ai-suggest-item {
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f9fafb;
  border: 1px solid transparent;
  color: #374151;
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
  transition: all .16s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ai-suggest-item:hover {
  background: #eff6ff;
  border-color: var(--brand-200);
  color: var(--brand-700);
}

/* 快捷入口 */
.ai-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.ai-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  font-size: 12px;
  cursor: pointer;
  transition: all .16s;
}
.ai-quick-btn:hover { background: #f3f4f6; border-color: #d1d5db; }
.ai-quick-ico {
  width: 16px; height: 16px;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background-size: 14px 14px;
  background-position: center;
  background-repeat: no-repeat;
}
.ai-quick-quote .ai-quick-ico { background-color: #eff6ff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231f6fb2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3' width='16' height='18' rx='2'/%3E%3Cpath d='M8 7h2M12 7h2M16 7h2M8 11h2M12 11h2M16 11h2M8 15h2M12 15h2M16 15h2'/%3E%3C/svg%3E"); }
.ai-quick-quantify .ai-quick-ico { background-color: #fff7ed; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23d97706' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M18 17V9'/%3E%3Cpath d='M13 17V5'/%3E%3Cpath d='M8 17v-3'/%3E%3C/svg%3E"); }
.ai-quick-follow .ai-quick-ico { background-color: #f3e8ff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237c3aed' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }

/* 消息气泡 */
.ai-messages { display: flex; flex-direction: column; gap: 14px; }
.ai-msg { display: flex; gap: 10px; max-width: 92%; }
.ai-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.ai-msg-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  color: #fff;
  background: var(--brand-500);
}
.ai-msg.bot .ai-msg-avatar {
  background: linear-gradient(135deg, #1f6fb2, #154a7a);
}
.ai-bubble {
  padding: 10px 13px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-msg.bot .ai-bubble {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #1f2937;
  border-top-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.ai-msg.user .ai-bubble {
  background: var(--brand-500);
  color: #fff;
  border-top-right-radius: 4px;
}
.ai-msg.bot .ai-bubble p { margin: 0 0 .5em; }
.ai-msg.bot .ai-bubble p:last-child { margin-bottom: 0; }
.ai-msg.bot .ai-bubble table {
  border-collapse: collapse;
  font-size: 12px;
  margin: 8px 0;
  width: 100%;
}
.ai-msg.bot .ai-bubble th,
.ai-msg.bot .ai-bubble td {
  border: 1px solid #e5e7eb;
  padding: 5px 8px;
  text-align: left;
}
.ai-msg.bot .ai-bubble th { background: #f9fafb; }
.ai-msg-error {
  color: #b91c1c !important;
  background: #fef2f2 !important;
  border-color: #fecaca !important;
}

.ai-typing {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 10px 13px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  width: fit-content;
  color: #9ca3af;
  font-size: 12px;
}
.ai-typing.open { display: flex; }
.ai-typing i {
  width: 6px; height: 6px;
  background: var(--brand-400);
  border-radius: 50%;
  animation: aiBlink 1.4s infinite both;
}
.ai-typing i:nth-child(2) { animation-delay: .2s; }
.ai-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes aiBlink {
  0%, 80%, 100% { transform: scale(0.6); opacity: .4; }
  40% { transform: scale(1); opacity: 1; }
}

/* 底部输入区 */
.ai-footer {
  padding: 10px 14px 12px;
  background: #fff;
  border-top: 1px solid #eef1f6;
}
.ai-input-box {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
  transition: border-color .18s, box-shadow .18s;
}
.ai-input-box:focus-within {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px var(--brand-50);
}
.ai-input-box textarea {
  width: 100%;
  min-height: 38px;
  max-height: 120px;
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  color: #1f2937;
  background: transparent;
}
.ai-input-box textarea::placeholder { color: #9ca3af; }
.ai-input-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}
.ai-deepthink {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #4b5563;
  font-size: 12px;
  cursor: pointer;
  transition: all .18s;
}
.ai-deepthink.active {
  background: #eff6ff;
  border-color: var(--brand-400);
  color: var(--brand-700);
}
.ai-deepthink svg { width: 13px; height: 13px; }
.ai-input-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-attach,
.ai-send {
  width: 30px; height: 30px;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .18s;
}
.ai-attach {
  background: transparent;
  color: #9ca3af;
}
.ai-attach:hover { color: #4b5563; }
.ai-attach svg { width: 16px; height: 16px; }
.ai-send {
  background: var(--brand-500);
  color: #fff;
}
.ai-send:hover { background: var(--brand-600); }
.ai-send svg { width: 15px; height: 15px; }
.ai-send.disabled { background: #c3d4e8; cursor: not-allowed; }

.ai-disclaimer {
  text-align: center;
  font-size: 11px;
  color: #9ca3af;
  margin-top: 8px;
}

/* 报价卡片：在消息气泡内完整自适应，禁止横向滚动与数字竖排 */
.ai-bubble .ai-quote-card {
  max-width: 100%;
  box-sizing: border-box;
}
.ai-quote-card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  margin: 10px 0;
  box-shadow: 0 2px 8px rgba(16,24,40,.06);
}
.ai-quote-header {
  background: linear-gradient(135deg, #1f6fb2, #154a7a);
  color: #fff;
  padding: 11px 12px;
}
.ai-quote-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 2px;
  line-height: 1.3;
}
.ai-quote-meta {
  font-size: 11px;
  opacity: .9;
}
.ai-quote-body {
  display: block;
  padding: 10px;
  background: #f8fafc;
}
.ai-quote-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  table-layout: fixed;
}
.ai-quote-table th,
.ai-quote-table td {
  width: 20%;
  padding: 6px 3px;
  text-align: center;
  border-bottom: 1px solid #f3f4f6;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
}
.ai-quote-table th {
  background: #f9fafb;
  color: #4b5563;
  font-weight: 600;
}
.ai-quote-table tr:last-child td { border-bottom: none; }
.ai-quote-original { color: #6b7280; text-decoration: line-through; }
.ai-quote-final { color: #dc2626; font-weight: 700; font-size: 12px; }
.ai-quote-save { color: var(--brand-600); font-weight: 600; }
.ai-quote-rec {
  display: inline-block;
  margin-left: 2px;
  padding: 1px 3px;
  border-radius: 4px;
  background: #f97316;
  color: #fff;
  font-size: 9px;
  white-space: nowrap;
  vertical-align: middle;
}
.ai-quote-side {
  width: 100%;
  margin-top: 8px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 10px;
  box-sizing: border-box;
}
.ai-quote-side-title {
  font-size: 11px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 4px;
  padding-left: 5px;
  border-left: 2px solid var(--brand-500);
}
.ai-quote-side-sub {
  font-size: 10px;
  color: #6b7280;
  margin-bottom: 5px;
}
.ai-quote-compare-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 2px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 11px;
  white-space: nowrap;
  gap: 8px;
}
.ai-quote-compare-row:last-child { border-bottom: none; }
.ai-quote-compare-price { color: #dc2626; font-weight: 700; }
.ai-quote-tip {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid #f3f4f6;
  font-size: 10px;
  color: var(--brand-700);
  line-height: 1.4;
}
.ai-quote-note {
  padding: 10px 12px;
  font-size: 12px;
  color: #4b5563;
  background: #fff;
  border-top: 1px solid #eef1f6;
  line-height: 1.6;
  word-break: break-word;
}
.ai-card-error {
  padding: 10px;
  background: #fef2f2;
  color: #b91c1c;
  border-radius: 8px;
  font-size: 12px;
}

/* 系统设置 → 助理配置 */
.assistant-cfg { display: flex; flex-direction: column; gap: 4px; }
.cfg-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 16px 4px;
  border-bottom: 1px solid #eef1f6;
}
.cfg-row:last-of-type { border-bottom: none; }
.cfg-text { min-width: 0; }
.cfg-label { font-size: 14px; font-weight: 600; color: #1f2937; }
.cfg-desc { font-size: 12px; color: #6b7280; margin-top: 3px; line-height: 1.5; }
.cfg-select {
  appearance: none; -webkit-appearance: none;
  padding: 8px 30px 8px 12px;
  border: 1px solid #d1d5db; border-radius: 8px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: #1f2937; font-size: 13px; cursor: pointer; outline: none; min-width: 180px;
}
.cfg-select:focus { border-color: var(--brand-400); box-shadow: 0 0 0 3px var(--brand-50); }
.cfg-actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.cfg-msg { font-size: 13px; }

/* 开关 */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #cbd5e1; border-radius: 999px; transition: .2s;
}
.switch .slider::before {
  content: ''; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--brand-500); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* 响应式 */
@media (max-width: 560px) {
  .ai-panel {
    right: 0; bottom: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  .ai-fab { right: 16px; bottom: 16px; }
  .ai-quote-body { flex-direction: column; }
  .ai-quote-side { width: 100%; }
  .ai-pet-mount { right: 42px; bottom: 16px; width: 90px; height: 106px; }
  .ai-pet-mount .ai-pet-hint { right: -6px; max-width: 170px; }
  .ai-pet-peek { right: 42px; bottom: 16px; width: 46px; height: 54px; padding: 4px 2px 5px; }
  .ai-pet-peek-img { width: 28px; height: 28px; }
}

/* 2D 宇航员桌宠挂载点 */
.ai-pet-mount {
  position: fixed;
  right: 52px; /* 整体再往左移 30px，避免卡墙角 */
  bottom: 26px;
  width: 112px;
  height: 132px;
  cursor: grab; /* 可按住拖动，松手即落位 */
  touch-action: none; /* 移动端拖拽时不让页面跟着滚 */
  z-index: 70;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  background: transparent !important;
}
/* 初始未加载完成时隐藏，防止露出蓝色兜底图 */
.ai-pet-mount:not(.ai-pet-2d) {
  opacity: 0;
  pointer-events: none;
}
.ai-pet-mount.hidden,
.ai-pet-mount.d-none { display: none !important; }

.ai-pet-mount .ai-pet-img {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: auto;
  height: 100%;
  transform-origin: center bottom;
  transform: translateX(-50%);
  filter: drop-shadow(0 10px 18px rgba(20,40,80,.2));
  pointer-events: none;
  will-change: transform, filter;
  background: transparent !important;
}

.ai-pet-mount .ai-pet-shadow {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 66%;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(24,32,46,.22) 0%, rgba(24,32,46,0) 70%);
  transform: translateX(-50%) scale(1);
  transform-origin: center;
  opacity: .16;
  pointer-events: none;
  transition: opacity .2s ease;
}

.ai-pet-mount .ai-pet-hint {
  position: absolute;
  right: 0;
  bottom: 100%;
  margin-bottom: 8px;
  width: max-content;
  max-width: 220px;
  padding: 9px 13px;
  border-radius: 10px;
  background: rgba(35,45,60,.92);
  color: #fff;
  font-size: 12px;
  line-height: 1.55;
  box-shadow: 0 4px 12px rgba(16,24,40,.18);
  opacity: 0;
  transform: translateY(0);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.ai-pet-mount .ai-pet-hint::after {
  content: '';
  position: absolute;
  right: 46px;
  top: 100%;
  border: 6px solid transparent;
  border-top-color: rgba(35,45,60,.92);
}

.ai-pet-mount .ai-pet-hide {
  position: absolute;
  top: 2px;
  right: 2px;
  padding: 3px 8px;
  border: none;
  border-radius: 10px;
  background: rgba(255,255,255,.92);
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  opacity: 0;
  transform: scale(.9);
  transition: opacity .18s ease, transform .18s ease, background .18s ease;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(16,24,40,.12);
  font-size: 11px;
  line-height: 1;
}
.ai-pet-mount:hover .ai-pet-hide {
  opacity: 1;
  transform: scale(1);
}
.ai-pet-mount .ai-pet-hide:hover {
  background: #fff;
  color: #ef4444;
}
.ai-pet-mount .ai-pet-hide svg {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

/* 隐藏后露出的宇航员入口 */
.ai-pet-peek {
  position: fixed;
  right: 52px;
  bottom: 26px;
  width: 54px;
  height: 64px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 14px rgba(16,24,40,.14);
  cursor: grab; /* 同样可拖动 */
  touch-action: none;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 2px 7px;
  box-sizing: border-box;
  transition: transform .18s ease, box-shadow .18s ease;
  overflow: hidden;
}
.ai-pet-peek:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 22px rgba(16,24,40,.2);
}
.ai-pet-peek.hidden { display: none !important; }
#aiAssistantRoot.ai-disabled { display: none !important; }

.ai-pet-peek-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  pointer-events: none;
  background: transparent !important;
}
.ai-pet-peek-label {
  font-size: 10px;
  color: #6b7280;
  line-height: 1;
  pointer-events: none;
  margin-top: 2px;
}

/* ---------- 拖拽移动位置 ---------- */
.ai-pet-mount.dragging,
.ai-pet-peek.dragging { cursor: grabbing; }
.ai-pet-mount.dragging { transition: none; }
/* 拖拽期间整页保持抓取光标，指针偶尔滑出挂件也不会闪回箭头 */
body.ai-pet-dragging { cursor: grabbing; user-select: none; }
body.ai-pet-dragging .ai-pet-mount .ai-pet-hint { opacity: 0 !important; }

/* 桌宠被拖到屏幕左半边时，气泡改为向右展开，避免顶出视口 */
.ai-pet-mount.ai-pet-flip .ai-pet-hint { right: auto; left: 0; }
.ai-pet-mount.ai-pet-flip .ai-pet-hint::after { right: auto; left: 46px; }

/* 桌宠贴近屏幕顶部时，气泡改为向下展开（原本朝上，会顶出视口） */
.ai-pet-mount.ai-pet-flip-y .ai-pet-hint { bottom: auto; top: 100%; margin-bottom: 0; margin-top: 8px; }
.ai-pet-mount.ai-pet-flip-y .ai-pet-hint::after {
  top: auto; bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: rgba(35,45,60,.92);
}

.ai-pet-fallback {
  width: 100%;
  height: 100%;
  animation: ai-pet-bob 2.6s ease-in-out infinite;
}
@keyframes ai-pet-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}


