* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #0d8a8a;
  --primary-dark: #0a6f6f;
  --primary-light: #e6f4f4;
  --accent: #1a9c9c;
  --blue: #2b7cff;
  --green: #16a34a;
  --orange: #ea8c1b;
  --purple: #8b5cf6;
  --text: #1f2937;
  --text-sub: #6b7280;
  --text-light: #9ca3af;
  --border: #e5e7eb;
  --bg: #f5f7f8;
  --card: #ffffff;
  --danger: #dc2626;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; }
input, select, textarea { outline: none; }
button { cursor: pointer; }

/* ============ 登录页 ============ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0d8a8a 0%, #096666 55%, #074f52 100%);
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  top: -200px; right: -150px;
}
.login-page::after {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  bottom: -200px; left: -100px;
}
.login-card {
  width: 420px;
  background: #fff;
  border-radius: 16px;
  padding: 40px 38px 32px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
  position: relative;
  z-index: 1;
}
.login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.logo-mark {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, #0d8a8a, #16a3a3);
  color: #fff;
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700;
  box-shadow: 0 6px 16px rgba(13,138,138,0.3);
}
.logo-mark.small { width: 38px; height: 38px; font-size: 19px; border-radius: 10px; }
.login-title { font-size: 21px; font-weight: 700; color: #111827; }
.login-subtitle { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.login-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.login-tab {
  background: none; border: none;
  padding: 10px 4px; margin-right: 24px;
  color: var(--text-sub); font-weight: 500;
  border-bottom: 2px solid transparent;
}
.login-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.login-panel .form-field { margin-bottom: 16px; }
.form-field label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 7px; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%; padding: 11px 13px;
  border: 1px solid #d1d5db; border-radius: 8px;
  transition: border-color .2s, box-shadow .2s;
  background: #fff; color: var(--text);
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,138,138,0.12);
}
.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; }
.btn-code {
  white-space: nowrap; padding: 0 14px;
  border: 1px solid var(--primary); color: var(--primary);
  background: var(--primary-light); border-radius: 8px; font-weight: 600;
}
.btn-code:disabled { opacity: .5; cursor: not-allowed; }
.login-error { color: var(--danger); font-size: 13px; min-height: 18px; margin-bottom: 6px; }
.btn {
  padding: 10px 18px; border-radius: 8px; border: 1px solid transparent;
  font-weight: 600; transition: all .15s; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: #fff; color: var(--text); border-color: #d1d5db; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.login-hint { font-size: 12px; color: var(--text-light); text-align: center; margin-top: 16px; line-height: 1.6; }
.local-mode-link {
  display: block; width: 100%; margin-top: 14px;
  background: none; border: none; color: var(--primary);
  font-size: 13px; text-decoration: underline; padding: 6px;
}

/* ============ 应用框架 ============ */
.app-shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 232px; flex-shrink: 0;
  background: #0c2e33;
  color: #fff;
  display: flex; flex-direction: column;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 22px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand-title { font-size: 15px; font-weight: 700; }
.brand-sub { font-size: 9px; color: rgba(255,255,255,0.4); letter-spacing: 1px; margin-top: 2px; }
.nav-menu { padding: 16px 12px; flex: 1; }
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 4px;
  background: transparent; border: none; border-radius: 8px;
  color: rgba(255,255,255,0.7); font-size: 14px; text-align: left;
  transition: all .15s;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.nav-icon { font-size: 17px; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto; background: rgba(255,255,255,0.15);
  padding: 1px 8px; border-radius: 10px; font-size: 11px;
}
.nav-item.active .nav-badge { background: rgba(255,255,255,0.25); }
.sidebar-footer { padding: 14px; border-top: 1px solid rgba(255,255,255,0.08); }
.storage-tag {
  font-size: 11px; color: rgba(255,255,255,0.55);
  padding: 6px 10px; margin-bottom: 10px; text-align: center;
  background: rgba(255,255,255,0.05); border-radius: 6px;
}
.user-box { display: flex; align-items: center; gap: 10px; padding: 6px; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #2b9c9c, #0d8a8a);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: rgba(255,255,255,0.45); }
.btn-logout {
  background: none; border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7); border-radius: 6px;
  padding: 4px 9px; font-size: 11px;
}
.btn-logout:hover { background: rgba(255,255,255,0.1); color: #fff; }

.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 78px; flex-shrink: 0;
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 0 30px; display: flex; align-items: center; justify-content: space-between;
}
.topbar-left h1 { font-size: 20px; font-weight: 700; color: #111827; }
.topbar-left p { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.topbar-right { display: flex; gap: 10px; }
.content-scroll { flex: 1; overflow-y: auto; padding: 26px 30px 60px; }
.page { display: none; }
.page.active { display: block; }

/* ============ 工作台 ============ */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
.stat-card {
  background: #fff; border-radius: 12px; padding: 20px 22px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat-icon {
  position: absolute; right: 18px; top: 18px;
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
}
.stat-icon.blue { background: #eaf2ff; color: var(--blue); }
.stat-icon.green { background: #e9f8ef; color: var(--green); }
.stat-icon.orange { background: #fff3e4; color: var(--orange); }
.stat-icon.purple { background: #f3edff; color: var(--purple); }
.stat-label { font-size: 13px; color: var(--text-sub); margin-bottom: 10px; }
.stat-value { font-size: 30px; font-weight: 700; color: #111827; line-height: 1.1; }
.stat-foot { font-size: 11px; color: var(--text-light); margin-top: 8px; }

.panel { background: #fff; border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 22px; }
.panel-head {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.panel-head h2 { font-size: 15px; font-weight: 700; color: #111827; }
.link-btn { background: none; border: none; color: var(--primary); font-size: 13px; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.panel-body { padding: 20px 22px; }
.recent-list { display: flex; flex-direction: column; }
.recent-item {
  display: flex; align-items: center; padding: 13px 8px;
  border-bottom: 1px solid #f3f4f6; gap: 14px;
  cursor: pointer; border-radius: 6px; transition: background .15s;
}
.recent-item:hover { background: var(--primary-light); }
.recent-item:last-child { border-bottom: none; }
.recent-icon {
  width: 38px; height: 38px; border-radius: 9px; background: var(--primary-light);
  color: var(--primary); display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.recent-info { flex: 1; min-width: 0; }
.recent-title { font-weight: 600; font-size: 14px; }
.recent-sub { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.recent-amount { font-weight: 700; font-size: 15px; color: #111827; }
.status-pill {
  font-size: 11px; padding: 3px 10px; border-radius: 12px; font-weight: 600;
}
.status-草稿 { background: #f3f4f6; color: #6b7280; }
.status-已发送 { background: #eaf2ff; color: var(--blue); }
.status-已确认 { background: #e9f8ef; color: var(--green); }
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.category-card {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; cursor: pointer; transition: all .15s;
}
.category-card:hover { border-color: var(--primary); background: var(--primary-light); }
.category-name { font-weight: 600; font-size: 13px; }
.category-count { color: var(--text-light); font-size: 12px; margin-top: 4px; }
.empty-category { color: var(--text-light); font-size: 13px; padding: 10px 0; }

/* ============ 工具栏与表格 ============ */
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.search-box { position: relative; flex: 1; max-width: 380px; }
.search-box input {
  width: 100%; padding: 10px 14px 10px 38px;
  border: 1px solid #d1d5db; border-radius: 8px; background: #fff;
}
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,138,138,0.1); }
.search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 14px; }
.select-control {
  padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px;
  background: #fff; color: var(--text); min-width: 130px;
}
.select-control:focus { border-color: var(--primary); }
#page-products .toolbar { flex-wrap: wrap; }
#page-products .search-box { min-width: 220px; }
#productSort, #pickerSort { min-width: 116px; width: 116px; padding: 10px 6px; font-size: 13px; }
.picker-toolbar #bomPickerMaterial, .picker-toolbar #bomPickerType, .picker-toolbar #iePickType, .picker-toolbar #iePickSort, .picker-toolbar #iePickCategory { min-width: 116px; max-width: 150px; padding: 10px 6px; font-size: 13px; }
#page-products #categoryFilter { max-width: 150px; }
#page-products #bomTypeFilter { max-width: 120px; }
.table-panel { overflow: hidden; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 13px 16px;
  background: #fafbfc; border-bottom: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--text-sub); white-space: nowrap;
}
.data-table td { padding: 13px 16px; border-bottom: 1px solid #f3f4f6; font-size: 13px; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafcfc; }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.cell-name { font-weight: 600; color: #111827; }
.cell-sub { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.price { font-variant-numeric: tabular-nums; font-weight: 600; }
.price-cost { color: var(--text-sub); }
.price-sale { color: var(--primary); }
.row-actions { display: flex; gap: 6px; justify-content: center; }
.icon-btn {
  padding: 5px 10px; border: 1px solid var(--border); background: #fff;
  border-radius: 6px; font-size: 12px; color: var(--text-sub);
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.icon-btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.empty-state { text-align: center; padding: 70px 20px; color: var(--text-light); }
.empty-icon { font-size: 52px; color: #d1d5db; margin-bottom: 14px; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-sub); margin-bottom: 8px; }
.empty-desc { font-size: 13px; margin-bottom: 20px; }

/* ============ 设置页 ============ */
/* 系统设置：所有版块单列从上到下；公司信息四项排一行 */
.settings-layout { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
#settingsForm { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#settingsForm .full { grid-column: 1 / -1; }
@media (max-width: 1200px) { #settingsForm { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { #settingsForm { grid-template-columns: 1fr; } }
.form-field textarea { resize: vertical; }
.save-tip { color: var(--green); font-size: 13px; margin-left: 12px; align-self: center; }
.tips-body { display: flex; flex-direction: column; gap: 14px; }
.tip-item {
  font-size: 13px; color: var(--text-sub); line-height: 1.7;
  padding-left: 14px; border-left: 3px solid var(--primary-light);
}
.tip-item b { color: var(--primary-dark); }

/* ============ 弹窗 ============ */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-dialog {
  background: #fff; border-radius: 14px; width: 560px; max-width: 100%;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 60px rgba(0,0,0,0.2);
}
.modal-dialog.wide { width: 760px; }
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 26px; color: var(--text-light); line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}
.import-help { font-size: 13px; color: var(--text-sub); margin-bottom: 14px; line-height: 1.7; }
.import-help code { background: #f3f4f6; padding: 3px 8px; border-radius: 4px; color: var(--primary-dark); font-size: 12px; }
#importText, #qeRemark { width: 100%; padding: 12px; border: 1px solid #d1d5db; border-radius: 8px; resize: vertical; }
.import-preview { margin-top: 14px; font-size: 12px; }

/* ============ 报价编辑器 ============ */
.quote-editor { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: flex; flex-direction: column; }
.qe-topbar {
  min-height: 64px; flex-shrink: 0; background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 10px 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.btn-back { background: none; border: none; color: var(--text-sub); font-size: 14px; padding: 8px 0; white-space: nowrap; }
.btn-back:hover { color: var(--primary); }
.qe-title { display: flex; align-items: center; gap: 12px; flex: 1 1 240px; min-width: 0; }
.qe-title > span { font-weight: 700; font-size: 16px; white-space: nowrap; }
.qe-no-input {
  border: 1px solid #d1d5db; border-radius: 6px;
  padding: 7px 11px; width: 180px; max-width: 100%; font-weight: 600; color: var(--primary-dark);
}
.qe-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.qe-body { flex: 1; overflow-y: auto; padding: 24px; display: block; }
.qe-main { min-width: 0; max-width: 100%; }
.qe-add-actions { display: flex; gap: 8px; }
.qe-add-actions .select-control { min-width: 200px; padding: 8px 10px; }
.quote-items-table input, .quote-items-table select {
  width: 100%; padding: 7px 8px; border: 1px solid #e5e7eb; border-radius: 6px; background: #fff;
}
.quote-items-table input:focus { border-color: var(--primary); }
.quote-items-table td { padding: 5px 8px; vertical-align: middle; }
/* 图片列：上下无内边距，图片充满行高；表头与数据均居中 */
.quote-items-table th.cell-img, .quote-items-table td.cell-img { text-align: center; padding-left: 4px; padding-right: 4px; }
.quote-items-table td.cell-img { padding-top: 0; padding-bottom: 0; }
/* 材质列：上下无内边距，材质框最小100px撑满行高，与图片列齐平 */
.quote-items-table td.cell-mat { padding-top: 0; padding-bottom: 0; }
.quote-items-table td.cell-mat .mat-cell { height: 100%; }
/* 材质工艺/技术说明：高度限制为 3 行文字（13px×1.6×3≈62px + padding/border≈74px），可滚动查看全文 */
.mat-cell {
  position: relative; width: 100%; min-width: 200px;
}
.mat-cell textarea {
  width: 100%; min-width: 200px; height: 74px; padding: 5px 7px; border: 1px solid #e5e7eb; border-radius: 6px;
  background: #fff; font-size: 13px; line-height: 1.6; resize: none; overflow: auto;
  display: block; box-sizing: border-box;
}
.mat-cell textarea:focus { border-color: var(--primary); }
/* 报价明细缩略图：限制为 3 行文字高度的正方形，点击放大 */
.quote-items-table .item-thumb,
.quote-items-table .item-thumb-none {
  width: 64px; height: 64px;
}
.quote-items-table .item-thumb { cursor: zoom-in; transition: opacity .15s; }
.quote-items-table .item-thumb:hover { opacity: .82; }

/* 图片放大查看器（点击明细缩略图弹出） */
.img-viewer-mask {
  position: fixed; inset: 0; z-index: 9999; background: rgba(15,23,42,.78);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.img-viewer-mask[hidden] { display: none; }
.img-viewer-box {
  background: #fff; border-radius: 12px; max-width: min(92vw, 900px); max-height: 92vh;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.img-viewer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 18px; border-bottom: 1px solid var(--border); font-size: 15px; font-weight: 600;
}
.img-viewer-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-viewer-tools { display: flex; gap: 8px; flex: 0 0 auto; }
.img-viewer-body { padding: 18px; overflow: auto; text-align: center; background:#f8fafc; }
.img-viewer-body img { max-width: 100%; max-height: 68vh; object-fit: contain; border-radius: 6px; }
.img-viewer-close { border:none; background:#f1f5f9; border-radius:6px; padding:6px 12px; cursor:pointer; font-size:14px; }
.img-viewer-close:hover { background:#e2e8f0; }
/* 顶部：金额汇总——标题与7个字段强制排成一整行，不折行 */
.qe-summary-strip { display: flex; align-items: stretch; }
.qe-summary-strip .strip-head {
  flex: 0 0 auto; display: flex; align-items: center; white-space: nowrap;
  padding: 0 18px; font-size: 14px; font-weight: 700; color: #111827;
  border-right: 1px solid var(--border);
}
.summary-strip {
  flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: nowrap; align-items: center;
  gap: 6px 14px; padding: 12px 18px; overflow-x: auto;
}
.summary-strip .summary-cell {
  flex: 0 0 auto; display: flex; align-items: center; gap: 7px; white-space: nowrap;
}
.summary-strip .sc-label { font-size: 12px; color: var(--text-sub); }
.summary-strip .summary-cell b { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--text); }
.summary-strip .summary-cell b.discount-amt { font-size: 13px; color: #d97706; font-weight: 600; }
.summary-strip .summary-cell input {
  width: 72px; padding: 5px 7px; border: 1px solid #d1d5db; border-radius: 6px;
  font-size: 13px; text-align: right;
}
.summary-strip .sc-total {
  padding: 5px 10px; border: 1px solid var(--primary); border-radius: 8px; background: #f0f7f7;
}
.summary-strip .sc-total b { font-size: 18px; color: var(--primary); }
.summary-strip .sc-capital span { font-size: 13px; color: var(--text); }

/* 底部：备注与条款 / 出价参考 两栏 */
.qe-bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; margin-top: 22px; }
.qe-remark-panel textarea { width: 100%; min-height: 120px; }
.qe-tips-panel .tip-item { font-size: 12px; }
.item-amount { font-weight: 700; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.item-del { background: none; border: none; color: var(--text-light); font-size: 18px; padding: 2px 6px; }
.item-del:hover { color: var(--danger); }
.empty-inline { padding: 30px; text-align: center; color: var(--text-light); font-size: 13px; }
/* 操作按钮：底部单独一行横排 */
.qe-action-bar {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
  margin-top: 22px; padding: 18px 0 4px; border-top: 1px dashed #d1d5db;
}
.qe-action-bar .btn {
  flex: 0 1 auto; min-width: 172px; padding: 11px 16px; font-size: 13px; white-space: nowrap;
}
.qe-action-note {
  text-align: center; font-size: 11px; color: var(--text-light);
  margin-top: 8px; line-height: 1.5;
}

/* ============ 打印区 ============ */
.print-area { display: none; }
@media print {
  body * { visibility: hidden; }
  #printArea, #printArea * { visibility: visible; }
  #printArea { display: block !important; position: absolute; left: 0; top: 0; width: 100%; padding: 20px; }
  @page { size: A4; margin: 15mm; }
}
.quote-print { font-family: "Microsoft YaHei", sans-serif; color: #111; }
.qp-header { border-bottom: 3px solid #0d8a8a; padding-bottom: 14px; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: flex-end; }
.qp-company { font-size: 22px; font-weight: 700; color: #0d8a8a; }
.qp-company-sub { font-size: 11px; color: #666; margin-top: 4px; }
.qp-title { font-size: 26px; font-weight: 700; letter-spacing: 4px; }
.qp-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 30px; margin-bottom: 16px; font-size: 13px; }
.qp-meta div { border-bottom: 1px dotted #ccc; padding: 5px 0; }
.qp-meta b { color: #555; font-weight: 600; }
.qp-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 14px; }
.qp-table th { background: #0d8a8a; color: #fff; padding: 9px 8px; text-align: left; }
.qp-table td { border: 1px solid #ddd; padding: 8px; }
.qp-totals { margin-left: auto; width: 320px; font-size: 13px; }
.qp-totals div { display: flex; justify-content: space-between; padding: 5px 0; }
.qp-totals .grand { font-size: 18px; font-weight: 700; color: #0d8a8a; border-top: 2px solid #0d8a8a; margin-top: 6px; padding-top: 10px; }
.qp-terms { margin-top: 24px; font-size: 11px; color: #555; line-height: 1.8; border-top: 1px solid #ddd; padding-top: 12px; }
.qp-sign { margin-top: 30px; display: flex; justify-content: space-between; font-size: 13px; }

/* ============ Toast ============ */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: #1f2937; color: #fff; padding: 12px 24px;
  border-radius: 8px; font-size: 14px; z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--green); }

/* ============ 产品卡片 / 选择器 ============ */
.view-toggle { display: flex; border: 1px solid #d1d5db; border-radius: 8px; overflow: hidden; }
.view-btn { background: #fff; border: none; padding: 9px 13px; font-size: 15px; color: var(--text-sub); }
.view-btn.active { background: var(--primary); color: #fff; }
.product-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.product-card {
  background: #fff; border-radius: 11px; overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--border);
  transition: transform .15s, box-shadow .15s;
  display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.product-card-img {
  width: 100%; height: 150px; object-fit: contain;
  background: #f8fafb; border-bottom: 1px solid var(--border);
}
.product-card-noimg {
  width: 100%; height: 150px; background: #f3f5f6;
  display: flex; align-items: center; justify-content: center;
  color: #cbd5e1; font-size: 40px; border-bottom: 1px solid var(--border);
}
.product-card-body { padding: 12px 13px; flex: 1; display: flex; flex-direction: column; }
.product-card-name { font-weight: 700; font-size: 14px; color: #111827; line-height: 1.35; }
.product-card-meta { font-size: 11px; color: var(--text-light); margin-top: 5px; }
.product-card-cat { margin-top: 7px; }
.product-card-price { margin-top: auto; padding-top: 10px; display: flex; align-items: baseline; gap: 8px; }
.product-card-price .sale { font-size: 16px; font-weight: 700; color: var(--primary); }
.product-card-price .cost { font-size: 11px; color: var(--text-light); text-decoration: line-through; }
.product-card-actions { display: flex; gap: 6px; padding: 0 13px 12px; }
.product-card-actions .icon-btn { flex: 1; }

/* ============ 产品批量删除 ============ */
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-danger:disabled { background: #f3f4f6; color: #9ca3af; border-color: var(--border); cursor: not-allowed; }
.batch-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 16px; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow);
}
.batch-check-all { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.batch-bar input[type=checkbox], .prod-check { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
.batch-count { color: var(--primary); font-weight: 700; white-space: nowrap; }
.batch-muted { color: var(--text-light); font-size: 12px; }
.batch-actions { display: flex; gap: 8px; margin-left: auto; }
.batch-check-col { display: none; width: 38px; text-align: center; }

/* 产品库列表视图列宽：名称/分类/规格收窄，材质/参数加宽并自动换行 */
#productsTable .col-name { width: 115px; word-break: break-word; }
#productsTable .col-cat { width: 88px; }
#productsTable .col-model { width: 96px; word-break: break-word; }
#productsTable .col-material { width: 470px; }
#productsTable .col-material .mat-cell { max-width: 470px; color: #6b7280; white-space: normal; word-break: break-word; line-height: 1.7; }

/* 产品库列表内联编辑：名称/规格单行输入，材质多行限制为缩略图同高(100px) */
#productsTable .inline-edit {
  width: 100%; box-sizing: border-box; border: 1px solid transparent; border-radius: 5px;
  background: transparent; color: var(--text); font-size: 13px; line-height: 1.6;
  padding: 3px 5px; margin: -1px 0; transition: border-color .12s, background .12s;
}
#productsTable .inline-edit:hover { border-color: #d1d5db; background: #fff; }
#productsTable .inline-edit:focus { border-color: var(--primary); background: #fff; outline: none; box-shadow: 0 0 0 2px rgba(13,138,138,.12); }
#productsTable .edit-name { font-weight: 600; min-width: 105px; }
#productsTable .edit-model { color: #374151; }
#productsTable .edit-material {
  display: block; height: 100px; min-height: 100px; max-height: 100px;
  overflow-y: auto; resize: none; color: #6b7280; white-space: pre-wrap; word-break: break-word;
}
#productsTable .edit-material::-webkit-scrollbar { width: 6px; }
#productsTable .edit-material::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
/* 保存按钮：有待保存修改时高亮提示 */
.btn-save { background: #fff8e6; color: #b45309; border: 1px solid #fcd34d; }
.btn-save:hover { background: #fef3c7; border-color: #f59e0b; }
.btn-save.has-changes { background: #f59e0b; color: #fff; border-color: #d97706; box-shadow: 0 0 0 3px rgba(245,158,11,.18); }
.btn-save.has-changes:hover { background: #d97706; }
.batch-on .batch-check-col { display: table-cell; }
.prod-check-wrap { display: none; position: absolute; top: 8px; left: 8px; z-index: 2; background: rgba(255,255,255,.94); border-radius: 5px; padding: 3px; line-height: 0; }
.batch-on .prod-check-wrap { display: flex; }
.product-card.batch-mode { position: relative; cursor: pointer; }
.product-card.batch-mode .product-card-actions { display: none; }
.product-card.batch-mode.selected { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(13,138,138,.22); }

.picker-dialog { width: 1120px; max-width: 96vw; }
/* 明细行编辑弹窗 */
.item-edit-dialog { width: 900px; max-width: 96vw; }
#itemEditModal .modal-body { max-height: 72vh; overflow: auto; }
.ie-top { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.ie-img-box {
  width: 120px; height: 120px; flex: 0 0 120px; border: 1px dashed #b9c0c9; border-radius: 8px;
  background: #fafbfc; display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: 13px; cursor: pointer; overflow: hidden; text-align: center;
}
.ie-img-box img { width: 100%; height: 100%; object-fit: contain; }
.ie-img-box:hover { border-color: var(--primary); }
.ie-top-fields { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.ie-top-fields .ie-full, .ie-grid { grid-column: 1 / -1; }
.ie-grid { grid-template-columns: repeat(4, 1fr); gap: 10px 14px; margin-bottom: 12px; }
.ie-tools { display: flex; align-items: center; gap: 12px; margin: 6px 0 12px; }
.ie-hint { font-size: 12px; color: var(--text-light); }
.ie-bom-panel { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 6px; }
.ie-bom-panel .data-table td { padding: 6px 8px; }
/* 替换单品/选配件弹窗网格（iePickModal 复用 picker-item 卡片样式） */
.picker-grid {
  padding: 16px 20px; min-height: 200px; max-height: 55vh; overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; background: #fafbfc;
}
/* 替换/选配件弹窗列表视图：复用 picker-table 样式 */
.picker-grid.picker-list { display: block; padding: 0; }
.item-edit-btn {
  background: none; border: 1px solid var(--border); color: var(--primary);
  font-size: 12px; padding: 4px 8px; border-radius: 5px; cursor: pointer; white-space: nowrap;
}
.item-edit-btn:hover { background: var(--primary-light); border-color: var(--primary); }
/* BOM 参数录入弹窗：固定宽度，完整展示 4 列参数框 */
.bom-param-dialog { width: 1120px; max-width: 96vw; }
.picker-hint { font-size: 12px; font-weight: 400; color: var(--text-light); margin-left: 8px; }
.picker-toolbar { padding: 14px 20px; display: flex; gap: 12px; border-bottom: 1px solid var(--border); }
.picker-toolbar .search-box { flex: 1; }
.picker-body {
  padding: 16px 20px; min-height: 260px; max-height: 55vh; overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px;
  background: #fafbfc;
}
.picker-item {
  background: #fff; border: 2px solid transparent; border-radius: 9px;
  cursor: pointer; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: all .12s; text-align: center;
}
.picker-item:hover { border-color: var(--primary); transform: translateY(-2px); }
.picker-item.added { border-color: var(--green); }
.picker-item.added::after {
  content: '✓ 已加入'; display: block; background: var(--green); color: #fff;
  font-size: 11px; padding: 3px; font-weight: 600;
}
.picker-item-img { width: 100%; height: 100px; object-fit: contain; background: #f8fafb; display: block; }
.picker-item-noimg { width: 100%; height: 100px; background: #f3f5f6; display: flex; align-items: center; justify-content: center; color: #cbd5e1; font-size: 30px; }
.picker-item-name { font-size: 12px; font-weight: 600; padding: 7px 6px 2px; line-height: 1.3; }
.picker-item-price { font-size: 12px; color: var(--primary); font-weight: 700; padding: 0 6px 8px; }
.picker-count { margin-right: auto; color: var(--text-sub); font-size: 13px; align-self: center; }
/* 选择产品：视图切换 */
.picker-view-toggle .view-btn { padding: 7px 12px; }
/* 选择产品：列表视图 */
.picker-body.picker-list { display: block; padding: 0; }
.picker-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13px; }
.picker-table thead th {
  position: sticky; top: 0; z-index: 1; background: #f3f6f7; color: var(--text-sub);
  font-weight: 600; text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border);
  white-space: nowrap; font-size: 12px;
}
.picker-table tbody td { padding: 8px; border-bottom: 1px solid #eef1f2; vertical-align: middle; height: 120px; }
.picker-table tbody tr { cursor: pointer; transition: background .12s; }
.picker-table tbody tr:hover { background: #e8f7f6; }
.picker-table tbody tr.added { background: #f0faf5; }
.picker-table tbody tr.added .pl-name::after {
  content: '✓ 已加入'; display: block; width: fit-content; margin-top: 4px; background: var(--green); color: #fff;
  font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 600;
}
.picker-table .pl-img { width: 104px; height: 104px; object-fit: contain; background: #f8fafb; border-radius: 6px; display: block; }
.picker-table .pl-noimg { width: 104px; height: 104px; background: #f3f5f6; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #cbd5e1; font-size: 30px; }
.picker-table .pl-name { font-weight: 600; color: var(--text); word-break: break-word; line-height: 1.4; }
.picker-table .pl-model, .picker-table .pl-unit, .picker-table .pl-cat { color: var(--text-sub); word-break: break-word; line-height: 1.4; }
/* 材质/参数：固定高度=图片高度(104px)，超出隐藏，全文通过 td 的 title 悬停查看 */
.picker-table .pl-material {
  color: var(--text-sub); background: #fff; border: 1px solid #e2e8f0; border-radius: 6px;
  padding: 6px 8px; height: 104px; overflow: hidden; box-sizing: border-box;
  white-space: normal; word-break: break-word; line-height: 1.5; font-size: 12px;
}
.picker-table .pl-price { color: var(--primary); font-weight: 700; white-space: nowrap; text-align: right; }
/* 选择产品列表列宽（合计 740px，留余量避免横向滑条） */
.picker-table .col-img { width: 116px; }
.picker-table .col-name { width: 96px; }
.picker-table .col-model { width: 66px; }
.picker-table .col-unit { width: 42px; }
.picker-table .col-material { width: 290px; }
.picker-table .col-cat { width: 60px; }
.picker-table .col-price { width: 70px; text-align: right; }

/* 图片上传控件 */
.img-upload-row { display: flex; gap: 14px; align-items: center; }
.img-preview-box {
  width: 90px; height: 90px; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 8px; background: #f8fafb;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; color: var(--text-light); font-size: 12px;
}
.img-preview-box img { width: 100%; height: 100%; object-fit: contain; }
.img-preview-box.img-preview-sm { width: 72px; height: 72px; }
.img-upload-actions { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.upload-label { cursor: pointer; }

/* 明细行缩略图：充满行高 */
.item-thumb { display:block; width: 100px; height: 100px; object-fit: cover; border-radius: 6px; background: #fff; border: 1px solid var(--border); }
.item-thumb-none { display:block; width: 100px; height: 100px; display:flex; align-items:center; justify-content:center; font-size: 30px; color: #c9ced6; border-radius: 6px; background: #fafbfc; border: 1px dashed #d1d5db; cursor: pointer; }
.item-thumb-none:hover { border-color: var(--primary); color: var(--primary); }
.export-note { font-size: 11px; color: var(--text-light); text-align: center; margin-top: 4px; line-height: 1.4; }

/* 楼层与科室配置 */
.head-hint { font-size:11px; font-weight:400; color:#9aa3b2; margin-left:8px; }
.floor-tabs { display:flex; flex-wrap:wrap; gap:8px; padding:2px 0 12px; border-bottom:1px solid #eef0f3; }
.floor-tab { display:inline-flex; align-items:center; gap:6px; padding:8px 12px; border:1px solid #d8e3e3; border-radius:8px; background:#f7faf9; color:#475569; font-size:13px; cursor:pointer; transition:.15s; }
.floor-tab:hover { border-color:#0d8a8a; }
.floor-tab.active { background:#0d8a8a; border-color:#0d8a8a; color:#fff; font-weight:600; }
.floor-tab .ft-name { max-width:150px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.floor-tab .ft-copy, .dep-chip .dc-copy { font-size:11px; line-height:1; padding:2px 5px; border:1px solid currentColor; border-radius:4px; opacity:.75; cursor:pointer; white-space:nowrap; }
.floor-tab .ft-copy:hover { opacity:1; background:rgba(255,255,255,.22); }
.dep-chip .dc-copy:hover { opacity:1; background:#cbeaea; }
.floor-tab .ft-edit { font-size:13px; line-height:1; opacity:.55; padding:0 2px; }
.floor-tab .ft-edit:hover { opacity:1; color:#bff3f3; }
.floor-tab .ft-del { font-size:15px; line-height:1; opacity:.6; padding:0 2px; }
.floor-tab .ft-del:hover { opacity:1; color:#ffd5d5; }
.floor-empty { color:#9aa3b2; font-size:13px; padding:6px 0; }
.dep-bar { display:flex; align-items:flex-start; gap:10px; padding-top:12px; }
.dep-bar-label { font-size:13px; color:#6b7280; padding-top:6px; white-space:nowrap; }
.dep-chips { display:flex; flex-wrap:wrap; gap:7px; flex:1; }
.dep-chip { display:inline-flex; align-items:center; gap:6px; padding:5px 10px; border:1px solid #d8e3e3; border-radius:20px; background:#fff; color:#475569; font-size:12px; cursor:pointer; transition:.15s; }
.dep-chip:hover { border-color:#0d8a8a; }
.dep-chip.active { background:#e6f4f4; border-color:#0d8a8a; color:#0d6f6f; font-weight:600; }
.dep-chip .dc-edit { font-size:12px; line-height:1; opacity:.55; }
.dep-chip .dc-edit:hover { opacity:1; color:#0d6f6f; }
.dep-chip .dc-del { font-size:14px; line-height:1; opacity:.5; }
.dep-chip .dc-del:hover { opacity:1; color:#dc2626; }
.dep-empty { color:#b0b8c4; font-size:12px; padding-top:6px; }
.target-hint { margin-top:12px; padding:8px 12px; border-radius:6px; background:#f0f9f8; color:#0d6f6f; font-size:12px; }
.target-hint.warn { background:#fff8ec; color:#b7791f; }
.btn-xs { padding:4px 9px; font-size:12px; }
.btn-ghost { background:transparent; border:1px dashed #b6d8d8; color:#0d8a8a; }
.btn-ghost:hover { background:#e8f7f6; border-style:solid; }
/* 明细归属标签 */
.item-loc { font-size:11px; color:#0d8a8a; }
.item-loc.none { color:#c0392b; }
.loc-select { width:100%; font-size:11px; padding:4px 2px; border:1px solid #dfe3e8; border-radius:4px; background:#f7faf9; color:#0d6f6f; }

/* 明细归属标题栏 */
.items-scope-bar{display:flex;align-items:center;gap:12px;padding:10px 16px;background:linear-gradient(90deg,#eef9f9,#f7fbfb);border-bottom:1px solid #d5ecec;flex-wrap:wrap}
.items-scope-bar .isb-label{font-size:12px;color:#0d8a8a;font-weight:600;letter-spacing:.3px}
.items-scope-bar .isb-scope{font-size:14px;color:#114b6e;font-weight:700}
.items-scope-bar .isb-scope.none{color:#c0392b}
.items-scope-bar .isb-stat{margin-left:auto;font-size:12px;color:#5b7280;background:#fff;border:1px solid #d5ecec;border-radius:20px;padding:3px 12px}
.isb-audit{margin-left:4px;border:1px solid #f5c26b;background:#fffbeb;color:#a35b00;border-radius:20px;padding:3px 12px;font-size:12px;cursor:pointer}
.isb-audit:hover{background:#fff2d6}
.audit-dialog{width:860px;max-width:96vw}
#auditModal .modal-body{max-height:72vh;overflow:auto}
.audit-summary{background:#eef9f9;border:1px solid #d5ecec;border-radius:8px;padding:10px 14px;font-size:13px;color:#114b6e;margin-bottom:14px}
.audit-sec-title{font-size:14px;margin:0 0 6px;color:#114b6e}
.audit-tip{font-size:12px;color:#7b8794;margin:0 0 8px}
#qeAuditBadge{display:inline-block;min-width:16px;padding:0 4px;margin-left:5px;border-radius:9px;background:#e0533d;color:#fff;font-size:11px;line-height:16px;text-align:center}

/* 批量导入：标签页与上传区 */
.import-tabs { display:flex; gap:6px; border-bottom:2px solid #e5e7eb; margin-bottom:16px; }
.import-tab { background:none; border:none; padding:10px 16px; font-size:13px; font-weight:600; color:#6b7280; cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-2px; }
.import-tab.active { color:#0d8a8a; border-bottom-color:#0d8a8a; }
.upload-drop { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; min-height:130px; border:2px dashed #b6d8d8; border-radius:10px; background:#f4fbfa; cursor:pointer; transition:.2s; text-align:center; padding:18px; }
.upload-drop:hover, .upload-drop.dragover { border-color:#0d8a8a; background:#e8f7f6; }
.upload-icon { font-size:34px; }
.upload-text { font-size:14px; font-weight:600; color:#334155; }
.upload-sub { font-size:12px; color:#8a94a6; }
.import-preview { margin-top:14px; }

/* 响应式 */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-layout { grid-template-columns: 1fr; }
  .qe-bottom-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  /* 客户信息等表单：两列塌成一列 */
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .qe-body { padding: 14px; }
  .qe-topbar { padding: 10px 14px; gap: 10px; }
  .qe-title { flex: 1 1 100%; order: 3; }
  .qe-actions { flex: 1 1 auto; }
  .qe-actions .btn { padding: 8px 10px; font-size: 12px; }
  .qe-no-input { width: 140px; }
  .panel-body { padding: 16px 14px; }
  .panel-head { padding: 14px 16px; }
  .qe-summary-strip .strip-head { padding: 0 12px; }
  .summary-strip { padding: 10px 12px; }
  .qe-action-bar .btn { flex: 1 1 calc(50% - 6px); min-width: 0; white-space: normal; }
  .qe-add-actions .select-control { min-width: 0; }
}

/* ============ BOM 融合模块 ============ */
.btn-bom {
  background: #f0fdfa; border-color: #14b8a6; color: #0f766e;
}
.btn-bom:hover { background: #ccfbf1; }
.bom-badge {
  display: inline-block; margin-right: 4px; padding: 1px 5px; border-radius: 4px;
  background: #0f766e; color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .3px;
}
.manual-badge {
  display: inline-block; margin-right: 4px; padding: 1px 5px; border-radius: 4px;
  background: #f59e0b; color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .3px;
}
.selfadd-badge {
  display: inline-block; margin-right: 4px; padding: 1px 5px; border-radius: 4px;
  background: #2563eb; color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .3px;
}
.bom-tpl-table td { vertical-align: top; }
.bom-tpl-desc { color: var(--text-light); font-size: 11px; margin-top: 2px; line-height: 1.35; }
.bom-tpl-items { display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-start; }
.bom-pill {
  display: inline-block; padding: 1px 6px; border-radius: 10px; font-size: 11px;
  background: var(--primary-light); color: var(--primary-dark); white-space: nowrap;
}
.btn-xs.danger { color: var(--danger); border-color: #fecaca; }
.bom-tpl-actions .btn { white-space: nowrap; margin: 0 4px 4px 0; }
/* BOM 模板选择：类型列固定 6 列均分，预留一列给后续新增类型 */
#bomPickerModal .modal-dialog { width: 1440px; max-width: 96vw; }
.bom-tpl-grid {
  padding: 18px 20px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px 16px;
  align-items: start;
}
.bom-group { margin-bottom: 0; min-width: 0; }
.bom-group-title {
  font-size: 12px; font-weight: 700; color: var(--primary-dark);
  padding: 4px 0 8px; border-bottom: 1px solid var(--border); margin-bottom: 10px;
}
.bom-group-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (max-width: 1200px) { .bom-tpl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .bom-tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bom-tpl-card {
  border: 1px solid var(--border); border-radius: 8px; padding: 12px;
  background: #fff; cursor: pointer; transition: all .15s;
}
.bom-tpl-card:hover { border-color: var(--primary); box-shadow: 0 3px 12px rgba(13,138,138,.14); transform: translateY(-1px); }
.bom-tpl-card-name { font-weight: 700; color: var(--text); margin-bottom: 5px; }
.bom-tpl-card-meta { font-size: 12px; color: var(--text-sub); }
.bom-tpl-card-count { font-size: 11px; color: var(--primary); margin-top: 7px; }
.bom-param-summary {
  background: var(--primary-light); color: var(--primary-dark); border-radius: 6px;
  padding: 9px 12px; font-size: 13px; margin-bottom: 14px;
}
/* BOM参数录入：8 个输入框按 4 列 × 2 行排布 */
.bom-param-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; }
.bom-param-fields .form-field label { white-space: nowrap; }
@media (max-width: 640px) { .bom-param-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bom-param-preview { margin-top: 16px; max-height: 380px; overflow: auto; border: 1px solid var(--border); border-radius: 6px; }
.bom-preview-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.bom-preview-table th, .bom-preview-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.bom-preview-table th { background: var(--primary-light); color: var(--primary-dark); position: sticky; top: 0; }
#bomTplModal .modal-body, #bomParamModal .modal-body { max-height: 70vh; overflow: auto; }
.bom-badge.bom-main { background: #0F766E; }

/* 产品库 BOM方式 列（列表快速修改） */
#productsTable .col-bomtype { width: 104px; }
#productsTable .bom-type-select {
  width: 96px; padding: 4px 5px; font-size: 12px; border-radius: 5px;
  border: 1px solid var(--border); background: #fff; color: var(--text); cursor: pointer;
}
#productsTable .bom-type-select:focus { border-color: var(--primary); outline: none; }

/* 配置模板编辑弹窗：加宽以完整显示预置部件表；明确产品库来源 */
.bom-tpl-edit-dialog { width: 1120px; max-width: 96vw; }
/* 编辑配置模板：模板名称/产品类型/型态/材质 排成一行四列 */
.bom-tpl-edit-dialog .modal-body > .form-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 12px 14px; }
/* 部件列固定缩短；计价规则/系数/固定值按内容加宽，完整显示；表格不溢出、无水平滚动条 */
.bom-tpl-edit-dialog .tpl-items-wrap { overflow-x: visible; }
.bom-tpl-edit-dialog .tpl-items-wrap .data-table { table-layout: fixed; width: 100%; }
.bom-tpl-edit-dialog .tpl-items-wrap td { padding: 10px 8px; }
.bom-tpl-edit-dialog .tpl-items-wrap th { padding: 10px 8px; }
.bom-tpl-edit-dialog .tpl-items-wrap select.select-control { min-width: 0; width: 100%; }
.bom-tpl-edit-dialog .tpl-items-wrap td:nth-child(2) select.select-control { min-width: 260px; }
.bom-tpl-edit-dialog .tpl-items-wrap input[type="number"] { width: 100%; min-width: 0; padding: 6px 4px; }
.bom-source-label { font-size: 12px; font-weight: 400; color: var(--primary); margin-left: 8px; }
.picker-source { font-size: 12px; color: var(--primary); margin-right: 10px; align-self: center; }

/* 批量导入增强：重复处理 + 结果反馈 */
.import-dup-bar { display:flex; align-items:center; gap:14px; flex-wrap:wrap; padding:10px 14px; margin:10px 0 0; background:#fff7ed; border:1px solid #fed7aa; border-radius:6px; font-size:13px; }
.import-dup-bar label { display:flex; align-items:center; gap:4px; cursor:pointer; color:#9a3412; }
.import-dup-hint { color:#c2410c; font-weight:600; }
.import-result { margin-top:12px; padding:14px; border-radius:6px; font-size:13px; line-height:1.7; }
.import-result.ok { background:#f0fdf4; border:1px solid #bbf7d0; color:#166534; }
.import-result.partial { background:#fffbeb; border:1px solid #fde68a; color:#92400e; }
.import-result.err { background:#fef2f2; border:1px solid #fecaca; color:#991b1b; }
.dup-flag { display:inline-block; padding:1px 5px; border-radius:4px; background:#fff7ed; color:#c2410c; font-size:11px; margin-left:4px; }

/* 客户信息：桌面端排成一行六列——客户名称/项目名称长框，联系人/联系电话中框，报价日期/有效期短框 */
.customer-info-grid {
  display: grid;
  grid-template-columns: 1.7fr 1.7fr 1.15fr 1.15fr 0.9fr 0.9fr;
  gap: 14px;
  align-items: end;
}
.customer-info-grid > .form-field { min-width: 0; }
.customer-info-grid input { width: 100%; min-width: 0; }
.customer-info-grid input[type="date"] { padding: 6px 6px; }
@media (max-width: 1100px) {
  .customer-info-grid { grid-template-columns: 1.6fr 1.6fr 1fr; }
}
@media (max-width: 700px) {
  .customer-info-grid { grid-template-columns: 1fr 1fr; }
}

/* 角色权限：报价员/访客看不到系统设置入口与管理员操作 */
body.role-quoter .admin-only, body.role-visitor .admin-only { display: none !important; }
body.role-visitor .guest-hide { display: none !important; }
.account-self-bar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:10px 12px; margin-bottom:10px; background:#f0fdfa; border:1px solid #99f6e4; border-radius:6px; font-size:13px; }
.account-self-bar b { color:#0d8a8a; font-family:Consolas,Monaco,monospace; user-select:all; }
.account-self-bar .self-hint { color:#64748b; }
#page-products .col-brand, #page-products .col-supplier { width: 96px; }
#page-products .col-brand input, #page-products .col-supplier input { max-width: 90px; }

/* 供应商库 */
.supplier-toolbar { flex-wrap: wrap; gap: 8px; }
#supplierSort { min-width: 116px; width: 116px; }
#page-suppliers .data-table td { vertical-align: middle; }
#page-suppliers .sp-address, #page-suppliers .sp-remark { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

