/* ==========================================================
   珍珍桌宠组件 v15 · 样式（提取自 ink_pet_demo_v14.html）
   提取范围：桌宠组件 CSS 起、至原 </style> 前；已移除 .preview-* 预览页样式。
   只作用于 #inkpet-root / .inkpet-* 命名空间，不会影响宿主页面。
   ========================================================== */
/* ==========================================================
       ZHENZHEN INK PET COMPONENT v15
       正式接入时复制本段组件 CSS 和下面的 InkPet 脚本。
       V14 相比 V13：给墨团加了两只小手手。手不是常驻的，
       只会在害羞 / 方正 / 开心 / 蹭蹭 / 拖动 / 发呆这些时候伸出来，
       位置和动作都以颜文字为中心计算（揣手 / 脸两侧 / 抱鼠标）。
       V15 新增：闲置一会儿头顶外侧浮出 💭 思考气泡，点开是她攒着的几句
       悄悄话；文字逐字滚出，每滚一个字配一声音（Web Audio 现场合成，
       不加载音频文件），最后一个字打完、声音也正好收尾。
       ========================================================== */
    #inkpet-root {
      --inkpet-size: 232px;
      position: fixed;
      z-index: 99999;
      right: 24px;
      bottom: 22px;
      width: var(--inkpet-size);
      height: var(--inkpet-size);
      display: grid;
      place-items: center;
      cursor: grab;
      user-select: none;
      -webkit-user-select: none;
      touch-action: none;
      outline: none;
      -webkit-tap-highlight-color: transparent;
      --inkpet-wander-x: 0px;
      --inkpet-wander-y: 0px;
      --inkpet-wander-rotate: 0deg;
      --inkpet-evade-x: 0px;
      --inkpet-evade-y: 0px;
      --inkpet-outer-x: 0px;
      --inkpet-outer-y: 0px;
      --inkpet-core-x: 0px;
      --inkpet-core-y: 0px;
      --inkpet-core-rotate: 0deg;
      --inkpet-face-x: 0px;
      --inkpet-face-y: 0px;
      --inkpet-face-rotate: 0deg;
      --inkpet-face-inv-scale: 1;
      --inkpet-feed-x: 0px;
      --inkpet-feed-y: 0px;
      --inkpet-feed-scale: 1;
      --inkpet-doze: 0;
      transform: translate3d(calc(var(--inkpet-wander-x) + var(--inkpet-evade-x) + var(--inkpet-feed-x)), calc(var(--inkpet-wander-y) + var(--inkpet-evade-y) + var(--inkpet-feed-y)), 0) rotate(var(--inkpet-wander-rotate)) scale(var(--inkpet-feed-scale));
      transition: transform 1.15s cubic-bezier(.2,.7,.25,1);
    }
    #inkpet-root.inkpet-wandering { transition: none; }
    /* V13 投喂：整只桌宠一边挪向页面中心，一边被墨水撑大。 */
    #inkpet-root.inkpet-feeding { transition: transform .62s cubic-bezier(.2,.86,.24,1.1); }
    #inkpet-root.inkpet-angry { transition: transform .42s cubic-bezier(.2,.72,.2,1); }
    #inkpet-root:focus-visible .inkpet-art {
      filter: drop-shadow(0 0 5px rgba(103, 119, 119, .28));
    }
    #inkpet-root .inkpet-stage {
      position: absolute;
      inset: 0;
      z-index: 1;
      transform: translate3d(0, 0, 0);
      transform-origin: 50% 50%;
      will-change: transform;
      pointer-events: none;
    }
    /* 三层追视：外层浅墨轻微晃动，中层墨核跟随更明显，颜文字幅度最大。 */
    #inkpet-root .inkpet-outer-follow {
      transform: translate(var(--inkpet-outer-x, 0px), var(--inkpet-outer-y, 0px));
      transform-box: view-box;
      will-change: transform;
    }
    #inkpet-root .inkpet-center-follow {
      transform-box: fill-box;
      transform-origin: center;
      transform: translate(var(--inkpet-core-x, 0px), var(--inkpet-core-y, 0px)) rotate(var(--inkpet-core-rotate, 0deg));
      will-change: transform;
    }
    #inkpet-root .inkpet-art {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      overflow: visible;
      pointer-events: none;
      transform-origin: 50% 50%;
      animation: inkpet-idle 5.2s cubic-bezier(.42,0,.58,1) infinite;
      will-change: transform;
    }
    #inkpet-root.inkpet-hover { cursor: grab; }
    /* 蹭蹭作用于整个舞台：外圈浅墨、中心墨团、颜文字脸一起轻轻摆动。 */
    #inkpet-root.inkpet-hover .inkpet-stage {
      animation: inkpet-whole-nuzzle 1.18s cubic-bezier(.42,0,.58,1) infinite;
      transform-origin: 50% 50%;
    }
    #inkpet-root.inkpet-hover .inkpet-art { animation-duration: 3.8s; }
    #inkpet-root.inkpet-hover .inkpet-wash { animation-duration: 4.4s; }
    /* 鼠标停留时，中心像小动物一样轻轻蹭蹭；墨点从身体边缘短暂散开。 */
    #inkpet-root.inkpet-hover .inkpet-pigment-pulse {
      animation: inkpet-nuzzle-pulse 1.42s cubic-bezier(.42,0,.58,1) infinite;
    }
    #inkpet-root.inkpet-hover .inkpet-hover-specks circle {
      animation: inkpet-hover-speck 1.55s cubic-bezier(.18,.65,.28,1) infinite;
    }
    #inkpet-root.inkpet-hover .inkpet-hover-specks circle:nth-child(2n) { animation-duration: 1.82s; }
    #inkpet-root.inkpet-hover .inkpet-hover-specks circle:nth-child(3n) { animation-duration: 1.34s; }
    #inkpet-root.inkpet-dragging { cursor: grabbing; }
    #inkpet-root.inkpet-dragging .inkpet-art {
      animation: inkpet-drag-wobble .25s ease-in-out infinite;
      transform-origin: 50% 50%;
    }
    #inkpet-root.inkpet-bounce .inkpet-art {
      animation: inkpet-bounce .72s cubic-bezier(.22,.78,.28,1.16);
    }
    #inkpet-root .inkpet-wash {
      transform-origin: 90px 90px;
      animation: inkpet-wash-drift 7.2s ease-in-out infinite;
    }
    #inkpet-root.inkpet-hover .inkpet-wash { animation-duration: 5.7s; }
    #inkpet-root .inkpet-core-circle-group,
    #inkpet-root .inkpet-core-flower-group {
      transform-box: fill-box;
      transform-origin: center;
      transition: opacity .58s ease, transform .76s cubic-bezier(.2,.82,.22,1.12), filter .45s ease;
    }
    #inkpet-root .inkpet-core-circle-group { opacity: 1; transform: scale(1); }
    #inkpet-root .inkpet-core-flower-group { opacity: 0; transform: scale(.74) rotate(-13deg); }
    #inkpet-root.inkpet-happy .inkpet-core-circle-group { opacity: 0; transform: scale(.78) rotate(8deg); }
    #inkpet-root.inkpet-happy .inkpet-core-flower-group { opacity: 1; transform: scale(1) rotate(0deg); }
    #inkpet-root.inkpet-happy .inkpet-wash { animation-duration: 5.1s; }
    #inkpet-root .inkpet-flower-pigment { animation: inkpet-flower-breathe 4.4s ease-in-out infinite; }
    #inkpet-root .inkpet-core-fear-group {
      opacity: 0;
      transform-box: fill-box;
      transform-origin: center;
      transform: scale(.72) rotate(-8deg);
      transition: opacity .2s ease, transform .38s cubic-bezier(.2,.8,.25,1);
    }
    #inkpet-root.inkpet-fear .inkpet-core-circle-group,
    #inkpet-root.inkpet-fear .inkpet-core-flower-group { opacity: 0; transform: scale(.72); }
    #inkpet-root.inkpet-fear .inkpet-core-fear-group {
      opacity: 1;
      transform: scale(1) rotate(0deg);
      animation: inkpet-fear-spike-shiver .34s ease-in-out infinite;
    }
    #inkpet-root.inkpet-fear .inkpet-art { animation: inkpet-fear-whole-shiver .24s steps(2,end) infinite; }
    #inkpet-root.inkpet-fear .inkpet-wash { animation-duration: 2.9s; }
    #inkpet-root.inkpet-fear .inkpet-face { font-size: 25px; letter-spacing: .08em; }
    #inkpet-root.inkpet-dragging .inkpet-core-circle-group,
    #inkpet-root.inkpet-dragging .inkpet-core-flower-group { animation: inkpet-core-panic .23s ease-in-out infinite; }
    #inkpet-root.inkpet-nervous .inkpet-core-circle-group,
    #inkpet-root.inkpet-nervous .inkpet-core-flower-group { animation: inkpet-core-panic .22s ease-in-out infinite; }
    /* 睡眠外形沿用 V5：轻轻摊开，保留原本圆润、松软的比例。 */
    #inkpet-root.inkpet-sleepy .inkpet-core-circle-group,
    #inkpet-root.inkpet-sleepy .inkpet-core-flower-group { transform: scale(1.055, .88) translateY(4px); }
    #inkpet-root.inkpet-sleepy .inkpet-wash { animation-duration: 9.4s; }
    #inkpet-root.inkpet-sleepy .inkpet-art { animation: inkpet-sleepy-idle 8.5s ease-in-out infinite; }
    /* 睡着时被轻轻摸：整团越睡越扁（像放松下来的仓鼠），扁到极限会弹回来。 */
    #inkpet-root.inkpet-sleepy .inkpet-stage {
      transform-origin: 50% 92%;
      transform: scale(calc(1 + var(--inkpet-doze, 0) * .52), calc(1 - var(--inkpet-doze, 0) * .5)) translateY(calc(var(--inkpet-doze, 0) * 5px));
      transition: transform .22s cubic-bezier(.25,.9,.3,1.1);
    }
    #inkpet-root.inkpet-shy .inkpet-art { animation: inkpet-shy-shrink .62s cubic-bezier(.2,.8,.2,1) forwards; }
    #inkpet-root.inkpet-shy .inkpet-wash { opacity: 1; animation-duration: 2.7s; }
    #inkpet-root.inkpet-shy .inkpet-core-circle-group { opacity: 1; transform: scale(.97); }
    #inkpet-root.inkpet-shy .inkpet-core-flower-group { opacity: 0; }
    /* 害羞状态下继续点：轻轻抖一下，然后换一句颜文字。 */
    #inkpet-root.inkpet-shy-tap .inkpet-stage { animation: inkpet-shy-tap .3s cubic-bezier(.2,.8,.2,1); }
    @keyframes inkpet-shy-tap {
      0% { transform: scale(1, 1); }
      40% { transform: scale(.965, 1.035); }
      100% { transform: scale(1, 1); }
    }
    #inkpet-root.inkpet-angry .inkpet-art { animation: inkpet-angry-bristle .2s steps(2,end) infinite; }
    #inkpet-root.inkpet-angry { cursor: default; }
    #inkpet-root.inkpet-angry .inkpet-wash { animation: inkpet-angry-wash .23s ease-in-out infinite; }
    #inkpet-root.inkpet-angry .inkpet-core-circle-group,
    #inkpet-root.inkpet-angry .inkpet-core-flower-group { animation: inkpet-core-panic .2s ease-in-out infinite; }
    #inkpet-root.inkpet-eye .inkpet-wash { animation: inkpet-eye-wash-breathe 6.5s ease-in-out 1.7s infinite; }
    #inkpet-root.inkpet-near-pointer .inkpet-wash { animation-duration: 4.5s; }

    /* 漂浮状态沿用已经确认过的五瓣圆润墨花；身体和脸一起随根节点游动。 */
    #inkpet-root.inkpet-wandering .inkpet-core-circle-group { opacity: 0; transform: scale(.78); }
    #inkpet-root.inkpet-wandering .inkpet-core-flower-group { opacity: 1; transform: scale(1.035) rotate(-2deg); }
    #inkpet-root.inkpet-wandering .inkpet-flower-pigment { animation-duration: 3.2s; }
    #inkpet-root.inkpet-wandering .inkpet-art { animation-duration: 6.8s; }
    /* 贴纸后：保持生气表情和普通圆形墨团，并以整团为单位逃跑。 */
    #inkpet-root.inkpet-angry-wandering { transition: none !important; }
    /* 贴纸后的躲避状态使用普通圆形墨团，不切换成花花。 */
    #inkpet-root.inkpet-angry-wandering .inkpet-core-circle-group { opacity: 1; transform: scale(1) rotate(0deg); }
    #inkpet-root.inkpet-angry-wandering .inkpet-core-flower-group { opacity: 0; transform: scale(.74) rotate(-13deg); }

    /* 哭哭 V13：中心换成圆滚滚的墨云，云底不断落下墨滴，整团慢慢飘着走。 */
    #inkpet-root .inkpet-core-cloud-group {
      opacity: 0;
      transform-box: fill-box;
      transform-origin: center;
      transform: scale(.84);
      transition: opacity .4s ease, transform .6s cubic-bezier(.2,.82,.22,1.12);
    }
    #inkpet-root .inkpet-cloud-pigment { animation: inkpet-cloud-breathe 4.6s ease-in-out infinite; }
    #inkpet-root.inkpet-crying .inkpet-core-cloud-group { opacity: 1; transform: scale(1); }
    #inkpet-root.inkpet-crying .inkpet-core-circle-group,
    #inkpet-root.inkpet-crying .inkpet-core-flower-group,
    #inkpet-root.inkpet-crying .inkpet-core-fear-group { opacity: 0; transform: scale(.78); }
    #inkpet-root.inkpet-crying .inkpet-art { animation: inkpet-cry-sway 6.6s ease-in-out infinite; }
    #inkpet-root.inkpet-crying .inkpet-wash { animation-duration: 9.2s; }
    #inkpet-root.inkpet-crying .inkpet-face {
      font-size: 22px;
      letter-spacing: -.5px;
      animation: inkpet-cry-face 2.8s ease-in-out infinite;
    }
    #inkpet-root .inkpet-rain { opacity: 0; pointer-events: none; transition: opacity .55s ease; }
    #inkpet-root .inkpet-rain .inkpet-raindrop { opacity: 0; transform-box: view-box; transform-origin: 90px 90px; }
    #inkpet-root.inkpet-crying .inkpet-rain { opacity: 1; }
    #inkpet-root.inkpet-crying .inkpet-rain .inkpet-raindrop {
      animation-name: inkpet-rain-fall;
      animation-duration: var(--fall, 2s);
      animation-timing-function: cubic-bezier(.42,.03,.7,.5);
      animation-delay: var(--delay, 0s);
      animation-iteration-count: infinite;
    }
    @keyframes inkpet-cloud-breathe {
      0%, 100% { opacity: .96; transform: scale(1, .99); }
      40% { opacity: 1; transform: scale(1.018, 1.012); }
      72% { opacity: .97; transform: scale(.994, 1.004); }
    }
    @keyframes inkpet-cry-sway {
      0%, 100% { transform: translate(0, 0) rotate(-.7deg); }
      33% { transform: translate(-1.5px, 1px) rotate(.6deg); }
      66% { transform: translate(1.5px, 1.5px) rotate(-.4deg); }
    }
    @keyframes inkpet-cry-face {
      0%, 100% { transform: translate(calc(-50% + var(--inkpet-face-x, 0px)), calc(-50% + var(--inkpet-face-y, 0px) + 1px)) rotate(var(--inkpet-face-rotate, 0deg)) scale(1); }
      48% { transform: translate(calc(-50% + var(--inkpet-face-x, 0px)), calc(-50% + var(--inkpet-face-y, 0px) + 3px)) rotate(var(--inkpet-face-rotate, 0deg)) scale(.968, 1.03); }
    }
    @keyframes inkpet-rain-fall {
      0% { opacity: 0; transform: translate(0, 0) scale(.7, .84); }
      10% { opacity: .92; transform: translate(0, 3px) scale(1, 1.05); }
      72% { opacity: .76; }
      100% { opacity: 0; transform: translate(var(--drift, 0px), 92px) scale(.9, 1.32); }
    }

    /* 待机墨团形态：小熊 / 小猫 / 小狗 / 爱心 / 小章鱼。线条都保持圆润。 */
    #inkpet-root .inkpet-core-bear-group,
    #inkpet-root .inkpet-core-cat-group,
    #inkpet-root .inkpet-core-dog-group,
    #inkpet-root .inkpet-core-heart-group,
    #inkpet-root .inkpet-core-oct-group {
      opacity: 0;
      transform-box: fill-box;
      transform-origin: center;
      transform: scale(.8);
      transition: opacity .4s ease, transform .6s cubic-bezier(.2,.82,.22,1.12);
    }
    #inkpet-root.inkpet-shape-bear .inkpet-core-bear-group,
    #inkpet-root.inkpet-shape-cat .inkpet-core-cat-group,
    #inkpet-root.inkpet-shape-dog .inkpet-core-dog-group,
    #inkpet-root.inkpet-shape-heart .inkpet-core-heart-group,
    #inkpet-root.inkpet-shape-oct .inkpet-core-oct-group {
      opacity: 1;
      transform: scale(1);
    }
    #inkpet-root[class*="inkpet-shape-"] .inkpet-core-circle-group,
    #inkpet-root[class*="inkpet-shape-"] .inkpet-core-flower-group,
    #inkpet-root[class*="inkpet-shape-"] .inkpet-core-cloud-group { opacity: 0; transform: scale(.78); }
    #inkpet-root.inkpet-shape-bear .inkpet-flower-pigment,
    #inkpet-root.inkpet-shape-cat .inkpet-flower-pigment,
    #inkpet-root.inkpet-shape-dog .inkpet-flower-pigment,
    #inkpet-root.inkpet-shape-heart .inkpet-flower-pigment { animation: none; }
    /* V13.4 墨团垫底：换形态时在深色轮廓下面先垫一层灰色墨。
       这样轮廓的凹陷处（小猫的耳朵缝、小狗的耳根）、换形过程中的半透明叠化，
       看到的都是灰墨，而不是底下那圈浅灰发白的纸面。
       出现要快（不然淡入的过程中会露白），收起时先按住再慢慢退，等墨团已经完全显影再散。 */
    #inkpet-root .inkpet-shape-bed { opacity: 0; transition: opacity .34s ease .26s; }
    #inkpet-root.inkpet-shape-bear .inkpet-shape-bed,
    #inkpet-root.inkpet-shape-cat .inkpet-shape-bed,
    #inkpet-root.inkpet-shape-dog .inkpet-shape-bed,
    #inkpet-root.inkpet-shape-heart .inkpet-shape-bed,
    #inkpet-root.inkpet-shape-oct .inkpet-shape-bed,
    #inkpet-root.inkpet-crying .inkpet-shape-bed { opacity: 1; transition: opacity .12s ease 0s; }

    /* 方正形态：整团墨变成一枚圆角方印，连外面的浅墨一起方起来。 */
    #inkpet-root .inkpet-normal-wash { opacity: 1; transition: opacity .34s ease; }
    #inkpet-root .inkpet-square-wash {
      opacity: 0;
      transform-box: fill-box;
      transform-origin: center;
      transition: opacity .34s ease;
    }
    #inkpet-root.inkpet-shape-square .inkpet-normal-wash { opacity: 0; }
    #inkpet-root.inkpet-shape-square .inkpet-wash { animation: none; }
    #inkpet-root.inkpet-shape-square .inkpet-square-wash {
      opacity: 1;
      animation: inkpet-square-stamp .56s cubic-bezier(.2,.8,.25,1.15) both;
    }
    @keyframes inkpet-square-stamp {
      0% { opacity: 0; transform: scale(1.1); }
      45% { opacity: 1; transform: scale(.975); }
      72% { transform: scale(1.012); }
      100% { opacity: 1; transform: scale(1); }
    }

    /* 哼歌时从身边冒出来的小音符和小星星。 */
    #inkpet-root .inkpet-notes {
      position: absolute;
      left: 50%;
      top: 50%;
      z-index: 3;
      width: 0;
      height: 0;
      pointer-events: none;
    }
    #inkpet-root .inkpet-note {
      position: absolute;
      left: 0;
      top: 0;
      color: rgba(44, 44, 38, .82);
      font-family: Georgia, "Times New Roman", "Songti SC", serif;
      font-size: 20px;
      line-height: 1;
      opacity: 0;
      will-change: transform, opacity;
    }
    #inkpet-root.inkpet-humming .inkpet-note {
      animation: inkpet-note-float 2.5s cubic-bezier(.32,.05,.4,1) var(--delay, 0s) both;
    }
    #inkpet-root.inkpet-humming .inkpet-art { animation: inkpet-hum-sway 3.2s ease-in-out infinite; }
    @keyframes inkpet-note-float {
      0% { opacity: 0; transform: translate(var(--nx, 0px), calc(var(--ny, 0px) + 16px)) scale(.45) rotate(-10deg); }
      22% { opacity: .92; transform: translate(var(--nx, 0px), var(--ny, 0px)) scale(1) rotate(4deg); }
      72% { opacity: .8; }
      100% { opacity: 0; transform: translate(calc(var(--nx, 0px) * 1.35), calc(var(--ny, 0px) - 34px)) scale(.85) rotate(-6deg); }
    }
    @keyframes inkpet-hum-sway {
      0%, 100% { transform: translate(-1px, 0) rotate(-.7deg); }
      40% { transform: translate(1.5px, -2px) rotate(.8deg); }
      70% { transform: translate(-.5px, -1px) rotate(-.3deg); }
    }
    #inkpet-root .inkpet-face.inkpet-square-face { font-size: 19px; letter-spacing: .02em; }

    #inkpet-root .inkpet-hover-specks { opacity: 0; pointer-events: none; transition: opacity .22s ease; }
    #inkpet-root.inkpet-hover .inkpet-hover-specks { opacity: 1; }
    #inkpet-root .inkpet-pigment-pulse { transform-box: fill-box; transform-origin: center; }
    #inkpet-root .inkpet-hover-specks circle {
      opacity: 0;
      transform-box: fill-box;
      transform-origin: center;
    }

    #inkpet-root .inkpet-face {
      position: absolute;
      left: 50%;
      top: 50%;
      z-index: 2;
      min-width: 60px;
      color: rgba(250, 248, 238, .97);
      font-family: Arial, "Microsoft YaHei", "微软雅黑", "SimHei", "黑体", sans-serif;
      font-size: 25px;
      font-weight: 600;
      line-height: 1;
      letter-spacing: -1.5px;
      white-space: pre;
      text-align: center;
      text-shadow: 0 1px 4px rgba(0,0,0,.32);
      transform: translate(calc(-50% + var(--inkpet-face-x, 0px)), calc(-50% + var(--inkpet-face-y, 0px))) rotate(var(--inkpet-face-rotate, 0deg)) scale(var(--inkpet-face-inv-scale, 1));
      pointer-events: none;
      transition: opacity .18s ease, font-size .18s ease;
    }
    /* 投喂变大时，颜文字用反向缩放保持原大小，跟着墨团一起平滑过渡。 */
    #inkpet-root.inkpet-feeding .inkpet-face {
      transition: opacity .18s ease, font-size .18s ease, transform .62s cubic-bezier(.2,.86,.24,1.1);
    }
    #inkpet-root .inkpet-face.inkpet-small-expression { font-size: 18px; letter-spacing: -1.1px; }
    #inkpet-root .inkpet-face.inkpet-medium-expression { font-size: 20px; letter-spacing: -1.25px; }
    #inkpet-root .inkpet-face.inkpet-long-expression { font-size: 16px; letter-spacing: -1.25px; }
    #inkpet-root .inkpet-face.inkpet-happy-expression { font-size: 23px; }
    #inkpet-root.inkpet-dragging .inkpet-face { transform: translate(calc(-50% + var(--inkpet-face-x, 0px)), calc(-50% + var(--inkpet-face-y, 0px))) rotate(var(--inkpet-face-rotate, 0deg)) scale(.95, .86); }
    #inkpet-root.inkpet-eye .inkpet-face { opacity: 0; transform: translate(-50%, -50%) scale(.45); }
    #inkpet-root.inkpet-nervous .inkpet-face { transform: translate(calc(-50% + var(--inkpet-face-x, 0px)), calc(-50% + var(--inkpet-face-y, 0px))) rotate(var(--inkpet-face-rotate, 0deg)) scale(.9, .86); }
    #inkpet-root.inkpet-sleepy .inkpet-face { transform: translate(calc(-50% + var(--inkpet-face-x, 0px)), calc(-50% + var(--inkpet-face-y, 0px) + 2px)) rotate(var(--inkpet-face-rotate, 0deg)); }
    #inkpet-root.inkpet-shy .inkpet-face { font-size: 17px; }
    #inkpet-root.inkpet-angry .inkpet-face { animation: inkpet-face-tremble .16s ease-in-out infinite; }

    /* ---------- V14 小手手 ----------
       手手不是常驻的：平时没有手，只有害羞、方正、开心、蹭蹭 / 拖动、无聊发呆时才会伸出来。
       所有位置都以颜文字中心为原点，用四个变量摆位：
       --hx / --hy 偏移、--hr 旋转、--hs 缩放。
       所以同一套手既能贴在脸下面（揣手），也能放到脸两侧，或者跑去抱鼠标。 */
    #inkpet-root .inkpet-face-text { display: inline; }
    #inkpet-root .inkpet-hand {
      position: absolute;
      left: 50%;
      top: 50%;
      display: block;
      font-size: .82em;
      line-height: 1;
      letter-spacing: 0;
      color: inherit;
      opacity: 0;
      text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
      transform: translate(calc(-50% + var(--hx, 0px)), calc(-50% + var(--hy, 0px))) rotate(var(--hr, 0deg)) scale(var(--hs, 1));
      pointer-events: none;
      transition: opacity .2s ease, transform .26s cubic-bezier(.2,.8,.25,1.08), color .18s linear;
      will-change: transform;
    }
    #inkpet-root .inkpet-hand-inner { display: block; animation: inkpet-hand-bob 2.6s ease-in-out infinite; }
    #inkpet-root .inkpet-hand-r .inkpet-hand-inner { animation-delay: -1.3s; }
    #inkpet-root.inkpet-hands-on .inkpet-hand { opacity: 1; }
    #inkpet-root.inkpet-hands-on .inkpet-hand.inkpet-hand-off { opacity: 0; }

    /* V14.2 小装饰：头上的花、身边的小零食，和手一样挂在颜文字上，用 --px/--py/--pr/--ps 摆位。 */
    #inkpet-root .inkpet-prop {
      position: absolute;
      left: 50%;
      top: 50%;
      display: block;
      font-size: .74em;
      line-height: 1;
      letter-spacing: 0;
      font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Segoe UI Symbol", sans-serif;
      opacity: 0;
      transform: translate(calc(-50% + var(--px, 0px)), calc(-50% + var(--py, 0px))) rotate(var(--pr, 0deg)) scale(var(--ps, 1));
      pointer-events: none;
      transition: opacity .26s ease, transform .32s cubic-bezier(.2,.8,.25,1.08);
      will-change: transform;
    }
    #inkpet-root .inkpet-prop-inner { display: block; animation: inkpet-prop-float 3.2s ease-in-out infinite; }
    #inkpet-root .inkpet-prop-r .inkpet-prop-inner { animation-delay: -1.6s; }
    #inkpet-root.inkpet-prop-on .inkpet-prop { opacity: 1; }
    #inkpet-root.inkpet-prop-on .inkpet-prop.inkpet-prop-off { opacity: 0; }
    @keyframes inkpet-prop-float {
      0%, 100% { transform: translateY(0) rotate(-5deg); }
      50% { transform: translateY(-3px) rotate(5deg); }
    }
    /* 摸摸头：一只手在脑袋上来回左右扫。 */
    #inkpet-root.inkpet-prop-pat .inkpet-prop-inner {
      animation: inkpet-prop-pat 1.7s ease-in-out infinite;
    }
    @keyframes inkpet-prop-pat {
      0%, 100% { transform: translateX(-13px) rotate(-11deg); }
      50% { transform: translateX(13px) rotate(9deg); }
    }

    /* 揣手 / 手在脸两侧：一只上一只下地晃。 */
    #inkpet-root.inkpet-hands-tuck .inkpet-hand-inner { animation: inkpet-hand-bob 2.4s ease-in-out infinite; }
    #inkpet-root.inkpet-hands-side .inkpet-hand-inner { animation: inkpet-hand-lift 2s ease-in-out infinite; }
    /* 抱鼠标：两只手轻轻往里一收一放。 */
    #inkpet-root.inkpet-hands-hug .inkpet-hand-inner { animation: inkpet-hand-hug 1.1s ease-in-out infinite; }
    #inkpet-root.inkpet-hands-hug .inkpet-hand-r .inkpet-hand-inner { animation-delay: -.55s; }
    /* 开心时比耶的那只手，会轻轻晃两下。 */
    #inkpet-root.inkpet-happy .inkpet-hand-inner { animation: inkpet-hand-wave 1.7s ease-in-out infinite; }
    /* 打招呼：整只手以手腕为轴快速左右摆。 */
    #inkpet-root.inkpet-hands-wave .inkpet-hand-inner {
      animation: inkpet-hand-greet .56s ease-in-out infinite;
      transform-origin: 50% 92%;
    }
    @keyframes inkpet-hand-greet {
      0%, 100% { transform: rotate(-15deg); }
      50% { transform: rotate(15deg); }
    }

    /* emoji 手：比圆手再小一点，单独换字体，免得和颜文字字体打架。 */
    #inkpet-root.inkpet-hands-emoji .inkpet-hand {
      font-size: .8em;
      font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Segoe UI Symbol", sans-serif;
      text-shadow: none;
    }

    @keyframes inkpet-hand-bob {
      0%, 100% { transform: translateY(0) rotate(-2deg); }
      50% { transform: translateY(-2.4px) rotate(2deg); }
    }
    @keyframes inkpet-hand-lift {
      0%, 100% { transform: translateY(0) rotate(-5deg); }
      50% { transform: translateY(-3.4px) rotate(5deg); }
    }
    @keyframes inkpet-hand-hug {
      0%, 100% { transform: translate(0, 0) rotate(-6deg) scale(1); }
      50% { transform: translate(1.4px, -.6px) rotate(-1deg) scale(1.06); }
    }
    @keyframes inkpet-hand-wave {
      0%, 100% { transform: translateY(0) rotate(-8deg); }
      50% { transform: translateY(-2px) rotate(9deg); }
    }

    /* 睡意偶尔浮起小 Z；它们属于舞台的一部分，会与墨团一起晃动。 */
    #inkpet-root .inkpet-zzz {
      position: absolute;
      top: 15%;
      right: 21%;
      z-index: 4;
      display: flex;
      align-items: flex-start;
      gap: 1px;
      color: rgba(47, 47, 42, .73);
      font-family: Georgia, "Times New Roman", serif;
      font-weight: 600;
      line-height: 1;
      opacity: 0;
      pointer-events: none;
      white-space: nowrap;
    }
    #inkpet-root .inkpet-zzz span:first-child { font-size: 12px; animation: inkpet-zzz-float 4.8s ease-in-out infinite; }
    #inkpet-root .inkpet-zzz span:last-child { margin-top: -8px; font-size: 17px; animation: inkpet-zzz-float 4.8s ease-in-out .65s infinite; }
    #inkpet-root.inkpet-sleepy .inkpet-zzz { opacity: 1; }
    /* 惊醒时头顶冒出的感叹号。 */
    #inkpet-root .inkpet-alert {
      position: absolute;
      left: 50%;
      top: 8%;
      z-index: 5;
      color: #2f2e29;
      font-family: Georgia, "Songti SC", "Noto Serif CJK SC", serif;
      font-size: 42px;
      font-weight: 700;
      line-height: 1;
      opacity: 0;
      transform: translate(-50%, 8px) scale(.3);
      transform-origin: 50% 100%;
      pointer-events: none;
    }
    #inkpet-root.inkpet-alerting .inkpet-alert {
      animation: inkpet-alert-pop .95s cubic-bezier(.2,.9,.3,1.1) both;
    }
    @keyframes inkpet-alert-pop {
      0% { opacity: 0; transform: translate(-50%, 10px) scale(.25); }
      22% { opacity: 1; transform: translate(-50%, -4px) scale(1.2); }
      46% { transform: translate(-50%, 0) scale(1); }
      76% { opacity: 1; }
      100% { opacity: 0; transform: translate(-50%, -14px) scale(.95); }
    }

    /* V14.6 想问题的时候，墨团上转一圈跑马灯（配合询问窗口的「正在输入」）。
       12 根白色小条围成一圈，用 steps() 让高亮块一格一格地跳，像秒针一样。 */
    #inkpet-root .inkpet-think {
      position: absolute;
      left: 50%;
      top: 74px;
      z-index: 5;
      width: 30px;
      height: 30px;
      margin-left: -15px;
      opacity: 0;
      transform: translateY(4px) scale(.78);
      transition: opacity .2s ease, transform .3s cubic-bezier(.2,.8,.25,1.1);
      pointer-events: none;
    }
    #inkpet-root.inkpet-typing .inkpet-think { opacity: 1; transform: translateY(0) scale(1); }
    #inkpet-root .inkpet-think i {
      position: absolute;
      left: 50%;
      top: 50%;
      width: 2.6px;
      height: 7px;
      margin: -3.5px 0 0 -1.3px;
      border-radius: 1.3px;
      background: #fff;
      opacity: .18;
      transform: rotate(calc(var(--i) * -30deg)) translateY(-11px);
      transform-origin: 50% 50%;
      animation: inkpet-think-chase 1.2s steps(1, end) infinite;
      /* 负延迟保证一出现就已经在转，整体再减 1.2s 让高亮块按顺时针走（像秒针）。 */
      animation-delay: calc(var(--i) * -0.1s);
    }
    @keyframes inkpet-think-chase {
      0%, 8.3% { opacity: 1; }
      8.4%, 100% { opacity: .18; }
    }

    /* V14.8 干涸：桌宠一边淡出，位置上一边显出一滩干掉的黑墨。
       墨痕是 fixed 的独立节点，桌宠销毁后仍然留在纸上。 */
    #inkpet-root.inkpet-drying {
      opacity: 0;
      transition: opacity 1.55s ease;
      pointer-events: none;
    }
    /* 干涸时整团定住：不再追鼠标，也不再有呼吸/漂移，像墨真的凝住了。 */
    #inkpet-root.inkpet-drying .inkpet-art,
    #inkpet-root.inkpet-drying .inkpet-wash,
    #inkpet-root.inkpet-drying .inkpet-pigment-pulse,
    #inkpet-root.inkpet-drying .inkpet-core-circle-group,
    #inkpet-root.inkpet-drying .inkpet-core-flower-group {
      animation: none;
    }
    #inkpet-root.inkpet-drying .inkpet-art {
      filter: blur(1.5px) saturate(.85);
      transform: none;
    }

    /* V14.9 捏捏模式：拖她不再挪位置，而是把圆滚滚的身体捏软。
       形变写在一个 CSS 变量里，由 JS 按拖动方向算出「沿轴拉伸 + 垂直压扁」。 */
    #inkpet-root.inkpet-pinching { cursor: grab; }
    #inkpet-root.inkpet-pinching .inkpet-stage {
      transform: var(--inkpet-pinch-tf, translate3d(0, 0, 0));
      transition: transform .58s cubic-bezier(.2, 1.55, .36, 1);
      will-change: transform;
    }
    #inkpet-root.inkpet-pinching.inkpet-pinch-drag .inkpet-stage {
      transition: none;
      cursor: grabbing;
    }
    #inkpet-root.inkpet-pinching.inkpet-hover .inkpet-stage { animation: none; }
    #inkpet-root.inkpet-pinching .inkpet-art { animation-duration: 3.2s; }

    /* 捏捏模式里飘在旁边的「不捏了」小按钮 */
    .inkpet-pinch-btn {
      position: fixed;
      z-index: 100000;
      padding: 6px 13px;
      border: 1px solid rgba(96, 92, 82, .26);
      border-radius: 999px;
      background: rgba(250, 248, 238, .97);
      color: #4a483f;
      font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
      font-size: 12px;
      line-height: 1.1;
      letter-spacing: .04em;
      white-space: nowrap;
      cursor: pointer;
      box-shadow: 0 2px 9px rgba(60, 55, 45, .16);
      opacity: 0;
      transform: translateY(5px) scale(.96);
      transition: opacity .22s ease, transform .26s cubic-bezier(.2,.8,.25,1.1), box-shadow .2s ease;
    }
    .inkpet-pinch-btn.inkpet-pinch-btn-on { opacity: 1; transform: translateY(0) scale(1); }
    .inkpet-pinch-btn:hover { box-shadow: 0 4px 13px rgba(60, 55, 45, .22); transform: translateY(-1px) scale(1); }
    .inkpet-pinch-btn:active { transform: translateY(0) scale(.97); }
    .inkpet-dry-stain {
      position: fixed;
      z-index: 99998;
      transform: translate(-50%, -50%) scale(1.05);
      opacity: 0;
      pointer-events: none;
      -webkit-user-select: none;
      user-select: none;
      transition: opacity 1.55s ease, transform 2.4s cubic-bezier(.2,.8,.25,1);
      will-change: opacity, transform;
    }
    .inkpet-dry-stain.inkpet-dry-in {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
    }

    /* V14.5「触动」表情：一张透明底的 PNG，单独一档表情。
       出现时不显示颜文字、小手手和小装饰，只留这张脸。 */
    #inkpet-root .inkpet-png-face {
      position: absolute;
      left: 50%;
      top: 50%;
      width: 78px;
      height: auto;
      z-index: 2;
      opacity: 0;
      transform: translate(-50%, -50%) translateY(4px) scale(.94);
      transform-origin: 50% 50%;
      pointer-events: none;
      transition: opacity .32s ease, transform .52s cubic-bezier(.2,.8,.25,1.06);
      will-change: opacity, transform;
    }
    #inkpet-root.inkpet-png-face-on .inkpet-png-face {
      opacity: 1;
      transform: translate(-50%, -50%) scale(var(--inkpet-face-inv-scale, 1));
    }
    #inkpet-root .inkpet-face-text { transition: opacity .2s ease; }
    #inkpet-root.inkpet-png-face-on .inkpet-face-text { opacity: 0; }

    /* 特殊演出：外层浅墨形成眼白般的晕圈，中心深墨收束为较小瞳孔。 */
    #inkpet-root .inkpet-eye-wash { opacity: 0; transform-box: fill-box; transform-origin: center; }
    #inkpet-root .inkpet-eye-pupil-group { opacity: 0; transform-box: fill-box; transform-origin: center; }
    #inkpet-root.inkpet-eye .inkpet-outer-wash { opacity: .12; }
    #inkpet-root.inkpet-eye .inkpet-halo { opacity: .34; }
    #inkpet-root.inkpet-eye .inkpet-eye-wash {
      opacity: .9;
      animation: inkpet-eye-spread 1.7s cubic-bezier(.18,.75,.2,1) both;
    }
    #inkpet-root.inkpet-eye .inkpet-core-circle-group,
    #inkpet-root.inkpet-eye .inkpet-core-flower-group { opacity: 0; }
    #inkpet-root.inkpet-eye .inkpet-eye-pupil-group {
      opacity: 1;
      animation: inkpet-pupil-gather 1.15s cubic-bezier(.2,.85,.2,1) both;
    }

    /* 打喷嚏：小墨点像水花一样飞散，再沿弧线游回本体。仅此动作产生独立小墨点。 */
    #inkpet-root .inkpet-sneeze-particles { opacity: 0; pointer-events: none; }
    #inkpet-root .inkpet-sneeze-particles circle {
      transform-box: view-box;
      transform-origin: 90px 90px;
      opacity: 0;
    }
    #inkpet-root.inkpet-sneezing .inkpet-sneeze-particles { opacity: 1; }
    #inkpet-root.inkpet-sneezing .inkpet-sneeze-particles circle {
      animation: inkpet-sneeze-swim 2.55s cubic-bezier(.3,.05,.35,1) both;
    }
    #inkpet-root.inkpet-sneezing .inkpet-art { animation: inkpet-sneeze-shake .52s ease-in-out both; }

    /* 恶作剧贴纸 V13：纯色黄、正椭圆；不再使用渐变、描边和虚线内框。 */
    #inkpet-root .inkpet-sticker-tool,
    #inkpet-root .inkpet-sticker-imprint {
      position: absolute;
      left: 50%;
      z-index: 40;
      width: 66px;
      height: 32px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 0;
      border: 0;
      border-radius: 50%;
      color: #51380d;
      background: #f7d537;
      box-shadow: 0 3px 8px rgba(86, 67, 20, .18);
      font-family: "Microsoft YaHei", "微软雅黑", "SimHei", "黑体", sans-serif;
      text-align: center;
      font-weight: 800;
      line-height: 1.02;
      letter-spacing: .015em;
      pointer-events: none;
      transform-origin: 50% 50%;
    }
    #inkpet-root .inkpet-sticker-tool {
      top: -52px;
      opacity: 0;
      transform: translateX(-50%) rotate(-13deg) scale(1.08);
    }
    #inkpet-root .inkpet-sticker-tool span:first-child,
    #inkpet-root .inkpet-sticker-imprint span:first-child {
      font-size: 7px;
      letter-spacing: .08em;
      line-height: 1.05;
    }
    #inkpet-root .inkpet-sticker-tool span:last-child,
    #inkpet-root .inkpet-sticker-imprint strong {
      display: block;
      font-size: 12px;
      letter-spacing: .025em;
      line-height: 1;
    }
    #inkpet-root .inkpet-sticker-imprint {
      /* 贴在墨团内部偏上的位置，宽度只比颜文字脸略大。 */
      top: 76px;
      opacity: 0;
      transform: translateX(-50%) rotate(-11deg) scale(.42);
      transition: opacity .12s ease, transform .34s cubic-bezier(.18,.8,.2,1);
    }
    #inkpet-root.inkpet-sticking .inkpet-sticker-tool { animation: inkpet-sticker-fall .62s cubic-bezier(.2,.7,.28,1) both; }
    #inkpet-root.inkpet-sticking .inkpet-art { animation: inkpet-stamp-squash .64s cubic-bezier(.2,.8,.24,1.18) both; }
    #inkpet-root.inkpet-angry .inkpet-sticker-imprint {
      opacity: 1;
      transform: translateX(-50%) rotate(-11deg) scale(1);
    }
    /* 先让落下的贴纸完整经过镜头；飞落动画结束、短暂清理 sticking 类后，再显示留在墨团上的贴纸。 */
    #inkpet-root.inkpet-sticking .inkpet-sticker-imprint {
      opacity: 0;
      transform: translateX(-50%) rotate(-11deg) scale(.42);
      transition-delay: 0s;
    }
    #inkpet-root .inkpet-message {
      position: absolute;
      right: calc(100% - 12px);
      bottom: 77%;
      z-index: 8;
      width: max-content;
      min-width: 112px;
      max-width: min(245px, calc(100vw - 54px));
      padding: 9px 12px;
      border: 1px solid rgba(91, 87, 78, .16);
      border-radius: 4px 4px 4px 11px;
      color: #4d4b43;
      background: rgba(250, 248, 241, .97);
      box-shadow: 0 6px 22px rgba(67, 62, 52, .10);
      font-family: "Songti SC", "Noto Serif CJK SC", serif;
      font-size: 12px;
      line-height: 1.7;
      letter-spacing: .03em;
      white-space: normal;
      word-break: keep-all;
      overflow-wrap: anywhere;
      opacity: 0;
      transform: translateY(5px) scale(.97);
      transform-origin: right bottom;
      pointer-events: none;
      transition: opacity .2s ease, transform .2s ease;
    }
    #inkpet-root .inkpet-message.inkpet-show { opacity: 1; transform: translateY(0) scale(1); }
    #inkpet-root .inkpet-hint {
      position: absolute;
      right: 8px;
      bottom: 6px;
      z-index: 9;
      color: rgba(70, 69, 62, .42);
      font: 9px/1 ui-monospace, monospace;
      letter-spacing: .1em;
      opacity: 0;
      transform: translateY(3px);
      transition: opacity .25s, transform .25s;
      pointer-events: none;
    }
    #inkpet-root.inkpet-hover .inkpet-hint { opacity: 1; transform: translateY(0); }

    /* ==========================================================
       V13 新增：投喂墨水气泡、极限制止卡片、右键询问窗口
       以下元素挂在 body 上（不在 #inkpet-root 内），
       所以不会被桌宠本体的缩放一起放大。
       ========================================================== */
    .inkpet-feed-pop {
      position: fixed;
      left: 0;
      top: 0;
      z-index: 100001;
      width: min(268px, calc(100vw - 28px));
      padding: 14px 15px 12px;
      border: 1px solid rgba(91, 87, 78, .18);
      border-radius: 15px 15px 15px 5px;
      color: #4a4840;
      background: rgba(251, 249, 243, .985);
      box-shadow: 0 12px 34px rgba(58, 53, 44, .16);
      font-family: "Songti SC", "Noto Serif CJK SC", serif;
      opacity: 0;
      transform: translateY(7px) scale(.96);
      transform-origin: 20px 100%;
      pointer-events: none;
      transition: opacity .2s ease, transform .22s cubic-bezier(.2,.8,.2,1);
    }
    .inkpet-feed-pop.inkpet-feed-pop-open {
      opacity: 1;
      transform: translateY(0) scale(1);
      pointer-events: auto;
    }
    .inkpet-feed-text {
      margin: 0;
      font-size: 13px;
      line-height: 1.85;
      letter-spacing: .03em;
    }
    .inkpet-feed-options {
      display: none;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 10px;
    }
    .inkpet-feed-pop.inkpet-feed-pop-ask .inkpet-feed-options { display: flex; }
    .inkpet-feed-options button {
      appearance: none;
      padding: 6px 10px;
      border: 1px solid rgba(95, 90, 80, .22);
      border-radius: 999px;
      color: #55544b;
      background: rgba(255, 253, 247, .92);
      font-family: inherit;
      font-size: 12px;
      line-height: 1.2;
      cursor: pointer;
      transition: background .18s, border-color .18s, color .18s, transform .18s;
    }
    .inkpet-feed-options button:hover {
      color: #2c2c26;
      border-color: rgba(70, 66, 58, .45);
      background: #fffdf6;
      transform: translateY(-1px);
    }

    .inkpet-stop {
      position: fixed;
      left: 50%;
      bottom: 8vh;
      z-index: 100002;
      width: min(346px, calc(100vw - 36px));
      padding: 22px 24px 20px;
      border: 1px solid rgba(91, 87, 78, .2);
      border-radius: 7px;
      color: #3a3830;
      background: rgba(250, 248, 241, .992);
      box-shadow: 0 22px 60px rgba(40, 38, 32, .28);
      font-family: "Songti SC", "Noto Serif CJK SC", serif;
      text-align: center;
      opacity: 0;
      transform: translateX(-50%) translateY(10px) scale(.96);
      pointer-events: none;
      transition: opacity .22s ease, transform .28s cubic-bezier(.2,.8,.2,1.1);
    }
    .inkpet-stop.inkpet-stop-open {
      opacity: 1;
      transform: translateX(-50%) translateY(0) scale(1);
      pointer-events: auto;
      animation: inkpet-stop-jolt .52s cubic-bezier(.22,.8,.28,1.1) both;
    }
    .inkpet-stop-kicker {
      margin: 0;
      color: #9a968a;
      font: 10px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
      letter-spacing: .22em;
    }
    .inkpet-stop-title {
      display: block;
      margin: 0 0 10px;
      color: #2e2d28;
      font-size: 32px;
      font-weight: 600;
      letter-spacing: .16em;
    }
    .inkpet-stop-text {
      margin: 0 0 18px;
      color: #6b675d;
      font-size: 16px;
      line-height: 1.9;
      letter-spacing: .06em;
    }
    .inkpet-stop-btn {
      appearance: none;
      padding: 9px 20px;
      border: 1px solid rgba(120, 60, 52, .3);
      border-radius: 999px;
      color: #8d4137;
      background: #fffdf7;
      font-family: inherit;
      font-size: 13px;
      line-height: 1.2;
      cursor: pointer;
      transition: background .18s, transform .18s;
    }
    .inkpet-stop-btn:hover { background: #fff; transform: translateY(-1px); }

    /* 右键：AI 助手询问窗口 */
    /* 右键：AI 助手询问窗口。漫画式的对话气泡，下面带一个小尖尖指向珍珍。 */
    .inkpet-ask {
      --inkpet-ask-tail: 50%;
      --inkpet-ask-tail-y: 50%;
      position: fixed;
      left: 0;
      top: 0;
      z-index: 100000;
      display: flex;
      flex-direction: column;
      width: min(392px, calc(100vw - 32px));
      border: 1px solid rgba(91, 87, 78, .2);
      border-radius: 16px;
      background: rgba(251, 249, 243, .995);
      box-shadow: 0 16px 40px rgba(50, 46, 38, .2);
      font-family: "Songti SC", "Noto Serif CJK SC", serif;
      opacity: 0;
      transform: translateY(8px) scale(.97);
      pointer-events: none;
      transition: opacity .2s ease, transform .24s cubic-bezier(.2,.8,.2,1);
    }
    .inkpet-ask.inkpet-ask-open {
      opacity: 1;
      transform: none;
      pointer-events: auto;
    }
    /* 小尖尖：一个旋转 45° 的方块，只保留朝外的两条边，和气泡接在一起。 */
    .inkpet-ask::after {
      content: "";
      position: absolute;
      bottom: -8px;
      left: var(--inkpet-ask-tail, 50%);
      width: 15px;
      height: 15px;
      margin-left: -7.5px;
      background: rgba(251, 249, 243, .995);
      border-right: 1px solid rgba(91, 87, 78, .2);
      border-bottom: 1px solid rgba(91, 87, 78, .2);
      border-bottom-right-radius: 3px;
      transform: rotate(45deg);
    }
    /* 气泡在珍珍下方：尖尖朝上。 */
    .inkpet-ask.inkpet-ask-tail-up::after {
      bottom: auto;
      top: -8px;
      border-right: 0;
      border-bottom: 0;
      border-left: 1px solid rgba(91, 87, 78, .2);
      border-top: 1px solid rgba(91, 87, 78, .2);
      border-bottom-right-radius: 0;
      border-top-left-radius: 3px;
    }
    /* 气泡在珍珍左侧：尖尖朝右。 */
    .inkpet-ask.inkpet-ask-tail-left::after {
      bottom: auto;
      left: auto;
      right: -8px;
      top: var(--inkpet-ask-tail-y, 50%);
      margin-left: 0;
      margin-top: -7.5px;
      border-right: 1px solid rgba(91, 87, 78, .2);
      border-bottom: 0;
      border-top: 1px solid rgba(91, 87, 78, .2);
      border-bottom-right-radius: 0;
      border-top-right-radius: 3px;
    }
    /* 气泡在珍珍右侧：尖尖朝左。 */
    .inkpet-ask.inkpet-ask-tail-right::after {
      bottom: auto;
      left: -8px;
      top: var(--inkpet-ask-tail-y, 50%);
      margin-left: 0;
      margin-top: -7.5px;
      border-right: 0;
      border-bottom: 1px solid rgba(91, 87, 78, .2);
      border-left: 1px solid rgba(91, 87, 78, .2);
      border-bottom-right-radius: 0;
      border-bottom-left-radius: 3px;
    }
    .inkpet-ask.inkpet-ask-no-tail::after { display: none; }
    .inkpet-ask-log {
      flex: 1 1 auto;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 8px;
      padding: 12px 14px 16px;
    }
    .inkpet-ask-bubble {
      max-width: 93%;
      margin: 0;
      padding: 9px 12px;
      border-radius: 12px 12px 12px 4px;
      color: #4b4941;
      background: rgba(239, 235, 226, .86);
      font-size: 12.5px;
      line-height: 1.85;
      letter-spacing: .02em;
      overflow-wrap: anywhere;
    }
    .inkpet-ask-bubble.inkpet-ask-mine {
      align-self: flex-end;
      border-radius: 12px 12px 4px 12px;
      color: #76736a;
      background: rgba(232, 228, 218, .55);
    }
    /* 正在输入：三个小点。 */
    .inkpet-ask-bubble.inkpet-ask-typing {
      display: flex;
      align-items: center;
      gap: 4px;
      min-width: 52px;
      padding: 12px 14px;
      background: rgba(239, 235, 226, .86);
    }
    .inkpet-ask-typing span {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: #8d897e;
      animation: inkpet-typing-dot 1s ease-in-out infinite;
    }
    .inkpet-ask-typing span:nth-child(2) { animation-delay: .15s; }
    .inkpet-ask-typing span:nth-child(3) { animation-delay: .3s; }
    @keyframes inkpet-typing-dot {
      0%, 60%, 100% { opacity: .3; transform: translateY(0) scale(.8); }
      30% { opacity: 1; transform: translateY(-3px) scale(1); }
    }
    /* 回答出来之前，桌宠轻轻晃着“打字”。 */
    #inkpet-root.inkpet-typing .inkpet-art { animation: inkpet-typing-bob .62s ease-in-out infinite; }
    @keyframes inkpet-typing-bob {
      0%, 100% { transform: translate(0, 0) rotate(0deg); }
      25% { transform: translate(-1.6px, -1px) rotate(-1.3deg); }
      75% { transform: translate(1.6px, -1px) rotate(1.3deg); }
    }
    .inkpet-ask.inkpet-ask-busy .inkpet-ask-presets { pointer-events: none; opacity: .55; }
    /* 预设选项直接挂在问候语下面，像漫画里紧跟着台词的回应选项。 */
    .inkpet-ask-presets {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin: 0 0 2px 2px;
      padding: 0;
    }
    .inkpet-ask-presets button {
      appearance: none;
      padding: 6px 10px;
      border: 1px solid rgba(95, 90, 80, .2);
      border-radius: 3px;
      color: #55544b;
      background: rgba(255, 253, 247, .86);
      font-family: inherit;
      font-size: 11.5px;
      line-height: 1.3;
      cursor: pointer;
      transition: background .18s, border-color .18s, color .18s;
    }
    .inkpet-ask-presets button:hover {
      color: #2c2c26;
      border-color: rgba(70, 66, 58, .42);
      background: #fffdf6;
    }
    .inkpet-ask-presets button.inkpet-ask-soon {
      color: #9a978c;
      border-style: dashed;
    }
    /* 底部预留的输入框：之后给玩家自由提问。 */
    .inkpet-ask-input {
      display: flex;
      flex: 0 0 auto;
      align-items: center;
      gap: 6px;
      padding: 9px 12px 11px;
      border-top: 1px solid rgba(91, 87, 78, .1);
      border-radius: 0 0 15px 15px;
      background: rgba(246, 243, 235, .55);
    }
    .inkpet-ask-input input {
      flex: 1 1 auto;
      min-width: 0;
      padding: 8px 11px;
      border: 1px solid rgba(95, 90, 80, .22);
      border-radius: 999px;
      color: #4b4941;
      background: rgba(255, 253, 247, .92);
      font-family: inherit;
      font-size: 11.5px;
      line-height: 1.3;
      outline: none;
      transition: border-color .18s, background .18s;
    }
    .inkpet-ask-input input::placeholder { color: #a5a196; }
    .inkpet-ask-input input:focus { border-color: rgba(70, 66, 58, .46); background: #fffdf7; }
    .inkpet-ask-input button {
      appearance: none;
      flex: 0 0 auto;
      padding: 7px 13px;
      border: 1px solid rgba(120, 60, 52, .25);
      border-radius: 999px;
      color: #8d4137;
      background: #fffdf7;
      font-family: inherit;
      font-size: 11.5px;
      line-height: 1.2;
      cursor: pointer;
      transition: background .18s, transform .18s;
    }
    .inkpet-ask-input button:hover { background: #fff; transform: translateY(-1px); }
    .inkpet-ask.inkpet-ask-busy .inkpet-ask-input { opacity: .6; }

    @keyframes inkpet-stop-jolt {
      0% { transform: translateX(-50%) scale(.9); }
      30% { transform: translateX(-50%) scale(1.05) rotate(-1.4deg); }
      52% { transform: translateX(-50%) scale(.978) rotate(1.1deg); }
      74% { transform: translateX(-50%) scale(1.018) rotate(-.5deg); }
      100% { transform: translateX(-50%) scale(1); }
    }
    @keyframes inkpet-idle {
      0%, 100% { transform: translateY(0) scale(.975, .982); }
      24% { transform: translateY(-2px) scale(1.006, 1.014); }
      52% { transform: translateY(-5px) scale(1.038, 1.026); }
      76% { transform: translateY(-2px) scale(1.008, 1.012); }
    }
    @keyframes inkpet-wash-drift {
      0%, 100% { transform: rotate(-1.2deg) scale(.985, .99); }
      34% { transform: rotate(.7deg) scale(1.025, .985); }
      68% { transform: rotate(1.3deg) scale(.99, 1.025); }
    }
    @keyframes inkpet-drag-wobble {
      0%, 100% { transform: scale(1.045, .94) rotate(-1.8deg); }
      25% { transform: scale(.975, 1.055) rotate(1.4deg); }
      50% { transform: scale(1.065, .925) rotate(2deg); }
      75% { transform: scale(.99, 1.045) rotate(-1.4deg); }
    }
    @keyframes inkpet-core-panic {
      0%, 100% { transform: scale(1, 1) rotate(0deg); }
      25% { transform: scale(1.045, .96) rotate(-1.6deg); }
      55% { transform: scale(.955, 1.05) rotate(1.8deg); }
      78% { transform: scale(1.035, .975) rotate(-.8deg); }
    }
    @keyframes inkpet-flower-breathe { 0%, 100% { opacity: .94; } 48% { opacity: 1; } 72% { opacity: .97; } }
    @keyframes inkpet-sleepy-idle {
      0%, 100% { transform: translateY(2px) scale(.99, .97); }
      45% { transform: translateY(4px) scale(1.015, .99); }
      72% { transform: translateY(3px) scale(1.005, .985); }
    }
    @keyframes inkpet-shy-shrink {
      0% { transform: scale(1); }
      58% { transform: scale(.56, .62); }
      76% { transform: scale(.63, .58); }
      100% { transform: scale(.60, .60); }
    }
    @keyframes inkpet-angry-bristle {
      0%, 100% { transform: translate(0,0) rotate(-.8deg) scale(1.01); }
      25% { transform: translate(-1px,1px) rotate(1.2deg) scale(1.025,.99); }
      50% { transform: translate(1px,-1px) rotate(-1.4deg) scale(.99,1.025); }
      75% { transform: translate(-1px,-1px) rotate(.9deg) scale(1.02); }
    }
    @keyframes inkpet-angry-wash {
      0%, 100% { transform: rotate(-2deg) scale(1.02); }
      50% { transform: rotate(2deg) scale(1.08,1.04); }
    }
    @keyframes inkpet-sneeze-shake {
      0%, 100% { transform: translate(0,0) rotate(0); }
      18% { transform: translate(-3px,1px) rotate(-2deg); }
      38% { transform: translate(3px,-2px) rotate(2deg); }
      58% { transform: translate(-2px,1px) rotate(-1.3deg); }
      78% { transform: translate(1px,-1px) rotate(.8deg); }
    }
    @keyframes inkpet-sneeze-swim {
      0%, 100% { opacity: 0; transform: translate(0,0) scale(.12); }
      13% { opacity: .92; transform: translate(calc(var(--dx) * .22), calc(var(--dy) * .22)) scale(.9); }
      42% { opacity: .88; transform: translate(var(--dx), var(--dy)) scale(1); }
      62% { opacity: .82; transform: translate(calc(var(--dx) * .88), calc(var(--dy) * .86)) scale(.9); }
      83% { opacity: .5; transform: translate(calc(var(--dx) * .3), calc(var(--dy) * .25)) scale(.62); }
    }
    @keyframes inkpet-face-tremble {
      0%, 100% { translate: 0 0; }
      40% { translate: -1px 1px; }
      70% { translate: 1px -1px; }
    }
    @keyframes inkpet-zzz-float {
      0%, 54% { opacity: 0; transform: translate(0, 8px) scale(.78) rotate(-8deg); }
      62% { opacity: .72; }
      100% { opacity: 0; transform: translate(11px, -17px) scale(1.12) rotate(8deg); }
    }
    @keyframes inkpet-eye-spread {
      0% { opacity: 0; transform: scale(.80); }
      52% { opacity: .82; transform: scale(1.08); }
      100% { opacity: .9; transform: scale(1.015); }
    }
    @keyframes inkpet-pupil-gather {
      0% { opacity: 0; transform: scale(1.48); filter: blur(7px); }
      42% { opacity: .78; transform: scale(.88); filter: blur(2px); }
      100% { opacity: 1; transform: scale(1); filter: blur(0); }
    }
    @keyframes inkpet-eye-wash-breathe {
      0%, 100% { transform: scale(1.02); }
      50% { transform: scale(1.045); }
    }
    @keyframes inkpet-bounce {
      0% { transform: scale(1, 1); }
      19% { transform: scale(.86, 1.13); }
      38% { transform: scale(1.12, .89); }
      56% { transform: scale(.96, 1.04); }
      74% { transform: scale(1.025, .985); }
      100% { transform: scale(1, 1); }
    }
    @keyframes inkpet-sticker-fall {
      0% { opacity: 0; top: -52px; transform: translateX(-50%) rotate(16deg) scale(1.16); }
      43% { opacity: 1; top: 73px; transform: translateX(-50%) rotate(-7deg) scale(1.04); }
      62% { opacity: 1; top: 80px; transform: translateX(-50%) rotate(-12deg) scale(.94); }
      100% { opacity: 0; top: 76px; transform: translateX(-50%) rotate(-11deg) scale(.98); }
    }
    @keyframes inkpet-stamp-squash {
      0% { transform: scale(1); }
      25% { transform: scale(1.04, .76); }
      44% { transform: scale(.92, 1.10); }
      65% { transform: scale(1.035, .97); }
      82% { transform: scale(.985, 1.02); }
      100% { transform: scale(1); }
    }
    @keyframes inkpet-nuzzle-pulse {
      0%, 100% { transform: scale(1, 1) rotate(0deg); }
      28% { transform: scale(1.045, .97) rotate(-1.1deg); }
      58% { transform: scale(.975, 1.045) rotate(1.1deg); }
      78% { transform: scale(1.018, .99) rotate(-.4deg); }
    }
    @keyframes inkpet-whole-nuzzle {
      0%, 100% { transform: translate(0,0) rotate(0deg) scale(1); }
      22% { transform: translate(-2px,1px) rotate(-1.25deg) scale(1.018,.99); }
      48% { transform: translate(2px,-1px) rotate(1.3deg) scale(.992,1.02); }
      72% { transform: translate(-1px,0) rotate(-.7deg) scale(1.012,.996); }
    }
    @keyframes inkpet-hover-speck {
      0% { opacity: 0; transform: translate(0, 0) scale(.28); }
      16% { opacity: .92; transform: translate(0, 0) scale(1.12); }
      72% { opacity: .78; }
      100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.48); }
    }
    @keyframes inkpet-fear-spike-shiver {
      0%, 100% { transform: scale(1) rotate(-.7deg); }
      28% { transform: scale(1.045,.98) rotate(.8deg); }
      57% { transform: scale(.98,1.045) rotate(-.6deg); }
      78% { transform: scale(1.025,.99) rotate(.5deg); }
    }
    @keyframes inkpet-fear-whole-shiver {
      0%, 100% { transform: translate(0,0) rotate(-.35deg); }
      25% { transform: translate(-1px,1px) rotate(.55deg); }
      50% { transform: translate(1px,-1px) rotate(-.5deg); }
      75% { transform: translate(-.5px,-.5px) rotate(.35deg); }
    }
    /* ==========================================================
       V15 新增：💭 思考气泡 + 主动对话卡 + 逐字机械音
       气泡挂在 #inkpet-root 里（跟着珍珍一起缩放、飘移，算在“头上”），
       对话卡挂在 body 上（不随桌宠放大），位置由脚本贴着珍珍算。
       ========================================================== */
    #inkpet-root .inkpet-thinkbubble {
      position: absolute;
      z-index: 11;
      left: 50%;
      bottom: 84%;
      width: 58px;
      height: 58px;
      margin-left: 22px;
      display: grid;
      place-items: center;
      padding: 0;
      border: 0;
      color: inherit;
      background: none;
      appearance: none;
      -webkit-appearance: none;
      font-family: inherit;
      cursor: pointer;
      opacity: 0;
      transform: translateY(12px) scale(.32);
      transform-origin: 16% 100%;
      pointer-events: none;
      transition: opacity .3s ease, transform .44s cubic-bezier(.22,.9,.28,1.42);
      -webkit-tap-highlight-color: transparent;
      outline: none;
    }
    #inkpet-root .inkpet-thinkbubble.inkpet-thinkbubble-show {
      opacity: 1;
      transform: translateY(0) scale(1);
      pointer-events: auto;
    }
    #inkpet-root .inkpet-thinkbubble-emoji {
      display: block;
      font-size: 46px;
      line-height: 1;
      transform-origin: 50% 70%;
      filter: drop-shadow(0 4px 7px rgba(62, 57, 48, .22));
    }
    #inkpet-root .inkpet-thinkbubble.inkpet-thinkbubble-show .inkpet-thinkbubble-emoji {
      animation: inkpet-thinkbubble-float 3.4s ease-in-out infinite;
    }
    #inkpet-root .inkpet-thinkbubble:active .inkpet-thinkbubble-emoji { transform: scale(.9); }
    @keyframes inkpet-thinkbubble-float {
      0%, 100% { transform: translateY(0) rotate(-3.5deg); }
      36% { transform: translateY(-7px) rotate(2.5deg); }
      68% { transform: translateY(-3px) rotate(-1.5deg); }
    }

    /* 主动对话卡：贴着珍珍的漫画气泡，不随桌宠缩放。 */
    .inkpet-talk {
      --inkpet-talk-tail: 50%;
      position: fixed;
      left: 0;
      top: 0;
      z-index: 100002;
      width: min(324px, calc(100vw - 28px));
      padding: 15px 17px 11px;
      border: 1px solid rgba(91, 87, 78, .2);
      border-radius: 15px;
      background: rgba(251, 249, 243, .995);
      box-shadow: 0 14px 36px rgba(50, 46, 38, .19);
      font-family: "Songti SC", "Noto Serif CJK SC", serif;
      opacity: 0;
      transform: translateY(8px) scale(.96);
      pointer-events: none;
      transition: opacity .2s ease, transform .24s cubic-bezier(.2,.8,.2,1);
    }
    .inkpet-talk.inkpet-talk-open {
      opacity: 1;
      transform: none;
      pointer-events: auto;
    }
    /* 小尖尖：和询问窗口同一套做法，一个旋转 45° 的方块。 */
    .inkpet-talk::after {
      content: "";
      position: absolute;
      bottom: -8px;
      left: var(--inkpet-talk-tail, 50%);
      width: 15px;
      height: 15px;
      margin-left: -7.5px;
      background: rgba(251, 249, 243, .995);
      border-right: 1px solid rgba(91, 87, 78, .2);
      border-bottom: 1px solid rgba(91, 87, 78, .2);
      border-bottom-right-radius: 3px;
      transform: rotate(45deg);
    }
    .inkpet-talk.inkpet-talk-tail-up::after {
      bottom: auto;
      top: -8px;
      border-right: 0;
      border-bottom: 0;
      border-left: 1px solid rgba(91, 87, 78, .2);
      border-top: 1px solid rgba(91, 87, 78, .2);
      border-bottom-right-radius: 0;
      border-top-left-radius: 3px;
    }
    .inkpet-talk-text {
      margin: 0;
      min-height: 4.6em;
      padding-right: 16px;
      color: #44423b;
      font-size: 13.5px;
      line-height: 1.95;
      letter-spacing: .035em;
      word-break: normal;
      overflow-wrap: anywhere;
    }
    .inkpet-talk-caret {
      display: inline-block;
      width: 1px;
      height: 1em;
      margin-left: 2px;
      vertical-align: -.12em;
      background: currentColor;
      animation: inkpet-talk-caret 1s steps(1, end) infinite;
    }
    .inkpet-talk.inkpet-talk-ready .inkpet-talk-caret { display: none; }
    @keyframes inkpet-talk-caret {
      0%, 49% { opacity: .5; }
      50%, 100% { opacity: 0; }
    }
    .inkpet-talk-foot {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-top: 9px;
      min-height: 24px;
    }
    .inkpet-talk-voice,
    .inkpet-talk-next,
    .inkpet-talk-close {
      appearance: none;
      border: 0;
      font-family: inherit;
      cursor: pointer;
    }
    .inkpet-talk-voice {
      padding: 4px 9px;
      border: 1px solid rgba(95, 90, 80, .18);
      border-radius: 999px;
      color: #7c7970;
      background: rgba(255, 253, 247, .9);
      font-size: 10.5px;
      line-height: 1.2;
      letter-spacing: .06em;
      transition: color .18s, border-color .18s, background .18s;
    }
    .inkpet-talk-voice:hover { color: #514f47; border-color: rgba(70, 66, 58, .4); background: #fffdf7; }
    .inkpet-talk-next {
      padding: 5px 12px;
      border: 1px solid rgba(120, 60, 52, .24);
      border-radius: 999px;
      color: #8d4137;
      background: #fffdf7;
      font-size: 11.5px;
      line-height: 1.2;
      opacity: 0;
      transform: translateY(3px);
      pointer-events: none;
      transition: opacity .2s, transform .2s;
    }
    .inkpet-talk.inkpet-talk-ready .inkpet-talk-next {
      opacity: 1;
      transform: none;
      pointer-events: auto;
    }
    /* 必读卡：打字过程中也把「继续说」露出来，玩家一眼能看到要点哪里。 */
    .inkpet-talk.inkpet-talk-required .inkpet-talk-next {
      opacity: 1;
      transform: none;
      pointer-events: auto;
    }
    .inkpet-talk-next:hover { background: #fff; }
    .inkpet-talk-close {
      position: absolute;
      top: 5px;
      right: 7px;
      width: 22px;
      height: 22px;
      padding: 0;
      border-radius: 50%;
      color: #a5a196;
      background: transparent;
      font-size: 12px;
      line-height: 1;
      transition: color .18s, background .18s;
    }
    .inkpet-talk-close:hover { color: #5d5b53; background: rgba(90, 86, 77, .08); }
    /* 游戏整页的必读对话：藏起 ✕，只能点「继续说 / 好嘛」走完。 */
    .inkpet-talk.inkpet-talk-required .inkpet-talk-close { display: none; }

    @media (prefers-reduced-motion: reduce) {
      #inkpet-root .inkpet-art, #inkpet-root .inkpet-wash { animation: none !important; }
      #inkpet-root .inkpet-thinkbubble-emoji { animation: none !important; }
      #inkpet-root *, #inkpet-root *::before, #inkpet-root *::after { transition-duration: .01ms !important; }
    }
    @media (max-width: 760px) {
      #inkpet-root { width: min(var(--inkpet-size), 184px); height: min(var(--inkpet-size), 184px); right: 10px; bottom: 12px; }
      #inkpet-root .inkpet-face { font-size: 21px; }
      #inkpet-root .inkpet-face.inkpet-small-expression { font-size: 16px; }
      #inkpet-root .inkpet-face.inkpet-medium-expression { font-size: 18px; }
      #inkpet-root .inkpet-face.inkpet-long-expression { font-size: 14px; }
      #inkpet-root .inkpet-message { right: calc(100% - 8px); bottom: 76%; max-width: min(220px, calc(100vw - 34px)); }
      #inkpet-root .inkpet-thinkbubble { width: 50px; height: 50px; margin-left: 14px; }
      #inkpet-root .inkpet-thinkbubble-emoji { font-size: 38px; }
      .inkpet-talk { width: min(300px, calc(100vw - 24px)); }
      .inkpet-ask { width: min(348px, calc(100vw - 24px)); }
      .inkpet-stop { padding: 18px 18px 16px; }
      .inkpet-stop-title { font-size: 25px; }
      .inkpet-feed-pop { width: min(248px, calc(100vw - 24px)); }
    }
  

