:root {
  --xy-ink: #342820;
  --xy-muted: #76675d;
  --xy-tea: #b98253;
  --xy-teal: #168d86;
  --xy-teal-dark: #0f6663;
  --xy-gold: #f3b33f;
  --xy-paper: #fffaf2;
  --xy-line: #ead8c7;
  --xy-shadow: 0 18px 42px rgba(61, 43, 29, 0.18);
}

.xingxiaoyou-demo-page {
  min-height: 100vh;
  margin: 0;
  color: var(--xy-ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  background:
    linear-gradient(135deg, rgba(22, 141, 134, 0.12), transparent 36%),
    linear-gradient(225deg, rgba(243, 179, 63, 0.18), transparent 34%),
    #f7f1e9;
  overflow-x: hidden;
}

.xy-demo-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.xy-demo-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 18px;
}

.xy-demo-eyebrow {
  margin: 0 0 8px;
  color: var(--xy-teal-dark);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.xy-demo-title {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
}

.xy-demo-summary {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--xy-muted);
  font-size: 15px;
  line-height: 1.7;
}

.xy-demo-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.xy-demo-badge {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(22, 141, 134, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--xy-teal-dark);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.xy-demo-grid {
  display: grid;
  grid-template-columns: minmax(390px, 1fr) minmax(380px, 520px);
  gap: 18px;
  min-width: 0;
}

.xy-demo-card {
  min-width: 0;
  border: 1px solid rgba(185, 130, 83, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--xy-shadow);
}

.xy-stage {
  position: relative;
  min-height: 660px;
  overflow: hidden;
}

.xy-stage::before {
  content: "";
  position: absolute;
  inset: auto -10% -16% -10%;
  height: 44%;
  background: linear-gradient(180deg, rgba(207, 237, 232, 0.56), rgba(255, 255, 255, 0));
  transform: skewY(-3deg);
}

.xy-webpet-zone {
  position: relative;
  min-height: 430px;
  padding: 24px;
}

.xingxiaoyou-webpet {
  position: absolute;
  right: 32px;
  bottom: 24px;
  width: 260px;
  min-height: 300px;
  display: grid;
  place-items: end center;
  isolation: isolate;
}

.xingxiaoyou-sprite-wrap {
  position: relative;
  width: 230px;
  height: 230px;
  display: grid;
  place-items: end center;
}

.xingxiaoyou-sprite {
  position: relative;
  max-width: 230px;
  max-height: 230px;
  object-fit: contain;
  transform-origin: 50% 82%;
  filter: drop-shadow(0 10px 10px rgba(74, 52, 36, 0.14));
  z-index: 2;
}

.xingxiaoyou-shadow {
  position: absolute;
  bottom: 4px;
  width: 126px;
  height: 22px;
  border-radius: 999px;
  background: rgba(68, 49, 35, 0.13);
  filter: blur(2px);
}

.xingxiaoyou-bubble {
  position: absolute;
  right: 168px;
  bottom: 224px;
  width: min(320px, calc(100vw - 48px));
  min-height: 68px;
  padding: 14px 38px 14px 16px;
  border: 2px solid #9c7a61;
  border-radius: 8px;
  background: #fffefd;
  color: var(--xy-ink);
  box-shadow: 0 12px 28px rgba(70, 48, 32, 0.14);
  font-size: 16px;
  font-weight: 850;
  line-height: 1.55;
  z-index: 4;
}

.xingxiaoyou-bubble::after {
  content: "";
  position: absolute;
  right: 28px;
  bottom: -12px;
  width: 20px;
  height: 20px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  background: inherit;
  color: inherit;
  transform: rotate(45deg);
}

.xingxiaoyou-bubble[hidden] {
  display: none;
}

.xingxiaoyou-bubble-close {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(74, 52, 36, 0.08);
  color: #5e4a3e;
  cursor: pointer;
  font-weight: 900;
}

.xingxiaoyou-bubble[data-bubble="home-guide"],
.xingxiaoyou-bubble[data-bubble="progress"],
.xingxiaoyou-bubble[data-bubble="start"] {
  border-color: var(--xy-teal);
  background: #effaf8;
  color: #164f4c;
}

.xingxiaoyou-bubble[data-bubble="completed"],
.xingxiaoyou-bubble[data-bubble="done"] {
  border-color: #d59a24;
  background: #fff4d1;
  color: #5a3c13;
}

.xingxiaoyou-bubble[data-bubble="empty"] {
  border-color: #b58a66;
  background: #fff8eb;
}

.xingxiaoyou-webpet[data-state="collapsed"] {
  width: 118px;
  min-height: 118px;
  right: 34px;
  bottom: 28px;
  cursor: pointer;
}

.xingxiaoyou-webpet[data-state="collapsed"] .xingxiaoyou-sprite-wrap {
  width: 106px;
  height: 106px;
}

.xingxiaoyou-webpet[data-state="collapsed"] .xingxiaoyou-sprite {
  max-width: 106px;
  max-height: 106px;
}

.xingxiaoyou-webpet[data-state="collapsed"] .xingxiaoyou-shadow {
  width: 72px;
  height: 12px;
  bottom: 0;
}

.xingxiaoyou-webpet[data-state="collapsed"] .xingxiaoyou-bubble,
.xingxiaoyou-webpet[data-state="mobile-collapsed"] .xingxiaoyou-bubble {
  display: none;
}

.xingxiaoyou-webpet[data-state="mobile-collapsed"] {
  width: 56px;
  min-height: 56px;
  right: 20px;
  bottom: 22px;
  cursor: pointer;
}

.xingxiaoyou-webpet[data-state="mobile-collapsed"] .xingxiaoyou-sprite-wrap {
  width: 56px;
  height: 56px;
}

.xingxiaoyou-webpet[data-state="mobile-collapsed"] .xingxiaoyou-sprite {
  max-width: 56px;
  max-height: 56px;
}

.xingxiaoyou-webpet[data-state="mobile-collapsed"] .xingxiaoyou-shadow {
  width: 42px;
  height: 8px;
  bottom: 0;
}

.xy-motion-gentle-float,
.xy-motion-blink-float {
  animation: xyGentleFloat 4.8s ease-in-out infinite;
}

.xy-motion-float-bounce {
  animation: xyFloatBounce 3.6s ease-in-out infinite;
}

.xy-motion-slow-blink,
.xy-motion-steady-blink,
.xy-motion-steady-focus,
.xy-motion-weak-star-glow {
  animation: xySteadyBlink 3.8s ease-in-out infinite;
}

.xy-motion-head-wiggle,
.xy-motion-wiggle {
  animation: xyHeadWiggle 2.9s ease-in-out infinite;
}

.xy-motion-lean-forward,
.xy-motion-lean-nod,
.xy-motion-ready-nod {
  animation: xyLeanNod 2.6s ease-in-out infinite;
}

.xy-motion-tiny-hop,
.xy-motion-happy-hop,
.xy-motion-star-pop {
  animation: xyHappyHop 2.2s ease-in-out infinite;
}

.xy-motion-star-orbit,
.xy-motion-celebrate-settle {
  animation: xyCelebrateSettle 3.2s ease-in-out infinite;
}

.xy-motion-head-tilt,
.xy-motion-peek-in {
  animation: xyHeadTilt 3.4s ease-in-out infinite;
}

.xy-motion-star-twinkle {
  animation: xyGentleFloat 4.8s ease-in-out infinite, xyStarPulse 2.7s ease-in-out infinite;
}

.xy-motion-collapsed-breath,
.xy-motion-mobile-idle-dot {
  animation: xyTinyBreath 4s ease-in-out infinite;
}

@keyframes xyGentleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes xyFloatBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  42% { transform: translateY(-11px) scale(1.012); }
  58% { transform: translateY(-5px) scale(0.998); }
}

@keyframes xySteadyBlink {
  0%, 100% { transform: translateY(0); }
  48% { transform: translateY(-2px); }
}

@keyframes xyHeadWiggle {
  0%, 100% { transform: rotate(0deg); }
  35% { transform: rotate(-2deg); }
  65% { transform: rotate(2deg); }
}

@keyframes xyLeanNod {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  40% { transform: rotate(1.5deg) translateY(-4px); }
  58% { transform: rotate(0deg) translateY(-2px); }
}

@keyframes xyHappyHop {
  0%, 100% { transform: translateY(0) scale(1); }
  38% { transform: translateY(-18px) scale(1.025); }
  62% { transform: translateY(-4px) scale(0.99); }
}

@keyframes xyCelebrateSettle {
  0%, 100% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-16px) scale(1.025); }
  55% { transform: translateY(-8px) scale(1.012); }
  78% { transform: translateY(0) scale(1); }
}

@keyframes xyHeadTilt {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  50% { transform: rotate(-3deg) translateY(-3px); }
}

@keyframes xyStarPulse {
  0%, 100% { filter: drop-shadow(0 10px 10px rgba(74, 52, 36, 0.14)); }
  50% { filter: drop-shadow(0 10px 10px rgba(74, 52, 36, 0.14)) drop-shadow(0 0 10px rgba(243, 179, 63, 0.7)); }
}

@keyframes xyTinyBreath {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.xy-controls {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 18px;
  border-top: 1px solid rgba(22, 141, 134, 0.14);
  background: rgba(239, 250, 248, 0.72);
}

.xy-button {
  min-height: 38px;
  border: 1px solid rgba(52, 40, 32, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
}

.xy-button:hover,
.xy-button.is-active {
  border-color: var(--xy-teal);
  background: #e8f7f4;
  color: var(--xy-teal-dark);
}

.xy-button-primary {
  background: var(--xy-teal);
  border-color: var(--xy-teal);
  color: #fff;
}

.xy-info {
  padding: 20px;
}

.xy-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.xy-metric {
  min-height: 74px;
  padding: 12px;
  border: 1px solid rgba(52, 40, 32, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.xy-metric b {
  display: block;
  margin-bottom: 6px;
  color: var(--xy-muted);
  font-size: 12px;
  text-transform: uppercase;
}

.xy-metric span {
  font-size: 16px;
  font-weight: 850;
}

.xy-line-preview {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(22, 141, 134, 0.22);
  border-radius: 8px;
  background: #f7fcfb;
}

.xy-line-preview p {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.55;
}

.xy-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.xy-chip {
  min-height: 26px;
  padding: 5px 9px;
  border: 1px solid rgba(52, 40, 32, 0.12);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.xy-category-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.xy-category-row {
  display: grid;
  grid-template-columns: 118px 1fr 48px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(52, 40, 32, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 850;
}

.xy-bar {
  height: 8px;
  border-radius: 999px;
  background: #eadccd;
  overflow: hidden;
}

.xy-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--xy-teal), var(--xy-gold));
}

.xy-subtitle {
  margin: 18px 0 8px;
  color: var(--xy-teal-dark);
  font-size: 15px;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .xy-demo-shell {
    width: calc(100% - 24px);
    max-width: 720px;
  }

  .xy-demo-header,
  .xy-demo-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .xy-demo-badges {
    justify-content: flex-start;
  }

  .xy-controls {
    grid-template-columns: repeat(2, 1fr);
  }

  .xy-stage {
    min-height: 620px;
  }
}

@media (max-width: 560px) {
  .xy-demo-shell {
    width: calc(100% - 20px);
    padding-top: 18px;
  }

  .xy-demo-title {
    font-size: 31px;
  }

  .xy-demo-summary {
    font-size: 14px;
    overflow-wrap: anywhere;
  }

  .xy-stage {
    min-height: 580px;
  }

  .xy-webpet-zone {
    min-height: 360px;
    padding: 14px;
  }

  .xingxiaoyou-webpet {
    right: 18px;
    bottom: 18px;
    width: 220px;
    min-height: 260px;
  }

  .xingxiaoyou-sprite-wrap {
    width: 206px;
    height: 206px;
  }

  .xingxiaoyou-sprite {
    max-width: 206px;
    max-height: 206px;
  }

  .xingxiaoyou-bubble {
    right: 24px;
    bottom: 214px;
    width: calc(100vw - 64px);
    font-size: 15px;
  }

  .xingxiaoyou-webpet[data-state="mobile-collapsed"] {
    right: 76px;
    bottom: 22px;
  }

  .xy-info-grid {
    grid-template-columns: 1fr;
  }

  .xy-category-row {
    grid-template-columns: 106px 1fr 42px;
  }
}

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

/* P6.0 site runtime layer: keep the handoff visual system, adapt only placement and isolation. */
.xingxiaoyou-webpet.is-site {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 300px;
  min-height: 306px;
  z-index: 52;
  display: grid;
  place-items: end center;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
}

.xingxiaoyou-webpet.is-site[hidden] {
  display: none !important;
}

.xingxiaoyou-webpet.is-site,
.xingxiaoyou-webpet.is-site * {
  box-sizing: border-box;
}

.xingxiaoyou-webpet.is-site .xingxiaoyou-bubble {
  pointer-events: none;
  max-width: min(320px, calc(100vw - 48px));
}

.xingxiaoyou-webpet.is-site .xingxiaoyou-bubble-text {
  display: block;
  padding-right: 2px;
  overflow-wrap: anywhere;
}

.xingxiaoyou-webpet.is-site .xingxiaoyou-bubble-meta {
  display: block;
  margin-top: 6px;
  color: rgba(52, 40, 32, 0.68);
  font-size: 12px;
  font-weight: 800;
}

.xingxiaoyou-webpet.is-site .xingxiaoyou-bubble-action {
  display: inline-grid;
  place-items: center;
  min-height: 30px;
  margin-top: 10px;
  padding: 6px 11px;
  border: 1px solid rgba(22, 141, 134, 0.28);
  border-radius: 8px;
  background: #eaf7f5;
  color: #105a57;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.xingxiaoyou-webpet.is-site .xingxiaoyou-bubble-action[hidden] {
  display: none !important;
}

.xingxiaoyou-webpet.is-site .xingxiaoyou-bubble-close,
.xingxiaoyou-webpet.is-site .xingxiaoyou-bubble-action {
  pointer-events: auto;
}

.xingxiaoyou-webpet.is-site .xingxiaoyou-bubble-close,
.xingxiaoyou-webpet.is-site .xingxiaoyou-bubble-close:hover,
.xingxiaoyou-webpet.is-site .xingxiaoyou-bubble-close:focus-visible {
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: rgba(74, 52, 36, 0.08) !important;
  box-shadow: none !important;
  color: #5e4a3e !important;
  transform: none !important;
}

.xingxiaoyou-webpet.is-site .xingxiaoyou-bubble-action:hover,
.xingxiaoyou-webpet.is-site .xingxiaoyou-bubble-action:focus-visible {
  background: #dff2ef;
  color: #0f4e4b;
}

.xingxiaoyou-webpet.is-site .xingxiaoyou-sprite-wrap {
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
}

.xingxiaoyou-webpet.is-site.is-dragging .xingxiaoyou-sprite-wrap,
.xingxiaoyou-webpet.is-site.is-dragging .xingxiaoyou-bubble {
  cursor: grabbing;
}

.xingxiaoyou-webpet.is-site.is-dragging {
  transition: none !important;
}

.xingxiaoyou-webpet.is-site.is-dragging .xingxiaoyou-bubble {
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px) scale(0.96);
}

.xingxiaoyou-webpet.is-site[data-webpet-drag-phase="settle"] .xingxiaoyou-bubble {
  opacity: 0;
  pointer-events: none;
}

.xy-motion-dragging-sway {
  animation: xyDraggingSway 0.72s ease-in-out infinite;
}

.xy-motion-drag-settle {
  animation: xyDragSettle 0.7s ease-out 1;
}

@keyframes xyDraggingSway {
  0% { transform: translate3d(0, 0, 0) rotate(-3deg) scale(1.02); }
  50% { transform: translate3d(0, -5px, 0) rotate(3deg) scale(1.04); }
  100% { transform: translate3d(0, 0, 0) rotate(-3deg) scale(1.02); }
}

@keyframes xyDragSettle {
  0% { transform: translate3d(0, -6px, 0) rotate(3deg) scale(1.04); }
  55% { transform: translate3d(0, 3px, 0) rotate(-1deg) scale(0.99); }
  100% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
}

.xingxiaoyou-webpet.is-site[data-state="collapsed"] {
  width: 118px;
  min-height: 118px;
}

.xingxiaoyou-webpet.is-site[data-webpet-mode="collapsed"] {
  width: 118px;
  min-height: 118px;
}

.xingxiaoyou-webpet.is-site[data-state="mobile-collapsed"] {
  width: 56px;
  min-height: 56px;
}

.xingxiaoyou-webpet.is-site[data-webpet-mode="collapsed"] .xingxiaoyou-bubble {
  display: none !important;
}

.xingxiaoyou-webpet.is-site[data-webpet-mode="collapsed"] .xingxiaoyou-sprite-wrap {
  width: 106px;
  height: 106px;
}

.xingxiaoyou-webpet.is-site[data-webpet-mode="collapsed"] .xingxiaoyou-sprite {
  max-width: 106px;
  max-height: 106px;
}

.xingxiaoyou-webpet.is-site[data-state="collapsed"] .xingxiaoyou-bubble,
.xingxiaoyou-webpet.is-site[data-state="mobile-collapsed"] .xingxiaoyou-bubble {
  display: none !important;
}

@media (max-width: 560px) {
  .xingxiaoyou-webpet.is-site {
    right: 14px;
    bottom: 18px;
    width: 224px;
    min-height: 248px;
  }

  .xingxiaoyou-webpet.is-site .xingxiaoyou-sprite-wrap {
    width: 156px;
    height: 156px;
  }

  .xingxiaoyou-webpet.is-site .xingxiaoyou-sprite {
    max-width: 156px;
    max-height: 156px;
  }

  .xingxiaoyou-webpet.is-site .xingxiaoyou-shadow {
    width: 86px;
    height: 15px;
  }

  .xingxiaoyou-webpet.is-site .xingxiaoyou-bubble {
    right: 24px;
    bottom: 164px;
    width: min(286px, calc(100vw - 56px));
    min-height: 54px;
    padding: 12px 36px 12px 14px;
    font-size: 14px;
  }

  .xingxiaoyou-webpet.is-site[data-state="mobile-collapsed"] {
    right: 14px;
    bottom: 18px;
    width: 56px;
    min-height: 56px;
  }

  .xingxiaoyou-webpet.is-site[data-webpet-mode="collapsed"] {
    width: 56px;
    min-height: 56px;
  }

  .xingxiaoyou-webpet.is-site[data-state="mobile-collapsed"] .xingxiaoyou-sprite-wrap {
    width: 56px;
    height: 56px;
  }

  .xingxiaoyou-webpet.is-site[data-webpet-mode="collapsed"] .xingxiaoyou-sprite-wrap {
    width: 56px;
    height: 56px;
  }

  .xingxiaoyou-webpet.is-site[data-state="mobile-collapsed"] .xingxiaoyou-sprite {
    max-width: 56px;
    max-height: 56px;
  }

  .xingxiaoyou-webpet.is-site[data-webpet-mode="collapsed"] .xingxiaoyou-sprite {
    max-width: 56px;
    max-height: 56px;
  }
}

/* P6.0 Round 4: viewport drag and sprite crop polish. */
.xingxiaoyou-webpet.is-site {
  width: 268px;
  min-height: 328px;
  overflow: visible !important;
  contain: none;
}

.xingxiaoyou-webpet.is-site .xingxiaoyou-sprite-wrap {
  width: 252px;
  height: 252px;
  padding: 10px;
  overflow: visible !important;
}

.xingxiaoyou-webpet.is-site .xingxiaoyou-sprite {
  width: 230px;
  height: 230px;
  max-width: 230px;
  max-height: 230px;
  object-fit: contain;
  overflow: visible !important;
}

.xingxiaoyou-webpet.is-site .xingxiaoyou-shadow {
  bottom: 6px;
}

.xingxiaoyou-webpet.is-site[data-webpet-mode="collapsed"] {
  width: 126px;
  min-height: 126px;
}

.xingxiaoyou-webpet.is-site[data-webpet-mode="collapsed"] .xingxiaoyou-sprite-wrap {
  width: 116px;
  height: 116px;
  padding: 5px;
  overflow: visible !important;
}

.xingxiaoyou-webpet.is-site[data-webpet-mode="collapsed"] .xingxiaoyou-sprite {
  width: 106px;
  height: 106px;
  max-width: 106px;
  max-height: 106px;
}

.xingxiaoyou-webpet.is-site[data-state="dragging"] .xingxiaoyou-bubble,
.xingxiaoyou-webpet.is-site[data-webpet-drag-phase="dragging"] .xingxiaoyou-bubble,
.xingxiaoyou-webpet.is-site[data-webpet-drag-phase="settle"] .xingxiaoyou-bubble {
  display: none !important;
}

.xingxiaoyou-webpet.is-site .xy-motion-gentle-float,
.xingxiaoyou-webpet.is-site .xy-motion-blink-float {
  animation: xyRound4IdleFloat 3.4s ease-in-out infinite;
}

.xingxiaoyou-webpet.is-site .xy-motion-lean-forward,
.xingxiaoyou-webpet.is-site .xy-motion-lean-nod,
.xingxiaoyou-webpet.is-site .xy-motion-ready-nod {
  animation: xyRound4RemindNod 1.8s ease-in-out infinite;
}

.xingxiaoyou-webpet.is-site .xy-motion-tiny-hop,
.xingxiaoyou-webpet.is-site .xy-motion-happy-hop,
.xingxiaoyou-webpet.is-site .xy-motion-star-pop {
  animation: xyRound4HappyHop 1.45s ease-in-out infinite;
}

.xingxiaoyou-webpet.is-site .xy-motion-star-orbit,
.xingxiaoyou-webpet.is-site .xy-motion-celebrate-settle {
  animation: xyRound4DoneSettle 2.2s ease-in-out infinite;
}

.xingxiaoyou-webpet.is-site .xy-motion-head-tilt,
.xingxiaoyou-webpet.is-site .xy-motion-peek-in {
  animation: xyRound4HeadTilt 2.4s ease-in-out infinite;
}

.xingxiaoyou-webpet.is-site .xy-motion-dragging-sway {
  animation: xyRound4DraggingSway 0.58s ease-in-out infinite;
}

.xingxiaoyou-webpet.is-site .xy-motion-drag-settle {
  animation: xyRound4DragSettle 0.7s ease-out 1;
}

@keyframes xyRound4IdleFloat {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(0, -10px, 0) rotate(-1deg); }
}

@keyframes xyRound4RemindNod {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  35% { transform: translate3d(0, -8px, 0) rotate(3deg) scale(1.015); }
  65% { transform: translate3d(0, -2px, 0) rotate(-1deg) scale(1.005); }
}

@keyframes xyRound4HappyHop {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  38% { transform: translate3d(0, -22px, 0) scale(1.045); }
  68% { transform: translate3d(0, -5px, 0) scale(0.995); }
}

@keyframes xyRound4DoneSettle {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  30% { transform: translate3d(0, -16px, 0) rotate(-2deg) scale(1.035); }
  58% { transform: translate3d(0, -6px, 0) rotate(2deg) scale(1.012); }
}

@keyframes xyRound4HeadTilt {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(0, -4px, 0) rotate(-5deg); }
}

@keyframes xyRound4DraggingSway {
  0% { transform: translate3d(0, 0, 0) rotate(-6deg) scale(1.035); }
  50% { transform: translate3d(0, -8px, 0) rotate(6deg) scale(1.055); }
  100% { transform: translate3d(0, 0, 0) rotate(-6deg) scale(1.035); }
}

@keyframes xyRound4DragSettle {
  0% { transform: translate3d(0, -8px, 0) rotate(4deg) scale(1.045); }
  55% { transform: translate3d(0, 4px, 0) rotate(-2deg) scale(0.99); }
  100% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
}

@media (max-width: 560px) {
  .xingxiaoyou-webpet.is-site {
    width: 224px;
    min-height: 260px;
    overflow: visible !important;
  }

  .xingxiaoyou-webpet.is-site .xingxiaoyou-sprite-wrap {
    width: 174px;
    height: 174px;
    padding: 9px;
  }

  .xingxiaoyou-webpet.is-site .xingxiaoyou-sprite {
    width: 156px;
    height: 156px;
    max-width: 156px;
    max-height: 156px;
  }

  .xingxiaoyou-webpet.is-site[data-webpet-mode="collapsed"] {
    width: 64px;
    min-height: 64px;
  }

  .xingxiaoyou-webpet.is-site[data-webpet-mode="collapsed"] .xingxiaoyou-sprite-wrap {
    width: 64px;
    height: 64px;
    padding: 4px;
  }

  .xingxiaoyou-webpet.is-site[data-webpet-mode="collapsed"] .xingxiaoyou-sprite {
    width: 56px;
    height: 56px;
    max-width: 56px;
    max-height: 56px;
  }
}

/* P6.0 Round 5: visible-pixel hitbox. The position root is no longer the sprite frame. */
.xingxiaoyou-webpet.is-site {
  left: auto;
  top: auto;
  right: auto;
  bottom: auto;
  width: var(--xy-hitbox-w, 130px) !important;
  height: var(--xy-hitbox-h, 150px) !important;
  min-width: 0 !important;
  min-height: 0 !important;
  display: block !important;
  place-items: initial !important;
  overflow: visible !important;
  contain: none !important;
}

.xingxiaoyou-webpet.is-site .xingxiaoyou-drag-hitbox {
  position: relative;
  z-index: 3;
  width: var(--xy-hitbox-w, 130px);
  height: var(--xy-hitbox-h, 150px);
  overflow: visible !important;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
}

.xingxiaoyou-webpet.is-site.is-dragging .xingxiaoyou-drag-hitbox {
  cursor: grabbing;
}

.xingxiaoyou-webpet.is-site .xingxiaoyou-sprite-wrap {
  position: absolute !important;
  left: calc(-1 * var(--xy-frame-offset-x, 0px)) !important;
  top: calc(-1 * var(--xy-frame-offset-y, 0px)) !important;
  width: var(--xy-frame-w, 230px) !important;
  height: var(--xy-frame-h, 230px) !important;
  max-width: none !important;
  max-height: none !important;
  padding: 0 !important;
  display: block !important;
  overflow: visible !important;
  pointer-events: none;
}

.xingxiaoyou-webpet.is-site .xingxiaoyou-sprite {
  display: block;
  width: var(--xy-frame-w, 230px) !important;
  height: var(--xy-frame-h, 230px) !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}

.xingxiaoyou-webpet.is-site .xingxiaoyou-shadow {
  display: none !important;
}

.xingxiaoyou-webpet.is-site .xingxiaoyou-bubble {
  position: absolute !important;
  right: auto !important;
  bottom: auto !important;
  left: var(--xy-bubble-left, -220px) !important;
  top: var(--xy-bubble-top, -150px) !important;
  z-index: 4;
  transform: none !important;
  overflow: visible;
}

.xingxiaoyou-webpet.is-site[data-webpet-bubble-placement="right"] .xingxiaoyou-bubble::after {
  left: -12px;
  right: auto;
  top: var(--xy-bubble-arrow-y, 36px);
  bottom: auto;
  transform: rotate(135deg);
}

.xingxiaoyou-webpet.is-site[data-webpet-bubble-placement="left"] .xingxiaoyou-bubble::after {
  right: -12px;
  left: auto;
  top: var(--xy-bubble-arrow-y, 36px);
  bottom: auto;
  transform: rotate(-45deg);
}

.xingxiaoyou-webpet.is-site[data-webpet-bubble-placement="top"] .xingxiaoyou-bubble::after {
  left: var(--xy-bubble-arrow-x, 50%);
  right: auto;
  bottom: -12px;
  transform: translateX(-50%) rotate(45deg);
}

.xingxiaoyou-webpet.is-site[data-webpet-bubble-placement="bottom"] .xingxiaoyou-bubble::after {
  top: -12px;
  bottom: auto;
  left: var(--xy-bubble-arrow-x, 50%);
  right: auto;
  transform: translateX(-50%) rotate(225deg);
}

.xingxiaoyou-debug-bounds {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  font: 12px/1.2 Arial, sans-serif;
}

.xingxiaoyou-debug-bounds__box {
  position: fixed;
  border: 2px solid rgba(18, 101, 255, 0.9);
  background: rgba(18, 101, 255, 0.05);
}

.xingxiaoyou-debug-bounds__box[data-kind="hitbox"] {
  border-color: rgba(0, 150, 105, 0.95);
  background: rgba(0, 150, 105, 0.07);
}

.xingxiaoyou-debug-bounds__box[data-kind="sprite"] {
  border-color: rgba(230, 126, 34, 0.95);
  background: rgba(230, 126, 34, 0.06);
}

.xingxiaoyou-debug-bounds__box[data-kind="clamp"] {
  border-color: rgba(190, 70, 210, 0.95);
  background: rgba(190, 70, 210, 0.04);
}

.xingxiaoyou-debug-bounds__label {
  position: absolute;
  left: 0;
  top: -18px;
  padding: 2px 5px;
  background: rgba(18, 24, 38, 0.88);
  color: #fff;
  white-space: nowrap;
}

/* P6.0 Round 6: mount the old source assets directly, no sprite-frame cropping. */
.xingxiaoyou-webpet.is-site {
  width: var(--xy-stage-w, 180px) !important;
  height: var(--xy-stage-h, 180px) !important;
  min-width: 0 !important;
  min-height: 0 !important;
  z-index: 120 !important;
  overflow: visible !important;
  contain: none !important;
  transform: none !important;
}

.xingxiaoyou-webpet.is-site .xingxiaoyou-drag-hitbox {
  width: var(--xy-stage-w, 180px) !important;
  height: var(--xy-stage-h, 180px) !important;
  overflow: visible !important;
}

.xingxiaoyou-webpet.is-site .xingxiaoyou-sprite-wrap {
  position: relative !important;
  left: 0 !important;
  top: 0 !important;
  width: var(--xy-stage-w, 180px) !important;
  height: var(--xy-stage-h, 180px) !important;
  padding: 0 !important;
  overflow: visible !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: center !important;
}

.xingxiaoyou-webpet.is-site .xingxiaoyou-sprite {
  display: block !important;
  width: var(--xy-source-w, 180px) !important;
  height: var(--xy-source-h, 180px) !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center bottom !important;
  overflow: visible !important;
  animation: none !important;
  transform: translate3d(0, var(--xy-state-y, 0px), 0);
  transform-origin: center bottom !important;
  filter: drop-shadow(0 10px 10px rgba(74, 52, 36, 0.14));
}

.xingxiaoyou-webpet.is-site[data-webpet-mode="collapsed"] {
  width: var(--xy-stage-w, 76px) !important;
  height: var(--xy-stage-h, 76px) !important;
}

@media (max-width: 560px) {
  .xingxiaoyou-webpet.is-site,
  .xingxiaoyou-webpet.is-site[data-webpet-mode="collapsed"] {
    width: var(--xy-stage-w, 56px) !important;
    height: var(--xy-stage-h, 56px) !important;
  }
}

.xingxiaoyou-webpet.is-site .xy-motion-source-hover {
  animation: xyRound6SourceHover 0.72s ease-in-out infinite !important;
}

.xingxiaoyou-webpet.is-site .xy-motion-dragging-sway {
  animation: xyRound7DragHop 0.46s ease-in-out infinite !important;
}

.xingxiaoyou-webpet.is-site .xy-motion-drag-settle {
  animation: xyRound7DragSettle 0.48s ease-out 1 !important;
}

@keyframes xyRound6SourceHover {
  0%, 100% { transform: translate3d(0, var(--xy-state-y, 0px), 0) scale(1); }
  45% { transform: translate3d(0, calc(var(--xy-state-y, 0px) - 8px), 0) scale(1); }
  70% { transform: translate3d(0, calc(var(--xy-state-y, 0px) - 2px), 0) scale(1); }
}

@keyframes xyRound6SourceDrag {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-4deg) scale(1.02); }
  50% { transform: translate3d(0, -7px, 0) rotate(4deg) scale(1.04); }
}

@keyframes xyRound7DragHop {
  0%, 100% { transform: translate3d(0, var(--xy-state-y, 0px), 0) rotate(-2deg) scale(1); }
  38% { transform: translate3d(0, calc(var(--xy-state-y, 0px) - 8px), 0) rotate(2deg) scale(1); }
  68% { transform: translate3d(0, calc(var(--xy-state-y, 0px) - 3px), 0) rotate(-1deg) scale(1); }
}

@keyframes xyRound7DragSettle {
  0% { transform: translate3d(0, calc(var(--xy-state-y, 0px) - 7px), 0) rotate(2deg) scale(1); }
  60% { transform: translate3d(0, calc(var(--xy-state-y, 0px) + 2px), 0) rotate(-1deg) scale(0.995); }
  100% { transform: translate3d(0, var(--xy-state-y, 0px), 0) rotate(0deg) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .xingxiaoyou-webpet.is-site .xy-motion-source-hover,
  .xingxiaoyou-webpet.is-site .xy-motion-dragging-sway,
  .xingxiaoyou-webpet.is-site .xy-motion-drag-settle {
    animation-duration: 1.2s !important;
    animation-iteration-count: 1 !important;
  }
}
