:root {
  --content-color: #fff;
  --content-soft: rgba(255, 255, 255, 0.82);
  --autofill-color: #fff;
  --autofill-background: rgba(38, 35, 74, 0.62);
  --system-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  overflow: hidden;
  color: var(--content-color);
  font-family: "Instrument Serif", Georgia, serif;
  background: #000;
}

button,
input { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

.memory-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 650px;
  overflow: hidden;
  background: #000;
  transition: color 700ms ease;
}

.video-stack,
.scene-video,
.scene-shade,
.foreground-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.video-stack { z-index: 0; }

.scene-video {
  object-fit: cover;
  opacity: 0;
  transition: opacity 1000ms ease-in-out;
}

.scene-video.is-active { opacity: 1; }

.scene-shade {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.32), transparent 35%, rgba(0, 0, 0, 0.26)),
    radial-gradient(circle at 50% 45%, transparent 0 35%, rgba(0, 0, 0, 0.2) 100%);
}

.foreground-overlay {
  z-index: 1;
  object-fit: cover;
  pointer-events: none;
  transform: scale(1.03);
  animation: train-bob 3s ease-in-out infinite;
}

.content-layer {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 24px clamp(22px, 4vw, 64px) 28px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  color: #fff;
  font-size: clamp(25px, 2vw, 32px);
  font-style: italic;
  line-height: 1;
  text-decoration: none;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.18);
}

.liquid-glass {
  position: relative;
  overflow: hidden;
  border: none;
  background: rgba(255, 255, 255, 0.01);
  background-blend-mode: luminosity;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 12px 36px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.liquid-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1.4px;
  border-radius: inherit;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.15) 20%,
    rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0) 60%,
    rgba(255, 255, 255, 0.15) 80%, rgba(255, 255, 255, 0.45) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 6px 7px 6px 23px;
  border-radius: 999px;
  font-family: var(--system-font);
}

.desktop-nav a {
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.desktop-nav a:hover { color: #fff; }

.nav-enter,
.login-button,
.mobile-menu-links button {
  border: 0;
  color: #17202a;
  background: #fff;
  cursor: pointer;
  font-family: var(--system-font);
  font-weight: 600;
}

.nav-enter {
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
}

.hero-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px 16px 8px;
  text-align: center;
  transition: color 700ms ease;
}

.badge {
  padding: 9px 18px;
  border-radius: 999px;
  color: currentColor;
  font-family: var(--system-font);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.hero-content h1 {
  max-width: 950px;
  margin: 24px 0 0;
  font-size: clamp(50px, 6vw, 88px);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.025em;
  text-wrap: balance;
  text-shadow: 0 3px 24px rgba(0, 0, 0, 0.18);
}

.hero-subtext {
  max-width: 590px;
  margin: 20px 0 0;
  color: var(--content-soft);
  font-family: var(--system-font);
  font-size: 14px;
  line-height: 1.7;
  transition: color 700ms ease;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.2);
}

.login-panel {
  width: min(640px, 100%);
  margin-top: 27px;
  padding: 7px;
  border-radius: 24px;
  font-family: var(--system-font);
  transition: color 700ms ease, background 700ms ease;
}

.login-fields {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.field-wrap { position: relative; }

.field-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 18px;
  color: currentColor;
  border: 0;
  outline: none;
  background: transparent;
  font-family: var(--system-font);
  font-size: 14px;
}

.field-wrap input::placeholder { color: currentColor; opacity: 0.68; }

.field-wrap input:focus { background: rgba(255, 255, 255, 0.07); border-radius: 15px; }

/* Chromium/Edge 会给已保存的账号密码强制添加浅蓝底，覆盖玻璃输入框。 */
.field-wrap input:-webkit-autofill,
.field-wrap input:-webkit-autofill:hover,
.field-wrap input:-webkit-autofill:focus,
.field-wrap input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--autofill-color) !important;
  caret-color: var(--autofill-color);
  -webkit-box-shadow: 0 0 0 1000px var(--autofill-background) inset !important;
  box-shadow: 0 0 0 1000px var(--autofill-background) inset !important;
  border-radius: 15px;
  transition: background-color 9999s ease-out 0s;
}

.field-wrap input:autofill {
  color: var(--autofill-color) !important;
  caret-color: var(--autofill-color);
  box-shadow: 0 0 0 1000px var(--autofill-background) inset !important;
  border-radius: 15px;
}

.field-divider {
  width: 1px;
  height: 24px;
  background: currentColor;
  opacity: 0.24;
}

.password-wrap input { padding-right: 62px; }

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  padding: 8px;
  color: currentColor;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: var(--system-font);
  font-size: 10px;
  opacity: 0.72;
  transform: translateY(-50%);
}

.login-button {
  width: 100%;
  min-height: 48px;
  margin-top: 3px;
  border-radius: 17px;
  font-size: 13px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.login-button:hover { transform: scale(1.008); }
.login-button:disabled { cursor: wait; opacity: 0.7; }

.form-message {
  min-height: 0;
  margin: 0;
  color: currentColor;
  font-family: var(--system-font);
  font-size: 11px;
  transition: min-height 0.2s, margin 0.2s;
}

.form-message:not(:empty) { min-height: 17px; margin: 8px 0 2px; }

.video-switcher {
  display: flex;
  gap: 24px;
  margin-top: 24px;
  font-family: var(--system-font);
}

.scene-button {
  padding: 7px 0;
  color: currentColor;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  opacity: 0.5;
  transition: opacity 0.25s, border-color 0.25s;
}

.scene-button:hover { opacity: 0.8; }
.scene-button.is-active { border-bottom-color: currentColor; opacity: 1; }

.memory-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--system-font);
  font-size: 12px;
}

.memory-stats i { font-style: normal; opacity: 0.38; }

.mobile-menu-button,
.mobile-menu { display: none; }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 50;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(9px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.is-open { opacity: 1; pointer-events: auto; }

.mobile-menu-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
}

.mobile-menu-links a {
  color: #fff;
  font-size: 36px;
  text-decoration: none;
  transform: translateY(16px);
  opacity: 0;
  transition: opacity 500ms, transform 500ms;
}

.mobile-menu.is-open a { opacity: 1; transform: translateY(0); }
.mobile-menu.is-open a:nth-child(1) { transition-delay: 100ms; }
.mobile-menu.is-open a:nth-child(2) { transition-delay: 150ms; }
.mobile-menu.is-open a:nth-child(3) { transition-delay: 200ms; }
.mobile-menu.is-open a:nth-child(4) { transition-delay: 250ms; }

.mobile-menu-links button {
  margin-top: 15px;
  padding: 14px 26px;
  border-radius: 999px;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 500ms 300ms, transform 500ms 300ms;
}

.mobile-menu.is-open button { opacity: 1; transform: scale(1); }

.memory-hero.is-dark {
  --content-color: #182c41;
  --content-soft: rgba(24, 44, 65, 0.82);
  --autofill-color: #182c41;
  --autofill-background: rgba(255, 255, 255, 0.38);
}

.memory-hero.is-dark .hero-content { color: #182c41; }
.memory-hero.is-dark .hero-content h1 { text-shadow: 0 2px 20px rgba(255, 255, 255, 0.22); }
.memory-hero.is-dark .login-button { color: #fff; background: #182c41; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-transition {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  color: #f7f2e9;
  background: #10151a;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 750ms cubic-bezier(0.65, 0, 0.35, 1), visibility 750ms;
}

.page-transition.is-active {
  opacity: 1;
  visibility: visible;
}

.transition-diamond {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  transform: rotate(45deg);
  animation: transition-pulse 1.2s ease-in-out infinite;
}

.page-transition p {
  margin: 22px 0 0;
  font-family: var(--system-font);
  font-size: 12px;
  letter-spacing: 0.24em;
}

@keyframes transition-pulse {
  0%, 100% { transform: rotate(45deg) scale(0.75); opacity: 0.45; }
  50% { transform: rotate(45deg) scale(1.15); opacity: 1; }
}

@keyframes train-bob {
  0%, 100% { transform: translateY(0) scale(1.03); }
  50% { transform: translateY(-6px) scale(1.03); }
}

@media (max-width: 780px) {
  .memory-hero { min-height: 600px; }
  .content-layer { padding: 20px 20px 22px; }
  .desktop-nav { display: none; }

  .mobile-menu-button {
    position: relative;
    z-index: 60;
    width: 45px;
    height: 45px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
  }

  .mobile-menu-button span {
    width: 18px;
    height: 1.5px;
    background: #fff;
    transition: transform 300ms, opacity 300ms;
  }

  .mobile-menu-button.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .mobile-menu-button.is-open span:nth-child(2) { opacity: 0; transform: scale(0.75); }
  .mobile-menu-button.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
  .mobile-menu { display: flex; }

  .hero-content { padding: 18px 0 4px; }
  .badge { padding: 8px 13px; font-size: 9px; }
  .hero-content h1 { margin-top: 18px; font-size: clamp(43px, 13vw, 65px); }
  .hero-subtext { max-width: 440px; margin-top: 15px; font-size: 12px; }
  .login-panel { width: min(430px, 100%); margin-top: 20px; }
  .video-switcher { gap: 14px; margin-top: 16px; }
  .scene-button { font-size: 9px; }
  .memory-stats { gap: 12px; font-size: 10px; flex-wrap: wrap; }
  .memory-stats i { display: none; }
}

@media (max-width: 520px) {
  .login-fields { grid-template-columns: 1fr; }
  .field-divider { display: none; }
  .field-wrap input { height: 43px; }
  .field-wrap:first-child { border-bottom: 1px solid rgba(255, 255, 255, 0.22); }
  .login-button { min-height: 44px; }
  .video-switcher { width: 100%; justify-content: space-between; gap: 5px; }
  .memory-stats { max-width: 310px; margin: auto; }
}

@media (max-height: 720px) and (min-width: 781px) {
  .content-layer { padding-top: 18px; padding-bottom: 18px; }
  .hero-content h1 { font-size: clamp(48px, 5.4vw, 72px); margin-top: 17px; }
  .hero-subtext { margin-top: 13px; }
  .login-panel { margin-top: 18px; }
  .video-switcher { margin-top: 14px; }
}

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