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

/* ========================================
   交易记录区域样式 - 三列布局
   ======================================== */
.transaction-history-section {
  margin-top: 24px;
  border-top: 1px solid #ebebeb;
  padding-top: 20px;
}

.transaction-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.transaction-column {
  border: 1px solid #ebebeb;
  border-radius: 8px;
  overflow: hidden;
}

.transaction-title {
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #222;
  background: #f8f9fa;
  border-bottom: 1px solid #ebebeb;
  text-align: center;
}

/* 尺码筛选区域 */
.transaction-filter {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  background: #fafafa;
  border-bottom: 1px solid #ebebeb;
  gap: 8px;
}

.filter-label {
  font-size: 12px;
  color: #666;
  font-weight: 500;
}

/* 尺码筛选下拉框（嵌入表头） */
.size-filter-select {
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 11px;
  color: #999;
  cursor: pointer;
  outline: none;
  text-align: center;
  text-align-last: center;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23999'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  background-size: 8px 5px;
  padding-right: 12px;
  transition: color 0.15s ease;
}

.size-filter-select:hover {
  color: #333;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23333'/%3E%3C/svg%3E");
}

.size-filter-select:focus {
  color: #333;
}

.size-filter-select option {
  text-align: left;
  font-size: 12px;
  color: #333;
  padding: 4px 8px;
}

.transaction-header {
  display: flex;
  padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 11px;
  color: #999;
  background: #fafafa;
}

.transaction-header .th-option {
  width: 70px;
  text-align: center;
}

.transaction-header .th-price {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.transaction-header .th-date,
.transaction-header .th-count {
  width: 80px;
  text-align: center;
}

.transaction-body {
  max-height: 240px;
  overflow-y: auto;
  overflow-x: hidden;
}

.transaction-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-bottom: 1px solid #f8f8f8;
  font-size: 12px;
}

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

.transaction-item .ti-option {
  width: 70px;
  text-align: center;
  color: #666;
  font-size: 11px;
}

.transaction-item .ti-price {
  flex: 1;
  color: #222;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.transaction-item .ti-price .price-text {
  text-align: center;
}

.transaction-item .ti-date,
.transaction-item .ti-count {
  width: 80px;
  text-align: center;
  color: #999;
  font-size: 11px;
}

.lightning-icon {
  width: 12px;
  height: 12px;
  margin-left: 2px;
  flex-shrink: 0;
}

.lightning-placeholder {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 2px;
}

.transaction-loading,
.transaction-empty {
  padding: 20px;
  text-align: center;
  color: #999;
}

/* 加载动画容器 */
.transaction-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100px;
}

/* 加载旋转动画（交易记录区域） */
.transaction-loading .loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f0f0f0;
  border-top: 4px solid #007bff;
  animation: spin 0.8s linear infinite;
}

.transaction-more {
  padding: 10px;
  text-align: center;
  color: #007bff;
  font-size: 12px;
  cursor: pointer;
  border-top: 1px solid #f0f0f0;
  transition: background-color 0.2s;
  display: none; /* 初始隐藏，等数据加载完成后再显示 */
}

.transaction-more:hover {
  background-color: #f8f9fa;
  color: #0056b3;
  font-size: 12px;
}

/* 🆕 日期范围选择器容器 */
.transaction-date-range-picker {
  /* 移除动画效果 */
}

/* 🆕 日期快捷按钮样式 - 简洁版 */
.date-quick-btn {
  padding: 5px 10px;
  font-size: 11px;
  background: white;
  color: #666;
  border: 1px solid #d5d5d5;
  flex: 1;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 400;
  white-space: nowrap;
}

.date-quick-btn:hover {
  background: #f5f5f5;
  color: #333;
}

.date-quick-btn:active {
  transform: scale(0.98);
}

.date-quick-btn.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
  font-weight: 600;
}

.date-quick-btn.active:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: white;
}

/* 🆕 日期快捷按钮容器 - 桌面端可以一行显示 */
@media (min-width: 769px) {
  .date-quick-buttons-container {
    flex-direction: row !important;
    flex-wrap: wrap;
  }
  
  .date-quick-buttons-container > div {
    flex: 1;
    min-width: 0;
  }
  
  /* 桌面端：显示标题行的复制按钮 */
  #copySizeStatsBtn {
    display: flex !important;
  }
  
  /* 桌面端：隐藏选项卡行的移动端复制按钮 */
  #copySizeStatsBtnMobile {
    display: none !important;
  }
}

/* 交易记录移动端适配 */
@media (max-width: 768px) {
  .transaction-history-section {
    margin-top: 16px;
    padding-top: 12px;
  }
  
  .transaction-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .transaction-title {
    padding: 10px;
    font-size: 13px;
  }
  
  .transaction-filter {
    padding: 6px 10px;
    gap: 6px;
  }
  
  .filter-label {
    font-size: 11px;
  }
  
  .size-filter-select {
    font-size: 10px;
    padding-right: 10px;
    background-size: 6px 4px;
  }
  
  .transaction-header {
    font-size: 10px;
    padding: 6px 10px;
  }
  
  .transaction-header .th-date,
  .transaction-header .th-count,
  .transaction-header .th-option {
    width: 60px;
  }
  
  .transaction-body {
    max-height: 180px;
  }
  
  .transaction-item {
    font-size: 11px;
    padding: 6px 10px;
  }
  
  .transaction-item .ti-date,
  .transaction-item .ti-count,
  .transaction-item .ti-option {
    width: 60px;
    font-size: 10px;
  }
  
  .lightning-icon {
    width: 10px;
    height: 10px;
  }
  
  .size-info-section {
    margin-top: 16px;
    padding-top: 12px;
  }
  
  .size-info-title {
    font-size: 14px;
    margin-bottom: 10px;
  }
}

@media (max-width: 480px) {
  .transaction-grid {
    gap: 10px;
  }
  
  .size-info-section {
    margin-top: 12px;
    padding-top: 10px;
  }
  
  .size-info-title {
    font-size: 13px;
    margin-bottom: 8px;
  }
  
  .transaction-title {
    padding: 8px;
    font-size: 12px;
  }
  
  .transaction-modal-size-filter {
    font-size: 9px !important;
    padding: 2px 1px !important;
  }
  
  /* 🆕 480px下分布图自动换行+自适应高度 */
  .distribution-chart {
    height: auto;
    min-height: 0;
    max-height: none; /* 移除高度限制让其自适应 */
    overflow: hidden; /* 防止溢出 */
    flex-wrap: wrap; /* 🆕 关键：让柱状图自动换行 */
    justify-content: center;
    gap: 4px 6px; /* 调整换行后的间距 */
  }
  
  .distribution-bar-wrapper {
    padding-top: 25px;
    width: 55px; /* 缩小宽度以适应更多列 */
    height: 50px;
    flex: 0 0 auto;
  }
  
  .distribution-title {
    margin-bottom: 12px;
  }
  
  .bar-value {
    top: -14px;
    font-size: 9px;
  }
  
  .distribution-label {
    font-size: 7px;
  }
  
  .transaction-modal-load-btn {
    padding: 6px 12px;
    font-size: 11px;
    min-width: 80px;
  }
  
  .transaction-modal-list {
    max-height: 150px;
  }
  
  .transaction-filter {
    padding: 5px 8px;
    gap: 5px;
  }
  
  .filter-label {
    font-size: 10px;
  }
  
  .size-filter-select {
    font-size: 9px;
    padding-right: 8px;
    background-size: 5px 3px;
  }
  
  .transaction-header {
    font-size: 9px;
    padding: 5px 8px;
  }
  
  .transaction-header .th-date,
  .transaction-header .th-count,
  .transaction-header .th-option {
    width: 50px;
  }
  
  .transaction-body {
    max-height: 140px;
  }
  
  .transaction-item {
    font-size: 10px;
    padding: 5px 8px;
  }
  
  .transaction-item .ti-date,
  .transaction-item .ti-count,
  .transaction-item .ti-option {
    width: 50px;
    font-size: 9px;
  }
}

/* 🆕 货号选择对话框动画 */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ========================================
   交易记录完整数据模态框
   ======================================== */
.transaction-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: none;
}
