/* ==========================================================================
   AI智能时代 · AI智能公开课   —  H5 复刻版
   舞台 320 × 626（等比缩放），两页竖屏翻页
   ========================================================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #050a1c;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

/* ---------- 视口 ---------- */
.viewport {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, #101a3d 0%, #050a1c 62%, #02040c 100%);
  overflow: hidden;
}

.stage {
  position: relative;
  width: 320px;
  height: 626px;
  flex: none;
  transform: scale(var(--s, 1));
  transform-origin: center center;
  background: #0a1130;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(90, 170, 255, .10), 0 24px 70px rgba(0, 0, 0, .75);
}

/* ---------- 页 ---------- */
.page {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #0a1130;
  will-change: transform, opacity;
}

/* 两页上下相接：翻页时整体向上推移一屏（600ms，ease） */
.page--1 {
  z-index: 2;
  transform: translate3d(0, 0, 0);
  transition: transform .6s cubic-bezier(.25, .1, .25, 1);
}

.page--2 {
  z-index: 3;
  visibility: hidden;
  transform: translate3d(0, 100%, 0);
  transition: transform .6s cubic-bezier(.25, .1, .25, 1), visibility 0s linear .6s;
}

.page--1.is-leaving {
  transform: translate3d(0, -100%, 0);
}

.page--2.is-active,
.page--2.is-leaving {
  visibility: visible;
  transition: transform .6s cubic-bezier(.25, .1, .25, 1), visibility 0s linear 0s;
}

.page--2.is-active {
  transform: translate3d(0, 0, 0);
}

/* ---------- 通用对象 ---------- */
.obj {
  position: absolute;
  display: block;
  pointer-events: none;
  will-change: transform, opacity;
}

.bg {
  left: 0;
  top: 0;
  width: 320px;
  height: 626px;
  object-fit: cover;
  z-index: 0;
}

/* ==========================================================================
   光效（四道扫光，各自循环）
   light1 左→右 / light2 右→左 / light3 上→下 / light4 下→上
   ========================================================================== */
.light {
  position: absolute;
  z-index: 2;
  opacity: 0;
  will-change: transform, opacity;
}

.light img { display: block; width: 100%; height: 100%; }

.light--1 {
  left: 54px; top: 78.5px; width: 174px; height: 47.96px;
  animation: sweepH 6s cubic-bezier(.4, 0, .6, 1) infinite;
  --from: -260px; --to: 286px;
}
.light--2 {
  left: 145px; top: 100.5px; width: 174px; height: 47.96px;
  animation: sweepH 7.5s cubic-bezier(.4, 0, .6, 1) infinite;
  --from: 202px; --to: -336px;
}
.light--3 {
  left: 24px; top: 334px; width: 3px; height: 114px;
  animation: sweepV 8.5s cubic-bezier(.4, 0, .6, 1) infinite;
  --from: -426px; --to: 355px;
}
.light--4 {
  left: 293px; top: 230px; width: 3px; height: 113px;
  animation: sweepV 9.5s cubic-bezier(.4, 0, .6, 1) infinite;
  --from: 459px; --to: -389px;
}

/* 水平扫光：停留 → 入场 → 出场（百分比 = delay/总周期） */
@keyframes sweepH {
  0%      { transform: translateX(var(--from)); opacity: 0; animation-timing-function: cubic-bezier(.4, 0, .2, 1); }
  66.667% { transform: translateX(var(--from)); opacity: 0; animation-timing-function: cubic-bezier(.4, 0, .2, 1); }
  83.333% { transform: translateX(0); opacity: 1; animation-timing-function: cubic-bezier(.55, 0, .75, .5); }
  100%    { transform: translateX(var(--to)); opacity: 0; }
}

@keyframes sweepV {
  0%      { transform: translateY(var(--from)); opacity: 0; animation-timing-function: cubic-bezier(.4, 0, .2, 1); }
  76.47%  { transform: translateY(var(--from)); opacity: 0; animation-timing-function: cubic-bezier(.4, 0, .2, 1); }
  88.24%  { transform: translateY(0); opacity: 1; animation-timing-function: cubic-bezier(.55, 0, .75, .5); }
  100%    { transform: translateY(var(--to)); opacity: 0; }
}

/* light2 与 light4 的“入场”更靠后，单独覆盖停留比例 */
.light--2 { animation-name: sweepH2; }
.light--4 { animation-name: sweepV2; }

@keyframes sweepH2 {
  0%      { transform: translateX(var(--from)); opacity: 0; animation-timing-function: cubic-bezier(.4, 0, .2, 1); }
  73.333% { transform: translateX(var(--from)); opacity: 0; animation-timing-function: cubic-bezier(.4, 0, .2, 1); }
  86.667% { transform: translateX(0); opacity: 1; animation-timing-function: cubic-bezier(.55, 0, .75, .5); }
  100%    { transform: translateX(var(--to)); opacity: 0; }
}

@keyframes sweepV2 {
  0%      { transform: translateY(var(--from)); opacity: 0; animation-timing-function: cubic-bezier(.4, 0, .2, 1); }
  78.947% { transform: translateY(var(--from)); opacity: 0; animation-timing-function: cubic-bezier(.4, 0, .2, 1); }
  89.474% { transform: translateY(0); opacity: 1; animation-timing-function: cubic-bezier(.55, 0, .75, .5); }
  100%    { transform: translateY(var(--to)); opacity: 0; }
}

/* ==========================================================================
   入场动画
   页面未激活时全部隐藏；激活后按 --d 延迟播放一次
   ========================================================================== */
.page .anim { opacity: 0; }

.page--1.is-active .anim {
  animation-duration: var(--dur, 1s);
  animation-delay: var(--d, 0s);
  animation-fill-mode: both;
  animation-timing-function: cubic-bezier(.2, .7, .3, 1);
}

.page--1.is-active .anim--left   { animation-name: moveInLeft; }
.page--1.is-active .anim--right  { animation-name: moveInRight; }
.page--1.is-active .anim--pop    { animation-name: popIn; }
.page--1.is-active .anim--closer { animation-name: closerIn; }

@keyframes moveInLeft {
  0%   { transform: translate3d(var(--fly, -200px), 0, 0); opacity: 0; }
  18%  { opacity: .55; }
  100% { transform: translate3d(0, 0, 0); opacity: 1; }
}

@keyframes moveInRight {
  0%   { transform: translate3d(var(--fly, 200px), 0, 0); opacity: 0; }
  18%  { opacity: .55; }
  100% { transform: translate3d(0, 0, 0); opacity: 1; }
}

@keyframes popIn {
  0%   { transform: scale(.28); opacity: 0; }
  55%  { transform: scale(1.08); opacity: 1; }
  75%  { transform: scale(.97); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes closerIn {
  0%   { transform: scale(1.75); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.anim--fade { animation: fadeIn .9s ease-out both .2s; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

/* 光效不参与入场隐藏 */
.page .light { opacity: 0; }
.page--1.is-active .light { animation-play-state: running; }

/* ==========================================================================
   第 1 页细节
   ========================================================================== */
.title { z-index: 4; }
.frame { z-index: 1; }
.fig1, .fig2 { z-index: 5; }
.icon { z-index: 5; }
.person { z-index: 5; }

.copy {
  z-index: 6;
  overflow-y: auto;
  overflow-x: hidden;
  pointer-events: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.copy::-webkit-scrollbar { display: none; }

.copy p {
  font-size: 12px;
  line-height: 1.4;
  color: rgb(242, 242, 242);
  text-align: justify;
  text-justify: inter-ideograph;
}

/* ==========================================================================
   按钮
   ========================================================================== */
.btn {
  z-index: 8;
  width: 68.48px;
  height: 23.07px;
  border: 0;
  padding: 0;
  border-radius: 16px;
  background: rgba(0, 221, 255, .42);
  color: rgb(242, 242, 242);
  font-family: inherit;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, background-color .2s ease;
}

.btn:active {
  transform: scale(.94);
  background: rgba(0, 221, 255, .62);
}

.btn--next { left: 246.52px; top: 576px; }
.btn--prev { left: 246.52px; top: 576px; }

/* ==========================================================================
   第 2 页
   ========================================================================== */
.veil {
  left: -1px;
  top: 66px;
  width: 320px;
  height: 307px;
  background: rgba(23, 43, 135, .54);
  z-index: 1;
}

.video-wrap {
  left: 0;
  top: 76.5px;
  width: 320px;
  height: 184.01px;
  z-index: 2;
  overflow: hidden;
  background: #030a1a;
}

.video-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  pointer-events: none;
}

.copy2 {
  left: 12px;
  top: 273px;
  width: 296px;
  z-index: 6;
}

.copy2 p {
  font-size: 14px;
  line-height: 1.5;
  color: #fff;
  text-align: justify;
  text-justify: inter-ideograph;
}

/* 长图拖动 */
.longimg {
  left: -1px;
  top: 404.72px;
  width: 550px;
  height: 127px;
  z-index: 5;
  overflow: hidden;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
}

.longimg.is-dragging { cursor: grabbing; }

.longimg__track {
  position: relative;
  width: 550px;
  height: 127px;
  will-change: transform;
}

.longimg__track img {
  position: absolute;
  top: 0;
  display: block;
}

.hint {
  left: 90px;
  top: 541.72px;
  width: 142px;
  height: 24px;
  z-index: 6;
  font-size: 12px;
  line-height: 24px;
  color: rgb(78, 218, 253);
  text-align: center;
}

/* ==========================================================================
   音乐开关
   ========================================================================== */
.audio {
  position: absolute;
  left: 18px;
  top: 18px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: none;
  z-index: 20;
  pointer-events: auto;
  cursor: pointer;
  opacity: 1;
  overflow: visible;
}

.audio img {
  width: 100%;
  height: 100%;
  display: block;
}

/* 被自动播放策略拦截时：呼吸光圈 + 一次性提示 */
.audio.is-blocked::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid rgba(96, 200, 255, .8);
  animation: audioPulse 1.9s ease-out infinite;
  pointer-events: none;
}

@keyframes audioPulse {
  0%   { transform: scale(.92); opacity: .9; }
  75%  { opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}

.audio__tip {
  position: absolute;
  left: 46px;
  top: 7px;
  padding: 5px 9px;
  border-radius: 11px;
  background: rgba(6, 20, 46, .84);
  border: 1px solid rgba(90, 190, 255, .35);
  color: #a9e6ff;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}

.audio.is-tip .audio__tip {
  opacity: 1;
  transform: translateX(0);
}

/* ==========================================================================
   加载层
   ========================================================================== */
.loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  transition: opacity .5s ease;
}

.loader.is-done { opacity: 0; pointer-events: none; }

.loader__bar {
  width: 120px;
  height: 2px;
  background: rgba(255, 255, 255, .16);
  overflow: hidden;
  border-radius: 2px;
}

.loader__bar i {
  display: block;
  width: 0;
  height: 100%;
  background: #f36523;
  transition: width .2s linear;
}

.loader__txt {
  font-size: 12px;
  color: #fff;
  letter-spacing: .5px;
}

/* ==========================================================================
   桌面端：小提示
   ========================================================================== */
@media (min-width: 700px) and (min-height: 700px) {
  .stage {
    box-shadow: 0 0 0 1px rgba(90, 170, 255, .16),
                0 0 60px rgba(40, 110, 255, .22),
                0 30px 90px rgba(0, 0, 0, .85);
    border-radius: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .light { animation: none !important; }
}
