﻿/* PC预览模式 */
.preview-mode {
    .edit-controls,
    .btn-edit,
    .edit-top,
    .component-title,
    .add-item,
    .btn-del,
    .edit-top-placeholder,
    .column-droppable:empty:before,
    .placeholder-text,
    .component-big-title .btn-edit-big-title,
    .custom-html-editor,
    .btn-edit-content {
        display: none;
    }
    .btn-zoom,
    .btn-zoom-video,
    .custom-html-preview {
        display: block !important;
    }
}
/* 手机预览样式 */
.mobile-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    .custom-slider-container {
        .swiper-slide {
            display: none;
            &.swiper-slide-active {
                display: block;
            }
        }
    }
    .edit-canvas {
        padding: 0 10px;
    }
    .mobile-preview-device {
        position: relative;
        width: 395px;
        height: 730px;
        background: #111;
        border-radius: 40px;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
        padding: 10px;
        box-sizing: border-box;
    }
    .mobile-tip {
        position: fixed;
        top: 10px;
        left: 0;
        right: 0;
        color: #fff;
        text-align: center;
        font-size: 14px;
    }

    .mobile-preview-screen {
        position: relative;
        width: 100%;
        height: 100%;
        background: #fff;
        border-radius: 30px;
        overflow: hidden;
        overflow-y: auto;

        &::-webkit-scrollbar {
            width: 0;
        }
        .mobile-preview-content {
            padding: 52px 0 0;
            .layout-bg-video{
                z-index: 0 !important;
            }
            .header-box {
                position: absolute;
                box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            }
            header {
                border-width: 1px !important;
                .wp {
                    height: 50px;
                    .logo {
                        width: 80px;
                        height: 50px;
                        line-height: 50px;
                        margin-right: 10px;
                        margin-left: 10px;
                    }
                    .menuBtn{
                        display: block;
                    }
                    .nav-list {
                        display: none;
                        ul {
                            .nav-item {
                                a {
                                    font-size: 14px;
                                    width: 60px;
                                    height: 30px;
                                    line-height: 30px;
                                    border-radius: 4px;
                                }
                            }
                        }
                    }
                    .layui-nav {
                        .layui-nav-item {
                            > a {
                                font-size: 14px;
                                width: 60px;
                                height: 30px;
                                line-height: 30px;
                                border-radius: 4px;
                            }
                        }
                    }
                }
            }
            .layout-container {
                .big-title-content {
                    h2 span {
                        font-size: 24px !important;
                    }
                }
                .btn-zoom-video {
                    background-size: 30px auto;
                }
                .arrow {
                    width: 25px;
                    height: 40px;
                    background-size: 10px auto;
                    border-radius: 10px;
                    &.prev {
                        left: 10px;
                    }
                    &.next {
                        right: 10px;
                    }
                }
                .module-container + .module-container {
                    margin-top: 0;
                }
                .component-title {
                    display: none;
                }
                .edit-top,
                .placeholder-text,
                .edit-controls {
                    display: none;
                }
                .search-module {
                    padding: 0;
                    .search-results {
                        margin: 0;
                        .card-list-container {
                            .title-box {
                                padding: 10px 0;
                                .tit1 {
                                    font-size: 18px;
                                }
                                .tit2 {
                                    font-size: 14px;
                                }
                            }
                        }
                    }
                }

                .column-droppable,
                .layout-container,
                .module-container {
                    border: 0;
                }
                .nav-list {
                    display: none;
                }
                .tag-cloud {
                    padding: 12px;
                    border-radius: 8px;
                }
                .hot-image-container {
                    padding-top: 100%;
                    .hot-image-item {
                        border-radius: 10px;
                        &.hot-image-item1 {
                            width: 100%;
                            height: 58.5%;
                        }
                        &.hot-image-item2 {
                            top: auto;
                            bottom: 0;
                            right: auto;
                            left: 0;
                            width: 49%;
                            height: 40%;
                        }
                        &.hot-image-item3 {
                            width: 49%;
                            height: 40%;
                        }
                        .hot-image-info {
                            bottom: 10px;
                            left: 20px;
                            right: 20px;
                            text-align: justify;
                        }
                    }
                }
                .layout-container,
                .frame-container {
                    width: 100%;
                    margin-bottom: 15px;
                }
                .edit-controls {
                    display: none;
                }
                .placeholder-text {
                    display: none;
                }
                /* 通用布局调整 */
                .layout-row {
                    display: flex;
                    flex-direction: column; /* 强制垂直堆叠 */
                    flex-wrap: nowrap;
                    margin: 0; /* 重置栏间距的margin设置 */
                    position: relative;
                }

                .layout-column {
                    width: 100%; /* 强制单列 */
                    flex: none; /* 覆盖原来的flex: 1 */
                    margin: 0 0 0 0; /* 重置栏间距，只保留底部间距 */
                    padding-left: 0; /* 重置padding栏间距 */
                    padding-right: 0; /* 重置padding栏间距 */
                }

                /* 模块通用调整 - 让模块内的元素撑满宽度 */
                .diy-module {
                    width: 100%;
                    box-sizing: border-box;
                }
                /* 标签搜索组件调整 */
                .search-module {
                    .tag-search-input {
                        height: 40px;
                        padding: 0 40px 0 16px;
                        font-size: 12px;
                        border-width: 2px !important;
                        box-shadow: none !important;
                    }
                    .tag-search-btn {
                        width: 30px;
                        height: 30px;
                        margin-top: -15px;
                        right: 5px;
                        background-size: 16px auto;
                    }
                }
                /* 轮播推荐调整 */
                .recommend-list-container {
                    margin: 0 -3px;
                    .swiper-wrapper {
                        height: auto !important;
                        .swiper-slide {
                            width: 50% !important;
                            padding: 0 3px !important;
                        }
                        .card-content {
                            h3 {
                                font-size: 14px !important;
                                margin-top: 5px;
                            }
                            p {
                                font-size: 14px !important;
                            }
                        }
                    }
                }
                /* 轮播图调整 */
                .swiper-container{
                    width: 100% !important;
                }
                .swiper-wrapper {
                    height: auto !important;
                }

                .custom-slider-container {
                    .swiper-slide {
                        width: 100% !important;
                    }
                    .slider-image {
                        .txt {
                            left: 12%;
                            right: 12%;
                            h3 {
                                font-size: 14px !important;
                            }
                            p {
                                font-size: 14px !important;
                            }
                        }
                    }
                }
                .normal-list-container {
                    .card-list {
                        margin-bottom: 0;
                        margin-left: -3px !important;
                        margin-right: -3px !important;
                        .card-item {
                            width: 50%;
                            .card-inner {
                                padding: 6px 6px 18px !important;
                                margin: 0 3px !important;
                            }
                        }
                    }
                }
                .card-list .card-item {
                    margin-bottom: 6px;
                }
                .card-inner {
                    .card-content {
                        padding: 10px !important;
                        h3 {
                            font-size: 14px !important;
                        }
                        p {
                            font-size: 14px !important;
                        }
                    }
                }
                .waterfall-list-container {
                    .card-list {
                        column-count: 2;
                        column-gap: 6px;
                    }
                }
                .swiper-recommend{
                    .card-image{
                        margin-bottom: 10px;
                    }
                }
                /* 瀑布流/图片库布局强制单列 */
                .gallery-container,
                .diy-imagegallery-list {
                    column-count: 1;
                }
                .image-gallery-container {
                    .image-gallery-item {
                        .image-gallery-item-txt {
                            bottom: 10px !important;
                            left: 10px !important;
                            right: 10px !important;
                            .image-gallery-item-title {
                                font-size: 14px !important;
                            }
                            .image-gallery-item-desc {
                                font-size: 14px !important;
                            }
                        }
                    }
                }

                /* 热门图片组件调整 */
                .hot-image-container {
                    display: flex;
                    flex-direction: column;
                    .hot-image-info {
                        .hot-image-title {
                            font-size: 14px !important;
                        }
                        .hot-image-desc {
                            font-size: 14px !important;
                        }
                    }
                    .arrow {
                        top: 28%;
                        &.arrow.next{
                            left: auto;
                        }
                    }
                }
                /* 卡片列表组件 */
                .normal-list-container {
                    .card-list {
                        margin-bottom: -6px;
                        .card-item {
                            .card-inner {
                                border-radius: 8px;
                                .card-image {
                                    border-radius: 8px;
                                }
                            }
                        }
                    }
                }

                /* 搜索标签云调整 */
                .tag-cloud {
                    display: flex;
                    gap: 5px;
                }

                .tag-cloud .tag-item {
                    font-size: 12px;
                    height: 30px;
                    line-height: 30px;
                    width: 32%;
                    margin: 0;
                }

                /* 清除列之间的边框分隔线 */
                .layout-column + .layout-column {
                    border-left: none;
                }
                .column-droppable:empty:before,
                .add-item {
                    display: none !important;
                }
                /* 自定义html组件 */
                .custom-html-container {
                    min-height: 0;
                }
                /* 图文编辑组件 */
                .image-text-container {
                    padding: 0;
                }
            }
        }
    }

    .mobile-preview-notch {
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 150px;
        height: 25px;
        background: #111;
        border-bottom-left-radius: 15px;
        border-bottom-right-radius: 15px;
        z-index: 10;
    }
    .mobile-preview-home {
        position: absolute;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 100px;
        height: 5px;
        background: #333;
        border-radius: 5px;
        z-index: 10;
    }
    .mobile-preview-close {
        position: absolute;
        top: -40px;
        right: -40px;
        width: 36px;
        height: 36px;
        background: #fff;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
        z-index: 11;
    }
    .mobile-preview-close:after,
    .mobile-preview-close:before {
        content: "";
        position: absolute;
        width: 20px;
        height: 2px;
        background: #333;
        transform: rotate(45deg);
    }
    .mobile-preview-close:before {
        transform: rotate(-45deg);
    }
}
