:root {
  --bg: #f4f8fb;
  --card: #ffffff;
  --primary: #10a37f;
  --primary-light: #e8f7f2;
  --primary-dark: #0b7a5e;
  --text: #16283d;
  --text-sub: #5f7a94;
  --border: #e8f0f7;
  --danger: #e35d51;
  --danger-light: #fef1ef;
  --radius: 20px;
  --shadow: 0 2px 10px rgba(20, 60, 100, 0.05);
  --shadow-hover: 0 12px 28px rgba(20, 60, 100, 0.12);
}

/* ===== 网格 ===== */
.bom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
  gap: 19px;
}

/* ===== 卡片 ===== */
.card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 22px 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #10a37f, #34d3a6);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 14px;
}

.card-head h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  letter-spacing: -0.01em;
  word-break: break-word;
  flex: 1;
}

.status {
  flex-shrink: 0;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 20px;
  background: #e8f7ef;
  color: #0d7a4d;
  border: 1px solid #c5ecda;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.status.obsolete {
  background: #fef1ef;
  color: #c0392b;
  border-color: #f8d5d0;
}

/* 新增：规格 + 价格 同一排 */
.spec-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;   /* 窄屏自动换行，避免挤压 */
}

/* 规格：去掉原来的 margin-bottom，改为自适应 */
.spec {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f5f9fd;
  border-radius: 11px;
  padding: 7px 14px;
  color: #35618c;
  font-weight: 600;
  border: 1px solid #e4eff9;
  width: fit-content;
  margin-bottom: 0;      /* 改这里 */
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

/* 价格区：去掉原来的 margin-bottom，改为靠右 */
.price-section {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #f0faf6 0%, #f7fcfa 100%);
  border-radius: 12px;
  border: 1px solid #d8f0e6;
  margin-bottom: 0;      /* 改这里 */
  flex: 1;               /* 占满剩余宽度 */
  min-width: 0;
  margin-left:16px;
}

/* ===== 物料明细区 ===== */
.bom-section {
  background: #f8fbfe;
  border-radius: 14px;
  border: 1px solid #eaf2f9;
  padding: 14px 16px;
  margin-bottom: 16px;
  flex: 1;
}

.bom-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: #4a7aa0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.bom-section-title .material-icons-outlined { font-size: 15px; color: #6da8d0; }

.bom-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }

.bom-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: #2f4f70;
  padding: 7px 0;
  border-bottom: 1px dashed #e3eef8;
}

.bom-list li:last-child { border-bottom: none; }

.bom-list .part-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  min-width: 0;
}

.bom-list .part-name .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #10a37f;
  opacity: 0.55;
  flex-shrink: 0;
}

.bom-list .part-code {
  font-weight: 600;
  color: #5a7a99;
  background: #eef5fc;
  padding: 3px 9px;
  border-radius: 8px;
  white-space: nowrap;
  border: 1px solid #dcebf7;
}

/* ===== 操作按钮 ===== */
.actions {
  display: flex;
  gap: 9px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.actions a:not(:last-of-type){margin-right:16px;}
.btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
}

.btn:active { transform: scale(0.97); }
.btn .material-icons-outlined { font-size: 16px; }

.btn-edit { background: #eef5ff; color: #2a6fa8; }
.btn-edit:hover { background: #dfebff; }

.btn-delete { background: var(--danger-light); color: var(--danger); }
.btn-delete:hover { background: #fde3e0; }
.openboxs-cont{min-width:800px;}
.modal-body{padding:10px;}

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-weight: 600;
  color: #4a6a8a;
  margin-bottom: 7px;
}

.input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fafcfe;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.12);
}

.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }
.field-row .field:nth-of-type(2n){margin-left:16px;}
/* BOM 编辑区 */
.bom-editor {
  background: #f8fbfe;
  border-radius: 16px;
  padding: 17px;
  border: 1px solid var(--border);
}

.bom-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-weight: 600;
  color: #4a6a8a;
}

.btn-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border: none;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.btn-add:hover { background: #d5efe7; }
.btn-add .material-icons-outlined { font-size: 15px; }

.bom-row {
  display: flex;
  gap: 8px;
  margin-bottom: 9px;
  align-items: center;
}

.bom-row .input {
  padding: 8px 12px;
  border-radius: 10px;
}

.bom-row .remove-btn {
  background: #fdecea;
  color: var(--danger);
  border: none;
  width: 35px; height: 35px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.bom-row .remove-btn:hover { background: #fbd9d6; }
.bom-row .remove-btn .material-icons-outlined { font-size: 16px; }

/* 供应商区域 */
.supplier-section {
margin-top: 28px;
border-top: 2px solid #e9eef4;
padding-top: 22px;
}

.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 18px;
}

.section-header h3 {
font-size: 1.1rem;
font-weight: 700;
color: #0b1e33;
letter-spacing: -0.2px;
}

/* 按钮 — 无圆角，扁平风格 */
.btn {
border: none;
border-radius: 0;              /* 无圆角 */
padding: 8px 18px;
font-weight: 600;
font-size: 0.85rem;
cursor: pointer;
transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
background: #ffffff;
color: #1e293b;
border: 1.5px solid #cbd5e1;
letter-spacing: 0.2px;
}

.btn:hover {
background: #f8fafc;
border-color: #94a3b8;
}

.btn-primary {
background: #1e3a8a;
border: 1.5px solid #1e3a8a;
color: white;
}

.btn-primary:hover {
background: #1e40af;
border-color: #1e40af;
}

.btn-sm {
padding: 6px 16px;
font-size: 0.8rem;
}