/* ==========================================================================
   牛牛 v2 吸收层样式（2026-10-12）—— 配合 pet.js 的 v2 段
   来源：鹏哥的 bull-pet-v2-deploy.zip（8 类粒子 / 工具栏 / 睡眠 / 进度环 / 转圈 / 冲刺）
   注意：本文件与 pet.css 一样，站点是 no-store，改完立即生效；不需要 ?v= 顶缓存。
   ========================================================================== */

/* ---------- 8 类特效粒子（爱心/星光/尘土/汗滴/音符/问号/感叹/花瓣）---------- */
.pet-fx {
  position: fixed; z-index: 99998; font-size: 14px; line-height: 1;
  pointer-events: none; will-change: transform, opacity;
  animation: petFxFloat 1.15s ease-out forwards;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.pet-fx-heart    { color: #ff5a7a; }
.pet-fx-sparkle  { color: #ffd166; }
.pet-fx-sweat    { color: #6cc4ff; }
.pet-fx-note     { color: #b48cff; }
.pet-fx-confetti { color: #ff9ec4; }
.pet-fx-question, .pet-fx-exclaim { color: #ffd166; font-weight: 800; }

@keyframes petFxFloat {
  0%   { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(.7); }
  18%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--drift, 12px), -48px) rotate(var(--twist, -14deg)) scale(1.15); }
}

.pet-fx-dust {
  position: fixed; z-index: 99997; width: 7px; height: 7px; border-radius: 50%;
  background: rgba(158, 146, 124, .6); pointer-events: none;
  animation: petDust 1.05s ease-out forwards;
}
@keyframes petDust {
  0%   { opacity: .75; transform: translate(0, 0) scale(.6); }
  100% { opacity: 0; transform: translate(var(--dx, -40px), var(--dy, 50px)) scale(1.5); }
}

/* ---------- 工具栏 🌱📊💤 ---------- */
.pet-tools {
  position: fixed; z-index: 99999; display: flex; gap: 3px; align-items: center;
  transition: left .12s linear, top .12s linear;
}
.pet-tool {
  width: 24px; height: 24px; padding: 0; border-radius: 8px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(20, 24, 32, .74);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  font-size: 13px; line-height: 1; color: #fff; position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, transform .15s;
}
.pet-tool:hover { background: rgba(44, 52, 68, .92); transform: translateY(-1px); }
.pet-tool:active { transform: translateY(0) scale(.94); }
.pet-mdot {
  position: absolute; top: 1px; right: 1px; width: 6px; height: 6px; border-radius: 50%;
  background: transparent; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25);
}
.pet-mdot.go      { background: #2fbf71; }
.pet-mdot.caution { background: #f5a524; }
.pet-mdot.danger  { background: #e5484d; }

/* v3：跟随模式开启态 / 养成状态告警（饿了会呼吸） */
.pet-tool.on {
  background: rgba(47, 191, 113, .3);
  border-color: rgba(47, 191, 113, .7);
}
.pet-tool.hungry { animation: petHungry 1.6s ease-in-out infinite; }
@keyframes petHungry {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0); }
  50%      { box-shadow: 0 0 8px 2px rgba(229, 72, 77, .6); }
}

.pet-toast {
  position: fixed; z-index: 99999; pointer-events: none;
  background: rgba(18, 22, 30, .92); color: #fff; font-size: 12px; line-height: 1.35;
  padding: 4px 9px; border-radius: 8px; max-width: 240px;
  opacity: 0; transform: translateY(4px); transition: opacity .18s, transform .18s;
}
.pet-toast.show { opacity: 1; transform: translateY(0); }

/* ---------- 睡觉（变暗 + zZ）---------- */
.pet-ball.sleeping { filter: brightness(.74) saturate(.68); }
.pet-zzz {
  position: absolute; right: 2px; top: -12px; font-size: 12px; font-weight: 800;
  color: #9fd0ff; opacity: 0; pointer-events: none; text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
}
.pet-ball.sleeping .pet-zzz { opacity: 1; animation: petZz 2.4s ease-in-out infinite; }
@keyframes petZz {
  0%   { transform: translate(0, 0) scale(.9); opacity: .25; }
  50%  { transform: translate(3px, -8px) scale(1.05); opacity: 1; }
  100% { transform: translate(7px, -15px) scale(1.12); opacity: 0; }
}

/* ---------- 按住进度环（长按 → 牛市冲天）---------- */
.pet-hold-ring {
  position: absolute; left: 50%; top: 50%; width: 46px; height: 46px;
  margin: -23px 0 0 -23px; border-radius: 50%; pointer-events: none;
  opacity: 0; transition: opacity .15s;
  background: conic-gradient(#ffd166 calc(var(--hold, 0) * 360deg), rgba(255, 255, 255, .16) 0);
}
.pet-hold-ring.on { opacity: .92; }
.pet-hold-ring::after {
  content: ''; position: absolute; inset: 4px; border-radius: 50%;
  background: rgba(12, 14, 20, .5);
}

/* ---------- 双击转圈 / 冲刺中 ---------- */
.pet-ball.spinning { animation: petSpin .9s cubic-bezier(.3, .7, .3, 1); }
@keyframes petSpin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.pet-ball.charging { z-index: 100000; pointer-events: none; }

/* ---------- 手机：工具栏小一点，别挡视线 ---------- */
@media (max-width: 640px) {
  .pet-tool { width: 21px; height: 21px; border-radius: 7px; font-size: 12px; }
  .pet-tools { gap: 2px; }
  .pet-toast { font-size: 11px; max-width: 200px; }
}
@media (prefers-reduced-motion: reduce) {
  .pet-fx, .pet-fx-dust, .pet-tools { animation: none !important; transition: none !important; }
}

/* ==========================================================================
   v6 换形象（2026-10-13）：12 张规范图 + 「全员动画」
   .pet-sprite 是动作层（translate/rotate/scale），img 只负责翻面 scaleX(-1)，互不干扰。
   动作名由 pet.js 的 POSE_ANIM 表按表情 key 写到 data-anim 上。
   ========================================================================== */

.pet-sprite { display: block; width: 100%; height: 100%; transform-origin: 50% 90%;
  animation: niu-breath 3.4s ease-in-out infinite; }
.pet-sprite img { width: 100%; height: 100%; object-fit: contain; display: block;
  pointer-events: none; -webkit-user-drag: none; }

@keyframes niu-breath { 0%,100%{transform:translateY(0) scale(1,1)}50%{transform:translateY(-2px) scale(1.006,.99)} }

@keyframes niu-bounce { 0%,100%{transform:translateY(0)}35%{transform:translateY(-7px) rotate(-1.2deg)}70%{transform:translateY(-2px)} }

@keyframes niu-hop { 0%,100%{transform:translateY(0) scale(1,1)}20%{transform:translateY(0) scale(1.035,.94)}55%{transform:translateY(-15px) scale(.98,1.05)}85%{transform:translateY(0) scale(1.04,.95)} }

@keyframes niu-cheer { 0%,100%{transform:translateY(0) rotate(0)}25%{transform:translateY(-9px) rotate(-3deg)}50%{transform:translateY(0) rotate(0)}75%{transform:translateY(-6px) rotate(3deg)} }

@keyframes niu-charge { 0%,100%{transform:translateX(0) scale(1,1)}50%{transform:translateX(3px) scale(1.02,1)} }

@keyframes niu-sprint { 0%,100%{transform:translateY(0) rotate(-1.2deg)}50%{transform:translateY(-3px) rotate(1.2deg)} }

@keyframes niu-trot { 0%,100%{transform:translateY(0)}50%{transform:translateY(-2.5px)} }

@keyframes niu-typing { 0%,100%{transform:translateY(0) rotate(0)}25%{transform:translateY(-1px) rotate(-.7deg)}75%{transform:translateY(1px) rotate(.7deg)} }

@keyframes niu-droop { 0%,100%{transform:translateY(1px) scale(1,.99)}50%{transform:translateY(3.5px) scale(1.005,.972)} }

@keyframes niu-shiver { 0%,100%{transform:translateX(0) rotate(0)}25%{transform:translateX(-1.6px) rotate(-1.1deg)}75%{transform:translateX(1.6px) rotate(1.1deg)} }

@keyframes niu-tilt { 0%,100%{transform:rotate(0)}50%{transform:rotate(-3.5deg) translateY(-1px)} }

@keyframes niu-ping { 0%,100%{transform:translateY(0) scale(1)}12%{transform:translateY(-4px) scale(1.03)}30%{transform:translateY(0) scale(1)} }

@keyframes niu-shine { 0%,100%{transform:translateY(0) scale(1)}50%{transform:translateY(-2px) scale(1.022)} }

@keyframes niu-munch { 0%,100%{transform:translateY(0)}30%{transform:translateY(2px) scale(1.012,.988)}60%{transform:translateY(0)} }

@keyframes niu-stretch { 0%,100%{transform:scale(1,1)}35%{transform:scale(1.035,.968)}70%{transform:scale(.985,1.022)} }

@keyframes niu-wiggle { 0%,100%{transform:rotate(0)}20%{transform:rotate(-4deg)}60%{transform:rotate(4deg)} }

@keyframes niu-sip { 0%,100%{transform:translateY(0)}40%{transform:translateY(-1.5px) rotate(-1deg)} }

@keyframes niu-scan { 0%,100%{transform:translateX(0)}30%{transform:translateX(-2.2px)}70%{transform:translateX(2.2px)} }

.pet-sprite[data-anim="breath"] { animation: niu-breath 3.4s ease-in-out infinite; }

.pet-sprite[data-anim="bounce"] { animation: niu-bounce 1.15s ease-in-out infinite; }

.pet-sprite[data-anim="hop"] { animation: niu-hop 1.5s ease-in-out infinite; }

.pet-sprite[data-anim="cheer"] { animation: niu-cheer 1.6s ease-in-out infinite; }

.pet-sprite[data-anim="charge"] { animation: niu-charge 1.1s ease-in-out infinite; }

.pet-sprite[data-anim="sprint"] { animation: niu-sprint 0.62s ease-in-out infinite; }

.pet-sprite[data-anim="trot"] { animation: niu-trot 0.95s ease-in-out infinite; }

.pet-sprite[data-anim="typing"] { animation: niu-typing 0.85s ease-in-out infinite; }

.pet-sprite[data-anim="droop"] { animation: niu-droop 3.8s ease-in-out infinite; }

.pet-sprite[data-anim="shiver"] { animation: niu-shiver 0.28s ease-in-out infinite; }

.pet-sprite[data-anim="tilt"] { animation: niu-tilt 2.6s ease-in-out infinite; }

.pet-sprite[data-anim="ping"] { animation: niu-ping 2.2s ease-in-out infinite; }

.pet-sprite[data-anim="shine"] { animation: niu-shine 1.9s ease-in-out infinite; }

.pet-sprite[data-anim="munch"] { animation: niu-munch 0.72s ease-in-out infinite; }

.pet-sprite[data-anim="stretch"] { animation: niu-stretch 2.8s ease-in-out infinite; }

.pet-sprite[data-anim="wiggle"] { animation: niu-wiggle 1.25s ease-in-out infinite; }

.pet-sprite[data-anim="sip"] { animation: niu-sip 2.4s ease-in-out infinite; }

.pet-sprite[data-anim="scan"] { animation: niu-scan 3.0s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .pet-sprite { animation: none !important; }
}
