/* ============================================================
   量子河洛官网「智能管家」AI 悬浮问答助手 —— 样式
   依赖 website.css 中定义的 :root 设计令牌（--ink-*、--jade-*、--gold-*、--text-*）
   ============================================================ */

/* 悬浮按钮（右下角常驻）
   图标为 AI 生成位图，直接铺满按钮 —— 按钮自身不再画背景/描边，
   仅保留外投影与一圈极淡的玉青光环，避免给图片套上多余的双层边缘。 */
.lzhl-butler-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: transparent;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(231, 190, 115, 0.14),
              0 0 20px rgba(63, 175, 144, 0.22);
  color: var(--jade-100);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.lzhl-butler-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(231, 190, 115, 0.24),
              0 0 28px rgba(63, 175, 144, 0.34);
}
.lzhl-butler-btn .lzhl-butler-ico {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  display: block;
  line-height: 0;
  border-radius: 50%;
  overflow: hidden;
}
/* 位图图标：铺满并轻微放大，裁掉方形边缘可能残留的暗角 */
.lzhl-butler-btn .lzhl-butler-ico img,
.lzhl-butler-btn .lzhl-butler-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
  transform: scale(1.04);
  user-select: none;
  -webkit-user-drag: none;
}
.lzhl-butler-btn .lzhl-butler-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2fd8a0;
  box-shadow: 0 0 8px #2fd8a0;
  border: 1.5px solid #162420;
}
/* 关闭状态文案切换由 JS 控制 */

/* 让「回到顶部」按钮上移，避免与悬浮按钮重叠 */
.lzhl-butler-btn ~ .back-to-top,
.back-to-top.lzhl-butler-shifted {
  bottom: 92px !important;
}

/* 对话面板 */
.lzhl-butler-panel {
  position: fixed;
  right: 24px;
  bottom: 92px;
  z-index: 9991;
  width: 384px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 116px);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  border: 1px solid rgba(79, 184, 154, 0.28);
  background: linear-gradient(180deg, rgba(18, 25, 23, 0.98), rgba(10, 14, 13, 0.99));
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.lzhl-butler-panel.lzhl-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* 头部 */
.lzhl-butler-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(47, 162, 132, 0.14), rgba(21, 101, 87, 0.06));
}
.lzhl-butler-head .lzhl-butler-avatar {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 22, 19, 0.9);
  border: 1px solid rgba(231, 190, 115, 0.28);
  color: #fff;
  flex: 0 0 auto;
  overflow: hidden;
}
.lzhl-butler-head .lzhl-butler-avatar img,
.lzhl-butler-head .lzhl-butler-avatar svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}
.lzhl-butler-head-txt { flex: 1; min-width: 0; }
.lzhl-butler-head-txt .t { font-size: 14px; font-weight: 700; color: var(--text-1); }
.lzhl-butler-head-txt .s {
  font-size: 11px; color: var(--jade-300);
  display: flex; align-items: center; gap: 5px;
}
.lzhl-butler-head-txt .s .on { width: 6px; height: 6px; border-radius: 50%; background: #2fd8a0; }
.lzhl-butler-close {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer;
  color: var(--text-2); font-size: 18px; line-height: 1;
}
.lzhl-butler-close:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-1); }

/* 消息区 */
.lzhl-butler-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.lzhl-butler-body::-webkit-scrollbar { width: 6px; }
.lzhl-butler-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 3px; }

/* 欢迎区 */
.lzhl-butler-welcome { text-align: left; padding: 4px 2px 6px; }
.lzhl-butler-welcome .wl { font-size: 13.5px; color: var(--text-1); line-height: 1.6; margin-bottom: 12px; }
.lzhl-butler-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.lzhl-butler-quick button {
  padding: 7px 12px; border-radius: 16px; font-size: 12.5px;
  background: rgba(47, 162, 132, 0.10); color: var(--jade-200);
  border: 1px solid rgba(79, 184, 154, 0.25); cursor: pointer;
  font-family: inherit; transition: background 0.15s ease, border-color 0.15s ease;
}
.lzhl-butler-quick button:hover { background: rgba(47, 162, 132, 0.2); border-color: rgba(79, 184, 154, 0.55); }

/* 消息气泡 */
.lzhl-butler-msg { display: flex; flex-direction: column; max-width: 88%; }
.lzhl-butler-msg .bubble {
  padding: 9px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-word;
}
.lzhl-butler-msg.user { align-self: flex-end; }
.lzhl-butler-msg.user .bubble {
  background: var(--grad-main); color: #fff; border-bottom-right-radius: 4px;
}
.lzhl-butler-msg.assistant { align-self: flex-start; }
.lzhl-butler-msg.assistant .bubble {
  background: rgba(255, 255, 255, 0.07); color: var(--text-1);
  border: 1px solid rgba(255, 255, 255, 0.08); border-bottom-left-radius: 4px;
}
.lzhl-butler-msg .cursor { display: inline-block; width: 7px; height: 14px; background: var(--jade-300); margin-left: 2px; vertical-align: -2px; animation: lzhl-blink 1s steps(2) infinite; }
@keyframes lzhl-blink { 50% { opacity: 0; } }

/* 来源标注 */
.lzhl-butler-sources { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.lzhl-butler-sources span {
  font-size: 11px; color: var(--text-3);
  padding: 2px 8px; border-radius: 10px;
  background: rgba(231, 190, 115, 0.08); border: 1px solid rgba(231, 190, 115, 0.18);
}

/* 转人工 / 预约演示引导 */
.lzhl-butler-cta {
  margin-top: 8px; padding: 10px 12px; border-radius: 12px;
  background: rgba(231, 190, 115, 0.10);
  border: 1px solid rgba(231, 190, 115, 0.3);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.lzhl-butler-cta .t { font-size: 12.5px; color: var(--gold-200); line-height: 1.5; }
.lzhl-butler-cta a {
  flex: 0 0 auto; padding: 7px 13px; border-radius: 14px; font-size: 12.5px;
  background: var(--grad-gold); color: #241a08; font-weight: 700; text-decoration: none;
  white-space: nowrap;
}

/* 输入区 */
.lzhl-butler-foot { border-top: 1px solid rgba(255, 255, 255, 0.08); padding: 10px 12px; background: rgba(15, 21, 19, 0.6); }
.lzhl-butler-input-row { display: flex; align-items: flex-end; gap: 8px; }
.lzhl-butler-input {
  flex: 1; resize: none; min-height: 38px; max-height: 100px;
  padding: 9px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.5;
  background: rgba(255, 255, 255, 0.06); color: var(--text-1);
  border: 1px solid rgba(255, 255, 255, 0.12); outline: none; font-family: inherit;
}
.lzhl-butler-input:focus { border-color: rgba(79, 184, 154, 0.6); background: rgba(255, 255, 255, 0.08); }
.lzhl-butler-send {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad-main); color: #fff; border: none; cursor: pointer;
  transition: opacity 0.15s ease;
}
.lzhl-butler-send:disabled { opacity: 0.45; cursor: not-allowed; }
.lzhl-butler-send svg { width: 17px; height: 17px; }
.lzhl-butler-footnote {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; font-size: 11px; color: var(--text-3);
}
.lzhl-butler-footnote a { color: var(--gold-300); text-decoration: none; }
.lzhl-butler-footnote a:hover { text-decoration: underline; }

/* 移动端自适应 */
@media (max-width: 640px) {
  .lzhl-butler-btn { height: 52px; padding: 0; width: 52px; justify-content: center; border-radius: 50%; right: 16px; bottom: 16px; }
  .lzhl-butler-btn .lzhl-butler-label { display: none; }
  .lzhl-butler-btn .lzhl-butler-ico { width: 52px; height: 52px; }
  .lzhl-butler-btn .lzhl-butler-dot { position: absolute; top: 3px; right: 3px; }
  .lzhl-butler-panel {
    right: 8px; bottom: 76px; left: 8px; width: auto;
    max-width: none; height: calc(100vh - 96px); max-height: none;
    border-radius: 16px;
  }
}
