﻿/* 钲鹏机床ERP - 组件样式 V3.0 */

/* ========== 统计卡片 ========== */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  border-top: 3px solid transparent;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  min-height: 110px;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  border-radius: 0 0 0 80px;
  opacity: 0.06;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.stat-card:hover::after {
  opacity: 0.1;
}

.stat-card .stat-icon-wrap {
  width: 50px;
  height: 50px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 34px;
  display: flex;
  align-items: center;
}

.stat-title {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
  font-weight: 450;
}

.stat-sub {
  font-size: 12px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.stat-sub.up { color: var(--success); }
.stat-sub.down { color: var(--danger); }
.stat-sub.warn { color: var(--warning); }

.stat-trend {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

/* 紧凑单行统计卡片（物料主数据管理 5 个指标一行） */
.stat-cards-inline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.stat-cards-inline .stat-card {
  padding: 12px 14px;
  gap: 10px;
  min-width: 0;
}
.stat-cards-inline .stat-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}
.stat-cards-inline .stat-icon-wrap span {
  font-size: 18px;
}
.stat-cards-inline .stat-value {
  font-size: 22px;
}
.stat-cards-inline .stat-title {
  font-size: 12px;
  margin-top: 2px;
}
@media (max-width: 1200px) {
  .stat-cards-inline {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 768px) {
  .stat-cards-inline {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .stat-cards-inline .stat-card {
    padding: 10px 12px;
  }
}

/* 现金流看板：固定列数避免最后一行卡片数量不足导致对不齐 */
.stat-cards.cashflow-overview-cards {
  grid-template-columns: repeat(3, 1fr);
}
.stat-cards.cashflow-flow-cards {
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 1200px) {
  .stat-cards.cashflow-overview-cards,
  .stat-cards.cashflow-flow-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .stat-cards.cashflow-overview-cards,
  .stat-cards.cashflow-flow-cards {
    grid-template-columns: 1fr;
  }
}

/* ========== 卡片 ========== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 18px;
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title::before {
  content: '';
  width: 4px;
  height: 18px;
  background: var(--primary);
  border-radius: 2px;
}

.card-body {
  padding: 20px;
}

/* ========== 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  letter-spacing: -0.1px;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(79,110,247,0.25);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(79,110,247,0.35);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success);
  color: white;
  box-shadow: 0 2px 8px rgba(16,185,129,0.25);
}

.btn-success:hover {
  opacity: 0.92;
  box-shadow: 0 4px 12px rgba(16,185,129,0.35);
  transform: translateY(-1px);
}

.btn-warning {
  background: var(--warning);
  color: white;
  box-shadow: 0 2px 8px rgba(245,158,11,0.25);
}

.btn-warning:hover {
  opacity: 0.92;
  box-shadow: 0 4px 12px rgba(245,158,11,0.35);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: white;
  box-shadow: 0 2px 8px rgba(239,68,68,0.25);
}

.btn-danger:hover {
  opacity: 0.92;
  box-shadow: 0 4px 12px rgba(239,68,68,0.35);
  transform: translateY(-1px);
}

.btn-info {
  background: var(--info);
  color: white;
  box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}

.btn-info:hover {
  opacity: 0.92;
  box-shadow: 0 4px 12px rgba(99,102,241,0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
  color: var(--text);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-bg);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 10px 24px;
  font-size: 15px;
}

.btn:disabled,
.btn.disabled-btn {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.3);
}

/* ========== 状态标签 - V65增强 ========== */
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.1px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  transition: transform 0.15s ease;
}
.status-tag:hover {
  transform: scale(1.06);
}

.status-tag::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.6);
}

.status-active { background: var(--success-light); color: #065f46; }
.status-active::before { background: var(--success); }
.status-draft { background: var(--warning-light); color: #92400e; }
.status-draft::before { background: var(--warning); }
.status-pending { background: var(--warning-light); color: #a16207; }
.status-pending::before { background: var(--warning); }
.status-disabled { background: #f1f5f9; color: #64748b; }
.status-disabled::before { background: #94a3b8; }
.status-done { background: var(--info-light); color: #3730a3; }
.status-done::before { background: var(--info); }
.status-processing { background: #d1fae5; color: #065f46; }
.status-processing::before { background: var(--success); }
.status-processing::before { background: var(--success); }
.status-waiting { background: #fef3c7; color: #92400e; }
.status-waiting::before { background: var(--warning); }
.status-danger { background: var(--danger-light); color: #991b1b; }
.status-danger::before { background: var(--danger); }
.status-default { background: #f1f5f9; color: #64748b; }
.status-default::before { background: #94a3b8; }

/* ========== 进度条 ========== */
.progress-bar {
  position: relative;
  height: 22px;
  background: #e2e8f0;
  border-radius: 11px;
  overflow: hidden;
  min-width: 90px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 11px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  text-align: center;
  line-height: 22px;
  font-size: 11px;
  font-weight: 650;
  color: var(--text);
}

/* ========== 筛选栏 - V65增强 ========== */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 18px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.filter-left,
.filter-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-select,
.filter-input,
.filter-search {
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 13.5px;
  outline: none;
  background: #f8fafc;
  color: var(--text);
  transition: var(--transition);
  cursor: pointer;
}
.filter-select:hover {
  border-color: #a5b4fc;
  background: #fff;
}

.filter-select:focus,
.filter-input:focus,
.filter-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,110,247,0.08);
}

.filter-search {
  width: 220px;
  background: var(--bg);
}

.filter-search:focus {
  background: white;
}

/* ========== V4 销售订单筛选栏：多条件网格布局 ========== */
.so-filter-bar {
  display: block !important;
  padding: 16px 20px !important;
}
.so-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px 16px;
  margin-bottom: 14px;
}
.so-filter-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.so-filter-item label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.so-filter-input {
  width: 100% !important;
  box-sizing: border-box;
  min-width: 0;
}
.so-filter-range {
  display: flex;
  align-items: center;
  gap: 6px;
}
.so-filter-range .so-filter-input {
  flex: 1;
  min-width: 0;
}
.so-filter-sep {
  font-size: 12px;
  color: #94a3b8;
  flex: 0 0 auto;
}
.so-filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 2px;
  border-top: 1px solid #e8ecf0;
}
.so-filter-count {
  font-size: 12px;
  color: #64748b;
  margin-left: 4px;
}
/* 在 filter-bar 内按钮紧凑 */
.so-filter-actions .btn-sm {
  padding: 6px 16px;
  font-size: 12.5px;
}

/* ========== V86 FilterBar 通用筛选组件 ────────────────── */
.fb-pill {
  padding: 4px 12px;
  border-radius: 14px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.fb-pill:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}
.fb-pill.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

/* ========== V5 销售订单统计卡片 ────────────────────── */
.so-stats-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.so-stat-card {
  flex: 1;
  min-width: 90px;
  text-align: center;
  padding: 14px 10px;
  background: #fff;
  border: 1px solid #e8ecf3;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.so-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
  border-color: #c4d0de;
}
.so-stat-num {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.so-stat-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  margin-top: 4px;
  letter-spacing: 0.3px;
}
.so-stat-pending .so-stat-num { color: #d97706; }
.so-stat-confirm .so-stat-num { color: #2563eb; }
.so-stat-prod .so-stat-num { color: #7c3aed; }
.so-stat-done .so-stat-num { color: #059669; }
.so-stat-cancel .so-stat-num { color: #94a3b8; }
.so-stat-warn .so-stat-num { color: #dc2626; }
.so-stat-return .so-stat-num { color: #ea580c; }

/* ========== V5 快速筛选药丸 ───────────────────────── */
.so-quick-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.so-quick-pill {
  padding: 7px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  background: #f8fafc;
  color: #475569;
  transition: all 0.18s;
  user-select: none;
  white-space: nowrap;
}
.so-quick-pill:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #2563eb;
}
.so-quick-pill.active {
  background: #1e293b;
  color: #fff;
  border-color: #1e293b;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(30,41,59,0.2);
}
.so-qp-pending.active { background: #d97706; border-color: #d97706; }
.so-qp-confirmed.active { background: #2563eb; border-color: #2563eb; }
.so-qp-prod.active { background: #7c3aed; border-color: #7c3aed; }
.so-qp-done.active { background: #059669; border-color: #059669; }
.so-qp-undelivered.active { background: #dc2626; border-color: #dc2626; }
.so-qp-voided.active { background: #dc2626; border-color: #dc2626; }

/* ========== V5 筛选栏美化 ============================ */
.so-filter-bar {
  padding: 18px 22px !important;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 2px 12px rgba(0,0,0,0.02);
}
.so-filter-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px 18px;
}
.so-filter-item label {
  font-size: 11.5px;
  letter-spacing: 0.1px;
}
.filter-select.so-filter-input {
  appearance: none;
  background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E") no-repeat right 10px center;
  padding-right: 30px;
  cursor: pointer;
}
.so-filter-actions {
  border-top-color: #f1f5f9;
  padding-top: 10px;
}

/* ========== V92 FilterBar 单行紧凑布局（方案A） ==========
   filter-bar.js 组件容器带 fb-compact 类时启用：
   pills/条件/操作横向排列，小屏自动换行，重置计数靠右 */
.filter-bar.fb-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 18px;
  padding: 12px 16px !important;
}
.filter-bar.fb-compact .fb-pills-row {
  margin-bottom: 0 !important;
  align-items: center;
}
.filter-bar.fb-compact .so-filter-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 16px;
  margin-bottom: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.filter-bar.fb-compact .so-filter-item {
  flex-direction: column;
  gap: 3px;
  width: auto;
}
.filter-bar.fb-compact .so-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  border-top: none;
  padding-top: 0;
}

/* ========== V92 税务发票筛选栏超紧凑样式 ========== */
.fin-inv-filter-compact .filter-bar.fb-compact {
  padding: 8px 12px !important;
  gap: 8px 10px;
  border-radius: 8px;
}
.fin-inv-filter-compact .filter-bar.fb-compact .so-filter-grid {
  gap: 8px 10px;
}
.fin-inv-filter-compact .filter-bar.fb-compact .so-filter-item {
  gap: 2px;
}
.fin-inv-filter-compact .filter-bar.fb-compact .so-filter-item label {
  font-size: 11px;
  line-height: 1.2;
}
.fin-inv-filter-compact .filter-bar.fb-compact .so-filter-input,
.fin-inv-filter-compact .filter-bar.fb-compact input,
.fin-inv-filter-compact .filter-bar.fb-compact select {
  padding: 4px 7px;
  font-size: 12px;
  min-height: 28px;
  height: 28px;
}
.fin-inv-filter-compact .filter-bar.fb-compact .so-filter-item:nth-child(1) .so-filter-input,
.fin-inv-filter-compact .filter-bar.fb-compact .so-filter-item:nth-child(1) select {
  max-width: 100px;
}
.fin-inv-filter-compact .filter-bar.fb-compact .so-filter-item:nth-child(2) .so-filter-input {
  max-width: 140px;
}
.fin-inv-filter-compact .filter-bar.fb-compact .so-filter-range input {
  width: 100px;
}
.fin-inv-filter-compact .filter-bar.fb-compact .so-filter-actions .btn {
  padding: 4px 10px;
  font-size: 12px;
  min-height: 28px;
}

/* ========== V94 财务管理筛选栏：仅压缩行距，不改内容排列 ========== */
.fin-filter-compact .filter-bar.fb-compact {
  padding: 8px 12px !important;
  gap: 6px 14px;
  border-radius: 8px;
  align-items: flex-end;
}
.fin-filter-compact .filter-bar.fb-compact .fb-pills-row {
  gap: 4px;
  margin-bottom: 0 !important;
}
.fin-filter-compact .filter-bar.fb-compact .fb-pill {
  padding: 3px 10px !important;
  font-size: 11.5px !important;
  border-radius: 12px !important;
}
.fin-filter-compact .filter-bar.fb-compact .so-filter-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 6px 14px;
  margin-bottom: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.fin-filter-compact .filter-bar.fb-compact .so-filter-item {
  flex-direction: column;
  gap: 3px;
  width: auto;
  min-width: 0;
}
.fin-filter-compact .filter-bar.fb-compact .so-filter-item label {
  font-size: 11px;
  line-height: 1.3;
  color: #64748b;
  margin-bottom: 0;
}
.fin-filter-compact .filter-bar.fb-compact .so-filter-input,
.fin-filter-compact .filter-bar.fb-compact input,
.fin-filter-compact .filter-bar.fb-compact select {
  padding: 4px 7px;
  font-size: 12px;
  min-height: 27px;
  height: 27px;
  border-radius: 5px;
}
.fin-filter-compact .filter-bar.fb-compact .so-filter-item .so-filter-input,
.fin-filter-compact .filter-bar.fb-compact .so-filter-item input,
.fin-filter-compact .filter-bar.fb-compact .so-filter-item select {
  min-width: 90px;
}
.fin-filter-compact .filter-bar.fb-compact .so-filter-range {
  gap: 4px;
}
.fin-filter-compact .filter-bar.fb-compact .so-filter-range input {
  min-width: 100px;
}
.fin-filter-compact .filter-bar.fb-compact .so-filter-sep {
  font-size: 11px;
}
.fin-filter-compact .filter-bar.fb-compact .so-filter-actions {
  gap: 6px;
  border-top: none;
  padding-top: 0;
  margin-left: auto;
}
.fin-filter-compact .filter-bar.fb-compact .so-filter-actions .btn {
  padding: 4px 10px;
  font-size: 12px;
  min-height: 27px;
  height: 27px;
}
.fin-filter-compact .filter-bar.fb-compact .so-filter-count {
  font-size: 11px;
  margin-left: 0;
}

/* ========== V7 扁平化按台分行 ========== */
.so-item-sn {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  letter-spacing: 0.3px;
}

/* ========== 标签页 ========== */
.tabs {
  margin-bottom: 0;
}

.tab-headers {
  display: flex;
  border-bottom: 2px solid var(--border);
  gap: 2px;
  overflow-x: auto;
}

.tab-header {
  padding: 11px 22px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-light);
  transition: var(--transition);
  white-space: nowrap;
  font-weight: 500;
  border-radius: var(--radius) var(--radius) 0 0;
}

.tab-header:hover {
  color: var(--primary);
  background: var(--primary-bg);
}

.tab-header.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 650;
  background: transparent;
}

.tab-content {
  display: none;
  padding-top: 18px;
}

.tab-content.active {
  display: block;
  animation: fadeSlideIn 0.3s ease-out;
}

/* Tab导航按钮 */
.tab-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
  overflow-x: auto;
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: var(--text-light);
  font-size: 13.5px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  border-radius: var(--radius) var(--radius) 0 0;
  font-weight: 500;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--primary);
  background: var(--primary-bg);
}

.tab-btn.active {
  color: var(--primary);
  font-weight: 650;
  border-bottom-color: var(--primary);
}

/* ========== 快捷操作 ========== */
.quick-actions {
  margin-bottom: 24px;
}

.quick-actions h3 {
  font-size: 16px;
  font-weight: 650;
  margin-bottom: 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-actions h3::before {
  content: '';
  width: 4px;
  height: 18px;
  background: var(--primary);
  border-radius: 2px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.action-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px 18px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.action-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  transition: var(--transition);
}

.action-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.action-card:hover::before {
  height: 5px;
}

.action-icon {
  font-size: 36px;
  margin-bottom: 10px;
  transition: var(--transition);
}

.action-card:hover .action-icon {
  transform: scale(1.15);
}

.action-label {
  font-size: 13.5px;
  color: var(--text);
  font-weight: 550;
}

/* ========== 仪表盘网格 ========== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.dashboard-card {
  height: fit-content;
}

/* ========== 预警列表 ========== */
.alert-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
  transition: var(--transition);
}

.alert-item:hover {
  transform: translateX(2px);
}

.alert-danger {
  background: var(--danger-light);
  border-left: 3px solid var(--danger);
}

.alert-warning {
  background: var(--warning-light);
  border-left: 3px solid var(--warning);
}

.alert-info {
  background: var(--info-light);
  border-left: 3px solid var(--info);
}

.alert-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.alert-text {
  color: var(--text);
}

/* ========== 甘特图 ========== */
.gantt-chart {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: white;
}

.gantt-header {
  display: flex;
  background: #f8fafc;
  padding: 12px 18px;
  font-weight: 650;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.gantt-row {
  display: flex;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
  transition: var(--transition);
}

.gantt-row:hover {
  background: var(--bg-hover);
}

.gantt-bar {
  height: 26px;
  border-radius: 6px;
  color: white;
  font-size: 11px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  min-width: 40px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 550;
}

/* ========== 项目概览 KPI 卡片行 ========== */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-align: center;
  transition: var(--transition);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-card .kpi-value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 6px;
}

.kpi-card .kpi-label {
  font-size: 13px;
  color: var(--text-light);
  font-weight: 450;
}

/* ========== 数据表格 ========== */
.data-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: white;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.data-table thead {
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
}

table.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 650;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

table.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}

table.data-table tbody tr {
  transition: var(--transition);
}

table.data-table tbody tr:hover {
  background: #f8fafc;
}

table.data-table tbody tr:nth-child(even) {
  background: #fafbfc;
}

table.data-table tbody tr:nth-child(even):hover {
  background: #f1f5f9;
}

/* 选中行高亮 */
table.data-table tbody tr.row-selected {
  background: #dbeafe !important;
  outline: 2px solid #3b82f6;
  outline-offset: -2px;
}

table.data-table tbody tr.row-selected:hover {
  background: #bfdbfe !important;
}

/* 操作按钮列 */
.actions-cell {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.actions-cell .btn {
  padding: 4px 10px;
  font-size: 11.5px;
}

/* ========== 表单 ========== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-group .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  color: var(--text);
  transition: var(--transition);
  background: white;
  font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,110,247,0.08);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .form-inline {
    grid-template-columns: 1fr;
  }
}

/* ========== 搜索选择框 ========== */
.searchable-select-wrap {
  position: relative;
}

.searchable-select-wrap input {
  width: 100%;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
}

.searchable-select-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,110,247,0.08);
}

.searchable-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  display: none;
}

.searchable-dropdown.show {
  display: block;
}

.searchable-dropdown .dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13.5px;
  transition: var(--transition);
}

.searchable-dropdown .dropdown-item:hover {
  background: var(--primary-bg);
  color: var(--primary);
}

/* ========== 空状态 ========== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 15px;
}

/* ========== MRP ========== */
.mrp-panel {
  margin-bottom: 20px;
}

.mrp-summary {
  display: flex;
  gap: 12px;
  margin: 12px 0;
  flex-wrap: wrap;
}

.mrp-tag {
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 550;
}

.mrp-tag.danger { background: var(--danger-light); color: #991b1b; }
.mrp-tag.medium { background: #fed7aa; color: #9a3412; }
.mrp-tag.warning { background: var(--warning-light); color: #92400e; }
.mrp-tag.success { background: var(--success-light); color: #065f46; }

/* ========== APS排产 ========== */
.aps-stat-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 12px;
  min-width: 100px;
  text-align: center;
  line-height: 1.5;
  background: white;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.aps-stat-card strong {
  font-size: 24px;
  display: block;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* ========== 产能 ========== */
.capacity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.capacity-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
}

.capacity-item span:first-child {
  min-width: 120px;
  font-size: 13px;
  color: var(--text-secondary);
}

.capacity-bar-bg {
  flex: 1;
  height: 10px;
  background: #e2e8f0;
  border-radius: 5px;
  overflow: hidden;
}

.capacity-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== 配置项 ========== */
.config-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  gap: 14px;
}

.config-key {
  font-weight: 650;
  min-width: 130px;
  color: var(--text-secondary);
}

/* ========== 消息列表 ========== */
.message-list {
  max-height: 400px;
  overflow-y: auto;
}

.message-item {
  display: flex;
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition);
  border-radius: var(--radius-sm);
}

.message-item:hover {
  background: var(--bg-hover);
}

.message-item.unread {
  background: var(--primary-bg);
}

.message-item.unread:hover {
  background: #dde3ff;
}

.message-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.message-content {
  flex: 1;
}

.message-title {
  font-weight: 650;
  font-size: 14px;
}

.message-text {
  font-size: 13px;
  color: var(--text-light);
  margin: 4px 0;
}

.message-time {
  font-size: 12px;
  color: var(--text-muted);
}

/* ========== 待办列表 ========== */
.todo-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 13.5px;
  transition: var(--transition);
}

.todo-item:hover {
  background: var(--border);
}

.todo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.todo-dot.pending { background: var(--warning); }
.todo-dot.danger { background: var(--danger); }
.todo-dot.warning { background: var(--warning); }

/* ========== SN溯源 ========== */
.sn-trace h4 {
  margin-bottom: 16px;
  color: var(--primary);
  font-size: 16px;
  font-weight: 650;
}

.trace-sections {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.trace-section {
  background: var(--bg);
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}

.trace-section h5 {
  font-size: 14px;
  font-weight: 650;
  margin-bottom: 8px;
  color: var(--text);
}

.trace-section p {
  font-size: 13.5px;
  color: var(--text-light);
  margin: 5px 0;
}

/* ========== 模态框 ========== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.45);
  z-index: 999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-overlay.show {
  display: flex;
}

.modal-container {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 95%;
  max-width: 960px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.25s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  width: 34px;
  height: 34px;
  border: none;
  background: var(--bg);
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--danger-light);
  color: var(--danger);
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ========== Toast 消息 ========== */
.toast-container {
  position: fixed;
  top: 76px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius);
  color: white;
  font-size: 14px;
  font-weight: 550;
  box-shadow: var(--shadow-lg);
  animation: toastSlideIn 0.3s ease-out;
  min-width: 280px;
  max-width: 420px;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }
.toast-info { background: var(--info); }

/* ========== 批量操作 ========== */
.batch-actions { transition: background 0.2s; }
.batch-actions:hover { background: #fff3cd !important; }
.shortage-row { transition: background 0.15s; }
.shortage-row:hover { background: #fff3e0 !important; }
.wo-select-row { transition: background 0.15s; }
.wo-select-row:hover { background: #e8f0fe !important; }

.aps-wo-row { transition: background 0.15s; }
.aps-wo-row:hover { background: #e8f0fe !important; }

.aps-results .card-header h3 { font-size: 14px; }

/* APS 交期反推 */
.aps-backward-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #fafafa;
  border-bottom: 1px solid #e8e8e8;
  flex-wrap: wrap;
}
.aps-backward-recommend {
  padding: 8px 14px;
  font-size: 12px;
  color: #555;
  background: #fff;
  border-bottom: 1px solid #eee;
  line-height: 1.6;
}

/* APS 休息日 */
.aps-shift-tiers { padding: 10px 14px; background: #fefefe; border-bottom: 1px solid #eee; }
.aps-shift-row-wrap { display: flex; gap: 8px; flex-wrap: wrap; }
.aps-shift-card {
  flex: 1; min-width: 170px; max-width: 280px;
  border: 1px solid #e8e8e8; border-left-width: 4px;
  border-radius: 6px; padding: 8px 10px;
  background: #fff; font-size: 11px; line-height: 1.6;
}
.aps-shift-card.aps-shift-feasible { background: #f0fdf4; }
.aps-shift-card.aps-shift-short { background: #fff5f5; }
.aps-shift-name { font-weight: bold; font-size: 12px; margin-bottom: 2px; }
.aps-shift-label { color: #888; font-size: 10px; margin-bottom: 4px; }
.aps-shift-cap { color: #555; margin-bottom: 4px; }
.aps-shift-badge { font-weight: bold; font-size: 11px; padding: 1px 0; }
.aps-shift-feasible .aps-shift-badge { color: #2E7D32; }
.aps-shift-short .aps-shift-badge { color: #D0021B; }

/* APS 极限缺口 */
.aps-ultimate-gap {
  margin: 8px 14px; padding: 12px 14px;
  background: #fff5f5; border: 2px dashed #fca5a5; border-radius: 8px;
}
.aps-gap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.aps-gap-item {
  display: flex; flex-direction: column; padding: 6px 10px;
  background: #fff; border-radius: 4px; border: 1px solid #fecaca;
}
.aps-gap-label { font-size: 10px; color: #999; margin-bottom: 2px; }

.aps-worker-groups { padding: 8px 14px; background: #fafafa; border-bottom: 1px solid #eee; }
.aps-material-alerts > summary { transition: background 0.15s; }
.aps-material-alerts > summary:hover { background: #fff0f0 !important; }

/* ========== APS智能排产 V4.0 ========== */
/* 智能概览卡片网格 */
.aps-smart-overview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

/* 智能卡片 */
.aps-smart-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.aps-smart-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.aps-smart-card.blue::before { background: linear-gradient(90deg, #667eea, #764ba2); }
.aps-smart-card.green::before { background: linear-gradient(90deg, #10b981, #059669); }
.aps-smart-card.amber::before { background: linear-gradient(90deg, #f59e0b, #d97706); }
.aps-smart-card.red::before { background: linear-gradient(90deg, #ef4444, #dc2626); }
.aps-smart-card.purple::before { background: linear-gradient(90deg, #8b5cf6, #7c3aed); }
.aps-smart-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.aps-smart-card-icon { font-size: 22px; margin-bottom: 4px; }
.aps-smart-card-num { font-size: 26px; font-weight: 800; letter-spacing: -1px; }
.aps-smart-card.blue .aps-smart-card-num { color: #667eea; }
.aps-smart-card.green .aps-smart-card-num { color: #10b981; }
.aps-smart-card.amber .aps-smart-card-num { color: #f59e0b; }
.aps-smart-card.red .aps-smart-card-num { color: #ef4444; }
.aps-smart-card.purple .aps-smart-card-num { color: #8b5cf6; }
.aps-smart-card-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* 智能徽章 */
.aps-smart-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* 策略选择卡片 */
.aps-strategy-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
  position: relative;
}
.aps-strategy-card:hover {
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102,126,234,0.12);
}
.aps-strategy-card.active {
  border-color: #667eea;
  background: linear-gradient(135deg, #f8f7ff, #eef2ff);
  box-shadow: 0 2px 12px rgba(102,126,234,0.18);
}
.aps-strategy-card.active .aps-strategy-check {
  opacity: 1;
}
.aps-strategy-icon { font-size: 24px; flex-shrink: 0; }
.aps-strategy-content { flex: 1; min-width: 0; }
.aps-strategy-name { font-weight: 700; font-size: 13px; color: #333; }
.aps-strategy-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.aps-strategy-check {
  font-size: 16px;
  color: #667eea;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

/* Tab导航 */
.aps-tab-nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg);
  border-radius: 12px;
  margin-bottom: 14px;
  align-items: center;
}
.aps-tab-item {
  padding: 8px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-muted);
  white-space: nowrap;
}
.aps-tab-item:hover { color: #667eea; background: rgba(102,126,234,0.06); }
.aps-tab-item.active {
  color: #fff;
  background: linear-gradient(135deg, #667eea, #764ba2);
  box-shadow: 0 2px 8px rgba(102,126,234,0.3);
}

/* Tab内容 */
.aps-tab-content { }

/* 健康度徽章 */
.aps-health-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
}
.aps-health-badge.green { background: #ecfdf5; color: #059669; }
.aps-health-badge.amber { background: #fffbeb; color: #d97706; }
.aps-health-badge.red { background: #fef2f2; color: #dc2626; }

/* 瓶颈热力图 */
.aps-heat-item {
  flex: 1;
  min-width: 180px;
  max-width: 260px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.15s ease;
}
.aps-heat-item:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

/* ========== BOM工序配置 ========== */
.bom-tab { display: none; }
.bom-tab.active { display: block; }

.process-bom-selector {
  display: flex; align-items: center; padding: 12px 16px;
  background: var(--bg); border-radius: var(--radius); margin-bottom: 16px;
}

.process-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 8px; overflow: hidden;
  transition: box-shadow 0.2s;
}
.process-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.card-draft { border-left: 3px solid var(--warning); background: #fffdf7; }

/* BOM 工序卡片头 */
.process-card-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer; user-select: none;
}
.process-card-header:hover { background: #fafbfc; }
.process-seq {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #fff; font-weight: 700;
  font-size: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.process-info { flex: 1; min-width: 0; }
.process-name { display: block; font-weight: 600; font-size: 15px; color: var(--text); }
.process-meta { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.process-status-area { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* BOM 表格 */
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table th {
  background: #eef2f7; padding: 8px 12px; text-align: left;
  font-weight: 600; color: #555; border-bottom: 1px solid #ddd;
}
.mini-table td { padding: 7px 12px; border-bottom: 1px solid var(--border-light); }
.mini-table .mono { font-family: 'Courier New', monospace; font-size: 12px; }

/* BOM 按钮 */
.btn-action-icon {
  width: 30px; height: 30px; border: 1px solid #ddd;
  background: #fff; border-radius: 6px; cursor: pointer;
  font-size: 14px; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.btn-action-icon:hover { background: var(--primary-bg); border-color: var(--primary); }
.btn-danger-icon:hover { background: var(--danger-light); border-color: var(--danger); color: var(--danger); }

.process-card-body { display: none; border-top: 1px solid #eee; padding: 12px 16px; background: #fafbfc; }
.process-card-body.expanded { display: block; }
.process-materials-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 0 10px 0; margin-bottom: 8px; border-bottom: 1px dashed #e0e0e0;
}
.process-materials-empty { text-align: center; padding: 20px; color: #999; font-size: 13px; }

/* 齐套 */ 
.kitting-badge {
  display: inline-block; padding: 4px 12px; border-radius: 12px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all 0.15s; white-space: nowrap;
}
.kitting-badge:hover { transform: scale(1.05); }
.kitting-ready { background: var(--success-light); color: #065f46; border: 1px solid #a7f3d0; }
.kitting-partial { background: var(--warning-light); color: #92400e; border: 1px solid #fcd34d; }
.kitting-waiting { background: var(--danger-light); color: #991b1b; border: 1px solid #fca5a5; }

.kitting-summary-bar { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.ks-item {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: 8px; font-size: 14px; font-weight: 500;
}
.ks-item strong { font-size: 20px; }
.ks-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ks-ready { background: var(--success-light); color: #065f46; }
.ks-ready .ks-dot { background: var(--success); }
.ks-partial { background: var(--warning-light); color: #92400e; }
.ks-partial .ks-dot { background: var(--warning); }
.ks-waiting { background: var(--danger-light); color: #991b1b; }
.ks-waiting .ks-dot { background: var(--danger); }
.ks-total { background: var(--info-light); color: #3730a3; }

.kitting-cards { display: flex; flex-direction: column; gap: 20px; }
.kitting-group-title {
  font-weight: 700; font-size: 15px; margin-bottom: 10px;
  padding-bottom: 8px; border-bottom: 2px solid var(--primary); color: var(--text);
}
.kitting-card {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px;
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 6px; background: #fff; transition: box-shadow 0.15s;
}
.kitting-card:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.06); }
.kc-seq {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--primary-bg); color: var(--primary);
  font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.kc-info { flex: 1; min-width: 150px; }
.kc-name { font-weight: 600; font-size: 14px; color: var(--text); }
.kc-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.kc-material-list { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.kc-mat-tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  background: #f0f0f0; font-size: 11px; color: #666; white-space: nowrap;
}
.kc-mat-ok { background: #d1fae5; color: #065f46; }
.kc-mat-short { background: #fee2e2; color: #991b1b; }

/* 模糊搜索下拉 */
.fuzzy-combo { position: relative; min-width: 160px; }
.fuzzy-combo .item-name-combo { width: 100%; font-size: 13px; box-sizing: border-box; }
.filter-fuzzy .fuzzy-search-input { width: 100%; box-sizing: border-box; min-width: 160px; }
.filter-fuzzy .fuzzy-dropdown { position: absolute; z-index: 9999; top: 100%; left: 0; right: 0; }
.fuzzy-dropdown {
  position: fixed; max-height: 260px; min-width: 180px;
  overflow-y: auto; overflow-x: hidden; background: #fff;
  border: 1px solid #d0d0d0; border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15); z-index: 99999; display: none;
}
.fuzzy-dropdown.show { display: block; }
.fuzzy-dropdown-item {
  padding: 8px 12px; cursor: pointer; font-size: 13px;
  border-bottom: 1px solid #f5f5f5; transition: background 0.12s;
  display: flex; flex-direction: column; gap: 2px;
}
.fuzzy-dropdown-item:last-child { border-bottom: none; }
.fuzzy-dropdown-item:hover,
.fuzzy-dropdown-item.active { background: var(--primary-bg); color: var(--primary); }
.fuzzy-dropdown-item .fdi-main { font-weight: 600; color: var(--text); white-space: nowrap; }
.fuzzy-dropdown-item .fdi-sub { display: flex; gap: 8px; align-items: center; }
.fuzzy-dropdown-item .fdi-spec { font-size: 11px; color: var(--text-muted); }
.fuzzy-dropdown-item .fdi-code { font-size: 11px; color: #888; background: #f3f4f6; padding: 0 6px; border-radius: 3px; white-space: nowrap; }
.fuzzy-dropdown-optgroup {
  padding: 6px 12px; font-size: 11px; font-weight: 700;
  color: #e67e22; background: #fff7f0; border-bottom: 1px solid #f0e0d0;
  position: sticky; top: 0; z-index: 1;
}
.fuzzy-no-match { padding: 12px; text-align: center; font-size: 12px; color: #999; }
.fuzzy-dropdown-item mark { background: #fff3cd; color: #e67e22; padding: 0 2px; border-radius: 2px; font-weight: 600; }
.fuzzy-dropdown-item.fuzzy-manual { border-top: 1px dashed #ddd; color: var(--primary); font-style: italic; }

/* ========== 流程图编辑器 (保留原有复杂样式) ========== */
.route-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; transition: box-shadow 0.2s; }
.route-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.route-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid #f0f0f0;
  background: #fafbfc; flex-wrap: wrap; gap: 10px;
}
.route-card-info { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.route-card-code { font-weight: 700; font-size: 15px; color: var(--text); }
.route-card-model { font-size: 13px; color: #555; background: var(--primary-bg); padding: 2px 10px; border-radius: 4px; }
.route-card-version { font-size: 12px; color: #888; }
.route-card-actions { display: flex; gap: 8px; flex-shrink: 0; }
.route-card-flow { padding: 14px 18px; overflow-x: auto; }

.pv-track { display: flex; align-items: flex-start; gap: 0; flex-wrap: nowrap; min-height: 48px; }
.flow-empty-hint { color: #bbb; font-size: 13px; font-style: italic; }
.pv-arrow { font-size: 16px; color: var(--primary); margin: 0 4px; font-weight: 700; line-height: 52px; flex-shrink: 0; }

.flow-node-preview {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: linear-gradient(135deg, var(--primary-bg) 0%, #d2e3fc 100%);
  border: 2px solid var(--primary); border-radius: 10px;
  padding: 6px 14px; min-width: 72px; cursor: default;
  transition: transform 0.15s; flex-shrink: 0;
}
.flow-node-preview:hover { transform: translateY(-2px); box-shadow: 0 3px 10px rgba(74,144,217,0.2); }
.flow-node-preview .flow-node-seq { font-size: 10px; font-weight: 700; color: var(--primary); background: #fff; border-radius: 50%; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; line-height: 1; }
.flow-node-preview .flow-node-code { font-size: 11px; font-weight: 600; color: var(--text); font-family: 'Courier New', monospace; }
.flow-node-preview .flow-node-name { font-size: 10px; color: #666; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-node-preview .flow-node-hours { font-size: 9px; color: #999; background: #f0f0f0; padding: 1px 5px; border-radius: 3px; }

.pv-parallel-block { display: flex; align-items: stretch; gap: 2px; background: #fff8e1; border: 1.5px solid #ffcc80; border-radius: 8px; padding: 6px 8px; flex-shrink: 0; }
.pv-fork-mark, .pv-join-mark { font-size: 14px; color: #e65100; font-weight: 700; display: flex; align-items: center; padding: 0 2px; }
.pv-stack { display: flex; flex-direction: column; gap: 2px; }
.pv-branch-row { display: flex; align-items: center; gap: 1px; background: #fff; border-radius: 4px; padding: 2px 6px; border: 1px solid #ffe0b2; }
.pv-br-label { font-size: 9px; font-weight: 700; color: #e65100; background: #fff3e0; border-radius: 50%; width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pv-mini-arrow { font-size: 11px; color: #ff9800; margin: 0 1px; }
.pv-step { font-size: 11px; font-weight: 600; color: var(--text); background: #fff; border: 1px solid #ffe0b2; border-radius: 3px; padding: 1px 5px; font-family: 'Courier New', monospace; white-space: nowrap; }
.pv-empty { font-size: 10px; color: #ccc; padding: 0 4px; }
.pv-dep-mark { color: #1565c0; font-size: 9px; margin-left: 2px; font-weight: 700; vertical-align: super; }

.route-flow-list { display: flex; flex-direction: column; gap: 12px; }
.route-editor { display: flex; flex-direction: column; gap: 12px; }
.route-editor-hint { font-size: 12px; color: #888; background: #fffde7; border: 1px solid #ffe082; border-radius: 8px; padding: 8px 14px; line-height: 1.6; }
.route-editor-info { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group-inline { display: flex; flex-direction: column; gap: 4px; }
.form-group-inline label { font-size: 12px; font-weight: 600; color: #555; }
.form-group-inline .required { color: #e74c3c; }
.form-group-inline .form-input { width: 100%; box-sizing: border-box; }
.route-flow-title { font-size: 14px; font-weight: 700; color: var(--text); padding-bottom: 8px; border-bottom: 2px solid var(--primary); }

/* ========== WPS 拖搭式流程编辑器布局 ========== */
.route-editor-workspace { display: flex; gap: 12px; min-height: 360px; }
.route-editor-sidebar { width: 220px; flex-shrink: 0; background: #fafbfc; border: 1px solid #e0e0e0; border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; }
.re-sb-header { padding: 10px 12px; background: #e3f2fd; border-bottom: 1px solid #bbdefb; font-size: 13px; font-weight: 700; color: #1565c0; display: flex; align-items: center; gap: 6px; }
.re-sb-search { padding: 8px 10px; border-bottom: 1px solid #eee; }
.re-sb-search input { width: 100%; padding: 6px 10px; border: 1px solid #e0e0e0; border-radius: 6px; font-size: 12px; outline: none; box-sizing: border-box; }
.re-sb-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(74,144,217,0.15); }
.re-sb-list { flex: 1; overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 4px; }

/* 侧栏工序芯片 */
.re-sp-chip { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #fff; border: 1.5px solid #e0e0e0; border-radius: 10px; cursor: grab; transition: all 0.15s; user-select: none; }
.re-sp-chip:hover { border-color: var(--primary); box-shadow: 0 3px 12px rgba(74,144,217,0.2); transform: translateX(2px); }
.re-sp-chip:active { cursor: grabbing; opacity: 0.7; }
.re-sp-chip.re-dragging { opacity: 0.3; transform: scale(0.95); }
.re-sp-chip-icon { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--primary), #72ABE3); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.re-sp-chip-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.re-sp-chip-name { font-size: 12px; font-weight: 600; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.re-sp-chip-meta { font-size: 10px; color: #999; display: flex; gap: 8px; }

/* 主画布区域 */
.route-editor-canvas-area { flex: 1; background: #f8f9fb; border: 2px dashed #d0d5dd; border-radius: 12px; overflow: auto; position: relative; min-width: 0; display: flex; align-items: flex-start; justify-content: flex-start; padding: 16px; }
.route-editor-canvas-area.canvas-drag-over { border-color: var(--primary); background: #eef4fb; box-shadow: inset 0 0 30px rgba(74,144,217,0.08); }
/* 拉箭头 SVG 浮层 */
.fc-drag-arrow-svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1000; overflow: visible; }
.fc-drag-arrow-line { stroke: var(--primary); stroke-width: 2.5; stroke-dasharray: 8 4; fill: none; animation: fcArrowDash 0.6s linear infinite; }
@keyframes fcArrowDash { to { stroke-dashoffset: -24; } }

/* 拉箭头时画布内所有放置区高亮 */
.route-editor-canvas-area.arrow-active .fc-drop-zone,
.route-editor-canvas-area.arrow-active .fc-drop-end { border-color: var(--primary); background: rgba(74,144,217,0.04); }
.route-editor-canvas-area.arrow-active .fc-drop-zone::after,
.route-editor-canvas-area.arrow-active .fc-drop-end { border-color: var(--primary); }

/* 箭头悬停在放置区上的强调效果 */
.fc-drop-zone.fc-arrow-hover { background: rgba(126,211,33,0.15) !important; min-height: 32px !important; }
.fc-drop-zone.fc-arrow-hover::after { background: #7ED321 !important; height: 3px !important; width: 90% !important; }
.fc-drop-end.fc-arrow-hover { border-color: #7ED321 !important; background: rgba(126,211,33,0.12) !important; }
.fc-drop-end.fc-arrow-hover .fc-drop-end-text { color: #7ED321 !important; font-size: 12px !important; }

/* 拉箭头指向节点时的样式 */
.flow-step-node.fc-arrow-hover { border-color: #7ED321 !important; box-shadow: 0 0 0 4px rgba(126,211,33,0.25), 0 4px 12px rgba(126,211,33,0.2) !important; transform: translateY(-2px) !important; }
.flow-step-node.fc-arrow-hover .flow-dot-in { background: #7ED321; box-shadow: 0 0 0 4px rgba(126,211,33,0.25); }

/* 分支内节点颜色 */
.fc-branch-steps .flow-step-node { border-color: #ff9800; }
.fc-branch-steps .flow-step-node:hover { box-shadow: 0 4px 16px rgba(255,152,0,0.25); }
.route-flow-canvas { background: linear-gradient(135deg, #f8faff 0%, #fefefe 100%); border: 2px dashed #d0d8e8; border-radius: 12px; padding: 24px 20px; min-height: 100px; overflow-y: auto; max-height: 65vh; }
.flow-empty { text-align: center; color: #b0b8c8; font-size: 14px; padding: 32px; }

/* 拉箭头释放后的工序快速选择弹窗 */
.fc-arrow-popup { position: fixed; z-index: 10000; background: #fff; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,0.2), 0 0 0 1px rgba(0,0,0,0.08); width: 240px; max-height: 300px; overflow: hidden; animation: fcPopupIn 0.2s ease-out; }
@keyframes fcPopupIn { from { opacity: 0; transform: scale(0.9) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.fc-arrow-popup-title { padding: 10px 14px; background: linear-gradient(135deg, #e3f2fd, #bbdefb); font-size: 13px; font-weight: 700; color: #1565c0; border-bottom: 1px solid #e0e0e0; }
.fc-arrow-popup-list { max-height: 240px; overflow-y: auto; padding: 4px 0; }
.fc-arrow-popup-item { display: flex; align-items: center; gap: 10px; padding: 8px 14px; cursor: pointer; transition: background 0.12s; }
.fc-arrow-popup-item:hover { background: #f0f4ff; }
.fc-arrow-popup-item:active { background: #e3f2fd; }
.fc-api-icon { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--primary), #72ABE3); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.fc-api-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fc-api-name { font-size: 13px; font-weight: 600; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-api-meta { font-size: 10px; color: #999; }

/* ========== 纵向流程图（从上往下） ========== */
.fc-canvas { display: flex; flex-direction: column; align-items: center; gap: 0; overflow-y: auto; min-height: 180px; padding: 16px 8px; }
.fc-step-row { display: flex; justify-content: center; flex-shrink: 0; width: 100%; }

/* 垂直连线（串行节点之间） */
.fc-hline { display: flex; flex-direction: column; align-items: center; height: 36px; position: relative; flex-shrink: 0; }
.fc-hline::before { content: ''; width: 3px; height: 26px; background: var(--primary); border-radius: 2px; }
.fc-hline-arrow { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid #4A90D9; }

/* 纵向放置区（两个节点之间，横条 — 可见插入区） */
.fc-drop-zone { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 28px; flex-shrink: 0; transition: all 0.2s; border-radius: 8px; position: relative; }
.fc-drop-zone::after { content: ''; height: 1px; width: 70%; max-width: 280px; background: #e0e0e0; border-radius: 0; transition: all 0.2s; }
.fc-drop-zone:hover::after { background: var(--primary); height: 2px; }
.fc-drop-zone.fc-drop-active { min-height: 36px; background: rgba(126,211,33,0.1); }
.fc-drop-zone.fc-drop-active::after { background: #7ED321; height: 3px; width: 85%; }
.fc-drop-zone-label { position: absolute; font-size: 10px; color: #c0c7d0; font-weight: 600; right: 8px; top: 50%; transform: translateY(-50%); transition: color 0.15s; pointer-events: none; }
.fc-drop-zone:hover .fc-drop-zone-label { color: var(--primary); }
.fc-drop-zone.fc-drop-active .fc-drop-zone-label { color: #7ED321; }

/* 节点间"+"按钮 → 点击即可在中线插入工序 */
.fc-drop-zone-plus { position: absolute; z-index: 6; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid #d0d5dd; color: #999; font-size: 13px; line-height: 16px; text-align: center; cursor: pointer; transition: all 0.18s; opacity: 0; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.fc-drop-zone:hover .fc-drop-zone-plus,
.fc-canvas:hover .fc-drop-zone:hover .fc-drop-zone-plus { opacity: 1; }
.fc-drop-zone-plus:hover { background: var(--primary); border-color: var(--primary); color: #fff; transform: translate(-50%, -50%) scale(1.2); box-shadow: 0 2px 8px rgba(74,144,217,0.35); }

/* 终点插入区（底部横条） */
.fc-drop-end { flex-shrink: 0; display: flex; align-items: center; justify-content: center; margin-top: 8px; width: 100%; max-width: 260px; height: 44px; border: 2px dashed #ccc; border-radius: 10px; transition: all 0.2s; cursor: pointer; }
.fc-drop-end:hover { border-color: var(--primary); background: rgba(74,144,217,0.04); }
.fc-drop-end.fc-drop-active { border-color: #7ED321; background: rgba(126,211,33,0.08); }
.fc-drop-end-text { font-size: 10px; color: #999; font-weight: 600; transition: color 0.15s; }
.fc-drop-end.fc-drop-active .fc-drop-end-text { color: #7ED321; }

/* 节点样式 - 圆点改为上下布局 */
.flow-step-node { display: flex; align-items: center; gap: 8px; background: #fff; border: 2px solid var(--primary); border-radius: 12px; padding: 10px 14px; cursor: grab; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; user-select: none; min-width: 160px; max-width: 320px; position: relative; flex-shrink: 0; z-index: 1; }
.flow-step-node.fc-dep-open { z-index: 50; }
.flow-step-node:hover { box-shadow: 0 4px 16px rgba(74,144,217,0.25); transform: translateY(-2px); }
.flow-step-node.flow-dragging { opacity: 0.4; transform: scale(0.95); }
.flow-step-node.flow-drag-over { border-color: #7ED321 !important; box-shadow: 0 0 0 4px rgba(126,211,33,0.2); transform: translateY(-3px) !important; }
.flow-step-node .flow-dot-in { position: absolute; left: 50%; top: -7px; transform: translateX(-50%); width: 10px; height: 10px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; box-shadow: 0 0 0 1px #4A90D9; }
.flow-step-node .flow-dot-out { position: absolute; left: 50%; bottom: -7px; top: auto; transform: translateX(-50%); width: 12px; height: 12px; border-radius: 50%; background: #7ED321; border: 2px solid #fff; box-shadow: 0 0 0 1.5px #4A90D9; cursor: crosshair; transition: transform 0.15s, box-shadow 0.15s; z-index: 5; }
.flow-step-node .flow-dot-out:hover { transform: translateX(-50%) scale(1.6); box-shadow: 0 0 0 4px rgba(126,211,33,0.25), 0 0 0 1.5px #4A90D9; }
.flow-step-node .flow-dot-out:active { transform: translateX(-50%) scale(2); }

/* 分支内节点 → 纵向紧凑布局（序号在上、名称在下，避免多分支横向重叠） */
.flow-step-node.flow-step-vert { flex-direction: column; align-items: center; gap: 3px; min-width: 80px; max-width: 110px; padding: 8px 6px 28px 6px; }
.flow-step-node.flow-step-vert .flow-node-drag { position: absolute; left: 3px; top: 3px; font-size: 11px; color: #c0c8d4; }
.flow-step-node.flow-step-vert .flow-node-seq { width: 22px; height: 22px; font-size: 10px; margin-bottom: 2px; }
.flow-step-node.flow-step-vert .flow-node-name-only { font-size: 11px; max-width: 90px; text-align: center; white-space: normal; word-break: break-all; line-height: 1.3; flex: none; }
.flow-step-node.flow-step-vert .flow-node-remove { position: absolute; right: 3px; top: 3px; width: 18px; height: 18px; font-size: 9px; }
.flow-step-node.flow-step-vert .flow-dep-btn { position: absolute; right: 3px; bottom: 6px; width: 18px; height: 18px; font-size: 9px; }
.flow-step-node.flow-step-vert .flow-fork-btn { display: none; }
.flow-step-node.flow-step-vert .flow-dot-in { top: -6px; width: 8px; height: 8px; }
.flow-step-node.flow-step-vert .flow-dot-out { bottom: -6px; width: 10px; height: 10px; }
.flow-step-node.flow-step-vert .flow-dep-panel { bottom: 38px; min-width: 180px; }

/* ========== 并行组块（纵向布局） ========== */
.fc-parallel-block { display: flex; flex-direction: column; align-items: stretch; flex-shrink: 0; width: 100%; }

/* 分叉/汇合指示器（横向SVG，适配纵向流程） */
.fc-fork-indicator,
.fc-join-indicator { display: flex; align-items: center; justify-content: center; height: 36px; position: relative; }
.fc-fork-indicator svg,
.fc-join-indicator svg { width: 100%; height: 100%; display: block; position: relative; z-index: 0; pointer-events: none; }
.fc-join-target-btn { position: absolute; right: 6px; bottom: 2px; border-radius: 50%; width: 24px; height: 24px; padding: 0; font-size: 12px; cursor: pointer; white-space: nowrap; border: 1px solid #ffcc80; background: #fff; z-index: 10; line-height: 1; }
.fc-join-config-btn { position: absolute; left: 6px; bottom: 2px; border-radius: 50%; width: 24px; height: 24px; padding: 0; font-size: 13px; cursor: pointer; white-space: nowrap; border: 1px solid #1a73e8; background: #1a73e8; z-index: 10; line-height: 1; color: #fff; font-weight: 700; transition: all 0.15s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.fc-join-config-btn:hover { background: #0d47a1; border-color: #0d47a1; transform: scale(1.15); }
.fc-join-badge { position: absolute; top: -2px; left: 50%; transform: translateX(-50%); font-size: 10px; background: #e65100; color: #fff; padding: 1px 6px; border-radius: 8px; white-space: nowrap; z-index: 11; font-weight: 600; }
.fc-join-config-panel { position: absolute; top: 38px; left: 50%; transform: translateX(-50%); background: #fff; border: 1px solid #ffcc80; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,0.15); z-index: 100; min-width: 220px; padding: 10px 14px; }
.fc-join-config-inner { display: flex; flex-direction: column; gap: 6px; }
.fc-join-config-title { font-size: 12px; font-weight: 700; color: #e65100; padding-bottom: 4px; border-bottom: 1px solid #ffe0b2; margin-bottom: 2px; }
.fc-join-config-row { display: flex; flex-direction: column; gap: 2px; padding: 3px 0; }
.fc-join-config-row label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #333; cursor: pointer; }
.fc-join-config-row input[type="radio"] { margin: 0; }
.fc-join-config-hint { font-size: 10px; color: #999; padding-left: 20px; }
.fc-join-config-branches { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 0 20px; }
.fc-join-config-branch { display: flex; align-items: center; gap: 4px; font-size: 11px; color: #555; cursor: pointer; background: #f5f5f5; padding: 2px 8px; border-radius: 4px; border: 1px solid #e0e0e0; }
.fc-join-config-branch:hover { background: #e3f2fd; border-color: #90caf9; }
.fc-join-config-branch input[type="checkbox"] { margin: 0; }
.fc-join-config-actions { display: flex; justify-content: flex-end; padding-top: 6px; border-top: 1px solid #ffe0b2; margin-top: 4px; }
.fc-join-config-ok { background: #e65100; color: #fff; border: none; border-radius: 6px; padding: 4px 14px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.fc-join-config-ok:hover { background: #bf360c; transform: scale(1.05); }
.fc-join-config-panel { z-index: 200; }

.fc-parallel-row { background: linear-gradient(135deg, #fff8e1 0%, #fff3e0 100%); border: 2px solid #ff9800; border-radius: 12px; overflow: hidden; width: 100%; max-width: none; }
.fc-parallel-toolbar { display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%); border-bottom: 1px solid #ffcc80; }
.fc-parallel-badge { font-size: 13px; font-weight: 700; color: #e65100; flex: 1; }
.fc-tb-btn { font-size: 11px; border: none; border-radius: 5px; padding: 3px 12px; cursor: pointer; font-weight: 600; transition: transform 0.15s; }
.fc-tb-btn:hover { transform: scale(1.05); }
.fc-tb-add { background: var(--primary); color: #fff; }
.fc-tb-join { background: #1565c0; color: #fff; }
.fc-tb-dissolve { background: #e74c3c; color: #fff; }
.fc-branches-container { display: flex; gap: 6px; padding: 12px 8px; overflow-x: auto; justify-content: flex-start; }
.fc-branch-col { display: flex; flex-direction: column; align-items: center; gap: 0; min-width: 90px; flex: 1; }
.fc-branch-header { display: flex; align-items: center; gap: 4px; padding: 3px 6px; margin-bottom: 6px; background: #fff; border: 1px solid #ffcc80; border-radius: 6px; font-size: 11px; }
.fc-branch-letter { width: 22px; height: 22px; border-radius: 50%; background: #ff9800; color: #fff; font-weight: 700; font-size: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fc-branch-name { font-size: 12px; font-weight: 600; color: #e65100; }
.fc-branch-target-btn { font-size: 10px !important; padding: 1px 5px !important; }
.fc-branch-del { font-size: 10px; background: #ffcdd2; color: #c62828; border: none; border-radius: 3px; padding: 1px 5px; cursor: pointer; margin-left: auto; }
.fc-branch-del:hover { background: #e53935; color: #fff; }
.fc-branch-steps { display: flex; flex-direction: column; align-items: center; gap: 0; width: 100%; }
.fc-branch-empty { font-size: 11px; color: #999; font-style: italic; padding: 12px 8px; text-align: center; border: 1px dashed #ffcc80; border-radius: 8px; background: #fff; min-width: 80px; max-width: 120px; }

/* 分支内纵向连线 */
.fc-mini-vline { display: flex; flex-direction: column; align-items: center; height: 20px; }
.fc-mini-vline::before { content: ''; width: 2px; height: 12px; background: #ff9800; border-radius: 1px; }
.fc-mini-arrow { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid #ff9800; }

/* 节点子元素样式 */
.fc-vline { display: flex; flex-direction: column; align-items: center; height: 28px; position: relative; }
.fc-vline::before { content: ''; width: 3px; height: 18px; background: var(--primary); border-radius: 2px; }
.fc-vline-arrow { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid #4A90D9; }
.flow-node-drag { font-size: 14px; color: #b0b8c8; letter-spacing: -2px; cursor: grab; flex-shrink: 0; line-height: 1; margin-top: -2px; }
.flow-node-seq { width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.flow-node-body { display: flex; flex-direction: column; gap: 2px; }
.flow-node-code { font-size: 13px; font-weight: 700; color: var(--text); font-family: 'Courier New', monospace; }
.flow-node-name { font-size: 12px; color: #555; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-node-name-only { font-size: 13px; font-weight: 600; color: var(--text); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.flow-node-hours { font-size: 11px; color: #888; background: #f0f2f5; padding: 1px 6px; border-radius: 3px; align-self: flex-start; }
.flow-fork-btn { font-size: 11px; background: linear-gradient(135deg, #f9ab00 0%, #f57c00 100%); color: #fff; border: none; border-radius: 6px; padding: 3px 10px; cursor: pointer; font-weight: 600; white-space: nowrap; transition: transform 0.15s, box-shadow 0.15s; }
.flow-fork-btn:hover { transform: scale(1.05); box-shadow: 0 2px 8px rgba(245,124,0,0.4); }
.flow-node-remove { width: 22px; height: 22px; border-radius: 50%; border: none; background: var(--danger-light); color: #c5221f; cursor: pointer; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.15s; }
.flow-node-remove:hover { background: #d93025; color: #fff; }
.flow-dep-btn { width: 22px; height: 22px; border-radius: 50%; border: none; background: #f0f2f5; color: #888; cursor: pointer; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.15s; padding: 0; }
.flow-dep-btn:hover { background: #1565c0; color: #fff; transform: scale(1.1); }
.flow-dep-btn.flow-dep-active { background: #1565c0; color: #fff; }
.flow-dep-panel { position: absolute; bottom: 46px; left: 50%; transform: translateX(-50%); background: #fff; border: 1px solid #90caf9; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,0.15); z-index: 200; min-width: 240px; max-width: 320px; max-height: 260px; overflow-y: auto; padding: 10px 14px; }
.flow-dep-panel-inner { display: flex; flex-direction: column; gap: 4px; }
.flow-dep-panel-title { font-size: 12px; font-weight: 700; color: #1565c0; padding-bottom: 4px; border-bottom: 1px solid #e3f2fd; margin-bottom: 2px; }
.flow-dep-panel-empty { font-size: 11px; color: #999; padding: 8px 0; text-align: center; }
.flow-dep-panel-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #333; cursor: pointer; padding: 3px 4px; border-radius: 4px; transition: background 0.1s; }
.flow-dep-panel-item:hover { background: #e3f2fd; }
.flow-dep-panel-item input[type="checkbox"] { margin: 0; flex-shrink: 0; }
.flow-dep-panel-item small { color: #999; font-size: 10px; }
.route-add-section { display: flex; align-items: center; gap: 10px; padding: 12px 0; }
.route-add-section .form-input { min-width: 240px; }
.route-total-hours { font-size: 13px; color: #666; padding: 8px 14px; background: #f8f9fa; border-radius: 8px; text-align: right; }
.route-total-hours strong { color: var(--primary); font-size: 15px; }

/* 齐套派工面板 */
.pv-kit-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 3px; vertical-align: middle; flex-shrink: 0; border: 1px solid rgba(255,255,255,0.6); }
.route-kit-summary { padding: 8px 18px 10px 18px; font-size: 13px; border-top: 1px solid #f0f0f0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.ks-tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.ks-tag.ks-ready { background: #e8f5e9; color: #2e7d32; }
.ks-tag.ks-waiting { background: #fff8e1; color: #f57f17; }
.ks-tag.ks-blocked { background: #fce4ec; color: #c62828; }
.ks-tag.ks-done { background: #e3f2fd; color: #1565c0; }

.route-kit-panel { display: none; border-top: 2px solid var(--success); background: #fafbfc; }
.route-kit-panel.expanded { display: block; }
.rkd-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px; border-bottom: 1px solid #e8e8e8; background: var(--success-light); flex-wrap: wrap; gap: 8px; }
.rkd-title { font-weight: 700; font-size: 14px; color: #065f46; }
.rkd-legend { display: flex; gap: 8px; flex-wrap: wrap; }
.rkd-grid { padding: 12px 18px; display: flex; flex-direction: column; gap: 10px; }
.rkd-serial-row { display: flex; flex-direction: column; }
.rkd-parallel-section { border: 2px solid #ffcc80; border-radius: 10px; overflow: hidden; background: #fffdf7; }
.rkd-ps-label { padding: 8px 14px; background: linear-gradient(135deg, #fff3e0, #ffe0b2); font-size: 12px; font-weight: 700; color: #e65100; border-bottom: 1px solid #ffcc80; }
.rkd-branches-row { display: flex; gap: 8px; padding: 8px 10px; }
.rkd-branch-col { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 6px; }
.rkd-branch-hdr { font-size: 12px; font-weight: 700; color: #e65100; text-align: center; background: #fff; border: 1px solid #ffe0b2; border-radius: 4px; padding: 2px 8px; }
.rkd-step { border: 1.5px solid var(--border); border-radius: var(--radius); padding: 10px 14px; background: #fff; transition: box-shadow 0.15s; }
.rkd-step:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.rkd-step.rkd-ready { border-color: var(--success); background: #f6fef6; }
.rkd-step.rkd-waiting { border-color: var(--warning); background: #fffef5; }
.rkd-step.rkd-blocked { border-color: var(--border); background: #fafafa; opacity: 0.85; }
.rkd-step.rkd-done { border-color: var(--primary); background: #f5f8fc; }
.rkd-main { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rkd-code { font-weight: 700; font-size: 13px; color: var(--text); font-family: 'Courier New', monospace; }
.rkd-name { font-size: 13px; color: #555; flex: 1; }
.rkd-hours { font-size: 11px; color: #999; background: #f0f0f0; padding: 2px 7px; border-radius: 3px; white-space: nowrap; }
.rkd-checks { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }
.kd-dot { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.kd-green { background: var(--success-light); color: #065f46; }
.kd-yellow { background: var(--warning-light); color: #92400e; }
.kd-red { background: var(--danger-light); color: #991b1b; }
.kd-gray { background: #f0f0f0; color: #999; }
.kd-est { font-size: 10px; color: #f57f17; background: #fff8e1; padding: 1px 6px; border-radius: 3px; white-space: nowrap; }
.kd-wc { font-size: 10px; color: #888; background: #f0f0f0; padding: 1px 6px; border-radius: 3px; white-space: nowrap; }
.rkd-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rkd-reason { font-size: 11px; color: #888; flex: 1; }
.rkd-step.rkd-ready .rkd-reason { color: #065f46; font-weight: 600; }
.rkd-step.rkd-waiting .rkd-reason { color: #f57f17; }
.rkd-step.rkd-blocked .rkd-reason { color: #999; }
.kd-dispatch-btn { font-size: 11px; font-weight: 600; border: none; border-radius: 5px; padding: 4px 14px; cursor: pointer; white-space: nowrap; transition: transform 0.12s; background: linear-gradient(135deg, var(--success), #059669); color: #fff; }
.kd-dispatch-btn:hover { transform: scale(1.05); box-shadow: 0 2px 8px rgba(16,185,129,0.4); }
.kd-dispatch-btn.kd-dispatch-plan { background: linear-gradient(135deg, #f9ab00, #f57c00); color: #fff; }
.kd-dispatch-btn.kd-dispatch-plan:hover { box-shadow: 0 2px 8px rgba(245,124,0,0.4); }

/* ========== 仓库智能管理 V4.0 ========== */
/* 智能概览卡片网格 */
.wh-smart-overview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

/* 智能卡片 */
.wh-smart-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.wh-smart-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.wh-smart-card.blue::before { background: linear-gradient(90deg, #667eea, #764ba2); }
.wh-smart-card.green::before { background: linear-gradient(90deg, #10b981, #059669); }
.wh-smart-card.amber::before { background: linear-gradient(90deg, #f59e0b, #d97706); }
.wh-smart-card.red::before { background: linear-gradient(90deg, #ef4444, #dc2626); }
.wh-smart-card.purple::before { background: linear-gradient(90deg, #8b5cf6, #7c3aed); }
.wh-smart-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.wh-smart-card-icon { font-size: 22px; margin-bottom: 4px; }
.wh-smart-card-num { font-size: 26px; font-weight: 800; letter-spacing: -1px; }
.wh-smart-card.blue .wh-smart-card-num { color: #667eea; }
.wh-smart-card.green .wh-smart-card-num { color: #10b981; }
.wh-smart-card.amber .wh-smart-card-num { color: #f59e0b; }
.wh-smart-card.red .wh-smart-card-num { color: #ef4444; }
.wh-smart-card.purple .wh-smart-card-num { color: #8b5cf6; }
.wh-smart-card-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Tab导航 */
.wh-tab-nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg);
  border-radius: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.wh-tab-item {
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-muted);
  white-space: nowrap;
}
.wh-tab-item:hover { color: #667eea; background: rgba(102,126,234,0.06); }
.wh-tab-item.active {
  color: #fff;
  background: linear-gradient(135deg, #667eea, #764ba2);
  box-shadow: 0 2px 8px rgba(102,126,234,0.3);
}

/* V29: 更多下拉菜单（分组折叠导航） */
.wh-tab-more-wrap { position: relative; margin-left: 2px; }
.wh-tab-item.wh-tab-more { display: flex; align-items: center; gap: 4px; }
.wh-more-caret { font-size: 10px; transition: transform 0.2s ease; }
.wh-tab-more-wrap.open .wh-more-caret { transform: rotate(180deg); }
.wh-more-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 120;
  min-width: 260px;
  background: var(--surface, #fff);
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15,23,42,0.14);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}
.wh-tab-more-wrap.open .wh-more-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.wh-more-group {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  padding: 8px 10px 4px;
  letter-spacing: 0.5px;
}
.wh-more-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  color: #334155;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.wh-more-item:hover { background: rgba(102,126,234,0.08); color: #667eea; }
.wh-more-item.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}
.wh-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.wh-dot.amber { background: #f59e0b; }
.wh-dot.purple { background: #8b5cf6; }
.wh-dot.blue { background: #3b82f6; }
.wh-dot.green { background: #10b981; }
.wh-dot.orange { background: #f97316; }
.wh-dot.gray { background: #9ca3af; }
.wh-dot.red { background: #ef4444; }
.wh-dot.cyan { background: #06b6d4; }

/* 子Tab按钮 */
.wh-subtab-btn {
  font-size: 12px !important;
  font-weight: 600 !important;
  transition: all 0.15s;
}
.wh-subtab-btn.active {
  background: var(--primary-bg) !important;
  color: var(--primary) !important;
  border-color: var(--primary) !important;
}
