/* 陈列分析（2026-09-21）：样式照 Chuck 认可的效果图，色块按他的要求做成果冻质感。 */
.da-loading { padding: 8px 0; }
.da-hint { margin: 4px 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.da-gallery-hint { margin: 2px 2px 12px; }
.da-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.da-store-card { display: grid; gap: 10px; padding: 10px; text-align: start; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 8px 28px rgba(28, 29, 32, .05); cursor: pointer; }
.da-store-card:hover { border-color: #ffb6bd; }
.da-store-card.is-empty { opacity: .72; }
.da-thumb { display: grid; place-items: center; aspect-ratio: 2000 / 912; overflow: hidden; border-radius: 12px; background: #f6f6f8; color: #b3b6bd; }
.da-thumb img { width: 100%; height: 100%; object-fit: contain; }
.da-thumb.is-empty svg { width: 34px; height: 34px; }
.da-store-text { display: grid; gap: 2px; padding: 0 4px 4px; }
.da-store-text strong { font-size: 15px; }
.da-store-text small { color: var(--muted); font-size: 12px; }
.da-store-text small.is-live { color: var(--red); font-weight: 700; }

.da-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.da-seg { display: inline-flex; max-width: 100%; overflow-x: auto; padding: 3px; border-radius: 12px; background: #f0f0f2; scrollbar-width: none; }
.da-seg::-webkit-scrollbar { display: none; }
.da-seg button { position: relative; border: 0; background: transparent; padding: 7px 13px; border-radius: 9px; color: var(--muted); font-size: 13.5px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.da-seg button.on { background: #fff; color: var(--ink, #19191b); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.da-live { position: absolute; top: 5px; inset-inline-end: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.da-note { color: var(--muted); font-size: 12px; }

.da-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; align-items: start; }
.da-mapcard, .da-side { border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 8px 28px rgba(28, 29, 32, .05); }
.da-mapcard { position: relative; padding: 10px; overflow: hidden; }
.da-map { position: relative; width: 100%; max-height: 72vh; overflow: hidden; border-radius: 12px; background: #fff; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.da-map.is-dragging { cursor: grabbing; }
.da-svg { display: block; width: 100%; height: 100%; }
.da-block { cursor: pointer; transition: filter .12s ease; }
.da-block:hover { filter: brightness(1.06) saturate(1.08); }
.da-map.is-dragging .da-block { filter: none; transition: none; }
.da-svg { transform-origin: 0 0; }
.da-zoom { position: absolute; top: 18px; inset-inline-end: 18px; display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .94); box-shadow: 0 4px 14px rgba(28, 29, 32, .1); }
.da-zoom button { min-width: 34px; height: 34px; padding: 0 9px; border: 0; border-radius: 9px; background: #f3f3f5; font-size: 13px; font-weight: 700; cursor: pointer; }
.da-zoom button:hover { background: #e9e9ee; }
.da-map-hint { margin: 8px 4px 0; text-align: center; }

.da-side { padding: 14px 14px 12px; max-height: calc(72vh + 60px); overflow-y: auto; }
.da-side h2 { margin: 2px 0 8px; font-size: 15px; }
.da-side h3 { margin: 16px 0 6px; color: var(--muted); font-size: 13px; font-weight: 650; }
.da-wide { width: 100%; margin-top: 10px; }
.da-tap { color: var(--ink, #19191b); font-weight: 600; }
.da-legend { display: flex; align-items: center; gap: 8px; padding: 4px 2px; color: var(--muted); font-size: 12px; }
.da-grad { flex: 1; height: 10px; border: 1px solid var(--line); border-radius: 5px; background: linear-gradient(90deg, #fff, #ffe4e0, #ffaaa0, #f45442, #e60012, #960012); }
[dir="rtl"] .da-grad { background: linear-gradient(270deg, #fff, #ffe4e0, #ffaaa0, #f45442, #e60012, #960012); }
.da-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 8px 0 6px; font-size: 12.5px; }
.da-crumbs button { border: 0; background: none; padding: 2px 4px; color: var(--red); font-weight: 650; cursor: pointer; }
.da-crumbs i { color: var(--muted); font-style: normal; }
.da-crumbs span { font-weight: 700; }
.da-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px 4px; font-size: 13px; }
.da-sw { display: inline-block; flex: 0 0 auto; width: 12px; height: 12px; border: 1px solid rgba(0, 0, 0, .15); border-radius: 4px; }
.da-v { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; text-align: end; }
.da-table-scroll { overflow-x: auto; }
table.da-sk { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
table.da-sk th:not(:first-child) { width: 66px; }
table.da-sk th { padding: 3px 4px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 600; line-height: 1.35; text-align: end; vertical-align: bottom; white-space: normal; overflow-wrap: anywhere; }
table.da-sk th:first-child { text-align: start; }
table.da-sk td { padding: 6px 4px; border-bottom: 1px solid #f1f1f3; vertical-align: top; text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.da-sk td:first-child { overflow: hidden; text-align: start; white-space: normal; }
table.da-cats td:first-child { display: flex; align-items: center; gap: 7px; }
table.da-cats th:not(:first-child) { width: 58px; }
table.da-cats tr.is-link { cursor: pointer; }
table.da-cats tr.is-link:hover td { background: #f6f6f8; }
table.da-cats tr.on td { background: var(--red-soft, #fff0f1); }
.da-nm { display: block; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.da-stk { display: block; color: var(--muted); font-size: 11px; }
.da-cmp { display: grid; grid-template-columns: 84px 1fr 1fr 52px; gap: 6px; align-items: center; padding: 4px 2px; font-size: 12px; }
.da-cmp > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.da-track { position: relative; height: 8px; overflow: hidden; border-radius: 4px; background: #eee; }
.da-track i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 4px; }
.da-tagk { padding: 1px 6px; border-radius: 6px; font-size: 11px; font-weight: 700; text-align: center; white-space: nowrap; }
.k-up { background: #e9f8f0; color: #0d6b3a; } .k-down { background: #fff4e5; color: #8a4700; } .k-ok { background: #f0f0f2; color: #686b72; }
.da-warn { margin-top: 10px; padding: 8px 10px; border-radius: 12px; background: #fff4e5; color: #7a4312; font-size: 12.5px; line-height: 1.55; }
.da-linkrow { display: flex; justify-content: space-between; gap: 10px; width: 100%; margin-top: 4px; padding: 5px 2px; border: 0; border-top: 1px solid rgba(122, 67, 18, .14); background: none; color: inherit; font-size: 12.5px; text-align: start; cursor: pointer; }
.da-side > .da-linkrow { border-top: 1px solid #f1f1f3; color: var(--ink, #19191b); }
.da-linkrow:hover { text-decoration: underline; }

.da-zonecard { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-bottom: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.da-zonecard.is-mine { border-color: #ffb6bd; background: var(--red-soft, #fff0f1); }
.da-zl { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; font-size: 16px; font-weight: 800; }
.da-zname { font-size: 13.5px; font-weight: 700; }
.da-zst { color: var(--muted); font-size: 12px; }
.da-pbar { height: 6px; margin-top: 5px; overflow: hidden; border-radius: 3px; background: #eee; }
.da-pbar i { display: block; height: 100%; border-radius: 3px; }
.da-zbtns { display: grid; gap: 4px; }
.da-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 34px; padding: 7px 12px; border: 0; border-radius: 11px; font-size: 12.5px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.da-btn svg { width: 16px; height: 16px; }
.da-btn.red { background: var(--red); color: #fff; } .da-btn.gray { background: #f0f0f2; color: var(--ink, #19191b); } .da-btn.ghost { border: 1px solid var(--line); background: #fff; }

.da-tip { position: fixed; z-index: 60; width: 440px; max-width: calc(100vw - 24px); max-height: calc(100vh - 16px); overflow: auto; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 14px 40px rgba(20, 20, 30, .22); font-size: 12.5px; pointer-events: none; }
.da-tip.pin { pointer-events: auto; }
.da-tip h4 { margin: 0 22px 2px 0; font-size: 14px; }
[dir="rtl"].da-tip h4 { margin: 0 0 2px 22px; }
.da-tip-close { position: absolute; top: 6px; inset-inline-end: 8px; display: none; width: 28px; height: 28px; border: 0; border-radius: 50%; background: #f3f3f5; font-size: 18px; line-height: 1; cursor: pointer; }
.da-tip.pin .da-tip-close { display: block; }
.da-meta { margin-bottom: 6px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.da-leafline b { color: var(--ink, #19191b); }
.da-leafs { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; }
.da-leafchip { padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 12px; cursor: pointer; }
.da-leafchip.on { border-color: #ffb6bd; background: var(--red-soft, #fff0f1); color: var(--red); font-weight: 700; }
.da-kv { display: flex; gap: 10px; margin: 4px 0 8px; }
.da-kv div { flex: 1; padding: 6px 10px; border-radius: 10px; background: #f6f6f8; }
.da-kv b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.da-kv span { color: var(--muted); font-size: 11px; }
.da-trace { margin: 8px 0 0; color: var(--muted); font-size: 11.5px; }
.da-tip .stock-badge, .da-tag .stock-badge { margin-top: 2px; margin-inline-end: 4px; }

.da-tag h2 { margin: 0 0 2px; font-size: 17px; }
.da-strip { display: block; width: 100%; height: 96px; margin: 8px 0; border-radius: 12px; background: #f6f6f8; }
.da-field { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; margin-top: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 14px; }
.da-field input[type="number"] { width: 96px; min-height: 40px; padding: 0 8px; border: 1px solid var(--line); border-radius: 10px; font-size: 17px; font-weight: 700; text-align: end; }
.da-empty-toggle { grid-template-columns: minmax(0, 1fr) auto; cursor: pointer; }
.da-empty-toggle input { width: 22px; height: 22px; accent-color: var(--red); }
.da-stepper { display: inline-flex; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.da-stepper button { width: 40px; height: 40px; border: 0; background: #f6f6f8; font-size: 19px; font-weight: 700; cursor: pointer; }
.da-stepper b { min-width: 58px; font-size: 15px; font-variant-numeric: tabular-nums; text-align: center; }
.da-x { width: 30px; height: 30px; border: 0; border-radius: 50%; background: #f3f3f5; color: var(--muted); font-size: 17px; cursor: pointer; }
.da-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 10px; }
.da-add input { min-height: 42px; padding: 0 12px; border: 1px dashed #c9ccd3; border-radius: 12px; font-size: 14px; }
.da-results { display: grid; gap: 4px; margin-top: 6px; }
.da-result { display: grid; gap: 1px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: start; cursor: pointer; }
.da-result:hover { border-color: #ffb6bd; background: var(--red-soft, #fff0f1); }
.da-result small { color: var(--muted); font-size: 11.5px; }
.da-scan-note { padding: 6px 10px; border-radius: 10px; background: #f0f7ff; color: #1f4f82; }
.da-totalbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; margin-top: 10px; font-size: 13px; }
.da-total { font-weight: 700; }
.da-total.is-over { color: var(--danger, #d92d20); }
.da-tag-actions { flex-wrap: wrap; }
.da-scope { display: grid; gap: 6px; margin: 10px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; }
.da-scope legend { padding: 0 4px; color: var(--muted); font-size: 12px; }
.da-scope label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }

/* W-DISPLAY-ANALYSIS-V2-20260921: 清点保留独立已选区；卡片放图下，不遮挡地图。 */
.da-wrap { grid-template-columns: minmax(0, 1fr) minmax(360px, 30%); }
.da-detail { grid-column: 1; min-width: 0; }
.da-side { grid-column: 2; grid-row: 1 / span 2; }
.da-tip.da-tip-inline { position: relative; width: 100%; max-width: none; max-height: none; box-shadow: 0 8px 28px rgba(28,29,32,.05); box-sizing: border-box; }
.da-leaf-table tr { cursor: pointer; }
.da-leaf-table tr.on td { background: var(--red-soft,#fff0f1); color: var(--red); }
.da-form-error { color: var(--danger,#c82929); font-size: 13px; }
.modal:has(.da-tag-v2) { width: min(860px, calc(100vw - 32px)); }
.da-tag-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(220px,.8fr); gap: 18px; margin-top: 12px; }
.da-tag-find { min-width: 0; }
.da-tag-find .da-results { max-height: 45vh; overflow-y: auto; overscroll-behavior: contain; }
.da-tag-selected { display: flex; flex-direction: column; padding: 12px; border: 1px solid var(--line); border-radius: 12px; min-width: 0; background: #fafafb; }
.da-selected-list { flex: 1; max-height: 38vh; overflow-y: auto; overscroll-behavior: contain; }
.da-selected-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.da-selected-row small { display: block; color: var(--muted); font-size: 11px; }
.da-selected-row .da-x { flex: 0 0 30px; }
.da-zone-row { display: grid; grid-template-columns: 40px minmax(0,1fr) 28px; gap: 8px; align-items: center; margin: 10px 0; }
.da-zone-row input { min-width: 0; width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.da-zone-row button { border: none; cursor: pointer; }
.da-zone-picker { width: 230px; pointer-events: auto; }
.da-zone-picks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.da-zone-picks button { min-width: 40px; height: 40px; color: #fff; border: none; border-radius: 10px; cursor: pointer; font-weight: 700; }
.da-palette { display: grid; grid-template-columns: repeat(8,1fr); gap: 8px; margin: 16px 0; }
.da-palette button { aspect-ratio: 1; border: 3px solid transparent; border-radius: 10px; cursor: pointer; }
.da-palette button.on { outline: 2px solid var(--ink,#222); border-color: #fff; }
.da-layout { display: flex; flex-wrap: wrap; gap: 8px; border: 1px solid var(--line); border-radius: 12px; margin-top: 12px; }
.da-layout button.on { background: var(--red-soft,#fff0f1); color: var(--red); outline: 1px solid var(--red); }
.da-layout p { flex-basis: 100%; }
.da-layout-choice { flex-direction: column; flex: 1; min-width: 80px; white-space: normal; }
.da-layout-choice svg { width: 70px; height: 32px; }
.da-layout-choice small { color: var(--red); }
.da-factor-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.da-factor-fields .da-field { display: flex; flex-wrap: wrap; gap: 4px; padding: 7px 10px; margin: 0; font-size: 12px; }
.da-factor-fields .da-field > span:first-child { flex-basis: 100%; }
.da-factor-fields input { flex: 1; width: 70px !important; min-width: 0; }
.da-filter-list { display: grid; gap: 5px; max-height: 55vh; overflow-y: auto; margin-top: 12px; }
.da-kind-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; }
table.da-cats td:first-child { display: table-cell; min-width: 100px; }
table.da-cats .da-sw { margin-inline-end: 5px; }
table.da-cats .da-nm { display: inline; white-space: normal; }
table.da-cats tr.on td { color: var(--red); }
button.da-sw:not(:disabled) { cursor: pointer; }
@media (max-width:760px) {
  .da-wrap { grid-template-columns: minmax(0,1fr); }
  .da-side { grid-column: 1; grid-row: auto; }
  .da-bar > .da-seg:first-child { width: 100%; }
  .da-bar > .da-seg:first-child button { flex: 1; padding: 7px 5px; font-size: 11.5px; }
  .da-tag-grid { display: flex; flex-direction: column; gap: 10px; }
  .da-tag-selected { order: -1; position: sticky; top: 0; z-index: 1; padding: 10px; }
  .da-selected-list { max-height: 19vh; }
  .da-tag-find .da-results { max-height: 26vh; }
  .da-tag-selected .da-wide { margin-top: 8px; }
  .da-zone-picker { inset: auto !important; bottom: 12px !important; left: 12px !important; width: calc(100vw - 24px); max-height: none; border-radius: 16px; box-sizing: border-box; }
}

@media (max-width: 760px) {
  .da-wrap { grid-template-columns: 1fr; gap: 10px; }
  .da-gallery { grid-template-columns: 1fr; }
  .da-mapcard { padding: 6px; }
  .da-map { height: 46vh; max-height: none; aspect-ratio: auto !important; }
  .da-zoom { top: 12px; inset-inline-end: 12px; }
  .da-side { max-height: none; }
  .da-seg button { padding: 7px 10px; font-size: 13px; }
  .da-note { flex-basis: 100%; font-size: 11px; }
  .da-tip { inset-inline: 0; top: auto !important; bottom: 0; left: 0 !important; width: auto; max-width: none; max-height: 46vh; padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px)); border-radius: 20px 20px 0 0; pointer-events: auto; }
  .da-tip-close { display: block; }
  .da-field { grid-template-columns: minmax(0, 1fr) auto auto; }
  .da-tag-actions > button { flex: 1 1 auto; }
}

/* ---- 平面图编辑器（2026-09-21 第三段）：上传截图 → 自动识别 → 在图上增删改 → 保存 ---- */
.da-bar-spacer, .dpe-spacer { flex: 1 1 auto; }
.dpe-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.dpe-bar .da-btn:disabled { opacity: .45; cursor: default; }
.dpe-tools button { padding: 7px 10px; font-size: 13px; }
.dpe-map { cursor: default; }
.dpe-map.is-drawing { cursor: crosshair; }
.dpe-fixture { cursor: move; }
.dpe-map.is-drawing .dpe-fixture { cursor: crosshair; }
.dpe-handle { cursor: nwse-resize; }
.dpe-handle[data-handle="ne"], .dpe-handle[data-handle="sw"] { cursor: nesw-resize; }
.dpe-drop { display: grid; place-content: center; justify-items: center; gap: 6px; width: 100%; height: 100%; min-height: 260px; border: 2px dashed #c9ccd3; border-radius: 12px; background: #fafafb; color: var(--muted); cursor: pointer; }
.dpe-drop svg { width: 36px; height: 36px; }
.dpe-drop strong { color: var(--ink, #19191b); font-size: 15px; }
.dpe-name { width: 100%; min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; font-weight: 700; }
.dpe-inline { grid-template-columns: minmax(0, 1fr) auto; }
.dpe-inline select, .dpe-inline input[type="number"] { min-height: 40px; min-width: 96px; padding: 0 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 14px; }
.dpe-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 14px; font-size: 13.5px; }
.dpe-checks label { display: inline-flex; align-items: center; gap: 6px; }
.dpe-checks input { width: 18px; height: 18px; accent-color: var(--red); }
.dpe-calibrate { display: inline-flex; align-items: center; gap: 6px; }
.dpe-calibrate input { width: 74px; min-width: 0 !important; }
.dpe-calibrate i { color: var(--muted); font-style: normal; font-size: 12.5px; }
.dpe-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.dpe-danger { color: var(--danger, #d92d20); }
.dpe-steps { margin: 4px 0 10px; padding-inline-start: 20px; color: var(--ink, #19191b); font-size: 13px; line-height: 1.9; }
.dpe-warn-text { color: #b55d00; }
.dpe-zones { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin: 10px 0; }
.dpe-zones button { position: relative; min-height: 42px; border: 2px solid transparent; border-radius: 11px; background: color-mix(in srgb, var(--zone) 16%, #fff); color: var(--zone); font-size: 15px; font-weight: 800; cursor: pointer; }
.dpe-zones button.on { border-color: var(--zone); background: var(--zone); color: #fff; }
.dpe-zones small { position: absolute; top: 2px; inset-inline-end: 5px; font-size: 10px; font-weight: 700; opacity: .85; }
@media (max-width: 760px) {
  .dpe-tools { order: 5; flex-basis: 100%; }
  .dpe-actions { grid-template-columns: 1fr 1fr 1fr; }
}
