/* ===== 全局基础 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1677ff;
  --primary-dark: #0958d9;
  --success: #52c41a;
  --warning: #fa8c16;
  --danger: #ff4d4f;
  --purple: #722ed1;
  --teal: #13c2c2;
  --bg: #f0f2f5;
  --card-bg: #fff;
  --text: #262626;
  --text-muted: #8c8c8c;
  --border: #e8e8e8;
  --header-h: 56px;
  --sidebar-w: 220px;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  overflow-x: hidden;
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: linear-gradient(135deg, #1677ff 0%, #0958d9 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(22,119,255,0.3);
}

.header-left { display: flex; align-items: center; gap: 12px; }
.header-right { display: flex; align-items: center; gap: 12px; }

.menu-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-size: 20px;
  width: 36px; height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.menu-btn:hover { background: rgba(255,255,255,0.3); }

.logo {
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.time-display {
  color: rgba(255,255,255,0.85);
  font-size: 13px;
}

.user-badge {
  background: rgba(255,255,255,0.2);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
}

/* ===== Sidebar ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1100;
}
.sidebar-overlay.show { display: block; }

.sidebar {
  position: fixed;
  top: 0; left: -260px;
  width: var(--sidebar-w);
  height: 100vh;
  background: #001529;
  z-index: 1200;
  transition: left 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
}
.sidebar.open { left: 0; }

.sidebar-header {
  padding: 16px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-top: var(--header-h);
}

.close-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}

.nav-list { list-style: none; padding: 8px 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-icon { font-size: 18px; }

/* ===== Main Content ===== */
.main-content {
  margin-top: var(--header-h);
  padding: 20px 16px;
  min-height: calc(100vh - var(--header-h));
}

/* ===== Page ===== */
.page { display: none; }
.page.active { display: block; }

/* ===== iframe 子页面 ===== */
#page-iframe {
  padding: 0;
  margin: -20px -16px;
}
#page-iframe.active { display: block; }
#subframe {
  width: 100%;
  height: calc(100vh - var(--header-h));
  border: none;
  display: block;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 24px 0 12px;
  padding-left: 10px;
  border-left: 3px solid var(--primary);
}

/* ===== Stats Grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}

@media (min-width: 768px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  border-left: 4px solid;
}
.stat-card.blue { border-color: var(--primary); }
.stat-card.green { border-color: var(--success); }
.stat-card.orange { border-color: var(--warning); }
.stat-card.red { border-color: var(--danger); }
.stat-card.purple { border-color: var(--purple); }
.stat-card.teal { border-color: var(--teal); }
.stat-card.cyan { border-color: #0891b2; }
.stat-card.yellow { border-color: #faad14; }
.stat-card.orange-new { border-color: #fa8c16; }

.stat-icon { font-size: 28px; }
.stat-num { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ===== Cards ===== */
.scan-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

/* ===== Forms ===== */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}
.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: #fafafa;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22,119,255,0.1);
  background: #fff;
}
.form-input.inline { width: auto; display: inline-block; }

.form-row {
  display: flex;
  gap: 12px;
}
.form-group.half { flex: 1; }

.input-row {
  display: flex;
  gap: 8px;
}
.input-row .form-input { flex: 1; }

/* ===== Buttons ===== */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d46b08; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #d9363e; }
.btn-secondary { background: #f0f0f0; color: var(--text); }
.btn-small {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.btn-small:hover {
  opacity: 0.8;
}
.btn-secondary:hover { background: #e0e0e0; }
.btn-scan { background: var(--teal); color: #fff; padding: 10px 14px; flex-shrink: 0; }
.btn-full { width: 100%; margin-top: 8px; padding: 13px; font-size: 15px; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ===== Scanner ===== */
.scanner-container {
  position: relative;
  margin: 12px 0;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}
.scanner-container video {
  width: 100%;
  display: block;
  max-height: 240px;
  object-fit: cover;
}
.scan-line {
  position: absolute;
  left: 10%; right: 10%;
  height: 2px;
  background: #00ff88;
  box-shadow: 0 0 8px #00ff88;
  top: 50%;
  animation: scanAnim 2s ease-in-out infinite;
}
@keyframes scanAnim {
  0%, 100% { top: 20%; }
  50% { top: 80%; }
}
.scanner-container .btn { position: absolute; bottom: 10px; right: 10px; z-index: 10; }

.scan-area {
  background: #f5f7fa;
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 30px;
  text-align: center;
  margin-bottom: 16px;
}
.scan-icon { font-size: 40px; margin-bottom: 8px; }
.scan-area p { color: var(--text-muted); font-size: 13px; }

/* ===== Table ===== */
.table-wrap {
  overflow-x: auto;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}
.data-table th {
  background: #fafafa;
  padding: 12px 14px;
  text-align: left;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #f5f5f5;
  font-size: 13px;
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafcff; }
.data-table .empty-row td { text-align: center; color: var(--text-muted); padding: 40px; }

/* ===== Status Badges ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-pending { background: #fff7e6; color: #fa8c16; }
.badge-producing { background: #e6f4ff; color: #1677ff; }
.badge-done { background: #f6ffed; color: #52c41a; }
.badge-ready { background: #f9f0ff; color: #722ed1; }
.badge-shipped { background: #f0f5ff; color: #2f54eb; }
.badge-in { background: #f6ffed; color: #52c41a; }
.badge-out { background: #fff2e8; color: #fa541c; }
.badge-sale { background: #fff7e6; color: #fa8c16; }
.badge-ship { background: #e6f4ff; color: #1677ff; }
.badge-return { background: #fff1f0; color: #ff4d4f; }
.badge-damage { background: #fef3f3; color: #cf1322; }

/* ===== Production Cards ===== */
.prod-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, 400px); /* 固定400px，自动换行 */
  gap: 12px;
  padding: 8px;
  justify-content: center; /* 居中对齐 */
}

.prod-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--border);
  position: relative;
  width: 200px;
  height: 200px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.prod-card.pending { border-color: var(--warning); }
.prod-card.producing { border-color: var(--primary); }
.prod-card.done { border-color: var(--success); }
.prod-card.ready { border-color: var(--purple); }
.prod-card.shipped { border-color: var(--teal); }

.prod-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  flex-shrink: 0;
  min-height: 32px;
}
.prod-customer { 
  font-weight: 700; 
  font-size: 12px; 
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis; 
  max-width: 120px;
  line-height: 1.3;
}
.prod-status {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.prod-status.status-success { background: #f6ffed; color: #52c41a; }
.prod-status.status-info { background: #e6f4ff; color: #1677ff; }
.prod-status.status-default { background: #fff7e6; color: #fa8c16; }

/* 删除按钮 */
.btn-delete-prod {
  background: #ff4d4f;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
  transition: all 0.2s;
}
.btn-delete-prod:hover {
  background: #ff7875;
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(255,77,79,0.4);
}

.prod-card-body { 
  font-size: 11px; 
  color: var(--text-muted); 
  line-height: 1.6; 
  flex: 1; 
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.prod-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  min-height: 16px;
}
.prod-label { 
  color: var(--text-muted); 
  font-size: 10px;
  flex-shrink: 0;
}
.prod-value { 
  color: var(--text); 
  font-weight: 500;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  text-align: right;
}
.prod-card-footer {
  margin-top: auto;
  padding-top: 6px;
  flex-shrink: 0;
  min-height: 28px;
}

/* 订单看板归总视图 */
.order-list {
  max-height: 120px;
  overflow-y: auto;
}

/* 视图切换按钮 */
#btn-card-view, #btn-group-view {
  transition: all 0.2s;
}
#btn-card-view:hover, #btn-group-view:hover {
  transform: scale(1.05);
}

/* ===== 横向三栏卡片（固定400x400尺寸） ===== */
.prod-card-h {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  padding: 0;
  font-size: 12px;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  background: #fff;
  width: 400px; /* 固定宽度400px */
  height: 400px; /* 固定高度400px */
  transition: all 0.2s;
}
.prod-card-h:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* ===== 生产状态数字化统计 ===== */
.prod-stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
/* 数字化统计卡片容器：一行放3个 */
.prod-stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}
.prod-stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
  box-shadow: var(--shadow);
}
.prod-stat-card .prod-stat-num {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
}
.prod-stat-card .prod-stat-num.blue { color: var(--primary); }
.prod-stat-card .prod-stat-num.green { color: var(--success); }
.prod-stat-card .prod-stat-num.orange { color: var(--warning); }
.prod-stat-card .prod-stat-num.yellow { color: #d4a017; }
.prod-stat-card .prod-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 600;
}
.prod-stat-card .prod-stat-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 数字化进度条 */
.digi-progress {
  margin-top: 8px;
}
.digi-progress .digi-numbers {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.digi-progress .digi-numbers .done-num { 
  color: var(--success); 
  font-weight: 800; 
  font-size: 18px;
  font-family: 'Courier New', monospace;
}
.digi-progress .digi-numbers .done-num.complete {
  color: var(--success);
}
.digi-progress .digi-numbers .total-num { 
  color: var(--text); 
  font-weight: 700; 
}
.digi-progress .digi-bar {
  height: 8px;
  background: #e8ecf1;
  border-radius: 4px;
  overflow: hidden;
}
.digi-progress .digi-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  border-radius: 4px;
  transition: width 0.5s ease;
}
.digi-progress .digi-bar-fill.done,
.digi-progress .digi-bar-fill.complete {
  background: linear-gradient(90deg, var(--success), #52c41a);
}
.digi-progress .digi-bar-fill.warning {
  background: linear-gradient(90deg, var(--warning), #faad14);
}

/* ===== Filter Bar ===== */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.filter-btn {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ===== Report Grid ===== */
.report-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (min-width: 768px) {
  .report-grid { grid-template-columns: repeat(3, 1fr); }
}

.report-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px 16px;
  box-shadow: var(--shadow);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}
.report-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(22,119,255,0.15);
}
.report-icon { font-size: 36px; margin-bottom: 8px; }
.report-title { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.report-desc { font-size: 12px; color: var(--text-muted); }

/* Report card highlight */
.report-card-highlight {
  border-color: var(--primary);
  background: linear-gradient(135deg, #f0f7ff, var(--card-bg));
}

/* Report card active state */
.report-card-active {
  border-color: var(--primary) !important;
  background: linear-gradient(135deg, #e6f4ff, var(--card-bg)) !important;
  box-shadow: 0 4px 20px rgba(22,119,255,0.25) !important;
}
.report-card-active .report-title {
  color: var(--primary);
}

/* ===== Order Search Result ===== */
.order-result-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
  border-left: 4px solid var(--primary);
}
.order-result-header {
  padding: 14px 20px;
  background: linear-gradient(135deg, #f0f7ff, #fff);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.order-result-header .order-no {
  font-weight: 700;
  font-size: 15px;
  color: var(--primary);
  font-family: 'Courier New', monospace;
}
.order-result-header .order-time {
  font-size: 12px;
  color: var(--text-muted);
}
.order-result-body {
  padding: 14px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px 16px;
  font-size: 13px;
}
.order-result-body .field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.order-result-body .field-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}
.order-result-body .field-value {
  font-weight: 600;
  color: var(--text);
}

/* Timeline */
.order-timeline {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
}
.timeline-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.timeline {
  display: flex;
  align-items: flex-start;
  gap: 0;
  position: relative;
  overflow-x: auto;
  padding-bottom: 4px;
}
.timeline::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  height: 3px;
  background: #e8ecf1;
  z-index: 0;
}
.timeline-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.timeline-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  margin-bottom: 6px;
  border: 3px solid #e8ecf1;
  background: #fff;
  color: #ccc;
  transition: all .2s;
}
.timeline-dot.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(22,119,255,0.3);
}
.timeline-dot.done {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,185,107,0.3);
}
.timeline-dot.warning {
  border-color: var(--warning);
  background: var(--warning);
  color: #fff;
  box-shadow: 0 2px 8px rgba(250,173,20,0.3);
}
.timeline-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}
.timeline-label.active {
  color: var(--primary);
}
.timeline-label.done {
  color: var(--success);
}
.timeline-time {
  font-size: 10px;
  color: #bbb;
  text-align: center;
  white-space: nowrap;
}
.timeline-arrow {
  display: flex;
  align-items: center;
  color: #d0d5dd;
  font-size: 18px;
  height: 32px;
  flex-shrink: 0;
}

/* ===== Report Preview Table ===== */
.report-summary {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 12px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 14px;
}
.report-summary .sum-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.report-summary .sum-label {
  color: var(--text-muted);
  font-size: 13px;
}
.report-summary .sum-value {
  font-weight: 700;
  color: var(--primary);
  font-size: 16px;
}

.report-table-wrap {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.report-table-wrap .table-header-bar {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.report-table-wrap .table-header-bar .table-title {
  font-weight: 700;
  font-size: 14px;
}
.report-table-wrap .table-header-bar .record-count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 10px;
  border-radius: 20px;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.report-table thead {
  background: var(--bg);
  position: sticky;
  top: 0;
}
.report-table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.report-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.report-table tbody tr:hover {
  background: #f0f7ff;
}
.report-table tfoot td {
  background: #fafafa;
  font-weight: 700;
  color: var(--primary);
  border-top: 2px solid var(--primary);
  padding: 10px 12px;
}
.report-table-scroll {
  max-height: 50vh;
  overflow: auto;
}
.report-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.date-filter {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* ===== Search Bar ===== */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.search-bar .form-input { flex: 1; }

/* ===== Product Info Box ===== */
.product-info-box {
  background: #f0f7ff;
  border: 1px solid #bae0ff;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #1677ff;
}

/* ===== Ship Items List ===== */
.ship-items-list { margin: 8px 0 12px; }
.ship-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f5f7fa;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 6px;
  font-size: 13px;
}
.ship-item-name { font-weight: 500; }
.ship-item-qty { color: var(--text-muted); }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 14px;
  pointer-events: none;
  opacity: 0;
  transition: all 0.3s;
  z-index: 9999;
  max-width: 80vw;
  text-align: center;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { background: rgba(82,196,26,0.9); }
.toast.error { background: rgba(255,77,79,0.9); }
.toast.warning { background: rgba(250,140,22,0.9); }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
  overflow: hidden;
}
.modal-title {
  padding: 18px 20px 0;
  font-size: 16px;
  font-weight: 700;
}
.modal-body {
  padding: 12px 20px 20px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}
.modal-footer {
  padding: 12px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
}

/* ===== 响应式 PC 端 ===== */
@media (min-width: 992px) {
  .sidebar {
    left: 0;
    top: var(--header-h);
    height: calc(100vh - var(--header-h));
  }
  .sidebar-header { margin-top: 0; }
  .sidebar-overlay { display: none !important; }
  .main-content { margin-left: var(--sidebar-w); }
  .menu-btn { display: none; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d9d9d9; border-radius: 4px; }

/* ===== 发货产品列表 ===== */
.ship-items-list {
  margin: 12px 0;
  padding: 12px;
  background: var(--bg-light);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.ship-items-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.ship-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: #fff;
  border-radius: 6px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.ship-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}

.ship-item-barcode {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  font-size: 12px;
  color: var(--primary);
  padding: 2px 6px;
  background: var(--primary-light);
  border-radius: 4px;
}

.ship-item-name {
  font-weight: 500;
  color: var(--text);
  flex: 1;
}

.ship-item-spec {
  font-size: 12px;
  color: var(--text-muted);
  padding: 2px 6px;
  background: #f0f0f0;
  border-radius: 4px;
}

