﻿/* 前台用户中心蓝色直角风格：AI 悬浮球助手 */
.ai-ops-widget {
  position: fixed;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #040f43;
  --ai-primary: #165dff;
  --ai-primary-hover: #0f4bcc;
  --ai-primary-soft: #f1f6ff;
  --ai-border: #e1e6f0;
  --ai-border-soft: #eef2f7;
  --ai-text: #040f43;
  --ai-text-secondary: #4e5969;
  --ai-text-muted: #86909c;
  --ai-bg-soft: #f7f9fc;
  --ai-shadow: 0 0 20px rgba(0, 0, 0, 0.06);
}

.ai-ops-widget * { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== 悬浮球 ===== */
.ai-ops-ball {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 64px;
  height: 64px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ai-primary);
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, filter 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  overflow: visible;
  will-change: left, top, transform;
  z-index: 3;
}

.ai-ops-ball::before,
.ai-ops-ball::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 2px solid rgba(22, 93, 255, 0.58);
  background: radial-gradient(circle, rgba(22, 93, 255, 0.16) 0%, rgba(22, 93, 255, 0.08) 46%, rgba(22, 93, 255, 0) 72%);
  box-shadow: 0 0 18px rgba(22, 93, 255, 0.28), 0 0 34px rgba(22, 93, 255, 0.18);
  opacity: 0;
  pointer-events: none;
  animation: ai-ops-ball-ripple 2.6s ease-out infinite;
  z-index: 0;
}

.ai-ops-ball::after {
  animation-delay: 1.4s;
}

.ai-ops-ball:hover {
  transform: translateY(-2px);
  filter: drop-shadow(0 10px 20px rgba(22, 93, 255, 0.18));
}

.ai-ops-ball:active { transform: scale(0.97); }

.ai-ops-ball.dragging {
  transform: translateZ(0);
  transition: none;
}

.ai-ops-ball-icon {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
  pointer-events: none;
  display: block;
  animation: ai-ops-icon-float 2.6s ease-in-out infinite;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  transform-origin: center;
  will-change: transform;
}

@keyframes ai-ops-icon-float {
  0%, 100% {
    transform: translateY(0) scale(1);
    filter: drop-shadow(0 4px 10px rgba(22, 93, 255, 0.14));
  }
  50% {
    transform: translateY(-2px) scale(1.04);
    filter: drop-shadow(0 8px 16px rgba(22, 93, 255, 0.2));
  }
}

.ai-ops-ball-ring {
  display: none;
}

.ai-ops-ball-bubble {
  position: fixed;
  right: 96px;
  bottom: 38px;
  max-width: 220px;
  min-width: 156px;
  padding: 10px 14px;
  border: 1px solid rgba(22, 93, 255, 0.12);
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--ai-text-secondary);
  box-shadow: 0 8px 24px rgba(22, 93, 255, 0.12);
  font-size: 12px;
  line-height: 1.6;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
  pointer-events: none;
  z-index: 2;
}

.ai-ops-ball-bubble::after {
  content: '';
  position: absolute;
  right: -6px;
  bottom: 18px;
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.98);
  border-right: 1px solid rgba(22, 93, 255, 0.12);
  border-bottom: 1px solid rgba(22, 93, 255, 0.12);
  transform: rotate(-45deg);
}

.ai-ops-ball-bubble.is-right::after {
  left: -6px;
  right: auto;
  border-right: none;
  border-bottom: none;
  border-left: 1px solid rgba(22, 93, 255, 0.12);
  border-top: 1px solid rgba(22, 93, 255, 0.12);
  transform: rotate(-45deg);
}

.ai-ops-ball-bubble.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ai-ops-ball-bubble-text {
  display: block;
  white-space: normal;
}

@keyframes ai-ops-ball-ripple {
  0% {
    opacity: 0.72;
    transform: scale(0.86);
  }
  48% {
    opacity: 0.32;
    transform: scale(1.18);
  }
  82% {
    opacity: 0.08;
    transform: scale(1.42);
  }
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}

/* ===== 面板外壳 ===== */
.ai-ops-panel {
  position: fixed;
  width: 420px;
  height: 600px;
  min-width: 340px;
  min-height: 420px;
  max-width: 90vw;
  max-height: 90vh;
  background: #fff;
  border: 1px solid var(--ai-border-soft);
  border-radius: 1px;
  box-shadow: var(--ai-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px) scale(0.97);
  transform-origin: bottom right;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.ai-ops-widget--open .ai-ops-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.ai-ops-panel.dragging {
  transition: none;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.15);
}

/* ===== 头部 ===== */
.ai-ops-header {
  padding: 16px 20px;
  background: linear-gradient(180deg, #f7faff 0%, #ffffff 100%);
  border-bottom: 1px dashed var(--ai-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  cursor: move;
  user-select: none;
  -webkit-user-select: none;
}

.ai-ops-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-ops-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ecf2ff;
  border: 1px solid rgba(22, 93, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--ai-primary);
  flex-shrink: 0;
}

.ai-ops-header-info h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ai-text);
  margin: 0;
  line-height: 1.4;
}

.ai-ops-header-info .ai-ops-status {
  font-size: 12px;
  color: var(--ai-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-ops-header-info .ai-ops-status::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #00b42a;
  border-radius: 50%;
}

.ai-ops-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ai-ops-header button {
  background: #fff;
  border: 1px solid transparent;
  color: var(--ai-text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 1px;
  font-size: 14px;
  line-height: 1;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
}

.ai-ops-header button:hover {
  background: var(--ai-primary-soft);
  border-color: rgba(22, 93, 255, 0.14);
  color: var(--ai-primary);
}

/* ===== 快捷按钮 ===== */
.ai-ops-quick {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 12px 20px;
  background: #fff;
  border-bottom: 1px dashed var(--ai-border);
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.ai-ops-quick::-webkit-scrollbar { height: 6px; }
.ai-ops-quick::-webkit-scrollbar-track { background: transparent; }
.ai-ops-quick::-webkit-scrollbar-thumb {
  background: #d4ddeb;
  border-radius: 999px;
}

.ai-ops-quick-btn {
  padding: 6px 12px;
  background: #fff;
  border: 1px solid var(--ai-border);
  border-radius: 1px;
  font-size: 12px;
  cursor: pointer;
  color: var(--ai-text-secondary);
  white-space: nowrap;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 4px;
  max-width: none;
}

.ai-ops-quick-btn:hover {
  border-color: var(--ai-primary);
  color: var(--ai-primary);
  background: var(--ai-primary-soft);
}

/* ===== 消息区域 ===== */
.ai-ops-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: var(--ai-bg-soft);
  scroll-behavior: smooth;
}

.ai-ops-messages::-webkit-scrollbar { width: 5px; }
.ai-ops-messages::-webkit-scrollbar-track { background: transparent; }
.ai-ops-messages::-webkit-scrollbar-thumb { background: #d4ddeb; border-radius: 3px; }
.ai-ops-messages::-webkit-scrollbar-thumb:hover { background: #b8c6dd; }

.ai-ops-msg {
  margin-bottom: 16px;
  display: flex;
  animation: ai-ops-fadeIn 0.2s ease;
}

.ai-ops-messages.ai-ops-messages--streaming {
  scroll-behavior: auto;
}

.ai-ops-messages.ai-ops-messages--streaming .ai-ops-msg,
.ai-ops-msg.ai-ops-msg--typing {
  animation: none;
}

.ai-ops-msg.ai-ops-msg--typing .ai-ops-loading span {
  animation: ai-ops-bounce 1.2s ease-in-out infinite;
}

@keyframes ai-ops-fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-ops-msg-user { justify-content: flex-end; }
.ai-ops-msg-ai { justify-content: flex-start; }

.ai-ops-msg-ai .ai-ops-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ecf2ff;
  border: 1px solid rgba(22, 93, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--ai-primary);
  flex-shrink: 0;
  margin-right: 8px;
  margin-top: 2px;
}

.ai-ops-msg-ai .ai-ops-msg-content {
  max-width: 80%;
}

.ai-ops-bubble {
  padding: 10px 14px;
  border-radius: 1px;
  font-size: 13.5px;
  line-height: 1.65;
  word-break: break-word;
  white-space: pre-wrap;
  box-shadow: 0 0 0 1px rgba(225, 230, 240, 0.7);
}

.ai-ops-reply-text {
  display: block;
  min-height: 1.6em;
}

.ai-ops-thinking-text {
  color: var(--ai-text-muted);
}

.ai-ops-msg-user .ai-ops-bubble {
  background: var(--ai-primary);
  color: #fff;
  border-bottom-right-radius: 1px;
  max-width: 75%;
  box-shadow: none;
}

.ai-ops-msg-ai .ai-ops-bubble {
  background: #fff;
  color: var(--ai-text-secondary);
  border-bottom-left-radius: 1px;
}

.ai-ops-msg-ai .ai-ops-bubble a {
  color: var(--ai-primary);
  text-decoration: none;
}

.ai-ops-msg-ai .ai-ops-bubble a:hover { text-decoration: underline; }

/* ===== 加载动画 ===== */
.ai-ops-loading {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 2px;
}

.ai-ops-loading--inline {
  margin-top: 6px;
}

.ai-ops-loading span {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--ai-primary);
  border-radius: 50%;
  animation: ai-ops-bounce 1.2s ease-in-out infinite;
}

.ai-ops-loading span:nth-child(2) { animation-delay: 0.15s; }
.ai-ops-loading span:nth-child(3) { animation-delay: 0.3s; }

@keyframes ai-ops-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ===== 输入区域 ===== */
.ai-ops-input {
  padding: 14px 20px 16px;
  border-top: 1px dashed var(--ai-border);
  flex-shrink: 0;
  background: #fff;
}

.ai-ops-input-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--ai-border);
  border-radius: 1px;
  padding: 6px 6px 6px 14px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.ai-ops-input-box:focus-within {
  border-color: var(--ai-primary);
  box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.08);
  background: #fff;
}

.ai-ops-input textarea {
  flex: 1;
  border: none;
  background: transparent;
  padding: 6px 0;
  font-size: 13.5px;
  resize: none;
  height: 22px;
  min-height: 22px;
  max-height: 120px;
  overflow-y: hidden;
  font-family: inherit;
  outline: none;
  color: var(--ai-text);
  line-height: 1.5;
}

.ai-ops-input textarea::placeholder { color: var(--ai-text-muted); }

.ai-ops-send-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 1px;
  background: var(--ai-primary);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}

.ai-ops-send-btn:hover { background: var(--ai-primary-hover); }
.ai-ops-send-btn:active { transform: scale(0.95); }
.ai-ops-send-btn:disabled { background: #cbd5e1; cursor: not-allowed; }
.ai-ops-send-btn.ai-ops-send-btn--pause {
  background: #ef4444;
}
.ai-ops-send-btn.ai-ops-send-btn--pause:hover {
  background: #dc2626;
}

.ai-ops-send-btn svg { width: 14px; height: 14px; }

.ai-ops-disclaimer {
  margin-top: 8px;
  font-size: 11px;
  color: var(--ai-text-muted);
  text-align: center;
}

/* ===== 交互增强与欢迎区 ===== */
.ai-ops-widget--open .ai-ops-panel {
  animation: ai-ops-panel-enter 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ai-ops-messages-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  background: linear-gradient(180deg, #f8fbff 0%, #f4f8fd 100%);
}

.ai-ops-home-layer {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  z-index: 2;
}

.ai-ops-messages {
  height: 100%;
}

.ai-ops-input-area {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.ai-ops-quick--dock {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 0 20px;
  max-height: 0;
  opacity: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border-top: 0 solid transparent;
  transition: max-height 0.24s ease, opacity 0.2s ease, padding 0.24s ease, border-top-width 0.24s ease;
}

.ai-ops-quick--dock.show {
  padding: 12px 20px 8px;
  max-height: 58px;
  opacity: 1;
  border-top: 1px dashed var(--ai-border);
}

.ai-ops-quick-btn--dock {
  background: #f7faff;
}

.ai-ops-empty {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 24px 20px;
  animation: ai-ops-fadeIn 0.28s ease;
}

.ai-ops-empty-figure {
  width: 92px;
  height: 92px;
  padding: 10px;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f1f6ff 100%);
  box-shadow: 0 20px 44px rgba(22, 93, 255, 0.14);
  animation: ai-ops-float-slow 3.2s ease-in-out infinite;
}

.ai-ops-empty-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ai-ops-empty-title {
  margin-top: 20px;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.02em;
}

.ai-ops-empty-desc {
  max-width: 280px;
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ai-text-secondary);
}

.ai-ops-empty-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.ai-ops-continue-btn {
  margin-top: 14px;
  border: none;
  background: transparent;
  color: var(--ai-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.ai-ops-continue-btn:hover {
  opacity: 0.86;
  transform: translateY(-1px);
}

.ai-ops-auth-btn {
  min-width: 108px;
  height: 38px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ai-primary);
  border-radius: 1px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.ai-ops-auth-btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.ai-ops-auth-btn--primary {
  background: var(--ai-primary);
  color: #fff;
  box-shadow: 0 12px 24px rgba(22, 93, 255, 0.2);
}

.ai-ops-auth-btn--primary:hover {
  background: var(--ai-primary-hover);
  color: #fff;
}

.ai-ops-auth-btn--secondary {
  background: #fff;
  color: var(--ai-primary);
}

.ai-ops-auth-btn--secondary:hover {
  background: var(--ai-primary-soft);
  color: var(--ai-primary);
}

/* ===== 腾讯云KiKi风格 - 已登录欢迎页 ===== */
.qcaa-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 16px;
  text-align: center;
}

.qcaa-empty-state__hero {
  margin-bottom: 16px;
}

.qcaa-empty-state__avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--ai-primary-soft);
  box-shadow: 0 8px 24px rgba(22, 93, 255, 0.15);
}

.qcaa-empty-state__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qcaa-empty-state__info {
  margin-bottom: 20px;
}

.qcaa-empty-state__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--ai-text);
  line-height: 1.4;
  margin-bottom: 6px;
}

.qcaa-empty-state__subtitle {
  font-size: 14px;
  color: var(--ai-text-secondary);
  margin-top: 8px;
}

.qcaa-empty-state__desc {
  font-size: 13px;
  color: var(--ai-text-muted);
  margin-top: 12px;
  line-height: 1.5;
}

/* 横向快捷问题按钮 */
.qcaa-rec__group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 0 4px;
}

.qcaa-rec__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: var(--ai-bg-soft);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  color: var(--ai-text);
  transition: all 0.15s ease;
}

.qcaa-rec__item:hover {
  background: var(--ai-primary-soft);
  color: var(--ai-primary);
}

.qcaa-rec__item svg:first-child {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.qcaa-rec__item-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qcaa-rec__item svg:last-child {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  opacity: 0.6;
  transition: transform 0.15s ease;
}

.qcaa-rec__item:hover svg:last-child {
  transform: translateX(2px);
  opacity: 1;
}

.ai-ops-quick--hero {
  margin-top: 22px;
  justify-content: flex-start;
  border-bottom: 0;
  padding: 0 2px 6px;
  background: transparent;
  flex-wrap: nowrap;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
}

.ai-ops-quick-btn--hero {
  min-height: 36px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.ai-ops-avatar,
.ai-ops-msg-ai .ai-ops-avatar-sm {
  overflow: hidden;
}

.ai-ops-avatar {
  padding: 4px;
}

.ai-ops-avatar img,
.ai-ops-msg-ai .ai-ops-avatar-sm img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ai-ops-msg-ai .ai-ops-avatar-sm {
  padding: 3px;
}

.ai-ops-ball-bubble.show {
  animation: ai-ops-bubble-in 0.24s ease;
}

@keyframes ai-ops-panel-enter {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes ai-ops-bubble-in {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes ai-ops-float-slow {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}



/* ===== 自定义确认弹窗 ===== */
.ai-ops-dialog {
  align-items: center;
  background: rgba(15, 23, 42, 0.28);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 0;
  transition: opacity 0.16s ease;
  z-index: 20;
}

.ai-ops-dialog.show {
  opacity: 1;
  pointer-events: auto;
}

.ai-ops-dialog-box {
  background: #fff;
  border: 1px solid var(--ai-border);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
  max-width: calc(100% - 40px);
  padding: 18px;
  width: 280px;
}

.ai-ops-dialog-title {
  color: var(--ai-text);
  font-size: 15px;
  font-weight: 700;
}

.ai-ops-dialog-text {
  color: var(--ai-text-secondary);
  font-size: 13px;
  line-height: 1.7;
  margin-top: 8px;
}

.ai-ops-dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

.ai-ops-dialog-actions button {
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  height: 32px;
  padding: 0 14px;
}

.ai-ops-dialog-cancel {
  background: #fff;
  border: 1px solid var(--ai-border);
  color: var(--ai-text-secondary);
}

.ai-ops-dialog-confirm {
  background: var(--ai-primary);
  border: 1px solid var(--ai-primary);
  color: #fff;
}

/* ===== 缩放手柄（8个方向） ===== */
.ai-ops-resize {
  position: absolute;
  z-index: 10;
}

.ai-ops-resize--tl { top: 0; left: 0; width: 12px; height: 12px; cursor: nw-resize; }
.ai-ops-resize--t  { top: 0; left: 12px; right: 12px; height: 6px; cursor: n-resize; }
.ai-ops-resize--tr { top: 0; right: 0; width: 12px; height: 12px; cursor: ne-resize; }
.ai-ops-resize--r  { top: 12px; right: 0; bottom: 12px; width: 6px; cursor: e-resize; }
.ai-ops-resize--br { bottom: 0; right: 0; width: 12px; height: 12px; cursor: se-resize; }
.ai-ops-resize--b  { bottom: 0; left: 12px; right: 12px; height: 6px; cursor: s-resize; }
.ai-ops-resize--bl { bottom: 0; left: 0; width: 12px; height: 12px; cursor: sw-resize; }
.ai-ops-resize--l  { top: 12px; left: 0; bottom: 12px; width: 6px; cursor: w-resize; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .ai-ops-ball {
    right: 16px;
    bottom: 16px;
    width: 64px;
    height: 64px;
  }

  .ai-ops-ball-icon {
    animation: none;
    filter: drop-shadow(0 6px 14px rgba(22, 93, 255, 0.18));
    transform: translateZ(0);
  }

  .ai-ops-ball-bubble {
    right: 78px;
    bottom: 28px;
    max-width: 180px;
    min-width: 132px;
    padding: 8px 12px;
    font-size: 12px;
  }

  .ai-ops-panel {
    width: calc(100vw - 16px);
    height: calc(100vh - 60px);
    border-radius: 1px;
  }
}

@media (max-width: 480px) {
  .ai-ops-panel {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    right: 0 !important;
    bottom: 0 !important;
    top: 0 !important;
    left: 0 !important;
  }
}


/* 2026-07-01 常见问题贴近输入框、隐藏横向滚动条，并支持鼠标按住拖动滑动 */
.ai-ops-quick {
  -ms-overflow-style: none;
  cursor: grab;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  user-select: none;
  -webkit-user-select: none;
}

.ai-ops-quick::-webkit-scrollbar {
  display: none;
}

.ai-ops-quick .ai-ops-quick-btn {
  cursor: inherit;
}

.ai-ops-quick--dock {
  border-top: 0;
}

.ai-ops-quick--dock.show {
  border-top: 1px solid var(--ai-border);
  max-height: 44px;
  padding: 6px 20px 2px;
}

.ai-ops-quick-btn--dock {
  line-height: 1.25;
  padding-bottom: 5px;
  padding-top: 5px;
}

.ai-ops-quick--dragging {
  cursor: grabbing;
}

.ai-ops-quick--dragging .ai-ops-quick-btn {
  cursor: grabbing;
  pointer-events: none;
}
/* 拖动悬浮球时锁定页面触摸滚动，避免手机端页面跟着滑动 */
html.ai-ops-touch-lock,
body.ai-ops-touch-lock {
  overscroll-behavior: none;
  touch-action: none;
}

html.ai-ops-touch-lock,
body.ai-ops-touch-lock {
  overflow: hidden;
}
/* 2026-07-01 移动端和交互覆盖：高清图标、80%居中窗口、常见问题拖动、触摸锁 */
.ai-ops-ball {
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  will-change: left, top, transform;
}

.ai-ops-ball::before,
.ai-ops-ball::after {
  inset: 5px;
  border: 2px solid rgba(22, 93, 255, 0.58);
  background: radial-gradient(circle, rgba(22, 93, 255, 0.16) 0%, rgba(22, 93, 255, 0.08) 46%, rgba(22, 93, 255, 0) 72%);
  box-shadow: 0 0 18px rgba(22, 93, 255, 0.28), 0 0 34px rgba(22, 93, 255, 0.18);
  animation: ai-ops-ball-ripple 2.6s ease-out infinite;
  z-index: 0;
}

.ai-ops-ball.dragging {
  transform: translateZ(0);
  transition: none;
}

.ai-ops-ball-icon {
  position: relative;
  z-index: 1;
  object-fit: contain;
  image-rendering: auto;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform;
}

@keyframes ai-ops-ball-ripple {
  0% { opacity: 0.72; transform: scale(0.86); }
  48% { opacity: 0.32; transform: scale(1.18); }
  82% { opacity: 0.08; transform: scale(1.42); }
  100% { opacity: 0; transform: scale(1.5); }
}

.ai-ops-dialog-box,
.ai-ops-dialog-actions button {
  border-radius: 0;
}

.ai-ops-quick {
  -ms-overflow-style: none;
  cursor: grab;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  user-select: none;
  -webkit-user-select: none;
}

.ai-ops-quick::-webkit-scrollbar {
  display: none;
}

.ai-ops-quick .ai-ops-quick-btn {
  cursor: inherit;
}

.ai-ops-quick--dock {
  border-top: 0;
}

.ai-ops-quick--dock.show {
  border-top: 1px solid var(--ai-border);
  max-height: 44px;
  padding: 6px 20px 2px;
}

.ai-ops-quick-btn--dock {
  line-height: 1.25;
  padding-bottom: 5px;
  padding-top: 5px;
}

.ai-ops-quick--dragging {
  cursor: grabbing;
}

.ai-ops-quick--dragging .ai-ops-quick-btn {
  cursor: grabbing;
  pointer-events: none;
}

html.ai-ops-touch-lock,
body.ai-ops-touch-lock {
  overscroll-behavior: none;
  touch-action: none;
  overflow: hidden;
}

@media (max-width: 768px) {
  .ai-ops-ball {
    right: 16px;
    bottom: 96px;
    width: 64px;
    height: 64px;
  }

  .ai-ops-ball-icon {
    animation: none;
    filter: drop-shadow(0 6px 14px rgba(22, 93, 255, 0.18));
    transform: translateZ(0);
  }

  .ai-ops-ball-bubble {
    right: 78px;
    bottom: 108px;
    max-width: 180px;
    min-width: 132px;
    padding: 8px 12px;
    font-size: 12px;
  }

  .ai-ops-panel {
    width: 85vw;
    height: 85vh;
    height: 85dvh;
    max-width: 85vw;
    max-height: 85vh;
    max-height: 85dvh;
    min-width: 0;
    min-height: 0;
    border-radius: 1px;
    left: 50% !important;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, calc(-50% + 10px)) scale(0.97);
    transform-origin: center center;
  }

  .ai-ops-widget--open .ai-ops-panel {
    transform: translate(-50%, -50%) scale(1);
  }

  .ai-ops-minimize,
  .ai-ops-resize {
    display: none !important;
  }
}
/* 2026-07-01 移动端窗口缩小为 60%，放在最后确保覆盖旧规则 */
@media (max-width: 768px) {
  .ai-ops-panel {
    width: 60vw;
    height: 60vh;
    height: 60dvh;
    max-width: 60vw;
    max-height: 60vh;
    max-height: 60dvh;
    min-width: 0;
    min-height: 0;
    left: 50% !important;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, calc(-50% + 10px)) scale(0.97);
    transform-origin: center center;
  }

  .ai-ops-widget--open .ai-ops-panel {
    transform: translate(-50%, -50%) scale(1);
  }
}
/* 2026-07-02 消息内动作按钮：未登录、额度上限等状态直接给出主操作 */
.ai-ops-action-row {
  margin-top: 10px;
}

.ai-ops-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  height: 34px;
  padding: 0 16px;
  border-radius: 0;
  background: var(--ai-primary);
  color: #fff !important;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none !important;
  box-shadow: 0 10px 22px rgba(22, 93, 255, 0.2);
}

.ai-ops-action-btn:hover {
  background: var(--ai-primary-hover);
  color: #fff !important;
  text-decoration: none !important;
}

/* 2026-07-02 移动端窗口尺寸稳定为 85%，覆盖旧的 100vw/100vh 小屏规则。 */
@media (max-width: 768px) {
  .ai-ops-panel,
  .ai-ops-widget--open .ai-ops-panel {
    width: min(85vw, 480px) !important;
    height: min(85dvh, 700px) !important;
    max-width: 85vw !important;
    max-height: 85dvh !important;
    min-width: 0 !important;
    min-height: 0 !important;
    left: 50% !important;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) scale(1) !important;
    border-radius: 0 !important;
  }
}

@media (max-width: 480px) {
  .ai-ops-panel,
  .ai-ops-widget--open .ai-ops-panel {
    width: 85vw !important;
    height: 85dvh !important;
    max-width: 85vw !important;
    max-height: 85dvh !important;
  }
}
/* 2026-07-02 再次打开保持对话：底部常见问题贴近输入框，并去掉分割线。 */
.ai-ops-minimize {
  display: none !important;
}

.ai-ops-input {
  border-top: 0 !important;
  padding-top: 2px;
}

.ai-ops-quick--dock,
.ai-ops-quick--dock.show {
  border-top: 0 !important;
}

.ai-ops-quick--dock.show {
  max-height: 56px !important;
  padding: 8px 20px 4px !important;
}

.ai-ops-quick-btn--dock {
  padding-bottom: 7px !important;
  padding-top: 7px !important;
}
/* 2026-07-02 气泡大小配置强制生效：JS 会写入内联尺寸，这里兜底处理移动端覆盖。 */
.ai-ops-ball-bubble[data-bubble-size="small"] {
  width: 156px;
  max-width: 156px;
  min-width: 118px;
}

.ai-ops-ball-bubble[data-bubble-size="medium"] {
  width: 220px;
  max-width: 220px;
  min-width: 156px;
}

.ai-ops-ball-bubble[data-bubble-size="large"] {
  width: 320px;
  max-width: min(320px, calc(100vw - 24px));
  min-width: 230px;
}

@media (max-width: 768px) {
  .ai-ops-ball-bubble[data-bubble-size="small"] {
    width: 148px !important;
    max-width: 148px !important;
    min-width: 112px !important;
  }

  .ai-ops-ball-bubble[data-bubble-size="medium"] {
    width: 200px !important;
    max-width: 200px !important;
    min-width: 148px !important;
  }

  .ai-ops-ball-bubble[data-bubble-size="large"] {
    width: 268px !important;
    max-width: calc(100vw - 24px) !important;
    min-width: 210px !important;
  }
}
/* 2026-07-05 移动端窗口最终强制为 85%，防止前面旧规则覆盖。 */
@media (max-width: 768px) {
  .ai-ops-panel,
  .ai-ops-widget--open .ai-ops-panel {
    width: 85vw !important;
    height: 85dvh !important;
    max-width: 85vw !important;
    max-height: 85dvh !important;
    min-width: 0 !important;
    min-height: 0 !important;
    left: 50% !important;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) scale(1) !important;
    border-radius: 0 !important;
  }
}