@import url("../fonts/lxgw/package/lxgwwenkai-regular.css");
@import url("../fonts/mashan/package/chinese-simplified.css");
@import url("../fonts/zhimang/package/chinese-simplified.css");

:root {
  color-scheme: dark;
  --ink: #f7efd9;
  --muted: rgba(247, 239, 217, 0.76);
  --deep: #071315;
  --jade: #0b6a5b;
  --gold: #d7ad62;
  --line: rgba(234, 204, 137, 0.34);
  --shadow: 0 26px 90px rgba(0, 0, 0, 0.42);
  --font-body: "LXGW WenKai", "STKaiti", "KaiTi", "FangSong", "Microsoft YaHei", serif;
  --font-display: "Zhi Mang Xing", "Ma Shan Zheng", "LXGW WenKai", "STKaiti", "KaiTi", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--deep);
  font-family: var(--font-body);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 25;
  pointer-events: none;
}

body::before {
  opacity: 0.34;
  background:
    linear-gradient(115deg, transparent 0%, transparent 38%, rgba(247, 216, 137, 0.18) 45%, rgba(117, 229, 207, 0.12) 50%, transparent 58%, transparent 100%),
    radial-gradient(circle at 18% 82%, rgba(117, 229, 207, 0.12), transparent 28%),
    radial-gradient(circle at 82% 14%, rgba(247, 216, 137, 0.12), transparent 24%);
  mix-blend-mode: screen;
  animation: spirit-flow 9s ease-in-out infinite;
}

body::after {
  opacity: 0.2;
  background-image:
    radial-gradient(circle, rgba(255, 245, 205, 0.75) 0 1px, transparent 2px),
    radial-gradient(circle, rgba(109, 238, 216, 0.42) 0 1px, transparent 2px);
  background-position: 8% 88%, 72% 94%;
  background-size: 190px 240px, 280px 320px;
  animation: ember-rise 15s linear infinite;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 5vw, 58px);
  color: #fff4d5;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
}

.brand,
.nav-links {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(234, 204, 137, 0.62);
  border-radius: 50%;
  background: rgba(7, 26, 28, 0.54);
  box-shadow: 0 0 24px rgba(215, 173, 98, 0.16);
}

.nav-links {
  gap: 6px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(234, 204, 137, 0.38);
  background: linear-gradient(90deg, transparent, rgba(6, 20, 23, 0.24), transparent);
  backdrop-filter: blur(12px);
}

.nav-links a {
  min-width: 68px;
  padding: 8px 11px;
  font-family: var(--font-display);
  font-size: 18px;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.back-link:hover,
.back-link:focus-visible {
  color: #ffe4a1;
  outline: none;
}

.hero,
.cinema-page {
  position: relative;
  display: grid;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

.hero-art,
.cinema-bg {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.03);
  animation: slow-breath 18s ease-in-out infinite alternate;
}

.hero-shade,
.cinema-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 68% 42%, rgba(215, 173, 98, 0.2), transparent 26%),
    linear-gradient(90deg, rgba(4, 13, 16, 0.86) 0%, rgba(4, 13, 16, 0.5) 44%, rgba(4, 13, 16, 0.08) 100%),
    linear-gradient(180deg, rgba(4, 13, 16, 0.06) 0%, rgba(4, 13, 16, 0.28) 70%, rgba(4, 13, 16, 0.96) 100%);
}

.spirit-mist {
  position: absolute;
  inset: -20%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(255, 255, 255, 0.18), transparent 34%),
    radial-gradient(ellipse at 75% 25%, rgba(117, 229, 207, 0.13), transparent 30%),
    linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.12) 42%, transparent 68%);
  filter: blur(18px);
  opacity: 0.72;
  animation: mist-drift 16s linear infinite alternate;
}

.hero-content,
.cinema-copy {
  width: min(720px, calc(100% - 36px));
  align-self: center;
  margin-left: clamp(18px, 7vw, 94px);
  padding-top: 78px;
  text-shadow: 0 3px 28px rgba(0, 0, 0, 0.58);
}

.seal-text,
.section-script p,
.panel-copy small {
  margin: 0;
  color: #f3c978;
  font-family: var(--font-display);
  font-size: clamp(15px, 2.3vw, 20px);
  line-height: 1.5;
}

h1,
h2,
p {
  letter-spacing: 0;
}

h1 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(72px, 12vw, 138px);
  line-height: 1.08;
  font-weight: 400;
  animation: title-glow 4.8s ease-in-out infinite alternate;
}

.hero-copy,
.cinema-copy p:last-child {
  display: none;
  max-width: 650px;
  margin: 24px 0 0;
  color: rgba(255, 248, 225, 0.88);
  font-size: clamp(21px, 3vw, 30px);
  line-height: 1.78;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 42px;
}

.button,
.back-link {
  position: relative;
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 11px 20px;
  border: 1px solid rgba(234, 204, 137, 0.46);
  border-radius: 3px;
  background: rgba(7, 26, 28, 0.36);
  color: #fff4d5;
  font-family: var(--font-display);
  font-size: 20px;
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.24);
}

.button::after,
.back-link::after {
  content: "";
  position: absolute;
  inset: -80% -40%;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 236, 176, 0.3) 50%, transparent 64%);
  transform: translateX(-80%);
  animation: button-sheen 5.5s ease-in-out infinite;
}

.button.primary {
  color: #ffe8a7;
  background:
    linear-gradient(90deg, rgba(247, 216, 137, 0.2), rgba(185, 135, 56, 0.34)),
    rgba(7, 26, 28, 0.4);
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  outline: none;
}

.gateway-section {
  position: relative;
  padding: clamp(56px, 8vw, 94px) clamp(14px, 4vw, 54px) clamp(72px, 9vw, 108px);
  background:
    radial-gradient(circle at 50% 0%, rgba(63, 118, 108, 0.28), transparent 34%),
    linear-gradient(180deg, #071315 0%, #101818 100%);
}

.section-script {
  width: min(1180px, 100%);
  margin: 0 auto 26px;
}

.section-script h2 {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: clamp(38px, 6vw, 70px);
  line-height: 1.08;
  font-weight: 400;
}

.gateway-grid {
  display: grid;
  width: min(1180px, 100%);
  margin: 0 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 30px);
}

.gateway-panel {
  position: relative;
  display: grid;
  min-height: clamp(430px, 46vw, 620px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1719;
  box-shadow: var(--shadow);
  isolation: isolate;
}

.gateway-panel img {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform 900ms ease, filter 900ms ease;
}

.gateway-panel:hover img,
.gateway-panel:focus-visible img {
  transform: scale(1.09);
  filter: saturate(1.08) brightness(1.05);
}

.panel-veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 38%, transparent 0%, rgba(4, 13, 16, 0.12) 33%, rgba(4, 13, 16, 0.78) 100%),
    linear-gradient(180deg, rgba(4, 13, 16, 0.02) 0%, rgba(4, 13, 16, 0.78) 100%);
}

.gateway-panel::after,
.cinema-page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 231, 170, 0.62) 0 1px, transparent 2px),
    radial-gradient(circle, rgba(112, 228, 206, 0.32) 0 1px, transparent 2px);
  background-position: 10% 20%, 70% 55%;
  background-size: 180px 220px, 260px 260px;
  opacity: 0.35;
  animation: ember-rise 12s linear infinite;
}

.gateway-panel::before,
.relic-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.38;
  background: linear-gradient(120deg, transparent 18%, rgba(255, 228, 161, 0.18) 42%, rgba(117, 229, 207, 0.12) 50%, transparent 70%);
  transform: translateX(-95%);
  animation: panel-light 8s ease-in-out infinite;
}

.panel-copy {
  align-self: end;
  display: grid;
  gap: 10px;
  padding: clamp(22px, 5vw, 42px);
  text-shadow: 0 3px 20px rgba(0, 0, 0, 0.72);
}

.panel-copy strong {
  font-family: var(--font-display);
  font-size: clamp(44px, 6vw, 78px);
  line-height: 1.02;
  font-weight: 400;
}

.panel-copy em {
  max-width: 430px;
  color: var(--muted);
  font-size: clamp(18px, 2.4vw, 24px);
  line-height: 1.55;
  font-style: normal;
}

.cinema-page {
  min-height: 100svh;
}

.collection-page {
  background:
    radial-gradient(circle at 50% 0%, rgba(11, 106, 91, 0.18), transparent 34%),
    linear-gradient(180deg, #071315 0%, #101818 100%);
}

.collection-hero {
  min-height: 92svh;
}

.cinema-bg {
  object-position: center;
}

.scripture-page .cinema-bg {
  object-position: 58% center;
}

.cinema-copy {
  position: relative;
}

.back-link {
  margin-bottom: 28px;
  font-size: 16px;
}

.cinema-copy h1 {
  font-size: clamp(76px, 13vw, 146px);
}

.not-found-page .cinema-bg {
  object-position: 58% center;
  filter: saturate(0.88) brightness(0.82);
}

.not-found-page .cinema-shade {
  background:
    radial-gradient(circle at 60% 42%, rgba(117, 229, 207, 0.16), transparent 28%),
    linear-gradient(90deg, rgba(4, 13, 16, 0.88) 0%, rgba(4, 13, 16, 0.54) 50%, rgba(4, 13, 16, 0.18) 100%),
    linear-gradient(180deg, rgba(4, 13, 16, 0.08) 0%, rgba(4, 13, 16, 0.32) 72%, rgba(4, 13, 16, 0.96) 100%);
}

.not-found-page h1 {
  color: #fff6d8;
  text-shadow:
    0 3px 28px rgba(0, 0, 0, 0.62),
    0 0 34px rgba(117, 229, 207, 0.22);
}

.relic-section {
  position: relative;
  padding: clamp(54px, 8vw, 92px) clamp(14px, 4vw, 54px) clamp(76px, 9vw, 112px);
}

.relic-grid {
  display: grid;
  width: min(1180px, 100%);
  margin: 0 auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 2.4vw, 24px);
}

.relic-card {
  position: relative;
  display: grid;
  min-height: 300px;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(234, 204, 137, 0.24);
  border-radius: 8px;
  background:
    radial-gradient(circle at 72% 18%, rgba(215, 173, 98, 0.18), transparent 28%),
    linear-gradient(145deg, rgba(255, 244, 213, 0.08), rgba(7, 26, 28, 0.72));
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.28);
  isolation: isolate;
}

.relic-card::before {
  content: "";
  position: absolute;
  inset: 14px;
  z-index: -1;
  border: 1px solid rgba(234, 204, 137, 0.12);
  border-radius: 4px;
}

.relic-card:hover,
.relic-card:focus-visible {
  border-color: rgba(255, 228, 161, 0.6);
  transform: translateY(-4px);
  outline: none;
}

.relic-card:hover .relic-mark,
.relic-card:focus-visible .relic-mark {
  animation: relic-pulse 1.6s ease-in-out infinite alternate;
}

.relic-mark {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border: 1px solid rgba(234, 204, 137, 0.44);
  border-radius: 50%;
  color: #ffe4a1;
  background:
    radial-gradient(circle, rgba(215, 173, 98, 0.25), transparent 64%),
    rgba(8, 45, 42, 0.44);
  box-shadow:
    inset 0 0 24px rgba(215, 173, 98, 0.16),
    0 0 34px rgba(11, 106, 91, 0.2);
  font-size: 32px;
  font-weight: 800;
}

.relic-body {
  display: grid;
  align-self: end;
  gap: 10px;
  margin-top: 32px;
}

.relic-body small,
.admin-item small {
  color: #f3c978;
  font-size: 16px;
  line-height: 1.5;
}

.relic-body strong,
.admin-item strong {
  display: block;
  color: #fff7df;
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.14;
  font-weight: 400;
}

.relic-body em {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
  font-style: normal;
}

.relic-body span {
  width: fit-content;
  margin-top: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(234, 204, 137, 0.72);
  color: #ffe4a1;
  font-family: var(--font-display);
  font-size: 22px;
}

.admin-page {
  min-height: 100svh;
  padding: 110px clamp(14px, 4vw, 54px) 80px;
  background:
    linear-gradient(90deg, rgba(4, 13, 16, 0.9), rgba(4, 13, 16, 0.68)),
    url("../images/miji-entry.png") center / cover fixed;
}

.admin-hero,
.admin-shell,
.admin-export {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.admin-hero {
  margin-bottom: 28px;
}

.admin-hero h1 {
  font-size: clamp(62px, 10vw, 120px);
}

.admin-hero p:last-child,
.admin-export p {
  max-width: 720px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.7;
}

.admin-shell {
  display: grid;
  grid-template-columns: minmax(280px, 430px) 1fr;
  gap: 22px;
}

.admin-form,
.admin-list,
.admin-export {
  border: 1px solid rgba(234, 204, 137, 0.22);
  border-radius: 8px;
  background: rgba(5, 18, 21, 0.72);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.admin-form {
  display: grid;
  gap: 14px;
  align-self: start;
  padding: 22px;
}

.admin-form label {
  display: grid;
  gap: 7px;
  color: #f3c978;
  font-size: 16px;
}

.admin-form input,
.admin-form textarea,
.admin-form select,
.admin-export textarea {
  width: 100%;
  border: 1px solid rgba(234, 204, 137, 0.24);
  border-radius: 4px;
  padding: 12px 13px;
  color: #fff7df;
  background: rgba(0, 0, 0, 0.26);
  font-family: var(--font-body);
  font-size: 16px;
}

.admin-form textarea,
.admin-export textarea {
  resize: vertical;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-actions .button {
  border: 1px solid rgba(234, 204, 137, 0.42);
  cursor: pointer;
  font-family: inherit;
}

.admin-list {
  overflow: hidden;
}

.admin-tabs {
  display: flex;
  border-bottom: 1px solid rgba(234, 204, 137, 0.18);
}

.admin-tabs button,
.admin-item-actions button {
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 18px;
}

.admin-tabs button {
  flex: 1;
  padding: 15px;
  color: var(--muted);
}

.admin-tabs button.is-active {
  color: #ffe4a1;
  background: rgba(215, 173, 98, 0.12);
}

.admin-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid rgba(234, 204, 137, 0.14);
}

.admin-item .relic-mark {
  width: 58px;
  height: 58px;
  font-size: 24px;
}

.admin-item p {
  margin: 8px 0;
  color: var(--muted);
  line-height: 1.55;
}

.admin-item code {
  color: rgba(255, 244, 213, 0.62);
  word-break: break-all;
}

.admin-item-actions {
  display: grid;
  gap: 8px;
  align-content: start;
}

.admin-item-actions button {
  min-width: 42px;
  padding: 8px 10px;
  border: 1px solid rgba(234, 204, 137, 0.24);
  border-radius: 4px;
  color: #ffe4a1;
}

.admin-export {
  margin-top: 22px;
  padding: 22px;
}

.admin-export h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 400;
}

.admin-export textarea {
  margin-top: 14px;
  font-family: Consolas, monospace;
  font-size: 14px;
}

.sound-toggle {
  position: fixed;
  right: clamp(12px, 3vw, 24px);
  bottom: clamp(12px, 3vw, 24px);
  z-index: 50;
  min-width: 58px;
  min-height: 40px;
  border: 1px solid rgba(234, 204, 137, 0.42);
  border-radius: 999px;
  color: #ffe4a1;
  background: rgba(5, 18, 21, 0.64);
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 18px;
}

@keyframes spirit-flow {
  0% {
    transform: translate3d(-18%, 8%, 0) rotate(0deg);
  }

  50% {
    opacity: 0.48;
  }

  100% {
    transform: translate3d(18%, -8%, 0) rotate(0.001deg);
  }
}

@keyframes title-glow {
  from {
    text-shadow:
      0 3px 28px rgba(0, 0, 0, 0.58),
      0 0 12px rgba(255, 228, 161, 0.08);
  }

  to {
    text-shadow:
      0 3px 28px rgba(0, 0, 0, 0.58),
      0 0 26px rgba(255, 228, 161, 0.28),
      0 0 42px rgba(117, 229, 207, 0.14);
  }
}

@keyframes button-sheen {
  0%,
  62% {
    transform: translateX(-86%);
  }

  100% {
    transform: translateX(86%);
  }
}

@keyframes panel-light {
  0%,
  54% {
    transform: translateX(-96%);
  }

  100% {
    transform: translateX(96%);
  }
}

@keyframes relic-pulse {
  from {
    box-shadow:
      inset 0 0 24px rgba(215, 173, 98, 0.16),
      0 0 34px rgba(11, 106, 91, 0.2);
  }

  to {
    box-shadow:
      inset 0 0 34px rgba(215, 173, 98, 0.28),
      0 0 52px rgba(117, 229, 207, 0.34);
  }
}

@keyframes slow-breath {
  from {
    transform: scale(1.03) translate3d(0, 0, 0);
  }

  to {
    transform: scale(1.09) translate3d(-1.2%, -0.8%, 0);
  }
}

@keyframes mist-drift {
  from {
    transform: translate3d(-3%, 0, 0);
  }

  to {
    transform: translate3d(4%, -2%, 0);
  }
}

@keyframes ember-rise {
  from {
    background-position: 10% 92%, 72% 96%;
  }

  to {
    background-position: 12% 10%, 70% 18%;
  }
}

@media (max-width: 760px) {
  body::before {
    opacity: 0.24;
    animation-duration: 12s;
  }

  body::after {
    opacity: 0.16;
  }

  .site-header {
    padding: 12px 12px;
  }

  .brand span:last-child {
    display: none;
  }

  .nav-links {
    gap: 2px;
  }

  .nav-links a {
    min-width: 62px;
    padding: 8px 9px;
    font-size: 17px;
  }

  .hero-art {
    object-position: 58% center;
  }

  .hero-shade,
  .cinema-shade {
    background:
      radial-gradient(circle at 54% 42%, rgba(215, 173, 98, 0.16), transparent 28%),
      linear-gradient(180deg, rgba(4, 13, 16, 0.16) 0%, rgba(4, 13, 16, 0.36) 48%, rgba(4, 13, 16, 0.9) 100%);
  }

  .hero-content,
  .cinema-copy {
    align-self: end;
    width: calc(100% - 28px);
    margin: 0 auto;
    padding: 88px 0 58px;
  }

  h1,
  .cinema-copy h1 {
    font-size: clamp(56px, 19vw, 90px);
  }

  .hero-copy,
  .cinema-copy p:last-child {
    margin-top: 18px;
    font-size: 19px;
    line-height: 1.55;
  }

  .hero-actions {
    gap: 10px;
    margin-top: 26px;
  }

  .button {
    flex: 1 1 112px;
    min-height: 44px;
    font-size: 18px;
  }

  .gateway-section {
    padding: 48px 12px 68px;
  }

  .gateway-grid {
    grid-template-columns: 1fr;
  }

  .gateway-panel {
    min-height: 82svh;
  }

  .collection-hero {
    min-height: 88svh;
  }

  .gateway-panel img {
    object-position: center;
  }

  .gateway-panel:nth-child(2) img {
    object-position: 58% center;
  }

  .panel-copy {
    padding: 24px;
  }

  .panel-copy strong {
    font-size: clamp(48px, 17vw, 76px);
  }

  .panel-copy em {
    font-size: 19px;
  }

  .back-link {
    margin-bottom: 18px;
  }

  .relic-grid,
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .relic-card {
    min-height: 260px;
    padding: 22px;
  }

  .relic-mark {
    width: 66px;
    height: 66px;
    font-size: 28px;
  }

  .relic-body {
    margin-top: 24px;
  }

  .admin-page {
    padding: 92px 12px 64px;
    background-attachment: scroll;
  }

  .sound-toggle {
    right: 12px;
    bottom: 12px;
    min-width: 54px;
    min-height: 38px;
    font-size: 14px;
  }

  .admin-item {
    grid-template-columns: auto 1fr;
  }

  .admin-item-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
