/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

/* 工具类 */
.hidden {
  display: none !important;
}

/* 登录页面样式 */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.login-box {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  padding: 40px;
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header h1 {
  font-size: 24px;
  color: #333;
  margin-bottom: 8px;
}

.login-header p {
  font-size: 14px;
  color: #999;
}

.login-form .form-group {
  margin-bottom: 20px;
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.login-form input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.3s;
}

.login-form input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-login {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-login:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.loading {
  display: inline-block;
}

.error-message {
  margin-top: 15px;
  padding: 12px;
  background: #fee;
  color: #c33;
  border-radius: 6px;
  font-size: 14px;
  text-align: center;
}

.login-footer {
  margin-top: 30px;
  text-align: center;
  font-size: 12px;
  color: #999;
}

/* 主页面样式 */
.header {
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-title {
  font-size: 20px;
  color: #333;
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.last-update {
  color: #666;
  font-size: 14px;
  background: #f8f9fa;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #e9ecef;
  cursor: help;
  transition: all 0.2s ease;
}

.last-update:hover {
  background: #e9ecef;
  color: #495057;
}

.btn-sync {
  padding: 8px 16px;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  margin-right: 10px;
  transition: all 0.3s;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.btn-sync:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.btn-sync:active {
  transform: translateY(0);
}

.btn-sync:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-sync.syncing {
  background: #f59e0b;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

.btn-logout {
  padding: 8px 16px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 6px;
  color: #666;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.btn-logout:hover {
  background: #e8e8e8;
  border-color: #ccc;
}

/* 主内容区 */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* 筛选区域 */
.filter-section {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.filter-item label {
  font-size: 13px;
  color: #666;
  white-space: nowrap;
}

.filter-input,
.filter-select {
  padding: 7px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.3s;
}

.filter-input:focus,
.filter-select:focus {
  border-color: #667eea;
}

.filter-input {
  width: 120px;
}

.filter-select {
  width: 100px;
}

.filter-separator {
  color: #999;
  margin: 0 2px;
}

.filter-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.btn-primary,
.btn-secondary {
  padding: 8px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 500;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #ddd;
}

.btn-secondary:hover {
  background: #e8e8e8;
}


/* 统计卡片 */
.stats-section {
  margin-bottom: 24px;
}

.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.stat-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.stat-icon-blue {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-icon-green {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-icon-orange {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-icon-purple {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.stat-icon-red {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.stat-content {
  flex: 1;
}

.stat-label {
  font-size: 14px;
  color: #999;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 24px;
  font-weight: 600;
  color: #333;
}

/* 汇总统计区域 */
.summary-section {
  background: white;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.summary-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f3f4f6;
}

.summary-header h3 {
  font-size: 14px;
  color: #333;
  font-weight: 600;
  margin: 0;
}

.summary-total-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border-radius: 8px;
  font-size: 13px;
  color: #991b1b;
  box-shadow: 0 2px 4px rgba(153, 27, 27, 0.1);
}

.summary-total-label {
  font-weight: 600;
}

.summary-total-value {
  color: #7f1d1d;
}

.summary-total-value strong {
  font-size: 15px;
  font-weight: 700;
  color: #991b1b;
  margin: 0 2px;
}

.summary-total-separator {
  color: #dc2626;
  font-weight: 300;
  margin: 0 4px;
}

.summary-tabs {
  display: flex;
  gap: 6px;
}

.summary-tab {
  padding: 6px 16px;
  border: 1px solid #e5e7eb;
  background: white;
  color: #666;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

.summary-tab:hover {
  border-color: #667eea;
  color: #667eea;
}

.summary-tab.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.summary-tab .summary-tab-count {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.summary-tab.active .summary-tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

.summary-content {
  min-height: 150px;
  overflow-x: auto;
}

.summary-table-container {
  min-width: 100%;
}

/* 横向并排布局 */
.summary-grid-horizontal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
  grid-auto-rows: 1fr;
}

/* 物流公司卡片 */
.logistics-card {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.logistics-card:hover {
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
  transform: translateY(-3px);
  border-color: #667eea;
}

.logistics-card-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.logistics-card-header .percentage-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.logistics-card-body {
  flex: 1;
  overflow-y: auto;
}

.logistics-card-footer {
  flex-shrink: 0;
  margin-top: auto;
}

/* 物流公司表格 */
.logistics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.logistics-table th {
  background: #f9fafb;
  color: #6b7280;
  padding: 10px 12px;
  text-align: center;
  font-weight: 700;
  border-bottom: 2px solid #e5e7eb;
  font-size: 13px;
}

.logistics-table td {
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
  color: #374151;
  font-weight: 500;
}

.logistics-table tbody tr:hover {
  background: #f9fafb;
}

.logistics-table .area-name {
  text-align: left;
  padding-left: 16px;
  color: #4b5563;
  font-weight: 600;
}

.logistics-table .number-cell {
  font-family: 'Segoe UI', 'Arial', sans-serif;
  text-align: right;
  padding-right: 16px;
  color: #1f2937;
  font-weight: 600;
}

.logistics-table .total-row {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  font-weight: 800;
  color: #92400e;
  font-size: 14px;
}

.logistics-table .total-row td {
  border-bottom: none;
  padding: 12px 12px;
}

/* 总计卡片 */
.grand-total-card {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border: 3px solid #f87171;
  border-radius: 8px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  font-size: 15px;
  font-weight: 600;
  color: #991b1b;
  box-shadow: 0 4px 12px rgba(248, 113, 113, 0.25);
}

.grand-total-label {
  font-size: 18px;
  font-weight: 800;
}

.grand-total-value {
  font-size: 17px;
  font-weight: 700;
}

.grand-total-separator {
  color: #dc2626;
  font-weight: 400;
  font-size: 20px;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  background: white;
}

.summary-table th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 6px 8px;
  text-align: center;
  font-weight: 600;
  border: 1px solid #d1d5db;
  white-space: nowrap;
  font-size: 11px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.summary-table td {
  padding: 5px 8px;
  text-align: center;
  border: 1px solid #e5e7eb;
  white-space: nowrap;
  font-size: 11px;
}

.summary-table tbody tr:hover {
  background: #f9fafb;
}

.summary-table .logistics-name {
  font-weight: 600;
  color: #333;
  text-align: left;
  padding-left: 12px;
  font-size: 11px;
}

.summary-table .area-name {
  text-align: left;
  padding-left: 20px;
  color: #666;
  font-size: 11px;
}

.summary-table .total-row {
  background: #fef3c7;
  font-weight: 600;
  color: #92400e;
  font-size: 11px;
}

.summary-table .grand-total-row {
  background: #fee2e2;
  font-weight: 700;
  color: #991b1b;
  font-size: 12px;
}

.summary-table .number-cell {
  font-family: 'Courier New', monospace;
  text-align: right;
  padding-right: 12px;
  font-size: 11px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.summary-card {
  background: linear-gradient(135deg, #f6f8fb 0%, #ffffff 100%);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
}

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #667eea;
}

.summary-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.summary-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
  gap: 6px;
}

.summary-card-icon {
  font-size: 16px;
}

.summary-card-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  background: #f3f4f6;
  color: #666;
  font-weight: 500;
}

.summary-card-body {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-item-label {
  font-size: 12px;
  color: #999;
}

.summary-item-value {
  font-size: 18px;
  font-weight: 600;
  color: #667eea;
}

.summary-item-value.highlight {
  color: #f59e0b;
}

.loading-text {
  text-align: center;
  color: #999;
  padding: 40px;
  font-size: 14px;
}

/* 表格区域 */
.table-section {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.table-tabs {
  display: flex;
  gap: 8px;
}

.tab-btn {
  padding: 10px 24px;
  border: none;
  background: #f5f5f5;
  color: #666;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.tab-btn:hover {
  background: #e8e8e8;
}

.tab-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.tab-btn .tab-count {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  min-width: 24px;
  text-align: center;
}

.tab-btn.active .tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #667eea;
}

.table-header h3 {
  font-size: 16px;
  color: #333;
  font-weight: 600;
}

.table-info {
  font-size: 14px;
  color: #999;
}

.table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table thead {
  background: #f9fafb;
}

.data-table th {
  padding: 10px 6px;
  text-align: left;
  font-weight: 600;
  color: #666;
  border-bottom: 2px solid #e5e7eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table th.sortable {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
}

.data-table th.sortable:hover {
  background: #f3f4f6;
  color: #333;
}

.data-table th.sortable .sort-icon {
  font-size: 10px;
  color: #ccc;
  margin-left: 4px;
}

.data-table th.sortable.active .sort-icon {
  color: #667eea;
  font-weight: bold;
}

.data-table th.sortable.asc .sort-icon::before {
  content: '▲';
}

.data-table th.sortable.desc .sort-icon::before {
  content: '▼';
}

.data-table th:nth-child(1) {
  width: 8%;
}

/* 订单号(后9位) */
.data-table th:nth-child(2) {
  width: 10%;
}

/* 物流公司 */
.data-table th:nth-child(3) {
  width: 12%;
}

/* 详细地址 */
.data-table th:nth-child(4) {
  width: 8%;
}

/* 车牌号 */
.data-table th:nth-child(5) {
  width: 7%;
}

/* 总重量 */
.data-table th:nth-child(6) {
  width: 10%;
}

/* 代理商名称 */
.data-table th:nth-child(7) {
  width: 18%;
}

/* 备注 */
.data-table th:nth-child(8) {
  width: 8%;
}

/* 订单状态 */
.data-table th:nth-child(9) {
  width: 9%;
}

/* 创建时间 */
.data-table th:nth-child(10) {
  width: 9%;
}

/* 更新时间 */
.data-table th:nth-child(11) {
  width: 5%;
}

/* 操作 */

.data-table td {
  padding: 10px 6px;
  border-bottom: 1px solid #f3f4f6;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background: #f9fafb;
}

.loading-cell {
  text-align: center;
  color: #999;
  padding: 40px !important;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.badge-pugang {
  background: #dbeafe;
  color: #1e40af;
}

.badge-yougang {
  background: #fed7aa;
  color: #c2410c;
}

.badge-status-0 {
  background: #fee2e2;
  color: #991b1b;
}

.badge-status-1 {
  background: #dbeafe;
  color: #1e40af;
}

.badge-status-2 {
  background: #e0e7ff;
  color: #3730a3;
}

.badge-status-3 {
  background: #f3f4f6;
  color: #6b7280;
}

.badge-status-4 {
  background: #f3f4f6;
  color: #6b7280;
  text-decoration: line-through;
}

.badge-status-5 {
  background: #fef3c7;
  color: #92400e;
}

.badge-status-6 {
  background: #d1fae5;
  color: #065f46;
}

/* 订单行样式 */
.order-row {
  cursor: pointer;
  transition: all 0.2s;
}

.order-row:hover {
  background: #f9fafb !important;
}

.order-row.expanded {
  background: #eff6ff !important;
  border-left: 3px solid #667eea;
}

/* 更多按钮 */
.btn-more {
  padding: 4px 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 4px;
  color: white;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.btn-more:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-more:active {
  transform: translateY(0);
}

/* 订单详情行 */
.order-detail-row {
  background: #f9fafb;
}

.order-detail-row td {
  padding: 0 !important;
  border: none !important;
}

.order-detail-container {
  padding: 20px;
  background: linear-gradient(to bottom, #f9fafb 0%, #ffffff 100%);
  border-top: 2px solid #e5e7eb;
  border-bottom: 2px solid #e5e7eb;
}

.detail-loading,
.detail-empty,
.detail-error {
  text-align: center;
  padding: 40px 20px;
  color: #9ca3af;
  font-size: 14px;
}

.detail-error {
  color: #ef4444;
}

/* 订单详情表格包装器 */
.order-detail-table-wrapper {
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.detail-title {
  margin: 0 0 16px 0;
  font-size: 15px;
  font-weight: 600;
  color: #374151;
  padding-bottom: 12px;
  border-bottom: 2px solid #e5e7eb;
}

/* 订单详情表格 */
.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: white;
}

.detail-table thead {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.detail-table th {
  color: white !important;
  padding: 10px 8px;
  text-align: center;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.2);
  white-space: nowrap;
  font-size: 12px;
}

.detail-table thead tr:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.detail-table thead tr:hover th {
  color: white !important;
  background: transparent !important;
}

.detail-table td {
  padding: 8px;
  text-align: center;
  border: 1px solid #e5e7eb;
  white-space: nowrap;
  font-size: 12px;
}

.detail-table tbody tr {
  transition: background 0.2s;
}

.detail-table tbody tr:hover {
  background: #f9fafb;
}

.detail-table tbody tr:nth-child(even) {
  background: #fafafa;
}

.detail-table tbody tr:nth-child(even):hover {
  background: #f3f4f6;
}

.detail-table .highlight {
  font-weight: 600;
  color: #667eea;
}

/* 订单详情合计行 */
.detail-table tfoot {
  background: #f9fafb;
  font-weight: 600;
}

.detail-table .total-row td {
  padding: 10px 8px;
  border-top: 2px solid #667eea;
  font-weight: 600;
  color: #374151;
}

.detail-table .total-value {
  color: #667eea;
  font-size: 13px;
  font-weight: 700;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #f3f4f6;
}

.page-btn {
  padding: 8px 16px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}

.page-btn:hover:not(:disabled) {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-info {
  font-size: 14px;
  color: #666;
}

.page-size-select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

/* 模态框 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-content {
  background: white;
  border-radius: 12px;
  width: 85%;
  max-width: 900px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 12px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 16px;
  color: white;
  font-weight: 600;
  margin: 0;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  font-size: 20px;
  color: white;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.modal-body {
  padding: 0;
  overflow-y: auto;
  flex: 1;
  background: #f9fafb;
}

/* 模态框详情容器 */
.modal-detail-container {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 详情分组 */
.detail-section {
  background: white;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
}

.detail-section:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.detail-section.full-width {
  width: 100%;
}

.detail-section.three-col {
  width: 100%;
}

/* 分组标题 */
.section-header {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid #f3f4f6;
}

.section-icon {
  font-size: 14px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

/* 详情网格 */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

/* 3列网格 */
.detail-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-item.full-width {
  grid-column: 1 / -1;
}

.detail-label {
  font-size: 10px;
  color: #9ca3af;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.detail-value {
  font-size: 12px;
  color: #374151;
  font-weight: 500;
}

.detail-value.highlight {
  color: #667eea;
  font-weight: 600;
  font-size: 13px;
}

/* 统计卡片 */
.detail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat-card {
  background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
  border: 2px solid #667eea30;
  border-radius: 6px;
  padding: 10px;
  text-align: center;
  transition: all 0.3s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(102, 126, 234, 0.2);
  border-color: #667eea;
}

.stat-label {
  font-size: 10px;
  color: #9ca3af;
  margin-bottom: 4px;
  font-weight: 500;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: #667eea;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-unit {
  font-size: 11px;
  font-weight: 500;
  color: #9ca3af;
}

/* 徽章样式 */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.badge-blue {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.badge-purple {
  background: #ede9fe;
  color: #6b21a8;
  border: 1px solid #c4b5fd;
}

/* 备注内容 */
.remark-content {
  padding: 10px 12px;
  background: #f9fafb;
  border-radius: 6px;
  border-left: 3px solid #667eea;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  font-weight: 500;
}

/* 响应式 */
@media (max-width: 768px) {
  .filter-row {
    flex-direction: column;
  }

  .filter-actions {
    margin-left: 0;
    width: 100%;
  }

  .filter-actions button {
    flex: 1;
  }

  .stats-container {
    grid-template-columns: 1fr;
  }

  .data-table {
    font-size: 11px;
  }

  .data-table th,
  .data-table td {
    padding: 8px 4px;
  }
}

/* 大屏幕优化 */
@media (min-width: 1400px) {
  .main-content {
    max-width: 1600px;
  }
}

/* ==================== 月度统计页面样式 ==================== */

/* 导航按钮 */
.btn-nav {
  padding: 8px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.btn-nav:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* 月份选择器 */
.month-picker {
  width: 160px;
  padding: 8px 12px;
  font-size: 14px;
}

.year-picker {
  width: 120px;
  padding: 8px 12px;
  font-size: 14px;
}

/* 图表区域 */
.chart-section {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f3f4f6;
}

.chart-header h3 {
  font-size: 16px;
  color: #333;
  font-weight: 600;
  margin: 0;
}

.chart-tabs {
  display: flex;
  gap: 8px;
}

.chart-tab {
  padding: 6px 16px;
  border: 1px solid #e5e7eb;
  background: white;
  color: #666;
  font-size: 13px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

.chart-tab:hover {
  border-color: #667eea;
  color: #667eea;
}

.chart-tab.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.chart-container {
  height: 300px;
  position: relative;
}

.chart-summary {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 16px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: 8px;
  font-size: 14px;
  color: #0369a1;
}

.chart-summary strong {
  font-size: 18px;
  font-weight: 700;
  color: #0284c7;
}

/* 月度汇总样式调整 */
.monthly-summary .summary-header {
  flex-wrap: wrap;
}

.monthly-summary .summary-header h3 {
  font-size: 16px;
}

/* 物流卡片网格自适应 */
@media (max-width: 768px) {
  .chart-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .chart-container {
    height: 250px;
  }

  .chart-summary {
    flex-direction: column;
    gap: 8px;
  }

  .summary-grid-horizontal {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1200px) {
  .summary-grid-horizontal {
    grid-template-columns: repeat(2, 1fr);
  }
}

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