:root {
  color-scheme: light;
  --ink: #161918;
  --muted: #6f7471;
  --line: rgba(21, 25, 23, 0.13);
  --green: #1d5f46;
  --red: #b84f55;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: #f3f5f2;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input { font: inherit; }

.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1.08fr) minmax(390px, 0.92fr);
  align-items: center;
  overflow: hidden;
  background: #f3f5f2;
}

.scene {
  position: relative;
  align-self: stretch;
  min-height: 720px;
}

.scene::before,
.scene::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
  opacity: 0.72;
}

.scene::before {
  width: 76%;
  aspect-ratio: 1;
  left: 3%;
  top: 10%;
  background:
    radial-gradient(circle at 28% 30%, rgba(90, 224, 190, 0.3), transparent 42%),
    radial-gradient(circle at 72% 34%, rgba(112, 163, 255, 0.26), transparent 43%),
    radial-gradient(circle at 48% 78%, rgba(255, 120, 162, 0.22), transparent 45%);
  animation: aura-drift 9s ease-in-out infinite alternate;
}

.scene::after {
  width: 56%;
  height: 13%;
  left: 20%;
  bottom: 8%;
  background: rgba(66, 92, 82, 0.13);
  filter: blur(24px);
}

.mascot-shell {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  width: min(510px, 78%);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  transform-origin: 50% 78%;
  animation: mascot-float 4.8s ease-in-out infinite;
}

.mascot-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 28px 36px rgba(43, 66, 57, 0.16));
}

.mascot-shell.is-wrong {
  animation: mascot-shake 720ms ease;
}

.mascot-shell.is-happy {
  animation: mascot-welcome 1.55s ease both;
}

.scene-label {
  position: absolute;
  left: 42px;
  bottom: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(22, 25, 24, 0.46);
  font-size: 10px;
  font-weight: 750;
}

.scene-label span {
  width: 28px;
  height: 1px;
  background: currentColor;
}

.content {
  position: relative;
  z-index: 2;
  width: min(520px, calc(100% - 64px));
  margin-right: clamp(34px, 7vw, 110px);
  padding: 80px 0;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 58px;
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: 0;
}

.subtitle {
  min-height: 30px;
  margin: 22px 0 34px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
  transition: color 220ms ease;
}

form label {
  display: block;
  margin: 0 0 10px;
  color: #454a47;
  font-size: 13px;
  font-weight: 720;
}

.remember-row {
  width: fit-content;
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  color: #737a76;
  font-size: 12px;
  font-weight: 600;
}

.remember-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(25, 48, 39, 0.23);
  border-radius: 5px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.75);
  transition: background 160ms ease, border-color 160ms ease;
}

.remember-row input:checked + .checkmark {
  border-color: var(--green);
  background: var(--green);
}

.remember-row input:checked + .checkmark::after {
  content: "";
  width: 8px;
  height: 4px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: translateY(-1px) rotate(-45deg);
}

.access-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  gap: 12px;
}

.liquid-input {
  position: relative;
  height: 56px;
  padding: 2px;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(
    110deg,
    #50e3c2,
    #67a8ff,
    #c77dff,
    #ff6f91,
    #ffbc42,
    #50e3c2
  );
  background-size: 320% 100%;
  box-shadow:
    0 12px 35px rgba(52, 83, 72, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.75) inset;
  animation: liquid-flow 6s linear infinite;
}

.liquid-input::before {
  content: "";
  position: absolute;
  inset: -35%;
  background: conic-gradient(
    from 30deg,
    transparent 0deg,
    rgba(255, 255, 255, 0.95) 52deg,
    transparent 105deg,
    transparent 220deg,
    rgba(255, 255, 255, 0.75) 280deg,
    transparent 335deg
  );
  animation: liquid-spin 4.8s linear infinite;
}

.liquid-input::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 7px;
  pointer-events: none;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    inset 0 -8px 18px rgba(130, 182, 163, 0.08);
}

.liquid-input:focus-within {
  box-shadow:
    0 15px 45px rgba(74, 130, 111, 0.2),
    0 0 28px rgba(106, 169, 255, 0.24);
  animation-duration: 2.4s;
}

input {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 6px;
  padding: 0 17px;
  outline: none;
  color: var(--ink);
  background: rgba(250, 252, 250, 0.9);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}

input::placeholder { color: #999f9b; }

button {
  height: 56px;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: white;
  background: #1b2924;
  cursor: pointer;
  font-weight: 750;
  box-shadow: 0 13px 28px rgba(27, 41, 36, 0.18);
  transition: transform 180ms ease, background 180ms ease;
}

button:hover {
  background: var(--green);
  transform: translateY(-2px);
}

button:disabled {
  cursor: wait;
  opacity: 0.64;
  transform: none;
}

.arrow {
  font-size: 20px;
  line-height: 1;
}

.privacy-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 15px 0 0;
  color: #8a908c;
  font-size: 11px;
}

.privacy-note span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4aa67b;
  box-shadow: 0 0 0 4px rgba(74, 166, 123, 0.12);
}

.message-error { color: var(--red); }
.message-success { color: var(--green); font-weight: 700; }

.scroll-cue {
  position: absolute;
  right: 34px;
  bottom: 34px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #757b77;
  text-decoration: none;
  font-size: 12px;
}

.scroll-cue i {
  width: 35px;
  height: 35px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-style: normal;
}

.origin {
  position: relative;
  padding: 120px max(28px, calc((100vw - 1120px) / 2)) 104px;
  color: #eef2ef;
  background: #111513;
}

.origin::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #48ddb1, #65a7ff, #d179ff, #ff718f, #ffc857, #48ddb1);
  background-size: 260% 100%;
  animation: liquid-flow 8s linear infinite;
}

.origin-heading p {
  margin: 0 0 16px;
  color: #7fd5b2;
  font-size: 11px;
  font-weight: 800;
}

.origin h2 {
  width: fit-content;
  margin: 0;
  color: transparent;
  background: linear-gradient(90deg, #f7fff9, #8de8c2, #8ebcff, #e19aff, #f7fff9);
  background-size: 240% auto;
  background-clip: text;
  -webkit-background-clip: text;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 52px;
  line-height: 1.22;
  letter-spacing: 0;
  animation: liquid-flow 9s linear infinite;
}

.origin-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 38px 0 72px;
}

.origin-intro p {
  grid-column: 2;
  margin: 0;
  color: #aeb7b1;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 19px;
  line-height: 2;
}

.principles {
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.principles article {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 24px;
  padding: 36px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.principles article > span {
  padding-top: 5px;
  color: #70cfa8;
  font-family: Georgia, serif;
  font-size: 14px;
}

.principles h3 {
  margin: 0 0 10px;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 24px;
  letter-spacing: 0;
}

.principles p {
  max-width: 680px;
  margin: 0;
  color: #939d97;
  font-size: 15px;
  line-height: 1.8;
}

.manifesto {
  margin: 70px 0 0;
  color: transparent;
  background: linear-gradient(90deg, #83e5bd, #84b4ff, #e09cff, #ffb66e, #83e5bd);
  background-size: 220% auto;
  background-clip: text;
  -webkit-background-clip: text;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 22px;
  font-weight: 800;
  animation: liquid-flow 8s linear infinite;
}

@keyframes liquid-flow {
  from { background-position: 0 50%; }
  to { background-position: 260% 50%; }
}

@keyframes liquid-spin {
  to { transform: rotate(360deg); }
}

@keyframes aura-drift {
  from { transform: translate3d(-2%, -2%, 0) scale(0.96) rotate(-3deg); }
  to { transform: translate3d(4%, 3%, 0) scale(1.05) rotate(4deg); }
}

@keyframes mascot-float {
  0%, 100% { transform: translate(-50%, -50%) translateY(0) rotate(-1deg); }
  50% { transform: translate(-50%, -50%) translateY(-12px) rotate(1deg); }
}

@keyframes mascot-shake {
  0%, 100% { transform: translate(-50%, -50%) rotate(0); }
  18% { transform: translate(-50%, -50%) rotate(-7deg); }
  36% { transform: translate(-50%, -50%) rotate(7deg); }
  54% { transform: translate(-50%, -50%) rotate(-5deg); }
  72% { transform: translate(-50%, -50%) rotate(4deg); }
}

@keyframes mascot-welcome {
  0% { transform: translate(-50%, -50%) scale(1) rotate(0); }
  28% { transform: translate(-50%, -54%) scale(1.04) rotate(-3deg); }
  56% { transform: translate(-50%, -50%) scale(1) rotate(2deg); }
  78% { transform: translate(-50%, -52%) scale(1.025) rotate(-1deg); }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0); }
}

@keyframes tear-fall {
  0% { transform: translateY(-3px) rotate(22deg) scale(0.55); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: translateY(48px) rotate(22deg) scale(1); opacity: 0; }
}

@media (max-width: 820px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .scene {
    min-height: 500px;
  }

  .content {
    width: calc(100% - 40px);
    margin: 0 auto;
    padding: 20px 0 94px;
    text-align: center;
  }

  h1 { font-size: 43px; }

  form { text-align: left; }

  .scene-label {
    left: 22px;
    bottom: 18px;
  }

  .scroll-cue {
    right: 20px;
    bottom: 25px;
  }

  .origin {
    padding: 84px 22px 74px;
  }

  .origin h2 { font-size: 40px; }

  .origin-intro {
    grid-template-columns: 1fr;
    margin: 28px 0 50px;
  }

  .origin-intro p { grid-column: 1; }
}

@media (max-width: 460px) {
  .scene { min-height: 420px; }

  .access-row { grid-template-columns: 1fr; }

  button { width: 100%; }

  .scroll-cue span { display: none; }

  .principles article {
    grid-template-columns: 42px 1fr;
    gap: 10px;
  }
}

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


/* 申请访问模式切换与状态卡片 */
.gate-expired-banner {
  margin: 0 0 14px;
  padding: 10px 13px;
  border-radius: 12px;
  background: rgba(255, 251, 235, 0.92);
  border: 1px solid rgba(217, 119, 6, 0.35);
  color: #92400e;
  font-size: 13px;
  line-height: 1.5;
}

.gate-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.gate-label-row label {
  margin-bottom: 0 !important;
}

.gate-inline-link {
  height: auto !important;
  min-width: 0 !important;
  padding: 2px 4px !important;
  border: 0 !important;
  border-radius: 6px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #3b5ccc !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  cursor: pointer;
  transition: color 150ms ease, opacity 150ms ease;
}

.gate-inline-link:hover {
  color: #1d4ed8 !important;
  text-decoration: underline;
  transform: none !important;
}

.gate-mode-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.06);
}

.gate-mode-tab {
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
}

.gate-mode-tab.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.apply-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 10px;
  margin-bottom: 12px;
}

.apply-grid label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.apply-submit-btn {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 14px;
  background: #182033;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 150ms ease, opacity 150ms ease;
}

.apply-submit-btn:hover {
  transform: translateY(-1px);
}

.apply-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.apply-status {
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.6;
}

.apply-status.pending {
  background: rgba(239, 246, 255, 0.92);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #1e40af;
}

.apply-status.approved {
  background: rgba(236, 253, 245, 0.95);
  border: 1px solid rgba(16, 185, 129, 0.38);
  color: #065f46;
}

.apply-status.rejected {
  background: rgba(254, 242, 242, 0.95);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #991b1b;
}

.apply-status .apply-reset-btn {
  margin-top: 10px;
  height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: #fff;
  color: #334155;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.issued-passcode-card {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px dashed rgba(16, 185, 129, 0.55);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.issued-passcode-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
}

.issued-passcode-code {
  margin: 2px 0 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #047857;
  line-height: 1.15;
}

.issued-passcode-meta {
  font-size: 11.5px;
  color: #475569;
}

.issued-passcode-note {
  margin-top: 6px;
  font-size: 12px;
  color: #047857;
}

.btn-copy-code {
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: #059669;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-copy-code:hover {
  background: #047857;
}

.issued-passcode-actions {
  margin-top: 10px;
}

/* 申请访问码模态弹框 */
.gate-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.gate-modal-backdrop.is-open {
  display: flex;
}

.gate-modal {
  width: 100%;
  max-width: 460px;
  padding: 24px 24px 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  text-align: left;
  animation: modal-pop 180ms ease-out;
}

@keyframes modal-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.gate-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.gate-modal-kicker {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #3b5ccc;
  margin-bottom: 4px;
}

.gate-modal h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.gate-modal-close {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  padding: 0 !important;
  border-radius: 10px !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  background: rgba(15, 23, 42, 0.04) !important;
  color: #475569 !important;
  font-size: 20px !important;
  line-height: 1 !important;
  box-shadow: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.gate-modal-close:hover {
  background: rgba(15, 23, 42, 0.1) !important;
  color: #0f172a !important;
  transform: none !important;
}

.gate-modal-desc {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.55;
  color: #64748b;
}

.apply-modal-error {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 12.5px;
  line-height: 1.45;
}

.apply-countdown-bar {
  margin-top: 8px;
  height: 5px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.16);
  overflow: hidden;
}

.apply-countdown-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #6366f1);
  transition: width 0.95s linear;
}

.apply-action-row {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.apply-retry-btn {
  height: 36px !important;
  min-width: 0 !important;
  padding: 0 14px !important;
  border-radius: 10px !important;
  border: 0 !important;
  background: #182033 !important;
  color: #ffffff !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  box-shadow: none !important;
  cursor: pointer;
}

.apply-retry-btn:disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

.apply-status .apply-reset-btn {
  margin-top: 0 !important;
  height: 36px !important;
  min-width: 0 !important;
  padding: 0 14px !important;
  box-shadow: none !important;
}

@media (max-width: 560px) {
  .apply-grid {
    grid-template-columns: 1fr;
  }
  .issued-passcode-card {
    flex-direction: column;
    align-items: stretch;
  }
  .gate-modal {
    padding: 20px 18px;
  }
}
