:root {
  --mq-primary: #1890ff;
  --mq-primary-hover: #096dd9;
  --mq-primary-dark: #0050b3;
  --mq-primary-light: #e6f4ff;
  --mq-primary-alpha: rgba(24, 144, 255, 0.14);
  --mq-header-gradient: linear-gradient(135deg, #69c0ff 0%, #1890ff 50%, #096dd9 100%);

  --mq-bg-page: #eef0f3;
  --mq-bg-chat: #ffffff;
  --mq-bg-input: #f4f5f7;
  --mq-border: #e8eaed;
  --mq-text-primary: #333333;
  --mq-text-secondary: #666666;
  --mq-text-muted: #999999;
  --mq-text-time: #b0b0b0;

  --mq-bubble-in-bg: #ffffff;
  --mq-bubble-in-text: #333333;
  --mq-bubble-in-border: #e8eaed;
  --mq-bubble-out-bg: #1890ff;
  --mq-bubble-out-text: #ffffff;

  --mq-online: #1890ff;
  --mq-offline: #cccccc;
  --mq-badge: #ff4d4f;

  --mq-radius-panel: 16px;
  --mq-radius-bubble: 12px;
  --mq-radius-btn: 20px;
  --mq-shadow-panel: 0 12px 48px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.06);
  --mq-shadow-bubble: 0 1px 2px rgba(0, 0, 0, 0.04);
  --mq-font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

.mq-widget {
  position: fixed;
  z-index: 2147483000;
  font-family: var(--mq-font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Launcher ── */
.mq-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: var(--mq-header-gradient);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(24, 144, 255, 0.45);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mq-launcher:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 28px rgba(24, 144, 255, 0.5);
}
.mq-launcher:active { transform: scale(0.96); }

.mq-launcher__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--mq-badge);
  border: 2px solid #fff;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 14px;
  text-align: center;
  color: #fff;
}

/* ── Panel ── */
.mq-panel {
  position: fixed;
  right: 20px;
  bottom: 88px;
  width: 380px;
  height: 560px;
  max-height: calc(100vh - 100px);
  background: var(--mq-bg-chat);
  border-radius: var(--mq-radius-panel);
  box-shadow: var(--mq-shadow-panel);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.mq-panel[hidden] { display: none !important; }
.mq-panel.mq-panel--open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ── Header（美洽青绿顶栏） ── */
.mq-panel__header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 12px 14px 12px 16px;
  background: var(--mq-header-gradient);
  color: #fff;
  box-shadow: 0 2px 8px rgba(9, 109, 217, 0.25);
}

.mq-panel__avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.mq-panel__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.85);
  display: block;
}
.mq-panel__avatar--default {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}
.mq-panel__online-dot {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 10px;
  height: 10px;
  background: #52c41a;
  border: 2px solid #fff;
  border-radius: 50%;
}
.mq-panel__online-dot.offline { background: #bbb; }

.mq-panel__info { flex: 1; min-width: 0; }
.mq-panel__title {
  font-weight: 600;
  font-size: 16px;
  color: #fff;
  display: block;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mq-panel__subtitle {
  display: none;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.3;
  margin-top: 1px;
}
.mq-panel__status {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.88);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.mq-panel__status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #91d5ff;
}
.mq-panel__status.offline::before { background: rgba(255,255,255,0.4); }

.mq-panel__close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mq-panel__close:hover { background: rgba(255, 255, 255, 0.32); }

/* ── Body ── */
.mq-panel__body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 14px;
  background: var(--mq-bg-page);
  background-image:
    radial-gradient(circle at 20% 80%, rgba(24, 144, 255, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(24, 144, 255, 0.04) 0%, transparent 40%);
  -webkit-overflow-scrolling: touch;
}
.mq-panel__body::-webkit-scrollbar { width: 4px; }
.mq-panel__body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 4px;
}

.mq-empty {
  text-align: center;
  padding: 48px 24px 24px;
  color: var(--mq-text-muted);
}
.mq-empty__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--mq-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.mq-empty__text { font-size: 14px; line-height: 1.6; color: var(--mq-text-secondary); }

.mq-messages { list-style: none; margin: 0; padding: 0; }

/* ── Messages ── */
.mq-msg {
  display: flex;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 8px;
  animation: mq-fade-in 0.25s ease;
}
.mq-msg--out {
  flex-direction: row-reverse;
}
.mq-msg--system {
  justify-content: center;
  margin-bottom: 12px;
}
.mq-msg--system .mq-msg__bubble {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  color: var(--mq-text-muted);
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 20px;
  max-width: 90%;
  text-align: center;
  box-shadow: none;
}

.mq-msg__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--mq-primary-light);
  border: 1px solid rgba(24, 144, 255, 0.15);
}
.mq-msg__avatar--default {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--mq-primary);
  background: var(--mq-primary-light);
}

.mq-msg__content {
  max-width: calc(100% - 44px);
  display: flex;
  flex-direction: column;
}
.mq-msg--out .mq-msg__content { align-items: flex-end; }
.mq-msg--in .mq-msg__content { align-items: flex-start; }

.mq-msg__bubble {
  max-width: 100%;
  padding: 10px 14px;
  border-radius: var(--mq-radius-bubble);
  word-break: break-word;
  font-size: 14px;
  line-height: 1.55;
  box-shadow: var(--mq-shadow-bubble);
}
.mq-msg--in .mq-msg__bubble {
  background: var(--mq-bubble-in-bg);
  border: 1px solid var(--mq-bubble-in-border);
  color: var(--mq-bubble-in-text);
  border-bottom-left-radius: 4px;
}
.mq-msg--out .mq-msg__bubble {
  background: var(--mq-bubble-out-bg);
  color: var(--mq-bubble-out-text);
  border: none;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(24, 144, 255, 0.28);
  display: flex;
  align-items: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.mq-msg__tick {
  display: inline-flex;
  opacity: 0.85;
  flex-shrink: 0;
  margin-left: auto;
}
.mq-msg__name {
  font-size: 12px;
  color: var(--mq-text-muted);
  margin-bottom: 4px;
  line-height: 1.2;
}

.mq-msg__time {
  font-size: 11px;
  color: var(--mq-text-time);
  margin-top: 4px;
  padding: 0 2px;
}
.mq-msg--pending .mq-msg__bubble { opacity: 0.65; }
.mq-msg--pending .mq-msg__time { color: var(--mq-primary); font-size: 11px; }

.mq-msg__img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
  display: block;
  cursor: zoom-in;
}
.mq-msg__video {
  max-width: 220px;
  max-height: 180px;
  border-radius: 8px;
  display: block;
  background: #000;
}
.mq-msg__file {
  color: inherit;
  text-decoration: underline;
  word-break: break-all;
}
.mq-msg--out .mq-msg__file { color: #fff; }
.mq-msg__bubble--media {
  padding: 4px;
  background: var(--mq-bubble-in-bg);
  border: 1px solid var(--mq-bubble-in-border);
  box-shadow: var(--mq-shadow-bubble);
}
.mq-msg--out .mq-msg__bubble--media {
  background: var(--mq-bubble-in-bg);
  box-shadow: var(--mq-shadow-bubble);
}

.mq-typing {
  font-size: 12px;
  color: var(--mq-text-muted);
  padding: 4px 0 8px 40px;
  background: transparent;
}
.mq-typing__dot { animation: mq-blink 1.2s infinite; }
.mq-typing__dot:nth-child(2) { animation-delay: .2s; }
.mq-typing__dot:nth-child(3) { animation-delay: .4s; }

/* ── 机器人关键词卡片 ── */
.mq-bot-cards {
  flex-shrink: 0;
  margin: 0 0 8px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--mq-border);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.mq-bot-cards__title {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--mq-text-secondary);
  line-height: 1.4;
}
.mq-bot-cards__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mq-bot-card {
  padding: 8px 14px;
  border: 1px solid rgba(24, 144, 255, 0.35);
  border-radius: 20px;
  background: var(--mq-primary-light, #e6f4ff);
  color: var(--mq-primary, #1890ff);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  line-height: 1.3;
}
.mq-bot-card:hover {
  background: var(--mq-primary-alpha);
  border-color: var(--mq-primary);
}
.mq-bot-card:active { transform: scale(0.96); }

/* ── Footer（美洽输入区：工具栏在上、输入框在下） ── */
.mq-panel__footer {
  flex-shrink: 0;
  border-top: 1px solid var(--mq-border);
  padding: 8px 12px 10px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: #fff;
  display: flex;
  flex-direction: column;
}

.mq-footer-compose {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mq-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 2px;
}

.mq-compose {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 10px;
  background: var(--mq-bg-input);
  border-radius: var(--mq-radius-btn);
  padding: 6px 8px 6px 12px;
  border: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.mq-compose:focus-within {
  border-color: rgba(24, 144, 255, 0.35);
  box-shadow: 0 0 0 3px var(--mq-primary-alpha);
  background: #fff;
}

.mq-toolbar__btn,
.mq-toolbar__file {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mq-text-secondary);
  transition: background 0.15s, color 0.15s;
  padding: 0;
  flex-shrink: 0;
}
.mq-toolbar__btn:hover:not(:disabled),
.mq-toolbar__file:hover:not(:disabled) {
  background: var(--mq-primary-alpha);
  color: var(--mq-primary);
}
.mq-toolbar__btn:disabled,
.mq-toolbar__file:disabled { opacity: 0.4; cursor: not-allowed; }

.mq-emoji-picker {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--mq-border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  max-height: 160px;
  overflow-y: auto;
}
.mq-emoji-picker[hidden] { display: none; }
.mq-emoji-picker__item {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  border-radius: 6px;
  padding: 0;
  line-height: 32px;
}
.mq-emoji-picker__item:hover { background: var(--mq-bg-input); }

.mq-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  border: none;
  background: transparent;
  padding: 8px 4px;
  resize: none;
  max-height: 100px;
  min-height: 36px;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
  color: var(--mq-text-primary);
}
.mq-input::placeholder { color: #bbb; }
.mq-input:disabled { color: var(--mq-text-muted); }

.mq-send {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  background: var(--mq-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s;
  box-shadow: 0 2px 8px rgba(24, 144, 255, 0.35);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.mq-send:hover:not(:disabled) { background: var(--mq-primary-hover); }
.mq-send:active:not(:disabled) { transform: scale(0.92); }
.mq-send:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.mq-send svg { display: block; }

.mq-send--text {
  width: auto;
  min-width: 76px;
  height: 40px;
  padding: 0 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
}
.mq-send--text span { line-height: 1; }

/* ── 双栏布局（链接客服 PC） ── */
.mq-panel {
  display: flex;
  flex-direction: column;
}
.mq-panel__layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.mq-panel__chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.mq-panel__aside { display: none; }

.mq-aside__banner {
  flex-shrink: 0;
  overflow: hidden;
  background: #e8eef5;
}
.mq-aside__banner img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}
.mq-aside__banner-ph {
  height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e6f4ff 0%, #d6e8ff 100%);
  color: var(--mq-primary);
}
.mq-aside__banner-ph span { font-size: 36px; }
.mq-aside__banner-ph p { margin: 8px 0 0; font-size: 14px; font-weight: 500; }

.mq-aside__scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 20px;
  -webkit-overflow-scrolling: touch;
}
.mq-aside__welcome-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--mq-text-primary);
  line-height: 1.5;
}
.mq-aside__welcome-hint {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--mq-text-secondary);
  line-height: 1.5;
}
.mq-aside__faq-title {
  margin: 4px 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: #4a7aff;
  line-height: 1.3;
}
.mq-aside__faq-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mq-aside__faq-list li {
  margin: 0;
  padding: 0;
  border-bottom: none;
}
.mq-aside__faq-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 0 10px 16px;
  border: none;
  background: none;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  position: relative;
  line-height: 1.5;
  transition: color 0.15s;
}
.mq-aside__faq-item::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c8c8c8;
}
.mq-aside__faq-item:hover {
  color: #4a7aff;
}
.mq-aside__faq-item:hover::before {
  background: #4a7aff;
}

/* ── Rating / New chat ── */
.mq-rating { text-align: center; padding: 12px 4px; }
.mq-rating__title { font-size: 14px; color: var(--mq-text-primary); margin-bottom: 10px; font-weight: 500; }
.mq-rating__stars { display: flex; justify-content: center; gap: 8px; margin-bottom: 10px; }
.mq-rating__star {
  border: none; background: none; font-size: 32px; color: #e0e0e0;
  cursor: pointer; padding: 0; transition: color 0.15s, transform 0.15s;
}
.mq-rating__star:hover { transform: scale(1.1); }
.mq-rating__star.active { color: #ffb800; }
.mq-rating__comment {
  width: 100%; border: 1px solid var(--mq-border); border-radius: 10px;
  padding: 10px; font-family: inherit; margin-bottom: 10px; resize: none;
  font-size: 14px; background: var(--mq-bg-input);
}
.mq-rating__comment:focus { outline: none; border-color: var(--mq-primary); }
.mq-rating__submit {
  width: 100%; padding: 11px; background: var(--mq-primary); color: #fff;
  border: none; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 500;
}
.mq-rating__done { text-align: center; color: var(--mq-text-muted); padding: 12px 0; font-size: 14px; }

.mq-new-chat { text-align: center; padding: 8px 0; }
.mq-new-chat__btn {
  width: 100%; padding: 11px; background: var(--mq-primary); color: #fff;
  border: none; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 500;
}

/* ── Image preview ── */
.mq-img-preview {
  position: fixed; inset: 0; z-index: 2147483001;
  display: flex; align-items: center; justify-content: center;
}
.mq-img-preview__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.78); }
.mq-img-preview img {
  position: relative; max-width: 92vw; max-height: 92vh; border-radius: 8px;
}

@keyframes mq-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes mq-blink {
  0%, 80%, 100% { opacity: .2; }
  40% { opacity: 1; }
}

/* ── Standalone 全页聊天（/demo 链接客服） ── */
html.mq-standalone-page,
body.mq-standalone-body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #d8dce3;
}

.mq-widget--standalone .mq-launcher { display: none !important; }
.mq-widget--standalone .mq-panel__close { display: none !important; }

.mq-widget--standalone .mq-panel {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: 100%;
  border-radius: 0;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}

.mq-widget--standalone .mq-panel__header {
  min-height: 64px;
  padding: 14px 18px;
  padding-top: max(14px, env(safe-area-inset-top));
  background: linear-gradient(90deg, #5b8cff 0%, #4a7aff 55%, #3d6ef5 100%);
  box-shadow: 0 2px 12px rgba(61, 110, 245, 0.35);
}

.mq-widget--standalone .mq-panel__subtitle { display: none !important; }

.mq-widget--standalone .mq-panel__status {
  margin-top: 4px;
  font-size: 12px;
}
.mq-widget--standalone .mq-panel__status::before {
  background: #b7eb8f;
}

.mq-widget--standalone .mq-panel__avatar {
  width: 44px;
  height: 44px;
}

.mq-widget--standalone .mq-panel__body {
  padding: 16px 18px;
  background: #f3f4f6;
}

.mq-widget--standalone .mq-msg--system .mq-msg__bubble {
  background: #f6ffed;
  color: #52c41a;
  border: 1px solid #d9f7be;
}

.mq-widget--standalone .mq-panel__footer {
  padding: 10px 14px 14px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--mq-border);
}

.mq-widget--standalone .mq-compose {
  padding: 8px 10px 8px 14px;
  border-radius: 10px;
  background: #f7f8fa;
  border: 1px solid #e8eaed;
  align-items: flex-end;
}
.mq-widget--standalone .mq-compose:focus-within {
  border-color: rgba(74, 122, 255, 0.45);
  box-shadow: 0 0 0 2px rgba(74, 122, 255, 0.12);
  background: #fff;
}
.mq-widget--standalone .mq-input {
  min-height: 40px;
  max-height: 120px;
}

.mq-widget--standalone .mq-send--text {
  background: linear-gradient(135deg, #5b8cff 0%, #4a7aff 100%);
  box-shadow: 0 2px 10px rgba(74, 122, 255, 0.38);
  border-radius: 20px;
}
.mq-widget--standalone .mq-send--text:hover:not(:disabled) {
  background: linear-gradient(135deg, #6b98ff 0%, #3d6ef5 100%);
  box-shadow: 0 4px 14px rgba(74, 122, 255, 0.45);
}

/* PC 链接客服：居中卡片 + 右栏热门咨询 */
@media (min-width: 769px) {
  .mq-widget--standalone .mq-panel {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%) !important;
    width: min(920px, 94vw);
    height: min(680px, 92vh);
    max-height: 92vh;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
  }

  .mq-widget--standalone .mq-panel__layout {
    flex-direction: row;
  }

  .mq-widget--standalone .mq-panel__chat {
    flex: 1;
    min-width: 0;
  }

  .mq-widget--standalone .mq-panel__aside {
    display: flex;
    flex-direction: column;
    width: 300px;
    flex-shrink: 0;
    background: #fff;
    border-left: 1px solid var(--mq-border);
  }

  .mq-widget--standalone .mq-panel__body {
    background: #f5f6f8;
  }

  .mq-widget--standalone .mq-msg__bubble {
    max-width: 360px;
  }
}

/* 旧版窄屏居中（嵌入非 standalone 时保留） */
@media (min-width: 481px) and (max-width: 768px) {
  .mq-widget:not(.mq-widget--standalone) .mq-panel {
    inset: 0;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(440px, 100%);
    height: 100%;
    max-height: 100vh;
    border-left: 1px solid rgba(0, 0, 0, 0.06);
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.08);
  }
}

/* ── Mobile ── */
@media (max-width: 480px) {
  .mq-panel {
    inset: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    transform: translateY(100%);
  }
  .mq-panel.mq-panel--open {
    transform: translateY(0);
  }
  .mq-launcher {
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    width: 52px;
    height: 52px;
  }
  .mq-panel__header {
    padding-top: max(12px, env(safe-area-inset-top));
  }
  .mq-msg__bubble { max-width: 78vw; }

  .mq-widget--standalone .mq-panel,
  .mq-widget--standalone .mq-panel.mq-panel--open {
    transform: none;
  }
}

.mq-msg__header {
  display: block;
  font-size: 13px;
  color: var(--mq-text-secondary);
  margin-bottom: 6px;
  line-height: 1.45;
}

.mq-msg__bubble--rich {
  line-height: 1.55;
}

.mq-link-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--mq-border);
}

.mq-link-row:first-of-type {
  margin-top: 8px;
}

.mq-link-row__label {
  font-size: 13px;
  color: var(--mq-text-primary);
  margin-bottom: 6px;
}

.mq-link-row__body {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mq-link-row__url {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--mq-primary);
  word-break: break-all;
  text-decoration: none;
}

.mq-link-row__copy {
  flex-shrink: 0;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  color: #fff;
  background: var(--mq-primary);
  cursor: pointer;
}

.mq-link-row__copy:active {
  background: var(--mq-primary-hover);
}

.mq-msg__bubble--faq {
  padding: 12px 14px;
}

.mq-faq__title {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--mq-text-primary);
}

.mq-faq-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 8px 0;
  font-size: 14px;
  color: var(--mq-primary);
  cursor: pointer;
  line-height: 1.4;
}

.mq-faq-item:hover {
  text-decoration: underline;
}

.mq-faq-item__num {
  font-weight: 600;
}
