/* ===== Foundation ===== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

:root {
  color-scheme: dark;
  --bg: #080b09;
  --surface: rgba(18, 23, 20, 0.78);
  --text: #f1f5f2;
  --muted: #929d96;
  --subtle: #5e6862;
  --accent: #c8f7d9;
  --accent-bright: #e6ffee;
  --line: rgba(222, 240, 228, 0.12);
  --line-strong: rgba(222, 240, 228, 0.22);
  --gutter: clamp(24px, 5vw, 80px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font-sans: Inter, "SF Pro Display", "Segoe UI", "Microsoft YaHei", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

html { min-width: 320px; background: var(--bg); }
body {
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
::selection { color: #071009; background: var(--accent); }

/* ===== Ambient scene ===== */
.site-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  padding: 0 var(--gutter);
  overflow: hidden;
}
.scene { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(8, 11, 9, 0.18), transparent 45%, rgba(8, 11, 9, 0.28)),
              linear-gradient(0deg, rgba(8, 11, 9, 0.86), transparent 30%);
}
.scene__glow { position: absolute; border-radius: 50%; filter: blur(110px); }
.scene__glow--primary {
  width: 55vw;
  height: 55vw;
  top: -28vw;
  right: -8vw;
  background: rgba(91, 157, 115, 0.18);
  animation: glow-drift 16s ease-in-out infinite alternate;
}
.scene__glow--secondary {
  width: 44vw;
  height: 44vw;
  bottom: -32vw;
  left: -14vw;
  background: rgba(72, 108, 87, 0.14);
  animation: glow-drift 20s ease-in-out 2s infinite alternate-reverse;
}
.scene__grid {
  position: absolute;
  inset: 0;
  opacity: 0.32;
  background-image: linear-gradient(rgba(197, 230, 207, 0.035) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(197, 230, 207, 0.035) 1px, transparent 1px);
  background-size: 88px 88px;
  -webkit-mask-image: radial-gradient(ellipse at 68% 46%, #000 0%, transparent 68%);
  mask-image: radial-gradient(ellipse at 68% 46%, #000 0%, transparent 68%);
}
.scene__orbit {
  position: absolute;
  width: min(75vw, 1120px);
  aspect-ratio: 1;
  right: max(-30vw, -480px);
  top: 50%;
  border: 1px solid rgba(193, 227, 203, 0.07);
  border-radius: 50%;
  transform: translateY(-50%) rotate(-24deg) scaleY(0.62);
}
.scene__orbit--inner { width: min(53vw, 780px); right: max(-18vw, -300px); border-color: rgba(193, 227, 203, 0.09); }
.scene__orbit--outer::before {
  content: "";
  position: absolute;
  top: 17%;
  left: 12%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 20px rgba(200, 247, 217, 0.85);
}
.scene__noise {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}
@keyframes glow-drift {
  to { transform: translate3d(4vw, 3vh, 0) scale(1.08); }
}

/* ===== Header ===== */
.topbar, .footer {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar { padding-top: max(32px, env(safe-area-inset-top)); }
.brand { display: flex; align-items: center; }
.brand__name { font-size: 27px; font-weight: 750; line-height: 1; letter-spacing: -0.055em; }
.brand__divider { width: 1px; height: 26px; margin: 0 17px; background: var(--line-strong); }
.brand__meta { color: var(--muted); font-size: 8px; font-weight: 600; line-height: 1.45; letter-spacing: 0.24em; }
.system-status { display: flex; align-items: center; gap: 24px; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.13em; }
.system-status__label { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.system-status__label i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #9de5b6;
  box-shadow: 0 0 10px rgba(157, 229, 182, 0.6);
  animation: status-pulse 3s ease-in-out infinite;
}
.system-status__time { min-width: 59px; color: #c4cec7; font-variant-numeric: tabular-nums; }
@keyframes status-pulse { 50% { opacity: 0.45; box-shadow: 0 0 4px rgba(157, 229, 182, 0.25); } }

/* ===== Hero composition ===== */
.hero {
  width: 100%;
  max-width: 1280px;
  margin: auto;
  padding: clamp(60px, 8vh, 108px) 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 450px);
  align-items: center;
  gap: clamp(56px, 9vw, 140px);
}
.intro { min-width: 0; animation: reveal 1s var(--ease) both; }
.eyebrow { display: flex; align-items: center; gap: 13px; color: #a1aea5; font-size: 9px; font-weight: 600; letter-spacing: 0.27em; }
.eyebrow span { width: 28px; height: 1px; background: #a1aea5; }
.intro h1 {
  margin: clamp(28px, 4vh, 48px) 0 32px -0.065em;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(142px, 17vw, 246px);
  font-weight: 800;
  line-height: 0.7;
  letter-spacing: -0.105em;
  color: transparent;
  background: linear-gradient(118deg, #f4f8f5 6%, #9eaaa2 37%, #eef5f0 57%, #78867c 87%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 16px 35px rgba(0, 0, 0, 0.22));
}
.intro__title { font-size: clamp(25px, 2.2vw, 34px); font-weight: 400; letter-spacing: 0.08em; }
.intro__description { margin-top: 17px; color: var(--muted); font-size: 13px; font-weight: 300; line-height: 1.8; letter-spacing: 0.06em; }
.intro__footnote { display: flex; align-items: center; gap: 15px; margin-top: clamp(44px, 7vh, 80px); color: var(--subtle); font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.19em; }
.intro__footnote span:first-child { color: #a8b5ac; }
.intro__footnote i { width: 54px; height: 1px; background: var(--line); }

/* ===== Access card ===== */
.access-card {
  position: relative;
  width: 100%;
  padding: clamp(30px, 3vw, 42px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(27, 34, 29, 0.84), rgba(12, 16, 13, 0.84));
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  -webkit-backdrop-filter: blur(26px) saturate(115%);
  backdrop-filter: blur(26px) saturate(115%);
  animation: card-reveal 1.1s 0.12s var(--ease) both;
}
.access-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 12%;
  width: 42%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(218, 255, 230, 0.52), transparent);
}
.card-corner { position: absolute; width: 7px; height: 7px; border-color: rgba(205, 238, 216, 0.38); }
.card-corner--top { top: 12px; right: 12px; border-top: 1px solid; border-right: 1px solid; }
.card-corner--bottom { bottom: 12px; left: 12px; border-bottom: 1px solid; border-left: 1px solid; }
.access-card__heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-label { margin-bottom: 12px; color: #87968b; font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.18em; }
.access-card h2 { font-size: 26px; font-weight: 500; letter-spacing: 0.08em; }
.access-card__emblem {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  flex: 0 0 auto;
  color: #b5c8ba;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.025);
}
.access-card__emblem svg { width: 19px; height: 19px; }
.access-card__subtitle { margin-top: 16px; color: var(--muted); font-size: 12px; line-height: 1.7; letter-spacing: 0.025em; }
.access-card form { margin-top: 36px; }
.field__label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; color: #b8c3bb; font-size: 11px; letter-spacing: 0.08em; }
.field__count { color: var(--subtle); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.06em; }
.field__control { position: relative; }
.field input {
  width: 100%;
  height: 58px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  color: #eaf5ed;
  caret-color: var(--accent);
  background: rgba(3, 7, 4, 0.34);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.055em;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.field input::placeholder { color: #626e66; font-family: var(--font-sans); font-size: 12px; letter-spacing: 0.035em; }
.field input:hover { border-color: var(--line-strong); }
.field input:focus { border-color: rgba(190, 232, 203, 0.46); background: rgba(3, 7, 4, 0.52); box-shadow: 0 0 0 3px rgba(180, 230, 195, 0.045); }
.field__line { position: absolute; left: 16px; right: 16px; bottom: -1px; height: 1px; background: var(--accent); transform: scaleX(0); transition: transform 0.45s var(--ease); }
.field input:focus ~ .field__line { transform: scaleX(1); }
.field__message { min-height: 29px; padding-top: 9px; color: #f0a8a0; font-size: 11px; line-height: 1.5; letter-spacing: 0.025em; opacity: 0; transform: translateY(-3px); transition: opacity 0.2s ease, transform 0.2s ease; }
.field__message.show { opacity: 1; transform: translateY(0); }
.field.has-error input { border-color: rgba(240, 168, 160, 0.48); }

/* ===== Auth tabs (账号密码 / 卡密 双通道) ===== */
.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(3, 7, 4, 0.34);
}
.auth-tab {
  flex: 1;
  height: 40px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.25s ease, background 0.25s ease;
}
.auth-tab:hover:not(.is-active) { color: #d6e2d9; }
.auth-tab.is-active {
  color: #0b130e;
  background: linear-gradient(105deg, #d9f8e3, #b9e8c9);
  font-weight: 650;
}
.auth-pane[hidden] { display: none; }
.field + .field { margin-top: 14px; }

/* 密码可见性切换按钮 (贴在输入框右侧) */
.field__eye {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 7px;
  color: #7d8a80;
  background: transparent;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}
.field__eye:hover { color: #c9d8cc; background: rgba(255, 255, 255, 0.04); }
.field__eye svg { width: 17px; height: 17px; }
#passInput { padding-right: 52px; }

/* 通道切换提示语 */
.auth-hint {
  margin-top: 18px;
  color: var(--subtle);
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: 0.04em;
  text-align: center;
}

/* The page intentionally contains one action only. */
.download-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 58px;
  padding: 8px 9px 8px 21px;
  overflow: hidden;
  border: 0;
  border-radius: 11px;
  color: #0b130e;
  background: linear-gradient(105deg, #d9f8e3, #b9e8c9);
  box-shadow: 0 9px 30px rgba(128, 190, 147, 0.09);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.35s var(--ease), box-shadow 0.35s ease, background 0.35s ease;
}
.download-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-110%);
  transition: transform 0.8s var(--ease);
}
.download-button:hover:not(:disabled) { transform: translateY(-2px); background: linear-gradient(105deg, #edfff3, #cef3da); box-shadow: 0 13px 35px rgba(128, 190, 147, 0.17); }
.download-button:hover:not(:disabled)::before { transform: translateX(110%); }
.download-button:active:not(:disabled) { transform: translateY(0); }
.download-button:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 4px; }
.download-button:disabled { cursor: wait; }
.download-button__label { position: relative; z-index: 1; }
.download-button__icon { position: relative; z-index: 1; display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 8px; background: rgba(8, 22, 12, 0.09); }
.download-button__icon svg { width: 20px; height: 20px; transition: transform 0.3s var(--ease); }
.download-button:hover:not(:disabled) .icon-arrow { transform: translateX(2px); }
.spinner { display: none; width: 17px; height: 17px; border: 1.5px solid rgba(8, 22, 12, 0.22); border-top-color: #0b130e; border-radius: 50%; animation: spin 0.7s linear infinite; }
.download-button.is-loading .icon-arrow { display: none; }
.download-button.is-loading .spinner { display: block; }
.download-button.is-loading { opacity: 0.82; }
@keyframes spin { to { transform: rotate(360deg); } }
.access-card__footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 25px; color: #748178; font-size: 9px; letter-spacing: 0.035em; }
.access-card__footer span { display: inline-flex; align-items: center; gap: 6px; }
.access-card__footer svg { width: 13px; height: 13px; color: #91aa98; }

/* ===== Footer ===== */
.footer { gap: 22px; padding-bottom: max(28px, env(safe-area-inset-bottom)); color: #4f5b53; font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.13em; }
.footer__line { height: 1px; flex: 1; background: linear-gradient(90deg, var(--line), transparent); }

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(30px, env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 240px;
  padding: 13px 18px;
  border: 1px solid rgba(192, 235, 205, 0.2);
  border-radius: 12px;
  color: #dcebe0;
  background: rgba(16, 24, 18, 0.94);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.36);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  font-size: 12px;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
  transition: opacity 0.35s ease, transform 0.45s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast__icon { display: grid; place-items: center; width: 23px; height: 23px; color: var(--accent); border-radius: 50%; background: rgba(174, 232, 193, 0.08); }
.toast__icon svg { width: 15px; height: 15px; }

/* ===== Motion ===== */
@keyframes reveal { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes card-reveal { from { opacity: 0; transform: translateY(24px) scale(0.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .hero { grid-template-columns: minmax(0, 0.8fr) minmax(350px, 420px); gap: 42px; }
  .intro h1 { font-size: clamp(120px, 18vw, 180px); }
  .intro__title { font-size: 25px; }
}
@media (max-width: 760px) {
  .site-shell { overflow: visible; }
  .topbar { padding-top: max(25px, env(safe-area-inset-top)); }
  .system-status__label { display: none; }
  .hero { grid-template-columns: 1fr; gap: 44px; padding: 68px 0 56px; }
  .intro { text-align: center; }
  .eyebrow { justify-content: center; font-size: 8px; }
  .intro h1 { margin: 38px 0 28px; font-size: clamp(128px, 41vw, 200px); line-height: 0.72; }
  .intro__title { font-size: 25px; }
  .intro__description { font-size: 12px; }
  .intro__footnote { display: none; }
  .access-card { width: min(100%, 460px); margin: 0 auto; }
  .footer { justify-content: center; padding: 0 0 max(25px, env(safe-area-inset-bottom)); text-align: center; }
  .footer__line, .footer > span:last-child { display: none; }
  .scene__grid { background-size: 64px 64px; }
  .scene__orbit { width: 150vw; right: -90vw; top: 65%; }
  .scene__orbit--inner { width: 110vw; right: -58vw; }
}
@media (max-width: 420px) {
  :root { --gutter: 20px; }
  .brand__meta { font-size: 7px; }
  .brand__divider { margin: 0 13px; }
  .hero { padding-top: 54px; gap: 38px; }
  .intro h1 { margin-top: 34px; }
  .access-card { padding: 28px 23px; border-radius: 17px; }
  .access-card h2 { font-size: 23px; }
  .section-label { font-size: 7px; }
  .access-card__footer { font-size: 8px; }
}
@media (max-height: 720px) and (min-width: 761px) {
  .topbar { padding-top: 24px; }
  .hero { padding: 40px 0; }
  .intro h1 { margin-top: 30px; margin-bottom: 26px; font-size: clamp(120px, 16vw, 190px); }
  .intro__footnote { margin-top: 38px; }
  .access-card { padding-top: 30px; padding-bottom: 30px; }
  .access-card form { margin-top: 26px; }
  .footer { padding-bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}