*,
*::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-picture {
  position: fixed;
  inset: 0;
  display: block;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.page__bg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  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;
}

/* 新背景已经包含品牌标识与装饰，保留结构但关闭旧版顶部光效，
   避免在背景 Logo 上叠加另一套视觉元素。 */
.title-fx {
  display: none;
}

.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;
  }
}

/* 移动端：横版背景以高度铺满，焦点保持在人物与主视觉中心；
   底部控件使用更紧凑的间距，避免遮挡主体。 */
@media (max-width: 767px) {
  .page__bg {
    object-fit: cover;
    object-position: 48% center;
  }
}

/* 底部操作区 */
.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-group {
  width: 88vw;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.permanent-domain {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 34px;
  padding: 4px 12px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(58, 37, 23, 0.82) 20%, rgba(58, 37, 23, 0.88) 50%, rgba(58, 37, 23, 0.82) 80%, transparent 100%);
  color: #fff1ce;
  font-size: clamp(10px, 2.5vw, 13px);
  white-space: nowrap;
}

.permanent-domain__label {
  opacity: 0.9;
}

.permanent-domain__name {
  color: #ffcd70;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.permanent-domain__copy {
  padding: 3px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #ffcd70;
  font: inherit;
  cursor: pointer;
}

.permanent-domain__copy:focus-visible {
  outline: 2px solid #fff1ce;
  outline-offset: 2px;
}

.lines {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  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__state {
  font-size: clamp(0.58rem, 2.6vw, 0.72rem);
  font-weight: 500;
  color: #ffd88a;
  white-space: nowrap;
}

.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 .lines__state {
  color: #fff0c0;
}

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

.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: #fff0c0;
  text-shadow: 0 0 8px rgba(255, 200, 80, 0.45);
  line-height: 1.2;
  opacity: 0.95;
}

.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;
  }
}

/* 桌面/宽屏适配：页面原始设计以手机视口为基准，宽屏下限制操作区宽度，
   避免线路栏和进入按钮横向拉伸到遮挡主体 Logo。 */
@media (min-width: 768px) {
  /* PC 端使用横版画布铺满窗口，保留人物、品牌 Logo 与底部展台。 */
  .page__bg {
    object-fit: cover;
    object-position: center center;
  }

  .page {
    background: #1a0a3e;
  }

  .controls {
    width: min(620px, 58vw);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: clamp(26px, 6vh, 64px);
    padding: 0;
    gap: 18px;
  }

  .lines-group,
  .btn-enter {
    width: 100%;
  }

  .lines {
    background: rgba(17, 9, 7, 0.64);
    border-color: rgba(255, 196, 86, 0.48);
    box-shadow:
      0 0 26px rgba(255, 166, 45, 0.2),
      inset 0 1px 0 rgba(255, 245, 210, 0.12);
  }

  .lines__btn.is-active {
    background: linear-gradient(135deg, rgba(162, 78, 12, 0.9), rgba(236, 171, 54, 0.72));
    box-shadow: 0 0 18px rgba(255, 178, 55, 0.45);
  }

  .lines {
    padding: 4px;
  }

  .lines__btn {
    gap: 5px;
    padding: 14px 10px 13px;
  }

  .lines__label {
    font-size: 15px;
  }

  .lines__state {
    font-size: 12px;
  }

  .btn-enter {
    gap: 5px;
    padding: 20px 28px 18px;
    background: linear-gradient(90deg, #8d420f 0%, #d8891f 46%, #f5c65f 100%);
    border-color: rgba(255, 224, 145, 0.78);
    box-shadow:
      0 0 28px rgba(224, 143, 41, 0.5),
      0 4px 22px rgba(52, 19, 5, 0.5),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }

  .btn-enter__main {
    font-size: 18px;
  }

  .btn-enter__tip {
    font-size: 13px;
  }
}

/* 移动端覆盖项放在通用控件样式之后，确保响应式布局生效。 */
@media (max-width: 767px) {
  .controls {
    padding-bottom: calc(env(safe-area-inset-bottom, 12px) + 2.5vh);
    gap: 2.5vw;
  }

  .lines {
    background: rgba(12, 8, 8, 0.62);
    border-color: rgba(255, 190, 80, 0.42);
    box-shadow:
      0 0 22px rgba(255, 166, 45, 0.16),
      inset 0 1px 0 rgba(255, 245, 210, 0.12);
  }

  .lines-group {
    width: min(92vw, 520px);
  }

  .lines__btn.is-active {
    background: linear-gradient(135deg, rgba(165, 83, 16, 0.88), rgba(246, 183, 66, 0.68));
    box-shadow: 0 0 16px rgba(255, 176, 56, 0.4);
  }

  .btn-enter {
    width: min(92vw, 520px);
    background: linear-gradient(90deg, #8d420f 0%, #d8891f 46%, #f5c65f 100%);
    border-color: rgba(255, 224, 145, 0.78);
    box-shadow:
      0 0 24px rgba(224, 143, 41, 0.5),
      0 4px 20px rgba(52, 19, 5, 0.5),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
}
