/* Pets keep the site's existing paper, ink and seal palette. */
/* Armored companions: colored light surrounds the alpha silhouette. Fox stays original. */
[data-pet-id="rabbit"]{--pet-aura:#bcc8ff;--pet-spark:#fff3ca}
[data-pet-id="qinglong"]{--pet-aura:#48d4c1;--pet-spark:#f4d491}
[data-pet-id="baihu"]{--pet-aura:#8bceff;--pet-spark:#e8f6ff}
[data-pet-id="xuanwu"]{--pet-aura:#b59bef;--pet-spark:#efd6a4}
[data-pet-id="zhuque"]{--pet-aura:#ff9b55;--pet-spark:#ffe3a0}
[data-pet-id]:not([data-pet-id="fox"]) [data-pet-art]{isolation:isolate}
[data-pet-id]:not([data-pet-id="fox"]) [data-pet-art] .pet-portrait{position:relative;z-index:1;filter:drop-shadow(0 0 4px color-mix(in srgb,var(--pet-aura) 40%,transparent))}
[data-pet-id]:not([data-pet-id="fox"]) [data-pet-art]::before{content:'';position:absolute;z-index:0;inset:23% 4% 12%;border:1px solid color-mix(in srgb,var(--pet-aura) 60%,transparent);border-left-color:transparent;border-radius:50%;box-shadow:0 0 7px color-mix(in srgb,var(--pet-aura) 25%,transparent);transform:rotate(-24deg);animation:pet-armored-aura 5s ease-in-out infinite;pointer-events:none}
[data-pet-id]:not([data-pet-id="fox"]):not([data-pet-mood="sleep"]) [data-pet-art]::after{content:'✦';position:absolute;z-index:2;right:8%;top:17%;font-size:11px;color:var(--pet-spark);text-shadow:0 0 6px var(--pet-aura);animation:pet-armored-spark 4s ease-in-out infinite;pointer-events:none}
@keyframes pet-armored-aura{50%{transform:rotate(-12deg) translateY(-3px);opacity:.35}}
@keyframes pet-armored-spark{0%,100%{opacity:.25;transform:translateY(0) scale(.7)}50%{opacity:.95;transform:translateY(-7px) scale(1)}}
[data-pet-quiet="true"] [data-pet-art]::before,[data-pet-quiet="true"] [data-pet-art]::after{animation:none!important}
@media(prefers-reduced-motion:reduce){[data-pet-art]::before,[data-pet-art]::after{animation:none!important}}
[data-pet-art]{display:block;position:relative;width:100%;height:100%;transform-origin:50% 85%}
[data-pet-art] svg,[data-pet-art] .pet-portrait{display:block;width:100%;height:100%;object-fit:contain}
body .reader-companion .companion-avatar:has([data-pet-art]){background:none!important}
body .reader-companion .companion-avatar{background:none!important}
[data-pet-surface] [data-pet-art]{animation:companion-breathe 5s ease-in-out infinite}
[data-pet-mood="reading"] [data-pet-art]{animation:companion-read 7s ease-in-out infinite}
[data-pet-mood="pet"] [data-pet-art]{animation:companion-nuzzle 1.1s ease-in-out infinite}
[data-pet-mood="win"] [data-pet-art],[data-pet-mood="finish"] [data-pet-art]{animation:companion-cheer 1.2s ease-in-out infinite}
[data-pet-mood="sleep"] [data-pet-art]{animation:companion-breathe 8s ease-in-out infinite;filter:saturate(.8)}
[data-pet-mood="sleep"] svg.pet-art .pet-eye{animation:none;transform:scaleY(.12)}
[data-pet-mood="sleep"] [data-pet-art]::after{content:'Z z';position:absolute;right:4px;top:0;font:16px Georgia,serif;color:#78628a}
[data-pet-stage="知音"] [data-pet-art],[data-pet-stage="博览"] [data-pet-art]{filter:drop-shadow(0 0 9px #d6ae6b66)}
[data-pet-quiet="true"] [data-pet-art],[data-pet-quiet="true"] svg.pet-art *{animation:none!important}
[data-pet-surface] .pet-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.pet-actions button,[data-preview-pet-actions] button{min-height:44px;padding:8px 12px;border:1px solid #cbbca5;border-radius:10px;background:#faf5e8;color:#604e3c;font:inherit;font-size:14px;cursor:pointer}
.pet-actions button:focus-visible,[data-preview-pet-actions] button:focus-visible{outline:3px solid #87684d;outline-offset:2px}
.pet-actions button[aria-pressed="true"]{background:#e7dbc3;border-color:#9e8061}
[data-pet-trait],[data-pet-stage],[data-pet-status]{display:block;font-size:14px;line-height:1.6;color:#73634e}
body .reader-companion .companion-panel{max-width:min(300px,calc(100vw - 88px));box-sizing:border-box}
body .reader-companion.pet-is-compact .companion-toggle{width:48px;height:54px}
body .reader-companion.pet-is-compact .companion-avatar{width:46px;height:50px}
body .reader .home-pet.pet-is-compact{width:48px;height:62px}
body .home-pet.pet-is-compact .home-pet-avatar{width:48px;height:54px}
body .home-pet.pet-is-compact .home-pet-avatar::after{display:none}
body .home-pet.pet-is-compact .home-pet-info{right:52px}
body .home-pet-avatar [data-pet-art]{position:absolute;inset:0}
body .home-pet-avatar>img{visibility:hidden}
body .shop-preview-scene [data-pet-art]{position:absolute;right:18px;bottom:12px;width:140px;height:160px}
body .shop-preview-scene>[data-preview-pet]{visibility:hidden}
[data-preview-pet-actions]{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
[data-preview-pet-actions][hidden]{display:none}
[data-preview-pet-line]{font-size:16px;line-height:1.7;min-height:1.7em;color:#654f3c}
.pet-game-response{margin:10px 0;font-size:14px;color:#78613f;line-height:1.7}
.pet-growth-note{padding:12px 16px;border-left:3px solid #b39161;background:#f6eedf;font-size:14px;line-height:1.8}
@keyframes companion-breathe{50%{transform:translateY(-3px) scale(1.015)}}
@keyframes companion-read{35%{transform:rotate(-2deg) translateY(-2px)}70%{transform:rotate(1deg)}}
@keyframes companion-nuzzle{30%{transform:rotate(-7deg) scale(1.04)}70%{transform:rotate(5deg) scale(1.04)}}
@keyframes companion-cheer{35%{transform:translateY(-9px) rotate(-3deg)}65%{transform:translateY(-4px) rotate(3deg)}}
@media(max-width:640px){body .reader-companion .companion-toggle{width:90px;height:100px}body .reader-companion .companion-avatar{width:86px;height:96px}.pet-actions button{padding-inline:10px}.shop-preview-scene [data-pet-art]{width:110px;height:130px}}
@media(prefers-reduced-motion:reduce){[data-pet-surface] [data-pet-art],svg.pet-art *{animation:none!important}}
body .focus-reader .reader-companion[data-pet-surface]{position:fixed;inset:auto;left:12px;bottom:76px;margin:0;width:auto;display:grid;grid-template-columns:auto minmax(0,260px);justify-content:start;z-index:8}
body .focus-reader .reader-companion[data-pet-surface] .companion-panel{position:relative;inset:auto;max-height:calc(100dvh - 170px);overflow:auto;background:#faf3e5}
body .focus-reader .companion-head{flex-wrap:wrap;justify-content:flex-start}
body .focus-reader .companion-head span{font-size:14px}
body .focus-reader .companion-panel p{font-size:16px}
body .reader-pet-icon{display:none!important}
@media(max-width:640px){body .focus-reader .reader-companion[data-pet-surface]{left:4px;bottom:72px;grid-template-columns:auto minmax(0,calc(100vw - 106px))}}
[data-pet-quiet="true"] .companion-avatar{animation:none!important;transform:none!important}
[data-pet-quiet="true"] .companion-fireflies{display:none}
@media(prefers-reduced-motion:reduce){[data-pet-surface] .companion-avatar{animation:none!important;transform:none!important}[data-pet-surface] .companion-fireflies{display:none}}

/* A transparent character silhouette, with controls shown only on demand. */
html body [data-pet-surface] button.home-pet-avatar,html body [data-pet-surface] button.companion-toggle,
html[data-theme="dark"] body [data-pet-surface] button.home-pet-avatar,html[data-theme="dark"] body [data-pet-surface] button.companion-toggle{background:transparent!important;background-image:none!important;border:0!important;border-radius:0!important;box-shadow:none!important;padding:0}
body .home-pet-avatar::after,body .companion-toggle::after{display:none!important}
body .reader .home-pet{border:0!important;background:transparent!important;box-shadow:none!important}
body .companion-fireflies{display:none}
@media(max-width:640px){body .reader .home-pet{width:68px;height:86px}body .home-pet .home-pet-avatar{width:68px;height:82px}body .home-pet .home-pet-info{right:70px;bottom:8px}body .reader-companion .companion-toggle{width:72px;height:84px}body .reader-companion .companion-avatar{width:68px;height:80px}}

/* One floating companion travels across the main site. */
.global-pet{position:fixed;right:18px;bottom:20px;z-index:160;display:flex;flex-direction:column;align-items:flex-end;max-width:calc(100vw - 24px);pointer-events:none}.global-pet>*{pointer-events:auto}
html body .global-pet .global-pet-avatar,html[data-theme="dark"] body .global-pet .global-pet-avatar{display:block;width:106px;height:122px;padding:0;border:0;border-radius:0;background:transparent!important;box-shadow:none!important;cursor:pointer;filter:drop-shadow(0 5px 5px #253b3026)}
.global-pet .global-pet-compact{font:12px/1.5 system-ui;padding:3px 8px;min-height:26px;border:1px solid #b5b79d;border-radius:12px;background:#fff7e4e8;color:#58654a;cursor:pointer}.global-pet.pet-is-compact .global-pet-avatar{width:44px!important;height:50px!important}.global-pet-panel{width:285px;max-width:calc(100vw - 40px);box-sizing:border-box;margin-bottom:6px;padding:16px;border:1px solid #afba9e;border-radius:12px;background:#fff9ea;box-shadow:0 8px 25px #17281f25;color:#334c3a;max-height:calc(100dvh - 220px);overflow:auto}.global-pet-panel[hidden]{display:none!important}.global-pet-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}.global-pet-heading strong{font-size:18px}.global-pet-heading button{border:0;background:transparent;padding:4px 8px;font-size:22px;cursor:pointer;color:inherit}.global-pet-panel p{font-size:16px;line-height:1.7;margin:12px 0}.global-pet-change{width:100%;min-height:42px;margin-top:12px;padding:10px;border:1px solid #36594c;border-radius:6px;background:#36594c;color:#fff8e5;font:inherit;font-size:14px;cursor:pointer}.global-pet .pet-actions{gap:6px}.global-pet .pet-actions button{padding:8px;min-height:40px}.global-pet:has(.global-pet-panel:not([hidden])){z-index:180}body.is-reader-open .global-pet,body:has([data-focus-reader][open]) .global-pet{display:none}
body .reader .home-pet{display:none!important}html[data-theme="dark"] body .global-pet-panel{background:#263c32;color:#eee9d9;border-color:#819174}
@media(max-width:640px){.global-pet{right:8px;bottom:calc(72px + env(safe-area-inset-bottom))}html body .global-pet .global-pet-avatar{width:66px;height:78px}.global-pet-panel{width:270px;margin-bottom:4px}.global-pet .global-pet-compact{font-size:12px}.global-pet .global-pet-panel{max-height:calc(100dvh - 240px)}}
@media(prefers-reduced-motion:reduce){.global-pet [data-pet-art]{animation:none!important}}
body .focus-reader .reader-companion[data-pet-surface]{left:auto;right:12px;bottom:calc(76px + env(safe-area-inset-bottom));display:flex;flex-direction:column;align-items:flex-end;gap:6px}body .focus-reader .reader-companion .companion-toggle{order:2}body .focus-reader .reader-companion .companion-panel{order:1;width:min(300px,calc(100vw - 30px));max-width:none}body .focus-reader .reader-companion:not(.is-open) .companion-panel{display:none}body:has(.mobile-more[open]) .global-pet{display:none}
/* Five permanent white tiger forms, independent of companionship XP. */
.pet-evolution{grid-column:1/-1;width:100%;padding:22px 0 4px;border-top:1px solid #ab976653;color:#3e4d41}
.pet-evolution[hidden]{display:none}
.evolution-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}
.evolution-heading h4{margin:0;font-size:24px}.evolution-heading .eyebrow{margin:0 0 5px}.evolution-heading>span{font-size:14px;color:#79643e}
.evolution-path{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}
html body #shop .pet-showroom:is([data-pet-id="baihu"],[data-pet-id="xuanwu"],[data-pet-id="rabbit"],[data-pet-id="qinglong"]) [data-showroom-touch]{height:440px!important}
.evolution-path button{display:flex;flex-direction:column;align-items:center;gap:7px;padding:12px 8px;border:1px solid #ab976653;border-radius:12px;background:#fffaf05c;color:inherit;cursor:pointer;transition:border-color .2s,background .2s}
.evolution-path img{width:100%;height:170px;object-fit:contain;filter:drop-shadow(0 4px 6px #314f4b20)}
.evolution-path strong{font-size:19px}.evolution-path span{font-size:13px}
.evolution-path button[aria-pressed="true"]{border:2px solid #a58242;background:#eadcbf66;padding:11px 7px}
.evolution-path .is-unlocked strong::after{content:' · 已拥有';font-size:11px;color:#6a8068}
.evolution-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:16px 0 9px}
.evolution-footer p{margin:0;font-size:14px}.evolution-footer button{padding:11px 18px;border:1px solid #ae8e52;border-radius:8px;background:#655434;color:#fff3d4;cursor:pointer}.evolution-footer button:disabled{opacity:.55;cursor:default}
.pet-evolution>small{display:block;font-size:12px;line-height:1.7;opacity:.85}
.pet-showroom.is-evolving .showroom-art [data-pet-art]{animation:pet-evolution-reveal 1.6s ease-out}
@keyframes pet-evolution-reveal{0%{filter:brightness(1)}35%{filter:brightness(1.7) drop-shadow(0 0 24px #b2e0ff);transform:scale(.95)}100%{filter:brightness(1);transform:scale(1)}}
html[data-theme="dark"] .pet-evolution{color:#eee4ca;border-color:#a8946866}html[data-theme="dark"] .evolution-heading>span{color:#d3be8e}html[data-theme="dark"] .evolution-path button{background:#263c3266;border-color:#b9a47766}html[data-theme="dark"] .evolution-path button[aria-pressed="true"]{background:#596b5544;border-color:#dbc48f}
@media(max-width:760px){.evolution-heading{align-items:flex-start;flex-direction:column}.evolution-path{grid-template-columns:repeat(5,132px);gap:8px;overflow-x:auto;padding-bottom:10px;scroll-snap-type:x proximity}.evolution-path button{scroll-snap-align:center}.evolution-path img{height:150px}.evolution-path strong{font-size:17px}.evolution-path span{font-size:11px}.evolution-path .is-unlocked strong::after{display:block}.evolution-footer{align-items:stretch;flex-direction:column;gap:10px}html body #shop .pet-showroom:is([data-pet-id="baihu"],[data-pet-id="xuanwu"],[data-pet-id="rabbit"],[data-pet-id="qinglong"]) [data-showroom-touch]{height:320px!important}}
@media(prefers-reduced-motion:reduce){.pet-showroom.is-evolving .showroom-art [data-pet-art]{animation:none}}

.evolution-path button:disabled{opacity:.55;cursor:default;min-height:225px}.evolution-path button:disabled strong{margin-top:auto}.evolution-path img[hidden]{display:none}
