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

html {
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
  min-height: 100svh;
  overflow: hidden;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #1a0a3e;
}

.page {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  min-height: 100svh;
  overflow: hidden;
}

/* 全屏背景：随屏幕宽高自适应，无固定像素尺寸 */
.page__bg {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* ── 顶部 Logo 区 · 纯光效（适中强度） ── */
.title-fx {
  position: fixed;
  top: env(safe-area-inset-top, 0);
  left: 0;
  right: 0;
  height: 26vh;
  min-height: 140px;
  max-height: 220px;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.title-fx__glow {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
}

.title-fx__glow--cyan {
  width: 82vw;
  height: 16vh;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 210, 255, 0.28) 0%,
    rgba(0, 180, 255, 0.1) 45%,
    transparent 72%
  );
  animation: fx-glow-cyan 3.2s ease-in-out infinite;
}

.title-fx__glow--magenta {
  width: 70vw;
  height: 14vh;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 80, 200, 0.22) 0%,
    rgba(180, 60, 255, 0.08) 50%,
    transparent 75%
  );
  animation: fx-glow-magenta 3.2s ease-in-out infinite 1.6s;
}

.title-fx__orbit {
  position: absolute;
  top: 52%;
  left: 50%;
  width: 78vw;
  height: 78vw;
  max-width: 320px;
  max-height: 32vh;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid transparent;
  border-top-color: rgba(0, 220, 255, 0.35);
  border-right-color: rgba(255, 90, 200, 0.2);
  border-bottom-color: rgba(0, 220, 255, 0.08);
  box-shadow: 0 0 20px rgba(0, 200, 255, 0.12);
  animation: fx-orbit 14s linear infinite;
}

.title-fx__orbit::after {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  border: 1px solid transparent;
  border-left-color: rgba(255, 100, 200, 0.25);
  border-bottom-color: rgba(0, 220, 255, 0.15);
  animation: fx-orbit 10s linear infinite reverse;
}

.title-fx__sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    108deg,
    transparent 38%,
    rgba(255, 255, 255, 0.04) 46%,
    rgba(0, 235, 255, 0.14) 50%,
    rgba(255, 120, 220, 0.1) 52%,
    rgba(255, 255, 255, 0.04) 56%,
    transparent 64%
  );
  background-size: 250% 100%;
  animation: fx-sheen 5.5s ease-in-out infinite;
}

.title-fx__scan {
  position: absolute;
  left: 8%;
  width: 84%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 230, 255, 0.45) 35%,
    rgba(255, 90, 200, 0.45) 65%,
    transparent 100%
  );
  box-shadow:
    0 0 8px rgba(0, 220, 255, 0.45),
    0 0 16px rgba(255, 80, 200, 0.2);
  animation: fx-scan 4.2s ease-in-out infinite;
}

.title-fx__stars span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px rgba(0, 230, 255, 0.8);
  animation: fx-twinkle 2.8s ease-in-out infinite;
}

.title-fx__stars span:nth-child(1) { top: 18%; left: 12%; animation-delay: 0s; }
.title-fx__stars span:nth-child(2) { top: 28%; left: 78%; animation-delay: 0.4s; box-shadow: 0 0 6px rgba(255, 120, 220, 0.8); }
.title-fx__stars span:nth-child(3) { top: 55%; left: 8%; animation-delay: 0.9s; }
.title-fx__stars span:nth-child(4) { top: 42%; left: 88%; animation-delay: 1.3s; }
.title-fx__stars span:nth-child(5) { top: 72%; left: 22%; animation-delay: 0.6s; width: 2px; height: 2px; }
.title-fx__stars span:nth-child(6) { top: 65%; left: 70%; animation-delay: 1.8s; box-shadow: 0 0 6px rgba(255, 120, 220, 0.7); }
.title-fx__stars span:nth-child(7) { top: 35%; left: 45%; animation-delay: 2.1s; width: 2px; height: 2px; }
.title-fx__stars span:nth-child(8) { top: 80%; left: 55%; animation-delay: 1.1s; }

/* 十字星点 */
.title-fx__stars span:nth-child(1)::before,
.title-fx__stars span:nth-child(4)::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #fff 50%, transparent);
  transform: translate(-50%, -50%);
}

.title-fx__stars span:nth-child(1)::after,
.title-fx__stars span:nth-child(4)::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1px;
  height: 10px;
  background: linear-gradient(180deg, transparent, #fff 50%, transparent);
  transform: translate(-50%, -50%);
}

@keyframes fx-glow-cyan {
  0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
}

@keyframes fx-glow-magenta {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.95; transform: translate(-50%, -50%) scale(1.05); }
}

@keyframes fx-orbit {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes fx-sheen {
  0%, 100% { background-position: 120% 0; opacity: 0.4; }
  45% { background-position: -30% 0; opacity: 0.85; }
  55% { background-position: -30% 0; opacity: 0.85; }
}

@keyframes fx-scan {
  0% { top: 5%; opacity: 0; }
  10% { opacity: 0.75; }
  88% { opacity: 0.75; }
  100% { top: 92%; opacity: 0; }
}

@keyframes fx-twinkle {
  0%, 100% { opacity: 0.25; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.5); }
}

@media (prefers-reduced-motion: reduce) {
  .title-fx *,
  .title-fx *::before,
  .title-fx *::after {
    animation: none !important;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .title-fx {
    height: 38vh;
    max-height: 180px;
  }
}

/* 底部操作区 */
.controls {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  width: 100%;
  padding: 0 6vw calc(env(safe-area-inset-bottom, 16px) + 4vh);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3.5vw;
}

.lines {
  display: flex;
  width: 88vw;
  padding: 0.8vw;
  border-radius: 999px;
  background: rgba(20, 8, 50, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 220, 255, 0.35);
  box-shadow:
    0 0 20px rgba(0, 200, 255, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.lines__btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5vw;
  padding: 2.4vw 1vw 2.2vw;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(220, 230, 255, 0.75);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}

.lines__label {
  font-size: clamp(0.78rem, 3.5vw, 0.95rem);
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.2;
}

.lines__status {
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}

.lines__dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: status-blink 2s ease-in-out infinite;
}

.lines__state {
  font-size: clamp(0.58rem, 2.6vw, 0.72rem);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.lines__btn.status--smooth .lines__dot {
  background: #2dd87a;
  box-shadow: 0 0 6px rgba(45, 216, 122, 0.9);
}

.lines__btn.status--smooth .lines__state {
  color: #5ee89a;
}

.lines__btn.status--normal .lines__dot {
  background: #ffb020;
  box-shadow: 0 0 6px rgba(255, 176, 32, 0.85);
  animation-duration: 2.8s;
}

.lines__btn.status--normal .lines__state {
  color: #ffd060;
}

.lines__btn.status--slow .lines__dot {
  background: #ff5a6a;
  box-shadow: 0 0 6px rgba(255, 90, 106, 0.9);
  animation-duration: 1.4s;
}

.lines__btn.status--slow .lines__state {
  color: #ff8a96;
}

.lines__btn.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(0, 180, 255, 0.55) 0%, rgba(180, 60, 255, 0.55) 100%);
  box-shadow:
    0 0 16px rgba(0, 220, 255, 0.45),
    0 0 8px rgba(255, 80, 200, 0.25);
}

.lines__btn.is-active .lines__label {
  color: #fff;
}

.lines__btn.is-active.status--smooth .lines__state {
  color: #a8ffd0;
}

.lines__btn.is-active.status--normal .lines__state {
  color: #ffe8a0;
}

.lines__btn.is-active.status--slow .lines__state {
  color: #ffc0c8;
}

.lines__btn:active:not(.is-active) {
  opacity: 0.8;
}

@keyframes status-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

.btn-enter {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6vw;
  width: 88vw;
  padding: 3.5vw 6vw 3.2vw;
  border-radius: 999px;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(90deg, #0066ff 0%, #00b4ff 40%, #7b5cff 100%);
  border: 1px solid rgba(0, 240, 255, 0.6);
  box-shadow:
    0 0 24px rgba(0, 200, 255, 0.5),
    0 4px 20px rgba(100, 40, 200, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: btn-pulse 2.5s ease-in-out infinite;
}

.btn-enter__main {
  font-size: clamp(1rem, 4.5vw, 1.15rem);
  font-weight: 700;
  letter-spacing: 0.2em;
  line-height: 1.2;
}

.btn-enter__tip {
  font-size: clamp(0.68rem, 3vw, 0.8rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #a8ffd0;
  text-shadow: 0 0 8px rgba(45, 216, 122, 0.5);
  line-height: 1.2;
  opacity: 0.95;
}

.btn-enter--normal .btn-enter__tip {
  color: #ffe8a0;
  text-shadow: 0 0 8px rgba(255, 200, 80, 0.45);
}

.btn-enter--slow .btn-enter__tip {
  color: #ffc8d0;
  text-shadow: 0 0 8px rgba(255, 120, 140, 0.45);
}

.btn-enter:active {
  transform: scale(0.97);
  animation: none;
}

@keyframes btn-pulse {
  0%, 100% {
    box-shadow:
      0 0 24px rgba(0, 200, 255, 0.5),
      0 4px 20px rgba(100, 40, 200, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.25);
  }
  50% {
    box-shadow:
      0 0 32px rgba(255, 80, 200, 0.45),
      0 4px 24px rgba(0, 200, 255, 0.5),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
}

/* 横屏：背景以高度为准铺满，避免裁切过多 */
@media (orientation: landscape) and (max-height: 500px) {
  .page__bg {
    object-fit: cover;
    object-position: center center;
  }

  .controls {
    padding-bottom: calc(env(safe-area-inset-bottom, 8px) + 2vh);
    gap: 2vh;
  }
}
