/* 
 * 销售记录列表页面样式
 * 作者: 阿瑞
 * 版本: 1.0.0
 */

/* 页面容器 */
.pageContainer {
  width: 100%;
  padding: 0.5rem 0.5rem 1rem;
  min-height: 100vh;
}

@media (min-width: 768px) {
  .pageContainer {
    padding: 1rem 1rem 1.5rem;
  }
}

/* 页面标题 */
.pageTitle {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--color-text-primary);
}

/* 搜索栏容器 */
.searchContainer {
  margin-bottom: 1.5rem;
  border-radius: 0.75rem;
  padding: 1rem;
}

.searchContainer.light {
  background-color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e7eb;
}

.searchContainer.dark {
  background-color: rgba(31, 41, 55, 0.7);
}

/* 搜索表单 */
.searchForm {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* 搜索行 */
.searchRow {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .searchRow {
    flex-direction: row;
  }
}

/* 搜索输入框容器 */
.searchInputContainer {
  flex: 1;
  position: relative;
}

/* 搜索输入框 */
.searchInput {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  border-radius: 0.5rem;
  outline: none;
  transition: border-color 0.2s;
}

.searchInput.light {
  background-color: #fff;
  color: #111827;
  border: 1px solid #d1d5db;
}

.searchInput.light:focus {
  border-color: #3b82f6;
}

.searchInput.dark {
  background-color: #374151;
  color: #f3f4f6;
  border: 1px solid #4b5563;
}

.searchInput.dark:focus {
  border-color: #3b82f6;
}

/* 搜索图标 */
.searchIcon {
  position: absolute;
  left: 0.75rem;
  top: 0.625rem;
  color: #9ca3af;
}

/* 过滤器组 */
.filterGroup {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* 日期输入框 */
.dateInput {
  width: 140px;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  outline: none;
  transition: border-color 0.2s;
}

.dateInput.light {
  background-color: #fff;
  color: #111827;
  border: 1px solid #d1d5db;
}

.dateInput.light:focus {
  border-color: #3b82f6;
}

.dateInput.dark {
  background-color: #374151;
  color: #f3f4f6;
  border: 1px solid #4b5563;
}

.dateInput.dark:focus {
  border-color: #3b82f6;
}

/* 选择框 */
.select {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  outline: none;
  transition: border-color 0.2s;
}

.select.light {
  background-color: #fff;
  color: #111827;
  border: 1px solid #d1d5db;
}

.select.light:focus {
  border-color: #3b82f6;
}

.select.dark {
  background-color: #374151;
  color: #f3f4f6;
  border: 1px solid #4b5563;
}

.select.dark:focus {
  border-color: #3b82f6;
}

/* 按钮组 */
.buttonGroup {
  display: flex;
  gap: 0.5rem;
}

/* 搜索按钮 */
.searchButton {
  padding: 0.5rem 0.75rem;
  background-color: #2563eb;
  color: white;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  transition: background-color 0.2s;
}

.searchButton:hover {
  background-color: #1d4ed8;
}

/* 次要按钮 */
.secondaryButton {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  transition: background-color 0.2s;
}

.secondaryButton.light {
  background-color: #f3f4f6;
  color: #4b5563;
}

.secondaryButton.light:hover {
  background-color: #e5e7eb;
}

.secondaryButton.dark {
  background-color: #374151;
  color: #e5e7eb;
}

.secondaryButton.dark:hover {
  background-color: #4b5563;
}

/* 添加按钮 */
.addButton {
  padding: 0.5rem 0.75rem;
  background-color: #10b981;
  color: white;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  transition: background-color 0.2s;
}

.addButton:hover {
  background-color: #059669;
}

/* 高级筛选容器 */
.advancedFiltersContainer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding-top: 1rem;
  border-top-width: 1px;
}

.advancedFiltersContainer.light {
  border-top-color: #e5e7eb;
}

.advancedFiltersContainer.dark {
  border-top-color: #4b5563;
}

@media (min-width: 768px) {
  .advancedFiltersContainer {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .advancedFiltersContainer {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 筛选项容器 */
.filterItem {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* 筛选项标签 */
.filterLabel {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
}

/* 快速筛选按钮组 */
.quickFilterButtons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* 快速筛选按钮 */
.quickFilterButton {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 0.25rem;
  transition: background-color 0.2s;
}

.quickFilterButton.light {
  background-color: #f3f4f6;
}

.quickFilterButton.light:hover {
  background-color: #e5e7eb;
}

.quickFilterButton.dark {
  background-color: #374151;
}

.quickFilterButton.dark:hover {
  background-color: #4b5563;
}

/* 错误提示 */
.errorMessage {
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-left-width: 4px;
  border-left-color: #ef4444;
}

.errorMessage.light {
  background-color: #fee2e2;
  color: #b91c1c;
}

.errorMessage.dark {
  background-color: #7f1d1d;
  color: #fca5a5;
}

/* 加载指示器容器 */
.loaderContainer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 5rem 0;
}

/* 加载指示器 */
.loader {
  animation: spin 1s linear infinite;
  border-radius: 9999px;
  height: 2.5rem;
  width: 2.5rem;
  border-bottom: 2px solid #3b82f6;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* 空状态容器 */
.emptyState {
  padding: 2rem;
  border-radius: 0.75rem;
  text-align: center;
}

.emptyState.light {
  background-color: #f3f4f6;
}

.emptyState.dark {
  background-color: #1f2937;
}

/* 空状态文本 */
.emptyStateText {
  color: #6b7280;
}

.emptyStateText.dark {
  color: #9ca3af;
}

/* 表格容器 */
.tableContainer {
  overflow-x: auto;
  border-radius: 0.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* 表格 */
.table {
  min-width: 100%;
  border-collapse: collapse;
}

.table.light {
  color: #374151;
  border: 1px solid #e5e7eb;
}

.table.dark {
  color: #d1d5db;
  border: 1px solid #374151;
}

/* 表头 */
.tableHead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.tableHead.light {
  background-color: #f3f4f6;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}

.tableHead.dark {
  background-color: #1f2937;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* 表头单元格 */
.tableHeadCell {
  font-weight: 600;
  padding: 1rem 0.75rem;
  text-align: left;
  font-size: 1.15rem;
  white-space: nowrap;
  letter-spacing: 0.02em;
  border-bottom: 2px solid;
}

.tableRow.light .tableHeadCell {
  border-bottom-color: #d1d5db;
}

.tableRow.dark .tableHeadCell {
  border-bottom-color: #4b5563;
}

/* 表格行 */
.tableRow {
  transition: background-color 0.15s;
}

.tableRow.light:hover {
  background-color: #f9fafb;
}

.tableRow.dark:hover {
  background-color: #1f2937;
}

/* 表格数据单元格 */
.tableCell {
  padding: 1rem 0.75rem;
  vertical-align: top;
  border-bottom: 1px solid;
}

.tableCell:last-child {
  padding-right: 1.5rem;
}

.tableRow.light .tableCell {
  border-bottom-color: #e5e7eb;
}

.tableRow.dark .tableCell {
  border-bottom-color: #374151;
}

/* 客户信息列 */
.infoColumn {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* 信息项带图标 */
.infoItemWithIcon {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* 信息项带图标 - 蓝色 */
.iconBlue {
  color: #3b82f6;
  margin-right: 0.25rem;
  flex-shrink: 0;
}

/* 信息项带图标 - 绿色 */
.iconGreen {
  color: #10b981;
  margin-right: 0.25rem;
  flex-shrink: 0;
}

/* 信息项带图标 - 橙色 */
.iconOrange {
  color: #f59e0b;
  margin-right: 0.25rem;
  flex-shrink: 0;
}

/* 信息项带图标 - 黄色 */
.iconYellow {
  color: #eab308;
  margin-right: 0.25rem;
  flex-shrink: 0;
}

/* 信息项带图标 - 灰色 */
.iconGray {
  color: #6b7280;
  margin-right: 0.25rem;
  flex-shrink: 0;
}

/* 信息标签 */
.infoLabel {
  font-weight: 600;
  margin-right: 0.25rem;
}

/* 信息内容 */
.infoContent {
  display: flex;
  flex-direction: column;
  margin-left: 1.25rem;
}

/* 下级信息项 */
.subInfoItem {
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.subInfoItem.light {
  color: #6b7280;
}

.subInfoItem.dark {
  color: #9ca3af;
}

/* 产品列表容器 */
.productListContainer {
  margin-left: 0.5rem;
  margin-top: 0.25rem;
  width: 100%;
}

/* 产品列表滚动区域 - 旧版列表样式，保留以便兼容 */
.productListScroll {
  max-height: 250px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

/* 产品网格布局滚动区域 - 新版网格样式 */
.productGridScroll {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 0.5rem;
  max-height: unset;
  padding: 0.25rem;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  -ms-overflow-style: none;
}

.productGridScroll::-webkit-scrollbar {
  height: 5px;
}

.productGridScroll::-webkit-scrollbar-thumb {
  background-color: rgba(156, 163, 175, 0.5);
  border-radius: 9999px;
}

/* 产品项 */
.productItem {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom-width: 1px;
}

.productItem:last-child {
  border-bottom: none;
}

.productItem.light {
  border-bottom-color: #f3f4f6;
}

.productItem.dark {
  border-bottom-color: #4b5563;
}

/* 产品行 */
.productRow {
  display: flex;
  gap: 0.5rem;
}

/* 产品图片容器 */
.productImageContainer {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border-radius: 0.25rem;
  overflow: hidden;
}

/* 产品图片占位符 */
.productImagePlaceholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.productImagePlaceholder.light {
  background-color: #e5e7eb;
}

.productImagePlaceholder.dark {
  background-color: #4b5563;
}

/* 产品信息容器 */
.productInfo {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-left: 0.5rem;
  overflow: hidden;
}

/* 产品名称 */
.productName {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

/* 产品详情网格 */
.productDetailsGrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.25rem;
  font-size: 0.75rem;
}

.productDetailsGrid.light {
  color: #6b7280;
}

.productDetailsGrid.dark {
  color: #9ca3af;
}

/* 产品详情标签 */
.productDetailLabel {
  font-weight: 500;
}

/* 产品详情值 */
.productDetailValue {
  margin-left: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 备注内容区域 */
.remarkContent {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.25rem;
  min-height: 80px;
}

/* 备注文本 */
.remarkText {
  font-size: 0.85rem;
  margin-left: 1.25rem;
  line-height: 1.4;
  max-height: 80px;
  overflow-y: auto;
}

.remarkText.dark {
  color: #d1d5db;
}

.remarkText.light {
  color: #4b5563;
}

/* 操作按钮容器 */
.actionsColumn {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  justify-content: center;
  padding: 0.25rem;
  width: 100%;
}

/* 公共操作按钮样式 */
.actionButton {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  padding: 0.5rem 0.25rem;
  font-size: 0.75rem;
  line-height: 1.1;
  transition: all 0.2s;
  width: 100%;
  min-width: 56px;
  height: 54px;
  border: none;
}

.actionButton svg {
  margin-bottom: 0.25rem;
}

/* 查看按钮 */
.viewButton {
  background-color: #e5e7eb;
  color: #4b5563;
}

.viewButton:hover {
  background-color: #d1d5db;
}

.viewButton.dark {
  background-color: #374151;
  color: #e5e7eb;
}

.viewButton.dark:hover {
  background-color: #4b5563;
}

/* 编辑按钮 */
.editButton {
  background-color: #dbeafe;
  color: #1d4ed8;
}

.editButton:hover {
  background-color: #bfdbfe;
}

.editButton.dark {
  background-color: rgba(29, 78, 216, 0.2);
  color: #60a5fa;
}

.editButton.dark:hover {
  background-color: rgba(29, 78, 216, 0.3);
}

/* 退货按钮 */
.returnButton {
  background-color: #fee2e2;
  color: #dc2626;
}

.returnButton:hover {
  background-color: #fecaca;
}

.returnButton.dark {
  background-color: rgba(220, 38, 38, 0.2);
  color: #f87171;
}

.returnButton.dark:hover {
  background-color: rgba(220, 38, 38, 0.3);
}

/* 换货按钮 */
.exchangeButton {
  background-color: #fef3c7;
  color: #d97706;
}

.exchangeButton:hover {
  background-color: #fde68a;
}

.exchangeButton.dark {
  background-color: rgba(217, 119, 6, 0.2);
  color: #fbbf24;
}

.exchangeButton.dark:hover {
  background-color: rgba(217, 119, 6, 0.3);
}

/* 补货按钮 */
.replenishButton {
  background-color: #d1fae5;
  color: #059669;
}

.replenishButton:hover {
  background-color: #a7f3d0;
}

.replenishButton.dark {
  background-color: rgba(5, 150, 105, 0.2);
  color: #34d399;
}

.replenishButton.dark:hover {
  background-color: rgba(5, 150, 105, 0.3);
}

/* 价差按钮 */
.priceDiffButton {
  background-color: #e0e7ff;
  color: #4f46e5;
}

.priceDiffButton:hover {
  background-color: #c7d2fe;
}

.priceDiffButton.dark {
  background-color: rgba(79, 70, 229, 0.2);
  color: #a5b4fc;
}

.priceDiffButton.dark:hover {
  background-color: rgba(79, 70, 229, 0.3);
}

/* 发货按钮 */
.shipButton {
  background-color: #ede9fe;
  color: #7c3aed;
}

.shipButton:hover {
  background-color: #ddd6fe;
}

.shipButton.dark {
  background-color: rgba(124, 58, 237, 0.2);
  color: #c4b5fd;
}

.shipButton.dark:hover {
  background-color: rgba(124, 58, 237, 0.3);
}

/* 分页容器 */
.paginationContainer {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1.5rem;
}

/* 分页按钮 */
.paginationButton {
  padding: 0.25rem 0.75rem;
  margin: 0 0.25rem;
  border-radius: 0.25rem;
}

.paginationButton.light {
  background-color: #e5e7eb;
  color: #4b5563;
}

.paginationButton.light:hover:not(:disabled) {
  background-color: #d1d5db;
}

.paginationButton.dark {
  background-color: #374151;
  color: #d1d5db;
}

.paginationButton.dark:hover:not(:disabled) {
  background-color: #4b5563;
}

/* 当前页按钮 */
.paginationButtonCurrent {
  padding: 0.25rem 0.75rem;
  margin: 0 0.25rem;
  border-radius: 0.25rem;
  background-color: #3b82f6;
  color: white;
}

/* 表格响应式调整 */
@media (max-width: 1280px) {
  .tableContainer {
    overflow-x: auto;
  }
  
  .table {
    min-width: 1200px;
  }
  
  .actionButton {
    font-size: 0.65rem;
    height: 52px;
  }
  
  .productGridScroll {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    max-height: 280px;
  }
}

@media (max-width: 768px) {
  .actionButton {
    font-size: 0.6rem;
    height: 48px;
    padding: 0.35rem;
  }
  
  .productGridScroll {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    max-height: 250px;
  }
}

/* 客户信息中的产品汇总信息 */
.productSummaryInfo {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px dashed;
  font-weight: 500;
}

.productSummaryInfo.light {
  border-top-color: #e5e7eb;
}

.productSummaryInfo.dark {
  border-top-color: #4b5563;
}

/* 内联总价显示 */
.productTotalInline {
  font-weight: 600;
  color: #3b82f6;
}

.productTotalInline.dark {
  color: #60a5fa;
} 