:root {
  --ink: #1a1a1a;
  --ink-2: #333;
  --gray: #78756e;
  --line: #d6d0c3;
  --paper: #fffdf7;
  --paper-2: #f5f0e5;
  --yellow: #ffd24d;
  --yellow-soft: #fff2ad;
  --danger: #bd3d35;
  --sans: "Source Han Sans SC", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --hand: "Chalkboard SE", "Comic Sans MS", "Kaiti SC", "STKaiti", cursive;
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(circle at 22% 26%, rgba(60,48,24,.045) 0 1px, transparent 1.5px);
  background-size: 19px 21px;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.auth-topbar {
  position: fixed;
  z-index: 30;
  left: 0;
  right: 0;
  top: 0;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(22px, 4vw, 58px);
  pointer-events: none;
}

.auth-topbar > * { pointer-events: auto; }
.auth-logo { display: inline-flex; align-items: center; gap: 10px; }
.auth-logo img { width: 49px; height: 42px; transition: transform .2s ease; }
.auth-logo:hover img { transform: translate(2px, -1px) rotate(-7deg); }
.auth-logo > span { display: grid; justify-items: center; }
.auth-logo b { font: 800 17px/1 var(--hand); letter-spacing: .095em; }
.auth-logo small { margin-top: 4px; font: 600 12.5px/1 var(--hand); letter-spacing: .42em; transform: translateX(2px); }
.auth-topbar > div { display: flex; align-items: center; gap: 12px; color: var(--gray); font-size: 13.5px; }
.auth-switch { min-height: 40px; display: inline-flex; align-items: center; padding: 8px 16px; border: 1.7px solid var(--ink); border-radius: 11px 8px 12px 9px; color: var(--ink); background: var(--paper); box-shadow: 2px 3px 0 rgba(26,26,26,.13); font-weight: 750; }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, .95fr) minmax(500px, 1.05fr); }
.auth-story { position: relative; min-height: 760px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding: 128px clamp(35px, 6vw, 100px) 76px; border-right: 2px solid var(--ink); background: var(--yellow); }
.auth-story::before { content: ""; position: absolute; width: 78%; height: 42%; left: -28%; bottom: -25%; border: 2px solid var(--ink); border-radius: 50%; opacity: .28; transform: rotate(5deg); }
.auth-story::after { content: ""; position: absolute; width: 64%; height: 37%; right: -30%; top: 16%; border: 2px solid var(--ink); border-width: 2px 0 0; border-radius: 50%; opacity: .31; transform: rotate(-18deg); }
.story-copy { position: relative; z-index: 2; }
.story-copy > p { margin: 0 0 18px; font: 800 12.5px var(--hand); letter-spacing: .14em; }
.story-copy h1 { margin: 0; font-size: clamp(42px, 4.5vw, 68px); line-height: 1.15; letter-spacing: -.06em; }
.story-copy h1 span { position: relative; z-index: 0; white-space: nowrap; }
.story-copy h1 span::after { content: ""; position: absolute; z-index: -1; left: -3%; right: -3%; bottom: .04em; height: .28em; border-radius: 50%; background: var(--paper); opacity: .7; transform: rotate(-2deg); }
.story-copy > small { display: block; margin-top: 20px; color: #5f4d08; font: 700 13.5px/1.7 var(--hand); }
.story-star { position: absolute; z-index: 1; font: 800 42px var(--hand); }
.star-a { right: 12%; top: 18%; transform: rotate(15deg); }
.star-b { left: 8%; top: 32%; font-size: 18px; transform: rotate(-17deg); }

.orbit-preview { position: relative; z-index: 2; width: min(390px, 92%); margin: 49px 0 0 auto; transform: rotate(-2deg); }
.orbit-card { padding: 22px 23px; border: 2px solid var(--ink); border-radius: 19px 14px 21px 15px; background: var(--paper); box-shadow: 6px 8px 0 rgba(26,26,26,.12); }
.orbit-card > span { color: var(--gray); font-size: 12.5px; }
.orbit-card > strong { display: block; margin-top: 3px; font-size: 42px; letter-spacing: -.05em; }
.orbit-card > small { color: var(--gray); font-size: 12.5px; }
.orbit-card > small b { color: #3b9763; font-size: 14px; }
.mini-bars { height: 76px; display: flex; align-items: end; gap: 9px; margin-top: 16px; padding: 0 5px; border-bottom: 1px solid #aaa49a; }
.mini-bars i { width: 26px; height: var(--h); border: 1.5px solid var(--ink); border-bottom: 0; border-radius: 4px 4px 0 0; background: repeating-linear-gradient(-25deg, #eeebe1 0 3px, #fff 3px 6px); }
.mini-bars i.active { background: repeating-linear-gradient(-25deg, var(--yellow) 0 4px, #ffdf75 4px 7px); }
.orbit-preview > p { width: fit-content; margin: 12px 15px 0 auto; padding-bottom: 5px; border-bottom: 3px solid var(--paper); font: 700 12.5px var(--hand); }

.auth-panel { display: grid; place-items: center; padding: 105px clamp(24px, 5vw, 76px) 58px; background: rgba(255,253,247,.9); }
.auth-card { width: min(470px, 100%); }
.auth-eyebrow { margin: 0; color: #806600; font: 800 12.5px var(--hand); letter-spacing: .15em; }
.auth-card h2 { margin: 11px 0 0; font-size: 37px; letter-spacing: -.045em; }
.auth-subtitle { margin: 10px 0 0; color: var(--gray); font-size: 13.5px; line-height: 1.7; }
.auth-form { display: grid; gap: 17px; margin-top: 30px; }
.auth-form > label:not(.check-field) { display: grid; gap: 8px; color: #4b4944; font-size: 13.5px; font-weight: 700; }
.auth-form input:not([type="checkbox"]) {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1.5px solid #aaa59a;
  border-radius: 12px 9px 13px 10px;
  outline: 0;
  color: var(--ink);
  background: #fff;
  font-size: 14px;
  transition: border .15s ease, box-shadow .15s ease;
}
.auth-form input:not([type="checkbox"]):focus { border-color: var(--ink); box-shadow: 3px 4px 0 rgba(255,210,77,.7); }
.password-field, .code-field { position: relative; display: grid; grid-template-columns: 1fr auto; }
.password-field input, .code-field input { grid-column: 1 / -1; grid-row: 1; padding-right: 64px !important; }
.password-field button { z-index: 1; grid-column: 2; grid-row: 1; align-self: center; margin-right: 12px; padding: 5px; border: 0; color: #806600; background: transparent; font-size: 12.5px; cursor: pointer; }
.code-field input { padding-right: 122px !important; }
.code-field button { z-index: 1; grid-column: 2; grid-row: 1; align-self: stretch; min-width: 108px; margin: 6px; border: 0; border-left: 1px dashed #c4bdae; color: #68530a; background: #fff8cf; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.code-field button:disabled { color: var(--gray); cursor: wait; }
.form-meta { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: -2px; }
.form-meta > button { padding: 4px 0; border: 0; color: #715a07; background: transparent; font-size: 12.5px; cursor: pointer; }
.check-field { display: flex !important; align-items: flex-start; gap: 8px !important; color: var(--gray) !important; font-size: 12.5px !important; font-weight: 500 !important; line-height: 1.6; }
.check-field input { width: 15px; height: 15px; flex: 0 0 auto; margin: 0; accent-color: var(--yellow); }
.agreement { margin-top: -2px; }
.form-error { min-height: 17px; margin: -4px 0 -3px; color: var(--danger); font-size: 12.5px; }
.auth-submit {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border: 2px solid var(--ink);
  border-radius: 14px 10px 15px 11px;
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 4px 5px 0 rgba(26,26,26,.14);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.auth-submit:hover { transform: translate(-1px,-2px) rotate(-.25deg); box-shadow: 6px 7px 0 rgba(26,26,26,.15); }
.auth-submit:disabled { opacity: .65; cursor: wait; transform: none; }
.demo-account { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin-top: 22px; padding: 13px 14px; border: 1px dashed #aaa397; border-radius: 12px 9px; background: #f6f2e8; }
.demo-account > span { padding: 5px 6px; border-radius: 6px 4px; color: #5c4907; background: var(--yellow); font: 800 12px var(--hand); }
.demo-account p { margin: 0; color: var(--gray); font-size: 12px; line-height: 1.65; }
.demo-account p b { color: var(--ink); font-family: ui-monospace, monospace; }
.demo-account button { padding: 6px; border: 0; color: #715a07; background: transparent; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.auth-footnote { margin: 25px 0 0; color: var(--gray); font-size: 12.5px; text-align: center; }
.auth-footnote a { color: var(--ink); font-weight: 750; text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.auto-name-note { display: flex; align-items: center; gap: 8px; margin: 21px 0 -7px; padding: 10px 12px; border: 1px solid #dfc44e; border-radius: 11px 8px; color: #66520b; background: #fff6c6; font-size: 12.5px; line-height: 1.6; }
.auto-name-note span { width: 21px; height: 21px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 7px 5px; color: var(--ink); background: var(--yellow); }

.register-story { background: #f2eee4; }
.register-story .story-copy h1 span::after { background: var(--yellow); }
.register-story .story-copy > small { color: #68645d; }
.story-benefits { position: relative; z-index: 2; display: grid; gap: 12px; width: min(420px, 100%); margin: 39px 0 0; padding: 0; list-style: none; }
.story-benefits li { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--ink); border-radius: 13px 9px 14px 10px; background: rgba(255,253,247,.86); box-shadow: 2px 3px 0 rgba(26,26,26,.09); }
.story-benefits li:nth-child(2) { margin-left: 18px; background: #fff6c8; transform: rotate(-.7deg); }
.story-benefits li > b { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--yellow); font: 800 12.5px var(--hand); }
.story-benefits li > span { display: grid; gap: 3px; }
.story-benefits strong { font-size: 13.5px; }
.story-benefits small { color: var(--gray); font-size: 12px; }
.story-telescope { position: absolute; z-index: 1; width: 190px; right: 5%; bottom: -12px; opacity: .6; }
.register-page .auth-panel { padding-top: 91px; padding-bottom: 34px; }
.register-page .auth-form { gap: 13px; margin-top: 22px; }
.register-page .auth-form > label:not(.check-field) > span:first-child small { margin-left: 5px; color: var(--gray); font-size: 12px; font-weight: 500; }
.register-page .auth-card h2 { font-size: 34px; }
.register-page .auth-form input:not([type="checkbox"]) { height: 47px; }
.register-page .auth-submit { min-height: 49px; }
.register-success { padding: 24px 0; text-align: center; }
.register-success > img { width: 90px; height: 73px; margin: 0 auto 18px; }
.register-success > p { margin: 0; color: #806600; font: 800 12.5px var(--hand); letter-spacing: .14em; }
.register-success h2 { margin: 14px 0 0; font-size: 37px; line-height: 1.25; }
.register-success > span { display: block; margin-top: 25px; color: var(--gray); font-size: 12.5px; }
.register-success > strong { width: fit-content; display: block; margin: 8px auto 0; padding: 7px 14px; border: 1.5px solid var(--ink); border-radius: 10px 7px; background: var(--yellow-soft); font: 800 15px var(--hand); transform: rotate(-1deg); }
.register-success > small { max-width: 340px; display: block; margin: 23px auto 0; color: var(--gray); font-size: 12.5px; line-height: 1.7; }
.register-success > .register-reward-message { margin-top: 12px; padding: 9px 12px; border: 1px solid #d4b74e; border-radius: 9px; color: #66520b; background: var(--yellow-soft); font-weight: 700; }
.register-success > .register-reward-message[hidden] { display: none; }
.register-success > div { display: grid; gap: 14px; margin-top: 27px; }
.back-home { color: var(--gray); font-size: 12.5px; text-decoration: underline; text-underline-offset: 4px; }
.auth-toast { position: fixed; z-index: 60; right: 24px; bottom: 24px; max-width: min(360px, calc(100% - 32px)); padding: 12px 16px; border: 1.5px solid var(--ink); border-radius: 11px 8px; background: var(--paper); box-shadow: 4px 5px 0 rgba(26,26,26,.14); font-size: 13.5px; }

@media (max-width: 960px) {
  .auth-topbar { position: absolute; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-story { min-height: 560px; padding: 132px 8vw 68px; border-right: 0; border-bottom: 2px solid var(--ink); }
  .story-copy { max-width: 680px; }
  .orbit-preview { position: absolute; width: 310px; right: 7vw; bottom: 52px; margin: 0; opacity: .94; }
  .login-page .story-copy { max-width: 52%; }
  .auth-panel { min-height: 680px; padding: 70px 24px; }
  .register-story { min-height: 640px; }
  .register-story .story-copy { max-width: 650px; }
  .story-benefits { width: min(390px, 70%); }
}

@media (max-width: 680px) {
  .auth-topbar { height: 66px; padding: 0 14px; }
  .auth-logo { gap: 6px; }
  .auth-logo img { width: 39px; height: 34px; }
  .auth-logo b { font-size: 14px; }
  .auth-logo small { font-size: 12px; }
  .auth-topbar > div > span { display: none; }
  .auth-switch { min-height: 35px; padding: 7px 11px; font-size: 12.5px; }
  .auth-story { min-height: 480px; justify-content: flex-start; padding: 118px 21px 45px; }
  .story-copy h1 { font-size: 43px; }
  .login-page .story-copy { max-width: 100%; }
  .orbit-preview { position: relative; right: auto; bottom: auto; width: min(340px, 94%); margin: 42px 0 0 auto; }
  .orbit-card { padding: 17px 18px; }
  .mini-bars { height: 65px; }
  .mini-bars i { width: 22px; }
  .auth-panel { min-height: 0; padding: 59px 18px 65px; }
  .auth-card h2, .register-page .auth-card h2 { font-size: 31px; }
  .auth-form { margin-top: 25px; }
  .demo-account { grid-template-columns: auto 1fr; }
  .demo-account button { display: none; }
  .register-story { min-height: 600px; }
  .register-story .story-copy { max-width: 100%; }
  .story-benefits { width: 100%; margin-top: 32px; }
  .story-benefits li:nth-child(2) { margin-left: 10px; }
  .story-telescope { width: 150px; right: -18px; opacity: .35; }
  .register-page .auth-panel { padding: 54px 18px 64px; }
  .register-success h2 { font-size: 32px; }
  .auth-toast { right: 16px; bottom: 16px; }
}

@media (max-width: 380px) {
  .auth-logo small { display: none; }
  .story-copy h1 { font-size: 38px; }
  .auth-card h2, .register-page .auth-card h2 { font-size: 28px; }
  .auth-form input:not([type="checkbox"]) { font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* Flat comfort pass for authentication surfaces. */
.auth-switch {
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: none;
}

.auth-story { border-right: 1px solid #d4b74e; }
.auth-story::before,
.auth-story::after { border-color: #9c8335; border-width: 1px; }

.orbit-preview { transform: none; }
.orbit-card {
  border: 1px solid #bdb6a9;
  border-radius: 17px;
  box-shadow: 0 14px 34px rgba(38, 34, 24, .075);
}

.mini-bars i { border: 1px solid #aaa397; border-bottom: 0; }

.auth-form input:not([type="checkbox"]) {
  border: 1px solid var(--line);
  border-radius: 10px;
}

.auth-form input:not([type="checkbox"]):focus {
  border-color: #c3a741;
  box-shadow: 0 0 0 3px rgba(255, 210, 77, .22);
}

.auth-submit {
  border: 1px solid #d4b13a;
  border-radius: 11px;
  box-shadow: none;
  transition: transform .14s ease, border-color .14s ease, background-color .14s ease;
}

.auth-submit:hover {
  transform: translateY(-1px);
  border-color: #c7a32d;
  background: #ffcc3a;
  box-shadow: 0 5px 14px rgba(181, 137, 15, .12);
}

.demo-account { border-color: var(--line); border-style: solid; border-radius: 10px; }

.story-benefits li {
  border: 1px solid #d0c9bc;
  border-radius: 11px;
  box-shadow: none;
}

.story-benefits li:nth-child(2) { transform: none; }

.register-success > strong {
  border: 1px solid #d4b74e;
  border-radius: 9px;
  transform: none;
}

.auth-toast {
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(38, 34, 24, .1);
}

@media (max-width: 960px) {
  .auth-story { border-right: 0; border-bottom: 1px solid #d4b74e; }
}

@media (max-width: 680px) {
  .auth-submit:hover { transform: none; }
  .orbit-card { box-shadow: 0 10px 24px rgba(38, 34, 24, .065); }
}
