@keyframes disappear {
  to {
    opacity: 0;
  }
}

@keyframes appear {
  from {
    opacity: 0;
  }
}

.#{$ns}ImageGallery {
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  border-radius: 0;

  //Aug
  // max-width: 1010px !important; 
  width: 100% !important;
  overflow: hidden;

  &-close {
    position: absolute;
    // right: 0;
    // top: 0;
    // color: rgba(255, 255, 255, 0.8);
    cursor: pointer;

    // Aug
    height: 50px;
    width: 50px;
    background-color: #4f4f4f;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 12px;
    right: 12px;
    z-index: 10;

    &:hover {
      color: #fff;
    }

    > svg {
      // Aug 16 -> 24
      width: px2rem(24px);
      height: px2rem(24px);
    }
  }

  @media screen and (max-width: 768px) {
    &-close {
      height: 24px;
      width: 24px;
      svg {
        width: 1rem;
        height: 1rem;
      }
    }
  }

  &-title {
    height: px2rem(30px);
    vertical-align: top;
    line-height: px2rem(30px);
    font-size: px2rem(12px);
    color: var(--white);
    text-align: center;
  }

  &-main {
    // background: #000; //Aug
    flex-basis: 0;
    flex-grow: 1;
    height: 0;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;

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

  &-prevBtn,
  &-nextBtn {
    > svg {
      width: px2rem(48px);
      height: px2rem(48px);
    }

    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #999;
    text-shadow: rgba(0, 0, 0, 0.3) 0px 0px 4px;

    &:hover {
      color: #fff;
      text-shadow: rgba(0, 0, 0, 0.5) 0px 0px 4px;
    }
    animation-name: disappear;
    animation-delay: var(--animation-duration);
    animation-duration: var(--animation-duration);
    animation-fill-mode: both;

    &.is-disabled {
      pointer-events: none;
    }
  }

  &-main:hover &-prevBtn,
  &-main:hover &-nextBtn {
    animation-name: appear;
    animation-delay: 0s;
    animation-duration: var(--animation-duration);
  }

  &-prevBtn {
    left: var(--gap-md);
  }

  &-nextBtn {
    right: var(--gap-md);
  }

  &-footer {
    height: px2rem(74px);
    background: #222;
    display: flex;
    flex-direction: row;
    user-select: none;

    position: relative; // Aug
  }

  &-prevList,
  &-nextList {
    width: var(--gap-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;

    background: rgba(0, 0, 0, 0.3);
    color: #fff;

    &.is-disabled {
      background: rgba(0, 0, 0, 0.3);
      color: rgba(255, 255, 255, 0.1);
      pointer-events: none;
    }

    &:hover {
      background: rgba(0, 0, 0, 1);
      color: #fff;
    }
  }

  &-itemsWrap {
    flex-grow: 1;
    flex-basis: 0;
    width: 0;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    display: flex;
  }

  &-items {
    display: inline-block;
    white-space: nowrap;
  }

  &-item {
    margin: 10px 5px;
    width: 54px;
    height: 54px;
    display: inline-flex;
    position: relative;
    border: 1px solid #666;
    justify-content: center;
    align-items: center;
    cursor: pointer;

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

    @supports (object-fit: cover) {
      > img {
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
    }

    &:after {
      position: absolute;
      content: '';
      display: block;
      background: rgba(0, 0, 0, 0.5);
      z-index: 1;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
    }

    &:hover {
      border: 1px solid #e5e5e5;
      &:after {
        display: none;
      }
    }

    &.is-active {
      border: 1px solid var(--primary);
      &:after {
        display: none;
      }
    }
  }

  // Aug
  .absoluteCenterWrapper {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 0;
    overflow: hidden;
  }
}


.preview-modal {
	bottom: 10px;

	.ant-modal-content {
		background: #ffffff;
		overflow: hidden;
		box-shadow: 0 12px 32px 0 rgba(0,0,0,0.24); /* 阴影效果 */
		border-radius: 4px;
    
    .ant-modal-header {
			background-color: #F7F8FA !important;
      .dialog-title {
        padding: 6px 16px !important;
        .disabled-move-title {
          font-size: 14px !important;
        }
      }
		}
		.preview-close {
			font-size: 26px;
			padding: 14px;
			background-color: #4f4f4f;
			color: white;
		}

		.ant-modal-body {
			display: flex;
			justify-content: center;
			position: relative;
			padding: 0 !important;

			.preview-body {
        position: relative;
				display: flex;
				width: 100%;
				height: 100%;
				flex-direction: column;
        overflow: hidden;
        .arrow-icon {
          position: absolute;
          z-index: 1;
          top: 40%;
          font-size: 40px;
          cursor: pointer;
          color: #ccc;
          transition: all .2s ease;
          &:hover {
            color: #fff;
            background-color: rgba(0, 0, 0, 0.3);
          }
          &.disabled {
            color: #ccc;
            cursor: not-allowed;
            .icon {
              cursor: not-allowed;
            }
            &:hover {
              background-color: transparent;
            }
          }
          &.l {
            left: -8px;
          }
          &.r {
            right: -8px;
          }
        }
				// 表格体
				.preview-pdf-container {
					// overflow-y: scroll;
					.preview-pdf,
					.preview-image {
						box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.07); /* 阴影效果 */
						display: flex;
						align-items: center;
						overflow: auto;

						&::-webkit-scrollbar {
							display: none;
						}
					}

					.preview-pdf-page {
						height: 100%;
						overflow: auto;

						&::-webkit-scrollbar {
							display: none;
						}
					}
				}
        .preview-box-fileName {
          position: sticky;
          bottom: 40px;
          text-align: center;
          height: 20px;
          line-height: 20px;
          // background: rgba(0, 0, 0, 0.8);
          // color: #fff;
          background: #F7F8FA;
          &.showList {
            bottom: 104px;
          }
        }
				.preview-tools {
          box-sizing: border-box;
					position: sticky;
					bottom: 0;
					background-color: #fff;
					z-index: 1;
					display: flex;
					justify-content: center;
					align-items: center;
					width: 100%;
          height: 40px;
					min-height: 40px;
					border-top: 1px solid #f0f0f0;
          
					&-item {
						display: flex;
						justify-content: center;
						padding: 0;
						margin-right: 32px;
						width: 20px;
						height: 20px;
            background: transparent !important;
						
						.icon {
							width: 20px;
							height: 20px;
							color: black;
						}

						&-index {
							position: relative;
              padding-top: 1px;
              margin-right: 20px;
							font-weight: 500;
							font-size: 16px;
							// line-height: 20px;
              display: block;
              width: 55px;
						}
            &.checked {
              .icon {
                color: #2a87eb;
              }
            }
            &.disabled {
              .icon {
                color: #dbdbdb;
                cursor: not-allowed;
              }
            }
					}
				}
				.preview-scroll-container {
					// width: 100%;
					// height: 100%;
					display: flex;
					align-items: center;
					justify-content: center;
					// overflow: hidden;
          
          .file-preview-handler {
            cursor: move;
            transition: all .1s ease;
            user-select: none;
          }
				}
				.ant-image-img {
          object-fit: contain;
					width: auto;
          max-width: 100%;
          max-height: 100%;
				}
        
        .mediaShowList {
          position: sticky;
          bottom: 40px;
          height: initial;
          // min-height: 88px;
          min-height: 64px;
          // background-color: rgba(0, 0, 0, 0.8);
          background-color: #F7F8FA;
          .imgList-arrow {
            color: #666;
          }
        }
			}
		}
	}
}

.mb-images-preview {
	z-index: 9999;
}

.mb-pdf-preview {
	height: 100vh;
	width: 100vw;
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	right: 0;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	background-color: white;

	.react-transform-wrapper {
		flex: 1;
	}

	&-header {
		background-color: white;
		color: black;
		width: 100%;
	}

	&-doc {
		overflow: hidden;
		flex: 1;
	}

	&-page {
		margin-top: 8px;

		&:first-child {
			margin-top: 0;
		}
	}
}
