﻿/* =========================================
   汉仓茶业S2B平台 — 后台管理样式
   ========================================= */

/* 变量 */
:root {
  --brand: #1a5632;
  --brand-light: #2d8a5e;
  --brand-dark: #0d3518;
  --brand-bg: #f0f7f2;
  --danger: #c62828;
  --danger-light: #ffebee;
  --warning: #e65100;
  --warning-light: #fff3e0;
  --info: #1565c0;
  --info-light: #e3f2fd;
  --gray-100: #f5f5f5;
  --gray-200: #eeeeee;
  --gray-300: #e0e0e0;
  --gray-400: #bdbdbd;
  --gray-500: #9e9e9e;
  --gray-600: #757575;
  --gray-700: #616161;
  --gray-800: #424242;
  --gray-900: #212121;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.12);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.16);
  --radius: 8px;
  --radius-sm: 4px;
  --sidebar-w: 240px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--gray-800); background: var(--gray-100); }
a { color: var(--brand); text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* Layout */
.admin-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--brand-dark);
  color: var(--white);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform .3s;
}
.sidebar-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-brand .logo {
  width: 36px; height: 36px;
  background: var(--brand);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
}
.sidebar-brand .brand-text {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}
.sidebar-brand .brand-sub {
  font-size: 11px;
  opacity: .6;
  margin-top: 2px;
}
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-group { margin-bottom: 8px; }
.nav-group-title {
  padding: 8px 20px 4px;
  font-size: 11px;
  opacity: .5;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  gap: 10px;
  font-size: 14px;
  transition: all .2s;
  border-radius: 0;
}
.nav-item:hover { background: rgba(255,255,255,.1); }
.nav-item.active { background: var(--brand); color: var(--white); }
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; }

/* Sidebar user area */
.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user .user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--white); font-weight: 600;
}
.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name {
  font-size: 14px; font-weight: 500; color: var(--white);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-user .user-role {
  font-size: 11px; color: rgba(255,255,255,.5);
}
.sidebar-user .logout-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.6);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
  cursor: pointer;
}
.sidebar-user .logout-btn:hover {
  background: rgba(255,255,255,.2);
  color: var(--white);
}

/* Main content */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
}

/* Header */
.page-header {
  background: var(--white);
  padding: 16px 32px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.page-header h1 { font-size: 20px; font-weight: 600; margin: 0; }
.page-header .breadcrumb { font-size: 13px; color: var(--gray-500); }
.page-header .breadcrumb a { color: var(--gray-500); }
.page-header .breadcrumb a:hover { color: var(--brand); }

/* Content area */
.content-area { padding: 24px 32px; }

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.toolbar-left { display: flex; align-items: center; gap: 12px; }
.toolbar-right { display: flex; align-items: center; gap: 12px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
  background: var(--white);
  color: var(--gray-700);
}
.btn:hover { background: var(--gray-100); }
.btn-primary { background: var(--brand); color: var(--white); }
.btn-primary:hover { background: var(--brand-light); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { opacity: .9; }
.btn-outline { border: 1px solid var(--gray-300); background: var(--white); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-icon { padding: 6px 8px; }

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.data-table th {
  background: var(--gray-100);
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  text-align: left;
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover { background: var(--brand-bg); }
.data-table .img-cell img {
  width: 60px; height: 45px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}
.data-table .actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
/* 产品表操作列：固定 280px，编辑/上下架/库存/删除 四按钮并排不换行 */
#productTable th.col-actions { width: 280px; min-width: 280px; }
#productTable td.actions { flex-wrap: nowrap; }

/* Tags */
.level-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  color: #333;
  background: #999;
  margin-right: 4px;
  font-weight: 500;
}
.level-tag-l1 { background: #1a5632; color: #fff; }
.level-tag-l2 { background: #2d8a56; color: #fff; }
.level-tag-l3 { background: #e8f5e9; color: #1a5632; }
.level-tag-advisor { background: #fff3e0; color: #e65100; }
.level-tag-6 { background: #607d8b; color: #fff; }
.level-tag-unknown { background: #bbb; color: #333; }
.status-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}
.status-on { background: #e8f5e9; color: #2e7d32; }
.status-off { background: var(--gray-200); color: var(--gray-600); }
.type-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}
.type-standard { background: var(--info-light); color: var(--info); }
.type-custom { background: var(--warning-light); color: var(--warning); }
/* 货盘类型：0=公盘(绿/success) 1=私盘(橙/warning) 其余=未设置(灰/info) */
.type-public { background: #e8f5e9; color: #2e7d32; }
.type-private { background: #fff7e6; color: #fa8c16; }
.type-unset { background: var(--gray-200); color: var(--gray-600); }
.stock-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}
.stock-ok { background: #e8f5e9; color: #2e7d32; }
.stock-low { background: var(--warning-light); color: var(--warning); }
.stock-out { background: var(--gray-200); color: var(--gray-500); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.show { display: flex; }

.modal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  animation: modalIn .2s;
}
.modal-dialog {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  animation: modalIn .2s;
}
.modal-fullscreen {
  max-width: 960px;
  max-height: 90vh;
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h2 { font-size: 18px; font-weight: 600; margin: 0; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--gray-100);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.modal-close:hover { background: var(--gray-200); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

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

/* 确认弹窗 — 始终在最顶层，不被任何弹窗遮挡 */
#confirmModal { z-index: 9999; }
#confirmModal .modal { max-width: 400px; }

/* 经销商管理弹窗 — 从货主看板弹窗内打开，层级需高于看板弹窗(1000) */
#dealerMgrModal { z-index: 2000; }

/* Form */
.form-group {
  margin-bottom: 20px;
}
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color .2s;
}
.form-input:focus { outline: none; border-color: var(--brand); }
.form-input.error { border-color: var(--danger); }
.form-input::placeholder { color: var(--gray-400); }
.form-hint { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; display: none; }
.form-error.show { display: block; }
textarea.form-input { min-height: 80px; resize: vertical; }
.form-row { display: flex; gap: 16px; }
.form-row > .form-group { flex: 1; }
.form-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
}

/* Checkbox group */
.checkbox-group { display: flex; gap: 16px; }
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}
.checkbox-item input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--brand);
}

/* Radio group */
.radio-group { display: flex; gap: 16px; }
.radio-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}
.radio-item input[type="radio"] {
  width: 18px; height: 18px;
  accent-color: var(--brand);
}

/* Select */
.form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--white);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23757575' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.form-select:focus { outline: none; border-color: var(--brand); }

/* Image upload placeholder */
.upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s;
  background: var(--gray-100);
}
.upload-area:hover { border-color: var(--brand); }
.upload-area .upload-icon { font-size: 32px; color: var(--gray-400); }
.upload-area .upload-text { font-size: 14px; color: var(--gray-500); margin-top: 8px; }
.upload-area .upload-hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; }
.upload-preview {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}
.upload-preview .preview-item {
  width: 120px; height: 90px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--gray-200);
}
.upload-preview .preview-item img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview .preview-item .preview-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--gray-100); color: var(--gray-400);
  font-size: 12px;
}
.upload-preview .preview-item .remove-btn {
  position: absolute;
  top: 2px; right: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  color: white;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* SKU table */
.table-container {
  width: 100%;
  overflow-x: auto;
  box-sizing: border-box;
  margin-bottom: 12px;
}
.sku-table {
  width: 100%;
  table-layout: fixed;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  border-collapse: collapse;
}
.sku-table th { background: var(--gray-100); padding: 8px 12px; font-size: 13px; }
.sku-table td { padding: 8px 12px; font-size: 14px; word-break: break-all; }
.sku-table th:nth-child(1),
.sku-table td:nth-child(1) { width: 40%; }  /* 规格名称 */
.sku-table th:nth-child(2),
.sku-table td:nth-child(2) { width: 20%; }  /* 库存数量 */
.sku-table th:nth-child(3),
.sku-table td:nth-child(3) { width: 20%; }  /* 最低起订量 */
.sku-table th:nth-child(4),
.sku-table td:nth-child(4) { width: 20%; }  /* 操作 */
.sku-table .sku-input {
  width: 100%;
  max-width: 120px;
  padding: 4px 8px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  text-align: center;
  box-sizing: border-box;
}

/* Card layout (for cargo pool cards) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card-image {
  height: 160px;
  background: var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-image .placeholder { font-size: 14px; color: var(--gray-400); }
.card-body { padding: 16px; }
.card-body h3 { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
.card-body p { font-size: 13px; color: var(--gray-500); margin: 0; }
.card-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 16px; }

/* ==================== Pagination ==================== */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  margin-top: 16px;
  border-top: 1px solid var(--gray-200);
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--gray-600);
  white-space: nowrap;
}

.pagination-total {
  color: var(--gray-500);
  font-size: 13px;
  margin-right: 8px;
}

.pagination-size-label {
  font-size: 13px;
  color: var(--gray-500);
}

.pagination-size-select {
  padding: 4px 8px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  font-size: 13px;
  color: var(--gray-700);
  background: var(--white);
  cursor: pointer;
  outline: none;
  min-width: 60px;
}

.pagination-size-select:hover { border-color: var(--brand); }
.pagination-size-select:focus { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15); }

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  background: var(--white);
  color: var(--gray-700);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  line-height: 1;
}

.page-btn:hover:not(:disabled):not(.active) {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--gray-50);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--gray-100);
}

.page-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
  cursor: default;
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3);
}

.page-prev,
.page-next {
  font-weight: 500;
  padding: 0 12px;
}

.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--gray-400);
  font-size: 14px;
  user-select: none;
}

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  z-index: 9999;
  transform: translateX(100%);
  transition: transform .3s;
  box-shadow: var(--shadow-md);
}
.toast.show { transform: translateX(0); }
.toast-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.toast-error { background: var(--danger-light); color: var(--danger); border: 1px solid #ef9a9a; }
.toast-warning { background: var(--warning-light); color: var(--warning); border: 1px solid #ffcc80; }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}
.pagination button {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-300);
  background: var(--white);
  font-size: 14px;
}
.pagination button.active { background: var(--brand); color: var(--white); border-color: var(--brand); }
.pagination button:hover:not(.active) { background: var(--gray-100); }
.pagination button:disabled { opacity: .5; cursor: not-allowed; }

/* Drag handle */
.drag-handle {
  cursor: grab;
  color: var(--gray-400);
  font-size: 16px;
  padding: 0 4px;
}
.drag-handle:hover { color: var(--gray-600); }

.dragging { opacity: .5; }

/* Search input */
.search-input {
  position: relative;
}
.search-input input {
  padding-left: 36px;
}
.search-input .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
}

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.filter-bar select {
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 14px;
  min-width: 140px;
}

/* 排序保存操作区（靠右） */
.filter-bar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sort-hint {
  font-size: 12px;
  color: var(--gray-500, #888);
  white-space: nowrap;
}

/* Discount display */
.discount-value {
  font-weight: 600;
  color: var(--brand);
}
.discount-hint {
  font-size: 12px;
  color: var(--gray-500);
}

/* 排序数字输入框（表格内） */
.sort-input {
  width: 64px;
  padding: 5px 8px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 13px;
  text-align: center;
  -moz-appearance: textfield;
}
.sort-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-soft, rgba(0,0,0,.06));
}
/* 隐藏 number 输入的上下箭头（Webkit） */
.sort-input::-webkit-outer-spin-button,
.sort-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Sub-page header */
.sub-page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.sub-page-header .back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--gray-600);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background .2s;
}
.sub-page-header .back-btn:hover { background: var(--gray-100); }
.sub-page-header .current-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-800);
}

/* Scrollable tabs */
.tab-bar {
  display: flex;
  gap: 0;
  background: var(--white);
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 2px solid var(--gray-200);
  overflow-x: auto;
  margin-bottom: 0;
}
.tab-item {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.tab-item:hover { color: var(--brand); }
.tab-item.active { color: var(--brand); border-bottom-color: var(--brand); }

/* Rich text placeholder */
.rich-editor {
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  min-height: 200px;
  padding: 12px;
  font-size: 14px;
  background: var(--white);
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .content-area { padding: 16px; }
  .modal { width: 95%; }
  .card-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .two-column-layout { flex-direction: column; }
}

/* ==================== 订单管理专用样式 ==================== */

/* 统计卡片行 */
.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 20px;
  text-align: center;
}
.stat-card .stat-label {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 8px;
}
.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-800);
}
.stat-card .stat-value.stat-warning {
  color: var(--warning);
}
.stat-card .stat-value.stat-info {
  color: var(--info);
}
.stat-card .stat-value.stat-brand {
  color: var(--brand);
}
.stat-card.highlight {
  border: 2px solid var(--warning);
  background: var(--warning-light);
}
.stat-card.highlight .stat-value { color: var(--warning); }

/* 订单筛选栏 */
.order-filter-bar {
  display: grid;
  grid-template-columns: auto auto auto auto auto auto 1fr;
  gap: 12px;
  padding: 16px 20px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  align-items: center;
}
.order-filter-bar .filter-btn-group {
  display: flex;
  gap: 8px;
}

/* 订单状态标签 */
.order-status-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}

/* 订单来源标签 */
.order-source-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}
.source-dealer { background: var(--warning-light); color: var(--warning); }
.source-agent { background: var(--info-light); color: var(--info); }

/* 支付方式标签 */
.pay-type-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}
.pay-wechat { background: #e8f5e9; color: #2e7d32; }
.pay-offline { background: var(--gray-200); color: var(--gray-600); }
.pay-balance { background: #e3f2fd; color: #1565c0; }

/* 订单详情卡片 */
.detail-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
  margin-bottom: 16px;
}
.detail-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
}
.detail-card-title .card-icon {
  margin-right: 8px;
}

/* 进度条 */
.progress-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 0 16px;
}
.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1;
}
.progress-step .step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  border: 2px solid var(--gray-300);
  background: var(--gray-100);
  color: var(--gray-500);
  transition: all .3s;
}
.progress-step.active .step-circle {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--white);
}
.progress-step.current .step-circle {
  background: var(--brand-light);
  border-color: var(--brand);
  color: var(--white);
  box-shadow: 0 0 0 4px rgba(26,86,50,.2);
}
.progress-step .step-label {
  font-size: 13px;
  color: var(--gray-500);
}
.progress-step.active .step-label { color: var(--brand); font-weight: 500; }
.progress-step.current .step-label { color: var(--brand); font-weight: 600; }
.progress-connector {
  height: 2px;
  flex: 1;
  background: var(--gray-300);
  margin: 0 -16px;
  position: relative;
  top: -24px;
}
.progress-connector.done { background: var(--brand); }

/* 详情信息行 */
.detail-row {
  display: flex;
  align-items: baseline;
  margin-bottom: 8px;
  font-size: 14px;
}
.detail-row .detail-label {
  color: var(--gray-500);
  min-width: 120px;
  flex-shrink: 0;
}
.detail-row .detail-value {
  color: var(--gray-800);
  font-weight: 500;
}

/* 下单人信息卡 */
.buyer-info-card {
  display: flex;
  align-items: center;
  gap: 16px;
}
.buyer-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gray-200);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.buyer-avatar img { width: 100%; height: 100%; object-fit: cover; }
.buyer-avatar .avatar-placeholder { font-size: 20px; color: var(--gray-400); }
.buyer-details { flex: 1; }
.buyer-details .buyer-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 8px;
}
.buyer-details .buyer-meta {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 4px;
}

/* 余额信息网格 */
.balance-info-grid {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}
.balance-stat-card {
  flex: 1;
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.balance-stat-label {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 8px;
}
.balance-stat-value {
  font-size: 18px;
  font-weight: 600;
}
.balance-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* 产品明细表格 */
.product-detail-table {
  width: 100%;
  border-collapse: collapse;
}
.product-detail-table th {
  background: var(--gray-100);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}
.product-detail-table td {
  padding: 10px 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.product-detail-table .product-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--gray-100);
}
.total-row {
  display: flex;
  justify-content: flex-end;
  padding: 12px 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--brand);
  border-top: 2px solid var(--gray-200);
  margin-top: 8px;
}

/* 物流信息 */
.shipping-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}
.shipping-info .shipping-icon { font-size: 24px; }
.shipping-info .shipping-detail { flex: 1; }
.shipping-info .shipping-company { font-weight: 600; color: var(--gray-800); }
.shipping-info .shipping-no { font-size: 13px; color: var(--gray-500); }
.copy-btn {
  padding: 4px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 12px;
  background: var(--white);
  color: var(--gray-600);
  cursor: pointer;
}
.copy-btn:hover { background: var(--gray-100); border-color: var(--brand); color: var(--brand); }

/* 代客下单提示条 */
.agent-tip-bar {
  background: var(--info-light);
  border: 1px solid var(--info);
  border-radius: var(--radius);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--info);
  font-weight: 500;
}

/* 两栏布局（代客下单） */
.two-column-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.two-column-layout .left-panel { flex: 65; min-width: 0; }
.two-column-layout .right-panel { flex: 35; min-width: 300px; }

/* 订货清单卡 */
.order-list-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  position: sticky;
  top: 80px;
}
.order-list-card .order-list-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.order-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
}
.order-list-item .item-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--gray-100);
}
.order-list-item .item-info { flex: 1; }
.order-list-item .item-name { font-size: 14px; font-weight: 500; color: var(--gray-800); }
.order-list-item .item-spec { font-size: 12px; color: var(--gray-500); }
.order-list-item .item-qty {
  display: flex;
  align-items: center;
  gap: 4px;
}
.order-list-item .qty-btn {
  width: 24px; height: 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-300);
  background: var(--white);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.order-list-item .qty-value { width: 32px; text-align: center; font-weight: 500; font-size: 14px; }
.order-list-item .item-price { font-weight: 600; color: var(--brand); min-width: 80px; text-align: right; }
.order-list-item .item-delete {
  color: var(--gray-400);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
}
.order-list-item .item-delete:hover { color: var(--danger); }
.order-total-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 2px solid var(--gray-200);
  margin-top: 12px;
}
.order-total-bar .total-label { font-size: 14px; color: var(--gray-600); }
.order-total-bar .total-value { font-size: 24px; font-weight: 700; color: var(--brand); }
.order-list-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

/* 经销商选择卡片 */
.dealer-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all .2s;
  border: 2px solid transparent;
}
.dealer-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.dealer-card.selected { border-color: var(--brand); background: var(--brand-bg); }
.dealer-card .dealer-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--gray-200);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.dealer-card .dealer-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dealer-card .dealer-info { flex: 1; }
.dealer-card .dealer-name { font-size: 16px; font-weight: 600; }
.dealer-card .dealer-meta { font-size: 13px; color: var(--gray-500); margin-top: 4px; }
.dealer-card .select-btn { padding: 6px 16px; }

/* 货盘面包屑 */
.pool-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 16px;
}
.pool-breadcrumb .bc-sep { color: var(--gray-300); }
.pool-breadcrumb .bc-active { color: var(--brand); font-weight: 500; }

/* 产品选购卡 */
.product-pick-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  cursor: pointer;
  transition: all .2s;
}
.product-pick-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.product-pick-card .pick-thumb {
  width: 100%; height: 120px;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 12px;
}
.product-pick-card .pick-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-pick-card .pick-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.product-pick-card .pick-point { font-size: 12px; color: var(--gray-500); margin-bottom: 8px; }
.product-pick-card .pick-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.product-pick-card .pick-price { font-size: 16px; font-weight: 700; color: var(--brand); }
.product-pick-card .pick-discount { font-size: 12px; color: var(--gray-500); }

/* 确认下单弹窗 */
.confirm-order-section {
  margin-bottom: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
}
.confirm-order-section:last-child { border-bottom: none; }
.confirm-order-section .section-label {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 8px;
}
.confirm-total {
  font-size: 24px;
  font-weight: 700;
  color: var(--brand);
  text-align: center;
  padding: 16px 0;
}
.pay-tag-offline {
  display: inline-block;
  padding: 4px 12px;
  background: #e8f5e9;
  color: #2e7d32;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
}

/* 定制订单进度条 */
.custom-progress-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.custom-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.custom-progress-step .cp-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  border: 2px solid var(--gray-300);
  background: var(--gray-100);
  color: var(--gray-500);
}
.custom-progress-step.active .cp-circle { background: var(--brand); border-color: var(--brand); color: var(--white); }
.custom-progress-step.current .cp-circle { background: var(--brand-light); border-color: var(--brand); color: var(--white); box-shadow: 0 0 0 4px rgba(26,86,50,.2); }
.custom-progress-step .cp-label { font-size: 12px; color: var(--gray-500); margin-top: 6px; }
.custom-progress-step.active .cp-label { color: var(--brand); font-weight: 500; }

/* 待发货专用页 */
.pending-ship-banner {
  background: var(--warning-light);
  border: 2px solid var(--warning);
  border-radius: var(--radius);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.pending-ship-banner .banner-text {
  font-size: 16px;
  color: var(--warning);
  font-weight: 500;
}
.pending-ship-banner .banner-count {
  font-size: 28px;
  font-weight: 700;
  color: var(--warning);
}

/* 用户头像（列表表格中） */
.user-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-cell .user-avatar-sm {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gray-200);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--gray-400);
}
.user-cell .user-avatar-sm img { width: 100%; height: 100%; object-fit: cover; }

/* 订单编号链接 */
.order-no-link {
  color: var(--brand);
  cursor: pointer;
  font-weight: 500;
}
.order-no-link:hover { text-decoration: underline; }

/* 日期范围选择器 */
.date-range {
  display: flex;
  align-items: center;
  gap: 8px;
}
.date-range input[type="date"] {
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

/* Step indicator */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px 0;
}
.step-indicator .step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--gray-500);
}
.step-indicator .step .step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
  background: var(--gray-200);
  color: var(--gray-500);
}
.step-indicator .step.active .step-num {
  background: var(--brand);
  color: var(--white);
}
.step-indicator .step.active { color: var(--brand); font-weight: 500; }
.step-indicator .step-arrow { color: var(--gray-300); font-size: 20px; }

/* Main badge (product image main badge) */
.main-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: var(--brand);
  color: var(--white);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  line-height: 1.4;
}
