:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #1f3a5f;
  --accent-2: #2f6fed;
  --success: #059669;
  --warn: #d97706;
  --danger: #dc2626;
  --sidebar: #111827;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea {
  font: inherit;
  color: inherit;
}
#app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
#sidebar {
  width: 220px;
  background: var(--sidebar);
  color: #d1d5db;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand-title {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .5px;
}
.brand-sub {
  color: #9ca3af;
  font-size: 12px;
  margin-top: 2px;
}
#nav {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.25) transparent;
}
#nav a {
  padding: 10px 12px;
  border-radius: 8px;
  color: #d1d5db;
}
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
}
.nav-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
}
.nav-group-title:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.nav-group-title .chevron {
  font-size: 12px;
  transition: transform .2s;
}
.nav-group.collapsed .chevron {
  transform: rotate(-90deg);
}
.nav-group-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  max-height: 340px;
  transition: max-height .2s ease, opacity .2s;
}
.nav-group.collapsed .nav-group-items {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}
.nav-group-items a {
  padding-left: 28px;
}
#nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
#nav a.active {
  background: rgba(47, 111, 237, .25);
  color: #fff;
  font-weight: 600;
}
.identity {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 14px;
  flex-shrink: 0;
}
.identity label {
  display: block;
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 6px;
}
.identity select {
  width: 100%;
  background: #1f2937;
  color: #fff;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 8px 10px;
}

/* Main */
#main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
#topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
#page-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}
#content {
  padding: 20px 24px 40px;
}

/* Cards / layout */
.grid {
  display: grid;
  gap: 14px;
}
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.card h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}
.metric {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}
.metric.money { color: #1d4ed8; font-size: 22px; line-height: 1.3; }
.metric.money.warn { color: #d97706; }
.metric.sub {
  font-size: 22px;
}
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* 服务费配置美化 */
.fees-card { padding: 20px; }
.fees-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fees-head h3 { font-size: 16px; }
.fees-tbl { border-radius: 10px; overflow: hidden; }
.fees-tbl thead th { background: #f8fafc; color: #64748b; font-size: 12px; font-weight: 600; letter-spacing: .5px; }
.fees-tbl tbody tr { transition: background .15s ease; }
.fees-tbl tbody tr:hover { background: #f8fafc; }
.fees-tbl td { padding: 12px 14px; font-size: 14px; }
.eco-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 10px; vertical-align: middle; box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.fee-cell { display: flex; flex-direction: column; gap: 7px; }
.fee-ratio { font-weight: 700; color: var(--accent); font-size: 17px; line-height: 1; }
.fee-bar { width: 150px; max-width: 100%; height: 7px; background: #eef2f7; border-radius: 4px; overflow: hidden; }
.fee-bar-in { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #60a5fa, #1d4ed8); transition: width .4s ease; }

/* 经营视图时间筛选 */
.stat-filter { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; flex-wrap: wrap; }
.seg { display: inline-flex; background: #eef2f7; border-radius: 8px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 7px 18px; border-radius: 6px; font-size: 13px; color: #475569; cursor: pointer; }
.seg button.on { background: #fff; color: var(--brand2); font-weight: 600; box-shadow: 0 1px 3px rgba(15,23,42,.12); }
#stat-pick { padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: #fff; color: #334155; }
#stat-label { white-space: nowrap; }

/* SKU 规格选择弹窗 */
.sku-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.sku-pick-row { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: all .15s ease; }
.sku-pick-row:hover { border-color: var(--brand2); background: #f8fafc; transform: translateY(-2px); box-shadow: 0 2px 8px rgba(15,23,42,.06); }
.sku-pick-row img { width: 100%; height: 96px; object-fit: contain; border-radius: 8px; background: #fff; border: 1px solid var(--line); }
.sku-pick-ph { width: 100%; height: 96px; display: flex; align-items: center; justify-content: center; background: #eef2f7; border-radius: 8px; color: #94a3b8; font-size: 24px; }
.sku-pick-main { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; }
.sku-pick-name { font-size: 13px; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sku-pick-price { color: var(--accent); font-size: 15px; }

/* Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.toolbar .spacer { flex: 1; }

/* Buttons */
.btn {
  border: 1px solid transparent;
  background: var(--accent-2);
  color: #fff;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
  line-height: 1.2;
}
.btn:hover { filter: brightness(1.05); }
.btn.secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}
.btn.ghost {
  background: transparent;
  color: var(--accent-2);
  border-color: transparent;
}
.btn.danger { background: var(--danger); }
.btn.success { background: var(--success); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Inputs */
input, select, textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, .12);
}
label.field,
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
label.field > span,
.field > span { font-weight: 600; }

/* Table */
.table-wrap {
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
table.data {
  width: auto;
  border-collapse: collapse;
  min-width: 100%;
}
table.data th, table.data td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}
table.data th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
table.data tr:hover td { background: #f9fafb; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #eef2ff;
  color: #3730a3;
}
.tag.green { background: #ecfdf5; color: #047857; }
.tag.orange { background: #fff7ed; color: #c2410c; }
.tag.gray { background: #f3f4f6; color: #4b5563; }
.tag.red { background: #fef2f2; color: #b91c1c; }
/* 客户状态与分级标签 */
.cst { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.cst-新线索 { background: #f3f4f6; color: #4b5563; }
.cst-已联系, .cst-已量房, .cst-已方案 { background: #eff6ff; color: #1d4ed8; }
.cst-已报价, .cst-议价中 { background: #fff7ed; color: #c2410c; }
.cst-已签约 { background: #ecfdf5; color: #047857; }
.cst-施工中 { background: #eef2ff; color: #3730a3; }
.cst-已交付 { background: #f0fdf4; color: #15803d; }
.cst-售后回访 { background: #f8fafc; color: #475569; }
.cst-branch { background: #fdf2f8; color: #be185d; margin-left: 4px; }
.lv { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; font-weight: 700; }
.lv-A { background: #fef2f2; color: #b91c1c; }
.lv-B { background: #eff6ff; color: #1d4ed8; }
.lv-C { background: #f3f4f6; color: #6b7280; }
/* 首页待办 */
.todo-card { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.todo-box { flex: 1 1 220px; min-width: 210px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.todo-box h4 { margin: 0 0 8px; font-size: 14px; color: #1f2937; display: flex; align-items: center; gap: 6px; }
.todo-box h4 .n { background: #ef4444; color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; }
.todo-list { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow-y: auto; }
.todo-list li { padding: 6px 2px; border-bottom: 1px dashed #e5e7eb; font-size: 13px; line-height: 1.5; cursor: pointer; }
.todo-list li:last-child { border-bottom: none; }
.todo-list li:hover { background: #f8fafc; }
.todo-list .sub { color: #6b7280; font-size: 12px; }
.todo-list .warn { color: #d97706; font-weight: 600; }
.sku-count { font-size: 11px; color: #6366f1; background: #eef2ff; border-radius: 6px; padding: 1px 6px; margin-top: 2px; display: inline-block; }
.rtoolbar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.rt-btn { font-size: 12px; padding: 3px 8px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; color: #334155; }
.rt-btn:hover { background: #f1f5f9; }
.rt-sel { font-size: 12px; padding: 2px 4px; border: 1px solid var(--line); border-radius: 6px; color: #334155; }
.rte { min-height: 90px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: 13px; line-height: 1.6; background: #fff; outline: none; }
.rte:focus { border-color: var(--brand); }
.rte img { max-width: 100%; border-radius: 8px; display: block; margin: 6px 0; user-select: none; }
.rte img:hover { outline: 2px dashed #94a3b8; outline-offset: 2px; cursor: grab; }
/* 连续图片（中间无文字/换行）之间不留间距：前一张底边+后一张顶边都清零 */
.rte img:has(+ img) { margin-bottom: 0 !important; }
.rte img + img { margin-top: 0 !important; }
.intro img:has(+ img) { margin-bottom: 0 !important; }
.intro img + img { margin-top: 0 !important; }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 2100;
}
.modal {
  background: #fff;
  border-radius: 16px;
  width: min(720px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 20px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .2);
}
.modal.wide { width: min(960px, 100%); }
.modal.alert {
  width: min(520px, 100%);
  border: 3px solid #f59e0b;
  box-shadow: 0 24px 64px rgba(180, 83, 9, .35);
}
.modal.alert h2 {
  text-align: center;
  font-size: 20px;
  color: #b45309;
  background: #fff7ed;
  margin: -20px -20px 16px;
  padding: 14px 20px;
  border-radius: 13px 13px 0 0;
}
.modal h2 {
  margin: 0;
  font-size: 18px;
  color: var(--accent);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.modal-top-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.form-grid .full { grid-column: 1 / -1; }

/* toast */
#toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast-item {
  background: #111827;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  min-width: 180px;
}
.toast-item.ok { background: var(--success); }
.toast-item.err { background: var(--danger); }

/* empty */
.empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* rooms / devices */
.room {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fff;
}
.room-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-bottom: 8px;
}
.room-head h4 {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
}
.room-head h4 .tag, .room-head .tag, .room-head .btn { flex: none; white-space: nowrap; }
.device-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px dashed var(--line);
  flex-wrap: wrap;
}
.device-row img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
  background: #f3f4f6;
}
.device-row .name { flex: 1; min-width: 120px; }
.device-row input { width: 80px; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  cursor: pointer;
  border: 1px solid transparent;
}
.chip.active {
  background: var(--accent-2);
  color: #fff;
  position: relative;
  padding: 4px 12px 4px 16px;
}
.chip .del-room {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 20px;
  height: 20px;
  min-width: 20px;
  padding: 0;
  border-radius: 50%;
  color: #fff;
  background: #d33;
  border: 1px solid #fff;
  font-weight: bold;
  font-size: 11px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
}

.progress {
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  background: var(--accent-2);
}

.pay-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fff;
}
.pay-card .row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}
.thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.thumbs img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.visit-item {
  border-left: 3px solid var(--accent-2);
  padding: 8px 12px;
  margin: 8px 0;
  background: #f8fafc;
  border-radius: 0 8px 8px 0;
}

/* Floor designer */
.floor-wrap {
  display: flex;
  gap: 12px;
  min-height: 70vh;
}
.floor-side {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.floor-side .list {
  overflow: auto;
  max-height: 50vh;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.floor-side .list-item {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.floor-side .list-item:hover,
.floor-side .list-item.selected {
  background: #eef2ff;
}
.floor-canvas {
  flex: 1;
  position: relative;
  background: #e5e7eb;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: auto;
  min-height: 520px;
}
.floor-canvas .plan {
  position: relative;
  margin: 0 auto;
  user-select: none;
}
.floor-canvas .plan img {
  display: block;
  max-width: 100%;
  height: auto;
  pointer-events: none;
}
.floor-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
}
.marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #2f6fed;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  cursor: grab;
  z-index: 3;
}
.marker.orange { background: #f59e0b; }
.marker.green { background: #059669; }
.marker .label {
  position: absolute;
  top: 36px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: rgba(17, 24, 39, .85);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  pointer-events: none;
}
.marker:active { cursor: grabbing; }

/* ===== 报价编辑（按房间/楼层分组） ===== */
.modal.xl { width: min(1240px, 100%); }
.qf-top {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  align-items: end;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.qf-floortool {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 0;
}
.qf-floor {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-2);
  color: #fff;
  padding: 3px 8px;
  border-radius: 14px;
  font-size: 12px;
}
.qf-floor-name {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 12px;
  width: 60px;
  text-align: center;
  outline: none;
  border-bottom: 1px dashed rgba(255,255,255,.6);
}
.qf-floor-name:focus { border-bottom: 1px solid #fff; background: rgba(255,255,255,.15); border-radius: 3px; }
.qf-floor-rooms {
  background: rgba(255,255,255,.22);
  border: none;
  color: #fff;
  font-size: 11px;
  border-radius: 8px;
  padding: 1px 6px;
  cursor: pointer;
  line-height: 1.4;
}
.qf-floor-rooms:hover { background: rgba(255,255,255,.4); }
.qf-hint { color: #9ca3af; font-size: 11px; }
.qf-manage-rooms { margin-left: 8px; }
.chip-edit {
  border: none;
  background: transparent;
  font-size: 12px;
  width: 64px;
  text-align: center;
  outline: none;
  border-bottom: 1px dashed rgba(47,111,237,.5);
  color: inherit;
}
.chip-edit:focus { border-bottom: 1px solid var(--accent-2); }
.fee-ratio { font-weight: 700; color: #111827; }
.qf-floor-del {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}
.qf-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.qf-tab {
  border: 1px solid var(--line);
  background: #fff;
  color: #374151;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}
.qf-tab:hover { border-color: var(--accent-2); color: var(--accent-2); }
.qf-groups { display: flex; flex-direction: column; gap: 12px; }
.qf-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fbfcfe;
}
.qf-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--line);
}
.qf-room-name { font-weight: 700; color: #111827; }
.qf-room-sub { color: var(--accent-2); font-weight: 600; }
.qf-items th, .qf-items td { padding: 6px 8px; font-size: 12px; }
.qf-unit { margin-left: 4px; color: #6b7280; font-size: 11px; }
.qf-fee { padding: 2px 4px; font-size: 12px; }
.qf-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.qf-total { font-size: 14px; }
.qf-total b { font-size: 22px; color: var(--accent-2); margin-left: 6px; }
.qf-prod-img { width:32px; height:32px; object-fit:cover; border-radius:6px; vertical-align:middle; margin-right:8px; }
.qf-prod-name { vertical-align:middle; }
.qf-group-foot .btn { font-weight: 400; }
/* 参考图式产品卡片行 */
.qf-cards { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; }
.qf-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #eef2f7; border-radius: 8px; background: #fff; }
.qf-card:hover { border-color: #cbd5e1; }
.qf-card-img { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; background: #f8fafc; flex-shrink: 0; }
.qf-card-img-empty { background: #f1f5f9; }
.qf-card-main { flex: 1; min-width: 0; }
.qf-card-name { font-size: 13px; color: #0f172a; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qf-card-spec { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.qf-card-price input, .qf-card-qty input, .qf-card-disc input { width: 62px; font-size: 12px; border: 1px solid #e2e8f0; border-radius: 6px; padding: 4px 6px; }
.qf-card-label, .qf-card-unit { font-size: 12px; color: #6b7280; }
.qf-card-price, .qf-card-qty, .qf-card-disc, .qf-card-fee { display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.qf-card-qty { min-width: 84px; }
.qf-card-fee select { font-size: 12px; border: 1px solid #e2e8f0; border-radius: 6px; padding: 3px 4px; }
.qf-fee-tag { font-size: 11px; color: #94a3b8; }
.qf-card-sub { min-width: 76px; text-align: right; font-size: 13px; font-weight: 600; color: #0f172a; white-space: nowrap; }
.qf-card-ops { display: flex; gap: 2px; }
.qf-card-ops .btn { padding: 2px 6px; font-size: 12px; }
.qf-empty { color: #94a3b8; padding: 12px; font-size: 13px; text-align: center; border: 1px dashed #e2e8f0; border-radius: 8px; }
/* 移动端方案编辑器 */
.mob-sol { padding: 12px; }
.mob-sol-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 10px; }
.mob-sol-name { font-size: 15px; color: #0f172a; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mob-sol-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 10px; background: #f8fafc; border: 1px solid #eef2f7; border-radius: 10px; font-size: 13px; color: #475569; }
.mob-sol-bar .link { color: #2563eb; cursor: pointer; }
.mob-qty { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.mob-qty .btn { padding: 2px 9px; font-size: 14px; line-height: 1.4; min-width: 30px; }
.mob-qty b { min-width: 22px; text-align: center; font-size: 14px; }
/* 价格编辑弹窗 */
.pe-wrap { padding: 8px 4px; min-width: 320px; }
.pe-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; font-size: 14px; color: #0f172a; border-bottom: 1px solid #f1f5f9; }
.pe-row b { color: #dc2626; }
.pe-row span { color: #475569; }
.pe-row input { width: 100px; font-size: 14px; border: 1px solid #e2e8f0; border-radius: 6px; padding: 5px 8px; }
.pe-note { font-size: 12px; color: #94a3b8; border: none; }
.pe-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 16px; }
/* 户型锁定醒目弹窗 */
.lock-alert { text-align: center; padding: 18px 12px 6px; }
.lock-ico { font-size: 40px; color: #dc2626; line-height: 1; }
.lock-title { font-size: 18px; font-weight: 700; color: #dc2626; margin: 14px 0 8px; }
.lock-msg { font-size: 14px; color: #475569; margin-bottom: 20px; }
.lock-act { display: flex; justify-content: center; }

@media (max-width: 960px) {
  .floor-wrap { flex-direction: column; }
  .floor-side { width: 100%; }
}
@media (max-width: 640px) {
  .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  #content { padding: 14px; }
}
/* 角色权限管理 */
.role-form { display: flex; gap: 18px; }
.role-basic { width: 240px; flex: none; }
.role-perms { flex: 1; max-height: 420px; overflow: auto; border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px; }
.perm-mod { margin-bottom: 14px; }
.perm-mod-head { display: flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; font-size: 14px; }
.perm-items { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 8px 0 2px 26px; }
.perm-item { display: flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; color: #374151; }
@media (max-width: 900px) { .role-form { flex-direction: column; } .role-basic { width: 100%; } }
/* ============ 手机 / 平板适配 ============ */
#nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--accent);
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
}

/* 平板 / 笔记本小屏（≤1024px）：收紧侧栏与网格 */
@media (max-width: 1024px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #content { padding: 16px; }
  #sidebar { width: 190px; padding: 16px 12px; }
  #nav a { padding: 9px 10px; font-size: 13px; }
  .nav-group-items a { padding-left: 22px; }

  /* 报价编辑：产品卡片单行自适应，超宽横滑 */
  .qf-cards { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .qf-card { flex: none; width: fit-content; min-width: 100%; flex-wrap: nowrap; }
  .qf-card-name { overflow: visible; }
  .qf-card-ops { flex: none; }
}

/* 手机（≤600px）：抽屉导航 + 全屏弹窗 + 单列 */
@media (max-width: 600px) {
  #nav-toggle { display: inline-flex; }
  #topbar { padding: 12px 14px; gap: 10px; }
  #page-title { font-size: 17px; }
  #content { padding: 12px 12px 24px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }

  /* 侧边栏 → 抽屉 */
  #sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 1100;
  }
  body.nav-open #sidebar { transform: translateX(0); }
  body.nav-open::before {
    content: "";
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 1090;
  }

  /* 弹窗全屏 */
  .modal-backdrop { padding: 0; align-items: stretch; }
  .modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 100vh;
    border-radius: 0;
    padding: 16px;
  }
  .modal.alert h2 { margin: -16px -16px 14px; }

  /* 表格触屏滚动 */
  .table-wrap { -webkit-overflow-scrolling: touch; }

  /* 表单单列 */
  .form-grid { grid-template-columns: 1fr; }
  .role-form { flex-direction: column; }
  .role-basic { width: 100%; }
  #top-actions .btn { padding: 8px 12px; font-size: 13px; }

  .qf-foot { flex-wrap: wrap; }
}
