html, body {
    margin: 0;
    padding: 0;
    background: #101218;
    color: #edf0f5;
    font-family: Arial, sans-serif;
}

.stream-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    max-width: 1480px;
    margin: 0 auto;
    padding: 16px;
}

.stream-panel {
    position: relative;
    min-width: 0;
    overflow: hidden;
    background: #000;
    border-radius: 8px;
}

.stream-single {
    max-width: 1080px;
    margin: 0 auto;
}

.video {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
}

.stream-status {
    position: absolute;
    right: 12px;
    bottom: 12px;
    left: 12px;
    margin: 0;
    padding: 10px 12px;
    border-radius: 4px;
    background: rgba(16, 18, 24, .85);
    font-size: 14px;
    text-align: center;
}

.stream-stage {
    position: relative;
    width: 100%;
    background: #000;
}

.stream-stage .stream-status {
    bottom: 64px;
}

.stream-fullscreen-button {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-height: 44px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 6px;
    background: rgba(16, 18, 24, .8);
    color: #fff;
    font: inherit;
    cursor: pointer;
    touch-action: manipulation;
}

.stream-fullscreen-button svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.stream-fullscreen-button .fullscreen-icon-collapse,
.is-fullscreen .stream-fullscreen-button .fullscreen-icon-expand {
    display: none;
}

.is-fullscreen .stream-fullscreen-button .fullscreen-icon-collapse {
    display: block;
}

.stream-fullscreen-button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
}

html.stream-fullscreen-open,
html.stream-fullscreen-open body {
    overflow: hidden;
    overscroll-behavior: none;
}

.stream-panel.is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    border-radius: 0;
}

.is-fullscreen .stream-stage {
    width: 100%;
    height: 100%;
}

.is-fullscreen .video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 在不能锁定屏幕方向的手机上旋转显示层，按钮随视频一起旋转。 */
@media (orientation: portrait) {
    .is-fullscreen .stream-stage {
        position: absolute;
        top: 50%;
        left: 50%;
        width: var(--fullscreen-height, 100vh);
        height: var(--fullscreen-width, 100vw);
        transform: translate(-50%, -50%) rotate(90deg);
    }
}

@media (max-width: 720px) {
    .stream-grid {
        grid-template-columns: 1fr;
        padding: 8px;
        gap: 8px;
    }
}