:root {
  --china-red: #b22234;
  --deep-red: #8b1e1e;
  --golden: #c9a87b;
  --paper: #fef7e8;
  --ink: #2c2418;
  --muted: #7b6654;
  --line: #ead6b6;
  --success: #276749;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 18%, rgba(201, 168, 123, 0.22), transparent 34%),
    linear-gradient(135deg, rgba(178, 34, 52, 0.08), rgba(201, 168, 123, 0.14)),
    var(--paper);
  color: var(--ink);
  font-family: "Noto Serif SC", "Times New Roman", serif;
}

a {
  color: var(--china-red);
  font-weight: 800;
  text-decoration: none;
}

a:hover {
  color: var(--deep-red);
}

.auth-shell {
  width: min(100% - 32px, 960px);
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: 20px 0 44px;
}

.auth-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 2px solid var(--golden);
  padding-bottom: 14px;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--china-red);
  font-size: 1.15rem;
  font-weight: 900;
}

.auth-brand img {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: contain;
}

.auth-nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.auth-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 36px 0 10px;
}

.auth-card {
  width: min(100%, 520px);
}

.auth-intro {
  text-align: center;
  margin-bottom: 18px;
}

.auth-intro h1 {
  color: var(--china-red);
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
  margin-bottom: 10px;
}

.auth-intro p {
  color: #4b382c;
  font-size: 1rem;
  line-height: 1.8;
}

.auth-panel {
  width: 100%;
  background: rgba(255, 250, 240, 0.97);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(54, 30, 18, 0.14);
  padding: 30px;
}

.auth-panel h2 {
  color: var(--china-red);
  font-size: 1.55rem;
  margin-bottom: 8px;
  text-align: center;
}

.auth-panel .hint {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 20px;
  text-align: center;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.form-field {
  display: grid;
  gap: 7px;
}

.form-field label {
  color: #4e2a1a;
  font-weight: 800;
}

.form-field input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #cfb38a;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 10px 13px;
}

.file-picker {
  width: 100%;
  min-height: 48px;
  border: 1px dashed #cfb38a;
  border-radius: 8px;
  background: #fff;
  color: var(--china-red);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  padding: 10px 13px;
  text-align: center;
}

.file-picker:hover {
  border-color: var(--china-red);
  background: #fff7eb;
}

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

.form-field input:focus {
  border-color: var(--china-red);
  box-shadow: 0 0 0 3px rgba(178, 34, 52, 0.12);
  outline: none;
}

.auth-button,
.ghost-button {
  min-height: 48px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 10px 18px;
}

.auth-button {
  background: var(--china-red);
  color: #fff;
}

.auth-button:hover {
  background: var(--deep-red);
}

.ghost-button {
  background: #eadcc8;
  color: #4b3121;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.status {
  min-height: 24px;
  color: var(--deep-red);
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
}

.status.success {
  color: var(--success);
}

.avatar-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  min-height: 74px;
}

.avatar-preview img {
  display: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--golden);
  object-fit: cover;
}

.profile-meta {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 14px;
  text-align: center;
}

@media (max-width: 640px) {
  .auth-shell {
    width: min(100% - 24px, 560px);
    padding-top: 14px;
  }

  .auth-nav {
    align-items: center;
    flex-direction: column;
  }

  .auth-nav-links {
    justify-content: center;
  }

  .auth-main {
    padding-top: 28px;
  }

  .auth-panel {
    padding: 24px 18px;
  }
}
