/* Footer QR codes: a restrained blue halo. */
body:not(.yichen-beautify-no-qr-glow) .footer-miniimg img,
body:not(.yichen-beautify-no-qr-glow) .footer-miniimg-2 img {
    border-radius: 4px;
    box-shadow: 0 0 0 2px rgba(37, 131, 255, 0.2), 0 0 12px rgba(37, 131, 255, 0.5);
    animation: yichen-beautify-qr-glow 2.8s ease-in-out infinite;
}

/* Theme header and footer logos: move a soft highlight across the image. */
body:not(.yichen-beautify-no-logo-shine) .header .navbar-logo,
body:not(.yichen-beautify-no-logo-shine) .mobile-header .navbar-logo,
body:not(.yichen-beautify-no-logo-shine) .footer-logo {
    position: relative;
    display: inline-block;
    overflow: hidden;
    vertical-align: middle;
}

body:not(.yichen-beautify-no-logo-shine) .header .navbar-logo::after,
body:not(.yichen-beautify-no-logo-shine) .mobile-header .navbar-logo::after,
body:not(.yichen-beautify-no-logo-shine) .footer-logo::after {
    position: absolute;
    top: -30%;
    left: -45%;
    width: 34%;
    height: 160%;
    content: "";
    pointer-events: none;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.78), transparent);
    transform: skewX(-22deg);
    animation: yichen-beautify-logo-shine 5s ease-in-out infinite;
}

@keyframes yichen-beautify-qr-glow {
    0%,
    100% {
        box-shadow: 0 0 0 2px rgba(37, 131, 255, 0.18), 0 0 9px rgba(37, 131, 255, 0.38);
    }

    50% {
        box-shadow: 0 0 0 3px rgba(37, 131, 255, 0.34), 0 0 17px rgba(37, 131, 255, 0.7);
    }
}

@keyframes yichen-beautify-logo-shine {
    0% {
        transform: translateX(-170%) skewX(-22deg);
    }

    28%,
    100% {
        transform: translateX(440%) skewX(-22deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    body:not(.yichen-beautify-no-qr-glow) .footer-miniimg img,
    body:not(.yichen-beautify-no-qr-glow) .footer-miniimg-2 img,
    body:not(.yichen-beautify-no-logo-shine) .header .navbar-logo::after,
    body:not(.yichen-beautify-no-logo-shine) .mobile-header .navbar-logo::after,
    body:not(.yichen-beautify-no-logo-shine) .footer-logo::after {
        animation: none;
    }
}

.yichen-member-notice-stack {
    position: fixed;
    z-index: 99999;
    right: 16px;
    bottom: 16px;
    display: flex;
    width: min(300px, calc(100vw - 32px));
    height: 120px;
    overflow: hidden;
    pointer-events: none;
}

.yichen-member-notice-track {
    display: flex;
    width: 100%;
    flex-direction: column;
    gap: 6px;
    will-change: transform;
}

.yichen-member-notice {
    box-sizing: border-box;
    display: flex;
    width: 100%;
    height: 36px;
    min-height: 36px;
    flex: 0 0 36px;
    align-items: center;
    gap: 7px;
    padding: 6px 9px;
    color: #713716;
    background: linear-gradient(110deg,
        rgba(255, 240, 186, var(--yichen-member-notice-pc-opacity, 1)),
        rgba(255, 211, 154, var(--yichen-member-notice-pc-opacity, 1)) 62%,
        rgba(255, 183, 133, var(--yichen-member-notice-pc-opacity, 1)));
    border: 1px solid #f2a35e;
    border-left: 4px solid #f0643b;
    border-radius: 7px;
    box-shadow: 0 6px 20px rgba(186, 82, 31, 0.28);
    animation: none;
}

.yichen-member-notice.is-entering:not(.is-next) {
    animation: yichen-member-notice-in 480ms cubic-bezier(.2, .75, .25, 1) both;
}

.yichen-member-notice.is-exiting {
    opacity: 0;
    transform: translateY(-9px);
    transition: opacity 420ms ease, transform 420ms ease;
}

.yichen-member-notice.is-next {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 480ms ease, transform 480ms ease;
}

.yichen-member-notice.is-next.is-entering {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 100ms;
}

.yichen-member-notice::before {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    content: "";
    background: #f0643b;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(240, 100, 59, 0.15);
}

.yichen-member-notice-message {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.3;
    text-overflow: clip;
    white-space: nowrap;
}

.yichen-member-notice-name {
    color: #a33f22;
    font-weight: 700;
}

.yichen-member-notice-tier {
    color: #743514;
    font-weight: 700;
}

.yichen-member-notice-amount {
    display: inline-block;
    flex: 0 0 auto;
    margin-left: auto;
    padding: 2px 4px;
    color: #fff;
    background: #d94d37;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.yichen-member-notice.is-diamond {
    background: linear-gradient(110deg,
        rgba(255, 233, 173, var(--yichen-member-notice-pc-opacity, 1)),
        rgba(255, 200, 142, var(--yichen-member-notice-pc-opacity, 1)) 62%,
        rgba(255, 169, 139, var(--yichen-member-notice-pc-opacity, 1)));
    border-left-color: #da4c65;
}

.yichen-member-notice.is-diamond::before {
    background: #da4c65;
    box-shadow: 0 0 0 4px rgba(218, 76, 101, 0.15);
}

@keyframes yichen-member-notice-in {
    0% { opacity: 0; transform: translate(16px, 8px); }
    55% { opacity: 0.55; }
    to { opacity: 1; transform: translate(0, 0); }
}

@media (max-width: 600px) {
    .yichen-member-notice-stack {
        right: 10px;
        bottom: 12px;
        width: min(300px, calc(100vw - 20px));
        height: 78px;
        display: flex;
        justify-content: flex-end;
    }

    .yichen-member-notice-track {
        width: max-content;
        max-width: 100%;
        align-items: flex-end;
    }

    .yichen-member-notice {
        width: max-content;
        max-width: 100%;
        height: 36px;
        min-height: 36px;
        flex-basis: 36px;
        gap: 6px;
        padding: 4px 6px;
        border-radius: 6px;
        background: rgba(255, 203, 151, var(--yichen-member-notice-mobile-opacity, 0.3));
        border-color: rgba(242, 163, 94, 0.44);
        box-shadow: 0 2px 8px rgba(130, 63, 31, 0.06);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }

    .yichen-member-notice.is-diamond {
        background: rgba(255, 185, 155, var(--yichen-member-notice-mobile-opacity, 0.3));
        border-left-color: rgba(218, 76, 101, 0.64);
    }

    .yichen-member-notice-message {
        flex: 0 1 auto;
        font-size: 9px;
    }

    .yichen-member-notice-amount {
        margin-left: 4px;
        padding: 1px 3px;
        font-size: 9px;
        background: rgba(217, 77, 55, 0.86);
    }
}

@media (prefers-reduced-motion: reduce) {
    .yichen-member-notice.is-entering:not(.is-next) {
        animation-duration: 1ms;
    }
}
