/* 室内瓷砖 3D 全景总展厅 · 建E网级克制毛玻璃 UI
 * 严守原色铁律：严禁对 #pano-canvas-wrap 或 canvas 添加任何 CSS filter / 叠加色层
 */
:root {
  --glass-bg: rgba(17, 19, 24, 0.72);
  --glass-bg-strong: rgba(15, 17, 22, 0.88);
  --glass-border: rgba(255, 255, 255, 0.13);
  --glass-border-hi: rgba(220, 186, 126, 0.55);
  --text-main: #f4f5f7;
  --text-sub: rgba(235, 238, 245, 0.72);
  --text-muted: rgba(215, 220, 232, 0.52);
  --gold: #dfc088;
  --gold-soft: rgba(223, 192, 136, 0.18);
  --teal: #6fd3be;
  --shadow-hud: 0 10px 30px rgba(0, 0, 0, 0.36);
  --radius-lg: 16px;
  --radius-pill: 999px;
  --font-sans: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #101216;
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* 画布零滤镜原色直出 */
#pano-canvas-wrap {
  position: fixed;
  inset: 0;
  z-index: 1;
  cursor: grab;
  touch-action: none;
}
#pano-canvas-wrap.dragging {
  cursor: grabbing;
}
#pano-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  filter: none !important;
}

/* 主视口 2D 方位实景大图（严禁滤镜，保持 sRGB 原色） */
.still-stage {
  position: fixed;
  inset: 0;
  z-index: 5;
  background: #0c0e13;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}
.still-stage.dragging {
  cursor: grabbing;
}
.still-stage img {
  max-width: 96vw;
  max-height: calc(100dvh - 156px);
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  pointer-events: none;
  filter: none !important;
  border-radius: 6px;
}

.hud-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(135%);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-hud);
}

.hidden {
  display: none !important;
}

/* ==================== 3D 空间悬浮瓷砖热点 ==================== */
#hotspots-layer {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
}
#hotspots-layer.spots-hidden {
  display: none;
}

.pano-hotspot {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s ease;
  padding: 4px;
}

.pano-hotspot .hs-dot-wrap {
  position: relative;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.pano-hotspot .hs-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  animation: hsPulse 2.2s cubic-bezier(0.2, 0.7, 0.2, 1) infinite;
}

.pano-hotspot .hs-core {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(18, 22, 28, 0.78);
  box-shadow: 0 0 0 2px rgba(223, 192, 136, 0.7), 0 2px 8px rgba(0,0,0,0.5);
  transition: transform 0.2s ease, background 0.2s ease;
}

.pano-hotspot:hover .hs-core {
  transform: scale(1.22);
  background: var(--gold);
}

.pano-hotspot .hs-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 5px 9px;
  border-radius: var(--radius-pill);
  background: rgba(16, 18, 24, 0.76);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.38);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.pano-hotspot:hover .hs-pill {
  background: rgba(24, 27, 34, 0.92);
  border-color: var(--glass-border-hi);
  transform: translateY(-1px);
}

.hs-role {
  color: var(--gold);
  font-weight: 600;
}
.hs-code {
  color: #f6f7f9;
  font-weight: 500;
}
.hs-arrow {
  color: rgba(255,255,255,0.55);
  font-size: 11px;
}

@keyframes hsPulse {
  0%   { transform: scale(0.55); opacity: 0.95; }
  75%  { transform: scale(1.45); opacity: 0; }
  100% { transform: scale(1.45); opacity: 0; }
}

/* ==================== 左侧可伸缩多户型抽屉 ==================== */
.house-edge-btn {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 10px 12px;
  border-radius: 0 14px 14px 0;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-left: none;
  color: var(--text-main);
  cursor: pointer;
  box-shadow: 6px 8px 28px rgba(0, 0, 0, 0.42);
  transition: left 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s, background 0.2s;
}
.house-edge-btn:hover {
  border-color: var(--glass-border-hi);
  background: rgba(24, 27, 34, 0.95);
}
.house-edge-btn.shifted {
  left: 342px;
}
.edge-icon {
  font-size: 15px;
  color: var(--gold);
}
.edge-text {
  writing-mode: vertical-rl;
  letter-spacing: 3px;
  font-size: 13px;
  font-weight: 600;
}
.edge-badge {
  font-size: 11px;
  font-weight: 700;
  color: #16181d;
  background: var(--gold);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
}

.house-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 342px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: rgba(14, 16, 21, 0.92);
  backdrop-filter: blur(22px) saturate(135%);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
  border-right: 1px solid var(--glass-border);
  box-shadow: 14px 0 40px rgba(0, 0, 0, 0.52);
  transform: translateX(-102%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.house-drawer.open {
  transform: translateX(0);
}

.house-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}
.drawer-kicker {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 3px;
}
.drawer-title {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.count-pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--gold-soft);
  color: var(--gold);
  border: 1px solid rgba(223, 192, 136, 0.35);
}

.house-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.house-list::-webkit-scrollbar { width: 5px; }
.house-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 99px; }

.house-card {
  width: 100%;
  text-align: left;
  padding: 12px 13px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.house-card:hover {
  background: rgba(255, 255, 255, 0.085);
  border-color: rgba(255, 255, 255, 0.22);
}
.house-card.active {
  background: linear-gradient(135deg, rgba(223, 192, 136, 0.17), rgba(223, 192, 136, 0.05));
  border-color: var(--glass-border-hi);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}

.hc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.hc-idx {
  font-size: 11px;
  color: var(--gold);
  font-weight: 700;
  margin-right: 4px;
}
.hc-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
.hc-area {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-sub);
  flex-shrink: 0;
}
.house-card.active .hc-area {
  background: var(--gold);
  color: #14161a;
  font-weight: 600;
}
.hc-meta {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.4;
}
.hc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 1px;
}
.hc-chip {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}
.hc-chip.dim-chip {
  color: #b7e6da;
  background: rgba(111, 211, 190, 0.12);
}

.house-drawer-foot {
  padding: 11px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* ==================== 顶部 HUD ==================== */
.top-left-hud {
  position: fixed;
  top: 16px;
  left: 18px;
  z-index: 15;
  padding: 11px 16px;
  border-radius: var(--radius-lg);
  max-width: min(46vw, 540px);
}
.tl-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.project-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.area-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--gold-soft);
  color: var(--gold);
  border: 1px solid rgba(223, 192, 136, 0.35);
}
.color-lock-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(111, 211, 190, 0.14);
  color: var(--teal);
  border: 1px solid rgba(111, 211, 190, 0.3);
}
.tl-sub {
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-right-hud {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.tool-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border-radius: 13px;
  pointer-events: auto;
}

.tb-txt-mini {
  display: none;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.tool-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
}
.tool-btn.active {
  background: rgba(223, 192, 136, 0.18);
  border-color: rgba(223, 192, 136, 0.5);
  color: var(--gold);
}
/* 右上角 3 个核心功能按钮各自独立鲜明配色 */
.tool-btn.btn-cad-blue {
  background: rgba(29, 78, 216, 0.42);
  border-color: rgba(56, 189, 248, 0.72);
  color: #e0f2fe;
  font-weight: 600;
}
.tool-btn.btn-cad-blue:hover {
  background: rgba(29, 78, 216, 0.62);
  border-color: #7dd3fc;
  color: #ffffff;
}
.tool-btn.btn-tile-amber {
  background: rgba(180, 83, 9, 0.42);
  border-color: rgba(251, 191, 36, 0.72);
  color: #fef3c7;
  font-weight: 600;
}
.tool-btn.btn-tile-amber:hover {
  background: rgba(180, 83, 9, 0.62);
  border-color: #fcd34d;
  color: #ffffff;
}
.tool-btn.btn-gal-emerald {
  background: rgba(4, 120, 87, 0.42);
  border-color: rgba(52, 211, 153, 0.72);
  color: #d1fae5;
  font-weight: 600;
}
.tool-btn.btn-gal-emerald:hover {
  background: rgba(4, 120, 87, 0.62);
  border-color: #6ee7b7;
  color: #ffffff;
}
.tool-btn.icon-only {
  width: 34px;
  padding: 0;
  justify-content: center;
  font-size: 15px;
}
.tb-sep {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.14);
  margin: 0 2px;
}
.dot-ind {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
}
.tool-btn.active .dot-ind {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

/* ==================== 右上实时方位罗盘 ==================== */
.compass-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 9px;
  border-radius: 13px;
  pointer-events: auto;
}
.compass-dial {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}
.compass-svg {
  width: 100%;
  height: 100%;
}
.c-ring {
  fill: rgba(0, 0, 0, 0.28);
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 1.2;
}
.c-ring-inner {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}
.c-dir {
  fill: rgba(255, 255, 255, 0.52);
  font-size: 7.5px;
  font-weight: 600;
  text-anchor: middle;
}
.c-n {
  fill: var(--gold);
  font-weight: 700;
}
.c-fov-cone {
  fill: rgba(223, 192, 136, 0.3);
}
.c-needle {
  stroke: var(--gold);
  stroke-width: 1.8;
  stroke-linecap: round;
}
.c-center {
  fill: #fff;
  stroke: var(--gold);
  stroke-width: 1.4;
}
.compass-kicker {
  font-size: 10px;
  color: var(--text-muted);
}
.compass-main {
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  margin-top: 1px;
}
.compass-deg {
  font-size: 11px;
  color: var(--gold);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* ==================== 底部居中悬浮控制坞（全景+方位实景条 + 分离双胶囊） ==================== */
.bottom-dock-wrap {
  position: fixed;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: calc(100vw - 20px);
  pointer-events: none;
}

/* 顶部排：🌐 360°全景 + 3 张各方位实景缩略切换栏 */
.view-mode-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 12px;
  background: rgba(15, 17, 23, 0.72);
  backdrop-filter: blur(14px) saturate(135%);
  -webkit-backdrop-filter: blur(14px) saturate(135%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.34);
  pointer-events: auto;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.view-mode-bar::-webkit-scrollbar {
  display: none;
}

.vm-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 2px 10px 2px 4px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-sub);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.16s ease;
}
.vm-btn.vm-pano {
  padding: 2px 11px;
}
.vm-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.vm-btn.active {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.42);
  color: #fff;
  font-weight: 600;
}
.vm-btn.vm-pano.active {
  background: rgba(2, 132, 199, 0.34);
  border-color: rgba(56, 189, 248, 0.72);
  color: #e0f2fe;
}
.vm-thumb {
  width: 34px;
  height: 24px;
  border-radius: 5px;
  object-fit: cover;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: #1b1f27;
}

/* 底部双独立分离胶囊行（左侧站位胶囊 + 右侧方案胶囊，留 16px 明显间距） */
.bottom-capsules-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  max-width: 100%;
  pointer-events: none;
}

.station-capsule,
.scheme-capsule {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 5px;
  border-radius: 13px;
  pointer-events: auto;
  flex-shrink: 0;
}

.station-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}
.station-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.st-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.station-btn.st-a .st-dot {
  background: #38bdf8;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.8);
}
.station-btn.st-b .st-dot {
  background: #2dd4bf;
  box-shadow: 0 0 6px rgba(45, 212, 191, 0.8);
}
/* 站位 A 激活态：天际蓝 */
.station-btn.st-a.active {
  background: rgba(2, 132, 199, 0.44);
  border-color: #38bdf8;
  color: #e0f2fe;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.36);
}
/* 站位 B 激活态：通透青碧绿 */
.station-btn.st-b.active {
  background: rgba(13, 148, 136, 0.44);
  border-color: #2dd4bf;
  color: #ccfbf1;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(13, 148, 136, 0.36);
}

/* 方案按钮：紧凑双行清晰展示（上行方案系列，下行墙/地砖型号） */
.scheme-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  height: 36px;
  padding: 2px 11px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}
.scheme-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.scheme-btn.active {
  background: linear-gradient(135deg, rgba(217, 172, 92, 0.34), rgba(180, 130, 56, 0.18));
  border-color: rgba(236, 200, 128, 0.78);
  color: #fffbeb;
  box-shadow: 0 0 12px rgba(217, 172, 92, 0.25);
}
.scheme-btn strong {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
}
.scheme-btn small {
  font-size: 10px;
  color: rgba(226, 232, 240, 0.66);
  line-height: 1.2;
  margin-top: 1px;
}
.scheme-btn.active small {
  color: #fde68a;
}

/* ==================== 右侧滑出抽屉（瓷砖原图 / 静帧色准） ==================== */
.side-drawer {
  position: fixed;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: 410px;
  max-width: calc(100vw - 32px);
  z-index: 35;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: rgba(15, 17, 23, 0.94);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: -12px 10px 44px rgba(0, 0, 0, 0.56);
  overflow: hidden;
}
.side-drawer-wide {
  width: min(680px, calc(100vw - 40px));
}

.side-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.16s;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* 瓷砖元素图直出视图（无裁切自由缩放 + 底部规格说明） */
.tile-elem-stage {
  flex: 1;
  min-height: 220px;
  background: #0c0e13;
  padding: 10px;
}
.tile-elem-stage img {
  max-width: 96%;
  max-height: 96%;
  object-fit: contain;
  border-radius: 6px;
  filter: none !important;
}
.tile-elem-specs {
  flex-shrink: 0;
  padding: 12px 15px 14px;
  background: rgba(255, 255, 255, 0.035);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tile-elem-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.tile-elem-title-group {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.tile-code {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.tile-size {
  font-size: 12px;
  font-weight: 600;
  color: var(--teal);
  background: rgba(111, 211, 190, 0.13);
  padding: 2px 8px;
  border-radius: 6px;
}
.tile-series {
  font-size: 12.5px;
  color: var(--gold);
  font-weight: 500;
}
.tile-specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.ts-item {
  background: rgba(255, 255, 255, 0.045);
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 11.5px;
  color: var(--text-sub);
}
.ts-item b {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 2px;
}

.color-check-cta {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--glass-border-hi);
  background: linear-gradient(135deg, rgba(223, 192, 136, 0.2), rgba(223, 192, 136, 0.08));
  color: #fff6e4;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.18s;
}
.color-check-cta:hover {
  background: linear-gradient(135deg, rgba(223, 192, 136, 0.34), rgba(223, 192, 136, 0.14));
}

/* 铺贴与色卡核对抽屉（直接自由缩放拖拽） */
.gallery-tabs {
  display: flex;
  gap: 6px;
  padding: 9px 14px;
  overflow-x: auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.gal-tab {
  padding: 6px 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-sub);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}
.gal-tab.active {
  background: var(--gold-soft);
  border-color: var(--glass-border-hi);
  color: var(--gold);
  font-weight: 600;
}
.gal-viewport {
  flex: 1;
  min-height: 0;
  background: #0c0e12;
  padding: 10px;
}
.gal-viewport img {
  max-width: 96%;
  max-height: 96%;
  object-fit: contain;
  border-radius: 6px;
  filter: none !important;
}

/* ==================== CAD 原图 vs 俯视排砖全屏双栏弹窗 ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(7, 9, 13, 0.84);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.cad-modal-shell {
  width: 100%;
  height: 100%;
  max-width: 1760px;
  max-height: 1040px;
  border-radius: 18px;
  background: #12151c;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cad-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.cad-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cad-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--gold);
  color: #14161b;
}
.cad-modal-head h2 {
  font-size: 15.5px;
  font-weight: 600;
}
.cad-sub {
  font-size: 12px;
  color: var(--text-sub);
}
.cad-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cad-tip {
  font-size: 11.5px;
  color: var(--text-muted);
}

.cad-compare-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px;
  background: #0d1016;
}
.cad-compare-grid.solo-left {
  grid-template-columns: 1fr;
}
.cad-compare-grid.solo-left #pane-ortho {
  display: none;
}
.cad-compare-grid.solo-right {
  grid-template-columns: 1fr;
}
.cad-compare-grid.solo-right #pane-cad {
  display: none;
}

.cad-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #161a22;
  overflow: hidden;
}
.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.035);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.pane-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.pane-tag {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.tag-cad {
  background: rgba(96, 165, 250, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.35);
}
.tag-ortho {
  background: rgba(223, 192, 136, 0.18);
  color: var(--gold);
  border: 1px solid rgba(223, 192, 136, 0.4);
}
.pane-file {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pane-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.zoom-readout {
  font-size: 11.5px;
  color: var(--gold);
  min-width: 42px;
  text-align: right;
  margin-right: 3px;
  font-variant-numeric: tabular-nums;
}
.z-mini {
  height: 26px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-size: 11.5px;
  cursor: pointer;
}
.z-mini:hover {
  background: rgba(255, 255, 255, 0.16);
}

.cad-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.cad-mode-switch .z-mini {
  border-color: transparent;
  background: transparent;
}
.cad-mode-switch .z-mini.active {
  background: var(--gold-soft);
  border-color: var(--glass-border-hi);
  color: var(--gold);
  font-weight: 600;
}

.panzoom-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  background: #0b0d12;
  touch-action: none;
}
.panzoom-stage.dragging {
  cursor: grabbing;
}
.panzoom-stage img {
  max-width: 96%;
  max-height: 96%;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  pointer-events: none;
}

.cad-checklist-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  overflow-x: auto;
}
.checklist-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--teal);
  white-space: nowrap;
}
.checklist-items {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.chk-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11.5px;
  color: var(--text-sub);
  white-space: nowrap;
}
.chk-pill b {
  color: #fff;
  font-weight: 600;
}
.chk-ok {
  color: var(--teal);
  font-weight: 700;
}

/* Lightbox */
.lightbox-shell {
  width: min(1320px, 94vw);
  height: min(880px, 90vh);
  border-radius: 16px;
  background: #12151c;
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.lightbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.lightbox-title {
  font-size: 14px;
  font-weight: 600;
}
.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 加载提示 */
.loading-overlay {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-radius: 14px;
  background: rgba(14, 16, 22, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 13px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.22);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .top-left-hud { max-width: 52vw; }
  .cad-tip { display: none; }
}

/* ==================== 手机竖屏 & 微信内置浏览器深度适配 ==================== */
@media (max-width: 768px) {
  .top-left-hud {
    top: calc(8px + env(safe-area-inset-top, 0px));
    left: 8px;
    right: 8px;
    max-width: none;
    padding: 7px 11px;
    border-radius: 12px;
  }
  .project-name { font-size: 13.5px; }
  .area-tag { font-size: 10px; padding: 1px 6px; }
  .color-lock-tag { font-size: 10px; padding: 1px 6px; }
  .tl-sub {
    font-size: 10.5px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .top-right-hud {
    top: calc(64px + env(safe-area-inset-top, 0px));
    left: 8px;
    right: 8px;
    align-items: stretch;
  }
  .compass-card { display: none; }
  .tool-bar {
    width: 100%;
    justify-content: space-between;
    padding: 4px 5px;
    gap: 4px;
    border-radius: 11px;
  }
  .tool-btn {
    height: 30px;
    padding: 0 8px;
    font-size: 11.5px;
    gap: 4px;
    border-radius: 8px;
    flex: 1;
    justify-content: center;
  }
  .tool-btn.icon-only {
    flex: 0 0 30px;
    width: 30px;
  }
  .tb-txt-full { display: none; }
  .tb-txt-mini { display: inline; }
  .tb-sep { display: none; }

  .house-edge-btn {
    top: 46%;
    bottom: auto;
    transform: translateY(-50%);
    flex-direction: column;
    gap: 5px;
    padding: 9px 6px;
    border-radius: 0 11px 11px 0;
  }
  .house-edge-btn.shifted { left: min(82vw, 310px); }
  .edge-text {
    writing-mode: vertical-rl;
    letter-spacing: 1.5px;
    font-size: 11px;
  }
  .edge-badge { font-size: 10px; padding: 1px 5px; }
  .house-drawer { width: min(82vw, 310px); }

  .bottom-dock-wrap {
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 14px);
    max-width: calc(100vw - 14px);
    gap: 5px;
  }
  .view-mode-bar {
    padding: 3px 4px;
    gap: 4px;
  }
  .vm-btn {
    height: 26px;
    font-size: 10.5px;
    padding: 2px 7px 2px 3px;
  }
  .vm-btn.vm-pano { padding: 2px 8px; }
  .vm-thumb { width: 28px; height: 20px; }

  .bottom-capsules-row {
    flex-direction: column;
    gap: 5px;
    width: 100%;
  }
  .station-capsule {
    padding: 3px 4px;
    border-radius: 10px;
  }
  .station-btn {
    height: 26px;
    padding: 0 10px;
    font-size: 11px;
  }
  .scheme-capsule {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 3px 4px;
    border-radius: 10px;
  }
  .scheme-capsule::-webkit-scrollbar { display: none; }
  .scheme-btn {
    height: 32px;
    padding: 2px 8px;
  }
  .scheme-btn strong { font-size: 11px; }
  .scheme-btn small { font-size: 9.5px; }

  .still-stage img {
    max-height: calc(100dvh - 210px);
  }

  .pano-hotspot .hs-pill {
    padding: 4px 8px;
    font-size: 11px;
  }

  .side-drawer, .side-drawer-wide {
    top: calc(8px + env(safe-area-inset-top, 0px));
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: none;
    border-radius: 14px;
  }

  .modal-backdrop {
    padding: 6px;
    padding-top: calc(6px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .cad-modal-shell {
    border-radius: 13px;
  }
  .cad-modal-head {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 9px 11px;
  }
  .cad-modal-head h2 { font-size: 13.5px; }
  .cad-sub, .cad-badge { display: none; }
  .cad-head-actions {
    justify-content: space-between;
    gap: 6px;
  }
  .cad-head-actions .tool-btn {
    flex: 0 0 auto;
    height: 28px;
    padding: 0 9px;
  }
  .cad-compare-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 8px;
    padding: 8px;
  }
  .cad-compare-grid.solo-left,
  .cad-compare-grid.solo-right {
    grid-template-rows: 1fr;
  }
  .pane-head { padding: 6px 9px; }
  .pane-file { display: none; }
  .cad-checklist-bar {
    padding: 7px 10px;
    gap: 8px;
  }
  .checklist-items { flex-wrap: nowrap; }
  .chk-pill { font-size: 11px; padding: 3px 8px; }
}
