/* size-stats.css - Auto-split from styles.css */

/* 🆕 移动端必须限制溢出 */
@media (max-width: 768px) {
  .price-distribution {
    flex: 0 0 auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-width: 100% !important;
    max-height: 28vh !important; /* 🆕 限制最大高度，给表格更多空间 */
    margin-bottom: 6px !important;
  }
  
  .distribution-chart {
    overflow: hidden !important;
    flex-wrap: wrap !important;
  }
  
  /* 🆕 表格填充剩余空间 */
  .transaction-modal-table {
    flex: 1 !important;
    min-height: 180px !important;
  }
}

/* 🆕 尺码列表容器 */
#sizeStatisticsList {
  max-height: 240px !important;
}

/* 🆕 尺码统计卡片默认样式（桌面端）*/
.size-stat-card {
  box-sizing: border-box;
  flex: 0 0 auto;
  min-width: 120px;
  max-width: 160px;
  overflow: visible;
  position: relative;
}

/* 🆕 主力尺码占比/价格相对位置摘要 */
.size-stat-summary {
  width: 100%;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.size-stat-summary-title {
  font-size: 12px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.size-stat-summary-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.size-stat-summary-item {
  font-size: 11px;
  color: #374151;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 3px 8px;
  line-height: 1.5;
  font-weight: 500;
}

.size-stat-summary-line {
  font-size: 11px;
  color: #4b5563;
  margin-top: 4px;
}

.size-stat-summary-params {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.size-stat-summary-param {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 4px 10px;
  transition: all 0.2s ease;
}

.size-stat-summary-param:hover {
  background: #fafbfc;
  border-color: #d1d5db;
}

.size-stat-summary-param .param-label {
  color: #6b7280;
  font-size: 10px;
  line-height: 1.4;
  white-space: nowrap;
}

.size-stat-summary-param .param-value {
  color: #1e40af;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #93c5fd;
}

/* 移动端尺码统计摘要样式优化 */
@media (max-width: 480px) {
  /* 🆕 两个参数在同一行显示 */
  .size-stat-summary-params {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 4px;
    align-items: center;
    justify-content: center;
  }
  
  .size-stat-summary-param {
    flex: 0 1 auto;
    justify-content: center;
    padding: 2px 5px;
    gap: 3px;
  }
  
  .size-stat-summary-param .param-label {
    font-size: 8px;
  }
  
  .size-stat-summary-param .param-value {
    font-size: 10px;
    padding: 1px 4px;
  }
}

.size-stat-ratio-inline {
  font-size: 10px;
  color: #2563eb;
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 1px 5px;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  margin-left: auto;
}

/* 🆕 求购报价标题容器 */
.bids-title-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bids-tab-container,
.asks-tab-container {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 10px;
  flex-wrap: wrap;
}

.bids-tab-hint {
  font-size: 10px;
  color: #64748b;
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(100, 116, 139, 0.05);
  border-radius: 6px;
  white-space: nowrap;
}

.bids-tab-hint svg {
  width: 11px;
  height: 11px;
  fill: #64748b;
  flex-shrink: 0;
}

.bids-tab,
.asks-tab {
  padding: 4px 12px;
  font-size: 11px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.bids-tab:not(.active):hover,
.asks-tab:not(.active):hover {
  background: #f5f5f5;
}

.bids-tab.active,
.asks-tab.active {
  background: #2196F3;
  border-color: #2196F3;
  color: #fff;
  font-weight: 600;
}

.asks-tab-panel {
  display: block;
}

.bids-depth-empty {
  padding: 20px;
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px dashed #e2e8f0;
}

.bids-depth-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 4px;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* 🆕 移动端求购深度高度限制 */
@media (max-width: 768px) {
  .bids-depth-grid {
    max-height: 110px;
  }
  
  #bidsDepthContainer {
    max-height: 120px;
    overflow-y: auto;
    overflow-x: hidden;
  }
}

@media (max-width: 480px) {
  .bids-depth-grid {
    max-height: 90px;
    gap: 5px;
  }
  
  #bidsDepthContainer {
    max-height: 100px;
  }
  
  /* 🆕 缩小求购深度卡片 */
  .bids-depth-card {
    min-width: 110px;
    max-width: 130px;
    padding: 6px 8px;
  }
  
  .bids-depth-size {
    font-size: 11px;
    margin-bottom: 4px;
    padding-bottom: 3px;
  }
  
  .bids-depth-level {
    font-size: 10px;
    padding: 2px 3px;
  }
}

.bids-depth-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  padding: 8px 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: all 0.2s ease;
  cursor: pointer;
  min-width: 140px;
  max-width: 160px;
}

.bids-depth-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.bids-depth-size {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #f0f0f0;
}

.bids-depth-levels {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bids-depth-level {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  padding: 3px 4px;
  background: #f8fafc;
  border-radius: 4px;
}

.bids-depth-rank {
  color: #94a3b8;
  font-weight: 600;
  font-size: 10px;
  min-width: 18px;
}

.bids-depth-price {
  color: #2563eb;
  font-weight: 700;
  font-size: 11px;
  flex: 1;
}

.bids-depth-qty {
  color: #64748b;
  font-weight: 600;
  font-size: 10px;
  background: #e3f2fd;
  padding: 1px 4px;
  border-radius: 3px;
}

/* 🆕 求购报价卡片样式优化 */
.price-bucket {
  transition: all 0.2s ease;
}

/* 🆕 求购报价移动端优化 */
@media (max-width: 768px) {
  /* 移动端保持横向布局，隐藏提示文本 */
  .bids-title-container {
    flex-direction: row !important;
    justify-content: space-between !important;
    gap: 8px !important;
  }
  
  /* 隐藏提示文本，节省空间 */
  .bids-hint-text,
  .bids-tab-hint {
    display: none !important;
  }
  
  /* 🆕 出售报价和求购报价标题区域移动端优化 - 保持一行 */
  #asksDistributionHeader,
  #asksSizeHeader,
  #bidsDistributionHeader {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 4px !important;
    padding-bottom: 6px !important;
    overflow-x: auto !important;
  }
  
  #asksDistributionHeader .asks-tab,
  #bidsDistributionHeader .bids-tab {
    padding: 3px 6px !important;
    font-size: 10px !important;
    flex-shrink: 0 !important;
  }
  
  #asksDistributionHeader #asksTotalCount,
  #bidsDistributionHeader > span {
    padding: 2px 4px !important;
    font-size: 10px !important;
    flex-shrink: 0 !important;
  }
  
  #asksDistributionHeader button[onclick*="copy"],
  #asksSizeHeader button[onclick*="copy"],
  #bidsDistributionHeader button[onclick*="copy"] {
    padding: 3px 5px !important;
    font-size: 9px !important;
    gap: 2px !important;
    flex-shrink: 0 !important;
  }
  
  #asksDistributionHeader button[onclick*="copy"] svg,
  #asksSizeHeader button[onclick*="copy"] svg,
  #bidsDistributionHeader button[onclick*="copy"] svg {
    width: 9px !important;
    height: 9px !important;
  }
  
  /* 尺码统计标题区域移动端优化 */
  #sizeStatisticsHeader {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    padding-bottom: 8px !important;
  }
  
  #sizeStatisticsHeader > div:first-child {
    display: flex !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
  }
  
  #sizeStatisticsHeader > div:last-child {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 6px !important;
  }
  
  #sizeStatisticsTitle {
    font-size: 10px !important;
    flex: 1 !important;
    min-width: 0 !important;
  }
  
  #sizeStatisticsTitle > span {
    display: inline-block !important;
    margin: 0 3px !important;
  }
  
  /* 移动端复制按钮优化 */
  #copySizeStatsBtn {
    padding: 3px 7px !important;
    font-size: 10px !important;
    gap: 3px !important;
  }
  
  #copySizeStatsBtn svg {
    width: 10px !important;
    height: 10px !important;
  }
  
  /* 移动端：缩小选项卡按钮 */
  .size-stat-tab,
  .asks-tab,
  .bids-tab {
    padding: 3px 8px !important;
    font-size: 10px !important;
    white-space: nowrap !important;
  }
  
  /* 🆕 移动端：支撑价/压力价一行显示 */
  .distribution-meta {
    flex-wrap: nowrap !important;
    gap: 4px !important;
    margin-top: 2px !important;
  }
  
  .distribution-support,
  .distribution-resistance {
    padding: 3px 6px !important;
    gap: 2px !important;
  }
  
  .support-label,
  .resistance-label {
    font-size: 9px !important;
  }
  
  .support-value,
  .resistance-value {
    font-size: 10px !important;
  }
  
  .distribution-divider {
    font-size: 10px !important;
    margin: 0 2px !important;
  }
  
  /* 列表尺码数量标题区域移动端优化 */
  .asks-size-title-container {
    justify-content: flex-start !important;
    gap: 6px !important;
  }
  
  .asks-size-title-container > span:first-of-type {
    font-size: 11px !important;
  }
  
  .asks-size-title-container > span:nth-of-type(2) {
    font-size: 10px !important;
    padding: 3px 8px !important;
  }
  
  /* 复制按钮移动端优化 - 缩小尺寸但保留文字 */
  #copySizeStatsBtn,
  button[onclick*="copy"] {
    padding: 3px 8px !important;
    font-size: 10px !important;
  }
  
  #copySizeStatsBtn span,
  button[onclick*="copy"] span {
    display: inline !important;
  }
  
  /* 图标尺寸优化 */
  #copySizeStatsBtn svg,
  button[onclick*="copy"] svg {
    width: 11px !important;
    height: 11px !important;
  }
  
  /* 卡片尺寸调整 */
  .price-bucket {
    min-width: 85px !important;
    max-width: 95px !important;
    padding: 8px 8px !important;
  }
  
  .price-bucket .bucket-size {
    font-size: 11px !important;
  }
  
  .price-bucket .bucket-value {
    font-size: 11px !important;
    padding: 2px 6px !important;
  }
  
  /* 🆕 移动端尺码统计列表限制高度 */
  #sizeStatisticsList {
    flex: 0 0 auto !important;
    max-height: 100px !important;
    min-height: 0 !important;
    overflow-y: auto !important;
  }
  
  /* 🆕 移动端尺码统计区域限制高度 */
  .size-statistics-section {
    max-height: none !important;
    padding: 10px !important;
    margin-bottom: 10px !important;
  }
}

@media (max-width: 480px) {
  /* 🆕 480px下尺码统计列表限制高度 */
  #sizeStatisticsList {
    flex: 0 0 auto !important;
    max-height: 90px !important;
    min-height: 0 !important;
    overflow-y: auto !important;
  }
  
  /* 🆕 480px下尺码统计区域限制高度 */
  .size-statistics-section {
    max-height: none !important;
    padding: 8px !important;
    margin-bottom: 8px !important;
  }
  
  /* 尺码统计标题在小屏幕上进一步缩小 */
  #sizeStatisticsTitle {
    font-size: 10px !important;
    gap: 3px !important;
  }
  
  /* 小屏幕：进一步缩小选项卡和移动端复制按钮 */
  .size-stat-tab {
    padding: 2px 6px !important;
    font-size: 9px !important;
  }
  
  #copySizeStatsBtnMobile {
    padding: 2px 5px !important;
    font-size: 9px !important;
  }
  
  #copySizeStatsBtnMobile svg {
    width: 9px !important;
    height: 9px !important;
  }
  
  /* 列表尺码数量标题在小屏幕上进一步缩小 */
  .asks-size-title-container > span:first-of-type {
    font-size: 10px !important;
  }
  
  .asks-size-title-container > span:nth-of-type(2) {
    font-size: 9px !important;
    padding: 2px 6px !important;
  }
  
  /* 复制按钮在小屏幕上进一步优化 */
  #copySizeStatsBtn,
  button[onclick*="copy"] {
    padding: 2px 6px !important;
    font-size: 9px !important;
  }
  
  #copySizeStatsBtn span,
  button[onclick*="copy"] span {
    display: inline !important;
  }
  
  #copySizeStatsBtn svg,
  button[onclick*="copy"] svg {
    width: 10px !important;
    height: 10px !important;
  }
  
  /* 🆕 小屏手机尺码统计卡片 - 一行显示2个 */
  .size-stat-card {
    min-width: calc(50% - 5px) !important;
    max-width: calc(50% - 5px) !important;
    flex: 0 0 calc(50% - 5px) !important;
    padding: 5px 6px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  
  /* 进一步缩小字体 */
  .size-stat-card > div > span {
    font-size: 10px !important;
  }
  
  /* 小屏幕价格指标优化 */
  .distribution-stats > div {
    gap: 4px !important;
    padding: 4px 6px !important;
  }
  
  .distribution-stats .stats-item {
    padding: 2px 5px !important;
  }
  
  .distribution-stats .stats-label {
    font-size: 9px !important;
  }
  
  .distribution-stats .stats-value {
    font-size: 10px !important;
  }
  
  .distribution-stats .stats-divider {
    font-size: 10px !important;
  }
  
  /* 小屏幕价格分布图高度调整 */
  .distribution-bar-wrapper {
    padding-top: 16px !important;
    height: 50px !important;
  }
  
  /* 小屏幕列表尺码数量容器 */
  .asks-size-count-list {
    max-height: 95px !important;
    padding: 3px !important;
  }
}

/* 🆕 尺码统计列表滚动条样式 */
#sizeStatisticsList {
  scrollbar-width: thin;
  scrollbar-color: #bbb #f5f5f5;
}

#sizeStatisticsList::-webkit-scrollbar {
  width: 6px;
}

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

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

#sizeStatisticsList::-webkit-scrollbar-thumb:hover {
  background-color: #999;
}

/* 🆕 出售报价尺码数量统计容器 */
#asksSizeStatsContainer {
  max-height: none;
  position: relative;
  z-index: 1;
}

/* 🆕 移动端尺码数量容器限制高度防止溢出 */
@media (max-width: 768px) {
  #asksSizeStatsContainer {
    max-height: 120px;
    overflow-y: auto;
    overflow-x: hidden;
    margin-bottom: 6px;
  }
}

@media (max-width: 480px) {
  #asksSizeStatsContainer {
    max-height: 100px;
  }
}

.asks-size-count-list::-webkit-scrollbar {
  width: 6px;
}

.asks-size-count-list::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 3px;
}

.asks-size-count-list::-webkit-scrollbar-thumb {
  background-color: #bbb;
  border-radius: 3px;
  transition: background-color 0.2s;
}

.asks-size-count-list::-webkit-scrollbar-thumb:hover {
  background-color: #999;
}

/* 移动端优化出售报价尺码卡片 */
@media (max-width: 768px) {
  .asks-size-count-list > div {
    padding: 6px 10px !important;
    gap: 5px !important;
  }
  
  .asks-size-count-list > div > span:first-child {
    font-size: 12px !important;
  }
  
  .asks-size-count-list > div > span:last-child {
    font-size: 10px !important;
    padding: 2px 6px !important;
    min-width: 24px !important;
  }
  
  /* 移动端容器内边距优化 */
  #asksSizeStatsContainer > div {
    padding: 8px 16px 10px !important;
  }
  
  #asksSizeStatsContainer > div > div:first-child {
    margin-bottom: 6px !important;
  }
  
  /* 平板日期选择器优化 */
  .transaction-date-range-picker {
    padding: 6px !important;
  }
  
  .date-quick-btn {
    padding: 4px 8px !important;
    font-size: 10px !important;
  }
}

@media (max-width: 480px) {
  .asks-size-count-list {
    gap: 8px !important;
    padding: 3px !important;
    max-height: 130px !important;
    overflow-y: auto !important;
  }
  
  .asks-size-count-list > div {
    padding: 5px 8px !important;
    gap: 4px !important;
  }
  
  .asks-size-count-list > div > span:first-child {
    font-size: 11px !important;
  }
  
  .asks-size-count-list > div > span:last-child {
    font-size: 9px !important;
    padding: 2px 5px !important;
    min-width: 22px !important;
  }
  
  /* 小屏容器内边距 */
  #asksSizeStatsContainer > div {
    padding: 6px 12px 8px !important;
  }
  
  #asksSizeStatsContainer > div > div:first-child {
    margin-bottom: 5px !important;
  }
  
  /* 小屏求购报价卡片 */
  .price-bucket {
    min-width: 75px !important;
    max-width: 85px !important;
    padding: 6px 6px !important;
  }
  
  /* 🆕 小屏求购报价自适应高度 */
  #distributionChart {
    flex: 1 !important;
    max-height: none !important;
    min-height: 0 !important;
  }
  
  .price-bucket .bucket-size {
    font-size: 10px !important;
  }
  
  .price-bucket .bucket-value {
    font-size: 10px !important;
    padding: 2px 5px !important;
  }
  
  .price-bucket > div:last-child {
    font-size: 9px !important;
    padding: 1px 4px !important;
  }
  
  /* 小屏幕复制按钮 */
  #copySizeStatsBtn,
  button[onclick*="copy"] {
    padding: 2px 6px !important;
    font-size: 9px !important;
  }
  
  #copySizeStatsBtn svg,
  button[onclick*="copy"] svg {
    width: 9px !important;
    height: 9px !important;
  }
  
  #copySizeStatsBtn span,
  button[onclick*="copy"] span {
    display: none;
  }
  
  /* 小屏日期选择器优化 */
  .transaction-date-range-picker {
    padding: 6px !important;
  }
  
  .date-quick-btn {
    padding: 4px 8px !important;
    font-size: 10px !important;
  }
  
  .date-input {
    padding: 3px 6px !important;
    font-size: 10px !important;
  }
  
  #loadByDateRangeBtn {
    padding: 3px 10px !important;
    font-size: 10px !important;
  }
}

/* 🆕 全局tooltip样式 - 附加到body，最高层级 */
.global-tooltip {
  position: fixed;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.92);
  color: #fff;
  font-size: 11px;
  line-height: 1.5;
  white-space: normal;
  max-width: 260px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 9999999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

/* 🆕 尺码统计卡片 tooltip 样式 - 禁用CSS tooltip，使用JS全局tooltip */
.size-stat-tooltip {
  cursor: help;
  padding: 2px 3px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.size-stat-tooltip:hover {
  background-color: #f0f0f0;
}

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