/* ============================================================
   animations.css — 动效
   灯火呼吸、虚位灯提示、暖尘上浮、显形与减动效降级
   ============================================================ */

/* 点亮灯泡的呼吸发光 */
@keyframes bulb-breath {

    0%,
    100% {
        filter: brightness(0.92);
    }

    50% {
        filter: brightness(1.18);
    }

}

/* 未接线灯位的空壳呼吸 */
@keyframes wip-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(240, 180, 92, 0.35);
    }

    50% {
        box-shadow: 0 0 0 7px rgba(240, 180, 92, 0);
    }

}

/* 暖尘自下而上飘过光柱 */
@keyframes ember-rise {

    0% {
        transform: translate3d(0, 0, 0);
        opacity: 0;
    }

    12% {
        opacity: 0.85;
    }

    100% {
        transform: translate3d(18px, -70vh, 0);
        opacity: 0;
    }

}

/* 热茶蒸汽升腾 */
@keyframes steam-rise {

    0% {
        opacity: 0;
        transform: translateY(4px);
    }

    35% {
        opacity: 0.75;
    }

    100% {
        opacity: 0;
        transform: translateY(-12px);
    }

}

/* 吊灯点亮瞬间的弹跳 */
@keyframes lamp-pop {

    0% {
        transform: scale(0.4);
    }

    60% {
        transform: scale(1.35);
    }

    100% {
        transform: scale(1);
    }

}

/* 元素入场显形初始态 */
.reveal {
    opacity: 0;

    transform: translate3d(0, 26px, 0);

    transition: opacity 0.7s ease, transform 0.7s ease;

}

/* 元素入场显形完成态 */
.reveal.is-visible {
    opacity: 1;

    transform: translate3d(0, 0, 0);

}

/* 点亮吊灯逐盏呼吸 */
.lamp .lamp-bulb {
    animation: bulb-breath 3.2s ease-in-out infinite;

}

/* 各盏灯错开呼吸相位 */
.lamp:nth-child(2n) .lamp-bulb {
    animation-delay: 0.9s;

}

.lamp:nth-child(3n) .lamp-bulb {
    animation-delay: 1.7s;

}

/* 虚位灯改为空壳呼吸提示 */
.lamp.is-wip .lamp-bulb {
    animation: wip-pulse 2.8s ease-in-out infinite;

}

/* 暖尘微粒统一升腾 */
.ambient .ember {
    animation: ember-rise 12s linear infinite;

}

/* 蒸汽统一升腾 */
.tea .steam {
    animation: steam-rise 3.2s ease-in-out infinite;

}

/* 点亮灯位的弹跳表现 */
.lamp.pop .lamp-bulb {
    animation: lamp-pop 0.5s ease;

}


/* 减动效偏好下全部动画静止 */
@media (prefers-reduced-motion: reduce) {

    /* 关闭全部关键帧动画 */
    *,
    *::before,
    *::after {
        animation: none !important;

        transition: none !important;

    }

    /* 显形元素直接可见 */
    .reveal {
        opacity: 1;

        transform: none;

    }

}
