/* 禁用全局长按菜单与文字选中，但保留二维码的识别功能 */
* {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

img {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.qr-code,
.qr-code img {
  -webkit-touch-callout: none !important;
  -webkit-user-select: auto !important;
  user-select: auto !important;
  pointer-events: auto !important;
  -webkit-user-drag: auto !important;
}

/* button,
button img {
  pointer-events: auto !important;
} */

/* 容器与页面布局 */
body {
  background-color: #f6f8fa;
  color: #333;
}

/* 隐藏滚动条，但保持滚动区域高度以支持 JS 滚动 */
html {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}
html::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}
body::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.container {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  background-color: #ffffff;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.06);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 头部区域 */
.header {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* 推广标 */
.advertorial-badge {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 100;
  background: rgba(61, 61, 61, 0.6);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  line-height: 1.4;
  user-select: none;
  pointer-events: none;
}

@media (max-width: 768px) {
  .advertorial-badge {
    font-size: 10px;
    padding: 3px 8px;
  }
}

.header-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  animation: headerFadeIn 1.2s ease forwards;
}

.header-img1 {
  position: absolute;
  width: 100%;
  top: 15%;
  left: 50%;
  transform: translate3d(-50%, 0, 0);
  opacity: 0;
}

.header .header-img1,
.end-page.visible .header-img1 {
  animation: headerImg1Enter 1s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}

.header-img1 img {
  width: 100%;
  height: auto;
  display: block;
}

.header-img2 {
  position: absolute;
  width: 70%;
  top: 24%;
  left: 50%;
  transform: translate3d(-50%, 0, 0);
  opacity: 0;
}

.header .header-img2,
.end-page.visible .header-img2 {
  animation: headerImg2Enter 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}

.header-img2 img {
  width: 100%;
  height: auto;
  display: block;
}

.header-img3 {
  position: absolute;
  width: 70%;
  top: 7%;
  left: 50%;
  transform: translate3d(-50%, 0, 0);
  opacity: 0;
  animation: headerImg3Enter 1s cubic-bezier(0.22, 1, 0.36, 1) 0.3s forwards;
}

.header-img3 img {
  width: 100%;
  height: auto;
  display: block;
}

.header-img4 {
  position: absolute;
  width: 78%;
  top: 16.5%;
  left: 48%;
  transform: translate3d(-50%, 0, 0);
  opacity: 0;
  animation: headerImg4Enter 1s cubic-bezier(0.22, 1, 0.36, 1) 0.45s forwards;
}

.header-img4 img {
  width: 100%;
  height: auto;
  display: block;
}

.header-btn {
  position: absolute;
  left: 0%;
  bottom: 8%;
  width: 46%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
  z-index: 10;
  opacity: 0;
  animation: headerBtnEnter 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s forwards;
  transition:
    transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    opacity 0.2s ease;
}

.header-btn:hover {
  transform: scale(1.03);
  opacity: 0.95;
}

.header-btn:active {
  transform: scale(0.96);
  opacity: 0.9;
}

.header-btn img {
  width: 100%;
  height: auto;
  display: block;
}

.finger-tip {
  position: absolute;
  left: 36%;
  bottom: 6%;
  width: 12%;
  pointer-events: none;
  z-index: 11;
  opacity: 0;
  animation:
    fingerTipEnter 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.75s forwards,
    fingerTap 1.8s infinite ease-in-out 1.55s;
}
.finger-tip img {
  width: 100%;
  height: auto;
  display: block;
}

/* 内容区域 */
.content {
  position: relative;
  width: 100%;
  flex: 1;
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1),
    visibility 0.6s;
}

.content.fade-out {
  opacity: 0;
  visibility: hidden;
}

.long-bg {
  width: 100%;
  height: auto;
  display: block;
}

/* 引导遮罩与提示 */
.guide-overlay {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  z-index: 90;
  pointer-events: auto; /* 阻挡下方元素的交互 */
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.4s ease,
    visibility 0.4s;
}

.guide-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.guide-tip {
  position: absolute;
  left: 75%;
  transform: translateX(-50%);
  width: 90%;
  bottom: calc(30px + 24vw + 20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  white-space: nowrap;
  color: #ffffff;
  pointer-events: none;
}

@media screen and (min-width: 600px) {
  .guide-tip {
    bottom: calc(30px + 144px + 20px);
  }
}

.guide-tip p {
  font-size: 1.8rem;
  line-height: 1.5;
  font-weight: bold;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  text-align: center;
}

.guide-tip .en {
  font-size: 1.8rem;
  margin-top: 10px;
  opacity: 0.95;
  line-height: 1.4;
  font-weight: normal;
}

/* 固定浮动控件容器 */
.fixed-controls {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  height: 0;
  pointer-events: none;
  z-index: 100;
}

.go-btn {
  position: absolute;
  right: 5%;
  bottom: 30px;
  width: 24%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
  pointer-events: auto; /* 允许点击事件 */
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8);
  transition:
    opacity 0.5s ease,
    transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    visibility 0.5s,
    box-shadow 0.5s ease;
  border-radius: 50%; /* 确保外层发光是圆形的 */
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.65); /* 轻微白光 */
  animation: goBtnPulse 2s infinite ease-in-out;
}

.go-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.go-btn:hover {
  animation: none;
  transform: scale(1.08) rotate(3deg);
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.9);
}

.go-btn:active {
  transform: scale(0.94) rotate(0deg);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.7);
}

.go-btn img {
  width: 100%;
  height: auto;
  display: block;
}

/* 跑步的人动画与定位 */
.runner-wrap {
  position: absolute;
  top: 21%; /* 定位在特定位置，可根据实际长图位置调整 */
  left: 82%;
  width: 16%;
  opacity: 0;
  transform: translate3d(0, 20px, 0) scale(0.85);
  transition:
    opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1),
    transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: none;
  z-index: 5;
}

.runner-wrap.visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.runner-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

.runner-wrap.flip img {
  scale: -1 1;
}

/* 当跑步的人出现时，使其有一个呼吸/跑步跳动感 */
.runner-wrap.visible img {
  animation: runnerRun 0.6s infinite alternate ease-in-out;
}

/* 页脚 */
.footer {
  width: 100%;
  height: auto;
}

.end-page {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  height: 100%;
  background: url("../images/bg.png") no-repeat center center;
  background-size: cover;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10% 8% 8% 8%;
  box-sizing: border-box;
  z-index: 120;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1),
    visibility 0.6s;
}

.end-page.visible {
  opacity: 1;
  visibility: visible;
}

.end-content {
  position: absolute;
  top: 7%;
  left: 50%;
  transform: translate3d(-50%, 0, 0);
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 0 10%;
  z-index: 10;
  opacity: 0;
}

.end-page.visible .end-content {
  animation: headerImg3Enter 1s cubic-bezier(0.22, 1, 0.36, 1) 0.3s forwards;
}

.qr-code {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-code img {
  width: 100%;
  height: auto;
  display: block;
}

.end-text-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  flex: 1;
}

.end-text-zh {
  font-size: 1.6rem;
  color: #fff;
  font-weight: bold;
  line-height: 1.5;
  text-align: left;
  margin-bottom: 6px;
}

.end-text-en {
  font-size: 1.2rem;
  color: #fff;
  line-height: 1.4;
  text-align: left;
  max-width: 100%;
}

.replay-btn {
  width: 44%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
  transition:
    transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    opacity 0.2s ease;
  margin-top: auto;
  margin-bottom: 10%;
  opacity: 0;
  z-index: 10;
}

.end-page.visible .replay-btn {
  animation: headerBtnEnter 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s forwards;
}

.replay-btn:hover {
  transform: scale(1.04);
}

.replay-btn:active {
  transform: scale(0.96);
}

.replay-btn img {
  width: 100%;
  height: auto;
  display: block;
}

.runner-wrap.bottom-hide {
  opacity: 0 !important;
  transform: translate3d(0, 0, 0) scale(0.85) !important;
  pointer-events: none !important;
}

/* 动画定义 */
@keyframes goBtnPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.9);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
  }
}

@keyframes runnerRun {
  0% {
    transform: translateY(0) rotate(-2deg);
  }
  100% {
    transform: translateY(-8px) rotate(2deg);
  }
}

@keyframes fingerTap {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-8px, -8px) scale(0.92);
  }
}

/* 头图入场动画定义 */
@keyframes headerFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes headerImg1Enter {
  from {
    opacity: 0;
    transform: translate3d(-50%, 0, 0) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate3d(-50%, 0, 0) scale(1);
  }
}

@keyframes headerImg2Enter {
  from {
    opacity: 0;
    transform: translate3d(-50%, 40px, 0) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate3d(-50%, 0, 0) scale(1);
  }
}

@keyframes headerImg3Enter {
  from {
    opacity: 0;
    transform: translate3d(-50%, -25px, 0) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate3d(-50%, 0, 0) scale(1);
  }
}

@keyframes headerImg4Enter {
  from {
    opacity: 0;
    transform: translate3d(-50%, -15px, 0) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate3d(-50%, 0, 0) scale(1);
  }
}

@keyframes headerBtnEnter {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fingerTipEnter {
  from {
    opacity: 0;
    transform: translate(30px, 30px) scale(0.85);
  }
  to {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

/* 移动端特殊重置 (高度自适应, 隐藏电脑端背景) */
@media screen and (max-width: 600px) {
  body {
    background-color: #ffffff;
  }
  .container {
    box-shadow: none;
  }
}

@media screen and (min-width: 1024px) {
  .header-img3 {
    top: 6%;
  }
  .replay-btn {
    width: 60%;
  }
}
