/* blackcat-web 共享设计包 · 逗猫棒光标动效（需求 F，2026-09-11 追加；需求 G 镜像适配） */
/* 说明：静态降级路径（无 JS / 触摸设备 / prefers-reduced-motion）由 cursor.css 承担；
   本文件的动态部分仅在 cursor-motion.js 判定「支持悬停的精确指针设备且未减弱动效」并给
   <html> 加上 cat-cursor-on 后生效：隐藏原生光标 + 显示跟随元素 + 状态动画。
   需求 G（2026-09-11）：光标已水平镜像，棒尖移到左上 (2,3)——旋转原点改为 2px 3px；
   三组关键帧旋转角取反，使摆动方向为镜像前的自然效果（水平镜像时旋转方向随之反转）。 */

.cat-cursor {
  position: fixed;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  pointer-events: none;
  z-index: 2147483646;
  opacity: 0;
  transition: opacity 120ms linear;
  will-change: transform;
}
.cat-cursor.is-live { opacity: 1; }
.cat-cursor.is-over-text { opacity: 0; }
.cat-cursor__swing {
  width: 100%;
  height: 100%;
  transform-origin: 2px 3px;
  animation: cat-cursor-idle 2.8s ease-in-out infinite;
}
.cat-cursor img { display: block; width: 100%; height: 100%; }
.cat-cursor.is-target .cat-cursor__swing { animation: cat-cursor-active 0.9s ease-in-out infinite; }
.cat-cursor.is-click .cat-cursor__swing { animation: cat-cursor-pounce 0.38s ease-out; }

/* 待机：轻微浮动/摆动 */
@keyframes cat-cursor-idle {
  0%, 100% { transform: rotate(5deg) translateY(0); }
  50% { transform: rotate(-7deg) translateY(-3px); }
}
/* 悬停可点击元素：摆动更明显 */
@keyframes cat-cursor-active {
  0%, 100% { transform: rotate(13deg) translateY(0) scale(1.02); }
  50% { transform: rotate(-17deg) translateY(-4px) scale(1.06); }
}
/* 点击：扑击反馈 */
@keyframes cat-cursor-pounce {
  0% { transform: scale(0.72) rotate(18deg); }
  60% { transform: scale(1.12) rotate(-9deg); }
  100% { transform: scale(1) rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  .cat-cursor { display: none; }
  .cat-cursor__swing { animation: none !important; }
}
@media (hover: none), (pointer: coarse) {
  .cat-cursor { display: none; }
}

/* 动效激活（html.cat-cursor-on）时隐藏原生光标；文本输入区域保留原生光标 */
html.cat-cursor-on,
html.cat-cursor-on body,
html.cat-cursor-on a,
html.cat-cursor-on button,
html.cat-cursor-on summary,
html.cat-cursor-on label,
html.cat-cursor-on select,
html.cat-cursor-on input[type='submit'],
html.cat-cursor-on input[type='button'],
html.cat-cursor-on [role='button'],
html.cat-cursor-on .button {
  cursor: none;
}
html.cat-cursor-on input:not([type='submit']):not([type='button']):not([type='checkbox']):not([type='radio']),
html.cat-cursor-on textarea,
html.cat-cursor-on [contenteditable=''],
html.cat-cursor-on [contenteditable='true'] {
  cursor: auto;
}
