/* 微沙盘 · 大图查看器样式（共享模块）
 * ------------------------------------------------------------------
 * 视觉语言跟 pano-view.css 的 hotspots 保持一致：
 *   胶囊 = 黑色 50% 底 + 白字 + 圆角 12 + **底边 1px 主题色**
 *        （krpano 原版是 bgshadow "0 1 0 <色> 1"，CSS 就是 box-shadow）
 *   锚点 = 白色小圆点 + 一圈半透明黑描边
 * 这样区位图上的热点和全景里的标注看起来是同一套东西。
 * ------------------------------------------------------------------ */

.bv {
  position: relative;
  width: 100%;
  /* 高度由图片宽高比决定，跟原案例"地图铺满宽度"一致 */
  aspect-ratio: var(--bv-ar, 1.6);
  overflow: hidden;
  background: #f4f1ec;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.bv.bv-grab { cursor: grabbing; }

/* 世界层：尺寸 = 源图像素，缩放平移只在这一层上做一次 */
.bv-world {
  position: absolute; left: 0; top: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.bv-view {
  position: absolute; left: 0; top: 0;
  width: 100%; height: 100%;
  display: block;
  /* 第一层：屏幕尺寸整图。先出来先清晰 */
}
.bv-view[src=""] { visibility: hidden; }

/* 第二层：放大时才挂上来的瓦片 */
.bv-tile {
  position: absolute;
  display: block;
  opacity: 0;
  transition: opacity .18s ease;
  pointer-events: none;
}
.bv-tile.on { opacity: 1; }

/* 热点覆盖层：不跟 world 一起缩放，所以字不会变大 */
.bv-spots {
  position: absolute; left: 0; top: 0;
  transform-origin: 0 0;
  pointer-events: none;
}
.bv-spot {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center;
  pointer-events: auto;
  cursor: pointer;
  /* 细线小点用手点不中，用 flex + 内边距把热区撑起来 */
  padding: 4px;
}
.bv-spot-label {
  display: inline-flex; align-items: center;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  border-radius: 12px;
  font-size: 12px; line-height: 16px;
  white-space: nowrap;
  padding: 1px 8px;
  /* 主题色 = 胶囊底边那 1px 色边 */
  box-shadow: 0 1px 0 0 var(--c, #c8552e);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .45);
}
.bv-spot-dot {
  position: absolute; left: 50%; top: 50%;
  width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--c, #c8552e);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .95), 0 0 6px rgba(0, 0, 0, .35);
  opacity: 0;
}
/* 只有锚点、没有标签时（编辑器里编辑某一个点）才显示锚点 */
.bv.anchors-only .bv-spot-label { display: none; }
.bv.anchors-only .bv-spot-dot { opacity: 1; }

.bv-spot.on .bv-spot-label { outline: 2px solid var(--gold, #d8a33a); outline-offset: 1px; }
.bv-spot.on .bv-spot-dot { opacity: 1; }

/* 整图视角下标签会叠成一团 —— 只显示圆点，放大或点选才出标签 */
.bv-dots .bv-spot-label { display: none; }
.bv-dots .bv-spot-dot { opacity: 1; }
/* 但被选中的那个点无论如何都要露出标签，不然用户不知道自己点了啥 */
.bv-dots .bv-spot.on .bv-spot-label { display: inline-flex; }
.bv:not(.bv-dots) .bv-spot-dot { display: none; }

/* ================= 热点图文说明（点位抽屉） ================= */
/* 挂在「整屏不滚动」的宿主上（编辑器/手机页的 #screen），所以 inset:0 = 整屏 */
.ss { position: absolute; inset: 0; z-index: 40; }
.ss-mask {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, .42);
  opacity: 0; transition: opacity .25s ease;
}
.ss.in .ss-mask { opacity: 1; }
.ss-sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: #fff;
  border-radius: 14px 14px 0 0;
  padding: 18px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  max-height: 72%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, .18);
  transform: translateY(102%);
  transition: transform .28s cubic-bezier(.2, .8, .25, 1);
}
.ss.in .ss-sheet { transform: none; }
/* 顶部那道小握把：暗示「可以往下拖」 */
.ss-grip {
  position: absolute; left: 50%; top: 7px;
  width: 34px; height: 3px; margin-left: -17px;
  border-radius: 2px; background: #dcdcdc;
}
.ss-x {
  position: absolute; right: 6px; top: 6px;
  width: 30px; height: 30px;
  border: 0; background: transparent;
  color: #b0b0b0; font-size: 14px; line-height: 1;
  cursor: pointer;
}
/* 分类胶囊：跟地图上标签是同一套视觉（黑 50% 底 + 组色底边） */
.ss-cap {
  display: inline-flex; align-items: center; gap: 6px;
  height: 20px; padding: 0 9px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  font-size: 11px; letter-spacing: .5px;
  box-shadow: 0 1px 0 0 var(--c, #c8552e);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .45);
}
.ss-cap .ss-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--c, #c8552e);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .9);
}
.ss-title {
  margin-top: 10px;
  font-size: 17px; font-weight: 600; letter-spacing: .5px;
  color: #2b2b2b;
  font-family: var(--font-serif, serif);
}
.ss-desc {
  margin-top: 8px;
  font-size: 13px; line-height: 1.8; color: #5a5a5a;
}
.ss-desc p { margin: 0 0 6px; }
.ss-desc p:last-child { margin-bottom: 0; }
.ss-img {
  display: block; width: 100%; height: auto;
  margin-top: 12px; border-radius: 8px;
}

/* 缩放按钮 */
.bv-tools {
  position: absolute; right: 8px; top: 8px;
  display: flex; flex-direction: column; gap: 6px;
  z-index: 5;
}
.bv-btn {
  width: 30px; height: 30px;
  border: 0; border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  color: #3b3b3b;
  font-size: 16px; line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.bv-btn:active { background: #fff; transform: scale(.94); }

.bv-hint {
  position: absolute; left: 50%; bottom: 10px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, .42);
  color: #fff;
  font-size: 11px; line-height: 18px;
  padding: 1px 10px; border-radius: 9px;
  pointer-events: none;
  white-space: nowrap;
  opacity: 1;
  transition: opacity .4s ease;
}
/* 用户一操作就把提示淡掉，别一直挡着 */
.bv.bv-used .bv-hint { opacity: 0; }

.bv-loading {
  position: absolute; left: 8px; top: 8px;
  background: rgba(255, 255, 255, .92);
  border-radius: 6px;
  font-size: 11px; color: #666;
  padding: 2px 8px;
  pointer-events: none;
  z-index: 5;
}

/* ================= 区位页整体（四层结构） ================= */
/* 页面宿主：跟 .ph-stage 是兄弟，二选一显示（全景鸟瞰 / 区位介绍） */
.qw-host {
  flex: 1; min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #f8f6f2;
  display: none;
}
.qw-host.on { display: block; }
/* 切到区位页时把全景舞台收起来，不然两个 flex:1 会把屏幕挤成两半。
 * 两个选择器都要：真机页的壳是 .screen，编辑器手机壳是 .phone。 */
.screen.pg-quwei .ph-stage,
.phone.pg-quwei .ph-stage { display: none; }

.qw-page {
  position: relative;
  width: 100%;
  background: #f8f6f2;
}
/* 第一层 背景：宣纸纹样 */
.qw-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center top;
  pointer-events: none;
}
.qw-inner { position: relative; }

/* 第二层 标题：logo + 主标语 */
.qw-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 22px 16px 6px;
}
.qw-head .qw-logo { max-width: 34%; height: auto; display: block; }
.qw-head .qw-slogan { max-width: 62%; height: auto; display: block; }

/* 第三层 地图：上下各一条暖棕细线（案例原样） */
.qw-map-wrap {
  margin: 10px 0 0;
  border-top: 3px solid #aa7d66;
  border-bottom: 3px solid #aa7d66;
  background: #fff;
}

/* ---------- 整图版式（.qw-page.single，默认） ----------
 * 整页就是一张竖屏图，跟案例 xiangmuquwei1 一样：
 * 图按宽度铺满、高度跟着宽高比走（BigView 的 --bv-ar 决定的），
 * 比容器矮时上下居中，露出的部分用纸色接上（图本身上下也是纸色，看不出来接缝）。 */
.qw-page.single {
  display: flex; flex-direction: column;
  min-height: 100%;
}
.qw-page.single .qw-map-wrap {
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  margin: 0;
  border: 0;                      /* 整图里自带上下的暖棕线，别再叠一条 */
  background: transparent;
}
/* 别让 flex 把图压扁：高度就按宽高比来，宁可超出滚动 */
.qw-page.single .qw-map { flex: none; }

/* 分隔装饰 + 文案 */
.qw-divider { display: block; margin: 26px auto 14px; max-width: 34%; height: auto; }
.qw-title { display: block; margin: 0 auto 10px; max-width: 76%; height: auto; }
.qw-desc { display: block; margin: 0 auto; max-width: 82%; height: auto; }
.qw-foot { display: block; margin: 34px auto 26px; max-width: 88%; height: auto; }

/* 编辑器里给可点区域一个提示描边 */
.eq-pick { outline: 1px dashed transparent; border-radius: 4px; }
.eq-pick:hover { outline-color: rgba(28, 147, 250, .55); }
.eq-pick.on { outline: 2px solid var(--gold, #d8a33a); }

/* ================= 欢迎页 ================= */
.wc {
  position: absolute; inset: 0;
  z-index: 60;
  background: #f8f6f2;
  display: flex; flex-direction: column;
  opacity: 1;
  transition: opacity .45s ease;
}
.wc.out { opacity: 0; pointer-events: none; }
/* 底图按「宽 100%」摆放而不是 cover：
 * 这张图是「宣纸 + 效果图带 + 宣纸」的构图，比例 0.5625。
 * 用 cover 的话，容器高矮一变，纸和照片的分界线就上下跑，文字会压到照片上；
 * 按宽度等比缩放后，分界线位置只跟宽度有关（390 宽时在 180.6px），可预测。
 * 图比容器矮时底下露出 .wc 自己的纸色，正好接得上。 */
.wc-bg {
  position: absolute; inset: 0;
  background-size: 100% auto;
  background-position: center top;
  background-repeat: no-repeat;
  /* 图按宽度等比、顶部对齐；图下面空出来的部分就用这个纸色接上 */
  background-color: #f8f6f2;
}
/* 上下纸色蒙版：客户换图后字也读得清。
 * 上蒙版高度用 aspect-ratio 锁死 = 底图纸区高度（1080×500），
 * 所以在纸图分界线上刚好淡到 0，不会把效果图顶端洗白。 */
.wc-scrim { position: absolute; left: 0; right: 0; pointer-events: none; }
.wc-scrim-top {
  top: 0; height: auto;
  aspect-ratio: 1080 / 500;
  background: linear-gradient(180deg,
    rgba(248, 246, 242, .94) 0%,
    rgba(248, 246, 242, .94) 88%,
    rgba(248, 246, 242, 0) 100%);
}
.wc-scrim-bot {
  bottom: 0; height: 22%;
  background: linear-gradient(0deg,
    rgba(248, 246, 242, .95) 0%,
    rgba(248, 246, 242, .95) 62%,
    rgba(248, 246, 242, 0) 100%);
}
/* 文字块 = 底图的宣纸区本身
 * 底图是 1080×1920 的「宣纸 + 效果图带 + 宣纸」，宣纸区高 500/1080。
 * 这里用同一个 aspect-ratio 把文字块钉成宣纸区的大小，再垂直居中，
 * 于是不管手机多宽多窄，logo/楼盘名/标语永远待在纸区里 —— 不会压到效果图上。
 * 之前用 max-width + 固定 padding 时，390 宽的屏幕上只剩 1.2px 余量，窄屏必翻车。 */
.wc-body {
  position: absolute; left: 0; right: 0; top: 0;
  aspect-ratio: 1080 / 500;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 0 6.7%;
  overflow: hidden;
}
.wc-logo { max-width: 42%; height: auto; display: block; margin-bottom: 10px; }
.wc-name {
  font-size: 17px; font-weight: 500; letter-spacing: 3px; line-height: 1.3;
  color: #7a4a2b; font-family: var(--font-serif, serif);
}
.wc-slogan {
  margin-top: 6px;
  font-size: 12px; letter-spacing: 2px; line-height: 1.4; color: #8a6a4a;
}
/* 文字块改成绝对定位后就不占流了，这块要自己钉到底部，否则会顶到最上面 */
.wc-foot {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 0 26px calc(34px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.wc-enter {
  width: 100%; height: 44px;
  border: 1px solid rgba(170, 125, 100, .55);
  background: rgba(255, 255, 255, .72);
  border-radius: 22px;
  color: #7a4a2b; font-size: 14px; letter-spacing: 2px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.wc-enter:active { background: #fff; }
.wc-tip { font-size: 11px; color: #9a8a7a; letter-spacing: 1px; }
.wc-tel {
  font-size: 12px; letter-spacing: 1px; color: #8a6a4a;
  text-decoration: none;
}
.wc-skip {
  position: absolute; right: 14px; top: 14px;
  z-index: 3;
  background: rgba(0, 0, 0, .32);
  color: #fff;
  border: 0; border-radius: 12px;
  font-size: 12px; line-height: 24px;
  padding: 0 12px;
  cursor: pointer;
}
.wc-progress {
  position: absolute; left: 0; bottom: 0;
  height: 2px; width: 0;
  background: rgba(170, 125, 100, .7);
  /* 时长由 welcomeHTML 用 inline animation-duration 传进来 */
  animation-name: wcbar;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}
@keyframes wcbar { from { width: 0; } to { width: 100%; } }
/* 底图还没解码完时先压一层暖色，避免白屏闪一下 */
.wc::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(180deg, #f8f6f2 0%, #efe9e1 100%);
}
