@font-face {
  font-family: "Jiemian";
  src: url("../../fonts/jiemian.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "GongGong";
  src: url("../../fonts/gonggong.ttf") format("truetype");
  font-display: swap;
}

:root {
  --primary-cyan: #00f3ff;
  --primary-purple: #bc13fe;
  --bg-dark: #050212;
  --box-bg: rgba(10, 5, 25, 0.95);
  --neon-pink: #ff7fe8;
  --text-white: #ffffff;
  --mobile-portrait-width: min(100vw, 430px);
}

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

body {
  min-height: 100vh;
  width: var(--mobile-portrait-width);
  margin: 0 auto;
  overflow: hidden;
  position: relative;
  background: var(--bg-dark);
  color: var(--text-white);
  font-family: "GongGong", "Microsoft YaHei", "PingFang SC", sans-serif;
}

.page-loading-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 8, 28, 0.78);
  z-index: 999999;
  backdrop-filter: blur(2px);
  transition: opacity 0.22s ease;
}

.page-loading-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-glitch {
  position: relative;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  letter-spacing: 5px;
  z-index: 1;
  animation: shift 1s ease-in-out infinite alternate;
}

.loading-glitch:before,
.loading-glitch:after {
  display: block;
  content: attr(data-glitch);
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0.8;
}

.loading-glitch:before {
  animation: glitch 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
  color: #8b00ff;
  z-index: -1;
}

.loading-glitch:after {
  animation: glitch 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) reverse both infinite;
  color: #00e571;
  z-index: -2;
}

body,
button,
input,
textarea,
select {
  font-family: "GongGong", "Microsoft YaHei", "PingFang SC", sans-serif;
}

input::placeholder,
textarea::placeholder {
  font-family: "GongGong", "Microsoft YaHei", "PingFang SC", sans-serif;
}

.top-info-wrapper {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  text-align: center;
}

.top-info-title {
  color: var(--primary-cyan);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 4px;
  text-shadow: 2px 2px 0 #ff003c, -2px -2px 0 var(--primary-cyan), 0 0 15px var(--primary-cyan);
}

.scanner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 8px;
  z-index: 10;
  opacity: 0.4;
  background: linear-gradient(to bottom, transparent, var(--primary-cyan), transparent);
  box-shadow: 0 0 15px var(--primary-cyan);
  animation: scanMove 5s linear infinite;
}

@keyframes scanMove {
  0% {
    transform: translateY(-10vh);
  }

  100% {
    transform: translateY(110vh);
  }
}

.cyber-bg-lights {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.light-cyan,
.light-purple {
  position: absolute;
  border-radius: 50%;
}

.light-cyan {
  width: 80vw;
  height: 80vw;
  top: -10%;
  left: -10%;
  background: radial-gradient(circle, rgba(0, 243, 255, 0.15) 0%, rgba(0, 243, 255, 0) 70%);
  animation: flow1 25s infinite ease-in-out;
}

.light-purple {
  width: 100vw;
  height: 100vw;
  right: -10%;
  bottom: -10%;
  background: radial-gradient(circle, rgba(188, 19, 254, 0.15) 0%, rgba(188, 19, 254, 0) 70%);
  animation: flow2 30s infinite ease-in-out;
}

@keyframes flow1 {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  50% {
    transform: translate3d(20vw, 15vh, 0);
  }
}

@keyframes flow2 {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  50% {
    transform: translate3d(-15vw, -20vh, 0);
  }
}

@keyframes glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-3px, 3px); }
  40% { transform: translate(-3px, -3px); }
  60% { transform: translate(3px, 3px); }
  80% { transform: translate(3px, -3px); }
  to { transform: translate(0); }
}

@keyframes shift {
  0%, 40%, 44%, 58%, 61%, 65%, 69%, 73%, 100% { transform: skewX(0deg); }
  41% { transform: skewX(10deg); }
  42% { transform: skewX(-10deg); }
  59% { transform: skewX(40deg) skewY(10deg); }
  60% { transform: skewX(-40deg) skewY(-10deg); }
  63% { transform: skewX(10deg) skewY(-5deg); }
  70% { transform: skewX(-50deg) skewY(-20deg); }
  71% { transform: skewX(10deg) skewY(-10deg); }
}

.auth-page {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 110px 16px 96px;
}

.auth-shell {
  width: min(100%, 400px);
}

.login-box {
  width: 100%;
  padding: 40px 30px;
  position: relative;
  z-index: 5;
  border: 1px solid rgba(188, 19, 254, 0.4);
  border-radius: 12px;
  background: var(--box-bg);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

.main-title {
  margin-bottom: 12px;
  text-align: center;
  color: var(--text-white);
  font-size: 38px;
  letter-spacing: 2px;
  text-shadow: 3px 3px 0 #ff003c, -3px -3px 0 var(--primary-cyan), 5px 5px 0 rgba(0, 0, 0, 1);
}

.sub-greeting {
  margin-bottom: 30px;
  text-align: center;
  color: var(--text-white);
  font-size: 24px;
  text-shadow: 2px 2px 0 #ff003c, -2px -2px 0 var(--primary-cyan), 0 0 10px var(--primary-purple);
}

.wrapper {
  width: 100%;
}

.switch {
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  row-gap: 20px;
  align-content: start;
  width: 100%;
}

.switch-bar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  height: 28px;
}

.toggle {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.slider {
  position: relative;
  width: 54px;
  height: 24px;
  flex: 0 0 54px;
  cursor: pointer;
  border: 1px solid var(--primary-cyan);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 12px rgba(0, 243, 255, 0.35);
}

.slider::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 20px;
  height: 20px;
  border: 1px solid var(--primary-cyan);
  border-radius: 4px;
  background: rgba(0, 243, 255, 0.12);
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.55);
  transition: transform 0.3s ease;
}

.switch-text {
  width: 90px;
  border: 0;
  background: transparent;
  color: #7ddfe8;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

.switch-text-login.is-active,
.switch-text-register.is-active {
  color: var(--neon-pink);
  text-decoration: underline;
  text-shadow: 0 0 10px var(--neon-pink);
}

.flip-card__inner {
  width: 100%;
  position: relative;
  z-index: 1;
}

.switch.is-register .slider::before,
.toggle:checked + .switch-bar .slider::before {
  transform: translateX(30px);
}

.flip-card__front,
.flip-card__back {
  position: relative;
  width: 100%;
  display: none;
  justify-content: flex-start;
  align-items: flex-start;
}

.flip-card__back {
  margin-top: 0;
}

.switch:not(.is-register) .flip-card__front,
.toggle:not(:checked) ~ .flip-card__inner .flip-card__front {
  display: flex;
}

.switch.is-register .flip-card__back,
.toggle:checked ~ .flip-card__inner .flip-card__back {
  display: flex;
}

.flip-card__form {
  width: 100%;
}

.input-group {
  margin-bottom: 18px;
}

.input-label {
  display: block;
  margin-bottom: 6px;
  color: #cccccc;
  font-size: 14px;
}

.flip-card__input {
  width: 100%;
  border: 1px solid rgba(188, 19, 254, 0.4);
  border-radius: 4px;
  padding: 12px 15px;
  outline: none;
  text-align: center;
  font-size: 16px;
  color: var(--neon-pink);
  background: rgba(0, 0, 0, 0.6);
  text-shadow: 0 0 10px rgba(255, 127, 232, 0.55);
  box-shadow: inset 0 0 8px rgba(0, 243, 255, 0.08);
}

.flip-card__input::placeholder {
  color: rgba(255, 159, 240, 0.92);
  text-shadow: 0 0 8px rgba(255, 127, 232, 0.4);
}

.flip-card__input:focus {
  border-color: var(--primary-cyan);
  box-shadow: 0 0 16px rgba(0, 243, 255, 0.35);
}

.flip-card__btn {
  width: 100%;
  margin-top: 8px;
  padding: 12px 0;
  border: 1px solid var(--primary-cyan);
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
  color: var(--primary-cyan);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 4px;
  transition: 0.3s ease;
}

.flip-card__btn:hover {
  background: rgba(0, 243, 255, 0.2);
  box-shadow: 0 0 20px var(--primary-cyan);
}

.login-switch-hint {
  margin-top: 8px;
  text-align: center;
  font-size: 12px;
  line-height: 1.4;
  color: #ff4d4f;
}

.auth-status {
  min-height: 20px;
  margin-top: 10px;
  text-align: center;
  font-size: 13px;
  color: #9aa5b1;
}

.auth-status.is-error {
  color: #ff4d4f;
}

.auth-status.is-success {
  color: #22c55e;
}

.neon-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
}

.neon-modal.is-open {
  display: block;
}

.neon-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(2px);
}

.neon-modal__panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(92vw, 360px);
  transform: translate(-50%, -50%) scale(0.92);
  padding: 22px 18px 18px;
  border: 1px solid #ff2f66;
  border-radius: 12px;
  background: rgba(25, 4, 15, 0.95);
  box-shadow: 0 0 6px rgba(255, 47, 102, 0.45), 0 0 14px rgba(255, 47, 102, 0.28), inset 0 0 12px rgba(255, 47, 102, 0.12);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.neon-modal.is-error .neon-modal__panel {
  border-color: #ff2f66;
  background: rgba(25, 4, 15, 0.95);
  box-shadow: 0 0 6px rgba(255, 47, 102, 0.45), 0 0 14px rgba(255, 47, 102, 0.28), inset 0 0 12px rgba(255, 47, 102, 0.12);
}

.neon-modal.is-success .neon-modal__panel {
  border-color: #19ff9a;
  background: rgba(4, 25, 18, 0.95);
  box-shadow: 0 0 6px rgba(25, 255, 154, 0.45), 0 0 14px rgba(25, 255, 154, 0.28), inset 0 0 12px rgba(25, 255, 154, 0.12);
}

.neon-modal.is-open .neon-modal__panel {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.neon-modal__title {
  margin-bottom: 8px;
  text-align: center;
  color: #ff4d77;
  font-size: 24px;
  letter-spacing: 3px;
  text-shadow: 0 0 4px rgba(255, 77, 119, 0.45);
}

.neon-modal.is-success .neon-modal__title {
  color: #5dffba;
  text-shadow: 0 0 4px rgba(93, 255, 186, 0.45);
}

.neon-modal__message {
  margin-bottom: 16px;
  text-align: center;
  color: #ffd3df;
  font-size: 16px;
  line-height: 1.4;
}

.neon-modal.is-success .neon-modal__message {
  color: #d9ffef;
}

.neon-modal__btn {
  width: 100%;
  border: 1px solid #ff4d77;
  border-radius: 6px;
  padding: 10px 0;
  cursor: pointer;
  background: rgba(255, 77, 119, 0.08);
  color: #ff6b90;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 0 3px rgba(255, 77, 119, 0.38);
}

.neon-modal.is-success .neon-modal__btn {
  border-color: #5dffba;
  background: rgba(93, 255, 186, 0.08);
  color: #7dffca;
  text-shadow: 0 0 3px rgba(93, 255, 186, 0.38);
}

.neon-modal__btn:hover {
  background: rgba(255, 77, 119, 0.18);
  box-shadow: 0 0 12px rgba(255, 77, 119, 0.9);
}

.neon-modal.is-success .neon-modal__btn:hover {
  background: rgba(93, 255, 186, 0.18);
  box-shadow: 0 0 12px rgba(93, 255, 186, 0.9);
}

@media (max-width: 480px) {
  .top-info-wrapper {
    top: 28px;
  }

  .top-info-title {
    font-size: 22px;
    letter-spacing: 2px;
  }

  .auth-page {
    padding: 90px 14px 86px;
  }

  .login-box {
    padding: 30px 20px;
  }

  .main-title {
    font-size: 30px;
  }

  .sub-greeting {
    font-size: 20px;
    margin-bottom: 24px;
  }

  .switch {
    row-gap: 18px;
  }

  .flip-card__btn {
    letter-spacing: 2px;
  }
}
