* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  background: #f0f2f5; color: #333;
}
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }
header {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px; margin-bottom: 24px;
}
header h1 { font-size: 22px; }
nav { display: flex; gap: 16px; }
nav a { color: #1a73e8; text-decoration: none; font-size: 14px; }
nav a:hover { text-decoration: underline; }

/* 装机表格 */
.build-table {
  width: 100%; border-collapse: collapse; background: #fff;
  border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.08);
  margin-bottom: 20px;
}
.build-table th {
  background: #fafafa; font-weight: 600; font-size: 13px;
  padding: 10px 8px; border-bottom: 2px solid #e53935; text-align: center;
}
.build-table td {
  padding: 6px 8px; border-bottom: 1px solid #eee; vertical-align: middle;
}
.build-table td.col-cat { font-weight: 700; font-size: 14px; text-align: center; white-space: nowrap; }
.build-table select, .build-table input {
  padding: 4px 6px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; background: #fafafa;
}
.build-table td.col-price, .build-table td.col-subtotal {
  text-align: center; font-size: 14px; font-weight: 600;
}
.build-table td.col-qty { text-align: center; }
.col-cat { width: 60px; }
.col-brand { width: 100px; }
.col-model { min-width: 180px; }
.col-qty { width: 70px; }
.col-price { width: 70px; }
.col-subtotal { width: 80px; }
.col-note { width: 120px; }
.col-act { width: 30px; text-align: center; }
.btn-add-row, .btn-del-row {
  width: 24px; height: 24px; border: none; border-radius: 50%;
  font-size: 16px; line-height: 24px; cursor: pointer; font-weight: 700;
}
.btn-add-row { background: #43a047; color: #fff; }
.btn-del-row { background: #e53935; color: #fff; }

/* 合计栏 */
.total-bar {
  background: #fff; border-radius: 12px; padding: 20px;
  box-shadow: 0 1px 6px rgba(0,0,0,.1);
  display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px;
}
.total-left strong { font-size: 24px; color: #e53935; }
.toolbar-btns { display: flex; gap: 8px; }
.btn-history, .btn-clear {
  padding: 8px 16px; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600;
}
.btn-history { background: #e3f2fd; color: #1565c0; }
.btn-clear { background: #fce4ec; color: #c62828; }
.customer-section {
  background: #fff; border-radius: 12px; padding: 16px 20px;
  box-shadow: 0 1px 6px rgba(0,0,0,.1); margin-top: 12px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start;
}
.customer-section input, .customer-section textarea {
  padding: 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px;
}
.customer-section textarea { resize: vertical; min-height: 42px; }
.btn-submit {
  padding: 12px 32px; background: #e53935; color: #fff; border: none;
  border-radius: 8px; font-size: 15px; font-weight: 700; cursor: pointer;
}
.btn-submit:hover { background: #c62828; }

/* 导入页 */
.import-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 640px) { .import-layout { grid-template-columns: 1fr; } }
.import-form, .import-tips {
  background: #fff; border-radius: 12px; padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.import-form label { display: block; font-weight: 600; margin: 12px 0 4px; font-size: 14px; }
.import-form select, .import-form textarea {
  width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px;
}
.import-form textarea { font-family: monospace; }
.import-form .btn {
  margin-top: 12px; padding: 10px 24px; background: #1a73e8; color: #fff;
  border: none; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.import-form small { display: block; color: #999; font-size: 12px; margin-top: 8px; }
.import-ok { background: #e8f5e9; padding: 8px 12px; border-radius: 6px; color: #2e7d32; font-size: 14px; margin-bottom: 12px; }
.import-tips ol { padding-left: 20px; line-height: 2; font-size: 14px; }

/* 装机详情 */
.build-detail { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.status-paid { color: #2e7d32; font-weight: 700; }
.status-pending { color: #e65100; font-weight: 700; }
.pay-section { text-align: center; margin-top: 24px; padding-top: 20px; border-top: 1px solid #eee; }
.btn-pay {
  padding: 14px 48px; background: #1677ff; color: #fff; border: none; border-radius: 8px;
  font-size: 18px; font-weight: 700; cursor: pointer;
}
.btn-pay:hover { background: #0958d9; }
.btn-pay:disabled { background: #999; cursor: not-allowed; }
.build-meta { margin-bottom: 20px; line-height: 1.8; }
.detail-table { width: 100%; border-collapse: collapse; }
.detail-table td, .detail-table th {
  padding: 10px 12px; border-bottom: 1px solid #eee; text-align: left;
}
.detail-table th { background: #fafafa; font-weight: 600; }
.total-row td { border-top: 2px solid #e53935; font-size: 16px; }

/* 订单表 */
.order-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.order-table td, .order-table th { padding: 10px 12px; border-bottom: 1px solid #eee; font-size: 14px; text-align: left; }
.order-table th { background: #fafafa; font-weight: 600; }
.order-table a { color: #1a73e8; text-decoration: none; }
.empty { text-align: center; padding: 60px 0; color: #999; }

/* 配件管理 */
.parts-toolbar {
  background: #fff; border-radius: 10px; padding: 12px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08); margin-bottom: 12px;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
}
.parts-toolbar select, .parts-toolbar button {
  padding: 6px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px;
}
.parts-toolbar button { background: #1a73e8; color: #fff; border: none; cursor: pointer; }
.page-info { color: #999; font-size: 13px; margin-left: auto; }
.parts-table {
  width: 100%; border-collapse: collapse; background: #fff;
  border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.parts-table th, .parts-table td {
  padding: 8px 10px; border-bottom: 1px solid #eee; font-size: 13px; text-align: left;
}
.parts-table th { background: #fafafa; font-weight: 600; font-size: 12px; }
.parts-table select, .parts-table input {
  padding: 4px 6px; border: 1px solid #ddd; border-radius: 4px; font-size: 12px;
}
.pagination {
  text-align: center; margin-top: 16px; display: flex; gap: 12px;
  justify-content: center; align-items: center;
}
.pagination a { text-decoration: none; }

/* 品牌管理 */
.brand-layout { display: grid; grid-template-columns: 1fr 2fr; gap: 24px; }
@media (max-width: 640px) { .brand-layout { grid-template-columns: 1fr; } }
.brand-form, .brand-list { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.brand-form h3, .brand-list h3 { margin-bottom: 12px; }
.brand-form input[type=text] { width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 6px; margin-bottom: 8px; font-size: 14px; }
.brand-table { width: 100%; border-collapse: collapse; }
.brand-table td, .brand-table th { padding: 8px 12px; border-bottom: 1px solid #eee; text-align: left; font-size: 14px; }
.brand-table th { background: #fafafa; font-weight: 600; }
.btn-small { padding: 4px 12px; border: none; border-radius: 4px; cursor: pointer; font-size: 12px; display: inline-block; }
.btn-del { background: #e53935; color: #fff; }
.cat-checkboxes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.cat-checkboxes .cb { font-size: 13px; display: flex; align-items: center; gap: 3px; }
.cat-tag { display: inline-block; padding: 2px 6px; background: #e3f2fd; border-radius: 4px; font-size: 11px; margin: 1px; }
.cat-tag.dim { background: #f5f5f5; color: #999; }
