/* ==========================================================================
   preview.css —— 模板预览全屏层
   对应 弹层('预览层') + #预览页 模板
   ========================================================================== */

.preview-layer {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  animation: previewIn .18s ease-out;
}

@keyframes previewIn { from { opacity: 0; } to { opacity: 1; } }

/* 遮罩沿用弹层的 rgba(0,0,0,.9)：页面内容仍隐约可见 */
.preview-layer { background: rgba(0, 0, 0, .9); }

/* 弹层的滚动锁：fixed 定位 + top 负偏移，位置不丢 */
.no-scroll {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

.preview-close {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 10px 10px 13px;
  margin-right: 20px;
  background: none;
  border: none;
  font-size: 16px;
  border-radius: 15px;
  cursor: pointer;
  color: #fff;
}

.preview-layer.is-light .preview-close { color: #000; }

.preview-close svg { width: 24px; height: 24px; display: block; }

.preview-stage {
  height: calc(100% - 77px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 10px 10px;
  text-align: center;
  position: relative;
}

.preview-stage.is-light { background: #f2f2f2; }

.preview-stage img {
  display: inline-block;
  max-height: 100%;
  max-width: 100%;
  vertical-align: middle;
  border-radius: 4px;
}

.preview-stage video {
  object-fit: contain;
  width: 100%;
  height: 100%;
  max-height: 100%;
  max-width: 100%;
}

.preview-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 2;
}

.preview-play.is-hidden { display: none; }

.preview-bar {
  flex: 0 0 77px;
  height: 77px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  text-align: center;
  background-color: #333;
  border-top: 1px solid hsla(0, 0%, 100%, .06);
}

.preview-layer.is-light .preview-bar { background-color: #fff; }

.preview-bar .btn-create {
  flex: 1;
  display: inline-block;
  padding: 13px 10px;
  color: #fff;
  background-color: var(--c-buy);
  font-size: 16px;
  border-radius: 15px;
  text-align: center;
  cursor: pointer;
}

.preview-bar .btn-create:active { opacity: .88; }
