/* ==================== Modal System - 统一弹窗样式系统 ====================
 * 版本: v2.1.0（动画修复版）
 * 功能: 提供统一的弹窗尺寸、动画、交互样式
 * 使用方式: 在HTML中添加 class="modal modal--xl" 等类名
 *
 * v2.0 新增 / v2.1 修复：
 *   - 遮罩层渐进模糊+淡入（@keyframes 入场，解决 display:flex 常驻渲染树问题）
 *   - 弹窗缩放+弹簧入场（非嵌套）/ 纯淡入（嵌套）
 *   - 内容区域交错渐显（header→body→footer）
 *   - 平滑退出动画（.closing 类 → transitionend 后恢复 display:none）
 *   - 关闭按钮增强旋转+涟漪效果
 *   - 侧边栏弹性滑入增强
 *   - 完整的 prefers-reduced-motion 支持
 *
 * 动画架构：
 *   隐藏状态 → [open] → .active（@keyframes 入场）→ 显示状态
 *   显示状态 → [close] → .closing（transition 退出）→ 隐藏状态(display:none)
 */

/* ==================== 基础遮罩层 ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal-backdrop);
  /* v2.1: 恢复 display:none 作为基础隐藏态 */
  display: none;
}

/* ===== 遮罩层入场动画（@keyframes）===== */
.modal-overlay.active {
  display: flex;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  /* 从透明无模糊过渡到最终状态 */
  animation: overlayFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes overlayFadeIn {
  from {
    opacity: 0;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
  }
  to {
    opacity: 1;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
}

/* ===== 遮罩层退出动画（.closing 类）===== */
.modal-overlay.closing {
  pointer-events: none; /* 立即阻断交互 */
  display: flex; /* 🐛 v2.1.1 修复：避免 active 移除后 display:none 导致动画不触发 */
  animation: overlayFadeOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes overlayFadeOut {
  from {
    opacity: 1;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  to {
    opacity: 0;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
  }
}

/*
 * 嵌套层级由 ModalManager 根据真实栈序统一写入遮罩层。
 * 这里仅保留视觉状态，禁止再次声明 z-index，避免旧 CSS 覆盖运行时栈。
 */
.modal-overlay--nested.active {
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.modal-overlay--nested.closing {
  animation-duration: 0.22s;
}

/* ==================== 弹窗容器尺寸系统 ====================
 *
 * 设计决策：
 *   - 非嵌套弹窗：scale(0.92)+translateY(12px) → 弹簧入场
 *   - 嵌套弹窗：纯 opacity 过渡（避免 transform 创建 Stacking Context）
 */

/* ===== 弹窗基础样式 ===== */
.modal {
  background: #ffffff;
  border-radius: 12px;
  box-shadow:
    0 20px 60px -15px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 80px);
  overflow: hidden;
  will-change: auto;
}

/* 统一关闭按钮合同：标题栏右侧、可见焦点、足够的鼠标/触摸命中区域。 */
.modal > :is(.modal-header, .modal-head, .dialog-header, .kb-modal-header, .db-modal-header, .qa-modal-header, .agent-chat-modal__header, .pp-modal-header, .pp-editor-toolbar),
.modal-header,
.modal-head,
.dialog-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal :is(.modal-close, .dialog-close, .dialog-close-btn, .kb-modal-close, .db-modal-close, .qa-modal-close, .pp-modal-close, .import-modal-close, .sdc-dialog-close, .concrete-modal-close, .export-modal-close, .attach-preview-close, .compare-snapshot-modal-close, .m-sheet-close, .m-progress-close, .close-btn, [data-modal-close]) {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

.modal-overlay.active > .modal,
.modal-overlay.closing > .modal {
  will-change: opacity, transform;
}

/* ★★★ 关键修复：销售解析等大型弹窗的header区域禁止被modal容器裁剪 ★★★ */
.modal--xl {
  overflow: visible;
  /* overflow:visible 会破坏 border-radius 圆角，需在子元素上补偿 */
  border-radius: 12px;
  position: relative;
}
/* Header 承接顶部圆角（因为 overflow:visible 后 modal 自身圆角对内容无效）*/
.modal--xl > .modal-header:first-child {
  border-radius: 12px 12px 0 0;
  position: relative;
  z-index: 1;
}
/* Body 承接底部圆角 */
.modal--xl > .modal-body:last-of-type {
  border-radius: 0 0 12px 12px;
  position: relative;
  z-index: 1;
}
/* 用内部body容器接替overflow控制，防止整个弹窗内容泄漏 */
/* 添加比价组弹窗需要 overflow: auto 以支持内容滚动 */
/* 比价解析弹窗同样需要 overflow: auto 以支持 SKU 列表展开后滚动 */
#addGroupModal .modal-body,
#compareModal .modal-body {
  overflow: auto;
}
.modal--xl .modal-body {
  overflow: hidden;
}
#bindingModal .modal-body {
  overflow-y: auto;
}

/* ===== 非嵌套弹窗：缩放+弹簧入场 ===== */
.modal-overlay:not(.modal-overlay--nested).active .modal {
  animation: modalEnterBounce 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalEnterBounce {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ===== 非嵌套弹窗：退出收缩 ===== */
.modal-overlay:not(.modal-overlay--nested).closing .modal {
  animation: modalExitShrink 0.28s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}

@keyframes modalExitShrink {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.95) translateY(8px);
  }
}

/* ===== 嵌套弹窗：纯淡入/出（避免 Stacking Context）===== */
.modal-overlay--nested.active .modal {
  animation: nestedModalFadeIn 0.22s ease-out forwards;
}

@keyframes nestedModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; visibility: visible; }
}

.modal-overlay--nested.closing .modal {
  animation: nestedModalFadeOut 0.18s ease-out forwards;
  pointer-events: none;
}

@keyframes nestedModalFadeOut {
  from { opacity: 1; visibility: visible; }
  to { opacity: 0; visibility: hidden; }
}

/* ==================== 尺寸变体 ==================== */

/* XL: 全工作区面板 (compareModal, bindingModal, salesAnalysisModal) */
.modal--xl {
  width: 99%;
  max-width: 99vw;
  height: auto;
  max-height: 96vh;
  display: flex;
  flex-direction: column;
}

/* L: 大型表单/详情 (addGroupModal, manualMatchModal) */
.modal--l {
  width: min(1200px, 90vw);
  height: min(700px, 85vh);
}

/* M: 中等对话框 (productCodeParserModal) */
.modal--m {
  width: min(600px, 80vw);
  max-height: min(400px, 75vh);
}

/* S: 小型确认/提示框 (importConfirmModal, shortcutsModal) */
.modal--s {
  width: min(480px, 70vw);
  max-height: min(300px, 70vh);
}

/* ==================== 侧边栏面板（弹性滑入）==================== */
.modal--sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: min(520px, 90vw);
  height: 100vh;
  max-height: none;
  background: white;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
  z-index: var(--z-modal-sidebar);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  will-change: transform;
}

.modal--sidebar.active {
  animation: sidebarSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes sidebarSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.modal--sidebar.closing {
  animation: sidebarSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}

@keyframes sidebarSlideOut {
  from { transform: translateX(0); }
  to { transform: translateX(100%); }
}

/* 侧边栏头部紫色主题 */
.modal--sidebar .modal-header {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border-bottom: none;
}
.modal--sidebar .modal-header__text { color: white; font-size: 16px; }
.modal--sidebar .modal-close {
  color: white;
  background: rgba(255, 255, 255, 0.18);
}
.modal--sidebar .modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ==================== Header（交错入场第1波）==================== */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  flex-shrink: 0;
}

.modal-overlay.active .modal-header {
  animation: staggerFadeDown 0.28s ease-out 0.05s forwards;
}

@keyframes staggerFadeDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.modal-header__icon { font-size: 22px; line-height: 1; }
.modal-header__text {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
}

/* ==================== 关闭按钮（增强动画）==================== */
.modal-close {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  transition:
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.2s ease,
    color 0.15s ease,
    box-shadow 0.2s ease;
  color: #6b7280;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  position: relative;
  overflow: hidden;
}

.modal-close::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at center, rgba(220, 38, 38, 0.15) 0%, transparent 70%);
  transform: scale(0);
  opacity: 0;
  transition:
    transform 0.4s ease-out,
    opacity 0.3s ease-out;
}

.modal-close:hover {
  background: #fee2e2;
  color: #dc2626;
  transform: rotate(90deg) scale(1.08);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15);
}
.modal-close:hover::after {
  transform: scale(2.5);
  opacity: 1;
}

.modal:focus-visible,
.modal-close:focus-visible,
.modal button:focus-visible,
.modal a:focus-visible,
.modal input:focus-visible,
.modal select:focus-visible,
.modal textarea:focus-visible {
  outline: 2px solid var(--primary-500, #6366f1);
  outline-offset: 2px;
}
.modal-close:active {
  transform: rotate(90deg) scale(0.92);
  transition-duration: 0.1s;
}

.modal-close svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  position: relative;
  z-index: 1;
}

/* ==================== Body（交错入场第2波）==================== */
.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}

.modal-overlay.active .modal-body {
  animation: staggerFadeUp 0.3s ease-out 0.1s forwards;
}

@keyframes staggerFadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-track { background: transparent; }
.modal-body::-webkit-scrollbar-thumb { background-color: #d1d5db; border-radius: 3px; }
.modal-body::-webkit-scrollbar-thumb:hover { background-color: #9ca3af; }

/* ==================== Footer（交错入场第3波）==================== */
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  flex-shrink: 0;
}

.modal-overlay.active .modal-footer {
  animation: staggerFadeUp 0.28s ease-out 0.15s forwards;
}

/* Footer 左右分栏布局 */
.modal-footer--split {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-footer--split > div:last-child {
  display: flex;
  gap: 10px;
}

/* 统一异步确认弹窗：内容优先、按钮区固定在底部，避免业务页再次自定义确认 UI。 */
.modal-confirm {
  width: min(480px, calc(100vw - 32px));
  max-width: 480px;
}

.modal-confirm__message {
  color: #344054;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-line;
}

.modal-confirm__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
}

.modal-btn {
  min-width: 80px;
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}

.modal-btn-secondary {
  color: #475467;
  background: #f2f4f7;
  border-color: #d0d5dd;
}

.modal-confirm__confirm {
  color: #ffffff;
  background: #2563eb;
}

.modal-confirm__confirm--danger {
  background: #d92d20;
}

.modal-btn:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

.modal-alert__message,
.modal-prompt__message {
  color: var(--modal-text, #26332d);
  font-size: 14px;
  line-height: 1.7;
  white-space: normal;
}

.modal-alert__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 4px auto 14px;
  border-radius: 50%;
  background: #e8f1f2;
  color: #2f7475;
  font-size: 24px;
  font-weight: 800;
}

.modal-alert--success .modal-alert__icon {
  background: #e7f6ed;
  color: #218653;
}

.modal-alert--warning .modal-alert__icon,
.modal-alert--danger .modal-alert__icon {
  background: #fff4df;
  color: #b26a16;
}

.modal-alert--error .modal-alert__icon {
  background: #fdeceb;
  color: #b84b3d;
}

.modal-alert__details {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid #dfe7e0;
  border-radius: 8px;
  background: #f6f8f5;
}

.modal-alert__detail {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #69756c;
  font-size: 12px;
}

.modal-alert__detail strong {
  color: #26332d;
  font-weight: 650;
  text-align: right;
}

.modal-prompt__field {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.modal-prompt__label:empty {
  display: none;
}

.modal-prompt__label {
  color: #69756c;
  font-size: 12px;
}

.modal-prompt__input {
  box-sizing: border-box;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #b9c6ba;
  border-radius: 7px;
  background: #fff;
  color: #26332d;
  font: inherit;
  outline: none;
}

.modal-prompt__input:focus {
  border-color: #e66c4c;
  box-shadow: 0 0 0 3px rgba(230, 108, 76, 0.16);
}

.modal-prompt__error {
  min-height: 17px;
  color: #b84b3d;
  font-size: 12px;
}

/* ==================== Loading 状态 ==================== */
.modal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
}
.modal-loading__spinner {
  width: 40px; height: 40px;
  border: 3px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: modal-spin 0.8s linear infinite;
}
@keyframes modal-spin { to { transform: rotate(360deg); } }
.modal-loading__text { font-size: 14px; color: #6b7280; }

/* ==================== 错误状态 ==================== */
.modal-error { text-align: center; padding: 40px 20px; }
.modal-error__icon { font-size: 48px; margin-bottom: 16px; }
.modal-error__title { font-size: 18px; font-weight: 600; color: #dc2626; margin: 0 0 8px 0; }
.modal-error__message { font-size: 14px; color: #6b7280; margin: 0; }

/* ==================== 响应式适配 ==================== */

@media screen and (max-width: 1024px) {
  .modal--xl { width: 98vw; height: auto; max-height: 94vh; }
  .modal--l { width: 94vw; height: 85vh; }
  .modal--m { width: 85vw; }
  .modal--s { width: 80vw; }
  .modal-header { padding: 16px 20px; }
  .modal-body { padding: 16px 20px; }

  @keyframes modalEnterBounce {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
  }
}

@media screen and (max-width: 768px) {
  .modal {
    border-radius: 10px;
    max-height: calc(100vh - 40px);
    margin: 16px;
  }
  .modal--xl, .modal--l, .modal--m, .modal--s {
    width: calc(100vw - 24px);
    max-width: none;
    height: auto;
    max-height: calc(100vh - 40px);
  }
  .modal-header { padding: 14px 16px; }
  .modal-header__text { font-size: 16px; }
  .modal-body { padding: 14px 16px; }
  .modal-footer {
    padding: 12px 16px;
    flex-direction: column-reverse;
    gap: 8px;
  }
  .modal-footer button,
  .modal-footer input[type="submit"] { width: 100%; }
  .modal-close { width: 28px; height: 28px; }

  @keyframes modalEnterBounce {
    from { opacity: 0; transform: scale(0.97) translateY(6px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
  }
}

@media screen and (min-width: 1920px) {
  .modal--xl { width: 96vw; height: auto; max-height: 94vh; }
  .modal--l { width: 1200px; height: 750px; }
}

/* ==================== 无障碍访问：减弱动效模式 ==================== */
@media (prefers-reduced-motion: reduce) {
  .modal-overlay,
  .modal-overlay.active,
  .modal-overlay.closing {
    animation: none !important;
  }
  .modal,
  .modal-overlay.active .modal,
  .modal-overlay.closing .modal {
    animation: none !important;
    transform: none !important;
  }
  .modal-header,
  .modal-body,
  .modal-footer,
  .modal-overlay.active .modal-header,
  .modal-overlay.active .modal-body,
  .modal-overlay.active .modal-footer {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
  .modal--sidebar,
  .modal--sidebar.active,
  .modal--sidebar.closing {
    animation: none !important;
  }
  .modal--sidebar.active { transform: none !important; }
  .modal-close {
    transition: background 0.1s, color 0.1s;
  }
  .modal-close:hover { transform: none; box-shadow: none; }
  .modal-close::after { display: none; }
  .modal-loading__spinner {
    animation: none;
    border-top-color: transparent;
    border-left-color: #3b82f6;
  }
}

/* ==================== 响应式弹窗尺寸契约 v3 ====================
 *
 * 适用：新增弹窗与 ModalManager.openDynamic() 动态弹窗。
 * 兼容：历史页面只使用 modal--s/m/l/xl 时保持原行为；动态弹窗自动追加
 * modal--responsive，可通过 responsive:false 显式退出兼容层。
 *
 * 尺寸算法：
 * 1. 先由 --modal-width / --modal-height 提供内容语义尺寸；
 * 2. 再受视口宽高、安全区和 max-width/max-height 约束；
 * 3. 超出部分只在 .modal-body 内滚动，标题和操作区保持可见。
 */

.modal-overlay {
  box-sizing: border-box;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  padding-left: max(16px, env(safe-area-inset-left));
}

.modal--s {
  --modal-width: 480px;
  --modal-max-height: 300px;
}

.modal--m {
  --modal-width: 600px;
  --modal-max-height: 640px;
}

.modal--l {
  --modal-width: 1200px;
  --modal-max-height: 760px;
}

.modal--xl {
  --modal-width: 1400px;
  --modal-max-height: 900px;
}

.modal--responsive {
  --modal-viewport-gap: 32px;
  box-sizing: border-box;
  overflow: hidden;
  margin: auto;
  width: min(var(--modal-width, 600px), calc(100vw - var(--modal-viewport-gap)));
  max-width: calc(100vw - var(--modal-viewport-gap));
  height: auto;
  min-height: 0;
  max-height: min(var(--modal-max-height, 720px), calc(100vh - var(--modal-viewport-gap)));
  max-height: min(var(--modal-max-height, 720px), calc(100dvh - var(--modal-viewport-gap)));
}

.modal--responsive > .modal-header,
.modal--responsive > .modal-body,
.modal--responsive > .modal-footer {
  min-width: 0;
}

.modal--responsive > .modal-body {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.modal-overlay--responsive {
  align-items: flex-start;
}

.modal--responsive.modal--fullscreen {
  --modal-viewport-gap: 0px;
  --modal-width: 100vw;
  --modal-max-height: 100dvh;
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 0;
}

/* 经营中心的工作台主题以 body.wxt-v2 .modal 写入默认 600px 宽度；
 * 全屏弹窗必须以更高选择器优先级覆盖该默认值。 */
body.wxt-v2 .modal--responsive.modal--fullscreen {
  width: 100vw;
  min-width: 100vw;
  max-width: 100vw;
}

.modal-overlay.modal-overlay--fullscreen {
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}

/* 工作台主题在本文件之后为普通遮罩层补了 16px 内边距。全屏状态不能
 * 继承该内边距，否则 100vw/100dvh 的弹窗会向右、向下各溢出 16px。 */
body.wxt-v2 .modal-overlay.modal-overlay--fullscreen,
body.wanxiangtai-fresh .modal-overlay.modal-overlay--fullscreen {
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  overflow: hidden;
}

.modal-overlay--fullscreen > .modal--fullscreen {
  margin: 0;
}

@media (max-width: 768px) {
  .modal-overlay {
    padding: 12px;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    padding-left: max(12px, env(safe-area-inset-left));
  }

  .modal--responsive {
    --modal-viewport-gap: 24px;
    width: calc(100vw - var(--modal-viewport-gap));
    max-width: none;
    max-height: calc(100vh - var(--modal-viewport-gap));
    max-height: calc(100dvh - var(--modal-viewport-gap));
  }

  .modal--responsive.modal--fullscreen {
    width: 100vw;
    max-width: 100vw;
  }
}

@media (max-width: 420px) {
  .modal-overlay {
    padding: 8px;
  }

  .modal--responsive {
    --modal-viewport-gap: 16px;
    border-radius: 10px;
  }
}

/* 横屏手机的宽度常超过竖屏断点；以短屏触控特征保持可点操作与弹窗内滚动。 */
@media (max-width: 1024px) and (max-height: 500px) and (orientation: landscape) and (pointer: coarse) {
  .modal-overlay {
    box-sizing: border-box;
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }

  .modal {
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    margin: 0;
  }

  .modal-header {
    flex: 0 0 auto;
    min-height: 52px;
    padding: 6px 12px;
  }

  .modal-body {
    min-height: 0;
    padding: 8px 12px;
    overscroll-behavior: contain;
  }

  .modal-footer {
    flex: 0 0 auto;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 12px;
  }

  .modal :is(.modal-close, .dialog-close, .dialog-close-btn, .kb-modal-close, .db-modal-close, .qa-modal-close, .pp-modal-close, .import-modal-close, .sdc-dialog-close, .concrete-modal-close, .export-modal-close, .attach-preview-close, .compare-snapshot-modal-close, .m-sheet-close, .m-progress-close, .close-btn, [data-modal-close]) {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .modal button,
  .modal-footer button,
  .modal-footer input[type="submit"] {
    min-height: 44px;
  }

  .modal-footer button,
  .modal-footer input[type="submit"] {
    width: auto;
  }
}

/* ==================== 暗色模式支持（可选保留）====================
@media (prefers-color-scheme: dark) {
  .modal { background: #1f2937; color: #f9fafb; }
  .modal-header { background: linear-gradient(135deg, #111827 0%, #1f2937 100%); border-color: #374151; }
  .modal-header__text { color: #f9fafb; }
  .modal-body { color: #e5e7eb; }
  .modal-footer { background: #111827; border-color: #374151; }
  .modal-close { color: #9ca3af; }
  .modal-close:hover { background: #450a0a; color: #f87171; }
  .modal-loading__text { color: #9ca3af; }
  .modal-body::-webkit-scrollbar-thumb { background-color: #4b5563; }
}
*/

/* ==================== 快捷键帮助专用样式 ==================== */
.shortcuts-table { width: 100%; }
.shortcut-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid #e5e7eb;
}
.shortcut-row:last-child { border-bottom: none; }
.shortcut-key {
  font-weight: 600; font-size: 14px; flex-shrink: 0; margin-right: 16px;
}
.shortcut-key kbd {
  display: inline-block; padding: 2px 6px; font-family: inherit; font-size: 13px;
  background: #f3f4f6; border: 1px solid #d1d5db; border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.shortcut-desc { color: #6b7280; font-size: 14px; text-align: right; }
.shortcuts-hint { margin-top: 16px; font-size: 12px; color: #9ca3af; text-align: center; }
.shortcuts-hint kbd {
  display: inline-block; padding: 1px 5px; font-family: inherit; font-size: 11px;
  background: #f3f4f6; border: 1px solid #d1d5db; border-radius: 3px;
}

/* ==================== 商品编码解析弹窗专用样式 ==================== */
.product-code-parser__info {
  background: #f3e8ff; border-left: 4px solid #7c3aed;
  padding: 12px 16px; border-radius: 8px; margin-bottom: 16px;
  font-size: 13px; color: #5b21b6;
}
.product-code-parser__info strong { color: #7c3aed; }
.product-code-parser__textarea {
  width: 100%; min-height: 140px; height: 40%; padding: 12px;
  border: 2px solid #e5e7eb; border-radius: 10px;
  font-size: 13px; font-family: monospace; resize: none;
  box-sizing: border-box; transition: border-color 0.2s, box-shadow 0.2s;
}
.product-code-parser__textarea:focus {
  outline: none; border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}
.product-code-parser__stats { display: flex; gap: 16px; margin-top: 12px; font-size: 12px; color: #6b7280; }
.product-code-parser__preview {
  display: none; margin-top: 12px; flex: 1; min-height: 100px; overflow-y: auto;
  border: 1px solid #e5e7eb; border-radius: 8px;
}
.product-code-parser__preview.show { display: flex; flex-direction: column; }

/* 代码解析弹窗 body 撑满可用高度 */
#productCodeParserModal .modal-body {
  display: flex; flex-direction: column; gap: 0;
}
.product-code-parser__table { width: 100%; border-collapse: collapse; font-size: 12px; }
.product-code-parser__table thead { background: #f3e8ff; position: sticky; top: 0; }
.product-code-parser__table th { padding: 8px; text-align: left; font-weight: 600; color: #5b21b6; }
.product-code-parser__table td { padding: 8px; border-top: 1px solid #f3f4f9; }

/* ==================== 人工匹配弹窗专用样式 ==================== */
.manual-match__stats { font-size: 13px; color: #6b7280; }
.manual-match__count { font-weight: 600; color: #16a34a; }

/* 紫色主题按钮 */
.btn-purple-outline {
  background: #f3e8ff; color: #7c3aed; border: 1px solid #c4b5fd;
  transition: all 0.2s;
}
.btn-purple-outline:hover { background: #ede9fe; border-color: #a78bfa; }
.btn-purple-gradient {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%); border: none;
  transition: all 0.2s;
}
.btn-purple-gradient:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #9333ea 100%);
  transform: translateY(-1px); box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* ==================== AI分析面板专用样式 ==================== */
.ai-panel__meta {
  display: inline-block; font-size: 11px; color: #6b7280;
  background: #f3f4f6; padding: 4px 10px; border-radius: 6px; line-height: 1.5;
}
.ai-panel__content {
  white-space: pre-wrap; font-size: 14px; line-height: 1.8;
  color: #374151; margin-bottom: 20px;
}
.ai-panel__content strong { color: #1f2937; font-weight: 600; }
.ai-panel__content code {
  background: #f3f4f6; padding: 2px 8px; border-radius: 4px;
  font-size: 13px; font-family: 'SF Mono', Monaco, Consolas, monospace; color: #dc2626;
}
.ai-panel__suggestions {
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px; padding: 18px 20px;
}
.ai-panel__suggestions h4 { margin: 0 0 12px 0; color: #166534; font-size: 15px; font-weight: 600; }
.ai-panel__suggestions ol { margin: 0; padding-left: 22px; font-size: 13px; color: #15803d; line-height: 1.7; }
.ai-panel__suggestions li { margin-bottom: 6px; }

/* ==================== 销售解析弹窗专用样式 v3.0（头部UI全面重构）==================== */

/* ── 1. Header 工具栏增强 ── */

/* 标题文本超长时优雅截断（保留商品名前60字符+省略号） */
.modal-header__text {
  max-width: clamp(200px, 40vw, 520px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* 确保header标题区不挤压工具栏 */
.modal-header__title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
}

/* Header本身：禁止裁剪子元素 */
.modal-header {
  overflow: visible !important;
}

/* 工具栏容器：紧凑分组布局（允许换行防溢出） */
.modal-header__toolbar {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  max-width: calc(100vw - 420px);
  min-height: 0;
  overflow: visible;
  position: relative;
  z-index: var(--z-dropdown, 50);
}

/* 工具栏按钮统一缩小：btn-sm 基础上进一步压缩 */
.modal-header__toolbar .btn-sm {
  font-size: 11.5px;
  padding: 4px 9px;
  line-height: 1.4;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

/* 工具栏内分隔符：用细竖线分隔功能组 */
.modal-header__toolbar .toolbar-sep {
  width: 1px;
  height: 20px;
  background: #e5e7eb;
  flex-shrink: 0;
  margin: 0 2px;
}

/* ── 2. 拖拽导入区域 ── */
.sales-analysis__drag-zone {
  display: flex; align-items: center; gap: 4px; padding: 4px 9px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1.5px dashed #93c5fd; border-radius: 6px;
  cursor: pointer; transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  white-space: nowrap; font-size: 11.5px; color: #2563eb; font-weight: 600;
}
.sales-analysis__drag-zone:hover {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: #3b82f6;
  transform: translateY(-0.5px);
  box-shadow: 0 2px 8px rgba(59,130,246,0.15);
}

/* ── 3. 批量填入下拉菜单 ── */
.sales-analysis__dropdown-menu {
  display: none; position: absolute; top: calc(100% + 4px); left: 0;
  z-index: var(--z-dropdown); background: #fff;
  border: 1px solid #e2e8f0; border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.06);
  min-width: 160px; padding: 4px;
  animation: dropdownFadeIn 0.15s ease-out;
}
@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.sales-analysis__menu-item {
  padding: 9px 12px; cursor: pointer; font-size: 12.5px; color: #374151;
  border-radius: 6px; transition: all 0.12s ease; display: flex; align-items: center; gap: 6px;
}
.sales-analysis__menu-item:last-child { border-bottom: none; }
.sales-analysis__menu-item:hover {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #1e293b;
  padding-left: 14px;
}

/* ── 4. 统计面板（v3.0 重构：三段式层次结构）── */
.sales-analysis__stats-panel {
  flex-shrink: 0;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  padding: 0; /* 内部由子卡片控制padding */
  border-bottom: 1px solid #e5e7eb;
  /* 微妙的深度感 */
  box-shadow:
    0 1px 3px rgba(0,0,0,0.04),
    0 4px 12px rgba(0,0,0,0.03);
}

/* 统计卡片：统一的圆角容器 */
.sales-analysis__stats-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 14px 20px;
  margin-bottom: 0;
}

/* 单行布局：模式切换 + 推广输入 + 统计数据 */
.sales-analysis__stats-row {
  display: flex; justify-content: flex-start; align-items: center;
  flex-wrap: nowrap; gap: 16px;
  padding: 0;
  margin: 0;
  border-bottom: none;
}

/* 分隔线：推广输入区与统计数据的视觉分隔 */
.sales-analysis__stats-divider {
  width: 1px;
  height: 28px;
  background: #e5e7eb;
  flex-shrink: 0;
}

/* 第二行：核心数据摘要行（已合并到单行，保留兼容性）*/
.sales-analysis__summary-row {
  display: flex; gap: 0; flex-wrap: wrap; align-items: stretch;
}

/* ── 费比模式切换器 v3.0 ── */
.sales-analysis__mode-switcher {
  display: inline-flex; align-items: center; gap: 0;
  background: #f1f5f9; padding: 3px; border-radius: 8px;
  border: 1px solid #e2e8f0;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}
.sales-analysis__mode-switcher button {
  padding: 5px 16px; border: none; border-radius: 6px;
  font-size: 12.5px; font-weight: 500; cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  position: relative;
}
.sales-analysis__mode-switcher button:first-child {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  box-shadow: 0 1px 3px rgba(59,130,246,0.35);
}
.sales-analysis__mode-switcher button:last-child {
  background: transparent; color: #64748b;
}
.sales-analysis__mode-switcher button:last-child:hover {
  color: #334155; background: rgba(255,255,255,0.6);
}

/* ── 成本输入区域 v3.0 ── */
.sales-analysis__cost-input {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; padding: 6px 12px; border-radius: 8px;
  border: 1px solid #e2e8f0;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.sales-analysis__cost-input:hover {
  border-color: #93c5fd;
}
.sales-analysis__cost-input:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.08);
}
.sales-analysis__cost-input label {
  font-size: 13px; font-weight: 600; color: #475569; white-space: nowrap;
}
.sales-analysis__cost-input input[type="number"] {
  width: 100px; padding: 5px 10px; border: 1px solid #e2e8f0; border-radius: 6px;
  font-size: 13.5px; font-weight: 600; text-align: right;
  transition: border-color 0.15s; background: #fafbfc;
  font-variant-numeric: tabular-nums;
}
.sales-analysis__cost-input input[type="number"]:focus {
  outline: none; border-color: #3b82f6; background: #fff;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.1);
}
.sales-analysis__ratio-text {
  font-size: 12px; color: #94a3b8; font-weight: 500;
  padding: 3px 8px; background: #f1f5f9; border-radius: 4px;
}
.sales-analysis__manual-section {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: #64748b; font-weight: 500;
}

/* ── 统计项 v3.0：卡片化设计 ── */
.sales-analysis__stat-item {
  font-size: 12.5px; color: #64748b;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px;
  background: #f8fafc;
  border-right: 1px solid #e5e7eb;
  min-width: fit-content;
}
.sales-analysis__stat-item:first-of-type {
  border-radius: 8px 0 0 8px;
  padding-left: 14px;
}
.sales-analysis__stat-item:last-of-type {
  border-radius: 0 8px 8px 0;
  border-right: none;
  padding-right: 14px;
}
.sales-analysis__stat-item strong {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

/* 状态色强化 */
.stat-danger { background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%); }
.stat-danger strong { color: #dc2626; }
.stat-success { background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); }
.stat-success strong { color: #16a34a; }
.stat-purple { background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%); }
.stat-purple strong { color: #7c3aed; }
.stat-warning { background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); }
.stat-warning strong { color: #d97706; }

.sales-analysis__stat-divider {
  padding: 6px 10px; font-size: 11.5px; color: #d97706; font-weight: 700;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-radius: 4px;
  white-space: nowrap;
}
.stat-small { font-size: 11.5px !important; }
.stat-small strong { font-size: 12px !important; }

/* ── 5. 分组控制栏 v3.0 ── */
.sales-analysis__group-controls {
  margin: 0; padding: 10px 20px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-top: 1px solid #e5e7eb; border-bottom: 1px solid #e5e7eb;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.sales-analysis__group-label {
  font-size: 11.5px; color: #94a3b8; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-right: 4px;
}

/* 全局操作按钮（展开/折叠）放在右侧 */
.sales-analysis__group-actions {
  display: flex; gap: 6px; margin-left: auto;
}
.sales-analysis__group-actions button,
.sales-analysis__group-controls > button:not(.group-toggle-btn) {
  padding: 4px 12px; border: 1px solid #e2e8f0;
  background: #fff; border-radius: 6px;
  font-size: 11.5px; color: #64748b; cursor: pointer;
  transition: all 0.15s ease; font-weight: 500;
}
.sales-analysis__group-actions button:hover,
.sales-analysis__group-controls > button:not(.group-toggle-btn):hover {
  background: #f1f5f9; border-color: #cbd5e1; color: #334155;
}

/* 分组Toggle按钮 v3.0 */
.group-toggle-btn {
  padding: 5px 10px; border: 1px solid #e0e7ff;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  color: #3730a3; border-radius: 6px; font-size: 11.5px;
  cursor: pointer; font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
  transition: all 0.18s cubic-bezier(0.4,0,0.2,1);
}
.group-toggle-btn:hover {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  border-color: #a5b4fc;
  transform: translateY(-0.5px);
  box-shadow: 0 2px 6px rgba(99,102,241,0.15);
}
.group-indicator {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
  opacity: 0.7;
}
.group-arrow {
  width: 11px; height: 11px; transition: transform 0.2s cubic-bezier(0.4,0,0.2,1);
  fill: none; stroke: currentColor; stroke-width: 2.5;
  stroke-linecap: round; stroke-linejoin: round;
  opacity: 0.6;
}
.group-toggle-btn.collapsed {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
  border-color: #e2e8f0 !important; color: #94a3b8 !important;
  transform: none !important; box-shadow: none !important;
}
.group-toggle-btn.collapsed .group-indicator { background: #cbd5e1 !important; }
.group-toggle-btn.collapsed .group-arrow { transform: rotate(-90deg); }

/* ── 6. 表格容器 v3.0 ── */
.sales-analysis__table-container {
  flex: 1; overflow: auto; border: 1px solid #e5e7eb;
  border-top: none; border-radius: 0 0 10px 10px; margin: 0 20px 20px 20px;
  background: #fff;
}

/* ── 7. 响应式适配（销售面板专用）── */
@media screen and (max-width: 1280px) {
  .modal-header__text { max-width: 30vw; }
  .modal-header__toolbar .btn-sm { padding: 3px 7px; font-size: 11px; }
  .sales-analysis__stat-item { font-size: 11.5px; padding: 5px 9px; }
  .sales-analysis__stat-item strong { font-size: 12px; }
  .group-toggle-btn { font-size: 11px; padding: 4px 8px; }
}

@media screen and (max-width: 1024px) {
  .sales-analysis__stats-card { padding: 12px 16px; }
  .sales-analysis__group-controls { padding: 8px 16px; }
  .sales-analysis__summary-row { gap: 0; } /* 保持卡片连接 */
  /* 单行布局响应式：允许换行 */
  .sales-analysis__stats-row {
    flex-wrap: wrap;
    gap: 10px;
  }
  .sales-analysis__stats-divider {
    display: none; /* 小屏幕隐藏分隔线 */
  }
  .sales-analysis__cost-input label {
    display: none; /* 隐藏"推广成本"文字以节省空间 */
  }
}

/* ==================== 样式系统加载完成（v2.1 动画修复版）==================== */

/* ==================== 清空数据弹窗专用样式 ==================== */

.clear-data-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.clear-data-option:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}

.clear-data-option:has(input:checked) {
  border-color: #10b981;
  background: #f0fdf4;
}

.clear-data-option input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #10b981;
}

.clear-data-option-content {
  flex: 1;
  min-width: 0;
}

/* ==================== Body Scroll Lock（弹窗激活时禁止背景滚动）====================
 * :has() 选择器兼容性：Chrome 105+, Safari 15.4+, Firefox 121+
 * 作为 JS 方案（ModalManager._lockBodyScroll）的 CSS 兜底，
 * 覆盖所有直接 classList.add('active') 打开弹窗的降级路径
 */
body:has(.modal-overlay.active) {
  overflow: hidden !important;
}

/* ==================== 销售解析工具栏 V2（全新设计）==================== */

.sales-toolbar-v2 {
  display: flex;
  align-items: center;
  gap: 2px;
}

.sales-toolbar-v2__group {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 4px;
}

.sales-toolbar-v2__divider {
  width: 1px;
  height: 20px;
  background: linear-gradient(180deg, transparent, #d1d5db, transparent);
  flex-shrink: 0;
  margin: 0 2px;
}

.sales-toolbar-v2__btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 9px;
  font-size: 11.5px;
  line-height: 1.4;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.sales-toolbar-v2__btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  transform: translateY(-0.5px);
}

/* 主操作 - 蓝色 */
.sales-toolbar-v2__btn--primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
.sales-toolbar-v2__btn--primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

/* 危险操作 - 红色 */
.sales-toolbar-v2__btn--danger {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}
.sales-toolbar-v2__btn--danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

/* 成功操作 - 绿色 */
.sales-toolbar-v2__btn--success {
  background: #16a34a;
  color: #fff;
  border-color: #16a34a;
}
.sales-toolbar-v2__btn--success:hover {
  background: #15803d;
  border-color: #15803d;
}

/* AI 操作 - 紫色 */
.sales-toolbar-v2__btn--ai {
  background: #7c3aed;
  color: #fff;
  border-color: #7c3aed;
}
.sales-toolbar-v2__btn--ai:hover {
  background: #6d28d9;
  border-color: #6d28d9;
}

/* 导入按钮在 V2 中的微调 */
.sales-toolbar-v2 .sales-analysis__drag-zone {
  padding: 4px 9px;
  font-size: 11.5px;
  border-radius: 6px;
  gap: 3px;
}

/* 响应式：小屏幕进一步压缩 */
@media screen and (max-width: 1280px) {
  .sales-toolbar-v2__btn {
    padding: 4px 7px;
    font-size: 11px;
  }
  .sales-toolbar-v2__divider {
    height: 18px;
    margin: 0 1px;
  }
  .sales-toolbar-v2 .sales-analysis__drag-zone {
    padding: 3px 7px;
    font-size: 11px;
  }
}
