/* 登录、注册页左边的品牌区和宠物（橘猫 + 小麻雀）。形象是原创 SVG（js/auth/mascot.js），动作靠 svg 上的 data-* 属性切换，
   只用 CSS transform / transition。宠物的毛色、纸色是插画自己的调色板，明暗各一套；其余颜色都用 tokens.css 的变量。 */

.mascot {
  --m-fur: #eb9a4b; --m-fur-d: #c4722a; --m-belly: #fbe3c2; --m-pink: #f2a09b; --m-ink: #2b2320; --m-eyew: #fffdf8;
  --m-p1: #fffaf0; --m-p2: #f2e8d4; --m-p3: #e6d9be; --m-rule: #cdbf9f; --m-bird: #8d6b4e; --m-bird-d: #6c5039; --m-beak: #e9a43e; --m-mouth: #b9434a;
  --px: 0; --py: 0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mascot {
    --m-fur: #dd8c46; --m-fur-d: #b46a2a; --m-belly: #ebcba5; --m-pink: #e58f8a; --m-ink: #1b1613; --m-eyew: #f1ece2;
    --m-p1: #d8cfbc; --m-p2: #c0b7a3; --m-p3: #a69e8b; --m-rule: #8c8472; --m-bird: #ad8c6e; --m-bird-d: #8a6d52; --m-beak: #e0a043; --m-mouth: #a8434b;
  }
}
:root[data-theme="dark"] .mascot {
  --m-fur: #dd8c46; --m-fur-d: #b46a2a; --m-belly: #ebcba5; --m-pink: #e58f8a; --m-ink: #1b1613; --m-eyew: #f1ece2;
  --m-p1: #d8cfbc; --m-p2: #c0b7a3; --m-p3: #a69e8b; --m-rule: #8c8472; --m-bird: #ad8c6e; --m-bird-d: #8a6d52; --m-beak: #e0a043; --m-mouth: #a8434b;
}

.mascot-wrap { width: min(340px, 100%); margin: 0 auto; pointer-events: none; user-select: none; }
.mascot { display: block; width: 100%; height: auto; overflow: visible; }
.mascot .shadow { fill: color-mix(in srgb, var(--ink) 14%, transparent); }

/* 填色 */
.mascot .fur { fill: var(--m-fur); }
.mascot .ear-o { stroke: var(--m-fur); stroke-width: 8; stroke-linejoin: round; }
.mascot .belly { fill: var(--m-belly); }
.mascot .pink { fill: var(--m-pink); }
.mascot .cheek { fill: var(--m-pink); opacity: .4; }
.mascot .ink { fill: var(--m-ink); }
.mascot .glint { fill: #fff; }
.mascot .eyew { fill: var(--m-eyew); }
.mascot .paper1 { fill: var(--m-p1); stroke: var(--m-p3); stroke-width: 1; }
.mascot .paper2 { fill: var(--m-p2); stroke: var(--m-p3); stroke-width: 1; }
.mascot .paper3 { fill: var(--m-p3); }
.mascot .pen-b { fill: var(--run); } .mascot .pen-t { fill: var(--m-ink); } .mascot .pen-c { fill: var(--accent); }
.mascot .bird-b { fill: var(--m-bird); } .mascot .bird-tail, .mascot .bird-w { fill: var(--m-bird-d); }
.mascot .beak { fill: var(--m-beak); }
.mascot .bird-leg { stroke: var(--m-beak); stroke-width: 2; stroke-linecap: round; fill: none; }
.mascot .m-open { fill: var(--m-mouth); stroke: var(--m-ink); }

/* 线 */
.mascot .tailp { stroke: var(--m-fur); stroke-width: 17; stroke-linecap: round; fill: none; }
.mascot .rule { stroke: var(--m-rule); stroke-width: 1.5; stroke-linecap: round; fill: none; }
.mascot .stripe, .mascot .toe, .mascot .brow { stroke: var(--m-fur-d); stroke-linecap: round; fill: none; }
.mascot .stripe { stroke-width: 5; } .mascot .toe { stroke-width: 3; } .mascot .brow { stroke-width: 4; opacity: 0; }
.mascot .whisk { stroke: var(--m-eyew); stroke-width: 2; stroke-linecap: round; fill: none; opacity: .75; }
.mascot .mouth { stroke: var(--m-ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; fill: none; opacity: 0; }
.mascot .lash, .mascot .arc { stroke: var(--m-ink); stroke-width: 4; stroke-linecap: round; fill: none; opacity: 0; }

/* 嘴 */
.mascot[data-mouth="smile"] .m-smile, .mascot[data-mouth="flat"] .m-flat, .mascot[data-mouth="frown"] .m-frown,
.mascot[data-mouth="open"] .m-open, .mascot[data-mouth="smirk"] .m-smirk { opacity: 1; }

/* 眼睛：瞳孔跟着 --px/--py 挪；眼皮 scaleY 盖下来（眨眼、闭眼、眯一半） */
.mascot .pupil { transform: translate(calc(var(--px) * 1px), calc(var(--py) * 1px)); }
.mascot .lid { transform-box: fill-box; transform-origin: 50% 0; transform: scaleY(0); }
.mascot.is-blink[data-eyes="open"] .lid, .mascot[data-eyes="closed"] .lid { transform: scaleY(1); }
.mascot[data-eyes="smirk"] .lid { transform: scaleY(.42); }
.mascot[data-eyes="smirk"] .brow { opacity: 1; }
.mascot[data-eyes="closed"] .lash { opacity: 1; }
.mascot[data-eyes="happy"] .arc { opacity: 1; }
.mascot[data-eyes="happy"] .eyew, .mascot[data-eyes="happy"] .pupil, .mascot[data-eyes="happy"] .lid { opacity: 0; }

/* 耳朵、爪子、小麻雀 */
.mascot .ear, .mascot .head, .mascot .bird, .mascot .bird-head { transform-box: fill-box; }
.mascot .ear { transform-origin: 50% 100%; }
.mascot[data-ears="down"] .ear-l { transform: rotate(-15deg) translateY(3px); }
.mascot[data-ears="down"] .ear-r { transform: rotate(15deg) translateY(3px); }
.mascot .bird { transform-origin: 50% 100%; }
.mascot .bird-head { transform-origin: 20% 90%; }
/* 捂眼时：麻雀身体前倾 25 度、脑袋再往下探，小眼睛朝右下（密码框那边）看；显示密码时眼睛瞪大 */
.mascot[data-bird="peek"] .bird, .mascot[data-bird="surprise"] .bird { transform: translate(5px, 4px) rotate(25deg); }
.mascot[data-bird="peek"] .bird-head, .mascot[data-bird="surprise"] .bird-head { transform: rotate(30deg) translate(3px, 4px); }
.mascot .bird-eye { transform-box: fill-box; transform-origin: 50% 50%; }
.mascot .beye-w { fill: var(--m-eyew); }
.mascot[data-bird="peek"] .bpupil, .mascot[data-bird="surprise"] .bpupil { transform: translate(.9px, 1px); }
.mascot[data-bird="surprise"] .bird-eye { transform: scale(1.7); }
/* 爪心对准眼心：眼睛在 (153,120) 和 (207,120)，爪子平时在 (140,214) 和 (220,214)；胳膊从身体两侧抬上来 */
.mascot .armp, .mascot .armo { stroke: var(--m-fur); stroke-width: 24; stroke-linecap: round; fill: none; opacity: 0; }
.mascot .armo { stroke: var(--m-fur-d); stroke-width: 29; }
.mascot[data-paw-l="cover"] .paw-l { transform: translate(13px, -94px); }
.mascot[data-paw-r="cover"] .paw-r { transform: translate(-13px, -94px); }
.mascot[data-paw-r="peek"] .paw-r { transform: translate(-4px, -50px); }
.mascot:not([data-paw-l="rest"]) .arm-l, .mascot:not([data-paw-r="rest"]) .arm-r { opacity: 1; }
.mascot .pawo { fill: var(--m-belly); stroke: var(--m-fur-d); stroke-width: 3; }
.mascot .pad { fill: var(--m-pink); }

/* zzz */
.mascot .zzz { opacity: 0; }
.mascot[data-zzz="1"] .zzz { opacity: 1; }
.mascot .z { fill: var(--note); font: 700 22px var(--font-read); }

/* 过渡（只在没要求减少动态效果时） */
.mascot[data-anim="on"] .pupil { transition: transform 90ms ease-out; }
.mascot[data-anim="on"] .lid { transition: transform 110ms ease-in-out; }
.mascot[data-anim="on"] .ear, .mascot[data-anim="on"] .bird, .mascot[data-anim="on"] .bird-head, .mascot[data-anim="on"] .bird-eye { transition: transform 300ms cubic-bezier(.3, .8, .3, 1); }
.mascot[data-anim="on"] .paw { transition: transform 300ms cubic-bezier(.3, .8, .3, 1); }
.mascot[data-anim="on"] .armp, .mascot[data-anim="on"] .armo, .mascot[data-anim="on"] .mouth, .mascot[data-anim="on"] .arc, .mascot[data-anim="on"] .lash, .mascot[data-anim="on"] .zzz, .mascot[data-anim="on"] .brow { transition: opacity 160ms ease; }

/* 动作 */
.mascot .head { transform-origin: 50% 100%; }
.mascot[data-shake="1"] .head { animation: m-shake .55s ease-in-out; }
.mascot[data-bounce="1"] .all { animation: m-bounce .6s cubic-bezier(.3, .9, .4, 1) both; }
.mascot[data-anim="on"] .tail { transform-box: fill-box; transform-origin: 0 100%; animation: m-tail 3.4s ease-in-out infinite alternate; }
.mascot[data-anim="on"][data-zzz="1"] .z { animation: m-z 2.4s ease-in-out infinite; }
.mascot[data-anim="on"][data-zzz="1"] .z2 { animation-delay: .5s; }
.mascot[data-anim="on"][data-zzz="1"] .z3 { animation-delay: 1s; }
@keyframes m-shake { 0%, 100% { transform: rotate(0); } 18% { transform: rotate(-7deg); } 36% { transform: rotate(6deg); } 54% { transform: rotate(-5deg); } 72% { transform: rotate(3deg); } }
@keyframes m-bounce { 0% { transform: translateY(0); } 35% { transform: translateY(-22px); } 70% { transform: translateY(2px); } 100% { transform: translateY(0); } }
@keyframes m-tail { from { transform: rotate(-5deg); } to { transform: rotate(6deg); } }
@keyframes m-z { 0% { opacity: 0; transform: translate(0, 6px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(6px, -12px); } }
@keyframes m-card-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
.auth__card.is-shake { animation: m-card-shake .45s ease-in-out; }

/* ───────── 左栏品牌区 ───────── */
.auth__intro {
  position: relative; overflow: hidden; align-items: center; justify-content: center; text-align: center; gap: 12px;
  background: linear-gradient(160deg, var(--paper) 0%, color-mix(in srgb, var(--accent-soft) 70%, var(--paper)) 100%);
}
.auth__intro .brand { position: absolute; left: 32px; top: 28px; z-index: 2; }
.auth__stage { position: relative; z-index: 1; width: 100%; max-width: 420px; }
.auth__intro .auth__slogan { position: relative; z-index: 1; max-width: 16em; font-size: clamp(22px, 2.4vw, 30px); text-align: center; margin: 0; }
.auth__sub2 { position: relative; z-index: 1; color: var(--note); font-size: var(--fs-md); }
.auth__bits { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.auth__bits i { position: absolute; display: block; opacity: .9; animation: m-float 16s ease-in-out infinite alternate; }
.auth__bits .dot { border-radius: 50%; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.auth__bits .scrap { border-radius: 3px; background: color-mix(in srgb, var(--ink) 6%, transparent); border: 1px solid color-mix(in srgb, var(--ink) 8%, transparent); }
.auth__bits i:nth-child(1) { width: 14px; height: 14px; left: 12%; top: 22%; animation-duration: 15s; }
.auth__bits i:nth-child(2) { width: 22px; height: 22px; left: 80%; top: 16%; animation-duration: 19s; animation-delay: -4s; }
.auth__bits i:nth-child(3) { width: 9px; height: 9px; left: 26%; top: 68%; animation-duration: 13s; animation-delay: -2s; }
.auth__bits i:nth-child(4) { width: 18px; height: 18px; left: 88%; top: 62%; animation-duration: 17s; animation-delay: -7s; }
.auth__bits i:nth-child(5) { width: 11px; height: 11px; left: 8%; top: 84%; animation-duration: 21s; animation-delay: -5s; }
.auth__bits i:nth-child(6) { width: 30px; height: 30px; left: 62%; top: 88%; animation-duration: 18s; animation-delay: -9s; }
.auth__bits i:nth-child(7) { width: 34px; height: 44px; left: 6%; top: 46%; transform: rotate(-12deg); animation-duration: 20s; animation-delay: -3s; }
.auth__bits i:nth-child(8) { width: 28px; height: 36px; left: 86%; top: 38%; transform: rotate(10deg); animation-duration: 23s; animation-delay: -8s; }
.auth__bits i:nth-child(9) { width: 24px; height: 30px; left: 44%; top: 8%; transform: rotate(18deg); animation-duration: 25s; animation-delay: -6s; }
@keyframes m-float { from { translate: 0 0; } to { translate: 14px -26px; } }

@media (max-width: 759px) {
  .auth__intro { padding: 16px 16px 12px; gap: 4px; }
  .auth__intro .brand { position: static; align-self: center; }
  .auth__stage { max-width: 170px; }
  .auth__intro .auth__slogan { font-size: 17px; }
  .auth__sub2 { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .auth__bits i { animation: none; }
}
