/* ==========================================================================
   映山红酒店 · 全景页品牌外壳
   在不改动 krpano 内核的前提下，为漫游页增加品牌顶栏、加载动画与界面统一
   ========================================================================== */

:root {
  --p-brand: #DA2233;
  --p-ink: #FFFFFF;
  --p-serif: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif SC", Georgia, serif;
  --p-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

html,
body {
  background: #0B0A09;
  -webkit-tap-highlight-color: transparent;
}

/* krpano 画布铺满，且位于所有装饰层之下 */
#pano {
  position: relative;
  z-index: 1;
}

/* 隐藏 krpano 自带的左上角 logo 图层。
   它是 CSS 背景图图层，XML 里 visible="false" 对它无效，只能用 CSS 压制。
   品牌标识统一由 .pano-bar 承载，避免与场景名重叠。 */
#pano div[style*="logo.png"] {
  display: none !important;
}

/* 缩略图上的场景名：krpano 用 div 的背景图 + 直接文本节点实现，
   白字压在浅色场景图上几乎看不清。用多重实心阴影模拟一圈描边，
   比单层大模糊阴影更锐利，不会把字糊成一团。
   只改文字渲染，不动尺寸与定位，避免破坏 scrollarea 的布局计算。 */
#pano div[style*="thumb.jpg"] {
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 1), 0 -1px 1px rgba(0, 0, 0, 0.9),
    1px 0 1px rgba(0, 0, 0, 0.9), -1px 0 1px rgba(0, 0, 0, 0.9),
    0 0 4px rgba(0, 0, 0, 0.85);
}

/* 书屋这套模板的 tour.xml 里 thumbs_text 走的是皮肤内联样式，
   krpano 会给文字 div 直接写 background-color:rgba(0,0,0,0.6)——
   那条灰黑色带就是它，正是用户看到的「阴影」。这里强制清掉，
   靠上面的多重描边保证白字在亮画面上依然清楚。 */
#pano div[style*="thumb.jpg"] div[style*="background-color:rgba(0,0,0"] {
  background-color: transparent !important;
}

/* ---------- 加载动画 ---------- */
.pano-loading {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 45%, #1C1917 0%, #0B0A09 70%);
  transition: opacity 0.7s ease, visibility 0.7s;
}

.pano-loading.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pano-loading__logo {
  font-family: var(--p-serif);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 500;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: #fff;
  opacity: 0;
  animation: panoFadeUp 1s ease-out 0.15s forwards;
}

.pano-loading__en {
  margin-top: 10px;
  font-family: var(--p-sans);
  font-size: 10px;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: rgba(255, 255, 255, 0.45);
  opacity: 0;
  animation: panoFadeUp 1s ease-out 0.3s forwards;
}

.pano-loading__bar {
  position: relative;
  width: 132px;
  height: 1px;
  margin-top: 34px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.pano-loading__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--p-brand);
  transform: translateX(-100%);
  animation: panoProgress 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.pano-loading__scene {
  margin-top: 20px;
  font-family: var(--p-sans);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  color: rgba(255, 255, 255, 0.5);
  opacity: 0;
  animation: panoFadeUp 1s ease-out 0.45s forwards;
}

@keyframes panoFadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes panoProgress {
  0% {
    transform: translateX(-100%);
  }
  55% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ---------- 顶部品牌栏 ---------- */
.pano-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 26px);
  height: 72px;
  padding: 0 clamp(14px, 3vw, 30px);
  pointer-events: none;
  /* 上方渐变压暗，保证白字可读，同时不遮住画面主体 */
  background: linear-gradient(
    to bottom,
    rgba(8, 7, 6, 0.68) 0%,
    rgba(8, 7, 6, 0.34) 55%,
    rgba(8, 7, 6, 0) 100%
  );
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.8s ease 0.35s, transform 0.9s cubic-bezier(0.16, 0.84, 0.44, 1) 0.35s;
}

.pano-bar.is-ready {
  opacity: 1;
  transform: none;
}

.pano-bar > * {
  pointer-events: auto;
}

.pano-bar__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 15px 0 12px;
  font-family: var(--p-sans);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.94);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  white-space: nowrap;
}

.pano-bar__back svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  transition: transform 0.35s cubic-bezier(0.16, 0.84, 0.44, 1);
}

.pano-bar__back:hover {
  color: #fff;
  background: var(--p-brand);
  border-color: var(--p-brand);
}

.pano-bar__back:hover svg {
  transform: translateX(-3px);
}

.pano-bar__divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.22);
  flex: 0 0 auto;
}

.pano-bar__title {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.pano-bar__name {
  font-family: var(--p-serif);
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.25;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pano-bar__en {
  font-family: var(--p-sans);
  font-size: 9.5px;
  line-height: 1.3;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  /* 0.5 在亮画面上几乎看不清，提到 0.66 */
  color: rgba(255, 255, 255, 0.66);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 底部提示（首次进入的拖拽引导） ---------- */
.pano-hint {
  position: fixed;
  left: 50%;
  bottom: 108px;
  z-index: 4500;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  font-family: var(--p-sans);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  border-radius: 999px;
  background: rgba(12, 10, 9, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transform: translate(-50%, 10px);
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
  pointer-events: none;
}

.pano-hint.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.pano-hint.is-hide {
  opacity: 0;
  transform: translate(-50%, 8px);
}

.pano-hint svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--p-brand);
}

/* 首次进入时，鼠标左右拖拽的动画指示 */
.pano-hint__arrows {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  animation: panoSwipe 2.2s ease-in-out infinite;
}

@keyframes panoSwipe {
  0%,
  100% {
    transform: translateX(-3px);
  }
  50% {
    transform: translateX(3px);
  }
}

/* ---------- 底部渐变，衬托缩略图栏 ---------- */
.pano-vignette {
  position: fixed;
  left: 0;
  right: 0;
  /* 抬到缩略图栏之上，避免压暗缩略图与场景名 */
  bottom: 70px;
  z-index: 4000;
  height: 190px;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(8, 7, 6, 0) 0%,
    rgba(8, 7, 6, 0.32) 28%,
    rgba(8, 7, 6, 0.28) 62%,
    rgba(8, 7, 6, 0) 100%
  );
  opacity: 0;
  transition: opacity 0.8s ease 0.4s;
}

.pano-vignette.is-ready {
  opacity: 1;
}

/* ---------- 窄屏适配 ---------- */
@media (max-width: 640px) {
  .pano-bar {
    height: 58px;
    gap: 10px;
  }

  .pano-bar__back {
    height: 34px;
    padding: 0 12px 0 10px;
    font-size: 12px;
  }

  .pano-bar__back span {
    display: none; /* 窄屏只留箭头，把空间让给场景名 */
  }

  .pano-bar__en {
    display: none;
  }

  .pano-bar__name {
    font-size: 0.92rem;
    letter-spacing: 0.1em;
  }

  .pano-hint {
    bottom: 96px;
    font-size: 11.5px;
    padding: 8px 14px;
  }

  .pano-vignette {
    height: 150px;
  }
}

/* 尊重系统的减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  .pano-loading__logo,
  .pano-loading__en,
  .pano-loading__scene,
  .pano-loading__bar::after,
  .pano-hint__arrows {
    animation: none;
    opacity: 1;
  }

  .pano-bar,
  .pano-vignette {
    transition-duration: 0.001ms;
    transition-delay: 0ms;
  }
}
