:root {
  color-scheme: light;
  --screen-width: 1125;
  --screen-height: 2436;
  --screen-radius: 150;
  --phone-width: 1268;
  --phone-height: 2572;
  --slide-duration: 560ms;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  background: #effbfe;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.preview-page,
.carousel {
  width: 100%;
  min-height: 100svh;
}

.preview-page {
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, .86), rgba(237, 250, 253, .94)),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(37, 116, 145, .05) 80px),
    repeating-linear-gradient(0deg, transparent 0 79px, rgba(37, 116, 145, .05) 80px);
}

.carousel {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  outline: none;
  cursor: grab;
  touch-action: pan-y;
}

.carousel.is-dragging { cursor: grabbing; }

.active-phone {
  width: min(40vw, 460px, calc(90svh * var(--phone-width) / var(--phone-height)));
  aspect-ratio: var(--phone-width) / var(--phone-height);
}

.phone-composition {
  position: relative;
  width: 100%;
  aspect-ratio: var(--phone-width) / var(--phone-height);
  margin: 0;
  filter: drop-shadow(0 28px 38px rgba(21, 60, 77, .2));
  user-select: none;
}

.phone-screen {
  position: absolute;
  z-index: 1;
  left: calc(72 / var(--phone-width) * 100%);
  top: calc(68 / var(--phone-height) * 100%);
  width: calc(var(--screen-width) / var(--phone-width) * 100%);
  height: calc(var(--screen-height) / var(--phone-height) * 100%);
  overflow: hidden;
  border-radius: calc(var(--screen-radius) / var(--screen-width) * 100% / (var(--screen-height) / var(--screen-width)));
  background: #fff;
}

.layer,
.theme-stage,
.theme-layer {
  position: absolute;
  display: block;
  pointer-events: none;
}

.theme-stage {
  inset: 0;
  overflow: visible;
}

.theme-stage--skin { z-index: 1; }
.theme-stage--banner { z-index: 4; }

.theme-layer--skin {
  inset: 0;
  width: 100%;
  height: 100%;
}

.layer--product {
  z-index: 2;
  left: 0;
  top: var(--product-top-percent);
  width: 100%;
  height: auto;
  transition: top var(--slide-duration) cubic-bezier(.22, .75, .18, 1);
}

.layer--ui {
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
}

.theme-layer--banner {
  left: var(--banner-left-percent);
  top: var(--banner-top-percent);
  width: var(--banner-width-percent);
  height: var(--banner-height-percent);
  object-fit: fill;
  background: transparent;
}

.theme-layer {
  transform: translateX(0);
  will-change: transform;
}

.theme-layer.is-entering-next { transform: translateX(100%); }
.theme-layer.is-entering-previous { transform: translateX(-100%); }
.theme-layer.is-leaving-next { transform: translateX(-100%); }
.theme-layer.is-leaving-previous { transform: translateX(100%); }
.theme-layer.is-animating {
  transition: transform var(--slide-duration) cubic-bezier(.22, .75, .18, 1);
}

.phone-frame {
  position: absolute;
  z-index: 6;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

@media (max-width: 760px) {
  .active-phone { width: min(82vw, 390px); }
}

@media (prefers-reduced-motion: reduce) {
  :root { --slide-duration: 1ms; }
}

html.is-embedded,
html.is-embedded body,
html.is-embedded .preview-page,
html.is-embedded .carousel { width: 100%; height: 100%; min-height: 0; }
html.is-embedded body,
html.is-embedded .preview-page { background: transparent; }
html.is-embedded .active-phone { width: 100%; }
html.is-embedded .phone-composition { filter: none; }
