* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* 以常见手机竖屏为设计稿，整页等比缩放，保证各机型构图一致 */
  --design-w: 390;
  --design-h: 844;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --vw: calc(var(--app-vw, 100vw) - var(--safe-l) - var(--safe-r));
  --vh: calc(var(--app-vh, 100dvh) - var(--safe-t) - var(--safe-b));
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #000;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: "PingFang SC", "Hiragino Sans", "Noto Sans JP", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: stretch;
  min-height: 100dvh;
  min-height: 100svh;
  padding: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* 手机：画布铺满视口，背景强制满屏拉伸 */
.phone {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  min-height: var(--app-vh, 100dvh);
  max-width: none;
  margin: 0 auto;
  overflow: hidden;
  background: #000;
  flex: 1 1 auto;
}

.machine {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  line-height: 0;
}

.machine-img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  object-position: center;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.brand {
  position: absolute;
  z-index: 3;
  left: 3%;
  top: 1.4%;
  display: flex;
  align-items: center;
  gap: clamp(4px, 1.5vw, 8px);
  max-width: none;
  width: auto;
  right: auto;
}

.logo {
  display: block;
  width: auto;
  max-width: clamp(48px, 18vw, 72px);
  max-height: clamp(22px, 6.5vw, 28px);
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-title {
  margin: 0;
  font-size: clamp(12px, 3.7vw, 16px);
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
  flex: 0 0 auto;
}

.rich-copy p {
  margin: 0 0 0.25em;
}

.rich-copy ul,
.rich-copy ol {
  margin: 0.2em 0;
  padding-left: 1.2em;
  text-align: left;
}

.rich-copy a {
  color: #9ad7ff;
  word-break: break-all;
}

.layer-block {
  position: absolute;
  z-index: 3;
  box-sizing: border-box;
  text-align: center;
  pointer-events: auto;
}

.top-copy {
  font-size: clamp(11px, 3.3vw, 14px);
  line-height: 1.4;
  word-break: break-word;
  overflow: hidden;
  max-height: 28%;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

.reel-slot {
  position: absolute;
  z-index: 4;
  /* 高度/位置可由后台调节（CSS 变量），默认仍对齐膝盖 */
  left: 5%;
  top: var(--player-top, 40.5%);
  width: 90%;
  height: var(--player-h, 18.5%);
  overflow: hidden;
  background: #000;
  border-radius: clamp(8px, 2.5vw, 12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.reel-slot video,
.reel-slot iframe {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border: 0;
  background: #000;
}

.video-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ddd;
  font-size: clamp(12px, 3.2vw, 13px);
  background: #111;
}

.mid-copy,
.notice,
.warning {
  word-break: break-word;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.75);
}

.mid-copy {
  font-size: clamp(11px, 3.3vw, 13px);
  line-height: 1.4;
  overflow: hidden;
}

.notice {
  font-size: clamp(11px, 3.1vw, 12px);
  line-height: 1.45;
  overflow: hidden;
}

.notice a {
  color: #9ad7ff;
  word-break: break-all;
}

.downloads {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1.2vh, 8px);
  z-index: 5;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: min(220px, 100%);
  min-width: 0;
  padding: clamp(7px, 1.2vh, 10px) clamp(14px, 4vw, 20px);
  border: 0;
  border-radius: 999px;
  color: #1d4f8a;
  font-size: clamp(14px, 3.8vw, 16px);
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(180deg, #f4fbff 0%, #d7ecff 100%);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
}

.download-btn .btn-icon {
  width: clamp(18px, 5vw, 22px);
  height: clamp(18px, 5vw, 22px);
  object-fit: contain;
  flex: 0 0 auto;
}

.download-btn svg {
  width: 18px;
  height: 18px;
  fill: #2f6fad;
}

.warning {
  color: #ff3b3b;
  font-size: clamp(10px, 3vw, 12px);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 小屏手机（iPhone SE / 矮屏安卓） */
@media (max-height: 700px) {
  .top-copy {
    max-height: 22%;
    font-size: clamp(10px, 3vw, 12px);
  }

  .download-btn {
    padding: 6px 14px;
  }
}

/* 平板/桌面：仍用竖屏手机框预览，框内背景继续满框拉伸 */
@media (min-width: 500px) {
  body {
    background: #111;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  .phone {
    width: min(430px, 100vw);
    height: min(100dvh, 932px);
    min-height: 0;
    max-width: 430px;
    flex: 0 0 auto;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.55);
  }
}

/* 横屏手机：同样铺满屏幕拉伸背景 */
@media (orientation: landscape) and (max-height: 500px) {
  .phone {
    width: 100%;
    height: 100%;
    min-height: var(--app-vh, 100dvh);
    max-width: none;
  }

  .top-copy {
    max-height: 16%;
  }
}
