/* 独立动作层：胸部呼吸、头部回应、眼部闭合和双足步态分别播放。 */
pet-companion{position:relative;display:block;width:100%;height:auto;aspect-ratio:1;max-width:260px;margin:auto;isolation:isolate;contain:layout style;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
pet-companion[interactive=false]{cursor:inherit}pet-companion:focus-visible{outline:3px solid #854221;outline-offset:4px;border-radius:20px}
pet-companion .pc-actor{position:absolute;inset:0;transform-origin:50% 96%}pet-companion[data-stage=baby] .pc-actor{inset:12% 8% 0}pet-companion[data-stage=growing] .pc-actor{inset:5% 3% 0}
/* 未审核身体分层的图片只做脚底固定的1%整图呼吸、短暂轻倾；不裁头腿、不蒙眼。真实动作帧照常播放。 */
pet-companion:not([data-pose=walking]):not([data-pose=work]):not([data-action=happy]):not([data-action=eat]):not([data-action=look]):not([data-action=feeding]) .pc-safe-whole{animation:pc-safe-breath 3.6s ease-in-out infinite;animation-delay:var(--pc-phase,0s)}
pet-companion[data-action=look] .pc-safe-whole{animation:pc-safe-look 1.4s ease-in-out}
pet-companion .pc-rig,pet-companion .pc-frame{display:block;width:100%;height:100%;object-fit:contain;user-select:none;-webkit-user-drag:none}pet-companion .pc-frame[hidden]{display:none}pet-companion.pc-use-frames .pc-rig{display:none}
pet-companion .pc-floor{position:absolute;bottom:1%;left:20%;width:60%;height:8%;border-radius:50%;background:radial-gradient(closest-side,#54372048,transparent)}
pet-companion .pc-head{transform-origin:50px 58px;animation:pc-look 9s ease-in-out infinite;animation-delay:var(--pc-phase,0s)}
pet-companion .pc-body{transform-origin:50px 81px;animation:pc-breath 3.2s ease-in-out infinite;animation-delay:var(--pc-phase,0s)}
pet-companion .pc-eye{animation:pc-blink 5s linear infinite;animation-delay:var(--pc-phase,0s)}pet-companion .pc-foot{transform-origin:50px 85px}
pet-companion[data-hungry=true] .pc-body{animation-duration:5s}pet-companion[data-hungry=true] .pc-head{animation-name:pc-droop}
pet-companion[data-pose=walking] .pc-foot-left{animation:pc-step-left .48s ease-in-out infinite}pet-companion[data-pose=walking] .pc-foot-right{animation:pc-step-right .48s ease-in-out infinite}pet-companion[data-pose=walking] .pc-head{animation:pc-walk-head .48s ease-in-out infinite}
pet-companion[data-pose=work][data-work-action=feed] .pc-head{animation:pc-nibble .75s ease-in-out infinite}pet-companion[data-pose=work] .pc-foot-left{animation:pc-step-left 1.2s ease-in-out infinite}
pet-companion[data-action=happy] .pc-head{animation:pc-pat 1.4s ease-in-out}pet-companion[data-action=happy] .pc-actor{animation:pc-hop .8s ease-out}pet-companion[data-action=happy] .pc-foot-left{animation:pc-wave .7s ease-in-out 2}pet-companion[data-action=happy] .pc-heart{animation:pc-love 1.6s ease-out both}
pet-companion[data-action=look] .pc-head{animation:pc-pat 1.4s ease-in-out}pet-companion[data-action=feeding] .pc-food{opacity:1}pet-companion[data-action=eat] .pc-food{animation:pc-food-arrive .75s ease-in both}pet-companion[data-action=eat] .pc-head{animation:pc-nibble .35s ease-in-out 6}pet-companion[data-action=eat] .pc-body{animation:pc-breath .65s ease-in-out 3}
pet-companion .pc-food,pet-companion .pc-heart{position:absolute;z-index:2;pointer-events:none;opacity:0;font-size:clamp(15px,3vw,28px)}pet-companion .pc-food{left:25%;top:63%}pet-companion .pc-heart{left:74%;top:27%;color:#c44b55;text-shadow:0 1px #fff}
pet-companion .pc-response{position:absolute;z-index:4;bottom:0;left:50%;width:max-content;max-width:min(250px,180%);padding:5px 9px;transform:translateX(-50%);border:1px solid #d1af7e;border-radius:12px;background:#fff9ee;color:#543a27;font:600 12px/1.4 system-ui;text-align:center;box-shadow:0 3px 10px #65401c1c;pointer-events:none}pet-companion .pc-response:empty{display:none}
pet-companion[data-stage=dead] .pc-actor{opacity:.55;filter:grayscale(.85)}pet-companion[data-paused=true] *,pet-companion[data-stage=dead] *{animation:none!important;transition:none!important}pet-companion[data-paused=true] .pc-food,pet-companion[data-paused=true] .pc-heart{display:none}
pet-companion[compact=true] .pc-response{display:none}pet-companion[compact=true]{min-width:0;max-width:none}pet-companion .pc-unassigned{display:grid;height:100%;place-items:center;font-size:40px}
@keyframes pc-breath{0%,100%{transform:scaleY(1)}50%{transform:scaleY(1.025)}}
@keyframes pc-safe-breath{0%,100%{transform:scaleY(1)}50%{transform:scaleY(1.01)}}
@keyframes pc-safe-look{0%,100%{transform:rotate(0)}25%{transform:rotate(-2deg)}65%{transform:rotate(2deg)}}
@keyframes pc-look{0%,72%,100%{transform:rotate(0)}78%,90%{transform:rotate(-3deg)}84%,96%{transform:rotate(2deg)}}
@keyframes pc-blink{0%,42%,47%,100%{transform:scaleY(1)}44%,45%{transform:scaleY(.06)}}
@keyframes pc-droop{0%,100%{transform:translateY(1px) rotate(-2deg)}50%{transform:translateY(2px) rotate(1deg)}}
@keyframes pc-step-left{0%,100%{transform:translateY(0) rotate(-3deg)}50%{transform:translateY(-3px) rotate(5deg)}}
@keyframes pc-step-right{0%,100%{transform:translateY(-3px) rotate(4deg)}50%{transform:translateY(0) rotate(-3deg)}}
@keyframes pc-walk-head{0%,100%{transform:translateY(-1px) rotate(-1deg)}50%{transform:translateY(0) rotate(1deg)}}
@keyframes pc-pat{0%,100%{transform:rotate(0)}25%{transform:rotate(-7deg) translateY(-1px)}60%{transform:rotate(5deg)}}
@keyframes pc-wave{0%,100%{transform:rotate(0)}50%{transform:rotate(-9deg) translateY(-2px)}}
@keyframes pc-hop{0%,100%{transform:translateY(0)}25%{transform:translateY(-12px)}55%{transform:translateY(0)}75%{transform:translateY(-3px)}}
@keyframes pc-nibble{0%,100%{transform:translateY(0)}50%{transform:translateY(2px) rotate(1.5deg)}}
@keyframes pc-love{0%{opacity:0;transform:translateY(8px) scale(.5)}20%{opacity:1}100%{opacity:0;transform:translateY(-22px) scale(1.2)}}
@keyframes pc-food-arrive{0%{opacity:1;transform:translate(-15px,12px)}65%{opacity:1;transform:translate(20px,-27px) scale(.75)}100%{opacity:0;transform:translate(26px,-28px) scale(.2)}}
@media(prefers-reduced-motion:reduce){pet-companion *,pet-companion *::before,pet-companion *::after{animation:none!important;transition:none!important}pet-companion .pc-food,pet-companion .pc-heart{display:none}}
