* { box-sizing: border-box; }
:root {
    --rice-paper: #FFF8EC;
    --paper-deep: #F3E4CC;
    --ink: #241A17;
    --ink-soft: #5C4540;
    --cinnabar: #B83B32;
    --cinnabar-dark: #8F2F2A;
    --clay: #A85D45;
    --clay-dark: #6E3C2F;
    --apricot: #E89A5A;
    --saffron: #D69B2D;
    --blush: #F6D1C3;
    --paper-line: #E2CFB5;
    --deep-error: #8F2F2A;
    --cjk: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    --radius-sm: 10px;
    --radius-md: 13px;
    --radius-lg: 18px;
    --radius-pill: 999px;
    --shadow-sm: 0 4px 12px rgba(77,49,34,.06);
    --shadow-md: 0 8px 20px rgba(77,49,34,.09);
}
html { min-height: 100%; }
body.auth-page { display: flex; min-height: 100vh; flex-direction: column; overflow-x: hidden; margin: 0; color: var(--ink-soft); background: var(--rice-paper); font-family: "Nunito", sans-serif; font-size: 16px; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--cinnabar-dark); outline-offset: 3px; }
::selection { color: var(--ink); background: var(--blush); }
.auth-container { width: min(1200px, calc(100% - 44px)); margin-inline: auto; }

.auth-nav { position: sticky; top: 0; z-index: 50; border-bottom: 1.5px solid var(--paper-line); background: rgba(255, 248, 236, .96); backdrop-filter: blur(7px); }
.auth-nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; }
.auth-brand { flex: none; display: inline-flex; align-items: center; }
.auth-brand .brand-image { width: 186px; height: auto; }
.auth-actions { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
.auth-brand-mark { display: grid; width: 37px; height: 37px; place-items: center; border-radius: 11px; background: var(--cinnabar); box-shadow: 0 3px 0 var(--cinnabar-dark); color: var(--rice-paper); }
.auth-back { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border: 1.5px solid var(--paper-line); border-radius: 11px; background: #FFFCF7; box-shadow: 0 2px 0 rgba(226,207,181,.55); color: var(--ink-soft); font-size: 14px; font-weight: 700; transition: transform .1s, box-shadow .1s, background .15s; }
.auth-back:hover { transform: translateY(-1px); box-shadow: 0 3px 0 rgba(226,207,181,.7); background: #fff; }

.auth-main { position: relative; display: flex; flex: 1; align-items: center; justify-content: center; overflow: hidden; padding: 36px 0 40px; }
.auth-bg-hanzi { position: absolute; z-index: 0; color: transparent; font-family: var(--cjk); font-weight: 700; line-height: 1; pointer-events: none; user-select: none; -webkit-text-stroke: 1.8px var(--paper-deep); }
.auth-bg-hanzi-one { top: 38px; left: 6%; font-size: 110px; transform: rotate(-12deg); }
.auth-bg-hanzi-two { right: 6%; bottom: 36px; font-size: 90px; transform: rotate(10deg); }
.auth-bg-hanzi-three { top: 60%; left: 50%; font-size: 64px; opacity: .38; transform: rotate(5deg); }

.auth-card { position: relative; z-index: 2; width: min(100% - 32px, 480px); padding: 28px 26px 26px; border: 1.5px solid var(--paper-line); border-radius: 18px; background: #FFFCF7; box-shadow: var(--shadow-md); animation: auth-fade-up .5s ease both; }
.auth-head { margin-bottom: 24px; text-align: center; }
.auth-head h1 { margin: 0 0 6px; color: var(--ink); font-family: "Fredoka", sans-serif; font-size: 27px; font-weight: 700; line-height: 1.2; }
.auth-head p { margin: 0; color: var(--ink-soft); font-size: 14.5px; font-weight: 600; line-height: 1.5; }
.auth-mascot { width: 96px; margin: 0 auto 10px; animation: auth-float 3.5s ease-in-out infinite; }
.auth-mascot img { display: block; width: 100%; height: auto; }

.auth-tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 22px; border-radius: 12px; background: var(--paper-deep); border: 1px solid rgba(226,207,181,.5); }
.auth-tab { flex: 1; padding: 10px 12px; border: 1.5px solid transparent; border-radius: 10px; background: transparent; color: var(--ink-soft); cursor: pointer; font-family: "Fredoka", sans-serif; font-size: 14.5px; font-weight: 600; text-align: center; transition: background .18s, color .18s, box-shadow .18s, border-color .18s; }
.auth-tab:hover:not(.is-active) { color: var(--ink); background: rgba(255,255,255,.45); }
.auth-tab.is-active { background: #FFFCF7; border-color: var(--paper-line); box-shadow: 0 2px 8px rgba(77,49,34,.08); color: var(--ink); font-weight: 700; }

.auth-errors { padding: 12px 14px; margin: -6px 0 16px; border: 1.5px solid var(--deep-error); border-radius: 11px; background: var(--blush); color: var(--deep-error); font-size: 13px; font-weight: 700; }
.auth-errors p { margin: 0; }
.auth-errors p + p { margin-top: 4px; }
.auth-success { padding: 12px 14px; margin: -6px 0 16px; border: 1.5px solid var(--umber-success, #7B5A20); border-radius: 11px; background: rgba(214, 173, 78, .12); color: var(--umber-success, #7B5A20); font-size: 13px; font-weight: 700; }
.auth-success p { margin: 0; }
.auth-form { display: none; flex-direction: column; gap: 14px; }
.auth-form.is-active { display: flex; animation: auth-fade-up .3s ease both; }
.auth-name-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label { margin: 0; color: var(--ink); font-size: 14.5px; font-weight: 700; }
.auth-input-wrap { position: relative; }
.auth-input { width: 100%; padding: 12px 15px; border: 1.5px solid var(--paper-line); border-radius: 11px; outline: 0; background: #fff; box-shadow: 0 1px 0 rgba(226,207,181,.35); color: var(--ink); font-size: 15px; font-weight: 600; transition: border-color .18s, box-shadow .18s; }
.auth-input::placeholder { color: #9A8A7E; font-weight: 500; opacity: 1; }
.auth-input:focus { border-color: var(--cinnabar-dark); box-shadow: 0 2px 0 var(--cinnabar-dark); }
.auth-input-wrap.has-eye .auth-input { padding-right: 44px; }
.auth-eye { position: absolute; top: 50%; right: 10px; display: grid; padding: 6px; border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; place-items: center; transform: translateY(-50%); border-radius: 8px; }
.auth-eye:hover { color: var(--ink); background: var(--paper-deep); }
.auth-eye .is-hidden { display: none; }
.auth-field-hint { margin: 0; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.auth-options { display: flex; align-items: center; justify-content: flex-end; min-height: 22px; color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.auth-soon { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 13px; }
.auth-soon.is-muted { opacity: .85; cursor: default; }
.auth-soon em { padding: 2px 8px; border-radius: 999px; background: var(--saffron); color: var(--ink); font-size: 10px; font-style: normal; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.auth-soon-chip { padding: 2px 8px; border-radius: 999px; background: var(--saffron); color: var(--ink); font-size: 10px; font-style: normal; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.auth-btn { display: inline-flex; width: 100%; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 13px 22px; border: 0; border-radius: 13px; background: var(--cinnabar); box-shadow: 0 4px 0 var(--cinnabar-dark); color: #FFFCF7; cursor: pointer; font-family: "Fredoka", sans-serif; font-size: 16px; font-weight: 600; transition: transform .08s, box-shadow .08s, background .15s; }
.auth-btn:hover { background: var(--cinnabar-dark); }
.auth-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--cinnabar-dark); }
.auth-btn:disabled { cursor: wait; opacity: .7; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 8px 0; color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.auth-divider::before, .auth-divider::after { flex: 1; height: 1.5px; border-radius: 1px; background: var(--paper-line); content: ""; }
.auth-social-row { display: flex; gap: 10px; }
.auth-social { display: inline-flex; flex: 1; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 11px 12px; border: 1.5px solid var(--paper-line); border-radius: 11px; background: #FFFCF7; box-shadow: 0 2px 0 rgba(226,207,181,.45); color: var(--ink-soft); cursor: pointer; font-size: 14px; font-weight: 700; text-align: center; transition: background .15s, border-color .15s, opacity .15s; }
.auth-social:hover:not(.is-disabled) { background: #fff; border-color: var(--clay); }
.auth-social.is-disabled { cursor: not-allowed; opacity: .55; pointer-events: none; border-style: dashed; }
.auth-form-footer { margin: 6px 0 0; color: var(--ink-soft); font-size: 14px; font-weight: 600; text-align: center; }
.auth-form-footer a { color: var(--cinnabar-dark); font-weight: 700; }
.auth-form-footer a:hover { text-decoration: underline; }
.auth-terms { display: flex; align-items: flex-start; gap: 8px; color: var(--ink-soft); font-size: 13px; font-weight: 600; line-height: 1.45; }
.auth-terms input { width: 16px; height: 16px; flex: none; margin: 2px 0 0; accent-color: var(--cinnabar); }
.auth-terms a { color: var(--cinnabar-dark); font-weight: 700; text-decoration: underline; }
.auth-submit-note { display: none; padding: 10px 12px; border-radius: 10px; background: var(--paper-deep); color: var(--ink-soft); font-size: 12px; font-weight: 700; text-align: center; }
.auth-submit-note.is-visible { display: block; }

.auth-mini-footer { padding: 16px 22px; border-top: 1.5px solid var(--paper-line); background: rgba(255, 248, 236, .8); color: var(--ink-soft); font-size: 12.5px; font-weight: 600; text-align: center; }
@keyframes auth-fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes auth-float { 50% { transform: translateY(-5px); } }

@media (max-width: 860px) {
    .auth-brand .brand-image { width: 168px; }
}
@media (max-width: 640px) {
    .auth-brand .brand-image { width: 150px; }
    .auth-card { padding: 24px 18px; }
    .auth-head h1 { font-size: 24px; }
    .auth-bg-hanzi { font-size: 80px; }
    .auth-bg-hanzi-two { font-size: 66px; }
}
@media (max-width: 480px) {
    .auth-container { width: min(100% - 24px, 1200px); }
    .auth-card { padding: 22px 16px; border-radius: 16px; }
    .auth-social-row { flex-direction: column; }
    .auth-name-grid { grid-template-columns: 1fr; }
    .auth-bg-hanzi { font-size: 64px; }
    .auth-bg-hanzi-two { font-size: 52px; }
    .auth-bg-hanzi-three { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* auth-specific theme toggle compact */
.auth-actions .theme-toggle { width: 38px; height: 38px; border-width: 1.5px; border-radius: 11px; box-shadow: 0 2px 0 rgba(226,207,181,.5); }
