@image-link-url: '/src/assets/images/editor/icon_link_editor.png';

.wrap-phone-privew {
  .ant-modal {
    .ant-modal-close {
      inset-inline-end: 17px;
      top: 0px;
      right: 0;
    }

    .ant-modal-content {
      background: url('@/assets/images/phone_6.7.png') no-repeat;
      background-size: 100% 100%;
      box-shadow: none;
      height: 1003px;
      border-radius: 48px;
      padding: 36px 32px 34px 32px;
    }
    .priview-modal {
      padding-top: 40px;
      width: 430px;
      height: 932px;
      position: relative;
    }
  }

  .phone-body {
    flex: 1;
    height: 100%;
    overflow: hidden;
    box-sizing: border-box;
    overflow: hidden;
    width: 430px;
    border-radius: 30px;

  }
  .previee-container {
    height: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 0 0 40px;
    .chapter-head-title {
      height: 44px;
      line-height: 44px;
      border-bottom: 1px solid #efefef;
      
      h2 {
        font-size: 18px;
        text-align: left;
        height: 44px;
        white-space: nowrap;
        text-overflow: ellipsis;
        font-weight: 600;
        overflow: hidden;
        padding-right: 10px;
        align-items: center;
        &.tree {
          display: flex;
          justify-content: space-between;
          .no {
            display: block;
            flex: 1;
            max-width: calc(100% - 50px);
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
          }
          .menu {
            flex: 0 0 40px;
            display: block;
            text-align: right;
          }
        }
        .ant-btn {
          padding-right: 0;
          padding: 0 5px;
          margin-left: 5px;
        }

        .ant-space {
          width: 98%;
          overflow: hidden;
          .ant-space-item:nth-child(2) {
            width: 98%;
            overflow: hidden;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
          }
          .in {
          }
        }
        .no {
          padding-left: 20px;
        }
        .menu {
          cursor: pointer;
        }
      }
    }
    .preview-content-it {
      flex: 1;
      position: relative;
      height: calc(100% - 45px);
      overflow: hidden;
      .preview-content-show {
        overflow-x: hidden;
        overflow-y: auto;
        height: calc(100% - 45px);
      }
      * {
        line-height: 1.5;
        font-family: "黑体";
      }
      .preview-content-html {
        padding-bottom: 50px;

        .chapter-practice, .chapter-expand, .chapter-item-section, .chapter-item-header, .chapter-gallery-container {
          margin-top: 15px;
          margin-bottom: 15px;
          &.chapter-expand-inline, &.chapter-gallery-inline {
            margin-top: 0;
            margin-bottom: 0;
            margin-top: -3px !important;
          }
        }
        .tooltip-icon {
          margin-top: -3px !important;
        }
      }
      .table-container {
        padding: 10px;
      }
      span {
        vertical-align: middle;
      }
      table {
        border-collapse: collapse;
        margin-left: 10px;
        margin-right: 10px;
        width: calc(100% - 20px) !important;
      }
      table th {
        font-weight: 700;
        background-color: #f5f2f0;
      }
      table th,
      table td {
        border: 1px solid #ddd;
        padding: 5px;
        font-size: 18px;
      }
      div[data-w-e-type=video] {
        margin: 10px;
      }
      p[data-slate-node]:not(:empty) {
        margin: 15px 10px;
      }
      p {
        line-height: 1.5;
        font-size: 18px;
        font-family: '黑体';
        margin: 15px 10px;
        img {
          height: auto;
          max-width: 100%;
        }
        > img {
          vertical-align: middle;
          + span {
            vertical-align: middle;
            padding-top: 4px;
            line-height: 1.5;
          }
        }
      }

      // 预览题库
      .chapter-practice {
        margin: 0 10px;
        position: relative;
        cursor: pointer;
      }
      .practice-insert-topic {
        padding: 10px 10px 30px;
        .topic_style {
          h3 {
            font-size: 18px;
            color: #333;
            line-height: 20px;
            margin-bottom: 10px;
          }
        }
        .practice-item {
          padding: 10px 0;
          .topic-choose-title {
            display: flex;
            align-items: first baseline;
            margin-bottom: 10px;
            .index {
              display: block;
              flex: 0 0 18px;
              line-height: 24px;
            }
            p {
              display: inline;
              margin: 0;
            }
            img {
              max-height: 60px !important;
              max-width: 100% !important;
              width: auto !important;
              height: auto !important;
              vertical-align: middle;
            }
          }
          .topic_choose-list {
            .topic_choose-item {
              padding: 3px 3px 3px 10px;
              display: flex;
              .choose-ico {
                flex: 0 0 20px;
                align-items: baseline;
                padding-top: 2px;
                .ico {
                  display: inline-block;
                  width: 18px;
                  height: 18px;
                  vertical-align: text-top;
                  background-size: cover;
                  background-repeat: no-repeat;
                  &.checkbox {
                    background-image: url('@/assets/images/editor/icon_checkbox_normal.png');
                  }
                  &.radio {
                    background-image: url('@/assets/images/editor/icon_radio_normal.png');
                  }
                }
              }
            }
            .topic_content {
              margin-left: 5px;
              display: flex;
              align-items: first baseline;
              flex: 1;
              .correct {
                flex: 0 0 18px;
                display: block;
              }
              p {
                margin: 0;
                display: inline;
                vertical-align: top;
                img {
                  max-width: 50% !important;
                  height: auto;
                }
              }
            }
          }
        }
      }
      pre {
        white-space: pre-wrap;
        word-break: break-all;
        word-wrap: break-word;
        line-height: 20px;
        font-size: 14px;
        padding: 10px;
        color: #333;
        background-color: #f5f2f0;
        margin: 15px 0;
      }

      blockquote {
        padding: 10px;
        line-height: 20px;
        font-size: 14px;
        background-color: #f5f2f0;
        border-left: 5px solid #b4d5ff;
        margin: 15px 0;
      }

      a {
        color: #aa1941;
        &:link,
        &:visited,
        &:hover {
          color: #aa1941;
        }
        span {
          color: #aa1941 !important;
        }
        &::after {
          content: '';
          background-size: cover;
          background-image: url(@image-link-url); // 使用 Less 变量
          width: 14px;
          height: 14px;
          display: inline-block;
          margin: 0 5px;
          vertical-align: text-bottom;
        }
      }

      h1 {
        line-height: 40px;
        font-size: 24px;
      }
      h2 {
        line-height: 34px;
        font-size: 20px;
      }
      h3 {
        line-height: 28px;
        font-size: 18px;
      }
      h4 {
        line-height: 22px;
        font-size: 16px;
      }
      h5 {
        line-height: 18px;
        font-size: 14px;
      }
      h6 {
        line-height: 16px;
        font-size: 12px;
      }
      video,
      audio {
        width: 100%;
      }
      .chapter-image-pic {
        img {
          width: 100%;
          height: auto;
        }
      }

      .w-e-image-container {
        img {
          &:not([style]) {
            width: auto;
          }
          width: 100%;
        }
      }

      // 画廊
      .chapter-gallery-container {
        cursor: pointer;
        .chapter-gallery-item {
          width: 50%;
          padding: 10px;
          box-sizing: border-box;
          text-align: center;
          &.one {
            width: 100%;
          }
          p {

          }
          img {
            height: auto;
            width: 100%;
          }
          &.one {
            img {
              max-width: 100%;
              height: auto;
              width: 100%;
            }
          }
        }

        &.chapter-gallery-inline {
          display: inline-block;
          vertical-align: middle;
          cursor: pointer;
        }
      }

      .chapter-item-tooltip, .chapter-item-link, .chapter-gallery-inline, .chapter-expand-inline {
        text-indent: 0;
        svg {
          text-indent: 0;
        }
      }

      .chapter-item-link {
        display: inline !important;
      }

      // 画廊展示
      .gallery-prview-container {
        .gallery-img {
          max-height: 300px;
          height: 300px;
          width: 100%;
          text-align: center;
          display: flex;
          align-items: center;
          position: relative;
          text-align: center;
          justify-content: center;
          &.noData {
            text-align: center;
            padding-top: 40px;
            color: #999;
            font-size: 18px;;
          }
          .opa {
            position: absolute;
            top: 50%;
            background-repeat: no-repeat;
            background-size: cover;
            width: 32px;
            height: 32px;
            margin-top: -16px;
            cursor: pointer;
            &.prev {
              left: 10px;
              background-image: url('@/assets/images/editor/icon_preview_prev.png');
            }
            &.next {
              right: 10px;
              background-image: url('@/assets/images/editor/icon_preview_next.png');
            }
          }
          img {
            max-width: 100%;
            max-height: 300px;
            // width: 100%;
            // height: auto;
          }
        }

        .controll {
          padding: 20px;
          display: flex;
          justify-content: space-between;
        }
        .steps {
          padding: 0 10px;
          text-align: right;
          color: #999;
        }
        .title {
          padding: 12px 10px;
          font-size: 20px;
          line-height: 28px;
          margin-bottom: 5px;
          border-bottom: 1px solid #f1f1f1;
          white-space: pre-wrap;
          word-wrap: break-word;
          word-break: break-all;
        }
        .desc {
          padding: 0 10px;
          font-size: 16px;
          line-height: 28px;
          color: #999;
          white-space: pre-wrap;
          word-wrap: break-word;
          word-break: break-all;
        }
      }

      .chapter-expand {
        margin: 0 10px;
      }

      // 扩展内容
      .expand-content {
        padding-bottom: 25px;
      }

      .img-preview {
        text-align: center;
        padding-top: 50px;
        img {
          width: 100%;
        }
      }
      
      li, dd, dt, blockquote {
        font-size: 18px;
        font-family: "黑体";
        line-height: 1.5;
        margin: 15px 0;
      }
      ol {
        margin: 0 10px 0 28px;
        li {
          padding-left: 5px;
          span {
            vertical-align: initial;
          }
        }
      }
      ul {
        margin: 0px 10px 0 30px;
        li {
          span {
            vertical-align: initial;
          }
        }
      }

      .preview-content-other {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
        background-color: #fff;
      }
    }

    // 气泡
    .tooltip {
      position: absolute;
      width: 70%;
      max-width: 80%;
      // min-width: 50%;
      top: 10%;
      left: 00%;
      background-color: #fff;
      border: 1px solid #d2d2d2;
      border-radius: 5px;
      // opacity: 0;
      transition: 0.2s opacity linear;
      z-index: -1;
      box-shadow: 0 0 15px 1px rgba(122, 122, 122, 0.8);
      .square {
        width: 0px;
        height: 0px;
        position: absolute;
        left: 0;
        z-index: 10002;
        &::before {
          width: 0px;
          height: 0px;
          position: absolute;
          border: 9px solid transparent;
          content: '';
          padding: 0;
        }
        &::after {
          width: 0px;
          height: 0px;
          position: absolute;
          content: '';
          border: 10px solid transparent;
        }
        &.square_top {
          top: 0px;
          &::before {
            top: -17px;
            left: 3px;
            border-color: transparent transparent #fff transparent;
            z-index: 12;
          }
          &::after {
            top: -20px;
            left: 2px;
            border-color: transparent transparent #d2d2d2 transparent;
            z-index: 10;
          }
        }
        &.square_bottom {
          bottom: 0px;
          &::before {
            top: -1px;
            left: -19px;
            border-color: #fff transparent transparent transparent;
            z-index: 12;
          }
          &::after {
            top: 0px;
            left: -20px;
            border-color: #d2d2d2 transparent transparent transparent;
            z-index: 10;
          }
        }
      }
      .tooltip-content-container {
        padding: 5px;
      }
      .tooltip-content {
        .content {
          line-height: 22px;
          min-height: 22px;
          overflow-x: hidden;
          overflow-y: auto;
          max-height: 140px;
          padding: 5px;
          p {
            white-space: pre-wrap;
            word-wrap: break-word;
            word-break: break-all;
            margin: 0;
          }
        }
        .content-opa {
          border-top: 1px solid #ebebeb;
          padding-top: 5px;
          display: flex;
          justify-content: flex-end;
          align-items: center;
          .c-link {
            max-width: 60px;
            text-overflow: ellipsis;
            white-space: nowrap;
            overflow: hidden;
            height: 18px;
            line-height: 18px;
          }
          a:link,
          a:visited,
          a:hover {
            font-size: 14px;
            display: inline-block;
            margin-left: 10px;
            color: #aa1941;
          }
          a {
            img {
              width: 18px;
              height: 18px;
            }
          }
        }
      }
    }
  }
}

.priview-drawer-container {
  height: 932px;
  top: 42px;
  left: 0px;
  width: 430px;
  border-radius: 15px 0 40px 40px;
  overflow: hidden;
  .priview-drawer-header {
    padding: 10px;
  }
  .priview-drawer-body {
    padding: 10px;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }
}
