.qz-im-root {
  --im-ink: #10233f;
  --im-muted: #6b7890;
  --im-line: #dfe6ef;
  --im-blue: #176bdb;
  --im-blue-dark: #0f4fa8;
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147483000;
  font-family: "IBM Plex Sans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--im-ink);
}

.qz-im-launcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  float: right;
  border: 0;
  border-radius: 18px;
  color: #fff;
  background: #176bdb;
  box-shadow: 0 16px 42px rgba(20, 76, 153, .28);
  cursor: pointer;
  transition: transform .18s ease, background .18s ease;
}

.qz-im-launcher:hover { transform: translateY(-2px); background: var(--im-blue-dark); }
.qz-im-launcher:focus-visible, .qz-im-send:focus-visible, .qz-im-close:focus-visible, .qz-im-clear:focus-visible { outline: 3px solid rgba(23, 107, 219, .28); outline-offset: 3px; }
.qz-im-launcher svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.qz-im-panel {
  display: none;
  flex-direction: column;
  width: min(390px, calc(100vw - 28px));
  height: min(650px, calc(100vh - 100px));
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid rgba(186, 200, 219, .86);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 26px 80px rgba(15, 35, 67, .22);
  transform-origin: bottom right;
}

.qz-im-root.is-open .qz-im-panel { display: flex; animation: qz-im-in .2s ease-out; }
.qz-im-root.is-open .qz-im-launcher { display: none; }
@keyframes qz-im-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.qz-im-head {
  display: flex;
  align-items: center;
  min-height: 70px;
  padding: 14px 16px;
  color: #fff;
  background: #102b50;
}
.qz-im-mark { display: grid; place-items: center; width: 38px; height: 38px; margin-right: 11px; border-radius: 12px; background: #fff; color: #176bdb; font-weight: 700; }
.qz-im-heading { flex: 1; min-width: 0; }
.qz-im-title { font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.qz-im-status { display: flex; align-items: center; gap: 6px; margin-top: 3px; color: #c8d7eb; font-size: 12px; }
.qz-im-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #5ee1a2; box-shadow: 0 0 0 3px rgba(94, 225, 162, .14); }
.qz-im-head-actions { display: flex; align-items: center; gap: 2px; }
.qz-im-clear { min-height: 32px; padding: 0 9px; border: 0; border-radius: 9px; color: #cbd9ea; background: transparent; font-size: 12px; cursor: pointer; }
.qz-im-clear:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.qz-im-close { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; color: #d6e2f1; background: transparent; font-size: 24px; cursor: pointer; }
.qz-im-close:hover { background: rgba(255, 255, 255, .1); }

.qz-im-feed { flex: 1; overflow: auto; padding: 18px 14px 12px; overscroll-behavior: contain; background: #f5f7fa; }
.qz-im-row { display: flex; margin: 0 0 14px; }
.qz-im-row.is-user { justify-content: flex-end; }
.qz-im-bubble { max-width: 86%; padding: 11px 13px; border: 1px solid var(--im-line); border-radius: 7px 16px 16px 16px; background: #fff; color: var(--im-ink); font-size: 14px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; box-shadow: 0 4px 14px rgba(25, 43, 72, .04); }
.qz-im-row.is-user .qz-im-bubble { border-color: #176bdb; border-radius: 16px 7px 16px 16px; color: #fff; background: #176bdb; box-shadow: none; }
.qz-im-bubble.is-pending { color: var(--im-muted); }

.qz-im-actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; margin: -5px 0 14px; padding-left: 2px; }
.qz-im-action { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 11px; border: 1px solid #b8c9df; border-radius: 999px; color: #1756a7; background: #fff; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; }
.qz-im-action:hover { border-color: #176bdb; color: #0f4fa8; background: #f2f7ff; }
.qz-im-action.is-primary { border-color: #176bdb; color: #fff; background: #176bdb; }
.qz-im-action.is-danger { border-color: #d34848; color: #b42323; }
.qz-im-confirm { width: 100%; margin: -3px 0 14px; padding: 13px; border: 1px solid #f0cc8a; border-radius: 14px; background: #fffaf0; }
.qz-im-confirm strong { display: block; font-size: 14px; }
.qz-im-confirm p { margin: 5px 0 11px; color: #735c35; font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
.qz-im-confirm-buttons { display: flex; gap: 8px; }

.qz-im-compose { padding: 12px; border-top: 1px solid var(--im-line); background: #fff; }
.qz-im-inputbox { display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 12px; border: 1px solid #cfd9e6; border-radius: 16px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.qz-im-inputbox:focus-within { border-color: #176bdb; box-shadow: 0 0 0 3px rgba(23, 107, 219, .1); }
.qz-im-input { flex: 1; min-height: 25px; max-height: 110px; resize: none; overflow: auto; border: 0; outline: 0; color: var(--im-ink); background: transparent; font: inherit; font-size: 14px; line-height: 1.55; }
.qz-im-input::placeholder { color: #8c99aa; }
.qz-im-send { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border: 0; border-radius: 12px; color: #fff; background: #176bdb; cursor: pointer; }
.qz-im-send:disabled { opacity: .45; cursor: default; }
.qz-im-send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.qz-im-note { margin: 7px 4px 0; color: #8793a4; font-size: 10px; text-align: center; }


.qz-im-captcha-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(9, 24, 45, .58);
  backdrop-filter: blur(3px);
}
.qz-im-captcha-card {
  width: min(360px, calc(100vw - 28px));
  padding: 18px;
  border-radius: 18px;
  color: var(--im-ink, #10233f);
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
}
.qz-im-captcha-title { display: block; font-size: 16px; }
.qz-im-captcha-note { margin: 5px 0 13px; color: #6b7890; font-size: 13px; }
.qz-im-captcha-picture { position: relative; width: 100%; overflow: hidden; border-radius: 12px; background: #e8eef5; }
.qz-im-captcha-bg { display: block; width: 100%; height: 100%; object-fit: fill; user-select: none; pointer-events: none; }
.qz-im-captcha-piece { position: absolute; z-index: 2; user-select: none; pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .28)); }
.qz-im-captcha-range { width: 100%; margin: 16px 0 8px; accent-color: #176bdb; cursor: grab; }
.qz-im-captcha-range:active { cursor: grabbing; }
.qz-im-captcha-range:disabled { opacity: .45; cursor: wait; }
.qz-im-captcha-status { min-height: 20px; color: #6b7890; font-size: 12px; text-align: center; }
.qz-im-captcha-buttons { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }

@media (max-width: 600px) {
  .qz-im-root { right: 12px; bottom: 12px; }
  .qz-im-panel { width: calc(100vw - 24px); height: min(680px, calc(100dvh - 24px)); margin: 0; border-radius: 20px; }
  .qz-im-root.is-open .qz-im-panel { display: flex; }
  .qz-im-launcher { width: 54px; height: 54px; border-radius: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .qz-im-root.is-open .qz-im-panel { animation: none; }
  .qz-im-launcher { transition: none; }
}

