* { box-sizing: border-box; }

body.toon-auth {
  --ink: #101827;
  --paper: #fffdf5;
  --cream: #f5eddb;
  --yellow: #ffd34e;
  --orange: #ff7a59;
  --cyan: #39c5bd;
  --violet: #7567d8;
  --line: #101827;
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  display: grid;
  place-items: center;
  padding: 22px;
  color: var(--ink);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-weight: 600;
  text-rendering: optimizeLegibility;
  background-color: var(--cream);
  background-image: radial-gradient(#d8cbb2 1px, transparent 1px);
  background-size: 14px 14px;
}

body.toon-auth::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(57, 197, 189, .13), transparent 38%), linear-gradient(315deg, rgba(255, 122, 89, .12), transparent 44%);
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(1060px, 100%);
  min-height: 630px;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, .88fr);
  gap: 24px;
}

.auth-showcase,
.auth-panel {
  position: relative;
  overflow: hidden;
  border: 3px solid var(--line);
  box-shadow: 9px 9px 0 var(--line);
}

.auth-showcase {
  min-height: 630px;
  padding: 30px;
  background: var(--cyan);
  isolation: isolate;
}

.auth-showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .23;
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 12px 12px;
}

.auth-showcase::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -100px;
  width: 360px;
  height: 360px;
  border: 3px solid var(--line);
  border-radius: 50%;
  background: var(--yellow);
  z-index: -1;
}

.auth-brand { display: flex; align-items: center; gap: 10px; text-transform: uppercase; }
.auth-brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border: 3px solid var(--line); border-radius: 12px; background: var(--yellow); font-size: 26px; font-weight: 900; box-shadow: 4px 4px 0 var(--line); transform: rotate(-7deg); }
.auth-brand strong, .auth-brand small { display: block; line-height: 1; }
.auth-brand strong { font-size: 19px; letter-spacing: 1px; }
.auth-brand small { margin-top: 5px; font-size: 10px; font-weight: 800; letter-spacing: 2px; }
.comic-tag { display: inline-block; margin-top: 34px; padding: 6px 10px; border: 2px solid var(--line); background: var(--paper); font-size: 11px; font-weight: 900; letter-spacing: 1px; transform: rotate(-3deg); }
.speech-bubble { position: relative; width: min(300px, 80%); margin: 24px 0 0 12px; padding: 12px 14px; border: 3px solid var(--line); border-radius: 8px; background: var(--paper); font-size: 14px; font-weight: 800; line-height: 1.45; box-shadow: 5px 5px 0 var(--line); }
.speech-bubble::after { content: ""; position: absolute; left: 25px; bottom: -18px; width: 22px; height: 20px; border-right: 3px solid var(--line); border-bottom: 3px solid var(--line); background: var(--paper); transform: skewX(-28deg) rotate(24deg); }

.toon-driver { position: absolute; left: 50%; bottom: 94px; width: 230px; height: 310px; transform: translateX(-50%); animation: driver-bob 3.6s ease-in-out infinite; }
.helmet { position: absolute; left: 40px; top: 0; width: 150px; height: 112px; border: 5px solid var(--line); border-radius: 78px 78px 34px 34px; background: var(--orange); box-shadow: inset -13px -10px 0 rgba(16,24,39,.12); }
.helmet::before { content: ""; position: absolute; left: 22px; right: 22px; bottom: 18px; height: 35px; border: 4px solid var(--line); border-radius: 8px 8px 24px 24px; background: #202d43; }
.helmet-stripe { position: absolute; left: 71px; top: 0; width: 18px; height: 74px; border-left: 4px solid var(--line); border-right: 4px solid var(--line); background: var(--yellow); transform: skewX(-8deg); }
.driver-face { position: absolute; left: 53px; top: 83px; width: 124px; height: 116px; border: 5px solid var(--line); border-radius: 42px 42px 52px 52px; background: #ffd7af; }
.driver-eye { position: absolute; top: 31px; width: 29px; height: 35px; border: 4px solid var(--line); border-radius: 50%; background: #fff; overflow: hidden; }
.driver-eye.left { left: 22px; } .driver-eye.right { right: 22px; }
.pupil { position: absolute; left: 9px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--line); transition: transform .18s ease; }
.driver-mouth { position: absolute; left: 50%; bottom: 22px; width: 28px; height: 14px; border-bottom: 4px solid var(--line); border-radius: 0 0 20px 20px; transform: translateX(-50%); }
.driver-suit { position: absolute; left: 35px; bottom: 0; width: 160px; height: 130px; border: 5px solid var(--line); border-radius: 38px 38px 20px 20px; background: var(--violet); display: grid; place-items: center; color: #fff; font-size: 31px; font-weight: 900; box-shadow: inset -12px -12px 0 rgba(16,24,39,.16); }
.driver-suit span { transform: rotate(-8deg); }
.driver-glove { position: absolute; top: 205px; width: 55px; height: 25px; border: 5px solid var(--line); border-radius: 20px; background: var(--yellow); }
.driver-glove.left { left: 1px; transform: rotate(25deg); } .driver-glove.right { right: 1px; transform: rotate(-25deg); }
.speed-track { position: absolute; left: 24px; right: 24px; bottom: 40px; height: 44px; border-top: 4px solid var(--line); border-bottom: 4px solid var(--line); transform: skewY(-4deg); }
.speed-track span { display: inline-block; width: 48px; margin: 18px 15px 0 0; border-top: 4px dashed var(--line); animation: track-run .8s linear infinite; }
.speed-track span:nth-child(2) { animation-delay: -.25s; } .speed-track span:nth-child(3) { animation-delay: -.5s; }

.auth-panel { align-self: center; padding: 34px; background: var(--paper); }
.auth-panel::before { content: ""; position: absolute; right: -25px; top: -25px; width: 90px; height: 90px; border: 3px solid var(--line); border-radius: 50%; background: var(--yellow); }
.panel-kicker { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 900; letter-spacing: 1px; }
.panel-kicker span { width: 10px; height: 10px; border: 2px solid var(--line); border-radius: 50%; background: var(--orange); }
.auth-panel h1 { margin: 24px 0 8px; font-size: 34px; line-height: 1; letter-spacing: 0; }
.auth-subtitle { margin: 0 0 24px; color: #46566d; font-size: 13px; font-weight: 600; line-height: 1.65; }
.auth-error { display: grid; gap: 3px; margin-bottom: 16px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 6px; background: #ffd2cb; font-size: 12px; }
.auth-error strong { font-size: 11px; text-transform: uppercase; }
.auth-form { display: grid; gap: 14px; }
.auth-field { display: grid; gap: 6px; font-size: 12px; font-weight: 900; }
.input-slot { display: grid; grid-template-columns: 36px minmax(0, 1fr); min-height: 48px; border: 2px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; transition: box-shadow .18s ease, transform .18s ease; }
.input-slot:focus-within { box-shadow: 4px 4px 0 var(--cyan); transform: translate(-1px, -1px); }
.input-slot b { display: grid; place-items: center; border-right: 2px solid var(--line); background: var(--yellow); font-size: 11px; }
.input-slot input { min-width: 0; width: 100%; border: 0; outline: 0; padding: 0 12px; color: var(--ink); background: transparent; font: inherit; font-weight: 700; }
.input-slot input::placeholder { color: #6d798c; font-weight: 600; opacity: 1; }
.auth-submit { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 52px; margin-top: 5px; padding: 0 16px 0 18px; border: 3px solid var(--line); border-radius: 6px; background: var(--orange); color: var(--ink); box-shadow: 5px 5px 0 var(--line); cursor: pointer; font: inherit; font-size: 15px; font-weight: 900; transition: transform .18s ease, box-shadow .18s ease; }
.auth-submit b { padding: 4px 7px; border: 2px solid var(--line); border-radius: 4px; background: var(--yellow); font-size: 11px; }
.auth-submit:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--line); }
.auth-submit:active { transform: translate(4px, 4px); box-shadow: none; }
.auth-submit:disabled { opacity: .6; cursor: wait; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 24px; padding-top: 15px; border-top: 2px dashed #c9c0af; }
.auth-links a { color: var(--ink); font-size: 12px; font-weight: 900; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.auth-links a:hover { color: var(--orange); }

@keyframes driver-bob { 50% { transform: translate(-50%, -8px) rotate(1deg); } }
@keyframes track-run { to { transform: translateX(-64px); } }

@media (max-width: 760px) {
  body.toon-auth { padding: 14px; place-items: start center; }
  .auth-shell { grid-template-columns: 1fr; min-height: 0; max-width: 480px; gap: 16px; }
  .auth-showcase { min-height: 260px; padding: 18px; }
  .toon-driver { bottom: 38px; transform: translateX(-50%) scale(.7); transform-origin: bottom center; }
  .speech-bubble { margin-top: 16px; width: min(260px, 72%); }
  .speed-track { bottom: 20px; }
  .auth-panel { align-self: auto; }
}

@media (max-width: 320px) {
  body.toon-auth { padding: 8px; }
  .auth-shell { width: 100%; gap: 10px; }
  .auth-showcase { min-height: 142px; padding: 12px; box-shadow: 5px 5px 0 var(--line); }
  .auth-brand-mark { width: 34px; height: 34px; border-width: 2px; border-radius: 8px; font-size: 19px; box-shadow: 3px 3px 0 var(--line); }
  .auth-brand strong { font-size: 14px; } .auth-brand small { font-size: 8px; letter-spacing: 1px; }
  .comic-tag { position: absolute; right: 12px; top: 12px; margin: 0; font-size: 9px; padding: 4px 6px; }
  .speech-bubble { width: 190px; margin: 13px 0 0; padding: 7px 8px; border-width: 2px; box-shadow: 3px 3px 0 var(--line); font-size: 10px; }
  .toon-driver { right: 8px; left: auto; bottom: 18px; transform: scale(.32); transform-origin: right bottom; }
  .speed-track { left: 12px; right: 12px; bottom: 10px; height: 24px; border-width: 2px; }
  .speed-track span { margin-top: 8px; border-width: 2px; }
  .auth-panel { padding: 18px 14px; border-width: 2px; box-shadow: 5px 5px 0 var(--line); }
  .auth-panel h1 { margin-top: 16px; font-size: 26px; }
  .auth-subtitle { margin-bottom: 16px; font-size: 12px; }
  .auth-form { gap: 11px; }
  .input-slot { min-height: 44px; grid-template-columns: 32px minmax(0, 1fr); }
  .input-slot input { padding: 0 9px; font-size: 12px; }
  .auth-submit { min-height: 47px; font-size: 13px; box-shadow: 4px 4px 0 var(--line); }
  .auth-links { flex-direction: column; gap: 8px; margin-top: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .toon-driver, .speed-track span { animation: none; }
}
