* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

/* 适配手机浏览器地址栏高度变化 */
@supports (height: 100dvh) {
  html,
  body {
    height: 100dvh;
  }
}

/* VR 场景放在底层 */
#vrScene {
  position: fixed;
  inset: 0;
  z-index: 1;
}

/* 普通导入页放在最上层 */
#introOverlay {
  position: fixed;
  inset: 0;
  z-index: 100;

  width: 100vw;
  height: 100vh;

  background: #000;
  overflow: hidden;
}

@supports (height: 100dvh) {
  #introOverlay {
    height: 100dvh;
  }
}

/* 全屏视频 */
#introVideo {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center;
  display: block;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.6s ease;
}

#introVideo.fade-out {
  opacity: 0;
}

/* 全屏图片 */
#introImage {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;

  opacity: 1;
  transition: opacity 0.6s ease;
  cursor: pointer;
}

#introImage.fade-out {
  opacity: 0;
}

/* =========================================================
   中英文剧情弹窗
   ========================================================= */

#storyPopup {
  position: fixed;
  left: 50%;
  bottom: 10%;
  transform: translateX(-50%);
  z-index: 130;

  width: 84%;
  max-width: 980px;
  min-height: 210px;

  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  padding: 28px 42px;

  background: rgba(60, 60, 60, 0.82);

  border: 2px solid #ffd36a;
  border-radius: 24px;

  box-shadow:
    0 0 20px rgba(255, 211, 106, 0.9),
    0 0 38px rgba(255, 211, 106, 0.45),
    inset 0 0 28px rgba(0, 0, 0, 0.45);

  backdrop-filter: blur(4px);
  opacity: 0;

  transition:
    opacity 0.6s ease,
    border-color 0.4s ease,
    box-shadow 0.4s ease;
}

#storyPopup.show {
  display: flex;
  opacity: 1;
}

/* 中文文字：电脑端保留原来的发光描边风格 */
#storyCn {
  font-size: 27px;
  font-weight: 800;
  line-height: 1.65;
  letter-spacing: 1px;
  text-align: center;
  white-space: pre-line;

  color: #ffffff;
  -webkit-text-stroke: 1.2px #ffd36a;

  text-shadow:
    0 0 8px rgba(255, 211, 106, 0.8),
    0 0 16px rgba(255, 211, 106, 0.45),
    0 3px 8px rgba(0, 0, 0, 0.95);

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 英文文字：电脑端稍微细一点 */
#storyEn {
  margin-top: 14px;

  font-size: 19px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.5px;
  text-align: center;
  white-space: pre-line;

  color: #ffffff;
  -webkit-text-stroke: 0.35px #ffd36a;

  text-shadow:
    0 0 7px rgba(255, 211, 106, 0.6),
    0 3px 8px rgba(0, 0, 0, 0.95);

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =========================================================
   图二：沙漠黄色调
   ========================================================= */

#storyPopup.tone-yellow {
  border-color: #ffd36a;
  box-shadow:
    0 0 20px rgba(255, 211, 106, 0.95),
    0 0 38px rgba(255, 211, 106, 0.45),
    inset 0 0 28px rgba(0, 0, 0, 0.45);
}

#storyPopup.tone-yellow #storyCn {
  color: #ffffff;
  -webkit-text-stroke-color: #ffd36a;

  text-shadow:
    0 0 8px rgba(255, 211, 106, 0.8),
    0 0 16px rgba(255, 211, 106, 0.45),
    0 3px 8px rgba(0, 0, 0, 0.95);
}

#storyPopup.tone-yellow #storyEn {
  color: #ffffff;
  -webkit-text-stroke-color: #ffd36a;

  text-shadow:
    0 0 7px rgba(255, 211, 106, 0.6),
    0 3px 8px rgba(0, 0, 0, 0.95);
}

/* =========================================================
   图三：雨林紫色调
   ========================================================= */

#storyPopup.tone-purple {
  border-color: #c99cff;
  box-shadow:
    0 0 20px rgba(201, 156, 255, 0.95),
    0 0 38px rgba(201, 156, 255, 0.45),
    inset 0 0 28px rgba(0, 0, 0, 0.45);
}

#storyPopup.tone-purple #storyCn {
  color: #ffffff;
  -webkit-text-stroke-color: #c99cff;

  text-shadow:
    0 0 8px rgba(201, 156, 255, 0.8),
    0 0 16px rgba(201, 156, 255, 0.45),
    0 3px 8px rgba(0, 0, 0, 0.95);
}

#storyPopup.tone-purple #storyEn {
  color: #ffffff;
  -webkit-text-stroke-color: #c99cff;

  text-shadow:
    0 0 7px rgba(201, 156, 255, 0.6),
    0 3px 8px rgba(0, 0, 0, 0.95);
}

/* =========================================================
   图四：冰川蓝色调
   ========================================================= */

#storyPopup.tone-blue {
  border-color: #8fdcff;
  box-shadow:
    0 0 20px rgba(143, 220, 255, 0.95),
    0 0 38px rgba(143, 220, 255, 0.45),
    inset 0 0 28px rgba(0, 0, 0, 0.45);
}

#storyPopup.tone-blue #storyCn {
  color: #ffffff;
  -webkit-text-stroke-color: #8fdcff;

  text-shadow:
    0 0 8px rgba(143, 220, 255, 0.8),
    0 0 16px rgba(143, 220, 255, 0.45),
    0 3px 8px rgba(0, 0, 0, 0.95);
}

#storyPopup.tone-blue #storyEn {
  color: #ffffff;
  -webkit-text-stroke-color: #8fdcff;

  text-shadow:
    0 0 7px rgba(143, 220, 255, 0.6),
    0 3px 8px rgba(0, 0, 0, 0.95);
}

/* =========================================================
   图五：火山红色调
   ========================================================= */

#storyPopup.tone-red {
  border-color: #ff7b5f;
  box-shadow:
    0 0 20px rgba(255, 123, 95, 0.95),
    0 0 38px rgba(255, 123, 95, 0.5),
    inset 0 0 28px rgba(0, 0, 0, 0.45);
}

#storyPopup.tone-red #storyCn {
  color: #ffffff;
  -webkit-text-stroke-color: #ff7b5f;

  text-shadow:
    0 0 8px rgba(255, 123, 95, 0.8),
    0 0 16px rgba(255, 123, 95, 0.45),
    0 3px 8px rgba(0, 0, 0, 0.95);
}

#storyPopup.tone-red #storyEn {
  color: #ffffff;
  -webkit-text-stroke-color: #ff7b5f;

  text-shadow:
    0 0 7px rgba(255, 123, 95, 0.6),
    0 3px 8px rgba(0, 0, 0, 0.95);
}

/* =========================================================
   图片加载失败提示
   ========================================================= */

#imageError {
  display: none;

  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 150;
  transform: translate(-50%, -50%);

  color: #ffffff;
  text-align: center;
  font-size: 22px;
  line-height: 1.8;

  padding: 24px 32px;
  border: 1px solid rgba(180, 160, 255, 0.8);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.72);
  box-shadow: 0 0 24px rgba(130, 90, 255, 0.8);
}

/* =========================================================
   小 VR 按钮
   ========================================================= */

#enterVRBtn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 160;

  width: 52px;
  height: 52px;

  color: #ffffff;
  font-size: 15px;
  font-weight: 700;

  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);

  cursor: pointer;

  box-shadow:
    0 0 12px rgba(255, 255, 255, 0.35),
    inset 0 0 10px rgba(255, 255, 255, 0.08);
}

#enterVRBtn:hover {
  background: rgba(0, 0, 0, 0.65);
}

/* 进入 VR 后隐藏普通图片层 */
body.vr-active #introOverlay {
  display: none;
}

/* =========================================================
   手机竖屏适配
   重点：去掉文字描边，降低字重，避免发糊
   ========================================================= */

@media screen and (orientation: portrait) and (max-width: 768px) {
  #storyPopup {
    bottom: 8%;
    width: 88%;
    min-height: 170px;
    padding: 20px 22px;
    border-radius: 20px;
  }

  #storyCn,
  #storyPopup.tone-yellow #storyCn,
  #storyPopup.tone-purple #storyCn,
  #storyPopup.tone-blue #storyCn,
  #storyPopup.tone-red #storyCn {
    font-size: 18px !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    letter-spacing: 0.2px !important;

    -webkit-text-stroke: 0 !important;
    text-stroke: 0 !important;

    text-shadow:
      0 1px 3px rgba(0, 0, 0, 0.92) !important;

    color: #ffffff !important;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
  }

  #storyEn,
  #storyPopup.tone-yellow #storyEn,
  #storyPopup.tone-purple #storyEn,
  #storyPopup.tone-blue #storyEn,
  #storyPopup.tone-red #storyEn {
    margin-top: 10px;
    font-size: 12.5px !important;
    font-weight: 400 !important;
    line-height: 1.42 !important;
    letter-spacing: 0.1px !important;

    -webkit-text-stroke: 0 !important;
    text-stroke: 0 !important;

    text-shadow:
      0 1px 3px rgba(0, 0, 0, 0.92) !important;

    color: #ffffff !important;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
  }

  #imageError {
    width: 82%;
    font-size: 16px;
  }

  #enterVRBtn {
    width: 46px;
    height: 46px;
    font-size: 13px;
    right: 14px;
    bottom: 14px;
  }
}

/* =========================================================
   手机横屏适配
   重点：横屏文字更小、更细，不糊
   ========================================================= */

@media screen and (orientation: landscape) and (max-height: 600px) {
  html,
  body {
    width: 100vw;
    height: 100vh;
  }

  @supports (height: 100dvh) {
    html,
    body {
      height: 100dvh;
    }
  }

  #introOverlay {
    width: 100vw;
    height: 100vh;
  }

  @supports (height: 100dvh) {
    #introOverlay {
      height: 100dvh;
    }
  }

  #introVideo,
  #introImage {
    width: 100vw !important;
    height: 100vh !important;
    object-fit: cover !important;
    object-position: center center;
  }

  @supports (height: 100dvh) {
    #introVideo,
    #introImage {
      height: 100dvh !important;
    }
  }

  #storyPopup {
    left: 50%;
    bottom: 4%;
    width: 70%;
    max-width: 760px;
    min-width: 360px;
    min-height: 112px;
    padding: 13px 22px;
    border-radius: 18px;
  }

  #storyCn,
  #storyPopup.tone-yellow #storyCn,
  #storyPopup.tone-purple #storyCn,
  #storyPopup.tone-blue #storyCn,
  #storyPopup.tone-red #storyCn {
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1.38 !important;
    letter-spacing: 0.15px !important;

    -webkit-text-stroke: 0 !important;
    text-stroke: 0 !important;

    text-shadow:
      0 1px 3px rgba(0, 0, 0, 0.92) !important;

    color: #ffffff !important;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
  }

  #storyEn,
  #storyPopup.tone-yellow #storyEn,
  #storyPopup.tone-purple #storyEn,
  #storyPopup.tone-blue #storyEn,
  #storyPopup.tone-red #storyEn {
    margin-top: 7px;
    font-size: 10.5px !important;
    font-weight: 400 !important;
    line-height: 1.28 !important;
    letter-spacing: 0.05px !important;

    -webkit-text-stroke: 0 !important;
    text-stroke: 0 !important;

    text-shadow:
      0 1px 3px rgba(0, 0, 0, 0.92) !important;

    color: #ffffff !important;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
  }

  #imageError {
    width: 62%;
    font-size: 13px;
    line-height: 1.55;
    padding: 14px 20px;
    border-radius: 14px;
  }

  #enterVRBtn {
    width: 42px;
    height: 42px;
    font-size: 12px;
    right: 12px;
    bottom: 12px;
  }
}

/* =========================================================
   超矮横屏手机适配
   部分安卓横屏浏览器高度很小
   ========================================================= */

@media screen and (orientation: landscape) and (max-height: 430px) {
  #storyPopup {
    bottom: 3%;
    width: 66%;
    max-width: 660px;
    min-width: 320px;
    min-height: 92px;
    padding: 10px 18px;
    border-radius: 15px;
  }

  #storyCn,
  #storyPopup.tone-yellow #storyCn,
  #storyPopup.tone-purple #storyCn,
  #storyPopup.tone-blue #storyCn,
  #storyPopup.tone-red #storyCn {
    font-size: 13.5px !important;
    font-weight: 500 !important;
    line-height: 1.28 !important;
    letter-spacing: 0.1px !important;

    -webkit-text-stroke: 0 !important;
    text-stroke: 0 !important;

    text-shadow:
      0 1px 2px rgba(0, 0, 0, 0.92) !important;

    color: #ffffff !important;
  }

  #storyEn,
  #storyPopup.tone-yellow #storyEn,
  #storyPopup.tone-purple #storyEn,
  #storyPopup.tone-blue #storyEn,
  #storyPopup.tone-red #storyEn {
    margin-top: 5px;
    font-size: 9px !important;
    font-weight: 400 !important;
    line-height: 1.22 !important;
    letter-spacing: 0 !important;

    -webkit-text-stroke: 0 !important;
    text-stroke: 0 !important;

    text-shadow:
      0 1px 2px rgba(0, 0, 0, 0.92) !important;

    color: #ffffff !important;
  }

  #imageError {
    width: 60%;
    font-size: 11px;
    padding: 10px 16px;
  }

  #enterVRBtn {
    width: 36px;
    height: 36px;
    font-size: 10px;
    right: 10px;
    bottom: 10px;
  }
}