  .sheep {
    position: absolute; left: 0; top: 0;
    padding: 10px 10px 0;                   /* 去掉底部内边距，让脚贴住弧线 */
    background: none; border: 0;
    cursor: pointer;
    z-index: 3;
    will-change: transform, opacity;
    transform-origin: 50% 100%;
  }
  .sheep .art {
    position: relative;
    display: block;
    transform-origin: 50% 100%;
    transform: scaleX(var(--flip, 1));
    transition: filter .12s ease-out;
  }
  .sheep.walking .art { transform: scaleX(var(--flip, 1)) rotate(3deg); }
  .sheep.staged img { animation: none; }
  .sheep .art::after {
    content: "";
    position: absolute; left: 12%; right: 12%; bottom: -1px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(60,30,10,.2), rgba(60,30,10,0) 72%);
    pointer-events: none;
  }
  .sheep.covered .art {
    animation: sheepAim 1.2s ease-in-out infinite;
  }
  /* 瞄准光晕：双层 drop-shadow 让轮廓外扩更明显，贴图本身不变 */
  @keyframes sheepAim {
    0%, 100% { filter: brightness(1.05) saturate(1.15) drop-shadow(0 0 20px rgba(140,232,255,.62)) drop-shadow(0 0 7px rgba(190,250,255,.55)); }
    50% { filter: brightness(1.10) saturate(1.32) drop-shadow(0 0 36px rgba(150,240,255,1)) drop-shadow(0 0 12px rgba(210,255,255,.8)); }
  }
  .sheep.covered.peak .art {
    animation: sheepPeak .9s ease-in-out infinite;
  }
  @keyframes sheepPeak {
    0%, 100% { filter: brightness(1.05) saturate(1.15) drop-shadow(0 0 28px rgba(140,232,255,.65)) drop-shadow(0 0 10px rgba(190,250,255,.6)); }
    50% { filter: brightness(1.10) saturate(1.32) drop-shadow(0 0 52px rgba(150,240,255,1)) drop-shadow(0 0 16px rgba(215,255,255,.85)); }
  }
  /* 被光柱罩住时，一条窄光带约每 1.2s 从上到下扫过羊身；用立绘剪影做遮罩，不改变贴图与姿态 */
  .sheep .aim-scan {
    position: absolute; inset: 0;
    display: none;
    pointer-events: none;
    background-image: linear-gradient(180deg,
      rgba(120,235,255,0) 0%, rgba(150,245,255,.38) 28%, rgba(235,255,255,.98) 48%,
      #fff 50%, rgba(235,255,255,.98) 52%, rgba(150,245,255,.38) 72%, rgba(120,235,255,0) 100%);
    background-repeat: no-repeat;
    background-size: 100% 14%;
    background-position: 0 -30%;
    -webkit-mask-image: var(--aim-art);
    mask-image: var(--aim-art);
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    filter: blur(.35px) drop-shadow(0 0 4px rgba(160,245,255,.9));
    z-index: 2;
  }
  .sheep.covered .aim-scan {
    display: block;
    animation: sheepScan 1.2s linear infinite;
  }
  @keyframes sheepScan {
    0% { background-position: 0 -30%; opacity: .25; }
    12% { opacity: 1; }
    88% { opacity: 1; }
    100% { background-position: 0 130%; opacity: .25; }
  }
  /* 瞬移 / 受惊时立刻退掉扫光与光晕，不允许残留；
   * 进食是隐藏羊唯一的可收窗口，扫光与瞄准光晕都要保留（两套动画分别挂 .aim-scan / .art，互不覆盖） */
  .sheep:is(.blink-out, .blink-in, .startled) .aim-scan { display: none !important; animation: none !important; }
  .sheep:is(.blink-out, .blink-in, .startled) .art { animation: none !important; }
  .beam-ring {
    position: absolute;
    width: 204px; height: 204px;
    margin: -102px 0 0 -102px;
    border-radius: 50%;
    /* 总缩放由 beamRingScale() 从判定椭圆反推后写成变量（--ring-sx / --ring-sy） */
    transform: scaleX(var(--ring-sx, 1.12)) scaleY(var(--ring-sy, .50904));
    background:
      conic-gradient(from 180deg, rgba(255,255,255,var(--glow, 0)) 0 100%),
      conic-gradient(from 180deg, rgba(120,200,255,var(--hit, 0)) 0 100%),
      conic-gradient(from 180deg,
        rgba(94,56,38, var(--shade, 0)) 0deg calc(var(--p, 0) * 360deg),
        transparent calc(var(--p, 0) * 360deg) 360deg),
      conic-gradient(from 180deg,
        var(--ring, rgba(255,230,175,.95)) calc(var(--p, 0) * 360deg),
        rgba(94,56,38,.18) 0);
    -webkit-mask-image: radial-gradient(closest-side, transparent 76%, #000 82%);
    mask-image: radial-gradient(closest-side, transparent 76%, #000 82%);
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity .12s ease;
  }
  .beam-ring.on { opacity: 1; }
  .beam-ring.locked { --ring: rgba(255,196,80,.98); }
  .beam-ring.covered::after { opacity: .4; }
  .beam-ring.peak::after {
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(150, 225, 255, .9));
  }
  .beam-ring.locked::before {
    content: "";
    position: absolute; inset: 9%;
    border-radius: 50%;
    border: 3px solid rgba(150,236,255,.8);
    box-shadow: 0 0 14px rgba(120,220,255,.75), inset 0 0 10px rgba(150,236,255,.4);
    pointer-events: none;
    opacity: .65;
    animation: ringAim 1.1s ease-in-out infinite;
  }
  @keyframes ringAim {
    0%, 100% { opacity: .5; transform: scale(.985); }
    50% { opacity: .95; transform: scale(1.015); }
  }
  .beam-ring.peak::before { opacity: .25; animation: none; }
  .beam-ring::after {
    content: "";
    position: absolute; inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 180deg,
      transparent 0deg var(--hit-from, 306deg),
      rgba(215,247,255,.98) var(--hit-from, 306deg) var(--hit-to, 306deg),
      rgba(120,200,255,.42) var(--hit-to, 306deg) 360deg);
    -webkit-mask-image: radial-gradient(closest-side, transparent 76%, #000 82%);
    mask-image: radial-gradient(closest-side, transparent 76%, #000 82%);
    pointer-events: none;
  }
  .beam-ring.near::after {
    background: conic-gradient(from 180deg,
      transparent 0deg var(--hit-from, 306deg),
      rgba(230,250,255,1) var(--hit-from, 306deg) var(--hit-to, 306deg),
      rgba(150,220,255,.62) var(--hit-to, 306deg) 360deg);
  }
  .beam-ring.warn { animation: ringWarn .2s ease-out; }
  @keyframes ringWarn {
    0%, 100% { transform: scaleX(var(--ring-sx, 1.12)) scaleY(var(--ring-sy, .50904)) scale(1); }
    50% { transform: scaleX(var(--ring-sx, 1.12)) scaleY(var(--ring-sy, .50904)) scale(1.1); }
  }
  .sheep img {
    display: block;
    width: clamp(135px, 44vw, 175px); height: auto;
    aspect-ratio: 256 / 190;        /* 图片未加载时也预留高度，避免点击区先塌陷 */
    object-fit: contain;            /* 各羊立绘比例略有差异，contain 保证不变形 */
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    filter: drop-shadow(0 6px 10px rgba(0,0,0,.18));
    transform-origin: 50% 100%;       /* 所有形变都锚在脚底，挤压/呼吸才像踩在地上 */
    will-change: transform;
  }

  .feed-bar {
    position: absolute;
    left: 50%; top: -8px;
    width: 92px; height: 7px; margin-left: -46px;
    border-radius: 999px;
    background: rgba(26,26,26,.32);
    box-shadow: 0 0 0 1px rgba(255,255,255,.6);
    overflow: hidden;
    display: none;
    pointer-events: none;
  }
  .sheep.feeding .feed-bar { display: block; }
  .sheep-alert {
    --alert-size: clamp(34px, 10.56vw, 41px);
    position: absolute;
    left: 50%; bottom: calc(100% - 8px - var(--hover, 0px));
    width: var(--alert-size); height: var(--alert-size);
    margin-left: calc(var(--alert-size) / -2);
    display: none;
    align-items: center; justify-content: center;
    border-radius: 30%;
    background: #FFD54A;
    border: 3px solid #3A2B22;
    box-shadow: 0 3px 0 rgba(58,43,34,.35);
    color: #3A2B22;
    font-size: calc(var(--alert-size) * .86); font-weight: 900; line-height: 1;
    pointer-events: none;
    transform: rotate(calc(-1 * var(--sheep-rot, 0deg)))
      translateX(0) translateY(0);
    scale: 1;
  }
  .sheep.has-alert .sheep-alert {
    display: flex;
    animation: sheepAlertPop .2s cubic-bezier(.2,.8,.3,1.3);
  }
  .sheep-alert i {
    display: block;
    font-style: normal;
    animation: sheepAlertBob .5s ease-in-out infinite alternate;
  }
  @keyframes sheepAlertPop {
    from { scale: .6; }
    to { scale: 1; }
  }
  @keyframes sheepAlertBob {
    from { transform: translateY(0); }
    to { transform: translateY(-2px); }
  }
  .feed-bar i {
    display: block; width: 100%; height: 100%;
    transform-origin: left center;
    transform: scaleX(0);
    background: linear-gradient(90deg, #ffd166, #ffa53d);
  }
  .feed-bar.hurry i { background: linear-gradient(90deg, #ff8a5c, #ee4b3c); }
  .sheep.feeding img { animation: sheepEat .9s ease-in-out infinite; }
  /* 离场是独立状态：位移交给 runAway 的 WAAPI，img 不再叠待机/进食动画 */
  .sheep.fleeing img { animation: none; }
  @keyframes sheepEat {
    0%, 100% { transform: translateY(0) rotate(0deg) scale(1, 1); }
    30% { transform: translateY(2px) rotate(-3deg) scale(1.01, 0.98); }
    60% { transform: translateY(1px) rotate(2deg) scale(1.005, 0.99); }
  }
  .flee-symbol {
    position: absolute;
    pointer-events: none;
    /* 比羊身 / 残影 / 冲击环都高一层：任何档位的附加特效都不许盖住逃跑符号 */
    z-index: 4;
    background: url("./assets/game/fx/flee-symbol.webp") center/contain no-repeat;
    filter: drop-shadow(0 5px 6px rgba(60,40,25,.2));
    opacity: 0;
    transition: opacity .32s ease-out;
  }
  .flee-symbol.on { opacity: 1; }
  @media (prefers-reduced-motion: reduce) {
    .flee-symbol { transition: none; }
  }

  /* 瞬移残影：直接克隆羊的现有立绘节点（不新增图片），外壳复刻羊的位置 / 朝向，
     内层只做位移 + 淡出。contain 把重绘限制在自身盒子内，动画只碰合成层的
     transform / opacity，约 210ms 后由 JS 回收，不参与逐帧布局。 */
  .flee-ghost {
    position: absolute;
    left: 0; top: 0;
    pointer-events: none;
    z-index: 2;
    contain: layout paint;
    transform-origin: 50% 100%;
  }
  .flee-ghost-body {
    display: block;
    padding: 10px 10px 0;                /* 与 .sheep 同盒模型，立绘才对得上原位 */
    background: none; border: 0;
    transform-origin: 50% 100%;
    will-change: transform, opacity;     /* 动画只发生在这一层，独立合成不带动布局 */
  }
  .flee-ghost .art {
    position: relative;
    display: block;
    transform-origin: 50% 100%;
    transform: scaleX(var(--flip, 1));
  }
  .flee-ghost .art::after {
    content: "";
    position: absolute; left: 12%; right: 12%; bottom: -1px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(60,30,10,.2), rgba(60,30,10,0) 72%);
    pointer-events: none;
  }
  .flee-ghost img {
    display: block;
    width: clamp(135px, 44vw, 175px); height: auto;
    aspect-ratio: 256 / 190;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 6px 6px rgba(0,0,0,.18));
    transform-origin: 50% 100%;
  }
  /* 消失点冲击环（A / D 档）：只有描边，尺寸与位置由 JS 按羊身包围盒写入 */
  .flee-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(255, 249, 232, .92);
    box-shadow: 0 0 10px rgba(255, 240, 200, .55), inset 0 0 6px rgba(255, 235, 190, .35);
    pointer-events: none;
    z-index: 3;
    contain: layout paint;
    transform-origin: 50% 50%;
  }

  /* F 档速度线：纯 CSS 细线，沿逃跑方向抽出后散掉 */
  .flee-line {
    position: absolute;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 252, 240, 0), rgba(255, 252, 240, .92) 65%, rgba(255, 246, 222, .3));
    transform-origin: 50% 50%;
    pointer-events: none;
    z-index: 3;
    contain: layout paint;
    will-change: transform, opacity;
  }

  /* F 档起跑星尘：径向渐变 + 两粒高光点，不新增图片 */
  .flee-dust {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%,
      rgba(255, 255, 255, .9) 0 16%,
      rgba(255, 246, 214, .5) 36%,
      rgba(255, 240, 200, 0) 70%);
    box-shadow:
      10px -8px 0 -6px rgba(255, 255, 255, .85),
      -9px 7px 0 -7px rgba(255, 250, 230, .7);
    pointer-events: none;
    z-index: 2;
    contain: layout paint;
    will-change: transform, opacity;
  }

  .sheep.tremble img { animation: sheepTremble .18s ease-in-out 3; }
  .sheep.startled img { animation: sheepStartle .36s ease-out; }
  @keyframes sheepStartle {
    0% { transform: translateY(0) scale(1, 1); }
    30% { transform: translateY(-9px) scale(0.94, 1.06); }
    65% { transform: translateY(1px) scale(1.05, 0.95); }
    100% { transform: translateY(0) scale(1, 1); }
  }
  @keyframes sheepTremble {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    20% { transform: translate(-3px, 1px) rotate(-2.5deg); }
    40% { transform: translate(3px, -1px) rotate(2.5deg); }
    60% { transform: translate(-2px, 1px) rotate(-1.5deg); }
    80% { transform: translate(2px, 0) rotate(1.5deg); }
  }

  @media (prefers-reduced-motion: reduce) {
    .sheep.covered .art {
      animation: none;
      filter: brightness(1.08) saturate(1.2) drop-shadow(0 0 22px rgba(150,240,255,.8)) drop-shadow(0 0 8px rgba(200,250,255,.6));
    }
    .sheep.covered.peak .art {
      filter: brightness(1.08) saturate(1.2) drop-shadow(0 0 32px rgba(150,240,255,.85)) drop-shadow(0 0 10px rgba(200,250,255,.65));
    }
    /* 减少动态：不播放扫光，只保留静态光晕 */
    .sheep.covered .aim-scan { display: none; animation: none; }
    .beam-ring.locked::before { animation: none; opacity: .8; }
    .sheep.has-alert .sheep-alert,
    .sheep-alert i { animation: none; }
    .sheep.has-alert .sheep-alert { scale: 1; }
  }

