@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/inter-400.woff2") format("woff2");
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/inter-500.woff2") format("woff2");
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/inter-600.woff2") format("woff2");
}

:root {
  /* 颜色取自 /theme.css（全站唯一主题文件） */
  --page: rgb(var(--gray-100));
  --fg: rgb(var(--color-fg));
  --muted: rgb(var(--color-muted));
  --subtle: rgb(var(--color-subtle));
  --fill: rgb(var(--color-fill));
  --card: rgb(var(--color-panel));
  --danger: rgb(var(--danger-500));
  --brand: rgb(var(--color-brand));
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --well: inset 0 1px 2px rgb(var(--shadow-color) / 0.08), inset 0 0 0 1px rgb(var(--shadow-color) / 0.04);
  --raised: 0 0 0 1px rgb(var(--shadow-color) / 0.06), 0 1px 2px rgb(var(--shadow-color) / 0.08), 0 2px 6px -1px rgb(var(--shadow-color) / 0.06), inset 0 1px 0 #fff;
  --card-shadow:
    0 0 0 1px rgb(var(--shadow-color) / 0.08),
    0 1px 1px rgb(var(--shadow-color) / 0.05),
    0 4px 8px -2px rgb(var(--shadow-color) / 0.06),
    0 16px 32px -8px rgb(var(--shadow-color) / 0.09),
    0 40px 72px -20px rgb(var(--shadow-color) / 0.12);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  font-family: Inter, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  color: var(--fg);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

.lake {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: url("assets/lake.webp") 50% 85% / cover no-repeat;
  background-color: rgb(var(--gray-150));
}

.lake canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.lake canvas.is-ready {
  opacity: 1;
}

.grain,
.scan {
  position: absolute;
  pointer-events: none;
}

.grain {
  inset: -200px;
  background: url("assets/grain.webp") 0 0 / 220px 220px repeat;
  opacity: 0.6;
  animation: grain 0.333s steps(1) infinite;
  will-change: transform;
}

.scan {
  inset: 0;
  background: repeating-linear-gradient(
    transparent 0,
    transparent 2.5px,
    rgba(0, 0, 0, 0.047) 2.5px,
    rgba(0, 0, 0, 0.047) 3px
  );
}

@keyframes grain {
  0% { transform: translate3d(0, 0, 0); }
  12.5% { transform: translate3d(-137px, 61px, 0); }
  25% { transform: translate3d(83px, -149px, 0); }
  37.5% { transform: translate3d(-41px, -97px, 0); }
  50% { transform: translate3d(161px, 113px, 0); }
  62.5% { transform: translate3d(-173px, 29px, 0); }
  75% { transform: translate3d(53px, 167px, 0); }
  87.5% { transform: translate3d(109px, -47px, 0); }
}

main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 20px;
}

.shell {
  width: min(100%, 424px);
  min-width: 0;
}

.card { position: relative; overflow: hidden; border-radius: 16px; background: var(--card); box-shadow: 0 20px 64px -12px rgb(var(--shadow-color) / .2), 0 4px 12px rgb(var(--shadow-color) / .06); }
.card-body { padding: 36px 36px 28px; }
.head { display: flex; flex-direction: column; align-items: center; text-align: center; }
.mark { display: inline-flex; align-items: center; min-height: 40px; }
.mark img { display: block; height: 36px; width: auto; }
h1 { margin: 24px 0 0; font-size: 24px; line-height: 34px; font-weight: 600; letter-spacing: -.02em; overflow-wrap: anywhere; }
#subtitle { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 22px; }
form { display: flex; flex-direction: column; gap: 20px; margin-top: 28px; }
.field { display: flex; flex-direction: column; gap: 8px; }
label { color: var(--fg); font-size: 13px; line-height: 20px; font-weight: 500; }
.control { position: relative; }
.control input { display: block; min-width: 0; width: 100%; height: 44px; border: 1px solid rgb(var(--color-border)); border-radius: 8px; background: var(--card); padding: 0 12px; font-size: 14px; outline: none; caret-color: var(--fg); transition: border-color .15s, background .15s; }
.control input::placeholder { color: var(--muted); opacity: .85; }
.control input:hover:not(:disabled) { border-color: rgb(var(--color-border-strong)); }
.control input:focus { border-color: var(--brand); background: var(--card); outline: 2px solid rgb(var(--color-brand) / .1); outline-offset: 1px; }
.control input:-webkit-autofill,
.control input:-webkit-autofill:hover,
.control input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 1000px var(--card) inset; box-shadow: 0 0 0 1000px var(--card) inset; -webkit-text-fill-color: var(--fg); caret-color: var(--fg); transition: background-color 9999s ease-out 0s; }
.control input:disabled { background: var(--fill); color: var(--muted); }
#password { padding-right: 48px; }
.password-toggle { position: absolute; right: 5px; top: 5px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; background: transparent; border: 0; border-radius: 6px; color: var(--muted); }
.password-toggle:hover:not(:disabled) { color: var(--fg); background: var(--fill); }
.code-control { display: flex; gap: 8px; }
.code-control input { flex: 1; }
.code-btn { flex-shrink: 0; min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; color: var(--fg); background: var(--fill); font-size: 12px; font-weight: 500; white-space: nowrap; }
.code-btn:hover:not(:disabled) { background: rgb(var(--gray-150)); }
.session-options { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin-top: -4px; }
.remember-label { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; cursor: pointer; font-size: 13px; font-weight: 400; }
.remember-label input { width: 15px; height: 15px; margin: 0; accent-color: var(--brand); cursor: pointer; }
#remember-hint { color: var(--muted); font-size: 12px; line-height: 20px; }
.submit { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; padding: 10px 16px; border: 0; border-radius: 8px; background: var(--brand); color: rgb(var(--color-on-brand)); font-size: 14px; line-height: 22px; font-weight: 600; transition: background .15s; }
.submit:hover:not(:disabled) { background: rgb(var(--color-brand-hover)); }
button:disabled { cursor: not-allowed; opacity: .55; }
.submit:disabled { opacity: .7; }
.error { margin: -6px 0 0; border-radius: 8px; padding: 10px 12px; background: rgb(var(--danger-50)); color: #a52932; font-size: 12px; line-height: 20px; overflow-wrap: anywhere; }
.foot { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid rgb(var(--color-line)); text-align: center; color: var(--muted); font-size: 13px; line-height: 22px; }
.text-link { border: 0; background: transparent; color: var(--fg); padding: 2px 4px; border-radius: 4px; font-size: inherit; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgb(var(--color-border-strong)); }
.text-link:hover:not(:disabled) { text-decoration-color: var(--fg); }
.invite-note { margin: 16px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--fill); color: var(--muted); font-size: 12px; line-height: 20px; overflow-wrap: anywhere; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
::selection { background: var(--brand); color: rgb(var(--color-on-brand)); -webkit-text-fill-color: rgb(var(--color-on-brand)); }
@media (max-width: 480px) {
  main { padding: 24px 16px; }
  .card-body { padding: 28px 24px 24px; }
  .control input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  *, *::before, *::after { transition: none !important; }
}
