/* Preload images */
body:after {
  content: url(../images/close.png) url(../images/prev.png) url(../images/next.png);
  display: none;
}

.lightboxOverlay {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 9999;
  background-color: black;
  filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
  opacity: 0.8;
  display: none;
}

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  text-align: center;
  line-height: 0;
  font-weight: normal;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox .lb-image {
  display: block;
  height: auto;
  max-width: inherit;
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  -ms-border-radius: 3px;
  -o-border-radius: 3px;
  border-radius: 3px;
}

.lightbox a img {
  border: none;
}

.lb-outerContainer {
  position: relative;
  background-color: white;
  *zoom: 1;
  width: 250px;
  height: 250px;
  margin:5em auto 0.5em auto;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  -ms-border-radius: 4px;
  -o-border-radius: 4px;
  border-radius: 4px;
}

.lb-outerContainer:after {
  content: "";
  display: table;
  clear: both;
}

.lb-container {
  padding: 4px;
}

.lb-loader {
  position: absolute;
  top: 43%;
  left: 0;
  height: 25%;
  width: 100%;
  text-align: center;
  line-height: 0;
}

.lb-cancel {
  display: block;
  width: 32px;
  height: 32px;
  margin: 0 auto;
}

.lb-nav {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  z-index: 10;
}

.lb-container > .nav {
  left: 0;
}

.lb-nav a {
  outline: none;
  background-image: url('data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==');
}

.lb-prev, .lb-next {
  height: 100%;
  cursor: pointer;
  display: block;
}

.lb-nav a.lb-prev {
  width: 34%;
  left: 0;
  float: left;
  background: url(../images/prev.png) left 48% no-repeat;
  filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
  opacity: 0;
  -webkit-transition: opacity 0.6s;
  -moz-transition: opacity 0.6s;
  -o-transition: opacity 0.6s;
  transition: opacity 0.6s;
}

.lb-nav a.lb-prev:hover {
  filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
  opacity: 1;
}

.lb-nav a.lb-next {
  width: 64%;
  right: 0;
  float: right;
  background: url(../images/next.png) right 48% no-repeat;
  filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
  opacity: 0;
  -webkit-transition: opacity 0.6s;
  -moz-transition: opacity 0.6s;
  -o-transition: opacity 0.6s;
  transition: opacity 0.6s;
}

.lb-nav a.lb-next:hover {
  filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
  opacity: 1;
}

.lb-dataContainer {
  margin: 0 auto;
  padding-top: 5px;
  *zoom: 1;
  width: 100%;
  -moz-border-radius-bottomleft: 4px;
  -webkit-border-bottom-left-radius: 4px;
  border-bottom-left-radius: 4px;
  -moz-border-radius-bottomright: 4px;
  -webkit-border-bottom-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

.lb-dataContainer:after {
  content: "";
  display: table;
  clear: both;
}

.lb-data {
  padding: 0 4px;
  color: #ccc;
}

.lb-data .lb-details {
  width: 85%;
  float: left;
  text-align: left;
  line-height: 1.1em;
}

.lb-data .lb-caption {
  font-size: 13px;
    font-weight: 400;
    line-height: 1em;
}

.lb-data .lb-number {
  display: block;
  clear: left;
  padding-bottom: 1em;
  font-size: 12px;
  color: #999999;
}

.lb-data .lb-close {
  display: block;
  float: right;
  width: 34px;
  height: 34px;
  background: none;
  text-align: center;
  outline: none;
  opacity: 0.8;
  -webkit-transition: opacity 0.2s;
  -moz-transition: opacity 0.2s;
  -o-transition: opacity 0.2s;
  transition: opacity 0.2s;
  font-size: 28px;
  line-height: 34px;
  color: #666;
  text-decoration: none;
}

.lb-data .lb-close::before {
  content: "\00d7";
}

.lb-data .lb-close:hover {
  cursor: pointer;
  opacity: 1;
  color: #000;
}

/* 大图预览：约占窗口一半，居中显示 */
.lightbox .lb-outerContainer {
  position: relative;
  width: auto !important;
  height: auto !important;
  max-width: 50vw !important;
  max-height: 50vh !important;
  margin: 0 !important;
}

.lightbox .lb-container {
  position: relative;
}

.lightbox .lb-image {
  width: auto !important;
  height: auto !important;
  max-width: 50vw !important;
  max-height: 50vh !important;
  object-fit: contain;
}

.lightbox .lb-dataContainer {
  width: auto;
  max-width: 50vw;
  margin: 0;
  padding: 0;
  background: transparent;
}

/* 底部默认关闭按钮隐藏，改用图片右上角按钮 */
.lightbox .lb-dataContainer .lb-closeContainer {
  display: none;
}

/* 图片右上角关闭按钮 */
.lightbox .lb-close-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #000;
  color: #fff;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.lightbox .lb-close-overlay:hover,
.lightbox .lb-close-overlay:focus {
  background: #333;
  color: #fff;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.lightbox .lb-close-overlay span[aria-hidden="true"] {
  display: block;
  margin-top: -2px;
}

@media (max-width: 768px) {
  .lightbox .lb-outerContainer {
    max-width: 80vw !important;
    max-height: 50vh !important;
  }

  .lightbox .lb-image {
    max-width: 80vw !important;
    max-height: 50vh !important;
  }

  .lightbox .lb-dataContainer {
    max-width: 80vw;
  }
}
