/* =========================================================================
   工作台 AI 助手浮窗样式（QRVeo 私有化本地补丁，2026-10-27 v3）
   -------------------------------------------------------------------------
   全部选择器以 .vqr-ai- 前缀隔离，不依赖工作台的 CSS 变量，避免主题切换影响。
   浮窗挂在 body 上，故用 position: fixed + 高 z-index（低于 GrapesJS 模态框）。
   默认只显示可拖动的小球；展开后隐藏小球、显示面板。
   v3 新增：语音条与麦克风按钮、markdown 正文、表格、跳转按钮、系统提示气泡。
   ========================================================================= */

.vqr-ai-root {
  --ai-accent: #0f7b5f;
  --ai-accent-dark: #0b6349;
  --ai-border: #e5e7eb;
  --ai-text: #1f2937;
  --ai-muted: #6b7280;
  --ai-bg: #ffffff;
  --ai-soft: #f6f8f7;
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 2147482000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ai-text);
}

.vqr-ai-root *,
.vqr-ai-root *::before,
.vqr-ai-root *::after {
  box-sizing: border-box;
}

/* ---------------- 可拖动小球 ---------------- */

.vqr-ai-ball {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #12a06f 0%, var(--ai-accent) 58%, var(--ai-accent-dark) 100%);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  z-index: 2147482001;
  box-shadow: 0 10px 26px rgba(15, 123, 95, .38), 0 2px 8px rgba(15, 123, 95, .24);
  transition: transform .15s ease, box-shadow .15s ease;
}

.vqr-ai-ball::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(18, 160, 111, .28);
  animation: vqr-ai-pulse 2.4s ease-out infinite;
  pointer-events: none;
}

@keyframes vqr-ai-pulse {
  0%   { transform: scale(.92); opacity: .9; }
  70%  { transform: scale(1.22); opacity: 0; }
  100% { transform: scale(1.22); opacity: 0; }
}

.vqr-ai-ball:hover {
  transform: scale(1.06);
  box-shadow: 0 14px 30px rgba(15, 123, 95, .44), 0 2px 8px rgba(15, 123, 95, .26);
}

.vqr-ai-ball.is-dragging {
  cursor: grabbing;
  transform: scale(1.02);
  transition: none;
}

.vqr-ai-ball.is-dragging::after { display: none; }

.vqr-ai-ball-ico {
  pointer-events: none;
  transform: translateY(-1px);
}

.vqr-ai-root.is-open .vqr-ai-ball { display: none !important; }

/* ---------------- 面板 ---------------- */

/* hidden 属性必须显式压住 display:flex，否则面板会一直显示、与小球同时出现 */
.vqr-ai-panel[hidden] { display: none !important; }

.vqr-ai-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 620px;
  max-height: calc(100vh - 48px);
  background: var(--ai-bg);
  border: 1px solid var(--ai-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .22), 0 4px 12px rgba(15, 23, 42, .08);
  animation: vqr-ai-in .18s ease-out;
}

@keyframes vqr-ai-in {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.vqr-ai-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: linear-gradient(135deg, #0f7b5f, #0b6349);
  color: #fff;
  flex: 0 0 auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.vqr-ai-panel.is-dragging .vqr-ai-hd { cursor: grabbing; }
.vqr-ai-panel.is-dragging { transition: none; }

/* ---------------- 面板缩放把手（8 个方向） ----------------
   把手必须放在面板内侧：面板是 overflow:hidden，伸到外面的部分会被裁掉。
   默认全透明，hover 到边界才浮出一点颜色，平时不干扰阅读。 */

.vqr-ai-rs {
  position: absolute;
  z-index: 20;
  display: block;
  background: transparent;
  transition: background .12s ease;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.vqr-ai-rs:hover { background: rgba(15, 123, 95, .22); }

/* 上边压在深绿色标题栏上，用浅色提示才看得见 */
.vqr-ai-rs-n:hover { background: rgba(255, 255, 255, .38); }

/* 角把手不铺底色：面板圆角会把它裁成半月形，只靠花纹提示 */
.vqr-ai-rs-ne:hover,
.vqr-ai-rs-nw:hover,
.vqr-ai-rs-se:hover,
.vqr-ai-rs-sw:hover { background: transparent; }

/* 四条边：只占边缘 5px，靠内侧 */
.vqr-ai-rs-n,
.vqr-ai-rs-s {
  left: 10px;
  right: 10px;
  height: 5px;
  cursor: ns-resize;
}
.vqr-ai-rs-n { top: 0; }
.vqr-ai-rs-s { bottom: 0; }

.vqr-ai-rs-e,
.vqr-ai-rs-w {
  top: 10px;
  bottom: 10px;
  width: 5px;
  cursor: ew-resize;
}
.vqr-ai-rs-e { right: 0; }
.vqr-ai-rs-w { left: 0; }

/* 四个角：11px 见方，压住两条边的端头 */
.vqr-ai-rs-ne,
.vqr-ai-rs-nw,
.vqr-ai-rs-se,
.vqr-ai-rs-sw {
  width: 11px;
  height: 11px;
}

.vqr-ai-rs-nw { top: 0; left: 0; cursor: nwse-resize; }
.vqr-ai-rs-se { bottom: 0; right: 0; cursor: nwse-resize; }
.vqr-ai-rs-ne { top: 0; right: 0; cursor: nesw-resize; }
.vqr-ai-rs-sw { bottom: 0; left: 0; cursor: nesw-resize; }

/* 右下角画两道斜纹，告诉用户"这里能拉"。
   必须离角 5px 以上：面板圆角 14px，再靠外会被 overflow:hidden 裁掉。 */
.vqr-ai-rs-se::before,
.vqr-ai-rs-se::after {
  content: '';
  position: absolute;
  border-right: 1.5px solid rgba(15, 123, 95, .38);
  border-bottom: 1.5px solid rgba(15, 123, 95, .38);
  border-bottom-right-radius: 2px;
  pointer-events: none;
  transition: border-color .12s ease;
}

.vqr-ai-rs-se::after { right: 5px; bottom: 5px; width: 8px; height: 8px; }
.vqr-ai-rs-se::before { right: 9px; bottom: 9px; width: 4px; height: 4px; opacity: .55; }

.vqr-ai-rs-se:hover::after { border-color: rgba(15, 123, 95, .85); }
.vqr-ai-rs-se:hover::before { border-color: rgba(15, 123, 95, .6); }

/* 拖拽/缩放期间关掉 animation，不然每次改宽高都会重播入场动画 */
.vqr-ai-panel.is-resizing {
  animation: none;
  transition: none;
}

.vqr-ai-panel.is-resizing .vqr-ai-rs { cursor: inherit; }

/* 缩放中禁止选中文字和 iframe 抢指针 */
.vqr-ai-panel.is-resizing,
.vqr-ai-panel.is-resizing * {
  user-select: none;
  -webkit-user-select: none;
}

.vqr-ai-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  /* 标题栏现在有三个动作按钮，窄面板时标题要让位而不是把按钮挤出去 */
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.vqr-ai-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7bf1b8;
  box-shadow: 0 0 0 3px rgba(123, 241, 184, .25);
}

.vqr-ai-hd-acts {
  display: flex;
  gap: 6px;
}

.vqr-ai-hd-acts button {
  height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 7px;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  transition: background .15s ease;
}

.vqr-ai-hd-acts button:hover { background: rgba(255, 255, 255, .2); }

/* 动作按钮不能被标题挤变形 */
.vqr-ai-hd-acts { flex: 0 0 auto; }
.vqr-ai-hd-acts button { white-space: nowrap; }

/* ---------------- 状态条 ---------------- */

.vqr-ai-status {
  flex: 0 0 auto;
  padding: 6px 14px;
  font-size: 11.5px;
  color: #9a6a00;
  background: #fff8e6;
  border-bottom: 1px solid #f3e3b8;
}

.vqr-ai-status.is-ok {
  color: #0b6349;
  background: #eefaf4;
  border-bottom-color: #cdeee0;
}

/* ---------------- 消息区 ---------------- */

.vqr-ai-msgs {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  background: var(--ai-soft);
}

.vqr-ai-msg {
  display: flex;
  margin-bottom: 12px;
}

.vqr-ai-msg.is-user { justify-content: flex-end; }

.vqr-ai-bubble {
  max-width: 92%;
  padding: 9px 11px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--ai-border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  overflow-wrap: anywhere;
}

.vqr-ai-msg.is-user .vqr-ai-bubble {
  background: var(--ai-accent);
  border-color: var(--ai-accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.vqr-ai-msg.is-ai .vqr-ai-bubble {
  width: 92%;
  border-bottom-left-radius: 4px;
}

.vqr-ai-text { white-space: pre-wrap; }

/* ---------------- 推理过程 ---------------- */

.vqr-ai-reason {
  margin-bottom: 8px;
  border: 1px dashed #d9e2dd;
  border-radius: 8px;
  background: #fbfdfc;
  overflow: hidden;
}

.vqr-ai-reason summary {
  padding: 5px 9px;
  font-size: 12px;
  color: var(--ai-muted);
  cursor: pointer;
  user-select: none;
}

.vqr-ai-reason-pre {
  margin: 0;
  padding: 8px 9px;
  max-height: 140px;
  overflow: auto;
  font-size: 11.5px;
  line-height: 1.55;
  color: #55605a;
  white-space: pre-wrap;
  word-break: break-word;
  border-top: 1px dashed #e6ece9;
}

/* ---------------- Tab ---------------- */

.vqr-ai-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}

.vqr-ai-tabs button {
  height: 24px;
  padding: 0 10px;
  border: 1px solid var(--ai-border);
  border-radius: 6px;
  background: #fff;
  color: var(--ai-muted);
  font-size: 12px;
  cursor: pointer;
}

.vqr-ai-tabs button.is-on {
  background: #eefaf4;
  border-color: #b9e3d2;
  color: var(--ai-accent-dark);
  font-weight: 600;
}

/* ---------------- 代码 / 预览 ---------------- */

.vqr-ai-code {
  margin: 0;
  padding: 9px 10px;
  max-height: 240px;
  overflow: auto;
  background: #0f172a;
  color: #d7e3f4;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.vqr-ai-preview {
  border: 1px solid var(--ai-border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.vqr-ai-frame {
  display: block;
  width: 100%;
  height: 260px;
  border: 0;
  background: #fff;
}

/* ---------------- 操作按钮 ---------------- */

.vqr-ai-acts {
  display: flex;
  gap: 8px;
  margin-top: 9px;
}

.vqr-ai-acts button {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--ai-border);
  border-radius: 7px;
  background: #fff;
  color: var(--ai-text);
  font-size: 12.5px;
  cursor: pointer;
  transition: all .15s ease;
}

.vqr-ai-acts button:hover:not(:disabled) {
  border-color: #b9e3d2;
  background: #f2fbf7;
}

.vqr-ai-acts button.primary {
  border-color: var(--ai-accent);
  background: var(--ai-accent);
  color: #fff;
  font-weight: 600;
}

.vqr-ai-acts button.primary:hover:not(:disabled) {
  background: var(--ai-accent-dark);
  border-color: var(--ai-accent-dark);
}

.vqr-ai-acts button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.vqr-ai-err {
  margin-top: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 12px;
  white-space: pre-wrap;
}

/* ---------------- 快捷指令 ---------------- */

.vqr-ai-quick {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px 0;
  background: #fff;
}

.vqr-ai-quick button {
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--ai-border);
  border-radius: 13px;
  background: #fff;
  color: #4b5563;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s ease;
}

.vqr-ai-quick button:hover {
  border-color: #b9e3d2;
  background: #f2fbf7;
  color: var(--ai-accent-dark);
}

/* ---------------- 输入区 ---------------- */

.vqr-ai-compose {
  flex: 0 0 auto;
  padding: 8px 12px 12px;
  background: #fff;
  border-top: 1px solid var(--ai-border);
}

.vqr-ai-compose textarea {
  display: block;
  width: 100%;
  min-height: 54px;
  max-height: 132px;
  padding: 9px 10px;
  border: 1px solid var(--ai-border);
  border-radius: 9px;
  outline: none;
  /* 面板右下角有缩放手柄了，输入框再留一个 resize 角会让人分不清拖的是谁 */
  resize: none;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ai-text);
  background: #fbfcfc;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.vqr-ai-compose textarea:focus {
  border-color: var(--ai-accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 123, 95, .12);
}

.vqr-ai-compose-acts {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.vqr-ai-compose-acts button {
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--ai-border);
  border-radius: 8px;
  background: #fff;
  color: var(--ai-text);
  font-size: 13px;
  cursor: pointer;
}

.vqr-ai-compose-acts button.primary {
  min-width: 78px;
  border-color: var(--ai-accent);
  background: var(--ai-accent);
  color: #fff;
  font-weight: 600;
}

.vqr-ai-compose-acts button.primary:hover { background: var(--ai-accent-dark); }

.vqr-ai-compose-acts button.is-stop {
  background: #b91c1c;
  border-color: #b91c1c;
}

.vqr-ai-compose-acts button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* ---------------- Toast ---------------- */

.vqr-ai-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  z-index: 2147483000;
  transform: translateX(-50%);
  padding: 9px 16px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .28);
  opacity: 1;
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}

.vqr-ai-toast.is-err { background: #b91c1c; }
.vqr-ai-toast.is-out { opacity: 0; transform: translateX(-50%) translateY(-8px); }

/* ============ 2026-10-28 v5：可执行动作（应用到画布 + 撤销） ============ */

/* 带操作按钮的提示：可点击，所以要把父级的 pointer-events 打开 */
.vqr-ai-toast.has-act {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  padding: 9px 10px 9px 16px;
}

.vqr-ai-toast-act {
  flex: none;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .38);
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.vqr-ai-toast-act:hover {
  background: rgba(255, 255, 255, .24);
  border-color: rgba(255, 255, 255, .6);
}

.vqr-ai-toast-act:active { transform: translateY(1px); }

/* ============ 2026-10-27 v3：语音输入 / 数据简报 / 页面导航 ============ */

/* 标题栏上的当前页面名 */
.vqr-ai-page {
  margin-left: 2px;
  padding: 1px 7px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .16);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .2px;
  opacity: .95;
  /* 页面名可能很长，窄面板时省略而不是撑破标题栏 */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------- 助手文本回答（markdown 渲染结果） ---------------- */

.vqr-ai-body {
  font-size: 13px;
  line-height: 1.62;
  color: var(--ai-text);
  overflow-wrap: anywhere;
}

.vqr-ai-body.is-streaming {
  white-space: pre-wrap;
  color: #374151;
}

.vqr-ai-body.is-streaming::after {
  content: "▍";
  margin-left: 1px;
  color: var(--ai-accent);
  animation: vqr-ai-caret 1s steps(2) infinite;
}

@keyframes vqr-ai-caret {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.vqr-ai-body > *:first-child { margin-top: 0; }
.vqr-ai-body > *:last-child { margin-bottom: 0; }

.vqr-ai-body h2,
.vqr-ai-body h3,
.vqr-ai-body h4 {
  margin: 11px 0 5px;
  font-size: 13.5px;
  font-weight: 700;
  color: #0b6349;
  letter-spacing: .2px;
}

.vqr-ai-body h2 { font-size: 14.5px; }

.vqr-ai-body p { margin: 5px 0; }

.vqr-ai-body ul,
.vqr-ai-body ol {
  margin: 5px 0;
  padding-left: 19px;
}

.vqr-ai-body li { margin: 2px 0; }

.vqr-ai-body strong { color: #0b4f3c; }

.vqr-ai-body code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #eef4f1;
  color: #0b6349;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.vqr-ai-body hr {
  margin: 10px 0;
  border: 0;
  border-top: 1px solid var(--ai-border);
}

.vqr-ai-body blockquote {
  margin: 6px 0;
  padding: 4px 10px;
  border-left: 3px solid #b9e3d2;
  color: #4b5563;
  background: #f6fbf9;
}

.vqr-ai-tablewrap {
  margin: 7px 0;
  overflow-x: auto;
  border: 1px solid var(--ai-border);
  border-radius: 8px;
}

.vqr-ai-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.vqr-ai-body th,
.vqr-ai-body td {
  padding: 5px 8px;
  border-bottom: 1px solid #eef1f0;
  text-align: left;
  white-space: nowrap;
}

.vqr-ai-body th {
  background: #f2f8f5;
  font-weight: 600;
  color: #0b6349;
}

.vqr-ai-body tr:last-child td { border-bottom: 0; }

/* ---------------- 空状态引导 ---------------- */

.vqr-ai-welcome {
  padding: 12px 13px;
  border: 1px dashed #d7e3dc;
  border-radius: 10px;
  background: #fbfdfc;
  color: #4b5563;
}

.vqr-ai-welcome-t {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ai-accent-dark);
}

.vqr-ai-welcome ul {
  margin: 0;
  padding-left: 17px;
}

.vqr-ai-welcome li {
  margin: 3px 0;
  font-size: 12px;
  line-height: 1.6;
}

/* 已套用预设组件的说明（知识库展开结果） */
.vqr-ai-meta {
  margin-top: 7px;
  padding: 5px 8px;
  border-radius: 7px;
  background: #f2f8f5;
  color: #4b6b5e;
  font-size: 11.5px;
  line-height: 1.5;
}

.vqr-ai-meta[hidden] { display: none !important; }

/* ---------------- 系统提示气泡（跳转结果等） ---------------- */

.vqr-ai-msg.is-note { justify-content: flex-start; }

.vqr-ai-note {
  max-width: 92%;
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px dashed #d7e3dc;
  background: #f7faf8;
  color: #55605a;
  font-size: 12px;
  line-height: 1.55;
}

/* ---------------- 跳转按钮 ---------------- */

.vqr-ai-navbtn {
  border-color: #b9e3d2 !important;
  background: #eefaf4 !important;
  color: var(--ai-accent-dark) !important;
  font-weight: 600;
}

/* ---------------- 语音条 ---------------- */

.vqr-ai-voice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  padding: 6px 9px;
  border: 1px solid #f5c2c2;
  border-radius: 8px;
  background: #fff5f5;
  font-size: 12px;
  color: #b91c1c;
}

.vqr-ai-voice[hidden] { display: none !important; }

.vqr-ai-voice-tip {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vqr-ai-wave {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  flex: 0 0 auto;
}

.vqr-ai-wave i {
  display: block;
  width: 2px;
  height: 5px;
  border-radius: 1px;
  background: #e05252;
  animation: vqr-ai-wave 1s ease-in-out infinite;
}

.vqr-ai-wave i:nth-child(2) { animation-delay: .15s; }
.vqr-ai-wave i:nth-child(3) { animation-delay: .3s; }
.vqr-ai-wave i:nth-child(4) { animation-delay: .45s; }

@keyframes vqr-ai-wave {
  0%, 100% { height: 4px; opacity: .55; }
  50% { height: 13px; opacity: 1; }
}

/* ---------------- 麦克风按钮 ---------------- */

.vqr-ai-compose-acts .vqr-ai-mic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-width: 32px;
  padding: 0;
  border-radius: 50%;
  color: var(--ai-accent-dark);
}

.vqr-ai-compose-acts .vqr-ai-mic:hover:not(.is-na):not(.is-rec) {
  border-color: #b9e3d2;
  background: #f2fbf7;
}

/* 录音态：必须同时压住 :hover（hover 的选择器权重更高） */
.vqr-ai-compose-acts .vqr-ai-mic.is-rec,
.vqr-ai-compose-acts .vqr-ai-mic.is-rec:hover {
  border-color: #e05252;
  background: #e05252;
  color: #fff;
  animation: vqr-ai-mic-pulse 1.4s ease-out infinite;
}

@keyframes vqr-ai-mic-pulse {
  0% { box-shadow: 0 0 0 0 rgba(224, 82, 82, .45); }
  70% { box-shadow: 0 0 0 9px rgba(224, 82, 82, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 82, 82, 0); }
}

.vqr-ai-compose-acts .vqr-ai-mic.is-na {
  color: #b9c0c7;
  cursor: not-allowed;
}

/* "说完即发"开关 */
.vqr-ai-compose-acts .vqr-ai-mini {
  height: 26px;
  margin-right: auto;
  align-self: center;
  padding: 0 9px;
  border: 1px solid var(--ai-border);
  border-radius: 13px;
  background: #fff;
  color: #9aa3ad;
  font-size: 11.5px;
  cursor: pointer;
}

.vqr-ai-compose-acts .vqr-ai-mini.is-on {
  border-color: #b9e3d2;
  background: #eefaf4;
  color: var(--ai-accent-dark);
  font-weight: 600;
}

/* 改写按钮在窄屏可收缩 */
.vqr-ai-compose-acts .vqr-ai-rewrite { flex: 0 0 auto; }

/* ---------------- 小屏 ---------------- */

@media (max-width: 720px) {
  .vqr-ai-panel {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
    max-height: none;
  }
  /* 小屏面板本来就铺满，不给缩放手感上的误导 */
  .vqr-ai-rs { display: none; }
  .vqr-ai-ball { right: 16px; bottom: 16px; }
  .vqr-ai-msg.is-ai .vqr-ai-bubble { width: 100%; }
}
