/*!
 * 子比订单弹幕 - 前端样式
 */

.zib-danmaku-root {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 9990;
    pointer-events: none;
    overflow: hidden;
    transition: opacity .35s ease;
    -webkit-tap-highlight-color: transparent;
}

.zib-danmaku-root.zib-danmaku-top {
    top: var(--dmk-offset, 90px);
}

.zib-danmaku-root.zib-danmaku-bottom {
    bottom: var(--dmk-offset, 90px);
}

.zib-danmaku-root.is-hidden {
    opacity: 0;
    visibility: hidden;
}

.zib-danmaku-stage {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.zib-danmaku-item {
    position: absolute;
    left: 0;
    top: 0;
    display: -webkit-inline-box;
    display: inline-flex;
    -webkit-box-align: center;
    align-items: center;
    gap: 6px;
    max-width: 82vw;
    padding: 3px 13px 3px 3px;
    border-radius: 999px;
    background: rgba(15, 23, 42, var(--dmk-bg-alpha, .62));
    color: #fff;
    font-size: var(--dmk-fs, 14px);
    line-height: 1.5;
    font-weight: 400;
    letter-spacing: .2px;
    white-space: nowrap;
    pointer-events: auto;
    cursor: default;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .16);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    will-change: transform;
    transform: translate3d(100vw, 0, 0);
    text-shadow: 0 1px 1px rgba(0, 0, 0, .2);
}

.zib-danmaku-item .zib-danmaku-avatar {
    display: block;
    width: 1.72em;
    height: 1.72em;
    flex: 0 0 auto;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, .22);
    border: 1px solid rgba(255, 255, 255, .18);
}

.zib-danmaku-item .zib-danmaku-text {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.zib-danmaku-item.no-avatar {
    padding-left: 13px;
}

/* 开关按钮 */
.zib-danmaku-toggle {
    position: fixed;
    left: 12px;
    bottom: 12px;
    z-index: 9991;
    display: -webkit-inline-box;
    display: inline-flex;
    -webkit-box-align: center;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 6px 12px;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, .55);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    font-family: inherit;
    cursor: pointer;
    opacity: .5;
    transition: opacity .25s ease, background .25s ease;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

.zib-danmaku-toggle:hover,
.zib-danmaku-toggle:focus-visible {
    opacity: 1;
}

.zib-danmaku-toggle.is-off {
    background: rgba(15, 23, 42, .3);
    opacity: .4;
}

.zib-danmaku-toggle-dot {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, .22);
    transition: background .25s ease, box-shadow .25s ease;
}

.zib-danmaku-toggle.is-off .zib-danmaku-toggle-dot {
    background: #9ca3af;
    box-shadow: none;
}

@media (max-width: 768px) {
    .zib-danmaku-toggle {
        bottom: 66px;
        padding: 5px 10px;
        font-size: 11px;
    }

    .zib-danmaku-item {
        max-width: 88vw;
    }
}

@media print {
    .zib-danmaku-root,
    .zib-danmaku-toggle {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .zib-danmaku-root {
        display: none !important;
    }
}
