* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: #f1f5f9;
  color: #1e293b;
  padding: 24px 20px;
}

.container {
  max-width: 1440px;
  margin: 0 auto;
}

/* 顶部导航与身份 */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon {
  font-size: 26px;
}
.logo-area h2 {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.auth-badge {
  background-color: #fef3c7;
  color: #92400e;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid #fde68a;
}

/* 顶部单横排控制区 */
.top-control-bar {
  display: flex;
  align-items: center;
  background-color: #ffffff;
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  gap: 14px;
  overflow-x: auto;
  white-space: nowrap;
}

.selector-unit {
  display: flex;
  align-items: center;
  gap: 6px;
}
.selector-unit .label {
  font-size: 14px;
  font-weight: 600;
  color: #475569;
}
.selector-unit select {
  height: 36px;
  padding: 0 10px;
  font-size: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  outline: none;
  min-width: 130px;
}
.selector-unit select:focus {
  border-color: #2563eb;
  background: #fff;
}

.btn-ctrl {
  height: 36px;
  padding: 0 10px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  font-weight: 500;
  transition: all 0.15s;
}
.btn-add {
  background-color: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}
.btn-add:hover {
  background-color: #10b981;
  color: #ffffff;
}
.btn-del {
  background-color: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.btn-del:hover {
  background-color: #ef4444;
  color: #ffffff;
}

.divider {
  width: 1px;
  height: 24px;
  background-color: #e2e8f0;
}

/* 常用按钮通用 */
.btn {
  height: 36px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}
.btn-primary {
  background-color: #2563eb;
  color: #ffffff;
}
.btn-primary:hover {
  background-color: #1d4ed8;
}
.btn-dark {
  background-color: #0f172a;
  color: #ffffff;
}
.btn-dark:hover {
  background-color: #1e293b;
}
.btn-outline {
  background-color: transparent;
  border: 1px solid #cbd5e1;
  color: #334155;
}
.btn-outline:hover {
  background-color: #f1f5f9;
}
.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

/* 列表表格区域 */
.table-card {
  margin-top: 18px;
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  overflow: hidden;
}
.parts-table {
  width: 100%;
  border-collapse: collapse;
}
.parts-table th, .parts-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.parts-table th {
  background-color: #f8fafc;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}
.parts-table tr:hover {
  background-color: #fafbfc;
}

.part-thumbnail {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #e2e8f0;
  display: block;
  margin: 0 auto;
}
.no-thumb {
  width: 64px;
  height: 64px;
  background-color: #f1f5f9;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #94a3b8;
  margin: 0 auto;
}

/* 名称列宽展与徽章 */
.name-title {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.4;
}
.name-tags {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.badge-brand {
  font-size: 11px;
  padding: 2px 6px;
  background-color: #e0f2fe;
  color: #0369a1;
  border-radius: 4px;
  font-weight: 500;
}
.badge-cat {
  font-size: 11px;
  padding: 2px 6px;
  background-color: #f3e8ff;
  color: #7e22ce;
  border-radius: 4px;
  font-weight: 500;
}

/* 价格与代码 */
.price-display {
  font-size: 16px;
  font-weight: 700;
  color: #e11d48;
}
.code-display {
  display: inline-block;
  background-color: #f1f5f9;
  color: #334155;
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}
.remarks-text {
  font-size: 13px;
  color: #64748b;
  line-height: 1.4;
}

.action-btns {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.action-btn {
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid #cbd5e1;
  background: white;
  border-radius: 4px;
  cursor: pointer;
}
.action-btn:hover {
  background-color: #f8fafc;
}
.action-btn.del-btn {
  color: #ef4444;
  border-color: #fecaca;
}
.action-btn.del-btn:hover {
  background-color: #fef2f2;
}

.empty-tip {
  text-align: center;
  padding: 40px;
  color: #94a3b8;
  font-size: 14px;
}

/* 模态弹窗 */
.modal-mask {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-box {
  background-color: #ffffff;
  border-radius: 12px;
  width: 520px;
  max-width: 92%;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
  overflow: hidden;
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}
.close-btn {
  font-size: 20px;
  cursor: pointer;
  color: #94a3b8;
}
.close-btn:hover {
  color: #334155;
}
.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.form-row label {
  width: 76px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  text-align: right;
  flex-shrink: 0;
}
.form-row input, .form-row select {
  flex: 1;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
}
.form-row input:focus, .form-row select:focus {
  border-color: #2563eb;
}
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid #f1f5f9;
  background-color: #f8fafc;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
