:root {
  --bg: 0 0% 100%;
  --fg: 222 84% 5%;
  --primary: 231 48% 48%;
  --muted: 215 16% 47%;
  --border: 214 32% 91%;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Inter", sans-serif;
  background: hsl(var(--bg));
  color: hsl(var(--fg));
  overflow-x: hidden;
}

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

.page-shell {
  min-height: 100vh;
  max-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.hero-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: 3rem;
  color: #ffffff;
  background: linear-gradient(135deg, #9ca3af, #6b7280, #4b5563);
}

.brand-row,
.mobile-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  z-index: 4;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 0.6rem;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.17);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(3px);
}

.scene {
  position: relative;
  width: 550px;
  max-width: 100%;
  height: 400px;
  margin: 0 auto;
  z-index: 4;
}

.character {
  position: absolute;
  bottom: 0;
  transition: all 0.7s ease-in-out;
  transform-origin: bottom center;
}

.purple {
  left: 70px;
  width: 180px;
  height: 400px;
  border-radius: 10px 10px 0 0;
  background: #6c3ff5;
  z-index: 1;
}

.black {
  left: 240px;
  width: 120px;
  height: 310px;
  border-radius: 8px 8px 0 0;
  background: #2d2d2d;
  z-index: 2;
}

.orange {
  left: 0;
  width: 240px;
  height: 200px;
  border-radius: 120px 120px 0 0;
  background: #ff9b6b;
  z-index: 3;
}

.yellow {
  left: 310px;
  width: 140px;
  height: 230px;
  border-radius: 70px 70px 0 0;
  background: #e8d754;
  z-index: 4;
}

.eyes {
  position: absolute;
  display: flex;
  gap: 1.5rem;
  transition: all 0.2s ease-out;
}

.two-eyes {
  transition: all 0.7s ease-in-out;
}

.eye {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff;
  overflow: hidden;
  transition: all 0.15s ease-out;
}

.small-eye {
  width: 16px;
  height: 16px;
}

.pupil {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #2d2d2d;
  transition: transform 0.1s ease-out;
}

.small-pupil {
  width: 6px;
  height: 6px;
}

.dot-eye {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #2d2d2d;
  transition: transform 0.1s ease-out;
}

.mouth {
  position: absolute;
  width: 80px;
  height: 4px;
  border-radius: 999px;
  background: #2d2d2d;
  transition: all 0.2s ease-out;
}

.hero-footer {
  display: flex;
  justify-content: center;
  gap: 2rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.82);
  z-index: 4;
}

.hero-footer a:hover {
  color: #ffffff;
}

.beian {
  display: grid;
  width: min(100%, 26rem);
  justify-items: center;
  gap: 0.45rem;
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
}

.beian-link {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
}

.beian-public {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.beian-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.15;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.2) 1px, transparent 1px);
  background-size: 20px 20px;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(50px);
  z-index: 2;
}

.orb-a {
  width: 260px;
  height: 260px;
  top: 20%;
  right: 20%;
  background: rgba(156, 163, 175, 0.28);
}

.orb-b {
  width: 340px;
  height: 340px;
  left: 20%;
  bottom: 16%;
  background: rgba(209, 213, 219, 0.23);
}

.form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  max-width: 420px;
  width: min(100%, 420px);
  margin: 0 auto;
  padding: 2rem;
}

.mobile-brand {
  display: none;
  margin-bottom: 2.5rem;
}

.copy {
  width: 100%;
  text-align: center;
  margin-bottom: 2rem;
}

.copy h1 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  line-height: 1.1;
}

.copy p {
  margin: 0;
  color: hsl(var(--muted));
  font-size: 0.92rem;
}

.copy-quote {
  margin-top: 0.42rem;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: rgba(100, 116, 139, 0.92);
}

.login-form {
  display: grid;
  gap: 0.6rem;
  width: 100%;
}

.login-form label {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.login-form input[type="email"],
.login-form input[type="password"],
.login-form input[type="text"] {
  width: 100%;
  height: 3rem;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  padding: 0 1rem;
  font-size: 0.95rem;
  outline: none;
}

.login-form input:focus {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

.password-wrap {
  position: relative;
  width: 100%;
}

.ghost-btn {
  position: absolute;
  top: 50%;
  right: 0.55rem;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: hsl(var(--muted));
  font-size: 0.83rem;
  cursor: pointer;
}

.row {
  margin-top: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.88rem;
}

.row a {
  color: hsl(var(--primary));
}

.row a:hover {
  text-decoration: underline;
}

.check {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.form-error,
.form-ok {
  min-height: 0.95rem;
  margin: 0.08rem 0 0;
  font-size: 0.8rem;
}

.form-error {
  color: #b91c1c;
}

.form-ok {
  color: #15803d;
}

.hover-button {
  position: relative;
  margin-top: 0.35rem;
  height: 3rem;
  width: 100%;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
}

.main-text,
.hover-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: all 0.3s ease;
}

.hover-layer {
  background: hsl(var(--primary));
  color: #fff;
  transform: translateY(100%);
}

.hover-button:hover .main-text {
  transform: translateY(-100%);
  opacity: 0;
}

.hover-button:hover .hover-layer {
  transform: translateY(0);
}

.hover-button.subtle {
  margin-top: 1rem;
  font-weight: 500;
}

.signup-text {
  width: 100%;
  margin-top: 1.5rem;
  text-align: center;
  color: hsl(var(--muted));
  font-size: 0.9rem;
}

.signup-text a {
  color: hsl(var(--fg));
  font-weight: 600;
}

.signup-text a:hover {
  text-decoration: underline;
}

@media (max-width: 980px) {
  .page-shell {
    grid-template-columns: 1fr;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .hero-panel {
    display: flex;
    align-items: center;
    gap: 1rem;
    order: 2;
    overflow: hidden;
    padding: 1rem clamp(0.85rem, 4vw, 1.1rem) 1.1rem;
  }

  .mobile-brand {
    display: inline-flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 0.9rem;
  }

  .brand-row {
    display: none;
  }

  .scene {
    width: 550px;
    --scene-scale: clamp(0.46, calc((100vw - 3rem) / 550), 0.6);
    transform: translateX(-0.45rem) scale(var(--scene-scale));
    transform-origin: top center;
    margin-bottom: calc(400px * (var(--scene-scale) - 1) - 0.22rem);
  }

  .hero-footer {
    width: 100%;
    font-size: 0.78rem;
  }

  .form-panel {
    max-width: none;
    width: 100%;
    order: 1;
    padding: 0.9rem clamp(0.85rem, 4vw, 1.1rem) 1rem;
  }

  .copy {
    margin-bottom: 0.7rem;
  }

  .copy h1 {
    font-size: 1.42rem;
  }

  .copy p {
    font-size: 0.8rem;
  }

  .copy-quote {
    margin-top: 0.26rem;
    font-size: 0.72rem;
  }

  .login-form {
    gap: 0.32rem;
  }

  .login-form label {
    margin-top: 0.18rem;
    font-size: 0.78rem;
  }

  .login-form input[type="email"],
  .login-form input[type="password"],
  .login-form input[type="text"],
  .hover-button {
    height: 2.46rem;
  }

  .row {
    margin-top: 0.24rem;
    font-size: 0.76rem;
    gap: 0.7rem;
  }

  .check {
    gap: 0.32rem;
  }

  .form-error,
  .form-ok {
    min-height: 0.7rem;
    font-size: 0.72rem;
  }

  .signup-text {
    margin-top: 0.42rem;
    font-size: 0.76rem;
  }
}

@media (max-width: 640px) {
  .hero-panel {
    padding: 1.15rem 0.75rem 0.9rem;
  }

  .scene {
    --scene-scale: clamp(0.37, calc((100vw - 2.6rem) / 550), 0.5);
    transform: translateX(-0.55rem) scale(var(--scene-scale));
    margin-bottom: calc(400px * (var(--scene-scale) - 1));
  }

  .beian {
    font-size: 11px;
    line-height: 1.6;
  }

  .beian-public {
    gap: 0.25rem;
  }

  .beian-icon {
    width: 18px;
    height: 18px;
  }

  .copy h1 {
    font-size: 1.22rem;
  }

  .copy {
    margin-bottom: 0.58rem;
  }

  .copy-quote {
    font-size: 0.68rem;
  }

  .login-form label {
    margin-top: 0.14rem;
  }

  .login-form input[type="email"],
  .login-form input[type="password"],
  .login-form input[type="text"],
  .hover-button {
    height: 2.28rem;
    font-size: 0.86rem;
  }

  .ghost-btn {
    font-size: 0.72rem;
  }

  .row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.24rem;
    margin-top: 0.18rem;
  }

  .signup-text {
    margin-top: 0.34rem;
  }

  .form-error,
  .form-ok {
    min-height: 0.62rem;
    font-size: 0.68rem;
  }
}
