:root {
  --xunguang-ink: #02070d;
  --xunguang-gold: #c3a06a;
  --xunguang-pale: #d8cfb9;
  --xunguang-font: "Noto Serif SC", "Source Han Serif SC", "思源宋体", "Songti SC", STSong, serif;
}

.xunguang-page,
.rujing-page {
  position: fixed;
  inset: 0;
  z-index: 60;
  min-width: 0;
  min-height: 100%;
  overflow: hidden;
  color: var(--xunguang-gold);
  background: var(--xunguang-ink);
  font-family: var(--xunguang-font);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  isolation: isolate;
}

.xunguang-page.is-visible,
.rujing-page.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body:has(.xunguang-page.is-visible),
body:has(.rujing-page.is-visible) {
  overflow: hidden;
}

.xunguang-page__backdrop {
  position: absolute;
  inset: 0;
  z-index: -3;
  overflow: hidden;
  background: var(--xunguang-ink);
}

.xunguang-page__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.xunguang-page__atmosphere {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.xunguang-page__beam {
  position: absolute;
  right: 17%;
  top: -12%;
  width: 23%;
  height: 110%;
  background: linear-gradient(180deg, rgba(118, 183, 213, 0.05), rgba(114, 181, 211, 0.12) 52%, rgba(221, 181, 111, 0.05) 86%, transparent);
  filter: blur(18px);
  opacity: 0.25;
  transform-origin: 50% 85%;
  animation: xunguang-beam-breathe 8s ease-in-out infinite alternate;
}

.xunguang-page__ritual-glow {
  position: absolute;
  right: 23%;
  bottom: 4%;
  width: 28%;
  aspect-ratio: 2.2;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(216, 173, 99, 0.11), rgba(91, 166, 194, 0.04) 40%, transparent 72%);
  filter: blur(8px);
  opacity: 0.42;
  animation: xunguang-ritual-breathe 7s ease-in-out infinite alternate;
}

.xunguang-page__trace {
  position: absolute;
  right: 34%;
  top: 42%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(224, 190, 125, 0.72);
  box-shadow: 0 0 8px rgba(221, 180, 105, 0.42);
  animation: xunguang-trace-flow 10s ease-in-out infinite;
}

.xunguang-page__atmosphere > span {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgba(211, 188, 142, 0.58);
  opacity: 0.1;
  animation: xunguang-star-breathe var(--duration, 6s) ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
}

.xunguang-page__atmosphere > span:nth-of-type(1) { left: 9%; top: 17%; --duration: 7.2s; --delay: -2.4s; }
.xunguang-page__atmosphere > span:nth-of-type(2) { left: 24%; top: 68%; --duration: 5.8s; --delay: -1.6s; }
.xunguang-page__atmosphere > span:nth-of-type(3) { left: 41%; top: 29%; --duration: 8.1s; --delay: -5.1s; }
.xunguang-page__atmosphere > span:nth-of-type(4) { left: 57%; top: 72%; --duration: 6.6s; --delay: -3.2s; }
.xunguang-page__atmosphere > span:nth-of-type(5) { left: 81%; top: 20%; --duration: 7.7s; --delay: -4.7s; }
.xunguang-page__atmosphere > span:nth-of-type(6) { left: 91%; top: 61%; --duration: 5.9s; --delay: -2.8s; }

.xunguang-content {
  position: absolute;
  z-index: 2;
  left: clamp(380px, 34cqw, 653px);
  top: 54%;
  width: min(430px, 31cqw);
  transform: translateY(-50%);
  text-align: left;
}

.xunguang-heading h1 {
  margin: 0;
  color: rgba(202, 166, 108, 0.9);
  font-size: clamp(60px, 4cqw, 76px);
  font-weight: 260;
  line-height: 1;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  text-shadow: 0 0 18px rgba(207, 163, 95, 0.14);
}

.xunguang-heading__line {
  position: relative;
  display: block;
  width: 150px;
  height: 1px;
  margin-top: 34px;
  background: linear-gradient(90deg, rgba(197, 154, 93, 0.35), rgba(197, 154, 93, 0.08));
  transform-origin: left center;
}

.xunguang-heading__line b {
  position: absolute;
  right: -1px;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(224, 185, 117, 0.76);
  box-shadow: 0 0 7px rgba(225, 182, 111, 0.46);
  transform: translate(50%, -50%);
  animation: xunguang-line-star 5.6s ease-in-out infinite alternate;
}

.xunguang-verses {
  margin-top: 48px;
}

.xunguang-verse {
  display: grid;
  gap: 0;
  margin: 0 0 24px;
  color: rgba(218, 211, 195, 0.7);
  font-size: clamp(17px, 1cqw, 20px);
  font-weight: 300;
  line-height: 2;
  letter-spacing: 0.16em;
}

.xunguang-verse--lead {
  margin-bottom: 28px;
  color: rgba(222, 199, 159, 0.86);
}

.xunguang-verse--final {
  margin-bottom: 0;
  color: rgba(226, 211, 181, 0.9);
}

.xunguang-verse__light {
  color: rgba(232, 204, 153, 0.94);
  text-shadow: 0 0 12px rgba(220, 174, 103, 0.16);
}

.xunguang-entry {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  margin-top: 42px;
  padding: 5px 0;
  border: 0;
  color: rgba(200, 158, 95, 0.65);
  background: transparent;
  font: 350 clamp(15px, 0.84cqw, 17px)/1 var(--xunguang-font);
  letter-spacing: 0.18em;
  cursor: pointer;
  transition: color 400ms ease, text-shadow 400ms ease;
}

.xunguang-entry > i {
  position: relative;
  width: 17px;
  height: 17px;
  border: 1px solid rgba(203, 160, 95, 0.52);
  border-radius: 50%;
}

.xunguang-entry > i b {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(229, 190, 121, 0);
  box-shadow: 0 0 8px rgba(225, 181, 107, 0);
  transform: translate(-50%, -50%);
  transition: background-color 400ms ease, box-shadow 400ms ease;
}

.xunguang-entry em {
  font-style: normal;
  transition: transform 400ms ease;
}

.xunguang-entry:hover,
.xunguang-entry:focus-visible {
  color: rgba(229, 191, 126, 0.94);
  text-shadow: 0 0 10px rgba(221, 172, 99, 0.2);
}

.xunguang-entry:hover > i b,
.xunguang-entry:focus-visible > i b {
  background: rgba(232, 194, 126, 0.9);
  box-shadow: 0 0 8px rgba(228, 184, 112, 0.58);
}

.xunguang-entry:hover em,
.xunguang-entry:focus-visible em {
  transform: translateX(5px);
}

.xunguang-entry:focus-visible {
  outline: 1px solid rgba(215, 170, 102, 0.4);
  outline-offset: 8px;
}

.xunguang-ritual-entry {
  position: absolute;
  z-index: 4;
  right: 16%;
  bottom: 2.5%;
  width: 30%;
  height: 22%;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.xunguang-ritual-entry::after {
  content: "";
  position: absolute;
  inset: 17% 6%;
  border: 1px solid rgba(190, 159, 102, 0);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(105, 184, 204, 0);
  opacity: 0;
  transform: scale(0.98);
  transition: border-color 450ms ease, box-shadow 450ms ease, opacity 450ms ease, transform 450ms ease;
}

.xunguang-ritual-entry:hover::after,
.xunguang-ritual-entry:focus-visible::after {
  border-color: rgba(199, 165, 104, 0.17);
  box-shadow: 0 0 20px rgba(105, 184, 204, 0.08);
  opacity: 1;
  transform: scale(1.02);
}

.xunguang-ritual-entry:focus-visible {
  outline: none;
}

.xunguang-transition {
  position: absolute;
  z-index: 8;
  inset: 0;
  background:
    radial-gradient(circle at 72% 72%, rgba(92, 168, 200, 0.34), rgba(9, 35, 55, 0.66) 36%, rgba(1, 10, 19, 0.94) 78%),
    #020811;
  opacity: 0;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: right center;
}

.rujing-page {
  z-index: 65;
  background:
    radial-gradient(circle at 68% 55%, rgba(27, 68, 93, 0.32), transparent 45%),
    #02070d;
}

@keyframes xunguang-beam-breathe {
  from { opacity: 0.18; transform: scaleX(0.96); }
  to { opacity: 0.34; transform: scaleX(1.04); }
}

@keyframes xunguang-ritual-breathe {
  from { opacity: 0.32; transform: scale(0.97); }
  to { opacity: 0.48; transform: scale(1.03); }
}

@keyframes xunguang-trace-flow {
  0%, 100% { opacity: 0; transform: translate(0, 48px); }
  25% { opacity: 0.4; }
  60% { opacity: 0.7; transform: translate(18px, -55px); }
  75% { opacity: 0.2; }
}

@keyframes xunguang-star-breathe {
  from { opacity: 0.06; box-shadow: 0 0 0 rgba(213, 188, 137, 0); }
  to { opacity: 0.46; box-shadow: 0 0 5px rgba(213, 188, 137, 0.24); }
}

@keyframes xunguang-line-star {
  from { opacity: 0.38; }
  to { opacity: 0.9; }
}

@media (max-width: 980px), (max-height: 620px) {
  :root:not(.is-fixed-desktop-stage) .xunguang-content {
    left: 16%;
    top: 55%;
    width: min(430px, 38%);
  }

  :root:not(.is-fixed-desktop-stage) .xunguang-heading h1 {
    font-size: clamp(42px, 5cqw, 50px);
  }

  :root:not(.is-fixed-desktop-stage) .xunguang-verses {
    margin-top: 28px;
  }

  :root:not(.is-fixed-desktop-stage) .xunguang-verse {
    margin-bottom: 15px;
    font-size: clamp(15px, 1.7cqw, 17px);
    line-height: 1.75;
  }

  :root:not(.is-fixed-desktop-stage) .xunguang-entry {
    margin-top: 25px;
  }

  :root:not(.is-fixed-desktop-stage) .xunguang-page__atmosphere > span:nth-of-type(n + 4) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .xunguang-page *,
  .rujing-page * {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
