:root {
  --bg: #06070f;
  --ink: #eef1fb;
  --muted: #98a0bd;
  --line: rgba(255, 255, 255, 0.09);
  --card: rgba(255, 255, 255, 0.055);
  --brand-a: #7c5cff;
  --brand-b: #22d3ee;
  --danger: #ff6b81;
  --ok: #3ddc97;
  --radius: 26px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- 背景 ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.blob {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.55;
  will-change: transform;
}

.b1 {
  width: 46vmax; height: 46vmax;
  left: -14vmax; top: -16vmax;
  background: radial-gradient(circle at 30% 30%, #7c5cff, transparent 65%);
  animation: drift1 22s ease-in-out infinite alternate;
}

.b2 {
  width: 40vmax; height: 40vmax;
  right: -12vmax; top: 6vmax;
  background: radial-gradient(circle at 60% 40%, #22d3ee, transparent 65%);
  animation: drift2 26s ease-in-out infinite alternate;
}

.b3 {
  width: 34vmax; height: 34vmax;
  left: 24vmax; bottom: -18vmax;
  background: radial-gradient(circle at 50% 50%, #ff5c8a, transparent 68%);
  opacity: 0.32;
  animation: drift3 30s ease-in-out infinite alternate;
}

.grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 100%);
}

@keyframes drift1 { to { transform: translate3d(6vmax, 4vmax, 0) scale(1.1); } }
@keyframes drift2 { to { transform: translate3d(-5vmax, 6vmax, 0) scale(0.92); } }
@keyframes drift3 { to { transform: translate3d(4vmax, -5vmax, 0) scale(1.08); } }

/* ---------- 布局 ---------- */
.wrap {
  min-height: 100dvh;
  max-width: 460px;
  margin: 0 auto;
  padding: 48px 22px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-left: 4px;
  animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.mark {
  width: 42px; height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 19px;
  color: #06070f;
  background: linear-gradient(135deg, var(--brand-a), var(--brand-b));
  box-shadow: 0 10px 26px -10px rgba(124, 92, 255, 0.85);
}

.brand-text h1 {
  margin: 0;
  font-size: 19px;
  letter-spacing: 0.02em;
  font-weight: 700;
}

.brand-text p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.16em;
}

/* ---------- 卡片 ---------- */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.028));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px 24px;
  backdrop-filter: blur(26px) saturate(140%);
  -webkit-backdrop-filter: blur(26px) saturate(140%);
  box-shadow:
    0 34px 90px -30px rgba(0, 0, 0, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
  animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(120% 80% at 50% -20%, rgba(124, 92, 255, 0.22), transparent 60%);
}

/* ---------- 选项卡 ---------- */
.tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 22px;
}

.pill {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.95), rgba(34, 211, 238, 0.95));
  box-shadow: 0 8px 22px -8px rgba(124, 92, 255, 0.9);
  transition: transform 0.35s cubic-bezier(0.4, 0.1, 0.2, 1);
}

.pill.right { transform: translateX(100%); }

.tab {
  position: relative;
  z-index: 1;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 0;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.25s ease;
}

.tab.active { color: #06070f; }

/* ---------- 表单 ---------- */
.form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.05em;
}

input {
  width: 100%;
  padding: 14px 15px;
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 15px;
  outline: none;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

input::placeholder { color: rgba(152, 160, 189, 0.55); }

input:hover { background: rgba(255, 255, 255, 0.06); }

input:focus {
  border-color: rgba(124, 92, 255, 0.75);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.16);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px #14162a inset;
  transition: background-color 9999s ease-in-out 0s;
}

/* 密码强度 */
.meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: -2px;
}

.meter i {
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.3s ease;
}

.meter.s1 i:nth-child(-n + 1) { background: var(--danger); }
.meter.s2 i:nth-child(-n + 2) { background: #ffb020; }
.meter.s3 i:nth-child(-n + 3) { background: #a3e635; }
.meter.s4 i { background: var(--ok); }

/* ---------- 按钮 ---------- */
.btn {
  position: relative;
  overflow: hidden;
  appearance: none;
  border: 0;
  font: inherit;
  font-size: 14.5px;
  font-weight: 650;
  padding: 14px 18px;
  border-radius: 15px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.25s ease, filter 0.2s ease;
  letter-spacing: 0.02em;
}

.btn.primary {
  margin-top: 4px;
  color: #06070f;
  background: linear-gradient(135deg, var(--brand-a), var(--brand-b));
  box-shadow: 0 16px 38px -14px rgba(124, 92, 255, 0.95);
}

.btn.primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-18deg);
  transition: left 0.6s ease;
}

.btn.primary:hover::after { left: 120%; }

.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }

.btn:active { transform: translateY(0) scale(0.995); }

.btn:disabled {
  opacity: 0.65;
  cursor: progress;
  transform: none;
  filter: none;
}

.btn.ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  margin-top: 6px;
}

.btn.ghost:hover { background: rgba(255, 255, 255, 0.1); }

/* ---------- 已登录 ---------- */
.avatar {
  width: 66px;
  height: 66px;
  margin: 2px auto 16px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 800;
  color: #06070f;
  background: linear-gradient(135deg, var(--brand-a), var(--brand-b));
  box-shadow: 0 18px 40px -16px rgba(124, 92, 255, 0.95);
}

.card h2 {
  margin: 0;
  text-align: center;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.muted {
  margin: 7px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  word-break: break-all;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 22px 0 18px;
}

.stats > div {
  padding: 13px 6px;
  border-radius: 16px;
  text-align: center;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stats strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
}

.stats span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

/* ---------- 提示 ---------- */
.foot {
  text-align: center;
  font-size: 11.5px;
  color: rgba(152, 160, 189, 0.6);
  letter-spacing: 0.06em;
  margin: 0;
}

.toast {
  position: fixed;
  left: 50%;
  top: 24px;
  transform: translate(-50%, -18px);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 550;
  color: var(--ink);
  background: rgba(20, 22, 38, 0.9);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 10;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.err { border-color: rgba(255, 107, 129, 0.45); color: #ffd7de; }
.toast.ok { border-color: rgba(61, 220, 151, 0.45); color: #d5ffe9; }

/* ---------- 动效 ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.hidden { display: none !important; }

.shake { animation: shake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97); }

@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

@media (max-width: 420px) {
  .wrap { padding: 28px 16px 28px; }
  .card { padding: 22px 18px 20px; }
}

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