:root {
  color-scheme: light;
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --paper: #f8fafc;
  --white: #ffffff;
  --brand: #1e3a5f;
  --brand-dark: #16293f;
  --brand-soft: #eef2f7;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #eff6ff;
  --success: #047857;
  --success-soft: #ecfdf5;
  --success-line: #a7f3d0;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --danger-line: #fecaca;
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 8px;
  --shadow: 0 1px 2px rgb(15 23 42 / 6%);
  --shadow-md: 0 4px 14px rgb(15 23 42 / 8%);
  /* 兼容旧变量名，避免遗漏引用 */
  --navy: var(--brand);
  --navy-soft: #3b5f85;
  --orange: var(--accent);
  --mint: var(--success-soft);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3 {
  font-weight: 600;
}

/* ---------- 登录 / 注册 ---------- */

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(420px, 1.18fr);
  background: var(--white);
}

.brand-panel {
  padding: clamp(2.5rem, 5.5vw, 4.5rem);
  color: var(--white);
  background: var(--brand);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-mark {
  width: 3rem;
  height: 3rem;
  overflow: hidden;
  margin-bottom: 2.5rem;
  border: 1px solid rgb(255 255 255 / 26%);
  border-radius: 0.6rem;
  background: var(--white);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.eyebrow {
  margin: 0 0 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-panel h1 {
  margin: 0;
  max-width: 16ch;
  font-size: clamp(1.75rem, 3.2vw, 2.6rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.brand-copy {
  max-width: 28rem;
  margin: 1.1rem 0 0;
  color: rgb(255 255 255 / 70%);
  font-size: 0.95rem;
  line-height: 1.85;
}

.brand-points {
  margin: 2.25rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgb(255 255 255 / 12%);
}

.brand-points li {
  position: relative;
  padding: 0.8rem 0 0.8rem 1rem;
  border-bottom: 1px solid rgb(255 255 255 / 10%);
  color: rgb(255 255 255 / 78%);
  font-size: 0.88rem;
  line-height: 1.6;
}

.brand-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.3rem;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgb(255 255 255 / 45%);
}

.avatar {
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
  font-size: 0.9rem;
}

.avatar-blue {
  background: var(--brand-soft);
  color: var(--brand);
}

.avatar-orange {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.auth-panel {
  padding: clamp(1.5rem, 5vw, 4rem);
  display: grid;
  place-items: center;
  background: var(--paper);
}

.auth-card {
  width: min(100%, 27rem);
}

.auth-heading h2 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.4rem, 2.6vw, 1.7rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.auth-heading > p:last-child,
.auth-note {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.75;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 1.75rem 0 1.4rem;
  border-bottom: 1px solid var(--line);
}

.tab {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  margin-bottom: -1px;
  padding: 0.7rem 0.5rem;
  color: var(--muted);
  background: transparent;
  font-size: 0.92rem;
  font-weight: 600;
}

.tab.active {
  color: var(--brand);
  border-bottom-color: var(--accent);
  background: transparent;
}

.auth-form {
  display: grid;
  gap: 1.05rem;
}

.auth-form label {
  display: grid;
  gap: 0.4rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 600;
}

.auth-form input {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--white);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.auth-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 12%);
}

.auth-form input::placeholder {
  color: #94a3b8;
}

.primary-button {
  min-height: 2.85rem;
  margin-top: 0.4rem;
  border: 0;
  border-radius: var(--radius);
  color: var(--white);
  background: var(--brand);
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: background 120ms ease;
}

.primary-button:hover {
  background: var(--brand-dark);
}

.auth-note {
  margin: 1.25rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.hidden {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 10;
  transform: translate(-50%, 0.75rem);
  max-width: min(90vw, 32rem);
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  color: var(--white);
  background: var(--ink);
  box-shadow: var(--shadow-md);
  font-size: 0.88rem;
  opacity: 0;
  pointer-events: none;
  transition: 160ms ease;
}

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

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    padding: 2rem 1.5rem 1.75rem;
  }

  .brand-mark {
    width: 2.3rem;
    height: 2.3rem;
    margin-bottom: 1.5rem;
  }

  .brand-panel h1 {
    max-width: none;
    font-size: 1.7rem;
  }

  .brand-copy {
    margin-top: 0.85rem;
    font-size: 0.9rem;
  }

  .brand-points {
    display: none;
  }

  .auth-panel {
    padding: 1.75rem 1.25rem 3rem;
    place-items: start stretch;
  }

  .auth-card {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
