#pet-companion { position:fixed; left:0; bottom:6px; width:82px; height:66px; z-index:87; padding:0; border:0; border-radius:18px; background:transparent; color:inherit; cursor:grab; touch-action:none; user-select:none; -webkit-user-select:none; transition:bottom .3s ease; -webkit-tap-highlight-color:transparent; }
#pet-companion[hidden],.co-private #pet-companion { display:none!important; }
#pet-companion > svg { display:block; width:100%; height:100%; overflow:visible; filter:drop-shadow(0 2px 2px #30241b12); }
#pet-companion:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.pet-facing { transform:scaleX(var(--pet-direction,1)); transform-origin:48px 36px; }
#pet-companion[data-pace=walk] .pet-body { animation:pet-bob .65s ease-in-out infinite; }
#pet-companion[data-pace=run] .pet-body { animation:pet-bob .3s ease-in-out infinite; }
#pet-companion[data-pace=walk] .pet-leg { animation:pet-step .65s ease-in-out infinite alternate; transform-box:fill-box; transform-origin:center top; }
#pet-companion[data-pace=run] .pet-leg { animation:pet-step .25s ease-in-out infinite alternate; transform-box:fill-box; transform-origin:center top; }
#pet-companion .pet-leg-front { animation-delay:-.3s!important; }
.pet-portrait { display:flex; align-items:center; gap:18px; padding:8px 0 16px; border-bottom:1px solid var(--line); margin-bottom:6px; }
.pet-portrait svg { width:96px; height:72px; flex:none; }
.pet-portrait p { margin:0; color:var(--muted); font-size:.85em; line-height:1.9; overflow-wrap:anywhere; }
.pet-fields-two { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
@keyframes pet-bob { 0%,100% { transform:translateY(0); }50% { transform:translateY(-2px); } }
@keyframes pet-step { from { transform:rotate(-9deg); }to { transform:rotate(9deg); } }
@media(max-width:480px) { .pet-fields-two { grid-template-columns:minmax(0,1fr); }.pet-portrait { gap:12px; } }
@media(prefers-reduced-motion:reduce) { #pet-companion,#pet-companion * { animation:none!important; transition:none!important; } }
@media print { #pet-companion { display:none!important; } }

#pet-companion[data-dragging=true] { cursor:grabbing; z-index:150; transition:none; }
#pet-companion[data-frozen=true] * { animation-play-state:paused!important; }
#pet-companion[data-dragging=true] .pet-body { transform:rotate(-4deg); }
.pet-tail { transform-origin:15px 34px; }
.pet-head { transform-origin:61px 38px; }
.pet-torso { transform-origin:55px 44px; }
.pet-eyes { transform-origin:72px 21px; }
.pet-sleep-mark { display:none; }
#pet-companion .pet-eyes { animation:pet-blink 6s infinite; }
#pet-companion[data-pace=wag] .pet-tail { animation:pet-wag .24s ease-in-out infinite alternate; }
#pet-companion[data-pace=sniff] .pet-head { animation:pet-sniff 1s ease-in-out infinite; }
#pet-companion[data-pace=sit] .pet-torso { transform:translateY(5px) rotate(-13deg); }
#pet-companion[data-pace=sit] .pet-leg-back { transform:translate(8px,3px) scaleY(.5); transform-origin:26px 44px; }
#pet-companion[data-pace=sit] .pet-head { transform:translate(-2px,1px) rotate(-5deg); }
#pet-companion[data-pace=sit] .pet-tail { animation:pet-wag .7s ease-in-out infinite alternate; }
#pet-companion[data-pace=lie] .pet-torso { transform:translateY(12px) scaleY(.7); }
#pet-companion[data-pace=lie] .pet-leg { transform:translateY(8px) scaleY(.38); transform-origin:center 48px; }
#pet-companion[data-pace=lie] .pet-head { transform:translateY(12px) rotate(8deg); }
#pet-companion[data-pace=lie] .pet-tail { transform:translateY(8px) rotate(-20deg); }
#pet-companion[data-pace=lie] .pet-eyes { transform:scaleY(.18); animation:none; }
#pet-companion[data-pace=lie] .pet-sleep-mark { display:block; animation:pet-snooze 2.8s ease-in-out infinite; }
#pet-companion[data-pace=stretch] .pet-torso { transform:translate(-3px,4px) scaleX(1.12) rotate(8deg); }
#pet-companion[data-pace=stretch] .pet-head { transform:translate(3px,10px) rotate(12deg); }
#pet-companion[data-pace=stretch] .pet-leg-front { transform:translateX(4px) scaleX(1.15) scaleY(.85); transform-box:fill-box; transform-origin:center bottom; }
#pet-companion[data-pace=stretch] .pet-tail { transform:rotate(20deg); }
.pet-controls { margin-bottom:8px; flex-wrap:wrap; }
@keyframes pet-wag { from { transform:rotate(-18deg); }to { transform:rotate(22deg); } }
@keyframes pet-sniff { 0%,100% { transform:rotate(12deg) translateY(6px); }50% { transform:rotate(19deg) translateY(8px); } }
@keyframes pet-blink { 0%,44%,48%,94%,98%,100% { transform:scaleY(1); }46%,96% { transform:scaleY(.12); } }
@keyframes pet-snooze { 0%,100% { opacity:.25; transform:translateY(0); }50% { opacity:.9; transform:translateY(-3px); } }
@media(max-width:600px) { #pet-companion { width:calc(76px / var(--ui-zoom,1)); height:calc(62px / var(--ui-zoom,1)); } }
@media(prefers-reduced-motion:reduce) { #pet-companion,#pet-companion * { animation:none!important; transition:none!important; } }

/* The roaming companion yields while it covers a control the user can tap or type into. */
#pet-companion{transition:bottom .3s ease,opacity .12s ease}
/* 电脑端小狗常显：挡住内容也由用户自己拖开，绝不自动淡出 */
@media(max-width:600px){ #pet-companion[data-over-control=true]{opacity:0!important;pointer-events:none!important} }

/* === 2.40.87 道具表演：晒太阳 / 下雨 / 雪 / 风 / 寒冷 / 生气 / 开心 / 跳跃 === */
.pet-fx { position:absolute; inset:0; pointer-events:none; }
.pet-fx .fx { position:absolute; inset:0; display:none; }
.pet-fx .fx i,.pet-fx .fx b { position:absolute; display:block; }
#pet-companion[data-pace=sun] .fx-sun,
#pet-companion[data-pace=rain] .fx-rain,
#pet-companion[data-pace=snow] .fx-snow,
#pet-companion[data-pace=wind] .fx-wind,
#pet-companion[data-pace=cold] .fx-cold,
#pet-companion[data-pace=angry] .fx-anger,
#pet-companion[data-pace=happy] .fx-happy { display:block; }

/* 太阳：右上角光晕 + 三根渐渐伸缩的光线 */
.fx-sun b { right:-9px; top:-11px; width:28px; height:28px; border-radius:50%; background:radial-gradient(circle,#e7c07455,#e7c07400 72%); }
.fx-sun i { right:2px; width:11px; height:1.6px; border-radius:2px; background:#d9a94f; transform-origin:100% 50%; animation:pet-ray 3.2s ease-in-out infinite; }
.fx-sun i:nth-of-type(1) { top:11px; transform:rotate(-34deg); }
.fx-sun i:nth-of-type(2) { top:6px; transform:rotate(-6deg); animation-delay:.4s; }
.fx-sun i:nth-of-type(3) { top:2px; transform:rotate(22deg); animation-delay:.8s; }

/* 下雨：小云 + 三道斜雨丝 */
.fx-rain .fx-cloud { left:50%; top:-3px; margin-left:-16px; width:32px; height:11px; border-radius:11px; background:color-mix(in srgb,#8fa8b0 55%,transparent); }
.fx-rain i { left:22px; top:9px; width:1.6px; height:8px; border-radius:1px; background:#7fa3b6; transform:skewX(-12deg); animation:pet-rain 1s linear infinite; }
.fx-rain i:nth-of-type(2) { left:36px; animation-delay:.32s; }
.fx-rain i:nth-of-type(3) { left:50px; animation-delay:.62s; }

/* 下雪：四粒慢落的白点 */
.fx-snow i { width:3px; height:3px; border-radius:50%; background:#e4edf1; animation:pet-snow 2.8s linear infinite; }
.fx-snow i:nth-of-type(1) { left:24px; top:2px; }
.fx-snow i:nth-of-type(2) { left:38px; top:0; animation-delay:.7s; }
.fx-snow i:nth-of-type(3) { left:50px; top:4px; animation-delay:1.4s; }
.fx-snow i:nth-of-type(4) { left:31px; top:6px; animation-delay:2s; }

/* 起风：三道飘动的弧线 */
.fx-wind i { left:54px; top:8px; width:22px; height:7px; border-top:1.6px solid #9fb6ac; border-radius:50%; animation:pet-gust 2.4s ease-in-out infinite; }
.fx-wind i:nth-of-type(2) { left:46px; top:19px; width:15px; animation-delay:.6s; }
.fx-wind i:nth-of-type(3) { left:56px; top:30px; width:18px; animation-delay:1.2s; }

/* 寒冷：三团呼出的白气 */
.fx-cold i { left:34px; top:24px; width:5px; height:5px; border-radius:50%; background:#d7e6ec; animation:pet-breath 2.6s ease-out infinite; }
.fx-cold i:nth-of-type(2) { left:24px; animation-delay:.9s; }
.fx-cold i:nth-of-type(3) { left:43px; animation-delay:1.7s; }

/* 生气：漫画式怒筋（十字符）+ 轻微放大跳动 */
.fx-anger b { left:57px; top:0; width:10px; height:10px; animation:pet-vein .5s ease-in-out infinite; }
.fx-anger b::before,.fx-anger b::after { content:""; position:absolute; background:#d9614f; border-radius:1px; }
.fx-anger b::before { left:4.3px; top:0; width:1.4px; height:10px; }
.fx-anger b::after { left:0; top:4.3px; width:10px; height:1.4px; }

/* 开心：三颗小星芒 */
.fx-happy i { left:52px; top:2px; width:1.8px; height:6px; border-radius:2px; background:#e2b25d; animation:pet-spark 1.5s ease-in-out infinite; }
.fx-happy i:nth-of-type(2) { left:36px; top:8px; height:4px; animation-delay:.5s; }
.fx-happy i:nth-of-type(3) { left:63px; top:12px; height:4px; animation-delay:1s; }

#pet-companion[data-pace=jump] .pet-body { animation:pet-jump .8s cubic-bezier(.32,.72,.3,1); }
#pet-companion[data-pace=angry] .pet-body { animation:pet-shake .2s ease-in-out infinite; }
#pet-companion[data-pace=angry] .pet-tail { transform:rotate(-38deg); }
#pet-companion[data-pace=angry] .pet-eyes { transform:scaleY(.78) rotate(9deg); }
#pet-companion[data-pace=cold] .pet-body { animation:pet-shiver .16s linear infinite; }
#pet-companion[data-pace=cold] .pet-eyes { transform:scaleY(.62); }
#pet-companion[data-pace=rain] .pet-head { transform:translateY(4px) rotate(6deg); }
#pet-companion[data-pace=rain] .pet-body { animation:pet-shiver .42s linear infinite; }
#pet-companion[data-pace=snow] .pet-body { animation:pet-shiver .3s linear infinite; }
#pet-companion[data-pace=wind] .pet-head { transform:rotate(-8deg); }
#pet-companion[data-pace=sun] .pet-torso { transform:translateY(8px) scaleY(.84); }
#pet-companion[data-pace=sun] .pet-eyes { animation:none; transform:scaleY(.2); }
#pet-companion[data-pace=sun] .pet-tail { animation:pet-wag 1.8s ease-in-out infinite alternate; }
#pet-companion[data-pace=happy] .pet-tail { animation:pet-wag .16s ease-in-out infinite alternate; }
#pet-companion[data-pace=happy] .pet-body { animation:pet-hop .5s ease-in-out infinite; }

@keyframes pet-jump { 0%{transform:translateY(0) scaleY(1)} 22%{transform:translateY(-14px) scaleY(1.06) scaleX(.94)} 55%{transform:translateY(-16px) scaleY(1.05)} 82%{transform:translateY(0) scaleY(.9) scaleX(1.06)} 100%{transform:translateY(0) scaleY(1)} }
@keyframes pet-shake { 0%,100%{transform:translateX(-1.2px) rotate(-1deg)} 50%{transform:translateX(1.2px) rotate(1deg)} }
@keyframes pet-shiver { 0%,100%{transform:translate(0,0)} 25%{transform:translate(-.8px,.3px)} 75%{transform:translate(.8px,-.3px)} }
@keyframes pet-hop { 0%,100%{transform:translateY(0)} 45%{transform:translateY(-4px)} }
@keyframes pet-ray { 0%,100%{opacity:.35} 50%{opacity:.95} }
@keyframes pet-rain { 0%{opacity:0;transform:translateY(-4px) skewX(-12deg)} 30%{opacity:.9} 100%{opacity:0;transform:translateY(12px) skewX(-12deg)} }
@keyframes pet-snow { 0%{opacity:0;transform:translateY(-2px)} 20%{opacity:.95} 100%{opacity:0;transform:translateY(20px)} }
@keyframes pet-gust { 0%{opacity:0;transform:translateX(6px)} 35%{opacity:.9} 100%{opacity:0;transform:translateX(-14px)} }
@keyframes pet-breath { 0%{opacity:.9;transform:translate(0,0) scale(.6)} 100%{opacity:0;transform:translate(-4px,-12px) scale(1.5)} }
@keyframes pet-vein { 0%,100%{transform:scale(.92)} 50%{transform:scale(1.12)} }
@keyframes pet-spark { 0%,100%{opacity:.2;transform:scale(.8)} 50%{opacity:1;transform:scale(1.15)} }

/* ===== 2.40.92 宠物补充状态：打哈欠 / 被摸头 / 睡着 ===== */
#pet-companion[data-pace=yawn] .pet-torso{transform:translateY(2px) scaleY(.94)}
#pet-companion[data-pace=yawn] .pet-head{transform-box:fill-box;transform-origin:80% 60%;animation:pet-yawn 1.3s ease-in-out infinite alternate}
#pet-companion[data-pace=yawn] .pet-eyes{transform:scaleY(.34);transform-box:fill-box;transform-origin:center}
#pet-companion[data-pace=yawn] .pet-tail{animation:pet-wag 1.6s ease-in-out infinite alternate}
#pet-companion[data-pace=pat] .pet-head{transform-box:fill-box;transform-origin:80% 60%;animation:pet-pat .7s ease-in-out infinite alternate}
#pet-companion[data-pace=pat] .pet-tail{animation:pet-wag .28s ease-in-out infinite alternate}
#pet-companion[data-pace=sleep] .pet-torso{transform:translateY(12px) scaleY(.7)}
#pet-companion[data-pace=sleep] .pet-leg{transform:translateY(8px) scaleY(.38);transform-origin:center 48px}
#pet-companion[data-pace=sleep] .pet-head{transform:translateY(12px) rotate(8deg)}
#pet-companion[data-pace=sleep] .pet-tail{transform:translateY(8px) rotate(-20deg)}
#pet-companion[data-pace=sleep] .pet-eyes{transform:scaleY(.1);animation:none}
#pet-companion[data-pace=sleep] .pet-sleep-mark{display:block;animation:pet-snooze 3.6s ease-in-out infinite}
@keyframes pet-yawn{from{transform:translate(0,0) rotate(0deg)}to{transform:translate(-3px,5px) rotate(10deg)}}
@keyframes pet-pat{from{transform:translateY(0) rotate(0deg)}to{transform:translateY(3px) rotate(-5deg)}}