/* portal base (inlined so /login never renders unstyled if portal.css fails to load) */
:root {
  --bg: #fff7ed;
  --bg2: #fdf2f8;
  --panel: rgba(255, 255, 255, 0.88);
  --panel2: rgba(255, 250, 245, 0.94);
  --text: #17122b;
  --muted: #6f6479;
  --line: rgba(190, 132, 88, 0.22);
  --purple: #7c3aed;
  --purple2: #a855f7;
  --rose: #e11d48;
  --orange: #f59e0b;
  --amber: #fbbf24;
  --green: #16a34a;
  --blue: #6d5dfc;
  --shadow: 0 22px 60px rgba(122, 58, 28, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 4%, rgba(245, 158, 11, 0.22), transparent 30%),
    radial-gradient(circle at 90% 8%, rgba(168, 85, 247, 0.18), transparent 32%),
    radial-gradient(circle at 50% 100%, rgba(225, 29, 72, 0.10), transparent 34%),
    linear-gradient(135deg, #fffaf2 0%, #fff7ed 42%, #fdf2f8 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(124, 58, 237, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 58, 237, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 90%);
}

a { color: inherit; text-decoration: none; }

.container {
  width: min(1380px, calc(100% - 48px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(135deg, #a855f7, #e11d48 55%, #f59e0b);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 21px;
  color: #fff;
  box-shadow: 0 16px 36px rgba(168, 85, 247, 0.22);
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.02em;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.nav-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 14px;
  border-radius: 999px;
  color: #5b375f;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(122, 58, 28, 0.07);
}

.pill.primary,
.btn.primary {
  background: linear-gradient(135deg, #7c3aed, #e11d48 60%, #f59e0b);
  border-color: transparent;
  color: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(190, 132, 88, 0.28);
  border-radius: 16px;
  padding: 14px 18px;
  font-weight: 900;
  background: #fff;
  color: #831843;
  box-shadow: 0 14px 34px rgba(122, 58, 28, 0.08);
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
}

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

.kicker {
  color: #be123c;
  font-weight: 900;
  letter-spacing: 0.02em;
  margin: 0 0 14px;
}

@media (max-width: 820px) {
  .container { width: min(100% - 28px, 1380px); }
  .nav { align-items: flex-start; gap: 18px; flex-direction: column; }
}

/* login page */
.login-page { padding-bottom: 48px; }

.login-main {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 32px;
  align-items: center;
  padding: 36px 0 58px;
}

.login-hero h2 {
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.06em;
  white-space: pre-line;
}

.login-hero h2 span {
  background: linear-gradient(90deg, #18112d, #7c3aed 50%, #c2410c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-hero .lead {
  color: #5e5570;
  font-size: 17px;
  line-height: 1.85;
  max-width: 620px;
  margin: 22px 0 0;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-tag {
  padding: 10px 14px;
  border: 1px solid rgba(190, 132, 88, 0.28);
  border-radius: 999px;
  background: #fffaf3;
  color: #6b3b62;
  font-weight: 800;
  font-size: 13px;
}

.login-panel { position: relative; }

.login-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 250, 245, 0.88));
  border-radius: 34px;
  padding: 24px 28px 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: -120px -100px auto auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.16);
  filter: blur(20px);
  pointer-events: none;
}

.auth-switch {
  position: relative;
  margin-bottom: 22px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 247, 237, 0.95);
  border: 1px solid rgba(190, 132, 88, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.auth-switch-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.auth-switch-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(135deg, #7c3aed, #e11d48 62%, #f59e0b);
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.28);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}

.auth-switch.register .auth-switch-indicator {
  transform: translateX(100%);
}

.auth-switch-btn {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  padding: 12px 16px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
  color: #8a7b91;
  cursor: pointer;
  transition: color 0.2s;
}

.auth-switch-btn.active {
  color: #fff;
}

.login-card h3 {
  margin: 0 0 8px;
  font-size: 26px;
  letter-spacing: -0.04em;
}

.card-desc {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

form { display: grid; gap: 14px; position: relative; }

.field { display: grid; gap: 8px; }

.field span {
  font-size: 12px;
  font-weight: 800;
  color: #6b3b62;
  letter-spacing: 0.02em;
}

.field input {
  width: 100%;
  height: 48px;
  border: 1px solid rgba(190, 132, 88, 0.24);
  border-radius: 16px;
  background: #fff;
  padding: 0 14px;
  font-size: 15px;
  color: var(--text);
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus {
  border-color: rgba(124, 58, 237, 0.45);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.field input::placeholder { color: #9d8da9; }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }

.toggle-pw {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 12px;
  background: #fff7ed;
  cursor: pointer;
  font-size: 14px;
}

.submit-btn {
  width: 100%;
  margin-top: 6px;
  border: 0;
  min-height: 50px;
  font-size: 15px;
  letter-spacing: 0.02em;
}

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

.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.submit-btn.loading .btn-spinner { display: inline-block; }

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

.status {
  min-height: 20px;
  margin: 12px 0 0;
  font-size: 13px;
  text-align: center;
}

.status.error { color: #be123c; }
.status.success { color: #16a34a; }
.status.info { color: var(--muted); }

.login-foot {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(190, 132, 88, 0.18);
  font-size: 12px;
  color: #8a7b91;
  line-height: 1.6;
  text-align: center;
}

.login-foot a { color: #7c3aed; font-weight: 800; }

.oauth-block {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(190, 132, 88, 0.18);
}

.oauth-block.hidden { display: none; }

.oauth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  color: #9d8da9;
  font-size: 12px;
  font-weight: 700;
}

.oauth-divider::before,
.oauth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(190, 132, 88, 0.2);
}

.oauth-buttons { display: grid; gap: 10px; }

.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  border-radius: 16px;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 8px 20px rgba(122, 58, 28, 0.08);
}

.oauth-btn.google {
  background: #fff;
  border: 1px solid rgba(190, 132, 88, 0.24);
  color: #3c4043;
}

.oauth-btn.wechat {
  background: #07c160;
  border: 1px solid transparent;
  color: #fff;
}

.oauth-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 900;
}

.login-card code {
  background: #fff7ed;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 12px;
}

@media (max-width: 960px) {
  .login-main { grid-template-columns: 1fr; }
  .login-hero { padding-top: 8px; }
}
