* { margin: 0; padding: 0; box-sizing: border-box; }

:root{
  --brand-gold:#C97A3C; --brand-gold-light:#E0A06A; --brand-gold-dark:#8B5A2B;
  --brand-gold-soft:#FBF0E2; --brand-brown:#3a2c1c; --brand-brown-mid:#5a4632;
  --bg-page:#FAF6EE; --bg-card:#ffffff; --bg-subtle:#F1E7D6; --bg-overlay:rgba(58,44,28,.55);
  --text-primary:#3a2c1c; --text-secondary:#6f5a44; --text-muted:#a07c54; --text-inverse:#fdfbf7;
  --border:#EBD9BF; --border-strong:#d8c4a3;
  --success:#1f9d6b; --warning:#d97706; --danger:#c0392b; --info:#2c6e9e;
  --font-brand:"Songti SC","STSong","SimSun",Georgia,serif;
  --font-ui:-apple-system,"PingFang SC","Microsoft YaHei",sans-serif;
  --fs-display:28px; --fs-h1:22px; --fs-h2:18px; --fs-h3:15px;
  --fs-body:14px; --fs-sm:13px; --fs-xs:12px;
  --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px; --sp-6:24px; --sp-8:32px; --sp-12:48px;
  --radius-sm:8px; --radius:12px; --radius-lg:16px; --radius-pill:999px;
  --shadow-sm:0 1px 3px rgba(44,30,15,.08);
  --shadow:0 4px 16px rgba(44,30,15,.10);
  --shadow-lg:0 12px 40px rgba(44,30,15,.18);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  background: var(--bg-page);
  min-height: 100vh;
}

/* ===== 顶部 Header ===== */
header {
  background: linear-gradient(135deg, #2c1e0f 0%, #3d2b0e 40%, #5a3e1b 100%);
  color: white;
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.stat-item {
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 10px 12px;
  border-radius: 10px;
  text-align: center;
  min-width: 0;
  /* 容器查询：让 .value 的 cqw 直接绑定本格子宽度。Safari 16.0+ 支持。 */
  container-type: inline-size;
}

.stat-item .value {
  display: block;
  /* 绝对兜底：12px 一定装得下"¥101,747.62"，任何浏览器都不会溢出。
     这是所有浏览器都能识别的纯 px 值，避免 cqw/vw 等单位在某些 Safari 解析失败。*/
  font-size: 12px;
  font-weight: 700;
  color: #f0c040;
  white-space: nowrap;
  line-height: 1.15;
  /* JS 缩放时用 transform，避免影响行高 */
  transform-origin: center center;
}

/* 现代浏览器（Chrome / Safari 16.4+ / Firefox 117+）：用 cqw 让字号跟随格子宽度自适应放大 */
@supports (container-type: inline-size) {
  .stat-item .value {
    font-size: clamp(10px, 8cqw, 15px);
  }
}

.stat-item .label {
  font-size: 11px;
  opacity: 0.8;
  margin-top: 2px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Tab 导航 ===== */
/* ===== Tab 导航 ===== */
.tabs-wrap {
  position: relative;
  background: white;
  border-bottom: 1px solid #e8e8e8;
}
/* 右侧渐隐提示（有更多 tab 可滚动）*/
.tabs-wrap::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 32px;
  background: linear-gradient(to right, transparent, white);
  pointer-events: none;
  z-index: 1;
}

.tabs {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 16px;
  gap: 0;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex-shrink: 0;
  padding: 14px 18px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab:hover { color: var(--brand-brown); }

.tab.active {
  color: var(--brand-brown);
  border-bottom-color: var(--brand-gold);
  font-weight: 600;
}

/* ===== 内容区 ===== */
.content { padding: 24px; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== 操作栏 ===== */
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.hint-text {
  font-size: 12px;
  color: #999;
}

/* ===== 进行中统计栏 ===== */
.dashboard-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.dash-stat {
  background: #f8f9fc;
  border: 1px solid #e5e7eb;
  padding: 14px 20px;
  border-radius: 12px;
  text-align: center;
  min-width: 130px;
  flex: 1;
}
.dash-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: #0f3460;
}
.dash-stat-label {
  font-size: 11px;
  color: #6b7280;
  margin-top: 4px;
}
.dash-stat-green .dash-stat-value { color: #059669; }
.dash-stat-orange .dash-stat-value { color: #d97706; }
/* 强制所有 viewport 下 dash-stat-value 都用 nowrap + JS 会二分查找合适字号 */
.dash-stat-value { white-space: nowrap; }

@media (max-width: 768px) {
  .dashboard-stats { gap: 6px; }
  .dash-stat { min-width: 0; padding: 8px 6px; }
  /* 基础字号压到 12px，JS 会再二分查找合适的（更大值如果装得下） */
  .dash-stat-value { font-size: 12px; }
  .dash-stat-label { font-size: 10px; }
}

@media (max-width: 480px) {
  .dashboard-stats { gap: 4px; }
  .dash-stat { padding: 6px 4px; border-radius: 8px; }
  .dash-stat-value { font-size: 11px; }
}

.btn-primary-action {
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: .18s;
}

.btn-primary-action:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary-action.sm { padding: 5px 10px; font-size: 12px; border-radius: var(--radius-sm); box-shadow: none; }

.actions select {
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  background: white;
}

/* ===== 订单卡片（大卡片视图）===== */
.orders-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.order-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 0;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.order-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

/* 卡片左侧图片区 */
.card-left {
  width: 160px;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  border-right: 1px solid var(--border);
  padding: 12px;
  gap: 8px;
}

.order-thumb {
  width: 130px;
  height: 130px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s;
}

.order-thumb:hover { transform: scale(1.03); }

.order-thumb-empty {
  width: 130px;
  height: 130px;
  background: #f5f5f5;
  border: 2px dashed #ddd;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  color: #bbb;
  font-size: 28px;
  transition: background 0.2s;
}

.order-thumb-empty small { font-size: 12px; }
.order-thumb-empty:hover { background: #eee; }

/* 卡片主体 */
.card-body {
  flex: 1;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.order-num {
  font-size: 13px;
  color: var(--brand-gold-dark);
  font-family: monospace;
  font-weight: 600;
}

.customer-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-brown);
}

.product-desc {
  font-size: 14px;
  color: var(--text-secondary);
}

.card-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ===== 进度条 ===== */
.progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-gold), #e08a2e);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ===== 步骤网格 ===== */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: 10px;
  border: 2px solid #f0f0f0;
  background: #fafafa;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 0;
}

.step-item:hover {
  border-color: #0f3460;
  background: #f0f4ff;
  transform: translateY(-2px);
}

.step-item.done {
  border-color: #52c41a;
  background: linear-gradient(135deg, #f6ffed, #d9f7be);
}

.step-icon {
  font-size: 18px;
  line-height: 1;
}

.step-item.done .step-icon {
  font-size: 16px;
  color: #52c41a;
  font-weight: 700;
}

.step-label {
  font-size: 11px;
  text-align: center;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.step-item.done .step-label {
  color: #389e0d;
  font-weight: 600;
}

.step-note {
  font-size: 10px;
  color: #999;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

/* ===== 卡片底部金额信息 ===== */
.card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid #f5f5f5;
}

.total-amount {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-gold-dark);
  min-width: 0;
  overflow-wrap: break-word;
  flex: 1 1 auto;
}

.money-tag {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.money-tag.paid {
  background: #f6ffed;
  color: #52c41a;
  border: 1px solid #b7eb8f;
}

.money-tag.unpaid {
  background: #fff7e6;
  color: #fa8c16;
  border: 1px solid #ffd591;
}

.create-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-icon { font-size: 60px; margin-bottom: 16px; }
.empty-text { font-size: 16px; }
.empty-hint { color: #bbb; padding: 20px; text-align: center; }

/* ===== 表格（全部订单）===== */
.table-container { overflow-x: auto; background: white; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

table { width: 100%; border-collapse: collapse; }

thead { background: #fafafa; }

th {
  padding: 14px 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  border-bottom: 2px solid #f0f0f0;
  white-space: nowrap;
}

td {
  padding: 12px;
  border-bottom: 1px solid #f5f5f5;
  font-size: 13px;
  vertical-align: middle;
}

tr:hover td { background: #f9f9f9; }

.table-thumb {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
}

.table-thumb-empty {
  width: 50px;
  height: 50px;
  background: #f5f5f5;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #bbb;
}

.mini-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 100px;
}

.mini-bar {
  flex: 1;
  height: 6px;
  background: #f0f0f0;
  border-radius: 3px;
  overflow: hidden;
}

.mini-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-gold), var(--brand-gold-dark));
  border-radius: 3px;
  transition: width 0.3s;
}

.mini-progress span { font-size: 12px; color: #888; }

/* ===== 按钮 ===== */
.btn-sm {
  padding: 5px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 12px;
  color: #555;
  transition: all 0.2s;
}

.btn-sm:hover { background: #f5f5f5; }

/* 小程序上架按钮：已上架=墨蓝实底，未上架=虚线描边 */
.btn-sm.btn-mp {
  border: 1px dashed #c7cbd1;
  color: #6b7280;
  background: #fff;
  white-space: nowrap;
}
.btn-sm.btn-mp:hover { background: #f3f4f6; border-color: #9ca3af; }
.btn-sm.btn-mp.on {
  background: #0f3460;
  border: 1px solid #0f3460;
  color: #fff;
}
.btn-sm.btn-mp.on:hover { background: #16437a; }

/* ===== 工具栏中性按钮（去彩虹，hover 金棕）===== */
.toolbar-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font: 600 14px/1 var(--font-ui);
  cursor: pointer;
  transition: .18s;
}
.toolbar-btn:hover {
  border-color: var(--brand-gold);
  color: var(--brand-brown);
  background: var(--brand-gold-soft);
  transform: translateY(-1px);
}
.toolbar-btn.sm { padding: 5px 10px; font-size: 12px; border-radius: var(--radius-sm); }

/* ===== 寄售收货批量操作栏 ===== */
.receive-bulk-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 12px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 10;
}
.receive-bulk-check {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 14px/1 var(--font-ui); color: var(--text-primary); cursor: pointer; user-select: none;
}
.receive-bulk-check input { width: 18px; height: 18px; accent-color: var(--brand-gold-dark); cursor: pointer; }
.receive-bulk-count {
  flex: 1; min-width: 140px;
  font-size: 13px; color: var(--text-secondary);
}
.receive-batch-list { display: flex; flex-direction: column; gap: 10px; }
.receive-batch-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px;
  background: var(--bg-card); transition: .15s;
}
.receive-batch-card.selected { border-color: var(--brand-gold); background: var(--brand-gold-soft); box-shadow: 0 0 0 2px var(--brand-gold-soft); }
.receive-batch-row { display: flex; align-items: flex-start; gap: 12px; }
.receive-batch-checkbox {
  width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0;
  accent-color: var(--brand-gold-dark); cursor: pointer;
}
.receive-batch-card .sup-card-top { flex: 1; }
.receive-batch-card .sup-card-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .receive-bulk-bar { gap: 8px; padding: 10px; }
  .receive-bulk-count { width: 100%; order: 3; margin-top: 4px; }
  .receive-batch-card { padding: 12px; }
  .receive-batch-card .sup-card-actions { gap: 6px; }
}

/* ===== 寄售收货：跨批次明细大表 ===== */
.receive-filter-select {
  padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg-card); color: var(--text-primary); font-size: 13px; min-width: 120px;
}
.receive-items-table-wrap {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow-x: auto; box-shadow: var(--shadow-sm);
}
.receive-items-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.receive-items-table thead {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg-subtle);
}
.receive-items-table th {
  padding: 10px 8px; text-align: left; font-weight: 600;
  color: var(--text-secondary); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.receive-items-table td {
  padding: 10px 8px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle;
  color: var(--text-primary);
}
.receive-items-table tbody tr:hover { background: var(--bg-subtle); }
.receive-items-table tbody tr.selected { background: var(--brand-gold-soft); }
.receive-items-table tbody tr.selected:hover { background: #f5e6d3; }
.receive-item-thumb {
  width: 48px; height: 48px; border-radius: 6px; object-fit: cover;
  border: 1px solid var(--border); cursor: pointer;
}
.receive-item-checkbox, #receiveItemSelectAllHead {
  width: 18px; height: 18px; accent-color: var(--brand-gold-dark); cursor: pointer;
}

@media (max-width: 768px) {
  .receive-items-table { font-size: 12px; }
  .receive-items-table th, .receive-items-table td { padding: 8px 6px; }
  .receive-item-thumb { width: 40px; height: 40px; }
}

/* 危险操作（删除）：红色语义 */
.btn-danger {
  background: var(--danger); color: #fff; border: none;
  border-radius: var(--radius); padding: 9px 16px;
  font: 600 14px/1 var(--font-ui); cursor: pointer; transition: .18s;
}
.btn-danger:hover { filter: brightness(.94); }
.btn-danger.sm { padding: 4px 8px; font-size: 11px; border-radius: 6px; }

.btn-action {
  padding: 5px 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  margin-right: 4px;
  transition: opacity 0.2s;
}

.btn-action:hover { opacity: 0.8; }
.btn-edit { background: #f3f4f6; color: #374151; }
.btn-delete { background: #fff0f0; color: #e74c3c; }

/* ===== 弹窗 ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.show { display: flex; }

/* ===== 统一自建弹窗遮罩 (.native-modal) =====
   作为所有 JS 动态生成弹窗遮罩的「单一真相」，与 .modal 同处 z-index:1000 层，
   消除此前 z-index:10000/20000/9999 与标准 .modal 的层级冲突。
   原 6 处重复的内联遮罩样式（position:fixed; background:rgba(...); ...）统一收口到此。 */
.native-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  box-sizing: border-box;
}
/* 顶部对齐：用于较高的导入类弹窗（如 PDF 导入），避免内容被垂直居中截断 */
.native-modal.top { align-items: flex-start; }
/* 内容超高时整层滚动 */
.native-modal.scroll { overflow: auto; }

/* 统一关闭按钮：.modal-close 此前无样式，此处与 .close-modal 复用同一外观 */
.modal-close {
  background: #f5f5f5;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.modal-close:hover { background: #e8e8e8; }


.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  z-index: 1;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #f0f0f0;
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
}

.modal-header h2 { font-size: 18px; color: #1a1a2e; }

.close-modal {
  background: #f5f5f5;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.close-modal:hover { background: #e8e8e8; }

.modal-body { padding: 20px 24px; }
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid #f5f5f5;
  margin-top: 8px;
}

/* ===== 独立 overlay 浮层（不替换 .modal 上下文） =====
   用于「从裸石选择」等需要在父 modal 之上叠加的子弹窗，
   避免 showModal 替换父 modal 导致 invCostBody 等关键节点丢失。 */
.gem-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100; /* 高于 .modal 的 1000 */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  box-sizing: border-box;
}
.gem-picker-card {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.gem-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 2;
}
.gem-picker-header h3 {
  margin: 0;
  font-size: 17px;
  color: #1a1a2e;
  font-weight: 600;
}
.gem-picker-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

/* ===== 表单 ===== */
.form-group {
  margin-bottom: 14px;
  flex: 1;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #444;
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
  background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #0f3460;
}

.form-group textarea { resize: vertical; min-height: 70px; }

.form-row {
  display: flex;
  gap: 12px;
}

/* 上传区域 */
.upload-area {
  border: 2px dashed #ddd;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  color: #999;
  transition: all 0.2s;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-area:hover { border-color: #0f3460; color: #0f3460; background: #f8f9ff; }

/* ===== 步骤编辑 ===== */
.steps-edit-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.step-edit-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  background: #fafafa;
}

.step-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  min-width: 130px;
  white-space: nowrap;
}

.step-checkbox { width: 16px; height: 16px; cursor: pointer; }

.step-note-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 13px;
}

/* 按钮 */
.btn-primary {
  padding: 11px 24px;
  background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: .18s;
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary:active { transform: translateY(0); filter: brightness(.96); }

.btn-secondary {
  padding: 11px 20px;
  background: #f5f5f5;
  color: #555;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.btn-secondary:hover { background: #e8e8e8; }

.btn-mini {
  font-size: 12px;
  padding: 3px 9px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-mini:hover { background: #f1f5f9; border-color: #cbd5e1; }
.btn-mini.danger { color: #dc2626; border-color: #fecaca; }
.btn-mini.danger:hover { background: #fef2f2; }

/* ===== 图片大图预览 ===== */
.image-viewer {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.image-viewer.show { display: flex; }

.image-viewer img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}

.image-viewer-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== 统计图表 ===== */
.stats-section {
  background: white;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.stats-section h2 { font-size: 16px; margin-bottom: 16px; color: #1a1a2e; }

.chart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f5;
}

.chart-item:last-child { border-bottom: none; }

.chart-rank { font-size: 18px; min-width: 30px; }
.chart-label { min-width: 80px; font-size: 14px; color: #444; }

.chart-bar-wrap {
  flex: 1;
  height: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
}

.chart-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-gold), var(--brand-gold-dark));
  border-radius: 4px;
}

.chart-value { font-size: 13px; color: #888; white-space: nowrap; min-width: 120px; text-align: right; }

/* ===== 响应式 ===== */

/* 桌面中窄屏（769–1280px）：统计卡改 2×2 + 缩字号，保证长金额一行完整显示不溢出 */
@media (max-width: 1280px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  header { padding: 16px; }
  .content { padding: 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat-item { padding: 8px 6px; }
  /* .value 字号由全局 clamp(10px, 1.5vw, 14px) 动态接管，不在此处覆盖 */
  .stat-item .label { font-size: 10px; }
  
  /* 订单卡片紧凑化 */
  .orders-cards { gap: 12px; }
  .order-card { border-radius: 12px; }
  .card-left { width: 78px; min-width: 78px; padding: 12px 6px; gap: 8px; }
  .order-thumb, .order-thumb-empty { width: 64px; height: 64px; }
  .card-body { padding: 14px 14px; gap: 11px; }
  .step-item { padding: 7px 4px; }
  .card-actions { flex-wrap: wrap; gap: 6px; }
  .progress-bar { height: 7px; }
  .money-tag { padding: 3px 9px; font-size: 11px; }
  .total-amount { font-size: 15px; }
  .card-footer { gap: 7px; padding-top: 9px; }
  .customer-name { font-size: 15px; }
  
  /* 全部订单表格紧凑化 */
  table { min-width: 540px; }
  th { padding: 10px 8px; font-size: 12px; }
  td { padding: 8px; font-size: 12px; }
  .table-thumb, .table-thumb-empty { width: 40px; height: 40px; }
  .btn-action, .toolbar-btn.sm { font-size: 11px; padding: 4px 7px; }
  .mini-progress { min-width: 80px; }
  
  .steps-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .step-icon { font-size: 14px; }
  .step-label { font-size: 10px; }
  
  .form-row { flex-direction: column; }
}

@media (max-width: 480px) {
  /* 顶部统计卡：2×2 布局 + 更小 padding；.value 字号由全局 clamp 动态接管 */
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .stat-item { padding: 6px 4px; border-radius: 8px; }
  .stat-item .label { font-size: 9px; }

  /* ===== 订单卡片紧凑化 v2 ===== */
  .order-card { flex-direction: row; align-items: stretch; }

  /* 左侧：54px 缩略图（换图按钮已移除，通过编辑弹窗换图） */
  .card-left {
    width: 56px; min-width: 56px;
    flex-direction: column; align-items: center; justify-content: flex-start;
    padding: 8px 4px; gap: 0;
    border-right: 1px solid #f0f0f0;
  }
  .order-thumb, .order-thumb-empty { width: 50px; height: 50px; }
  .order-thumb-empty { font-size: 18px; gap: 2px; }
  .order-thumb-empty small { font-size: 9px; }

  /* 主体紧凑 */
  .card-body { padding: 9px 10px; gap: 7px; }

  /* ★ 8 个步骤改单行（最大头浪费点） */
  .steps-grid { grid-template-columns: repeat(8, 1fr); gap: 3px; }
  .step-item { padding: 5px 2px; border-width: 1px; gap: 2px; border-radius: 8px; }
  .step-icon { font-size: 13px; }
  .step-label { font-size: 9px; line-height: 1.1; }
  .step-note { font-size: 8px; }

  /* 标题行 */
  .card-header { flex-wrap: wrap; gap: 4px; align-items: baseline; }
  .card-title { gap: 4px; }
  .order-num { font-size: 11px; }
  .customer-name { font-size: 13px; }
  .product-desc { font-size: 11px; }

  /* 操作按钮：单行不换 + 极小字号 */
  .card-actions { flex-wrap: nowrap; gap: 4px; margin-left: auto; }
  .card-actions .btn-sm, .card-actions .toolbar-btn.sm {
    padding: 3px 6px; font-size: 10px; white-space: nowrap;
  }

  /* 进度条 / 文本 */
  .progress-bar { height: 5px; }
  .progress-bar-wrap { gap: 6px; }
  .progress-text { font-size: 10px; }

  /* 底部金额信息：总价独行 + 首付/尾款另起一行，避免溢出 */
  .card-footer { gap: 6px; padding-top: 6px; row-gap: 5px; }
  .total-amount { font-size: 14px; flex-basis: 100%; flex-grow: 0; }
  .money-tag { padding: 2px 7px; font-size: 10px; }
  .create-date { font-size: 10px; }

  /* 全部订单表格：进一步压紧 */
  table { min-width: 500px; }
  th { padding: 8px 6px; }
  td { padding: 7px 6px; }
  .btn-action, .toolbar-btn.sm { padding: 3px 6px; }
  .mini-progress { min-width: 70px; }

  /* 手机端 Tab：紧凑布局，图标+文字竖排 */
  .tabs { padding: 0 8px; gap: 0; }
  .tab {
    padding: 8px 12px;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 56px;
    line-height: 1.3;
  }
  /* 把 emoji 和文字拆分显示 */
  .tab .tab-icon { font-size: 18px; display: block; }
  .tab .tab-label { font-size: 11px; display: block; }
}

/* ===== Loading ===== */
.loading {
  text-align: center;
  padding: 40px;
  color: #bbb;
  font-size: 14px;
}

/* ===== 裁切弹窗 ===== */
.img-crop-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.img-crop-modal.show { display: flex; }

.img-crop-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
}

.img-crop-dialog {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 580px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 顶部标题栏 */
.img-crop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}

.img-crop-header h3 {
  font-size: 15px;
  color: #1a1a2e;
  font-weight: 600;
}

.img-crop-hint {
  font-size: 12px;
  color: #aaa;
}

/* 裁切画布区 —— 白色背景，给图片充足空间 */
.img-crop-canvas-wrap {
  background: #f8f8f8;
  height: 380px;
  position: relative;
  /* 不要 overflow:hidden，让 cropper.js 可以自由渲染 */
}

.img-crop-canvas-wrap img {
  display: block;
  /* Cropper.js 会接管这个元素，不需要固定尺寸 */
  max-width: 100%;
}

/* 覆盖 Cropper.js 默认样式，让裁切框和遮罩更清晰 */
.cropper-container {
  height: 380px !important;
}

/* 裁切遮罩改为半透明黑色（对比图片内容更清晰） */
.cropper-modal .cropper-modal-black {
  background-color: rgba(0, 0, 0, 0.55) !important;
  opacity: 1 !important;
}

/* 裁切框边线加粗，用品牌色 */
.cropper-modal .cropper-view-box {
  outline: 2.5px solid #0f3460 !important;
  outline-color: rgba(15, 52, 96, 0.9) !important;
}

/* 裁切框四角手柄放大，更好点击 */
.cropper-modal .cropper-point {
  width: 12px !important;
  height: 12px !important;
  background-color: #fff !important;
  border: 2px solid #0f3460 !important;
  border-radius: 50% !important;
  opacity: 1 !important;
}

/* 中心十字线 */
.cropper-modal .cropper-center {
  opacity: 0.8 !important;
}

/* 工具栏 */
.img-crop-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: #fafafa;
  border-top: 1px solid #f0f0f0;
  flex-wrap: wrap;
}

.crop-tool-btn {
  padding: 6px 12px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 7px;
  color: #444;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.crop-tool-btn:hover {
  background: #f0f4ff;
  border-color: #0f3460;
  color: #0f3460;
}

.crop-tool-btn:active { transform: scale(0.96); }

.ratio-btns {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.ratio-btn {
  padding: 5px 11px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  color: #666;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.ratio-btn:hover {
  border-color: var(--brand-gold-dark);
  color: var(--brand-gold-dark);
}

.ratio-btn.active {
  background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-dark));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

/* 底部按钮区 */
.img-crop-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  background: #fff;
  border-top: 1px solid #f0f0f0;
}

.cropper-footer .btn-secondary {
  background: #f5f5f5;
  color: #555;
}

.cropper-footer .btn-secondary:hover {
  background: #ebebeb;
}

/* ===================== 成本明细 & 报价 ===================== */

.cost-page {
  max-width: 960px;
}

.cost-order-selector {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  background: white;
  padding: 14px 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.cost-order-selector label {
  font-size: 14px;
  font-weight: 600;
  color: #444;
  white-space: nowrap;
}

.cost-order-selector select {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  background: white;
}

/* 成本汇总栏 */
.cost-summary-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #2c1e0f, #5a3e1b);
  color: white;
  padding: 14px 20px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.cost-total-label { font-size: 14px; opacity: 0.8; }

.cost-total-value {
  font-size: 22px;
  font-weight: 700;
  color: #f0c040;
  flex: 1;
}

.btn-add-cost {
  padding: 8px 16px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  color: white;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-add-cost:hover { background: rgba(255,255,255,0.25); }

/* 成本分类区块 */
.cost-sections { display: flex; flex-direction: column; gap: 12px; }

.cost-section {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  overflow: hidden;
}

.cost-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
}

.cost-cat-icon { font-size: 18px; }

.cost-cat-label {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a2e;
  flex: 1;
}

.cost-cat-total {
  font-size: 15px;
  font-weight: 700;
  color: #333;
}

.btn-add-cat-item {
  padding: 4px 12px;
  border: 1px solid currentColor;
  border-radius: 6px;
  background: white;
  font-size: 12px;
  cursor: pointer;
  transition: opacity 0.15s;
  margin-left: 8px;
}
.btn-add-cat-item:hover { opacity: 0.7; }

/* 成本条目列表 */
.cost-items-list { padding: 8px 12px; }

.cost-empty {
  text-align: center;
  color: #ccc;
  font-size: 13px;
  padding: 16px 0;
}

.cost-item-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 8px;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.15s;
}
.cost-item-card:last-child { border-bottom: none; }
.cost-item-card:hover { background: #f9f9f9; border-radius: 8px; }

.cost-item-img-wrap {
  position: relative;
  flex-shrink: 0;
}

.cost-item-img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s;
}
.cost-item-img:hover { transform: scale(1.05); }

.cost-item-img-empty {
  width: 64px;
  height: 64px;
  background: #f5f5f5;
  border: 2px dashed #ddd;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #ccc;
  cursor: pointer;
  gap: 2px;
}
.cost-item-img-empty small { font-size: 10px; }

.cost-img-change {
  position: absolute;
  bottom: 2px;
  right: 2px;
  padding: 2px 5px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 10px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}
.cost-item-img-wrap:hover .cost-img-change { opacity: 1; }

.cost-item-info { flex: 1; min-width: 0; }

.cost-item-name {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 4px;
}

.cost-item-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 3px; }

.cost-tag {
  padding: 2px 8px;
  background: #f0f0f0;
  border-radius: 20px;
  font-size: 11px;
  color: #666;
}

.cost-item-notes { font-size: 12px; color: #999; }

.cost-item-price {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a2e;
  white-space: nowrap;
  min-width: 90px;
  text-align: right;
}

.cost-item-actions { display: flex; gap: 4px; flex-shrink: 0; }

.btn-icon-edit, .btn-icon-del {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-icon-edit:hover { background: #e6f0ff; }
.btn-icon-del:hover { background: #fff0f0; }

/* ===================== 报价核算 ===================== */

.quote-panel-wrap { width: 100%; }

.quote-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}

.quote-form-col, .quote-chart-col {
  background: white;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.quote-section-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
}

.quote-field-group {
  margin-bottom: 14px;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  overflow: hidden;
}

.quote-field-header {
  padding: 8px 14px;
  background: #fafafa;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
}

.quote-field-group .form-row {
  padding: 10px 14px 2px;
}

.quote-field-group .form-group { margin-bottom: 8px; }

.quote-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
}
.quote-input:focus { outline: none; border-color: #0f3460; }

.gold-calc-hint {
  padding: 6px 14px 10px;
  font-size: 12px;
  color: #d97706;
  font-weight: 500;
}

.quote-save-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

/* 右侧汇总面板 */
.quote-total-display {
  text-align: center;
  font-size: 36px;
  font-weight: 800;
  color: #1a1a2e;
  padding: 16px 0 8px;
  letter-spacing: -1px;
}

.quote-total-display span { color: #0f3460; }

/* 百分比明细条 */
.quote-breakdown {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.quote-breakdown-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qb-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.qb-label {
  font-size: 13px;
  color: #444;
  width: 52px;
  flex-shrink: 0;
}

.qb-bar-wrap {
  flex: 1;
  height: 6px;
  background: #f0f0f0;
  border-radius: 3px;
  overflow: hidden;
}

.qb-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
  min-width: 2px;
}

.qb-pct {
  font-size: 12px;
  color: #888;
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

.qb-val {
  font-size: 12px;
  color: #555;
  font-weight: 600;
  width: 80px;
  text-align: right;
  flex-shrink: 0;
}

/* 饼图 */
.quote-chart-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
}

/* 响应式 */
@media (max-width: 860px) {
  .quote-layout { grid-template-columns: 1fr; }
}

/* ===== 报价核算子标签 ===== */
.quote-sub-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid #e8e8e8;
  padding-bottom: 0;
}

.quote-sub-tab {
  padding: 10px 22px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: #888;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 6px 6px 0 0;
  transition: all 0.2s;
}

.quote-sub-tab:hover { color: #0f3460; background: #f5f7ff; }
.quote-sub-tab.active { color: #0f3460; border-bottom-color: #0f3460; font-weight: 600; }

.quote-sub-panel { display: none; }
.quote-sub-panel.active { display: block; }

/* ===== 预报价工具栏 ===== */
.pre-quote-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.hint-text {
  font-size: 13px;
  color: #999;
}

/* ===== 预报价卡片列表 ===== */
.pre-quote-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pre-quote-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e8eaf2;
  box-shadow: 0 2px 8px rgba(15,52,96,0.06);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.pre-quote-card:hover {
  box-shadow: 0 4px 16px rgba(15,52,96,0.12);
}

.pq-card-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid #f0f0f5;
  background: linear-gradient(135deg, #f8f9fd 0%, #f0f4ff 100%);
}

.pq-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f3460;
  margin-bottom: 4px;
}

.pq-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pq-customer { font-size: 13px; color: #555; }
.pq-desc { font-size: 13px; color: #888; }
.pq-date { font-size: 12px; color: #bbb; margin-left: auto; }

.pq-card-body {
  padding: 16px 20px;
}

.pq-price-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.pq-price-tag {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.pq-total {
  font-size: 15px;
  color: #333;
  font-weight: 500;
}

.pq-total strong {
  font-size: 18px;
  color: #0f3460;
}

.pq-notes {
  margin-top: 8px;
  font-size: 12px;
  color: #999;
  line-height: 1.5;
}

.pq-card-actions {
  padding: 12px 20px;
  background: #fafafa;
  border-top: 1px solid #f0f0f0;
  display: flex;
  gap: 10px;
}

/* ===== 预报价表单总价预览 ===== */
.pq-form-total {
  margin-top: 16px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #2c1e0f, #5a3e1b);
  color: #fff;
  border-radius: 10px;
  font-size: 15px;
  text-align: right;
}

.pq-form-total span {
  font-size: 22px;
  font-weight: 700;
  color: #f0c040;
}

/* ===================== 库存管理 ===================== */

/* 统计卡片行 */
.inv-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.inv-stat-card {
  background: white;
  border-radius: 12px;
  padding: 14px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  text-align: center;
  flex: 1;
  min-width: 100px;
}

.inv-stat-num {
  font-size: 24px;
  font-weight: 800;
  color: #1a1a2e;
  line-height: 1.2;
}

.inv-stat-label {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

/* 工具栏 */
.inv-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.inv-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inv-filters select {
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  background: white;
  color: #444;
  cursor: pointer;
}

.inv-filters select:focus {
  outline: none;
  border-color: #0f3460;
}

/* 库存品类 tab（横向滚动 chips，金棕高亮，参考供货商筛选风格） */
.inv-cat-tabs {
  display: flex;
  gap: 8px;
  width: 100%;
  overflow-x: auto;
  padding: 10px 2px 2px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
  scrollbar-width: thin;
}
.inv-cat-chip {
  flex: 0 0 auto;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  color: #374151;
  transition: all .15s;
}
.inv-cat-chip:hover {
  border-color: var(--brand-gold);
  color: var(--brand-brown);
}
.inv-cat-chip.active {
  background: var(--brand-gold);
  border-color: var(--brand-gold);
  color: #fff;
}
.inv-cat-chip b {
  opacity: .7;
  font-weight: 700;
  margin-left: 2px;
}

/* 卡片网格 */
/* 视图切换按钮组 */
.inv-view-toggle {
  display: flex;
  gap: 2px;
  background: #e5e7eb;
  border-radius: 8px;
  padding: 2px;
}
.inv-view-toggle button {
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s;
}
.inv-view-toggle button.active {
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* 列表视图 */
.inv-list-view {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inv-list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s;
  cursor: default;
}
.inv-list-row:hover {
  box-shadow: 0 3px 12px rgba(0,0,0,0.1);
}

.inv-list-row .inv-list-img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  cursor: pointer;
  background: #f5f5f5;
}
.inv-list-row .inv-list-img-empty {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  font-size: 24px;
  color: #ccc;
  cursor: pointer;
}

.inv-list-row .inv-list-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.inv-list-row .inv-list-title {
  font-weight: 600;
  font-size: 13px;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.inv-list-row .inv-list-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.inv-list-row .inv-list-tags .inv-badge {
  font-size: 11px;
  padding: 2px 6px;
}

.inv-list-row .inv-list-meta {
  font-size: 12px;
  color: #666;
  white-space: nowrap;
}

.inv-list-row .inv-list-price {
  text-align: right;
  flex-shrink: 0;
}

.inv-list-row .inv-list-price .price-retail {
  font-size: 14px;
  font-weight: 600;
  color: #059669;
}

.inv-list-row .inv-list-price .price-cost {
  font-size: 11px;
  color: #d97706;
}

.inv-list-row .inv-list-price .price-qty {
  font-size: 11px;
  color: #0f3460;
}

.inv-list-row .inv-list-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.inv-list-row .inv-list-actions .btn-sm {
  font-size: 11px;
  padding: 4px 8px;
}

.inv-list-row .inv-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* 列表视图响应式 */
@media (max-width: 600px) {
  .inv-list-row {
    gap: 10px;
    padding: 8px 10px;
  }
  .inv-list-row .inv-list-img,
  .inv-list-row .inv-list-img-empty {
    width: 48px;
    height: 48px;
  }
  .inv-list-row .inv-list-title {
    max-width: 100px;
    font-size: 12px;
  }
  .inv-list-row .inv-list-meta {
    display: none;
  }
  .inv-list-row .inv-list-price .price-retail {
    font-size: 12px;
  }
}

.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

/* 库存卡片 */
.inv-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}

.inv-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

/* 图片区 */
.inv-card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f5f5f5;
}

.inv-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.3s;
}
.inv-card-img:hover { transform: scale(1.04); }

.inv-card-img-empty {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: #ccc;
  gap: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
.inv-card-img-empty small { font-size: 12px; }
.inv-card-img-empty:hover { background: #eee; }

.inv-status-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: 20px;
  color: white;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.inv-img-change {
  position: absolute;
  bottom: 6px;
  right: 6px;
  padding: 3px 8px;
  background: rgba(0,0,0,0.55);
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}
.inv-card-img-wrap:hover .inv-img-change { opacity: 1; }

/* 卡片正文 */
.inv-card-body {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inv-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.inv-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-brown);
}

/* 徽标 */
.inv-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-natural { background: #f0fdf4; color: #059669; border: 1px solid #6ee7b7; }
.badge-lab { background: #eff6ff; color: #2563eb; border: 1px solid #93c5fd; }
.badge-gem { background: #f5f3ff; color: #7c3aed; border: 1px solid #c4b5fd; }
.badge-cat { background: #fff7ed; color: #c2410c; border: 1px solid #fdba74; }
.badge-designer { background: #fce7f3; color: #be185d; border: 1px solid #f9a8d4; }

/* 详情标签 */
.inv-card-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inv-detail-tag {
  padding: 3px 9px;
  background: var(--brand-gold-soft);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* 价格区 */
.inv-card-prices {
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inv-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inv-price-label {
  font-size: 12px;
  color: var(--text-muted);
}

.inv-price-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-brown);
}

.inv-price-val.purchase { color: var(--warning); }
.inv-price-val.retail { color: var(--brand-gold-dark); }
.inv-price-val.qty { color: var(--text-secondary); }

.inv-sku {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
}

.inv-notes {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* 卡片操作 */
.inv-card-actions {
  padding: 10px 16px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

/* 响应式：小屏三列 */
@media (max-width: 600px) {
  .inv-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 10px; }
  .inv-filters { gap: 6px; }
  .inv-filters select { font-size: 12px; padding: 7px 8px; }
}

/* ===== 用户栏 ===== */
.user-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding-left: 16px;
}
.user-name {
  font-size: 13px;
  color: #8c6d2f;
  font-weight: 500;
  white-space: nowrap;
}
.btn-logout {
  background: transparent;
  border: 1px solid var(--brand-gold);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 13px;
  color: var(--brand-gold-light);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-logout:hover { background: var(--brand-gold-soft); color: var(--brand-brown); border-color: var(--brand-gold-dark); }
.btn-user-mgmt {
  background: transparent;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-user-mgmt:hover { background: #f0f0f0; }

/* header flex 布局适配 */
header {
  flex-wrap: wrap;
}
.header-left {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}


/* 裁切弹窗背景改为不透明(已废弃) */
.cropper-backdrop {
  position: absolute;
  inset: 0;
  background: #1a1a2e;
  backdrop-filter: none;
}

/* ===== 裁切弹窗修正（覆盖旧样式）===== */
.img-crop-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: none;
}
/* 把 cropper.js 内置的半透明遮罩调整到合理范围 */
.img-crop-canvas-wrap .cropper-modal {
  opacity: 0.5 !important;
  background: #000 !important;
}

/* ===== 系统 Header Logo ===== */
.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.92;
}
.header-logo-svg {
  width: 48px;
  height: 14.4px;
  opacity: 0.92;
}
.brand-header-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.brand-header-cn {
  font-size: 18px;
  font-weight: 600;
  color: #f5e9cc;
  letter-spacing: 4px;
  font-family: 'Georgia', 'STSong', serif;
}
.brand-header-en {
  font-size: 10px;
  color: #c8a96e;
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* stat value 颜色保持金黄，更暖 */
.stat-item .value { color: #f5c842 !important; }

/* stat-item 边框微调 */
.stat-item {
  border: 1px solid rgba(200,169,110,0.3) !important;
}


/* ====================================================
   报价 vs 成本对比 + 毛利率  (profit-compare)
   ==================================================== */
.profit-compare-block {
  margin-top: 20px;
  padding: 16px;
  background: #fffef9;
  border: 1px solid #e8d8b0;
  border-radius: 10px;
}
.profit-compare-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 14px;
  font-weight: 700;
  color: #6b4f1e;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e8d8b0;
}
.pc-loading { color: #999; font-size: 13px; padding: 8px 0; }
.pc-header-row, .pc-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 0;
}
.pc-header-row {
  color: #888;
  font-size: 11px;
  border-bottom: 1px solid #eee;
  padding-bottom: 6px;
  margin-bottom: 2px;
}
.pc-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.pc-label  { flex: 1; color: #444; min-width: 52px; }
.pc-quote-val { flex: 0 0 76px; text-align: right; color: #6b4f1e; font-weight: 500; }
.pc-vs     { flex: 0 0 18px; text-align: center; color: #bbb; font-size: 11px; }
.pc-cost-val  { flex: 0 0 76px; text-align: right; color: #555; }
.pc-diff   { flex: 0 0 82px; text-align: right; font-size: 12px; font-weight: 600; }
.pc-diff-pos { color: #16a34a; }
.pc-diff-neg { color: #dc2626; }
.pc-divider  { border: none; border-top: 1px solid #eee; margin: 4px 0; }
.pc-total-row { border-top: 1px solid #e8d8b0; padding-top: 6px; }

/* ---- 毛利率汇总 ---- */
.profit-summary { margin-top: 12px; }
.profit-summary-inner {
  padding: 14px 16px 10px;
  border-radius: 8px;
  border: 1px solid;
}
.profit-summary-inner.profit-pos {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-color: #86efac;
}
.profit-summary-inner.profit-neg {
  background: linear-gradient(135deg, #fff1f2, #fee2e2);
  border-color: #fca5a5;
}
.ps-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}
.ps-label { font-size: 12px; color: #666; }
.ps-val { font-size: 14px; font-weight: 700; }
.ps-val.pos { color: #16a34a; }
.ps-val.neg { color: #dc2626; }
.ps-val.ps-big { font-size: 22px; letter-spacing: -0.5px; }
.ps-bar-wrap {
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
  margin: 8px 0 6px;
}
.ps-bar { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.ps-bar-pos { background: linear-gradient(90deg, #4ade80, #16a34a); }
.ps-bar-neg { background: linear-gradient(90deg, #f87171, #dc2626); }
.ps-hint { font-size: 11px; color: #888; }

/* ====================================================
   报价核算「成本明细」子标签 owner-only 样式
   ==================================================== */
.quote-sub-tab.owner-only { /* 继承原有 quote-sub-tab 样式即可 */ }

/* 预报价导入模态框样式 */
.prequote-import-item {
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
}
.prequote-import-item:hover {
  border-color: #7c3aed;
  background-color: #f9f5ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.12);
}
.pqi-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.pqi-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}
.pqi-total {
  font-size: 16px;
  font-weight: 700;
  color: #7c3aed;
}
.pqi-meta {
  font-size: 13px;
  color: #666;
  margin-bottom: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.pqi-date {
  margin-left: auto;
  font-size: 12px;
  color: #999;
}
.pqi-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pqi-badge {
  background: #f0f9ff;
  border: 1px solid #d1e9ff;
  color: #175cd3;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 20px;
}
.modal-tip {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  color: #555;
  margin-bottom: 12px;
}

/* 预报价图片上传 */
.pq-img-upload-area { border:2px dashed #d1d5db; border-radius:10px; overflow:hidden; background:#fafafa; transition:border-color 0.2s; }
.pq-img-upload-area:hover { border-color:#7c3aed; }
.pq-img-drop-label { display:block; cursor:pointer; text-align:center; padding:20px; }
.pq-img-placeholder { color:#aaa; font-size:14px; }
.pq-img-placeholder:hover { color:#7c3aed; }
.pq-img-preview { width:100%; max-height:200px; object-fit:contain; display:block; cursor:zoom-in; }
.pq-img-actions { display:flex; gap:8px; padding:8px 12px; background:#f9f5ff; border-top:1px solid #ede9fe; }
.pq-card-thumb { width:72px; height:72px; object-fit:cover; border-radius:8px; float:right; margin-left:12px; cursor:zoom-in; border:1px solid #e0e0e0; }

/* ===================== 财务系统 ===================== */

/* KPI 概览 */
.finance-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 4px;
}
.finance-section-title {
  font-size: 15px;
  font-weight: 700;
  color: #374151;
  margin-bottom: 12px;
  padding-left: 2px;
}
.finance-kpi {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.finance-kpi-label { font-size: 12px; color: #6b7280; margin-bottom: 6px; }
.finance-kpi-value { font-size: 20px; font-weight: 700; line-height: 1.2; }
.finance-kpi-sub { font-size: 11px; color: #9ca3af; margin-top: 4px; }

/* 收支标签 */
.fin-cat-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.fin-income { background: #d1fae5; color: #065f46; }
.fin-expense { background: #fee2e2; color: #991b1b; }

/* 收支明细表格 */
.finance-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.finance-table thead th {
  background: #f9fafb;
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  color: #6b7280;
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb;
  letter-spacing: 0.5px;
}
.finance-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}
.finance-table tbody tr:hover { background: #f9fafb; }

/* 销售明细汇总 */
.sales-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 0;
  margin-top: 8px;
}
.sales-sum-item {
  background: linear-gradient(135deg, #f9fafb, #fff);
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 16px;
  min-width: 110px;
  text-align: center;
}
.sales-sum-label { display: block; font-size: 11px; color: #6b7280; margin-bottom: 4px; }
.sales-sum-val { display: block; font-size: 16px; font-weight: 700; color: #111827; }

/* 统计卡片 */
.finance-stat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.finance-stat-title { font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 8px; }
.finance-stat-total { font-size: 22px; font-weight: 700; color: #111827; margin-bottom: 14px; }
.finance-cat-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.finance-cat-table td { padding: 6px 4px; vertical-align: middle; }

/* 账户卡片 */
.finance-account-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  transition: box-shadow 0.2s;
}
.finance-account-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.10); }
.fac-type { font-size: 12px; color: #6b7280; margin-bottom: 6px; }
.fac-name { font-size: 16px; font-weight: 600; color: #111827; margin-bottom: 8px; }
.fac-balance { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.fac-notes { font-size: 12px; color: #9ca3af; margin-bottom: 10px; }
.fac-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ===== 库存成品成本明细 ===== */
.cost-section-title {
  font-size: 14px; font-weight: 600; color: #92400e;
  padding: 10px 0 6px; border-bottom: 1px solid #f0e6d3; margin-bottom: 8px;
}
.inv-cost-table {
  width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 8px;
}
.inv-cost-table th {
  background: #fdf3e7; color: #92400e; font-weight: 600;
  padding: 6px 8px; text-align: left; border-bottom: 1px solid #f0e6d3;
}
.inv-cost-table td { padding: 4px 4px; vertical-align: middle; }
.inv-cost-table input, .inv-cost-table select {
  border: 1px solid #e0d5c8; border-radius: 6px;
  padding: 4px 6px; font-size: 13px; background: #fff;
}
.inv-cost-table input:focus, .inv-cost-table select:focus {
  outline: none; border-color: #b07d3a; box-shadow: 0 0 0 2px rgba(176,125,58,.15);
}
.dev-section { margin: 14px 0; border: 1px solid #f0ece4; border-radius: 10px; padding: 12px 14px; background: #fffdfa; }
.dev-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-weight: 600; color: #5b4a36; font-size: 14px; }
.btn-add-cost-row {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border-radius: 8px; border: 1px dashed #b07d3a;
  background: #fdf8f2; color: #92400e; font-size: 13px; cursor: pointer;
  transition: background .15s;
}
.btn-add-cost-row:hover { background: #faefd8; }
.inv-cost-total-row {
  text-align: right; font-size: 14px; font-weight: 700;
  color: #92400e; padding: 6px 4px 0;
}

/* ===== 库存图片上传 ===== */
.inv-img-upload-section {
  margin: 12px 0;
  padding: 12px;
  background: #faf8f5;
  border-radius: 8px;
  border: 1px dashed #d4c5a9;
}

.inv-img-slots {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.inv-img-slot {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.inv-img-upload-btn {
  width: 80px;
  height: 80px;
  border: 2px dashed #d4c5a9;
  border-radius: 8px;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.inv-img-upload-btn:hover {
  border-color: #b8956b;
  background: #faf8f5;
}

.inv-img-upload-icon {
  font-size: 28px;
  color: #d4c5a9;
  line-height: 1;
}

.inv-img-upload-label {
  font-size: 11px;
  color: #78716c;
  margin-top: 4px;
  text-align: center;
}

.inv-img-upload-btn input[type="file"] {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
}

.inv-img-item {
  width: 80px;
  height: 80px;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.inv-img-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-remove-img {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.btn-remove-img:hover {
  background: rgba(220, 68, 68, 0.9);
}

.inv-img-hint {
  font-size: 12px;
  color: #a8a29e;
  margin-top: 8px;
  text-align: left;
}

/* ===== 实习生考勤 ===== */
.interns-header {
  margin-bottom: 16px;
}

.interns-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.interns-toolbar select {
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
  background: white;
}

.interns-summary {
  background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-dark));
  color: #1a1a1a;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.interns-calendar {
  background: white;
  border-radius: 12px;
  padding: 16px;
  overflow-x: auto;
}

/* ===== 考勤日历卡片布局 ===== */

.intern-cards-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 0;
}

.intern-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.intern-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 10px;
  background: #f9fafb;
  border-bottom: 1px solid #f0f0f0;
  flex-wrap: wrap;
}

.intern-card-info {
  flex: 1;
  min-width: 80px;
}

.intern-card-name {
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  display: block;
}

.intern-card-wage {
  font-size: 12px;
  color: #9ca3af;
  display: block;
  margin-top: 1px;
}

.intern-card-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.intern-stat-badge {
  display: inline-block;
  background: #d1fae5;
  color: #059669;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 12px;
}

.intern-stat-pay {
  font-size: 14px;
  font-weight: 700;
  color: #7c3aed;
}

.intern-card-actions {
  display: flex;
  gap: 6px;
}

.intern-card-actions button {
  padding: 3px 9px;
  font-size: 12px;
  border: 1px solid #e5e7eb;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  color: #374151;
  transition: background 0.15s;
}

.intern-card-actions button:hover {
  background: #f3f4f6;
}

/* 7列日历网格 */
.intern-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  padding: 10px 10px 12px;
  max-width: 490px;
  margin: 0 auto;
}

.intern-cal-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  padding: 4px 0 6px;
  letter-spacing: 0.5px;
}

.intern-cal-weekday.weekend {
  color: #ef4444;
}

.intern-cal-empty {
  /* 月份开头空白占位 */
}

.intern-cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 8px;
  font-size: 12px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  transition: all 0.12s;
  position: relative;
  min-height: 32px;
  max-width: 64px;
  justify-self: center;
  width: 100%;
}

.intern-cal-day .day-num {
  color: #374151;
  font-size: 12px;
  line-height: 1;
}

.intern-cal-day.weekend-day .day-num {
  color: #ef4444;
}

.intern-cal-day.today {
  background: #fef3c7;
  border-color: #fbbf24;
}

.intern-cal-day.today .day-num {
  color: #92400e;
  font-weight: 700;
}

.intern-cal-day.present {
  background: #d1fae5;
  border-color: #10b981;
}

.intern-cal-day .check-icon {
  color: #059669;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.intern-cal-day.today.present {
  background: #a7f3d0;
  border-color: #059669;
}

.intern-cal-day:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  transform: scale(1.05);
}

.intern-cal-day.present:hover {
  border-color: #059669;
  background: #bbf7d0;
  transform: scale(1.05);
}

/* 旧样式保留（兼容）*/
.intern-name-actions button {
  padding: 2px 6px;
  font-size: 11px;
  border: 1px solid #e5e7eb;
  background: white;
  border-radius: 4px;
  cursor: pointer;
}

.intern-daily-wage {
  font-size: 12px;
  color: #6b7280;
  display: block;
}


.inv-list-detail {
  font-size: 12px;
  color: #555;
  margin-top: 2px;
  line-height: 1.4;
}
.inv-detail-sku {
  color: #7c3aed;
  font-family: monospace;
  font-weight: 600;
  font-size: 11px;
}
.inv-detail-stone {
  color: #374151;
}
.inv-detail-metal {
  color: #6b7280;
  font-size: 11px;
}
.inv-detail-sep {
  color: #d1d5db;
  margin: 0 4px;
}

/* ========================================
   PWA 底部导航 + 首页工作台 + 移动端适配
   v=20260720a
   ======================================== */

/* ===== 底部导航（默认隐藏，移动端显示）===== */
.bottom-nav {
  display: none;
}

/* 移动端常驻快捷栏（桌面端隐藏，移动端在 media 内开启）*/
.quick-dock { display: none; }

/* ===== 移动端子导航（默认隐藏）===== */
.mobile-subnav {
  display: none;
}

/* 桌面端（>768px）强制隐藏移动子导航：杜绝手机宽度缩放/旋转到桌面后
   内联 style 残留 display:flex 覆盖 base display:none 而泄漏成灰色竖条 */
@media (min-width: 769px) {
  .mobile-subnav { display: none !important; }
}

/* ===== 首页工作台 ===== */
.home-workbench {
  max-width: 600px;
  margin: 0 auto;
  padding: 4px 0;
}

.home-greeting {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.home-greeting-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-brown);
}

.home-logout-btn {
  padding: 6px 14px;
  border: 1px solid #ddd;
  border-radius: 20px;
  background: white;
  font-size: 13px;
  color: #666;
  cursor: pointer;
}

.home-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 6px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  color: white;
  gap: 6px;
  transition: opacity 0.15s;
}
.quick-btn:active { opacity: 0.8; }

.quick-icon { font-size: 26px; line-height: 1; }
.quick-label { font-size: 11px; }

.quick-sale { background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-dark)); }
.quick-order { background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-dark)); }
.quick-inventory { background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-dark)); }
.quick-search { background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-dark)); }

/* 定制订单视图开关（进行中 / 全部订单 / 已完成）*/
.order-view-switch {
  display: inline-flex;
  border: 1px solid var(--brand-gold, #c8a45c);
  border-radius: 20px;
  overflow: hidden;
  flex-shrink: 0;
}
.view-switch-btn {
  border: none;
  background: #fff;
  color: #666;
  padding: 7px 15px;
  font-size: 13px;
  cursor: pointer;
  border-right: 1px solid #eee;
  white-space: nowrap;
}
.view-switch-btn:last-child { border-right: none; }
.view-switch-btn.active {
  background: linear-gradient(135deg, var(--brand-gold, #c8a45c), var(--brand-gold-dark, #a8843e));
  color: #fff;
  font-weight: 600;
}

.home-section { margin-bottom: 24px; }

.home-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.home-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-brown);
}

.home-more {
  font-size: 13px;
  color: var(--brand-gold);
  cursor: pointer;
}

.home-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.home-kpi {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi-label { font-size: 12px; color: var(--text-muted); }
.kpi-value { font-size: 20px; font-weight: 700; color: var(--brand-gold-dark); }
.kpi-blue { color: var(--brand-gold-dark); }
.kpi-gold { color: var(--brand-gold-dark); }
.kpi-green { color: var(--brand-gold-dark); }
.kpi-orange { color: var(--brand-gold-dark); }

.home-orders-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home-order-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 15px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.2s;
}
.home-order-card:active { background: var(--bg-subtle); }

.home-order-num { font-size: 14px; font-weight: 700; color: var(--brand-gold-dark); }
.home-order-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.home-order-amount { font-size: 15px; font-weight: 700; color: var(--brand-gold-dark); }

.home-func-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.home-func {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 6px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: white;
  cursor: pointer;
  gap: 6px;
  transition: background 0.15s;
}
.home-func:active { background: #f9fafb; }

.func-icon { font-size: 24px; line-height: 1; }
.func-label { font-size: 11px; color: #374151; }

/* ===== 移动端响应式（<=768px）===== */
@media (max-width: 768px) {
  /* 隐藏桌面端顶部 header 和 tabs */
  header { display: none !important; }
  .steps-grid { grid-template-columns: repeat(4, 1fr); }
  .sidebar { display: none !important; }

  /* 显示底部导航 */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e8e8e8;
    padding: 6px 0;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  }

  .bottom-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: none;
    background: none;
    cursor: pointer;
    padding: 4px 0;
    gap: 2px;
  }

  .bottom-icon { font-size: 22px; line-height: 1; width: 22px; height: 22px; display: block; }
  .bottom-label { font-size: 10px; color: #999; }
  .bottom-tab.active .bottom-label { color: var(--brand-gold-dark); font-weight: 600; }
  .bottom-tab.active .bottom-icon { transform: scale(1.1); }

  /* 显示移动端子导航（改为自动换行，保证所有标签完整显示不被视口切掉） */
  .mobile-subnav {
    display: flex;
    flex-wrap: wrap;
    background: white;
    border-bottom: 1px solid #e8e8e8;
    padding: 6px 10px;
    scrollbar-width: none;
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .mobile-subnav::-webkit-scrollbar { display: none; }
  .mobile-subnav[style*="display:none"] { display: none !important; }

  .sub-nav-tab {
    flex-shrink: 0;
    padding: 8px 14px;
    border: none;
    background: none;
    font-size: 14px;
    color: #666;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    cursor: pointer;
  }
  .sub-nav-tab.active {
    color: var(--brand-gold-dark);
    border-bottom-color: var(--brand-gold-dark);
    font-weight: 600;
  }

  /* 内容区域适配（底部给 Tab 栏 + 常驻快捷栏留白）*/
  .content {
    padding: 14px;
    padding-bottom: 150px;
  }

  /* 移动端首页悬浮快捷按钮（白底金边气泡形状，区别于底部导航栏，仅首页由 JS 加 .show 显示）*/
  .quick-dock.show {
    display: flex;
    position: fixed;
    left: 0; right: 0;
    bottom: calc(58px + 14px + env(safe-area-inset-bottom, 0px));
    z-index: 999;
    justify-content: center;
    align-items: flex-end;
    gap: 4px;
    padding: 0 2px;
    background: none;
    border: none;
    box-shadow: none;
    pointer-events: none; /* 容器空白区不拦截点击 */
  }
  .quick-dock.show .dock-btn {
    pointer-events: auto;
    flex: 1 1 0;
    min-width: 0;
    max-width: 62px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border: 1.5px solid var(--brand-gold, #c8a45c);
    background: #fff;
    border-radius: 16px;
    padding: 8px 1px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(200,164,92,0.22);
    transition: transform 0.12s, background 0.12s;
  }
  .quick-dock.show .dock-icon {
    font-size: 24px;
    line-height: 1;
    width: 24px;
    height: 24px;
    display: block;
  }
  .quick-dock.show .dock-label {
    font-size: 11px;
    color: #8a6d2f;
    font-weight: 600;
  }
  .quick-dock.show .dock-btn:active { transform: scale(0.95); background: #fffaf0; }

  /* 首页工作台移动端优化 */
  .home-quick-actions { gap: 8px; }
  .quick-btn { padding: 12px 4px; }
  .quick-icon { font-size: 24px; }

  /* 表格横向滚动 */
  .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 600px; }

  /* 操作栏适配 */
  .actions { gap: 8px; }
  .actions .btn-primary-action { font-size: 13px; padding: 8px 14px; }

  /* 模态框适配 */
  .modal-content {
    max-width: 95% !important;
    max-height: 90vh;
    overflow-y: auto;
    margin: 10px;
  }

  /* 库存工具栏适配 */
  .inv-toolbar { flex-wrap: wrap; gap: 6px; }
  .inv-toolbar .inv-filters select { font-size: 12px; padding: 6px 8px; }
  .inv-sku-search input { width: 100% !important; }

  /* 财务工具栏适配 */
  .inv-toolbar select,
  .inv-toolbar input[type="date"] {
    font-size: 12px;
    padding: 6px 8px;
  }

  /* 订单卡片适配 */
  .orders-cards { grid-template-columns: 1fr !important; }

  /* 报价子标签适配 */
  .quote-sub-tabs { overflow-x: auto; scrollbar-width: none; }
  .quote-sub-tabs::-webkit-scrollbar { display: none; }
  .quote-sub-tab { white-space: nowrap; padding: 8px 12px; font-size: 13px; }

  /* 按钮触摸优化 */
  button, .btn-primary-action, .btn-secondary {
    min-height: 36px;
  }

  /* 输入框触摸优化 */
  input, select, textarea {
    font-size: 14px !important;
  }
}

/* ===== 平板适配（769px-1024px）===== */
@media (min-width: 769px) and (max-width: 1024px) {
  .home-workbench { max-width: 800px; }
  .home-kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .home-func-grid { grid-template-columns: repeat(5, 1fr); }
  .steps-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ===== 桌面端：首页也可见但优化布局 ===== */
@media (min-width: 769px) {
  #home-tab .home-workbench { max-width: 900px; }
  .home-quick-actions { grid-template-columns: repeat(4, 1fr); max-width: 500px; }
  .home-kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .home-func-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ===== 新布局：左侧栏 + 内容区（2026-07-24 重构）===== */
.app-shell { display: flex; align-items: stretch; min-height: calc(100vh - 66px); }
.sidebar { width: 200px; flex: 0 0 200px; background: var(--sidebar-bg, #F7F1E3); border-right: 1px solid var(--border, #E8DFC8); padding: 10px 0; overflow-y: auto; }
.sidebar-nav { display: flex; flex-direction: column; }
.sidebar .tab { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 16px; border: none; border-left: 3px solid transparent; border-bottom: none; text-align: left; color: var(--text-secondary, #5b5247); font-size: 14px; background: none; cursor: pointer; white-space: nowrap; }
.sidebar .tab .tab-icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar .tab:hover { background: rgba(201,162,39,.08); color: var(--brand-brown, #8a6d1f); }
.sidebar .tab.active { background: var(--brand-gold-soft, #FBF3DB); border-left-color: var(--brand-gold, #C9A227); color: var(--brand-gold-dark, #A8851F); font-weight: 600; }
.nav-badge { margin-left: auto; background: #ef4444; color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; font-weight: 700; line-height: 1; }
.nav-badge.hidden { display: none; }
.content { flex: 1; min-width: 0; }
.hamburger { display: none; width: 38px; height: 38px; border: 1px solid var(--border, #E8DFC8); background: #fff; border-radius: 8px; font-size: 18px; cursor: pointer; align-items: center; justify-content: center; color: var(--text-secondary, #5b5247); margin-right: 4px; }
.scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 999; }
.scrim.show { display: block; }
.order-sub-tabs { display: flex; gap: 8px; margin-right: auto; }
.order-sub-tabs .sub-nav-tab { padding: 6px 14px; border-radius: 999px; font-size: 13px; color: var(--text-secondary, #5b5247); border: 1px solid transparent; cursor: pointer; }
.order-sub-tabs .sub-nav-tab:hover { background: var(--bg-page, #FBF8F1); }
.order-sub-tabs .sub-nav-tab.active { background: var(--brand-gold, #C9A227); color: #fff; }
/* 销售业务子标签栏（桌面端） */
.sales-biz-nav { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.sales-biz-tab { padding: 8px 18px; border-radius: 999px; font-size: 14px; color: var(--text-secondary, #5b5247); background: #fff; border: 1px solid var(--border, #E8DFC8); cursor: pointer; transition: all .15s; }
.sales-biz-tab:hover { background: var(--bg-page, #FBF8F1); }
.sales-biz-tab.active { background: var(--brand-gold, #C9A227); color: #fff; border-color: var(--brand-gold, #C9A227); }
@media (max-width: 768px) { .sales-biz-nav { display: none !important; } }
@media (max-width: 1024px) {
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; transform: translateX(-100%); transition: transform .2s ease; z-index: 1000; }
  .sidebar.open { transform: none; }
  .hamburger { display: flex; }
  .app-shell { min-height: auto; }
}
@media (max-width: 768px) {
  .app-shell { flex-direction: column; }
  .sidebar { display: none; }
  .hamburger { display: none; }
}

/* ==================== 收款单（小程序付款链接）==================== */

.payreq-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.payreq-stat {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.payreq-stat .k { font-size: 12px; color: #6b7280; }
.payreq-stat .v { font-size: 20px; font-weight: 700; color: #0f3460; }
.payreq-stat .v.amber { color: #b45309; }
.payreq-stat .v.green { color: #166534; }
.payreq-stat .v.muted { color: #9ca3af; }
.payreq-stat .s { font-size: 11px; color: #9ca3af; }

.payreq-list { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }

.pr-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}
.pr-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #f9fafb;
  border-bottom: 1px solid #f1f3f5;
  font-size: 12px;
}
.pr-code {
  font-weight: 700;
  color: #0f3460;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .5px;
}
.pr-kind { color: #6b7280; }
.pr-date { margin-left: auto; color: #9ca3af; }

.pr-status { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid; }
.pr-status.gray { color: #6b7280; border-color: #d1d5db; background: #f3f4f6; }
.pr-status.amber { color: #b45309; border-color: #fcd34d; background: #fffbeb; }
.pr-status.green { color: #166534; border-color: #86efac; background: #f0fdf4; }

.pr-card-body { padding: 14px 16px; }
.pr-title { font-size: 15px; font-weight: 600; color: #1a1a2e; }
.pr-meta { font-size: 12px; color: #6b7280; margin-top: 5px; }
.pr-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  font-size: 13px;
  color: #374151;
}
.pr-amounts .cut { color: #b45309; }
.pr-amounts .due { font-weight: 700; color: #0f3460; }
.pr-amounts .paid { color: #166534; }

.pr-bar { height: 5px; border-radius: 3px; background: #eef2f7; margin-top: 10px; overflow: hidden; }
.pr-bar i { display: block; height: 100%; background: linear-gradient(90deg, #34d399, #10b981); }

.pr-card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px 14px;
  border-top: 1px solid #f1f3f5;
  justify-content: flex-end;
}
.pr-btn {
  padding: 6px 14px;
  font-size: 12.5px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  border-radius: 7px;
  cursor: pointer;
}
.pr-btn:hover { background: #f3f4f6; }
.pr-btn.primary { background: #0f3460; border-color: #0f3460; color: #fff; }
.pr-btn.primary:hover { filter: brightness(1.12); background: #0f3460; }
.pr-btn.danger { color: #dc2626; border-color: #fca5a5; }
.pr-btn.danger:hover { background: #fef2f2; }

/* 弹窗表单 */
.pr-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pr-grid3 { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 14px; }

.pr-field { margin-bottom: 14px; }
.pr-field > label {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 5px;
}
.pr-field > label em { font-style: normal; color: #dc2626; }
.pr-field input,
.pr-field select,
.pr-field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: #fff;
  box-sizing: border-box;
  font-family: inherit;
}
.pr-field input:focus,
.pr-field select:focus,
.pr-field textarea:focus { border-color: #0f3460; }
.pr-field textarea { resize: vertical; }

.pr-total {
  padding: 9px 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 12.5px;
  color: #6b7280;
  line-height: 1.5;
}
.pr-total b { color: #0f3460; font-size: 15px; }
.pr-total .cut { color: #b45309; }

.pr-items-head,
.pr-item {
  display: grid;
  grid-template-columns: 1.6fr 1.3fr .8fr .55fr .9fr 32px;
  gap: 8px;
  align-items: center;
}
.pr-items-head {
  font-size: 11.5px;
  color: #9ca3af;
  padding: 0 2px 5px;
}
.pr-item { margin-bottom: 8px; }
.pr-item input {
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 13.5px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.pr-item input:focus { border-color: #0f3460; }
.pr-item .c-sum { font-size: 13px; color: #374151; text-align: right; }
.pr-item .c-act {
  border: 1px solid #fca5a5;
  background: #fff;
  color: #dc2626;
  border-radius: 7px;
  height: 32px;
  cursor: pointer;
  font-size: 13px;
}
.pr-item .c-act:hover { background: #fef2f2; }

.pr-items-actions { display: flex; gap: 8px; margin-top: 6px; }

.pr-hint {
  font-size: 12px;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 10px 12px;
  line-height: 1.7;
}

.pr-recinfo {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.pr-recinfo .t { font-size: 14px; font-weight: 600; color: #1a1a2e; }
.pr-recinfo .s { font-size: 12.5px; color: #6b7280; margin-top: 5px; }
.pr-recinfo .s b { color: #b45309; }

/* 库存选择器 */
.payinv-results { max-height: 52vh; overflow-y: auto; }
.payinv-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
}
.payinv-row:hover { background: #f0f7ff; border-color: #93c5fd; }
.payinv-row .r-main { flex: 1; min-width: 0; }
.payinv-row .t { font-size: 13.5px; color: #1a1a2e; font-weight: 500; }
.payinv-row .s { font-size: 11.5px; color: #9ca3af; margin-top: 3px; }
.payinv-row .p { font-size: 14px; font-weight: 700; color: #0f3460; white-space: nowrap; }

/* 详情弹窗 */
.pr-detail-title { font-size: 16px; font-weight: 700; color: #1a1a2e; }
.pr-detail-meta { font-size: 12.5px; color: #6b7280; margin-top: 6px; }
.pr-sec { font-size: 12px; color: #9ca3af; margin: 18px 0 8px; letter-spacing: .06em; }
.pr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pr-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 500;
  color: #9ca3af;
  padding: 6px 8px;
  border-bottom: 1px solid #e5e7eb;
}
.pr-table td { padding: 8px; border-bottom: 1px solid #f3f4f6; color: #374151; }
.pr-table td.muted { color: #9ca3af; font-size: 12.5px; }

.pr-sum { margin-top: 14px; padding: 12px 14px; background: #f9fafb; border-radius: 8px; }
.pr-sum > div { display: flex; justify-content: space-between; font-size: 13px; color: #6b7280; padding: 3px 0; }
.pr-sum > div.total { border-top: 1px solid #e5e7eb; margin-top: 6px; padding-top: 8px; }
.pr-sum > div.total b { font-size: 17px; color: #0f3460; }
.pr-sum b { color: #374151; }
.pr-sum b.cut { color: #b45309; }
.pr-sum b.green { color: #166534; }
.pr-sum b.amber { color: #b45309; }

.pr-note {
  font-size: 13px;
  color: #374151;
  line-height: 1.8;
  background: #fffdf5;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 12px 14px;
}
.pr-empty-line { font-size: 12.5px; color: #9ca3af; padding: 10px 0; }

@media (max-width: 768px) {
  .payreq-stats { grid-template-columns: repeat(2, 1fr); }
  .pr-grid2, .pr-grid3 { grid-template-columns: 1fr; }
  .pr-items-head { display: none; }
  .pr-item { grid-template-columns: 1fr 1fr; }
}

/* ===== 销售数据范围（行级隔离）提示条 ===== */
.scope-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 4px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #FFF8E8;
  border: 1px solid #E9D3A0;
  color: #7A5A18;
  font-size: 13px;
  line-height: 1.5;
}
.scope-banner b { color: #A8841A; }
#salesFilterSalesperson[data-perm]:disabled,
select[disabled] {
  background: #f3f4f6;
  color: #6b7280;
  cursor: not-allowed;
}
@media (max-width: 640px) {
  .scope-banner { font-size: 12px; padding: 8px 10px; }
}

/* =====================================================================
   小程序运营后台（ERP「📱 小程序」一级板块）
   ===================================================================== */
#miniapp-tab .quote-sub-tabs { margin-bottom: 14px; }

/* ---------- 概览 KPI ---------- */
.mp-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.mp-kpi {
  background: #fff;
  border: 1px solid #e8ecf2;
  border-radius: 12px;
  padding: 16px 18px;
}
.mp-kpi .k {
  font-size: 13px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mp-kpi .v {
  font-size: 30px;
  font-weight: 700;
  color: #0f3460;
  line-height: 1.25;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.mp-kpi .v.dim { color: #9ca3af; font-size: 22px; }
.mp-kpi .s { font-size: 12px; color: #9ca3af; margin-top: 2px; }

/* ---------- 保养申请 ---------- */
.mp-care-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #eef1f6;
}
.mp-care-row:last-child { border-bottom: none; }
.mp-care-row.todo { background: #fffbf3; }
.mp-care-main { flex: 1 1 320px; min-width: 0; }
.mp-care-t { font-size: 14px; color: #111827; display: flex; align-items: center; gap: 8px; }
.mp-care-st {
  font-size: 11px; color: #92400e; background: #fef3c7;
  border-radius: 999px; padding: 2px 8px; white-space: nowrap;
}
.mp-care-m { font-size: 12px; color: #6b7280; margin-top: 4px; }
.mp-care-n { font-size: 12px; color: #374151; margin-top: 6px; line-height: 1.6; }
.mp-care-side {
  display: flex; align-items: center; gap: 10px;
  flex: 0 0 auto; margin-left: auto;
}
.mp-care-photo-btn {
  font-size: 12px; padding: 5px 10px; border: 1px solid #cbd5e1;
  border-radius: 7px; background: #fff; color: #0f3460; cursor: pointer; white-space: nowrap;
}
.mp-care-sel {
  font-size: 12px; padding: 5px 8px; border: 1px solid #cbd5e1;
  border-radius: 7px; background: #fff; color: #374151; outline: none;
}
.mp-care-photos { flex: 1 1 100%; padding-top: 8px; }

/* ---------- 通用卡片 ---------- */
.mp-card {
  background: #fff;
  border: 1px solid #e8ecf2;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.mp-card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f3f7;
  margin-bottom: 12px;
}
.mp-card-more { font-size: 13px; font-weight: 400; color: #0f3460; cursor: pointer; }
.mp-card-more:hover { text-decoration: underline; }

/* ---------- 上线进度 ---------- */
.mp-steps { display: flex; flex-direction: column; gap: 10px; }
.mp-step { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.6; }
.mp-step .dot {
  flex: 0 0 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  margin-top: 1px;
}
.mp-step.done .dot { background: #16a34a; }
.mp-step.doing .dot { background: #d97706; }
.mp-step.todo .dot { background: #cbd5e1; }
.mp-step .tx { color: #374151; }
.mp-step.todo .tx { color: #9ca3af; }

/* ---------- 上架看板 ---------- */
.mp-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid #e8ecf2;
  border-radius: 12px;
  margin-bottom: 10px;
  background: #fff;
}
.mp-row.on { border-color: #bfdbfe; background: #f8fbff; }
.mp-row .ck { flex: 0 0 auto; }
.mp-row .ck input { width: 17px; height: 17px; accent-color: #0f3460; cursor: pointer; }
.mp-row .pic {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #cbd5e1;
}
.mp-row .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-row .mid { flex: 1; min-width: 0; }
.mp-row .nm {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mp-row .meta { font-size: 12.5px; color: #6b7280; margin-top: 5px; display: flex; flex-wrap: wrap; gap: 10px; }
.mp-row .meta b { color: #0f3460; font-weight: 600; }
.mp-row .acts { flex: 0 0 auto; display: flex; gap: 8px; align-items: center; }
.mp-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  line-height: 1.7;
}
.mp-badge.on { background: #dbeafe; color: #1d4ed8; }
.mp-badge.off { background: #f1f5f9; color: #94a3b8; }

/* ---------- 帮助文案 ---------- */
.mp-help-body { font-size: 14px; line-height: 1.85; color: #374151; }
.mp-help-body p { margin: 0 0 10px; }
.mp-help-body ol, .mp-help-body ul { margin: 0 0 10px; padding-left: 22px; }
.mp-help-body li { margin-bottom: 5px; }
.mp-help-body code {
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: #0f3460;
}
.mp-warn { background: #fffbeb; border-left: 3px solid #f59e0b; padding: 9px 12px; border-radius: 6px; color: #92400e; }
.mp-dim { color: #9ca3af; font-size: 13px; }

/* ---------- 海报卡片（页面版） ---------- */
.mp-bcard {
  display: flex;
  gap: 14px;
  padding: 14px;
  border: 1px solid #e8ecf2;
  border-radius: 12px;
  margin-bottom: 12px;
  background: #fff;
}
.mp-bcard.off { background: #fafafa; }
.mp-bcard .thumb {
  flex: 0 0 96px;
  height: 128px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e8ecf2;
  background: #f3f4f6;
  cursor: pointer;
  position: relative;
}
.mp-bcard .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-bcard .thumb .tip {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  font-size: 11px;
  text-align: center;
  padding: 3px 0;
}
.mp-bcard .body { flex: 1; min-width: 0; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .mp-kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .mp-kpi { padding: 12px 14px; }
  .mp-kpi .v { font-size: 24px; }
  .mp-row { flex-wrap: wrap; gap: 10px; }
  .mp-row .acts { width: 100%; justify-content: flex-end; }
  .mp-bcard { flex-direction: column; }
  .mp-bcard .thumb { flex: 0 0 auto; width: 100%; height: 160px; }
  #miniapp-tab .inv-toolbar { flex-wrap: wrap; }
}

/* ===================== 库存批量选择 / 批量删除（2026-10-09） ===================== */
.inv-card.inv-selectable,
.inv-list-row.inv-selectable {
  position: relative;
  cursor: pointer;
}
.inv-card.inv-selectable:hover,
.inv-list-row.inv-selectable:hover {
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.25);
}
/* 选中态：红框 + 淡红底，一眼看出哪些会被删 */
.inv-card.inv-selected,
.inv-list-row.inv-selected {
  outline: 2px solid #dc2626;
  outline-offset: -2px;
  background: #fff5f5;
}
/* 透明覆盖层：选择模式下点卡片任意位置即勾选，顺带避免误触卡片里的按钮 */
.inv-sel-cover {
  position: absolute;
  inset: 0;
  z-index: 6;
  cursor: pointer;
}
/* 左上角勾选框（纯展示，点击由 cover 接管） */
.inv-sel-check {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 7;
  pointer-events: none;
  background: #fff;
  border-radius: 6px;
  padding: 3px 4px 1px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  line-height: 0;
}
.inv-sel-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #dc2626;
  cursor: pointer;
}

/* ===== 「批量选择」入口按钮（2026-10-09 加强可见性） =====
   原先它和「导入文件 / 拍照查库存 / 导出Excel」一样是浅米色，用户扫过去看不见。
   这里改成红描边 + 红字，和同排其它按钮明显区分开。 */
#invSelectToggle.inv-select-entry {
  background: #fff;
  color: #b91c1c;
  border: 1.5px solid #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.10);
  font-weight: 700;
}
#invSelectToggle.inv-select-entry:hover {
  background: #fef2f2;
  color: #991b1b;
  border-color: #b91c1c;
}
/* 选择模式开启中 */
#invSelectToggle.inv-select-entry.is-on {
  background: #dc2626;
  color: #fff;
  border-color: #b91c1c;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.24);
}
#invSelectToggle.inv-select-entry.is-on:hover {
  background: #b91c1c;
  color: #fff;
}

/* ===== 客户管理 · 检索栏（2026-10-10） ===== */
.cust-toolbar { gap: 10px; }

.cust-search { position: relative; display: flex; align-items: center; }
.cust-search-icon {
  position: absolute; left: 12px; font-size: 13px;
  opacity: .6; pointer-events: none; line-height: 1;
}
#custSearch {
  width: 330px; padding: 10px 34px 10px 36px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  font: 400 14px/1 var(--font-ui); color: var(--text-primary);
  background: #fff; outline: none; transition: .18s;
}
#custSearch::placeholder { color: #b8a68f; }
#custSearch:focus {
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 3px rgba(201, 122, 60, .16);
}
.cust-search-clear {
  position: absolute; right: 7px; display: none;
  border: none; background: transparent; cursor: pointer;
  font-size: 13px; color: #9ca3af; padding: 4px 7px; border-radius: 6px; line-height: 1;
}
.cust-search-clear:hover { background: var(--bg-subtle); color: var(--brand-brown); }

.cust-filter {
  padding: 10px 10px; border: 1px solid var(--border-strong);
  border-radius: var(--radius); font: 400 13px/1 var(--font-ui);
  color: var(--text-secondary); background: #fff; outline: none; cursor: pointer;
}
.cust-filter:focus { border-color: var(--brand-gold); }

.cust-reset {
  padding: 9px 13px; border: 1px solid var(--border-strong); background: #fff;
  border-radius: var(--radius); font: 500 12px/1 var(--font-ui);
  color: var(--text-secondary); cursor: pointer; transition: .18s;
}
.cust-reset:hover { border-color: var(--brand-gold); color: var(--brand-gold-dark); background: var(--brand-gold-soft); }

.cust-count { font-size: 13px; color: var(--text-secondary); }

/* 命中高亮 */
mark.cust-hl {
  background: #FFF1B8; color: inherit;
  padding: 0 2px; border-radius: 3px; font-weight: 600;
}

/* ===== 客户检索选择器（新建/编辑订单）=====
   客户已 50+ 位，原生 select 要翻半天；换成「输入即筛」组合框。
   列表用**文档流**（不是 absolute）—— 弹窗 .modal-content 是 overflow:auto，
   absolute 的下拉会被裁掉；走文档流则自然把表单顶开、弹窗自己滚。 */
.cust-picker { position: relative; }
.cust-picker-box {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 0 10px; background: #fff; transition: .18s;
}
.cust-picker-box:focus-within {
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 3px rgba(201, 122, 60, .16);
}
.cust-picker-ico { flex: 0 0 auto; font-size: 13px; opacity: .5; }
.cust-picker-box input {
  flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: transparent;
  padding: 10px 0; font: 400 14px/1.4 var(--font-ui); color: var(--text-primary);
}
.cust-picker-box input::placeholder { color: #b6b0a6; }
.cust-picker-x {
  flex: 0 0 auto; border: 0; background: transparent; cursor: pointer;
  font-size: 13px; line-height: 1; color: #9ca3af; padding: 4px 6px; border-radius: 6px;
}
.cust-picker-x:hover { background: var(--bg-subtle); color: #b91c1c; }

.cust-picker-list {
  margin-top: 4px; max-height: 230px; overflow-y: auto;
  border: 1px solid var(--border-strong); border-radius: 10px; background: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .10);
}
.cust-picker-item { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid #f5f1e9; }
.cust-picker-item:last-child { border-bottom: 0; }
.cust-picker-item:hover,
.cust-picker-item.is-hi { background: #FDF6EC; }
.cust-picker-item.is-cur { background: #FBF3E7; box-shadow: inset 3px 0 0 var(--brand-gold); }
.ci-name {
  display: flex; align-items: center; gap: 6px;
  font: 600 14px/1.4 var(--font-ui); color: #1a1a2e;
}
.ci-tag {
  font: 400 11px/1.6 var(--font-ui); color: #8C938D;
  border: 1px solid #e7e2d8; border-radius: 4px; padding: 0 5px;
}
.ci-sub { margin-top: 2px; font: 400 12px/1.5 var(--font-ui); color: #8C938D; }

.cust-picker-empty { padding: 16px 12px; text-align: center; font: 400 13px/1.5 var(--font-ui); color: #9ca3af; }
.cust-picker-hint { margin-top: 6px; font: 400 12px/1.6 var(--font-ui); color: var(--text-muted); }

/* ===== 结算管理：供方伙伴汇总卡片（点一下 = 只看这一家） ===== */
.settle-chip-hint {
  margin: 0 0 10px; font: 400 12px/1.6 var(--font-ui); color: var(--text-muted);
}
.settle-chip {
  min-width: 190px; padding: 10px 14px; border-radius: 10px;
  background: var(--bg-card); border: 1px solid var(--border-strong);
  box-shadow: 0 1px 2px rgba(58, 44, 28, .05);
  cursor: pointer; user-select: none; transition: all .15s ease;
}
.settle-chip:hover {
  border-color: var(--brand-gold-light); background: var(--brand-gold-soft);
  box-shadow: 0 4px 12px rgba(201, 122, 60, .15); transform: translateY(-1px);
}
.settle-chip.is-active {
  border-color: var(--brand-gold); background: var(--brand-gold-soft);
  box-shadow: inset 3px 0 0 var(--brand-gold), 0 2px 8px rgba(201, 122, 60, .18);
}
.settle-chip.is-noclick { cursor: default; opacity: .75; }
.settle-chip.is-noclick:hover {
  border-color: var(--border-strong); background: var(--bg-card);
  box-shadow: 0 1px 2px rgba(58, 44, 28, .05); transform: none;
}
.settle-chip-name {
  margin-bottom: 4px; font: 600 14px/1.4 var(--font-ui); color: var(--text-primary);
}
.settle-chip.is-active .settle-chip-name { color: var(--brand-gold-dark); }

/* ===== 其他成本（快递费 / 包装费 …）=====
   三个宿主共用：新建/编辑订单的 #modal、销售开单 #directSaleModal、订单结算 #saleConfirmModal。
   注意：这是「并进该单 cost_amount 的成本」，不是支出流水 —— 直接扣毛利。 */
.extracost-section {
  margin: 14px 0 4px;
  padding: 12px 14px;
  border: 1px solid #f0e6d3;
  border-radius: 10px;
  background: #fffdfa;
}
.extracost-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.extracost-title { font-size: 14px; font-weight: 700; color: #92400e; }
.extracost-tip { font-size: 12px; color: #a1803f; }
.extracost-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.extracost-table th {
  background: #fdf3e7; color: #92400e; font-weight: 600;
  padding: 6px 8px; text-align: left; border-bottom: 1px solid #f0e6d3; font-size: 12px;
}
.extracost-table td { padding: 4px 4px; vertical-align: middle; }
.extracost-table input, .extracost-table select {
  width: 100%; box-sizing: border-box;
  border: 1px solid #e0d5c8; border-radius: 6px;
  padding: 5px 7px; font-size: 13px; background: #fff; color: var(--text-primary);
}
.extracost-table input:focus, .extracost-table select:focus {
  outline: none; border-color: #b07d3a; box-shadow: 0 0 0 2px rgba(176,125,58,.15);
}
.extracost-table .ec-amt { text-align: right; font-weight: 600; }
.ec-del {
  background: none; border: none; cursor: pointer;
  color: #c0392b; font-size: 15px; line-height: 1; padding: 2px 4px;
}
.ec-del:hover { color: #e74c3c; }
.extracost-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 8px; flex-wrap: wrap;
}
.extracost-add {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border-radius: 8px; border: 1px dashed #b07d3a;
  background: #fdf8f2; color: #92400e; font-size: 13px; cursor: pointer;
  transition: background .15s;
}
.extracost-add:hover { background: #faefd8; }
.extracost-total { font-size: 14px; font-weight: 700; color: #92400e; }
.extracost-total-val { font-variant-numeric: tabular-nums; }
