#obito-live2d-stage {
    position: fixed;
    bottom: env(safe-area-inset-bottom, 0px);
    left: 40px;
    width: 250px;
    height: 200px;
    z-index: 99999;
    pointer-events: none;
    perspective: 1000px;
    overflow: visible;
    will-change: transform;
    transition: transform .75s cubic-bezier(.2,.8,.2,1), opacity .2s ease;
}
/* 透明不等于不可点击：作品打开时连同子元素一起退出命中区域。 */
body.modal-open #obito-live2d-stage { opacity: 0; visibility: hidden; }
body.modal-open #obito-live2d-stage,
body.modal-open #obito-live2d-stage * { pointer-events: none; }
#obito-live2d-stage.is-escaping { transform: translate3d(-92px,-8px,0); }
#obito-live2d-stage.is-peeking { transform: translate3d(-40px,-8px,0); }
#obito-live2d-stage.is-returning { transform: translate3d(0,0,0); }
#obito-live2d-stage.is-peeking #obito-character { animation: none; }
#obito-character {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
    transform-style: preserve-3d;
    animation: obitoBreathe 3s ease-in-out infinite;
    transition: transform .1s cubic-bezier(.2,.8,.2,1);
}
.obito-img {
    width: 55%;
    height: auto;
    display: block;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,.3));
    pointer-events: auto;
    cursor: pointer;
    transition: transform .3s, opacity .2s;
    user-select: none;
    -webkit-user-drag: none;
}
.obito-img.is-eating {
    animation: obitoMunch .48s ease-in-out infinite;
    transform-origin: 50% 62%;
}
.obito-img.is-hit { animation: obitoHitShake .3s cubic-bezier(.36,.07,.19,.97) both; }
.obito-bubble {
    position: absolute;
    top: -65px;
    left: 20px;
    z-index: 100;
    padding: 12px 18px;
    border: 2px solid #eee;
    border-radius: 20px;
    background: #fff;
    color: #333;
    box-shadow: 0 5px 15px rgba(0,0,0,.1);
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(10px);
    transition: .3s;
    pointer-events: none;
}
.obito-bubble::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 25px;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: #fff transparent;
}
#obito-character:hover + .obito-bubble { opacity: 1; transform: translateY(0); }
#obito-live2d-stage.is-escaping .obito-bubble { opacity: 0 !important; }
#obito-live2d-stage.is-peeking .obito-bubble { left: 62px; }
.obito-carrot-crumb {
    position: absolute;
    left: var(--x);
    top: var(--y);
    z-index: 6;
    pointer-events: none;
    font-size: var(--s);
    filter: drop-shadow(0 2px 5px rgba(0,0,0,.18));
    animation: obitoCrumbPop .85s ease-out forwards;
}
.obito-heart-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}
.obito-heart-layer.back { z-index: 0; }
.obito-heart-layer.front { z-index: 2; }
.ob-heart-bubble {
    position: absolute;
    left: 0;
    top: 0;
    font-size: var(--size,16px);
    opacity: 0;
    filter: drop-shadow(0 6px 10px rgba(0,0,0,.15));
    will-change: transform, opacity;
    animation: obitoHeartFloat var(--dur,4200ms) ease-out forwards;
}
:root {
    --cursor-size: 34px;
    --cursor-ring: 10px;
    --cursor-name-bg: rgba(255,255,255,.92);
    --cursor-name-color: #222;
    --cursor-shadow: 0 10px 26px rgba(0,0,0,.18);
}
.ob-cursor {
    position: absolute;
    left: 0;
    top: 0;
    margin-left: calc(var(--cursor-size) * -.5);
    margin-top: calc(var(--cursor-size) * -.5);
    z-index: 999999;
    display: grid;
    place-items: center;
    pointer-events: none;
    will-change: transform;
    transform: translate3d(-9999px,-9999px,0);
}
.ob-cursor__glow {
    position: absolute;
    width: calc(var(--cursor-size) + var(--cursor-ring));
    height: calc(var(--cursor-size) + var(--cursor-ring));
    border-radius: 999px;
    background: radial-gradient(circle,color-mix(in srgb,var(--c-color) 55%,transparent) 0%,transparent 60%);
    filter: blur(2px);
    opacity: .8;
}
.ob-cursor__core {
    width: var(--cursor-size);
    height: var(--cursor-size);
    display: grid;
    place-items: center;
    border: 2px solid rgba(255,255,255,.9);
    border-radius: 999px;
    background: radial-gradient(circle at 30% 25%,rgba(255,255,255,.95),rgba(255,255,255,.4) 40%,rgba(255,255,255,.15) 70%),var(--c-color);
    box-shadow: var(--cursor-shadow);
    backdrop-filter: blur(6px);
    color: rgba(0,0,0,.7);
    font-size: 18px;
    font-weight: 800;
    transform-origin: 50% 60%;
}
.ob-cursor.is-me .ob-cursor__core {
    box-shadow: 0 14px 34px rgba(0,0,0,.22),0 0 0 2px rgba(255,255,255,.85) inset;
}
.ob-cursor__name {
    position: absolute;
    top: calc(var(--cursor-size) + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 10px;
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 999px;
    background: var(--cursor-name-bg);
    color: var(--cursor-name-color);
    box-shadow: 0 6px 18px rgba(0,0,0,.12);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    opacity: .9;
}
.ob-cursor.is-hover .ob-cursor__core {
    transform: scale(1.2);
    background: rgba(255,255,255,.1);
    border-color: #00eaff;
    border-width: 3px;
}
.ob-cursor.is-pressed .ob-cursor__core {
    transform: scale(.8) !important;
    transition: transform .1s;
    filter: brightness(.9);
}
.ob-cursor.is-feeding .ob-cursor__core,
.ob-cursor.is-carrot-ready .ob-cursor__core {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    font-size: 45px;
    line-height: 45px;
    transform-origin: center bottom;
    animation: obitoFeedShake .4s infinite alternate ease-in-out;
}
.ob-cursor.is-feeding .ob-cursor__name,
.ob-cursor.is-carrot-ready .ob-cursor__name { opacity: 0; }
.ob-trail {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 999998;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--c-color);
    box-shadow: 0 10px 18px rgba(0,0,0,.12);
    pointer-events: none;
    will-change: transform,opacity;
    animation: obTrail .7s ease-out forwards;
}
.hit-particle {
    position: fixed;
    z-index: 1000000;
    pointer-events: none;
    font-size: 24px;
    animation: obitoHitPop .4s ease-out forwards;
}
@keyframes obitoBreathe {
    0%,100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.03); }
}
@keyframes obitoMunch {
    0%,100% { transform: translateY(0) rotate(0) scale(1); }
    35% { transform: translateY(2px) rotate(-2deg) scale(.96,1.03); }
    70% { transform: translateY(-1px) rotate(2deg) scale(1.03,.98); }
}
@keyframes obitoCrumbPop {
    0% { opacity: 0; transform: translate(0,0) scale(.4) rotate(0); }
    20% { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--dx),var(--dy)) scale(1.1) rotate(var(--r)); }
}
@keyframes obitoHitShake {
    10%,90% { transform: translate3d(-2px,2px,0) scale(.85); }
    20%,80% { transform: translate3d(4px,-2px,0) scale(1); }
    30%,50%,70% { transform: translate3d(-6px,0,0) scale(1); }
    40%,60% { transform: translate3d(6px,0,0) scale(1); }
}
@keyframes obitoFeedShake {
    0% { transform: rotate(15deg) scale(1.1); }
    100% { transform: rotate(-15deg) scale(1.1); }
}
@keyframes obTrail {
    0% { opacity: .75; transform: translate3d(var(--x),var(--y),0) scale(1); }
    100% { opacity: 0; transform: translate3d(var(--x),var(--y),0) scale(.15); }
}
@keyframes obitoHeartFloat {
    0% { opacity: 0; transform: translate(-50%,-50%) translate(var(--dx,0),18px) scale(.2) rotate(var(--rot,0)); }
    12%,85% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%,-50%) translate(calc(var(--dx) * 1.8),calc(-1 * var(--rise,180px))) scale(1.25) rotate(calc(var(--rot,0deg) + 10deg)); }
}
@keyframes obitoHitPop {
    0% { opacity: 1; transform: translate(-50%,-50%) scale(.5); }
    50% { transform: translate(-50%,-50%) scale(1.5); }
    100% { opacity: 0; transform: translate(-50%,-50%) scale(1.2); }
}
@media (pointer:fine) {
    html,body,a,button,input,textarea,select,label,
    #obito-live2d-stage,#obito-character,.obito-img { cursor: none !important; }
}
@media (pointer:coarse) {
    .ob-cursor { display: none; }
}
@media (prefers-reduced-motion:reduce) {
    #obito-character,.obito-img,.ob-cursor { animation: none !important; }
    .ob-trail { display: none !important; }
}
