// compress: true, sourceMap: true
p-previewer {
    display: block;
    position: relative;
    background-color: #fff; // transition: all ease .3s;

    pre-page,
    .presize_con {
        display: block;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
    }

    pre-size {
        display: block;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        z-index: 2;
    }

    pre-page {
        display: none;

        &[selected="1"] {
            outline: #3a89b6 solid 2px;
        }

        >[xv-content] {
            width: 100%;
            height: 100%;
        }
    }

    >[xv-content] {
        width: 100%;
        height: 100%;
    }

    &.changeScreen {
        transition: all ease .3s;

        * {
            transition: all ease .3s;
        }
    }

    .locksize,
    .lockbox {
        width: 30px;
        height: 30px;
        background-image: url(img/tuxiangsuofangfuben.svg);
        background-position: center;
        background-repeat: no-repeat;
        background-size: 16px auto;
    }

    .lockbox {
        background-image: url(img/suoding.svg);
    }

    .pre_ele_outer {
        // display: block;
        display: flex;
        justify-content: flex-start;
        align-items: flex-start;
        position: absolute;
        width: 100%;
        height: 100%;
        left: 0;
        top: 0;
        pointer-events: none;

        .pre_ele_con {
            position: absolute;
            cursor: default;
        }

        &[hor="center"] {
            justify-content: center;
        }

        &[hor="end"] {
            justify-content: flex-end;
        }

        &[ver="center"] {
            align-items: center;
        }

        &[ver="end"] {
            align-items: flex-end;
        }

        .pre_ele {
            // box-sizing: border-box;
            position: absolute;
            width: 100%;
            height: 100%;
            outline: #aaa dashed 1px;
            pointer-events: auto;
        }

        &[selected="1"] {
            z-index: 3;

            .pre_ele {
                outline: none;

                pre-size {
                    box-sizing: border-box;
                    border: #3a89b6 solid 2px;
                }

                .resize_tool {
                    display: block;
                }
            }

            >.point {
                background-color: #fb4747;
            }

            &[ver="start"][hor="start"] {
                >.point[point-name="1"] {
                    display: block;
                }

                pre-size {
                    .point[point-name="1"] {
                        display: block;
                        background-color: #36e963;
                    }
                }
            }

            &[ver="start"][hor="center"] {
                >.point[point-name="2"] {
                    display: block;
                }

                pre-size {
                    .point[point-name="2"] {
                        display: block;
                        background-color: #36e963;
                    }
                }
            }

            &[ver="start"][hor="end"] {
                >.point[point-name="3"] {
                    display: block;
                }

                pre-size {
                    .point[point-name="3"] {
                        display: block;
                        background-color: #36e963;
                    }
                }
            }

            &[ver="center"][hor="start"] {
                >.point[point-name="8"] {
                    display: block;
                }

                pre-size {
                    .point[point-name="8"] {
                        display: block;
                        background-color: #36e963;
                    }
                }
            }

            &[ver="center"][hor="center"] {
                >.point[point-name="0"] {
                    display: block;
                }

                pre-size {
                    .point[point-name="0"] {
                        display: block;
                        background-color: #36e963;
                    }
                }
            }

            &[ver="center"][hor="end"] {
                >.point[point-name="4"] {
                    display: block;
                }

                pre-size {
                    .point[point-name="4"] {
                        display: block;
                        background-color: #36e963;
                    }
                }
            }

            &[ver="end"][hor="start"] {
                >.point[point-name="7"] {
                    display: block;
                }

                pre-size {
                    .point[point-name="7"] {
                        display: block;
                        background-color: #36e963;
                    }
                }
            }

            &[ver="end"][hor="center"] {
                >.point[point-name="6"] {
                    display: block;
                }

                pre-size {
                    .point[point-name="6"] {
                        display: block;
                        background-color: #36e963;
                    }
                }
            }

            &[ver="end"][hor="end"] {
                >.point[point-name="5"] {
                    display: block;
                }

                pre-size {
                    .point[point-name="5"] {
                        display: block;
                        background-color: #36e963;
                    }
                }
            }

            pre-size {
                .point {
                    display: block;
                }

                .line {
                    // display: none;
                    position: absolute; // background-color: rgba(255, 0, 0, .1);
                    z-index: 10;
                }

                [line-name="top"] {
                    left: 10px;
                    top: -6px;
                    width: ~"calc(100% - 20px)";
                    height: 11px;
                    cursor: row-resize;
                }

                [line-name="bottom"] {
                    left: 10px;
                    bottom: -6px;
                    width: ~"calc(100% - 20px)";
                    height: 11px;
                    cursor: row-resize;
                }

                [line-name="right"] {
                    right: -6px;
                    top: 10px;
                    width: 11px;
                    height: ~"calc(100% - 20px)";
                    cursor: col-resize;
                }

                [line-name="left"] {
                    left: -6px;
                    top: 10px;
                    width: 11px;
                    height: ~"calc(100% - 20px)";
                    cursor: col-resize;
                }
            }
        }

        .pre_context {
            position: relative;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            word-break: break-all;

            >img {
                display: block;
                width: 100%;
                height: 100%;
            }
        }

        .resize_tool {
            display: none;
            font-size: 9px;
            position: absolute;
            right: 0;
            top: 0;
            color: #e2e2e2;

            .resize_block {
                position: absolute;
                right: 0;
                top: 0;
                opacity: 0;
                // height: 20px;
                // line-height: 20px;
                // padding: 0 6px;
                margin-top: 5px;
                border-radius: 3px;
                letter-spacing: 0;
                text-align: center;
                background-color: rgba(0, 0, 0, .2);
                box-shadow: rgba(255, 255, 255, 0.452) 0 0 2px;
                cursor: pointer;
                filter: grayscale(100%);

                &:nth-child(1) {
                    animation: resize_block_anime ease .3s;
                    animation-delay: 0;
                    animation-fill-mode: forwards;
                }

                &:nth-child(2) {
                    animation: resize_block_anime ease .3s;
                    animation-delay: .07s;
                    animation-fill-mode: forwards;
                }
            }
        }

        .resize_block.lockbox {
            top: -40px;
        }

        .resize_block.locksize {
            right: -35px;
        }

        &[lockbox="1"] {
            .resize_block.lockbox {
                filter: grayscale(0%);
            }

            pre-size {

                [point-name="2"],
                [point-name="4"],
                [point-name="6"],
                [point-name="8"] {
                    display: none;
                }

                .line {
                    display: none;
                }
            }
        }

        &[locksize="1"] {
            .resize_block.locksize {
                filter: grayscale(0%);
            }
        }

        @keyframes resize_block_anime {
            0% {
                transform: translate(0, 10px);
                opacity: 0;
            }

            100% {
                transform: translate(0, 0);
                opacity: 1;
            }
        }
    }

    .point {
        display: none;
        position: absolute;
        width: 8px;
        height: 8px;
        border-radius: 7px;
        background-color: rgb(36, 129, 182);
        z-index: 2;
    }

    [point-name="0"] {
        left: ~"calc(50% - 5px)";
        top: ~"calc(50% - 5px)";
    }

    [point-name="1"] {
        left: -5px;
        top: -5px;
        cursor: nwse-resize;
    }

    [point-name="2"] {
        left: ~"calc(50% - 5px)";
        top: -5px;
        cursor: row-resize;
    }

    [point-name="3"] {
        right: -5px;
        top: -5px;
        cursor: nesw-resize;
    }

    [point-name="4"] {
        right: -5px;
        top: ~"calc(50% - 5px)";
        cursor: col-resize;
    }

    [point-name="5"] {
        right: -5px;
        bottom: -5px;
        cursor: nwse-resize;
    }

    [point-name="6"] {
        right: ~"calc(50% - 5px)";
        bottom: -5px;
        cursor: row-resize;
    }

    [point-name="7"] {
        left: -5px;
        bottom: -5px;
        cursor: nesw-resize;
    }

    [point-name="8"] {
        left: -5px;
        top: ~"calc(50% - 5px)";
        cursor: col-resize;
    }

    .movearea {
        // 拖拽移动区域
        position: absolute;
        z-index: 10;
        top: 10px;
        left: 10px;
        width: ~"calc(100% - 20px)";
        height: ~"calc(100% - 20px)"; // background-color: rgba(127, 255, 212, 0.315);
        cursor: move;
    }

    .textInpueEle {
        position: absolute;
        left: -2px;
        top: -2px;
        width: 100%;
        height: 100%;
        z-index: 2;
        background-color: transparent;
        border: none;
        resize: none;
        word-break: break-all;
        letter-spacing: 0;
    }
}