/* transaction-modal.css - Auto-split from styles.css */

.transaction-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
}

.transaction-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 16px;
  width: clamp(640px, 80vw, 780px);
  height: 82vh;
  min-height: 82vh;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

/* 🆕 选项卡和内容的主容器 */
.transaction-modal-main {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* 🆕 左侧选项卡区域 - 浅色调设计 */
.transaction-modal-sidebar {
  width: 140px;
  background: linear-gradient(180deg, #f8f9fc 0%, #f0f2f7 100%);
  border-right: 1px solid #e5e8ef;
  display: flex;
  flex-direction: column;
  padding: 16px 8px;
  gap: 8px;
  flex-shrink: 0;
}

/* 🆕 选项卡样式 - 浅色调 */
.transaction-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
  background: transparent;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
}

.transaction-tab::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  border-radius: 0 3px 3px 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.transaction-tab:hover {
  background: rgba(255, 255, 255, 0.7);
  color: #374151;
  transform: translateX(2px);
  border-color: rgba(59, 130, 246, 0.1);
}

.transaction-tab.active {
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  color: #1f2937;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12), 0 1px 3px rgba(0, 0, 0, 0.06);
  border-color: rgba(59, 130, 246, 0.15);
}

.transaction-tab.active::before {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.transaction-tab.active .tab-icon {
  color: #3b82f6;
  filter: drop-shadow(0 0 2px rgba(59, 130, 246, 0.3));
}

/* 添加选项卡点击反馈 */
.transaction-tab:active {
  transform: scale(0.98) translateX(1px);
}

/* 🆕 选项卡图标 */
.tab-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 🆕 选项卡文字 */
.tab-text {
  white-space: nowrap;
  flex: 1;
}

.transaction-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e8ef;
  background: linear-gradient(180deg, #fafbfc 0%, #f8f9fc 100%);
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  flex-shrink: 0;
}

.transaction-modal-header h3 {
  color: #1f2937;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.transaction-modal-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.transaction-modal-header-left h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #222;
}

.transaction-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #222;
}

/* 模态框货币切换按钮 */
#modalToggleCurrencyButton {
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#modalToggleCurrencyButton:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

#modalToggleCurrencyButton:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.transaction-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.transaction-modal-close:hover {
  background: #f4f4f4;
  color: #222;
}

.transaction-modal-body {
  padding: 20px 24px 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  position: relative;
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

.transaction-modal-filter {
  margin-bottom: 16px;
  display: flex;
  justify-content: flex-end;
}

.transaction-modal-select {
  padding: 6px 10px;
  font-size: 13px;
  color: #222;
  background: #fff;
  border: 1px solid #d3d3d3;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
  min-width: 100px;
}

.transaction-modal-select-compact {
  padding: 4px 6px;
  font-size: 11px;
  min-width: 70px;
}

.transaction-modal-select:hover {
  border-color: #999;
}

.transaction-modal-select:focus {
  border-color: #222;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.transaction-modal-table {
  border: 1px solid #ebebeb;
  border-radius: 8px;
  overflow-x: hidden;
  overflow-y: visible;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
  flex: 1; /* 🆕 填充剩余空间 */
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* 🆕 AI分析面板 */
.transaction-modal-ai {
  padding: 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  margin: 0 auto 12px;
  width: 100%;
  max-width: 680px;
  box-sizing: border-box;
  /* display 由 JS 控制，这里不设置 */
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* 当 AI 面板显示时应用 flex 布局 */
.transaction-modal-ai[style*="display: block"],
.transaction-modal-ai[style*="display:block"] {
  display: flex !important;
}

.ai-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.ai-panel-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap; /* 🆕 防止标题换行 */
  flex-shrink: 0;
}

.ai-panel-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ai-action-btn {
  padding: 6px 10px;
  font-size: 11px;
  background: #2563eb;
  color: #fff;
  border: 1px solid #2563eb;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ai-action-btn:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.ai-action-secondary {
  background: #fff;
  color: #374151;
  border-color: #d1d5db;
}

.ai-action-secondary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.ai-panel-status {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 8px;
}

.ai-status-error {
  color: #dc2626;
}

.ai-panel-content {
  white-space: pre-line;
  font-size: 14px;
  line-height: 1.8;
  color: #e5e5e5;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 14px 16px;
  min-height: 300px;
  flex: 1 1 auto;
  overflow-y: auto;
  letter-spacing: 0.3px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "微软雅黑", sans-serif;
  font-weight: 400;
}

/* ====== AI Wizard 重新设计 ====== */
.ai-wizard {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: #1e293b;
}

.ai-wz-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

/* 进度条 - 圆点+连线 */
.ai-wz-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 10px;
}

.ai-wz-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.ai-wz-dot span {
  font-size: 10px;
  font-weight: 700;
  color: #9ca3af;
  line-height: 1;
}

.ai-wz-dot.active {
  border-color: #2563eb;
  background: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.ai-wz-dot.active span {
  color: #fff;
}

.ai-wz-dot.done {
  border-color: #10b981;
  background: #10b981;
}

.ai-wz-dot.done span {
  color: #fff;
  font-size: 0;
}

.ai-wz-dot.done::after {
  content: '✓';
  font-size: 11px;
  color: #fff;
  font-weight: 700;
}

.ai-wz-line {
  flex: 1;
  height: 2px;
  background: #e2e8f0;
  min-width: 12px;
  max-width: 36px;
}

/* 内容区 */
.ai-wz-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-wz-step-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.ai-wz-step-desc {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 2px;
}

.ai-wz-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-wz-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ai-wz-label {
  font-size: 11px;
  color: #475569;
  font-weight: 600;
}

.ai-wz-input,
.ai-wz-select,
.ai-wz-textarea {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  box-sizing: border-box;
  background: #f8fafc;
  color: #1e293b;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.ai-wz-input::placeholder,
.ai-wz-textarea::placeholder {
  color: #94a3b8;
}

.ai-wz-textarea {
  min-height: 44px;
  resize: vertical;
}

.ai-wz-textarea[rows="1"] {
  min-height: 36px;
}

.ai-wz-textarea[rows="2"] {
  min-height: 40px;
}

.ai-wz-input:focus,
.ai-wz-select:focus,
.ai-wz-textarea:focus {
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* 按钮选择组 */
.ai-wz-btn-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ai-wz-opt-btn {
  padding: 7px 0;
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  min-width: 60px;
  text-align: center;
}

.ai-wz-opt-btn:hover {
  background: #eef2ff;
  border-color: #a5b4fc;
  color: #3730a3;
}

.ai-wz-opt-btn.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.ai-wz-opt-btn.active:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.ai-wz-note {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
  padding: 6px 8px;
  background: #f1f5f9;
  border-radius: 6px;
  border-left: 3px solid #2563eb;
  line-height: 1.5;
}

/* 底部操作栏 */
.ai-wz-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
  gap: 8px;
}

.ai-wz-footer-right {
  display: flex;
  gap: 6px;
}

.ai-wz-btn {
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1.5px solid transparent;
  white-space: nowrap;
}

.ai-wz-btn-primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.ai-wz-btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.ai-wz-btn-outline {
  background: #fff;
  color: #475569;
  border-color: #d1d5db;
}

.ai-wz-btn-outline:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.ai-wz-btn-ghost {
  background: transparent;
  color: #94a3b8;
  border-color: transparent;
  font-weight: 500;
}

.ai-wz-btn-ghost:hover {
  color: #64748b;
  background: #f1f5f9;
}

/* 🆕 移动端AI分析界面优化 - 紧凑版 */
@media (max-width: 480px) {
  /* AI面板头部 */
  .ai-panel-header {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
  }
  
  .ai-panel-title {
    font-size: 13px;
    margin-right: auto;
  }
  
  .ai-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  
  .ai-action-btn {
    padding: 4px 8px;
    font-size: 10px;
    white-space: nowrap;
  }
  
  /* AI分析面板容器 - 手机版填满高度 */
  /* 注意：不能用 display: flex !important，会覆盖 JS 的 display: none */
  .transaction-modal-ai[style*="display: block"],
  .transaction-modal-ai[style*="display:block"] {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    margin-bottom: 0 !important;
    height: 100% !important;
  }
  
  /* AI分析内容区域 - 手机版高度自适应填满 */
  .ai-panel-content {
    min-height: 100px !important;
    height: auto !important;
    max-height: none !important;
    flex: 1 1 auto !important;
    overflow-y: auto !important;
  }
  
  .ai-panel-status {
    margin-bottom: 4px;
  }
  
  .ai-panel-meta {
    margin-top: 4px;
  }
  
  /* 新版 Wizard 移动端适配 - 极紧凑 */
  .ai-wz-card {
    padding: 8px 10px;
  }
  
  .ai-wz-progress {
    margin-bottom: 6px;
    gap: 0;
  }
  
  .ai-wz-dot {
    width: 18px;
    height: 18px;
  }
  
  .ai-wz-dot span {
    font-size: 8px;
  }
  
  .ai-wz-dot.done::after {
    font-size: 9px;
  }
  
  .ai-wz-dot.active {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
  }
  
  .ai-wz-line {
    min-width: 6px;
    max-width: 16px;
  }
  
  .ai-wz-content {
    gap: 4px;
  }
  
  .ai-wz-step-title {
    font-size: 13px;
  }
  
  .ai-wz-step-desc {
    font-size: 10px;
    margin-bottom: 0;
  }
  
  .ai-wz-fields {
    gap: 6px;
  }
  
  .ai-wz-label {
    font-size: 10px;
  }
  
  .ai-wz-input,
  .ai-wz-select,
  .ai-wz-textarea {
    padding: 6px 8px;
    font-size: 12px;
  }
  
  .ai-wz-opt-btn {
    flex: 1 1 calc(50% - 3px);
    min-width: 50px;
    max-width: calc(50% - 3px);
    padding: 6px 4px;
    font-size: 12px;
  }
  
  .ai-wz-btn-group {
    gap: 5px;
  }
  
  .ai-wz-footer {
    margin-top: 6px;
    padding-top: 6px;
  }
  
  .ai-wz-btn {
    padding: 5px 10px;
    font-size: 11px;
  }
  
  .ai-wz-textarea {
    min-height: 50px !important;
  }
  
  .ai-wz-note {
    font-size: 10px;
    padding: 4px 6px;
  }
  
  .ai-wizard-date-picker {
    margin-top: 5px !important;
    padding-top: 5px !important;
  }
  
  .ai-wizard-date-picker > div:first-child {
    font-size: 10px !important;
    margin-bottom: 4px !important;
  }
  
  .ai-wizard-date-input {
    padding: 4px 6px !important;
    font-size: 11px !important;
  }
}

.ai-panel-meta {
  margin-top: 8px;
  font-size: 11px;
  color: #9ca3af;
}

.ai-loading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.transaction-sidebar-footer {
  margin-top: auto;
  padding: 8px 4px 4px;
}

.transaction-sidebar-product {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(135deg, #fafbfc 0%, #f0f2f5 100%);
  border: 1px solid #e0e4e8;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.transaction-sidebar-image-wrapper {
  width: 100%;
  height: 90px;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* 🆕 放大镜图标 */
.image-zoom-icon {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 18px;
  height: 18px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  pointer-events: none;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.image-zoom-icon svg {
  width: 12px;
  height: 12px;
}

.transaction-sidebar-image-wrapper:hover .image-zoom-icon {
  opacity: 1;
}

.transaction-sidebar-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.transaction-sidebar-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 2px 2px 0;
}

.transaction-sidebar-row {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  font-size: 11px;
  color: #4b5563;
  white-space: normal;
  flex-wrap: wrap;
  line-height: 1.4;
}

.transaction-sidebar-name-row {
  align-items: flex-start;
  white-space: normal;
  margin-bottom: 2px;
}

.transaction-sidebar-label {
  color: #9ca3af;
  flex-shrink: 0;
  font-size: 10px;
}

.transaction-sidebar-value {
  color: #1f2937;
  font-weight: 600;
  min-width: 0;
  word-break: break-all;
}

/* 🆕 侧边栏货号点击复制样式（支持手机和电脑） */
.transaction-sidebar-value.copy-model-number {
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
  border-radius: 3px;
  padding: 1px 4px;
  margin: -1px -4px;
}

.transaction-sidebar-value.copy-model-number:hover {
  color: #2196F3 !important;
  background-color: rgba(33, 150, 243, 0.1);
}

.transaction-sidebar-value.copy-model-number:active {
  color: #1976D2 !important;
  background-color: rgba(33, 150, 243, 0.2);
}

.transaction-sidebar-name {
  white-space: normal;
  line-height: 1.35;
  word-break: break-word;
  font-size: 12px;
  color: #111;
}

.transaction-modal-header-row {
  display: flex;
  background: #f8f9fa;
  border-bottom: 1px solid #ebebeb;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #666;
  align-items: center;
  flex-shrink: 0; /* 🆕 防止表头被压缩 */
}

/* 模态框表头中的尺码筛选下拉框 */
.transaction-modal-size-filter {
  outline: none;
  transition: all 0.2s ease;
}

.transaction-modal-size-filter:hover {
  border-color: #999 !important;
  background: #f8f9fa !important;
}

.transaction-modal-size-filter:focus {
  border-color: #222 !important;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05) !important;
}

.transaction-modal-list {
  flex: 1; /* 🆕 填充剩余空间 */
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.transaction-modal-item {
  display: flex;
  padding: 6px 12px;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.2s;
  font-size: 13px;
}

/* 模态框中价格列的对齐样式 */
.modal-price-cell {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.transaction-modal-item .price-text {
  display: inline-block;
  text-align: left;
  white-space: nowrap;
}

.modal-price-cell svg,
.modal-price-cell > span[style*="width: 12px"] {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  display: inline-block;
}

.transaction-modal-item:last-child {
  border-bottom: none;
}

.transaction-modal-item:hover {
  background: #fafafa;
}

.transaction-modal-loading {
  padding: 40px;
  text-align: center;
  color: #999;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
}

.transaction-modal-empty {
  padding: 40px;
  text-align: center;
  color: #999;
}

.transaction-modal-load-more {
  padding: 12px 20px;
  text-align: center;
  border-top: 1px solid #ebebeb;
  flex-shrink: 0;
  background: #fff;
  display: flex;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
}

.transaction-modal-load-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #0c4a6e;
  background: #e0f2fe;
  border: 1px solid #7dd3fc;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 100px;
  flex: 0 0 auto;
}

.transaction-modal-load-btn:hover:not(:disabled) {
  background: #bae6fd;
  border-color: #38bdf8;
}

.transaction-modal-load-btn:active:not(:disabled) {
  background: #7dd3fc;
  border-color: #38bdf8;
}

.transaction-modal-load-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 加载全部按钮样式 - 与加载下一页保持一致 */
.transaction-modal-load-all-btn {
  background: #e0f2fe;
  color: #0c4a6e;
  border-color: #7dd3fc;
}

.transaction-modal-load-all-btn:hover:not(:disabled) {
  background: #bae6fd;
  border-color: #38bdf8;
}

.transaction-modal-load-all-btn:active:not(:disabled) {
  background: #7dd3fc;
  border-color: #38bdf8;
}

.transaction-modal-footer {
  padding: 8px 16px;
  border-top: none;
  text-align: center;
  font-size: 14px;
  color: #666;
  flex-shrink: 0;
  background: #fff;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .transaction-modal-content {
    width: 92%;
    min-width: 280px;
    max-width: 480px;
    height: 78vh;
    min-height: 50vh;
    max-height: 80vh;
    top: 50%; /* 居中显示 */
  }
  
  /* 移动端选项卡调整 */
  .transaction-modal-sidebar {
    width: 100px;
    padding: 12px 6px;
    gap: 6px;
  }
  
  /* 移动端商品信息缩小 */
  .transaction-sidebar-footer {
    padding: 4px 2px 2px;
  }
  
  .transaction-sidebar-product {
    padding: 8px;
    gap: 6px;
  }
  
  .transaction-sidebar-image-wrapper {
    height: 80px;
  }
  
  .transaction-sidebar-row {
    font-size: 10px;
  }
  
  .transaction-tab {
    padding: 10px 8px;
    gap: 6px;
    font-size: 12px;
  }
  
  .tab-icon {
    width: 16px;
    height: 16px;
  }
  
  .tab-text {
    font-size: 12px;
  }
  
  /* 🆕 768px下交易记录体自适应布局 */
  .transaction-modal-body {
    padding: 16px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* 让内容可滚动 */
  }
  
  .transaction-modal-header {
    padding: 16px;
  }
  
  .transaction-modal-header h3 {
    font-size: 16px;
  }
  
  .transaction-modal-header-left {
    gap: 8px;
  }
  
  #modalToggleCurrencyButton {
    font-size: 11px;
    padding: 5px 10px;
  }
  
  .transaction-modal-select {
    font-size: 13px;
    padding: 6px 10px;
    min-width: 100px;
  }
  
  .transaction-modal-size-filter {
    font-size: 10px !important;
    padding: 3px 2px !important;
  }
  
  .transaction-modal-load-btn {
    padding: 7px 14px;
    font-size: 12px;
    min-width: 90px;
  }
  
  /* AI分析面板容器 - 平板版填满高度 */
  /* 注意：不能用 display: flex !important，会覆盖 JS 的 display: none */
  .transaction-modal-ai[style*="display: block"],
  .transaction-modal-ai[style*="display:block"] {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    margin-bottom: 0 !important;
    height: 100% !important;
  }
  
  /* AI分析内容区域 - 平板版高度自适应填满 */
  .ai-panel-content {
    min-height: 150px !important;
    height: auto !important;
    max-height: none !important;
    flex: 1 1 auto !important;
    overflow-y: auto !important;
  }
  
  .transaction-modal-table {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: none !important;
  }
  
  .transaction-modal-list {
    flex: 1;
    max-height: none !important;
    overflow-y: auto;
    min-height: 0;
  }
  
  .transaction-modal-footer {
    padding: 6px 12px;
    font-size: 12px;
  }
}

/* 小屏幕移动端适配 */
@media (max-width: 480px) {
  .transaction-modal-content {
    width: 95%;
    min-width: 260px;
    border-radius: 12px;
    height: 75vh;
    min-height: 50vh;
    max-height: 78vh;
    top: 50%; /* 居中显示 */
  }
  
  /* 小屏幕选项卡进一步缩小 */
  .transaction-modal-sidebar {
    width: 75px;
    padding: 10px 4px;
    gap: 5px;
  }
  
  .transaction-tab {
    padding: 8px 6px;
    gap: 4px;
    font-size: 11px;
    border-radius: 8px;
  }
  
  .tab-icon {
    width: 14px;
    height: 14px;
  }
  
  .tab-text {
    font-size: 10px;
  }
  
  /* 🆕 480px下交易记录体自适应布局 */
  .transaction-modal-body {
    padding: 12px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto; /* 让内容可滚动 */
  }
  
  /* 🆕 出售报价/求购报价页面 - 限制上方区域高度 */
  .price-distribution {
    flex: 0 0 auto;
    min-height: auto;
    max-height: 25vh !important; /* 🆕 限制最大高度，给表格留空间 */
    overflow-y: auto !important;
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 6px 0 !important;
    padding: 8px !important;
  }
  
  /* 🆕 缩小价格分布图表 */
  .distribution-chart {
    padding: 8px !important;
  }
  
  .distribution-bar-wrapper {
    height: 45px !important;
    padding-top: 20px !important;
  }
  
  /* 🆕 缩小支撑价/压力价区域 */
  .distribution-stats {
    margin-top: 6px !important;
    padding-top: 6px !important;
    gap: 6px !important;
  }
  
  .stat-badge {
    padding: 4px 8px !important;
    font-size: 11px !important;
  }
  
  .transaction-modal-table {
    flex: 1;
    min-height: 180px; /* 🆕 增加最小高度 */
    max-height: none !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  
  /* 🆕 交易记录列表自适应高度 */
  .transaction-modal-list {
    flex: 1;
    max-height: none !important;
    overflow-y: auto;
    min-height: 0;
  }
  
  .transaction-modal-distribution-row {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
}

/* 🆕 第一行：筛选 */
.transaction-modal-filter-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  position: relative;
  overflow: visible;
  flex-wrap: wrap;
}

.transaction-modal-filter {
  flex-shrink: 0;
}

/* 🆕 第二行：总数量 + 支撑价 + 压力价 */
.transaction-modal-count-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* 🆕 总数量显示 */
.transaction-modal-count {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: #e8f4f8;
  border: 1px solid #b8dce8;
  border-radius: 5px;
  flex-shrink: 0;
}

.count-label {
  font-size: 11px;
  color: #2c5f75;
  font-weight: 600;
}

.count-value {
  font-size: 13px;
  font-weight: 700;
  color: #1a4d63;
}

/* 🆕 支撑价显示 - 使用自定义tooltip */
.distribution-support {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 5px;
  flex-shrink: 0;
  cursor: help;
  position: relative;
  transition: background-color 0.2s ease;
}

.distribution-support:hover {
  background: #dcfce7;
}

.distribution-support::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 99999;
}

.distribution-support::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 2px;
  border: 6px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 99999;
}

.distribution-support:hover::after,
.distribution-support:hover::before {
  opacity: 1;
}

.support-label {
  font-size: 11px;
  color: #15803d;
  font-weight: 600;
}

.support-value {
  font-size: 12px;
  font-weight: 700;
  color: #166534;
}

/* 🆕 压力价显示 - 使用自定义tooltip */
.distribution-resistance {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 5px;
  flex-shrink: 0;
  cursor: help;
  position: relative;
  transition: background-color 0.2s ease;
}

.distribution-resistance:hover {
  background: #fee2e2;
}

.distribution-resistance::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 99999;
}

.distribution-resistance::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 2px;
  border: 6px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 99999;
}

.distribution-resistance:hover::after,
.distribution-resistance:hover::before {
  opacity: 1;
}

.resistance-label {
  font-size: 11px;
  color: #b91c1c;
  font-weight: 600;
}

.resistance-value {
  font-size: 12px;
  font-weight: 700;
  color: #991b1b;
}

/* 🆕 第二行：价格指标 */
.transaction-modal-stats-row {
  margin-bottom: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow: visible;
}

.transaction-modal-stats {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 8px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  position: relative;
}

/* 🆕 第三行：价格区间分布 */
.transaction-modal-distribution-row {
  margin: 4px 12px 12px 0;
  display: flex;
  justify-content: center;
  overflow: visible;
  max-height: none;
}

.price-distribution {
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  max-width: 100%;
  min-height: auto;
  max-height: none;
  width: calc(100% - 12px);
  margin: 0 12px 0 0;
  overflow: visible;
}

.distribution-meta {
  margin-top: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  position: relative;
}

.distribution-divider {
  color: #d1d5db;
  font-size: 12px;
}

.distribution-title {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
  text-align: center;
  letter-spacing: 0.5px;
}

.distribution-chart {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: auto;
  min-height: auto;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border-radius: 6px;
  overflow: visible;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* 🆕 求购报价滚动条美化 */
#distributionChart::-webkit-scrollbar {
  width: 6px;
}

#distributionChart::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 3px;
}

#distributionChart::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 3px;
  transition: background-color 0.2s;
}

#distributionChart::-webkit-scrollbar-thumb:hover {
  background-color: #94a3b8;
}

.distribution-bar-wrapper {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80px;
  height: 60px;
  justify-content: flex-end;
  padding-top: 20px;
}

.distribution-bar {
  width: 100%;
  min-height: 6px;
  background: linear-gradient(to top, #3b82f6 0%, #60a5fa 50%, #93c5fd 100%);
  border-radius: 4px 4px 0 0;
  position: relative;
  transition: all 0.2s ease;
  cursor: pointer;
  box-shadow: 0 -2px 6px rgba(59, 130, 246, 0.3);
}

.distribution-bar.median-zone {
  background: linear-gradient(to top, #10b981 0%, #34d399 50%, #6ee7b7 100%);
  box-shadow: 0 -2px 10px rgba(16, 185, 129, 0.5);
  border: 1px solid #10b981;
}

.distribution-bar:hover {
  transform: translateY(-3px) scaleY(1.05);
  box-shadow: 0 -4px 12px rgba(59, 130, 246, 0.5);
}

.distribution-bar.median-zone:hover {
  box-shadow: 0 -4px 12px rgba(16, 185, 129, 0.6);
}

.bar-value {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.median-zone .bar-value {
  color: #059669;
  font-size: 12px;
}

.distribution-label {
  font-size: 9px;
  color: #6b7280;
  margin-top: 6px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  width: 100%;
  text-align: center;
  font-weight: 500;
  line-height: 1.3;
  word-break: break-word;
}

.stats-item {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* 自定义tooltip - 使用全局tooltip系统 */
.stats-item.stats-tooltip {
  cursor: help;
  padding: 3px 5px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.stats-item.stats-tooltip:hover {
  background-color: #e9ecef;
}

/* 禁用CSS伪元素tooltip */
.stats-item.stats-tooltip::after,
.stats-item.stats-tooltip::before {
  display: none !important;
}

.stats-divider {
  color: #dee2e6;
  font-size: 12px;
  flex-shrink: 0;
}

.stats-label {
  font-size: 11px;
  color: #6c757d;
  font-weight: 500;
}

.stats-value {
  font-size: 13px;
  font-weight: 700;
  color: #495057;
}

/* 筛选行样式 */
.transaction-modal-filter-row {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 价格指标区域样式 */
.distribution-stats {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

/* 筛选和统计移动端适配 */
@media (max-width: 768px) {
  .transaction-modal-filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  
  .distribution-stats {
    margin-top: 10px !important;
    padding-top: 10px !important;
  }
  
  .distribution-stats > div {
    gap: 6px !important;
    padding: 6px 8px !important;
  }
  
  .distribution-stats .stats-item {
    padding: 3px 6px !important;
  }
  
  .distribution-stats .stats-label {
    font-size: 10px !important;
  }
  
  .distribution-stats .stats-value {
    font-size: 11px !important;
  }
  
  .transaction-modal-stats {
    padding: 6px 10px;
    gap: 6px;
    justify-content: center;
  }
  
  .stats-label {
    font-size: 10px;
  }
  
  .stats-value {
    font-size: 12px;
  }
  
  .stats-divider {
    font-size: 11px;
  }
  
  /* 🆕 768px下分布图自动换行+自适应高度 */
  .distribution-chart {
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: hidden;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 8px;
  }
  
  .distribution-bar-wrapper {
    padding-top: 18px;
    width: 65px;
    height: 55px;
    flex: 0 0 auto;
  }
  
  /* 🆕 移动端列表尺码数量容器优化 */
  .asks-size-count-list {
    max-height: 150px !important;
    padding: 4px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }
  
  .distribution-title {
    margin-bottom: 14px;
  }
  
  .bar-value {
    top: -16px;
    font-size: 10px;
  }
  
  .distribution-label {
    font-size: 8px;
  }
  
  /* 🆕 尺码统计卡片 - 一行显示3个 */
  .size-stat-card {
    min-width: calc(33.333% - 6px) !important;
    max-width: calc(33.333% - 6px) !important;
    flex: 0 0 calc(33.333% - 6px) !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  
  /* 优化卡片内部字体 */
  .size-stat-card > div > span {
    font-size: 11px !important;
  }
}

/* 🆕 复制按钮通用样式 */
.copy-data-btn {
  transition: all 0.2s ease;
}

/* 🆕 尺码统计区域容器（桌面端） */
.size-statistics-section,
.asks-tab-panel,
.price-distribution {
  overflow: visible !important;
}

/* 移动端溢出限制 → 见 size-stats.css */
