/* ===== 桌面端伴学萌宠常驻侧边栏（全屏右侧全高铺满） ===== */
  .desktop-pet-card{
    width: 352px; height: 100%; flex-shrink: 0;
    background: linear-gradient(180deg,rgba(255,255,255,.96),rgba(255,251,246,.98));
    border: none; border-left: 1px solid rgba(220,200,177,.76); border-radius: 0;
    box-shadow: -10px 0 30px rgba(73,49,31,.05); padding: 26px 22px;
    display: flex; flex-direction: column; gap: 18px;
    position: relative; top: 0; overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: #E8D5C4 transparent;
    transition: all .3s cubic-bezier(.2,.8,.3,1);
  }
  .desktop-pet-card::-webkit-scrollbar{ width: 5px; }
  .desktop-pet-card::-webkit-scrollbar-thumb{ background: #E8D5C4; border-radius: 999px; }
  .pet-card-header{
    display:flex; justify-content:space-between; align-items:center; padding:2px 4px;
  }
  .pet-badge-tag{
    display:inline-flex; align-items:center; gap:5px;
    font-size:12.5px; font-weight:800; color:#AD3F10;
    background:var(--orange-soft); padding:6px 11px; border-radius:999px;
  }
  .pet-badge-tag .sparkle{ animation:spinPulse 2.5s ease-in-out infinite; }
  @keyframes spinPulse{ 0%,100%{ transform:scale(1) rotate(0deg); } 50%{ transform:scale(1.2) rotate(180deg); } }
  .pet-top-actions{ display:flex; align-items:center; gap:8px; }
  .icon-btn{
    min-width:44px; min-height:44px; border-radius:50%; border:1.5px solid #F0E4D4;
    background:#fff; cursor:pointer; font-size:16px; display:inline-flex; align-items:center; justify-content:center;
    transition:transform var(--motion-fast), background var(--motion-fast), border-color var(--motion-fast);
  }
  .icon-btn:hover{ background:var(--cream); transform:scale(1.08); }
  .icon-btn:active{ transform:scale(.92); }
  .berry-counter{
    display:inline-flex; align-items:center; gap:4px; font-size:12.5px; font-weight:800;
    color:#B42318; background:#FEECEB; padding:4px 9px; border-radius:999px; border:1px solid #FFD6D4;
  }
  
  /* 开放式非束缚舞台（打破硬框限制，营造自然灵动的伴学生态） */
  .pet-stage-box{
    background: radial-gradient(ellipse 85% 65% at 50% 68%, rgba(255, 236, 217, 0.85) 0%, rgba(255, 248, 240, 0.25) 55%, transparent 75%);
    border: none;
    border-radius: 0;
    padding: 8px 6px 14px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: none;
    overflow: visible;
  }
  .pet-speech-bubble{
    width: 100%;
    max-width: 280px;
    background: #ffffff;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 750;
    color: var(--ink);
    line-height: 1.45;
    box-shadow: 0 8px 24px rgba(120, 75, 35, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
    border: 1.5px solid rgba(255, 222, 202, 0.85);
    position: relative;
    margin-bottom: 8px;
    text-align: center;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: petSpeechFloat 3.8s ease-in-out infinite;
  }
  .pet-speech-bubble::after{
    content: "";
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 7px 0;
    border-style: solid;
    border-color: #FFE0CF transparent transparent;
  }
  @keyframes petSpeechFloat{
    0%, 100%{ transform: translateY(0); }
    50%{ transform: translateY(-3.5px); }
  }
  
  .pet-character-wrap{
    width: 100%;
    max-width: 220px;
    height: 195px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    margin: 4px 0 10px;
    transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
  }
  .pet-character-wrap:hover{ transform: translateY(-2px); }
  .pet-character{
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
  }
  .pet-character:hover{ transform: scale(1.04); }
  .pet-character:active{ transform: scale(.95); }
  .pet-character svg{
    width: 185px;
    height: 185px;
    filter: drop-shadow(0 10px 22px rgba(61, 50, 41, 0.14));
    overflow: visible;
  }
  
  @keyframes petBob{ 0%,100%{ transform:translateY(0); } 50%{ transform:translateY(-5px); } }
  .pet-floating{ animation:petBob 3.4s ease-in-out infinite; }
  
  @keyframes petBlink{ 0%,88%,100%{ transform:scaleY(1); } 94%{ transform:scaleY(0.1); } }
  .pet-eyes{ transform-origin:50% 42px; animation:petBlink 4.5s ease-in-out infinite; }
  
  @keyframes petWobble{
    0%,100%{ transform:rotate(0deg) scale(1); }
    25%{ transform:rotate(-10deg) scale(1.12); }
    75%{ transform:rotate(10deg) scale(1.12); }
  }
  .pet-wobbling{ animation:petWobble .5s ease-in-out; }
  
  @keyframes petMunchAni{
    0%,100%{ transform:scale(1); }
    30%{ transform:scale(1.18, 0.85); }
    60%{ transform:scale(0.88, 1.15); }
  }
  .pet-munching{ animation:petMunchAni .6s ease-in-out; }
  
  @keyframes petSpinAni{
    0%{ transform:rotate(0deg) scale(1); }
    50%{ transform:rotate(180deg) scale(1.22); }
    100%{ transform:rotate(360deg) scale(1); }
  }
  .pet-spinning{ animation:petSpinAni .75s cubic-bezier(.2,.8,.3,1); }

  /* ===== 魔法猫咪「魔法妙妙」2D 骨骼与 6 组核心动作灵动动画系统 ===== */
  .cat-ground-shadow {
    transform-origin: 50px 96.5px;
    animation: catShadowIdle 3.4s ease-in-out infinite;
  }
  @keyframes catShadowIdle {
    0%, 100% { transform: scale(1); opacity: 0.22; }
    50% { transform: scale(0.95); opacity: 0.17; }
  }

  .cat-tail {
    transform-origin: 59px 82px;
  }
  .cat-head {
    transform-origin: 50px 64px;
    transition: transform 0.28s cubic-bezier(.34, 1.56, .64, 1);
  }
  .cat-arm-r {
    transform-origin: 58px 70px;
    transition: transform 0.28s cubic-bezier(.34, 1.56, .64, 1);
  }
  .cat-arm-l {
    transform-origin: 42px 70px;
    transition: transform 0.28s cubic-bezier(.34, 1.56, .64, 1);
  }
  .cat-mouth {
    transform-origin: 50px 55px;
    transition: transform 0.15s ease;
  }
  .cat-eyes {
    transform-origin: 50px 45px;
    transition: transform 0.2s ease;
  }
  .cat-hat-star {
    transform-origin: 71px 9px;
  }
  .cat-ear-r {
    transform-origin: 74px 28px;
    animation: catEarTwitch 4.8s ease-in-out infinite;
  }
  @keyframes catEarTwitch {
    0%, 88%, 100% { transform: rotate(0deg); }
    91% { transform: rotate(6deg); }
    94% { transform: rotate(-3deg); }
    97% { transform: rotate(4deg); }
  }
  .cat-forehead-star {
    animation: catStarTwinkle 3.2s ease-in-out infinite;
  }
  @keyframes catStarTwinkle {
    0%, 100% { filter: drop-shadow(0 0 1px rgba(255, 215, 0, 0.5)); }
    50% { filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.95)); }
  }

  /* 1. 默认 Idle 待机状态：呼吸浮动、眨眼、尾巴小幅自然摇摆、帽尖星随动微晃 */
  @keyframes catTailIdle {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(10deg); }
  }
  @keyframes catHatBounce {
    0%, 100% { transform: translate(71px, 9px) rotate(0deg); }
    50% { transform: translate(71px, 8.5px) rotate(8deg); }
  }
  .pet-character:not(.pet-act-hello):not(.pet-act-thinking):not(.pet-act-talking):not(.pet-act-celebrate):not(.pet-act-encourage) .cat-tail,
  .pet-act-idle .cat-tail {
    animation: catTailIdle 3.2s ease-in-out infinite;
  }
  .pet-character:not(.pet-act-hello):not(.pet-act-thinking):not(.pet-act-talking):not(.pet-act-celebrate):not(.pet-act-encourage) .cat-hat-star,
  .pet-act-idle .cat-hat-star {
    animation: catHatBounce 3.2s ease-in-out infinite;
  }

  /* 2. Hello 打招呼：挥手、歪头、微笑 */
  @keyframes catWaveRightArm {
    0%, 100% { transform: rotate(0deg); }
    15% { transform: rotate(-75deg); }
    30% { transform: rotate(-48deg); }
    45% { transform: rotate(-75deg); }
    60% { transform: rotate(-48deg); }
    75% { transform: rotate(-70deg); }
    90% { transform: rotate(-25deg); }
  }
  @keyframes catHeadTiltHello {
    0%, 100% { transform: rotate(0deg); }
    20%, 80% { transform: rotate(-8deg) translateY(-2px); }
  }
  .pet-act-hello .cat-head {
    animation: catHeadTiltHello 1.8s cubic-bezier(.34, 1.56, .64, 1);
  }
  .pet-act-hello .cat-arm-r {
    animation: catWaveRightArm 1.8s cubic-bezier(0.25, 1, 0.5, 1);
  }
  .pet-act-hello .cat-tail {
    animation: catTailIdle 1.2s ease-in-out infinite;
  }

  /* 3. Thinking 思考：歪头、眼睛上看、尾巴慢摆 */
  @keyframes catHeadThink {
    0%, 100% { transform: rotate(8deg) translateY(-2.5px); }
    50% { transform: rotate(11deg) translateY(-3.5px); }
  }
  @keyframes catEyesLookUp {
    0%, 100% { transform: translateY(-2.2px) translateX(0.6px); }
    50% { transform: translateY(-3.0px) translateX(1px); }
  }
  @keyframes catTailThink {
    0%, 100% { transform: rotate(-6deg); }
    50% { transform: rotate(14deg); }
  }
  @keyframes catArmThink {
    0%, 100% { transform: rotate(-55deg) translateY(-2px); }
    50% { transform: rotate(-58deg) translateY(-3px); }
  }
  .pet-act-thinking .cat-head {
    animation: catHeadThink 2.4s ease-in-out infinite;
  }
  .pet-act-thinking .cat-eyes {
    animation: catEyesLookUp 2.4s ease-in-out infinite;
  }
  .pet-act-thinking .cat-tail {
    animation: catTailThink 2.4s ease-in-out infinite;
  }
  .pet-act-thinking .cat-arm-r {
    animation: catArmThink 2.4s ease-in-out infinite;
  }

  /* 4. Talking 讲解：嘴巴开合、轻微点头、手做小幅讲解手势 */
  @keyframes catMouthTalk {
    0%, 100% { transform: scaleY(0.85); }
    25% { transform: scaleY(1.4) scaleX(1.08); }
    50% { transform: scaleY(0.9); }
    75% { transform: scaleY(1.45) scaleX(1.1); }
  }
  @keyframes catNodTalk {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(2.5px) rotate(1.2deg); }
  }
  @keyframes catGestureRight {
    0%, 100% { transform: rotate(-12deg); }
    50% { transform: rotate(-38deg) translateY(-2px); }
  }
  @keyframes catGestureLeft {
    0%, 100% { transform: rotate(12deg); }
    50% { transform: rotate(32deg) translateY(-1px); }
  }
  .pet-act-talking .cat-mouth {
    animation: catMouthTalk 0.42s ease-in-out infinite;
  }
  .pet-act-talking .cat-head {
    animation: catNodTalk 0.8s ease-in-out infinite;
  }
  .pet-act-talking .cat-arm-r {
    animation: catGestureRight 1.2s ease-in-out infinite;
  }
  .pet-act-talking .cat-arm-l {
    animation: catGestureLeft 1.2s ease-in-out infinite 0.6s;
  }

  /* 5. Celebrate 庆祝：小跳一下、双手举起、尾巴翘高 */
  @keyframes catCelebrateJump {
    0%, 100% { transform: translateY(0) scale(1); }
    12% { transform: translateY(4px) scale(1.12, 0.88); }
    42% { transform: translateY(-22px) scale(0.92, 1.08); }
    72% { transform: translateY(2px) scale(1.1, 0.9); }
    88% { transform: translateY(-4px) scale(0.98, 1.02); }
  }
  @keyframes catArmsCheerL {
    0%, 100% { transform: rotate(0deg); }
    25%, 80% { transform: rotate(115deg) translateY(2px); }
  }
  @keyframes catArmsCheerR {
    0%, 100% { transform: rotate(0deg); }
    25%, 80% { transform: rotate(-115deg) translateY(2px); }
  }
  @keyframes catTailCelebrate {
    0%, 100% { transform: rotate(0deg); }
    30%, 80% { transform: rotate(-26deg) scale(1.1); }
  }
  .pet-act-celebrate {
    animation: catCelebrateJump 1.5s cubic-bezier(0.28, 0.84, 0.42, 1);
  }
  .pet-act-celebrate .cat-ground-shadow {
    animation: catShadowJump 1.5s cubic-bezier(0.28, 0.84, 0.42, 1);
  }
  @keyframes catShadowJump {
    0%, 100% { transform: scale(1); opacity: 0.22; }
    12% { transform: scale(1.2); opacity: 0.28; }
    42% { transform: scale(0.55); opacity: 0.08; }
    72% { transform: scale(1.22); opacity: 0.28; }
    88% { transform: scale(0.96); opacity: 0.2; }
  }
  .pet-act-celebrate .cat-arm-l {
    animation: catArmsCheerL 1.5s cubic-bezier(0.28, 0.84, 0.42, 1);
  }
  .pet-act-celebrate .cat-arm-r {
    animation: catArmsCheerR 1.5s cubic-bezier(0.28, 0.84, 0.42, 1);
  }
  .pet-act-celebrate .cat-tail {
    animation: catTailCelebrate 1.5s ease-in-out;
  }

  /* 6. Encourage 鼓励：点头、握拳或做加油手势，保持温柔笑脸 */
  @keyframes catNodEncourage {
    0%, 100% { transform: translateY(0); }
    28% { transform: translateY(3.5px) rotate(2deg); }
    55% { transform: translateY(0); }
    75% { transform: translateY(3px); }
  }
  @keyframes catFistPump {
    0%, 100% { transform: rotate(0deg); }
    22% { transform: rotate(-50deg) translate(-2px, -3px); }
    42% { transform: rotate(-35deg); }
    65% { transform: rotate(-58deg) translate(-3px, -5px); }
    82% { transform: rotate(-25deg); }
  }
  .pet-act-encourage .cat-head {
    animation: catNodEncourage 1.8s ease-in-out;
  }
  .pet-act-encourage .cat-arm-r {
    animation: catFistPump 1.8s ease-in-out;
  }
  .pet-act-encourage .cat-cape-brooch {
    animation: catBroochPulse 1.8s ease-in-out;
  }
  @keyframes catBroochPulse {
    0%, 100% { filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.4)); }
    50% { filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.95)); }
  }

  /* ===== 萌龙呆呆：与猫咪共用同一套动作关键帧，关节对齐参考图站姿 ===== */
  .dino-ground-shadow {
    transform-origin: 50px 96.5px;
    animation: catShadowIdle 3.4s ease-in-out infinite;
  }
  .dino-tail { transform-origin: 50px 91px; }
  .dino-head {
    transform-origin: 50px 64px;
    transition: transform 0.28s cubic-bezier(.34, 1.56, .64, 1);
  }
  .dino-arm-r {
    transform-origin: 64px 59px;
    transition: transform 0.28s cubic-bezier(.34, 1.56, .64, 1);
  }
  .dino-arm-l {
    transform-origin: 36px 59px;
    transition: transform 0.28s cubic-bezier(.34, 1.56, .64, 1);
  }
  .dino-mouth {
    transform-origin: 50px 55px;
    transition: transform 0.15s ease;
  }
  .dino-eyes { transform-origin: 50px 40px; }

  .pet-character:not(.pet-act-hello):not(.pet-act-thinking):not(.pet-act-talking):not(.pet-act-celebrate):not(.pet-act-encourage) .dino-tail,
  .pet-act-idle .dino-tail {
    animation: catTailIdle 3.2s ease-in-out infinite;
  }
  .pet-act-hello .dino-head { animation: catHeadTiltHello 1.8s cubic-bezier(.34, 1.56, .64, 1); }
  .pet-act-hello .dino-arm-r { animation: catWaveRightArm 1.8s cubic-bezier(0.25, 1, 0.5, 1); }
  .pet-act-hello .dino-tail { animation: catTailIdle 1.2s ease-in-out infinite; }
  .pet-act-thinking .dino-head { animation: catHeadThink 2.4s ease-in-out infinite; }
  .pet-act-thinking .dino-eyes { animation: catEyesLookUp 2.4s ease-in-out infinite; }
  .pet-act-thinking .dino-tail { animation: catTailThink 2.4s ease-in-out infinite; }
  .pet-act-thinking .dino-arm-r { animation: catArmThink 2.4s ease-in-out infinite; }
  .pet-act-talking .dino-mouth { animation: catMouthTalk 0.42s ease-in-out infinite; }
  .pet-act-talking .dino-head { animation: catNodTalk 0.8s ease-in-out infinite; }
  .pet-act-talking .dino-arm-r { animation: catGestureRight 1.2s ease-in-out infinite; }
  .pet-act-talking .dino-arm-l { animation: catGestureLeft 1.2s ease-in-out infinite 0.6s; }
  .pet-act-celebrate .dino-ground-shadow { animation: catShadowJump 1.5s cubic-bezier(0.28, 0.84, 0.42, 1); }
  .pet-act-celebrate .dino-arm-l { animation: catArmsCheerL 1.5s cubic-bezier(0.28, 0.84, 0.42, 1); }
  .pet-act-celebrate .dino-arm-r { animation: catArmsCheerR 1.5s cubic-bezier(0.28, 0.84, 0.42, 1); }
  .pet-act-celebrate .dino-tail { animation: catTailCelebrate 1.5s ease-in-out; }
  .pet-act-encourage .dino-head { animation: catNodEncourage 1.8s ease-in-out; }
  .pet-act-encourage .dino-arm-r { animation: catFistPump 1.8s ease-in-out; }

  /* 参考图精灵：整张原图做轻微动作，避免盖住粘土质感 */
  .pet-ref-figure {
    transform-origin: center bottom;
    transform-box: fill-box;
  }
  @keyframes petRefIdle {
    0%, 100% { transform: translateY(0) scale(1, 1); }
    50% { transform: translateY(-3px) scale(1.015, 0.99); }
  }
  @keyframes petRefHello {
    0%, 100% { transform: rotate(0deg) scale(1); }
    18% { transform: rotate(-8deg) translateY(-3px) scale(1.03); }
    36% { transform: rotate(6deg) translateY(-1px) scale(1.01); }
    54% { transform: rotate(-7deg) translateY(-2px) scale(1.02); }
    72% { transform: rotate(4deg) translateY(0) scale(1.01); }
    88% { transform: rotate(-2deg); }
  }
  @keyframes petRefThink {
    0%, 100% { transform: rotate(6deg) translateY(-2px); }
    50% { transform: rotate(9deg) translateY(-4px) scale(1.01); }
  }
  @keyframes petRefTalk {
    0%, 100% { transform: translateY(0) scale(1, 1); }
    50% { transform: translateY(2.5px) scale(1.02, 0.98) rotate(0.8deg); }
  }
  @keyframes petRefNod {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(3.5px) rotate(2deg); }
    50% { transform: translateY(0) rotate(0deg); }
    75% { transform: translateY(3px) rotate(1.5deg); }
  }
  @keyframes petRefSleep {
    0%, 100% { transform: translateY(1.5px) scale(1.01, 0.98); }
    50% { transform: translateY(-1.5px) scale(0.99, 1.01); }
  }
  .pet-character:not(.pet-act-hello):not(.pet-act-thinking):not(.pet-act-talking):not(.pet-act-celebrate):not(.pet-act-encourage) .pet-ref-figure,
  .pet-act-idle .pet-ref-figure { animation: petRefIdle 3.2s ease-in-out infinite; }
  .pet-act-hello .pet-ref-figure { animation: petRefHello 1.8s ease-in-out; }
  .pet-act-thinking .pet-ref-figure { animation: petRefThink 2.4s ease-in-out infinite; }
  .pet-act-talking .pet-ref-figure { animation: petRefTalk 0.42s ease-in-out infinite; }
  .pet-act-encourage .pet-ref-figure { animation: petRefNod 1.8s ease-in-out; }
  .pet-act-celebrate .pet-ref-figure { animation: catCelebrateJump 1.5s cubic-bezier(0.28, 0.84, 0.42, 1); }
  .pet-character.is-sleeping .pet-ref-figure,
  .pet-character:has(.pet-zzz-text) .pet-ref-figure { animation: petRefSleep 4s ease-in-out infinite; }
  .pet-zzz-text {
    animation: petZzzFloat 2.6s ease-in-out infinite;
    transform-origin: 74px 24px;
  }
  @keyframes petZzzFloat {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.75; }
    50% { transform: translateY(-5px) scale(1.15); opacity: 1; }
  }
  
  /* 特效层（小心心、小星星粒子） */
  .pet-fx-layer{ position:absolute; inset:0; pointer-events:none; overflow:visible; }
  .heart-particle{
    position:absolute; font-size:22px; animation:floatHeart .8s ease-out forwards;
  }
  @keyframes floatHeart{
    0%{ opacity:1; transform:translate(0, 0) scale(.6); }
    100%{ opacity:0; transform:translate(var(--tx, 0), -50px) scale(1.3) rotate(var(--rot, 0deg)); }
  }
  .berry-particle{
    position:absolute; font-size:22px; animation:eatBerry .7s cubic-bezier(.1,.9,.2,1) forwards;
  }
  @keyframes eatBerry{
    0%{ opacity:0; transform:scale(.5) translateY(24px); }
    40%{ opacity:1; transform:scale(1.2) translateY(-10px); }
    100%{ opacity:0; transform:scale(.2) translateY(8px); }
  }
  
  .pet-info-row{
    display:flex; align-items:center; justify-content:space-between; width:100%; margin-top:4px;
  }
  .pet-lv-pill{
    font-size:11px; font-weight:800; color:#fff; background:linear-gradient(135deg,#FF7A45,#FFB03A);
    padding:3px 9px; border-radius:999px; box-shadow:0 2px 6px rgba(255,122,69,.25);
  }
  .pet-name-label{ font-size:13.5px; font-weight:800; color:var(--ink); }
  
  .pet-progress-wrap{ width:100%; margin-top:8px; }
  .pet-progress-bar{
    height:8px; background:#EFE3D4; border-radius:999px; overflow:hidden;
  }
  .pet-progress-fill{
    height:100%; border-radius:999px; background:linear-gradient(90deg,var(--orange),#FF9F43);
    transition:width .4s ease;
  }
  .pet-progress-text{
    display:flex; justify-content:space-between; font-size:11px; color:var(--ink-light);
    font-weight:600; margin-top:4px;
  }
  
  /* 操作网格 */
  .pet-action-grid{
    display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px;
  }
  .pet-btn-tool{
    border:none; background:#FFF9F0; border:1px solid #EFDCCA;
    border-radius:16px; padding:11px 4px; min-height:68px; cursor:pointer; font-family:inherit;
    display:flex; flex-direction:column; align-items:center; gap:4px;
    font-size:12px; font-weight:800; color:var(--ink); transition:transform var(--motion-fast), background var(--motion-fast), border-color var(--motion-fast), box-shadow var(--motion-fast);
  }
  .pet-btn-tool .ico{ font-size:19px; }
  .pet-btn-tool:hover{ background:#FFF1E3; border-color:#E8B895; transform:translateY(-2px); box-shadow:var(--shadow-sm); }
  .pet-btn-tool:active{ transform:scale(.94); }
  
  /* ===== 侧边栏伴学成就展示区 ===== */
  .pet-achievement-section{
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
    padding-top: 14px;
    border-top: 1.5px dashed #F2E3D2;
  }
  .pet-achieve-header{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2px;
  }
  .pet-achieve-title{
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 800;
    color: var(--ink);
  }
  .achieve-title-icon{ font-size: 15px; }
  .pet-achieve-more-btn{
    border: none;
    background: transparent;
    color: #AD3F10;
    font-size: 11.5px;
    font-weight: 750;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px 7px;
    border-radius: 8px;
    transition: background .15s, transform .15s;
  }
  .pet-achieve-more-btn:hover{ background: #FFF4EC; transform: translateX(2px); }
  .pet-achieve-more-btn .arr{ font-size: 13px; font-weight: 800; }

  /* 核心指标微卡片（3列） */
  .pet-achieve-stats-row{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .achieve-stat-chip{
    background: #FFFDF9;
    border: 1px solid #F6E7D8;
    border-radius: 12px;
    padding: 8px 4px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transition: transform .15s, box-shadow .15s;
  }
  .achieve-stat-chip:hover{
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(61,50,41,.06);
    background: #FFF8F0;
  }
  .achieve-stat-chip .chip-num{
    font-size: 13.5px;
    font-weight: 850;
    color: #AD3F10;
    line-height: 1.2;
  }
  .achieve-stat-chip .chip-lbl{
    font-size: 10px;
    font-weight: 700;
    color: var(--ink-light);
    white-space: nowrap;
  }

  /* 勋章展柜微卡片 */
  .pet-badges-mini-card{
    background: linear-gradient(180deg, #FFFFFF 0%, #FFFBF5 100%);
    border: 1.5px solid #FCE4D6;
    border-radius: 18px;
    padding: 12px 10px 10px;
    box-shadow: 0 4px 12px rgba(61,50,41,.03);
  }
  .mini-card-head{
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 4px;
  }
  .mini-card-title{
    font-size: 12px;
    font-weight: 800;
    color: var(--ink);
  }
  .mini-card-tip{
    font-size: 10.5px;
    font-weight: 700;
    color: #AD3F10;
    background: #FFF2E8;
    padding: 2px 7px;
    border-radius: 999px;
  }
  .pet-badges-mini-grid{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .mini-badge-item{
    background: #fff;
    border: 1.5px solid #F0E4D4;
    border-radius: 14px;
    padding: 8px 4px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    text-align: center;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    transition: all .2s cubic-bezier(.34, 1.56, .64, 1);
    font-family: inherit;
    color: inherit;
  }
  .mini-badge-item:hover{
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 5px 12px rgba(250,140,22,.15);
  }
  .mini-badge-item:active{
    transform: scale(.95);
  }
  .mini-badge-item.unlocked{
    border-color: #FFD591;
    background: linear-gradient(160deg, #FFFDF5 0%, #FFF4E0 100%);
    box-shadow: 0 2px 8px rgba(250,173,20,.16);
  }
  .mini-badge-item.unlocked .b-icon-wrap{
    background: radial-gradient(circle, #FFE58F 0%, #FFA940 100%);
    box-shadow: 0 2px 6px rgba(250,140,22,.3);
  }
  .mini-badge-item.locked{
    opacity: .68;
    background: #FAF8F5;
    border-style: dashed;
    border-color: #E8DDD2;
  }
  .mini-badge-item.locked .b-icon-wrap{
    background: #EBE4DC;
    filter: grayscale(80%);
  }
  .b-icon-wrap{
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    transition: transform .2s;
  }
  .mini-badge-item:hover .b-icon-wrap{
    transform: scale(1.1);
  }
  .b-name{
    font-size: 11px;
    font-weight: 800;
    color: var(--ink);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
  }
  .b-status-pill{
    font-size: 9px;
    font-weight: 750;
    padding: 1px 5px;
    border-radius: 999px;
    line-height: 1.3;
  }
  .mini-badge-item.unlocked .b-status-pill{
    background: #FFF0B8;
    color: #874D00;
  }
  .mini-badge-item.locked .b-status-pill{
    background: #ECE4DA;
    color: #8C7B6D;
  }

  /* 近期高光里程碑卡片 */
  .pet-milestone-card{
    background: linear-gradient(135deg, #FFF8EE 0%, #FFF2E8 100%);
    border: 1.5px solid #FFD8BF;
    border-radius: 16px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: transform .18s, box-shadow .18s;
    width: 100%;
    font-family: inherit;
    color: inherit;
    text-align: left;
  }
  .pet-milestone-card:hover{
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,122,69,.15);
  }
  .pet-milestone-card:active{
    transform: scale(.98);
  }
  .milestone-badge-icon{
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: #fff;
    border: 1.5px solid #FFD0B5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(255,122,69,.12);
  }
  .milestone-info{
    flex: 1;
    min-width: 0;
  }
  .milestone-title-row{
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
  }
  .milestone-label{
    font-size: 9.5px;
    font-weight: 800;
    color: #fff;
    background: #FA541C;
    padding: 1px 5px;
    border-radius: 4px;
    letter-spacing: .5px;
  }
  .milestone-name{
    font-size: 12px;
    font-weight: 800;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .milestone-desc{
    font-size: 10.5px;
    color: var(--ink-light);
    line-height: 1.35;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .milestone-progress-track{
    height: 5px;
    background: #EFE2D4;
    border-radius: 999px;
    overflow: hidden;
  }
  .milestone-progress-fill{
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #FF7A45, #FFB03A);
    transition: width .4s ease;
  }

  /* 学习页中的伴学提醒条 */
  .learn-companion-bar{
    display:flex; align-items:center; gap:10px; background:linear-gradient(135deg,#FFF7EE,#FFF0F3);
    border-radius:16px; padding:10px 12px; margin:8px 0 12px; border:1.5px dashed #FFD0B5;
  }
  .learn-companion-bar .l-avatar{
    width:36px; height:36px; border-radius:50%; background:#fff;
    display:flex; align-items:center; justify-content:center; font-size:20px;
    box-shadow:0 3px 8px rgba(255,122,69,.2); flex-shrink:0;
  }
  .learn-companion-bar .l-bubble{
    flex:1; font-size:12.5px; font-weight:700; color:var(--ink); line-height:1.45;
  }
  .learn-companion-bar .l-cheer-btn{
    border:none; background:var(--orange); color:#fff; font-size:12px; font-weight:800;
    min-height:44px; min-width:44px; padding:8px 14px; border-radius:999px; cursor:pointer; white-space:nowrap;
    box-shadow:0 3px 8px rgba(255,122,69,.3); transition:transform .15s; font-family:inherit;
    display:inline-flex; align-items:center; justify-content:center;
  }
  .learn-companion-bar .l-cheer-btn:active{ transform:scale(.92); }
  
  /* 我的页面中的伴学伙伴卡片 */
  .pet-my-card{
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    background:linear-gradient(145deg,#FFFFFF 60%,#FFF5EB); border:2px solid #FFE4D4;
    border-radius:20px; padding:16px; margin-bottom:16px;
  }
  .pet-my-left{ display:flex; align-items:center; gap:12px; }
  .pet-my-avatar{
    width:50px; height:50px; border-radius:50%; background:radial-gradient(circle at 30% 30%,#fff,#FFE2CD);
    display:flex; align-items:center; justify-content:center; font-size:26px;
    box-shadow:0 4px 10px rgba(255,122,69,.2); flex-shrink:0;
  }
  .pet-my-details .pet-my-name{ font-size:15px; font-weight:800; display:flex; align-items:center; gap:6px; }
  .pet-my-details .pet-my-sub{ font-size:12px; color:var(--ink-light); margin-top:3px; }
  .btn-pet-entry{
    border:none; background:var(--orange-soft); color:#AD3F10; font-size:13px; font-weight:800;
    padding:9px 14px; border-radius:999px; cursor:pointer; font-family:inherit; transition:all .2s;
    white-space:nowrap;
  }
  .btn-pet-entry:active{ transform:scale(.94); background:#FFD5BF; }
  .chip-sm{ font-size:10.5px; font-weight:750; padding:2px 8px; border-radius:999px; background:#FFEADF; color:#AD3F10; }
  
  /* ===== 精灵乐园弹窗（修复关不掉问题：严格处理隐藏状态） ===== */
  .pet-modal-overlay{
    position: fixed; inset: 0; background: rgba(40,30,22,.65);
    backdrop-filter: blur(5px); z-index: 9999;
    display: none; align-items: center; justify-content: center; padding: 20px;
  }
  .pet-modal-overlay.open{
    display: flex !important;
    animation: fadeIn .2s ease;
  }
  .pet-modal-overlay[hidden],
  .pet-modal-overlay:not(.open){
    display: none !important;
  }
  @keyframes fadeIn{ from{opacity:0;} to{opacity:1;} }

  .pet-modal-card{
    width: 100%; max-width: 680px; max-height: 90vh; background: #FFFDF9;
    border-radius: 28px; box-shadow: 0 28px 70px rgba(40,30,22,.32);
    border: 4px solid #fff; display: flex; flex-direction: column; overflow: hidden;
    animation: popModal .25s cubic-bezier(.34, 1.4, .64, 1);
  }
  @keyframes popModal{ from{transform:scale(.92) translateY(16px); opacity:0;} to{transform:scale(1) translateY(0); opacity:1;} }

  .modal-header{
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px; border-bottom: 1.5px dashed #F2E4D4; background: #FFF7ED;
  }
  .modal-header h3{ font-size: 18px; font-weight: 850; color: var(--ink); display: flex; align-items: center; gap: 8px; }
  .modal-header .close-btn{
    width: 38px; height: 38px; border-radius: 50%; border: none; background: #EFE4D6;
    font-size: 24px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: var(--ink); font-weight: 700; transition: all .18s ease;
  }
  .modal-header .close-btn:hover{ background: #FFE0CF; color: var(--orange); transform: scale(1.1); }
  .modal-header .close-btn:active{ transform: scale(.92); }
  .modal-body{ flex: 1; overflow-y: auto; padding: 20px 24px 28px; scrollbar-width: thin; scrollbar-color: #E8D5C4 transparent; }
  
  /* 弹窗中的预览区（宽幅自适应布局） */
  .modal-pet-preview{
    background: linear-gradient(180deg,#FFF3E4 0%,#FFE7D8 100%);
    border-radius: 22px; padding: 18px 22px; display: flex; align-items: center;
    justify-content: space-between; gap: 20px;
    border: 2px solid #FFD9C2; margin-bottom: 18px;
  }
  .modal-pet-preview-left{ display: flex; align-items: center; gap: 16px; }
  .preview-stage{
    width: 130px; height: 130px; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 40% 35%, #fff, #FFE3D0); border-radius: 50%;
    box-shadow: 0 8px 20px rgba(255,122,69,.18); flex-shrink: 0;
  }
  .preview-stage svg{ width: 118px; height: 118px; filter: drop-shadow(0 8px 16px rgba(61,50,41,.15)); }
  .preview-meta{ text-align: left; }
  .preview-name{ font-size: 18px; font-weight: 850; }
  .preview-level{ font-size: 13px; font-weight: 700; color: #AD3F10; margin-top: 2px; }
  .preview-berries{ font-size: 12.5px; color: var(--ink-light); margin-top: 4px; }
  .preview-interact-row{ display: flex; flex-direction: column; gap: 8px; width: 170px; flex-shrink: 0; }
  .btn-bubble{
    width: 100%; border: none; padding: 10px 12px; border-radius: 999px; cursor: pointer;
    font-size: 12.5px; font-weight: 800; font-family: inherit; transition: transform .15s;
    text-align: center;
  }
  .btn-bubble:active{ transform: scale(.95); }
  .btn-bubble.orange{ background: var(--orange); color: #fff; box-shadow: 0 4px 12px rgba(255,122,69,.3); }
  .btn-bubble.pink{ background: #FF4D79; color: #fff; box-shadow: 0 4px 12px rgba(255,77,121,.3); }
  
  /* 弹窗 Tab 导航 */
  .modal-tabs{
    display: flex; background: #F2E5D5; border-radius: 999px; padding: 4px; gap: 6px; margin-bottom: 16px;
  }
  .m-tab{
    flex: 1; border: none; background: transparent; padding: 10px 8px; border-radius: 999px;
    font-size: 13px; font-weight: 750; color: var(--ink-light); cursor: pointer; font-family: inherit;
    transition: all .2s; text-align: center;
  }
  .m-tab.active{ background: #fff; color: #B84212; box-shadow: 0 2px 8px rgba(61,50,41,.12); }
  
  .m-tab-panel{ display: none; animation: fadeIn .2s ease; }
  .m-tab-panel.active{ display: block; }
  
  /* 伙伴随心选网格（宽幅4列） */
  .roles-grid{ display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .role-card{
    background: #fff; border-radius: 18px; padding: 14px 12px; border: 2px solid #EFE4D6;
    cursor: pointer; display: flex; flex-direction: column; align-items: center; text-align: center;
    transition: all .2s;
  }
  .role-card:hover{ border-color: #FFBE99; transform: translateY(-2px); }
  .role-card.active{
    border-color: var(--orange); background: #FFF7F0;
    box-shadow: 0 4px 14px rgba(255,122,69,.18);
  }
  .role-card .role-avatar{ font-size: 36px; margin-bottom: 6px; }
  .role-card .role-name{ font-size: 14.5px; font-weight: 800; color: var(--ink); }
  .role-card .role-sub{ font-size: 12.5px; color: #AD3F10; font-weight: 700; margin: 2px 0 4px; }
  .role-card .role-desc{ font-size: 12px; color: var(--ink-light); line-height: 1.45; }
  
  /* 萌趣衣橱网格（宽幅6列） */
  .closet-grid{ display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
  .closet-item{
    background: #fff; border-radius: 16px; padding: 12px 6px; border: 2px solid #EFE4D6;
    cursor: pointer; display: flex; flex-direction: column; align-items: center; text-align: center;
    transition: all .2s;
  }
  .closet-item:hover{ border-color: #FFBE99; transform: translateY(-2px); }
  .closet-item.active{
    border-color: var(--orange); background: #FFF7F0;
    box-shadow: 0 4px 14px rgba(255,122,69,.18);
  }
  .closet-item .c-icon{ font-size: 30px; margin-bottom: 4px; }
  .closet-item .c-name{ font-size: 12px; font-weight: 750; color: var(--ink); }
  .closet-item .c-status{ font-size: 12px; font-weight: 700; margin-top: 2px; color: var(--ink-light); }
  .closet-item.active .c-status{ color: var(--orange); }
  
  /* 荣誉贴纸墙网格（宽幅2列） */
  .stickers-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .sticker-card{
    background: #fff; border-radius: 16px; padding: 14px 12px; border: 2px solid #EFE4D6;
    display: flex; gap: 12px; align-items: center; position: relative; overflow: hidden;
  }
  .sticker-card.unlocked{
    border-color: #FADB14; background: linear-gradient(145deg,#FFFDF0,#FFFBE6);
    box-shadow: 0 4px 12px rgba(250,219,20,.2);
  }
  .sticker-card.locked{ opacity: .6; filter: grayscale(85%); }
  .sticker-icon{ font-size: 32px; flex-shrink: 0; }
  .sticker-info .st-name{ font-size: 13px; font-weight: 800; color: var(--ink); }
  .sticker-info .st-desc{ font-size: 12px; color: var(--ink-light); margin-top: 2px; line-height: 1.45; }
  .sticker-info .st-tag{
    display: inline-block; font-size: 10px; font-weight: 800; padding: 2px 7px;
    border-radius: 999px; margin-top: 4px; background: #FFE58F; color: #874D00;
  }
  .sticker-card.locked .st-tag{ background: #E4DACD; color: #8A7A6B; }
  
  /* 五彩礼花 Canvas */
  .confetti-canvas{
    position: fixed; inset: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 99999;
  }

  /* 宽幅排版专用容器 */
  .card.habit-grid{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 16px 18px;
  }
  .card.habit-grid .habit-item{
    border-bottom: none;
    background: #FFFBF6;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px dashed #F2E3D2;
  }
  .growth-columns,
  .me-columns{
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 20px;
    align-items: start;
  }
  .me-columns{
    grid-template-columns: 1fr 1fr;
  }
  @media (max-width: 940px) {
    .growth-columns,
    .me-columns{
      grid-template-columns: minmax(0, 1fr);
    }
    .me-columns > div{
      min-width: 0;
    }
  }

  /* ===== 学习界面专属：可自由拖拽的桌面浮窗伴学精灵 (Option A) ===== */
  .learn-floating-pet {
    position: fixed;
    right: 28px;
    bottom: 28px;
    width: 145px;
    height: 155px;
    z-index: 950;
    display: flex;
    flex-direction: column;
    align-items: center;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    pointer-events: auto;
    transition: transform 0.25s cubic-bezier(.34, 1.56, .64, 1), opacity 0.2s ease;
  }

  .learn-floating-pet.is-dragging {
    cursor: grabbing !important;
    transition: none !important;
    transform: scale(1.06) !important;
  }

  .learn-floating-pet.is-collapsed .floating-pet-character {
    transform: scale(0.35) translate(80px, 80px);
    opacity: 0.55;
    pointer-events: none;
  }

  .floating-pet-drag-body {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
  }

  .floating-pet-drag-body:active {
    cursor: grabbing;
  }

  .floating-pet-character {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    filter: drop-shadow(0 10px 22px rgba(73, 49, 31, 0.16));
    transition: transform 0.2s cubic-bezier(.34, 1.56, .64, 1);
  }

  .floating-pet-character:hover {
    transform: scale(1.05);
  }

  .floating-pet-character:active {
    transform: scale(0.95);
  }

  .floating-pet-character svg {
    width: 135px;
    height: 135px;
    overflow: visible;
  }

  /* 浮动伴学对话/思考气泡 */
  .floating-pet-bubble {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 220px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255, 218, 196, 0.9);
    box-shadow: 0 8px 24px rgba(120, 75, 35, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
    border-radius: 16px;
    padding: 8px 13px;
    font-size: 12.5px;
    font-weight: 750;
    color: var(--ink);
    line-height: 1.4;
    text-align: center;
    pointer-events: none;
    animation: floatingBubblePop 0.3s cubic-bezier(.34, 1.56, .64, 1);
    z-index: 955;
  }

  .floating-pet-bubble::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 5px 0;
    border-style: solid;
    border-color: #FFDEC4 transparent transparent;
  }

  @keyframes floatingBubblePop {
    0% { opacity: 0; transform: translateX(-50%) translateY(8px) scale(0.85); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  }

  /* 最小化/折叠开关按钮 */
  .floating-pet-collapse-btn {
    position: absolute;
    top: 4px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid #FFD9C2;
    background: #FFF9F2;
    color: #B44616;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, transform 0.15s, background 0.15s;
    z-index: 952;
  }

  .learn-floating-pet:hover .floating-pet-collapse-btn,
  .learn-floating-pet.is-collapsed .floating-pet-collapse-btn {
    opacity: 0.88;
  }

  .floating-pet-collapse-btn:hover {
    opacity: 1 !important;
    background: #FFEAD8;
    transform: scale(1.12);
  }

  .floating-pet-collapse-btn:active {
    transform: scale(0.9);
  }

  @media (max-width: 940px) {
    .floating-pet-bubble {
      left: auto;
      right: 0;
      transform: none;
      max-width: min(220px, calc(100vw - 28px));
    }
    .floating-pet-bubble::after {
      left: auto;
      right: 62px;
      transform: none;
    }
    @keyframes floatingBubblePop {
      0% { opacity: 0; transform: translateY(8px) scale(0.85); }
      100% { opacity: 1; transform: translateY(0) scale(1); }
    }
  }

  @media (max-width: 768px) {
    .learn-floating-pet {
      width: 105px;
      height: 115px;
      right: 14px;
      bottom: calc(var(--mobile-tabbar-total-height) + 12px);
    }
    .floating-pet-character svg {
      width: 95px;
      height: 95px;
    }
    .floating-pet-bubble {
      max-width: 170px;
      font-size: 11.5px;
      padding: 6px 10px;
    }
    .floating-pet-bubble::after {
      right: 42px;
    }
  }
