
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
}

body {
  background: #061329;
  color: #fff;
}

.hidden {
  display: none !important;
}

/* =========================
   手机扫码页面
========================= */

.join-wrap,
.setup-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(
      circle at 50% 0,
      #174477 0,
      #081b35 48%,
      #040c1b 100%
    );
}

.join-card {
  width: min(100%, 480px);
  background: #fff;
  color: #10233c;
  border-radius: 22px;
  padding: 30px;
  box-shadow: 0 24px 70px #0005;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 3px;
  color: #69baff;
  font-weight: 700;
}

.join-card h1 {
  font-size: 27px;
  margin: 10px 0;
}

.intro {
  color: #63758b;
  margin: 0 0 24px;
}

.join-card form > label {
  display: block;
  font-weight: 650;
  margin: 16px 0 8px;
}

.join-card input[type=text],
.join-card input:not([type]) {
  width: 100%;
}

.join-card input#name {
  width: 100%;
  padding: 13px;
  border: 1px solid #ccd7e4;
  border-radius: 10px;
  font-size: 16px;
}

.join-card input[type=file] {
  width: 100%;
  padding: 12px;
  border: 1px dashed #a9bbce;
  border-radius: 10px;
  background: #f6f9fc;
}

.preview-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  color: #62748a;
}

.preview-wrap img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #dcecff;
}

.consent {
  display: flex !important;
  align-items: flex-start;
  gap: 9px;
  font-weight: 400 !important;
  font-size: 13px;
  color: #4d6076;
  line-height: 1.5;
}

.consent input {
  margin-top: 3px;
}

.join-card button {
  width: 100%;
  border: 0;
  border-radius: 11px;
  padding: 15px;
  background: linear-gradient(100deg, #0878db, #24b7d8);
  color: white;
  font-size: 17px;
  font-weight: 700;
  margin-top: 15px;
}

.join-card button:disabled {
  opacity: .6;
}

.message {
  min-height: 22px;
  color: #b45309;
  font-size: 14px;
}

.message.success {
  color: #07834b;
}

.privacy-note {
  font-size: 12px;
  line-height: 1.6;
  color: #8796a8;
  margin-top: 18px;
}

/* =========================
   普通大屏页面样式
========================= */

.screen-wrap {
  min-height: 100vh;
  padding: 36px 4vw 20px;
  background:
    radial-gradient(
      ellipse at 50% 20%,
      #174a78 0,
      #0a2140 40%,
      #040c1b 100%
    );
  overflow: hidden;
}

.screen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid #ffffff25;
  padding-bottom: 22px;
}

.screen-header h1 {
  font-size: clamp(30px, 4vw, 58px);
  margin: 8px 0;
}

.screen-header p {
  color: #b8d6f4;
  margin: 0;
}

.counter {
  text-align: center;
  background: #ffffff12;
  border: 1px solid #ffffff2b;
  border-radius: 18px;
  padding: 14px 24px;
  min-width: 150px;
}

.counter strong {
  display: block;
  font-size: 42px;
  color: #7fe5ff;
}

.counter span {
  font-size: 13px;
  color: #c5d8eb;
}

.screen-content {
  display: none;
}

.qr-panel,
.wall-panel {
  background: #ffffff0d;
  border: 1px solid #ffffff20;
  border-radius: 20px;
  padding: 22px;
}

.qr-panel {
  text-align: center;
  align-self: start;
}

.qr-panel h2,
.wall-heading h2 {
  font-size: 20px;
  margin: 0 0 18px;
}

.qr-panel #qrcode {
  display: flex;
  justify-content: center;
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  width: max-content;
  margin: auto;
}

.qr-panel #qrcode img {
  display: block;
}

.qr-panel p {
  color: #c4d8ee;
  font-size: 14px;
}

.url-hint {
  font-size: 10px;
  color: #9db4cd;
  word-break: break-all;
}

.wall-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wall-heading span {
  color: #8edfff;
  font-size: 13px;
}

.avatar-wall {
  display: grid;
  grid-template-columns:
    repeat(auto-fill, minmax(94px, 1fr));
  gap: 16px;
  max-height: 62vh;
  overflow: auto;
  padding: 8px;
}

.avatar-item {
  text-align: center;
  min-width: 0;
  animation: pop .35s ease-out;
}

.avatar-item img {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #8ee8ff;
  box-shadow: 0 0 18px #36c8ff55;
  background: #19385c;
}

.avatar-item span {
  display: block;
  margin-top: 7px;
  font-size: 13px;
  color: #e7f4ff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 10px;
  color: #a9c2dc;
}

@keyframes pop {
  from {
    transform: scale(.65);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.screen-wrap footer {
  text-align: center;
  color: #91b4d5;
  margin-top: 24px;
  font-size: 13px;
}

/* =========================
   大屏视频舞台
========================= */

#screenView {
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.video-stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  background: #000;
  overflow: hidden;
  perspective: 1400px;
  z-index: 1;
}

/* MP4 原生视频播放器 */

#launchPlayer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  z-index: 2;
  object-fit: contain;
  background: #000;
}

/* =========================
   等待扫码背景
========================= */

.video-stage.waiting-mode {
  background-image: url("cover.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.video-stage.waiting-mode #launchPlayer {
  display: none;
}

/* =========================
   左右两个二维码
========================= */

#videoQr,
.video-qr {
  position: absolute;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.video-qr-card {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: block;
  width: max-content;
  max-width: 210px;
  padding: 12px;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 12px;
  text-align: center;
  z-index: 101;
  pointer-events: auto;
  box-shadow:
    0 0 20px rgba(255,255,255,.22),
    0 0 40px rgba(70,190,255,.2);
}

/* 左侧二维码 */

.video-qr-card.left {
  left: 2.5%;
  right: auto;
}

/* 右侧二维码 */

.video-qr-card.right {
  right: 2.5%;
  left: auto;
}

/* 二维码本身 */

.video-qr-card img,
.video-qr-card canvas {
  display: block;
  width: 130px;
  height: 130px;
  max-width: 100%;
  margin: 0 auto;
}

/* 二维码说明文字 */

.video-qr-card p {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: #10233c;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

/* =========================
   旧头像层停用
========================= */

.video-avatars {
  position: absolute;
  inset: 0;
  display: none !important;
  overflow: hidden;
  z-index: 5;
  pointer-events: none;
  animation: none !important;
}

.video-avatars img {
  animation: none !important;
}

/* =========================
   中央大尺寸3D头像球体
========================= */

.avatar-sphere {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(72vh, 760px);
  height: min(72vh, 760px);
  margin: 0;
  transform: translate(-50%, -50%);
  transform-style: preserve-3d;
  opacity: 0;
  visibility: visible;
  transition: opacity 1.15s ease;
  pointer-events: none;
  z-index: 30;
  overflow: visible;
}

/* 等待扫码时显示球体 */

.avatar-sphere.sphere-show {
  opacity: 1;
  visibility: visible;
  animation: none !important;
}

/* 启动后球体淡出 */

.avatar-sphere.sphere-hide {
  opacity: 0 !important;
  visibility: visible !important;
  animation: none !important;
  transition: opacity 1.15s ease !important;
  pointer-events: none !important;
}

/* =========================
   球面头像
========================= */

.avatar-sphere .sphere-avatar {
  position: absolute;
  left: 50%;
  top: 50%;
  box-sizing: border-box;
  object-fit: cover;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.98);
  box-shadow:
    0 0 8px rgba(80,210,255,.7),
    0 0 18px rgba(50,180,255,.25);
  backface-visibility: visible;
  -webkit-backface-visibility: visible;
  transform-style: preserve-3d;
  will-change: transform, opacity;
  transition:
    transform 1.35s cubic-bezier(.16,.84,.28,1),
    opacity .9s ease;
  pointer-events: none;
}

/* =========================
   开始启动按钮
========================= */

.start-launch {
  position: absolute !important;
  left: 50% !important;
  bottom: 8% !important;
  transform: translateX(-50%) !important;
  z-index: 99999 !important;
  width: 220px !important;
  height: 64px !important;
  border: 2px solid #fff !important;
  border-radius: 40px !important;
  background: #0878db !important;
  color: #fff !important;
  font-size: 24px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}

.start-launch:disabled {
  opacity: .55;
  cursor: wait !important;
}

/* =========================
   屏幕尺寸适配
========================= */

@media (max-width: 1100px) {
  .avatar-sphere {
    width: min(68vh, 620px);
    height: min(68vh, 620px);
  }

  .video-qr-card {
    padding: 9px;
  }

  .video-qr-card img,
  .video-qr-card canvas {
    width: 115px;
    height: 115px;
  }

  .video-qr-card p {
    font-size: 13px;
  }
}

@media (max-width: 760px) {
  .screen-wrap {
    padding: 20px;
  }

  .screen-header {
    align-items: flex-start;
  }

  .screen-content {
    grid-template-columns: 1fr;
  }

  .qr-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .avatar-wall {
    grid-template-columns:
      repeat(auto-fill, minmax(72px, 1fr));
    max-height: 45vh;
  }

  .avatar-item img {
    width: 54px;
    height: 54px;
  }

  .counter {
    min-width: 100px;
    padding: 10px;
  }

  .counter strong {
    font-size: 30px;
  }

  .avatar-sphere {
    width: min(65vh, 460px);
    height: min(65vh, 460px);
  }

  .video-qr-card {
    padding: 6px;
    max-width: 145px;
  }

  .video-qr-card.left {
    left: 1%;
  }

  .video-qr-card.right {
    right: 1%;
  }

  .video-qr-card img,
  .video-qr-card canvas {
    width: 90px;
    height: 90px;
  }

  .video-qr-card p {
    font-size: 11px;
  }

  .start-launch {
    width: 190px !important;
    height: 56px !important;
    font-size: 21px !important;
  }
}

/* =========================
   减少动画偏好
========================= */

@media (prefers-reduced-motion: reduce) {
  .avatar-sphere {
    transition: opacity 1.15s ease !important;
  }

  .avatar-sphere .sphere-avatar {
    transition:
      transform 1.35s ease,
      opacity .9s ease;
  }
}
