/* ============================================================
   悟奇科技 · 智能客服挂件样式（与官网同风格）
   ============================================================ */

.wq-chat-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 900;
  width: 58px;
  height: 58px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: var(--grad, linear-gradient(100deg, #1fc9a8, #2cc5f2));
  box-shadow: 0 8px 28px rgba(31, 201, 168, 0.45);
  display: grid;
  place-items: center;
  transition: transform 0.3s var(--ease, ease), box-shadow 0.3s;
}
.wq-chat-fab:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 36px rgba(31, 201, 168, 0.6);
}
.wq-chat-fab svg { width: 26px; height: 26px; stroke: #04121c; }
.wq-chat-fab__tip {
  position: absolute;
  right: 68px;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--ink, #e8f1f4);
  background: rgba(10, 23, 35, 0.92);
  border: 1px solid var(--line-strong, rgba(88, 199, 214, 0.3));
  padding: 7px 14px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.wq-chat-fab:hover .wq-chat-fab__tip { opacity: 1; }

/* ---------- 聊天面板 ---------- */
.wq-chat {
  position: fixed;
  right: 22px;
  bottom: 94px;
  bottom: calc(94px + env(safe-area-inset-bottom, 0px));
  z-index: 901;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: min(600px, calc(100vh - 140px));
  display: flex;
  flex-direction: column;
  background: rgba(8, 20, 31, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line-strong, rgba(88, 199, 214, 0.3));
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(31, 201, 168, 0.08);
  overflow: hidden;
  opacity: 0;
  transform: translateY(24px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.35s var(--ease, ease), transform 0.35s var(--ease, ease);
}
.wq-chat--open { opacity: 1; transform: none; pointer-events: auto; }

.wq-chat__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line, rgba(88, 199, 214, 0.14));
  background: linear-gradient(120deg, rgba(31, 201, 168, 0.1), rgba(44, 197, 242, 0.06));
}
.wq-chat__avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(160deg, #f4f8f9, #dfe9ec);
  display: grid;
  place-items: center;
  padding: 5px;
  flex-shrink: 0;
}
.wq-chat__avatar img { max-width: 100%; max-height: 100%; object-fit: contain; }
.wq-chat__title { line-height: 1.3; flex: 1; }
.wq-chat__title b { display: block; font-size: 15px; font-weight: 700; letter-spacing: 0.06em; }
.wq-chat__title span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ink-faint, #5a7280);
}
.wq-chat__title i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal-bright, #1fc9a8);
  box-shadow: 0 0 8px var(--teal-bright, #1fc9a8);
  font-style: normal;
}
.wq-chat__close {
  background: none;
  border: none;
  color: var(--ink-dim, #93a8b3);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.3s;
}
.wq-chat__close:hover { color: var(--ink, #e8f1f4); }

/* ---------- 消息区 ---------- */
.wq-chat__body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
}
.wq-chat__body::-webkit-scrollbar { width: 5px; }
.wq-chat__body::-webkit-scrollbar-thumb { background: rgba(88, 199, 214, 0.3); border-radius: 3px; }

.wq-msg {
  max-width: 84%;
  padding: 11px 15px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  animation: wqMsgIn 0.35s var(--ease, ease) both;
}
@keyframes wqMsgIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.wq-msg--bot {
  align-self: flex-start;
  background: rgba(13, 30, 44, 0.9);
  border: 1px solid var(--line, rgba(88, 199, 214, 0.14));
  border-top-left-radius: 3px;
  color: var(--ink, #e8f1f4);
}
.wq-msg--user {
  align-self: flex-end;
  background: var(--grad, linear-gradient(100deg, #1fc9a8, #2cc5f2));
  color: #04121c;
  font-weight: 500;
  border-bottom-right-radius: 3px;
}
.wq-msg__src {
  display: block;
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--ink-faint, #5a7280);
  letter-spacing: 0.1em;
}

/* 正在输入 */
.wq-typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 5px;
  padding: 13px 16px;
  background: rgba(13, 30, 44, 0.9);
  border: 1px solid var(--line, rgba(88, 199, 214, 0.14));
  border-radius: 10px;
  border-top-left-radius: 3px;
}
.wq-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal-bright, #1fc9a8);
  animation: wqTyping 1.2s ease-in-out infinite;
}
.wq-typing i:nth-child(2) { animation-delay: 0.15s; }
.wq-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes wqTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* 快捷问题 */
.wq-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
}
.wq-chip {
  font-size: 12.5px;
  color: var(--cyan, #2cc5f2);
  background: rgba(44, 197, 242, 0.06);
  border: 1px solid var(--line-strong, rgba(88, 199, 214, 0.3));
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
  font-family: inherit;
}
.wq-chip:hover { background: rgba(44, 197, 242, 0.14); transform: translateY(-1px); }

/* ---------- 输入区 ---------- */
.wq-chat__input {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line, rgba(88, 199, 214, 0.14));
  background: rgba(6, 15, 24, 0.6);
}
.wq-chat__input input {
  flex: 1;
  min-width: 0;
  background: rgba(13, 30, 44, 0.8);
  border: 1px solid var(--line-strong, rgba(88, 199, 214, 0.3));
  border-radius: 6px;
  padding: 11px 14px;
  color: var(--ink, #e8f1f4);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.3s;
}
.wq-chat__input input::placeholder { color: var(--ink-faint, #5a7280); }
.wq-chat__input input:focus { border-color: var(--cyan, #2cc5f2); }
.wq-chat__send {
  border: none;
  border-radius: 6px;
  background: var(--grad, linear-gradient(100deg, #1fc9a8, #2cc5f2));
  color: #04121c;
  font-weight: 600;
  font-size: 14px;
  padding: 0 20px;
  cursor: pointer;
  font-family: inherit;
  transition: box-shadow 0.3s, transform 0.3s, opacity 0.3s;
}
.wq-chat__send:hover { box-shadow: 0 4px 18px rgba(31, 201, 168, 0.45); transform: translateY(-1px); }
.wq-chat__send:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- 留言表单 ---------- */
.wq-leave {
  padding: 4px 16px 16px;
  display: none;
  flex-direction: column;
  gap: 10px;
}
.wq-leave--show { display: flex; }
.wq-leave input,
.wq-leave textarea {
  width: 100%;
  background: rgba(13, 30, 44, 0.8);
  border: 1px solid var(--line-strong, rgba(88, 199, 214, 0.3));
  border-radius: 6px;
  padding: 10px 13px;
  color: var(--ink, #e8f1f4);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  resize: none;
  transition: border-color 0.3s;
}
.wq-leave input:focus,
.wq-leave textarea:focus { border-color: var(--cyan, #2cc5f2); }
.wq-leave textarea { height: 72px; }

/* 折叠时的留言模式提示条 */
.wq-notice {
  margin: 0 16px 10px;
  padding: 10px 14px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #ffd9a8;
  background: rgba(255, 170, 80, 0.08);
  border: 1px solid rgba(255, 170, 80, 0.25);
  border-radius: 6px;
  display: none;
}
.wq-notice--show { display: block; }

@media (max-width: 480px) {
  .wq-chat {
    right: 16px;
    left: 16px;
    width: auto;
    height: min(70vh, 560px);
  }
  .wq-chat-fab { right: 16px; }
}
