/* H5 全屏轮播 —— 所有层铺满视口，video/img 均 object-fit: cover */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body {
  position: fixed;
  inset: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

#stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #000;
}

.layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--fade, 500ms) linear;
  background: #000;
}

.layer.is-active {
  opacity: 1;
}

/* 视频铺满全屏（保持比例裁剪） */
video.layer {
  object-fit: cover;
  display: block;
}

/* 图片层 */
#imgLayer {
  background: #000;
}

.photo {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--fade, 500ms) linear;
}

.photo.is-active {
  opacity: 1;
}

/* 兜底层提示 */
#fallback .tip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(48px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
  letter-spacing: 1px;
}

/* 进入遮罩 */
#gate {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 90% at 50% 40%, #1b2330 0%, #05070b 70%);
  color: #fff;
  opacity: 1;
  transition: opacity 420ms ease;
}

#gate.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.gate-inner {
  text-align: center;
}

.gate-ring {
  width: 74px;
  height: 74px;
  margin: 0 auto 22px;
  border: 1.5px solid rgba(255, 255, 255, .85);
  border-radius: 50%;
  position: relative;
  animation: pulse 1.8s ease-out infinite;
}

.gate-ring::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform: translate(-42%, -50%);
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent rgba(255, 255, 255, .92);
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, .28); }
  70%  { box-shadow: 0 0 0 26px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.gate-text {
  font-size: 19px;
  letter-spacing: 4px;
}

.gate-sub {
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, .55);
}

/* 静音降级时的开声按钮 */
#soundBtn {
  position: absolute;
  z-index: 20;
  left: 50%;
  bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  padding: 9px 22px;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 999px;
  background: rgba(0, 0, 0, .35);
  color: #fff;
  font-size: 13px;
  letter-spacing: 1px;
  display: none;
}

#soundBtn.is-show {
  display: block;
}

/* 调试面板（URL 加 ?debug=1 开启） */
#debug {
  position: absolute;
  z-index: 40;
  left: 8px;
  top: calc(8px + env(safe-area-inset-top, 0px));
  max-width: 78%;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .62);
  color: #7CFFB2;
  font: 11px/1.55 ui-monospace, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-all;
  pointer-events: none;
}

/* 横屏适配：仍以 cover 铺满 */
@media screen and (orientation: landscape) {
  video.layer,
  .photo {
    object-fit: cover;
  }
}
