/* 定义全局 CSS 变量（放在最顶部） */
:root {
    /* 分享海报背景 */
    --board-bg-img: url("https://vrstatic.realcyun.com/1000166251/media/img/9545fa7c5e944262.png");
}

.vrnewshare-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(0, 0, 0, 0.58);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.vrnewshare-modal {
    width: min(856px, calc(100vw - 24px), calc((100vh - 24px) * 856 / 744));
    max-height: calc(100vh - 24px);
}

.vrnewshare-board {
    position: relative;
    width: 100%;
    aspect-ratio: 856 / 744;
    background: var(--board-bg-img) center center / 100% 100% no-repeat;
    filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.28));
}

/* 全局预加载 */
body::after {
    content: '';
    position: fixed;
    width: 0;
    height: 0;
    visibility: hidden;
    background-image: var(--board-bg-img);
}


.vrnewshare-scene {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.vrnewshare-hidden-block {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.vrnewshare-hidden-tag {
    left: 4%;
    width: 12%;
    height: 46%;
}

.vrnewshare-hidden-prefix {
    left: 14.8%;
    width: 20%;
    height: 7%;
}

.vrnewshare-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.vrnewshare-link-input {
    position: absolute;
    left: 35%;
    width: 57.5%;
    height: 5.7%;
    padding: 0 1.4%;
    border: none;
    outline: none;
    background: transparent;
    box-shadow: none;
    color: #6c5940;
    font-size: clamp(10px, 1.65vw, 16px);
    line-height: 1;
    text-overflow: ellipsis;
    pointer-events: auto;
}

.vrnewshare-link-input:focus {
    box-shadow: inset 0 0 0 1px rgba(114, 82, 50, 0.28);
    border-radius: 10px;
}

.vrnewshare-qrcode-wrap {
    position: absolute;
    left: 21.6%;
    width: 24.5%;
    aspect-ratio: 1 / 1;
    box-sizing: border-box;
}

.vrnewshare-thumb-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #fff;
}

.vrnewshare-action {
    position: absolute;
    left: 54.3%;
    width: 39%;
    height: 7.3%;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.01);
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    pointer-events: auto;
}

.vrnewshare-action:hover {
    background: rgba(120, 77, 51, 0.06);
}

.vrnewshare-action:active {
    background: rgba(120, 77, 51, 0.1);
}

.vrnewshare-action:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(120, 77, 51, 0.18);
}

.vrnewshare-scene-location .vrnewshare-hidden-tag {
    top: 2.2%;
}

.vrnewshare-scene-location .vrnewshare-hidden-prefix {
    top: 3.3%;
}

.vrnewshare-scene-location .vrnewshare-link-input {
    top: 7.45%;
}

.vrnewshare-scene-location .vrnewshare-qrcode-wrap {
    top: 16.65%;
}

.vrnewshare-scene-location .vrnewshare-action-copy {
    top: 16.2%;
}

.vrnewshare-scene-location .vrnewshare-action-screen {
    top: 26.95%;
}

.vrnewshare-scene-location .vrnewshare-action-poster {
    top: 37.55%;
}

.vrnewshare-scene-link .vrnewshare-hidden-tag {
    top: 54.9%;
}

.vrnewshare-scene-link .vrnewshare-hidden-prefix {
    top: 56.1%;
}

.vrnewshare-scene-link .vrnewshare-link-input {
    top: 56.35%;
}

.vrnewshare-scene-link .vrnewshare-qrcode-wrap {
    top: 66.65%;
}

.vrnewshare-scene-link .vrnewshare-action-copy {
    top: 65.2%;
}

.vrnewshare-scene-link .vrnewshare-action-screen {
    top: 75.95%;
}

.vrnewshare-scene-link .vrnewshare-action-poster {
    top: 86.55%;
}

.vrnewshare-poster-picker {
    width: min(620px, calc(100vw - 32px));
    height: auto;
    max-height: calc(100vh - 40px);
    padding: 22px 20px 18px;
    border-radius: 24px;
    background: linear-gradient(180deg, #eef8ff 0%, #dceeff 100%);
    box-shadow: 0 12px 32px rgba(74, 124, 179, 0.18);
    overflow-y: auto;
}

.vrnewshare-poster-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 14px;
}

.vrnewshare-poster-switch span {
    color: #6d5331;
    font-size: 18px;
    min-width: 64px;
    text-align: center;
    font-weight: 700;
}

.vrnewshare-poster-preview {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 420px;
}

#poster-img {
    display: block;
    max-width: calc(100% - 84px);
    max-height: 66vh;
    object-fit: contain;
}

.vrnewshare-picker-generate {
    width: 120px;
    margin: 14px auto 0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    background: linear-gradient(180deg, #67b8ff 0%, #3e8fe6 100%);
    border-radius: 18px;
    box-shadow: 0 8px 18px rgba(62, 143, 230, 0.28);
}

@media (max-width: 900px) {
    .vrnewshare-overlay {
        padding: 10px;
    }

    .vrnewshare-modal {
        width: min(420px, calc(100vw - 20px), calc((100vh - 20px) * 856 / 744));
        max-height: calc(100vh - 20px);
    }

    .vrnewshare-link-input {
        width: 56.8%;
        font-size: clamp(9px, 2.25vw, 12px);
    }

    .vrnewshare-action {
        left: 51.1%;
        width: 39.5%;
        height: 7.6%;
    }

    .vrnewshare-poster-picker {
        width: min(360px, calc(100vw - 20px));
        padding: 14px 12px 12px;
        border-radius: 18px;
    }

    .vrnewshare-poster-switch {
        margin-bottom: 10px;
    }

    .vrnewshare-poster-switch span {
        font-size: 15px;
        min-width: 56px;
    }

    .vrnewshare-poster-preview {
        min-height: 260px;
    }

    #poster-img {
        max-width: calc(100% - 48px);
        max-height: 52vh;
    }

    .vrnewshare-picker-generate {
        width: 96px;
    }
}
