/* DFA-07 落地页
 * PC：产品成品图 1920×1080，固定 16:9 等比居中。
 * H5：产品成品图 750×1450，按屏宽等比长页显示。
 * 所有业务链接均以透明热区覆盖在成品图对应位置，下载与埋点仍由 landing.js 负责。
 */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; width: 100%; min-height: 100%; }
body {
  overflow: hidden;
  background: #fff5f4;
  color: #222;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; user-select: none; -webkit-user-drag: none; }

.landing { position: fixed; inset: 0; }
.landing[data-layout="pending"] { visibility: hidden; }
.pc-design, .h5-design { display: none; }

.design-image { width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.design-hot {
  position: absolute;
  z-index: 5;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
}
.landing.debug-hotspots .design-hot {
  outline: 2px solid rgba(0, 110, 255, .85);
  background: rgba(0, 110, 255, .12);
}

/* PC 成品图框：任何桌面窗口都露出完整 1920×1080 画面，非 16:9 区域留浅色边。 */
.landing[data-layout="pc"] .pc-design {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  transform: translate(-50%, -50%);
}

/* PC 顶部三个合作按钮，坐标基于 1920×1080 成品图。 */
.pc-channel  { left: 2.34%; top: 4.07%; width: 10.68%; height: 5.20%; border-radius: 999px; }
.pc-business { left: 14.79%; top: 4.07%; width: 10.83%; height: 5.20%; border-radius: 999px; }
.pc-group    { left: 27.40%; top: 4.07%; width: 10.68%; height: 5.20%; border-radius: 999px; }

/* PC 左下二维码：避开成品图自带的红色边框，仅覆盖内部白区。 */
.pc-qr {
  position: absolute;
  z-index: 4;
  left: 6.46%;
  top: 76.11%;
  width: 10.31%;
  aspect-ratio: 1;
  padding: 3px;
  background: #fff;
}
.pc-qr canvas, .pc-qr img { display: block; width: 100% !important; height: 100% !important; }

/* H5 成品图框：按宽度等比展示整张 750×1450 长图。 */
.landing[data-layout="h5"] {
  position: relative;
  inset: auto;
  min-height: 100vh;
}
.landing[data-layout="h5"] .h5-design {
  position: relative;
  display: block;
  width: 100%;
  max-width: 750px;
  /* 设计稿等比高度不足一个现代长屏时，纵向延展至一屏，避免底部露出大块空白。
   * 热区与图片共用百分比坐标，随同纵向延展后仍保持对齐。 */
  height: max(100svh, calc(min(100vw, 750px) * 1.933333));
  margin: 0 auto;
}
body.landing-h5 { overflow-x: hidden; overflow-y: auto; background: #fce7e5; }

/* H5 顶部下载按钮。 */
.h5-top-download { left: 75.73%; top: 2.21%; width: 20.40%; height: 3.72%; border-radius: 999px; }

/* H5 右侧竖向合作胶囊的三个独立入口。 */
.h5-channel  { left: 88.27%; top: 41.10%; width: 11.73%; height: 6.82%; border-radius: 999px 999px 0 0; }
.h5-group    { left: 88.27%; top: 47.92%; width: 11.73%; height: 6.75%; }
.h5-business { left: 88.27%; top: 54.67%; width: 11.73%; height: 7.58%; border-radius: 0 0 999px 999px; }

/* H5 底部双下载按钮。 */
.h5-android-download { left: 2.13%; top: 85.59%; width: 47.20%; height: 9.17%; border-radius: 999px; }
.h5-ios-download     { left: 50.67%; top: 85.59%; width: 47.20%; height: 9.17%; border-radius: 999px; }

/* 底部安装提示文案：点击打开 Android 安装教程；iOS 仍可查看通用说明。 */
.h5-install-guide { left: 2.13%; top: 95.31%; width: 95.73%; height: 3.72%; }

/* Android 安装教程弹层（继承原落地页行为）。 */
.android-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow-y: auto;
  background: #f5f5f5;
  color: #222;
}
.android-modal[hidden] { display: none; }
.android-modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  background: #fff;
}
.android-modal-back { width: 32px; height: 32px; padding: 0; border: 0; background: none; cursor: pointer; }
.android-modal-back img { width: 100%; height: 100%; object-fit: contain; }
.android-modal-title { flex: 1; text-align: center; font-size: 16px; font-weight: 600; }
.android-modal-spacer { width: 32px; }
.android-modal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 750px;
  margin: 0 auto;
  padding: 12px;
}
.android-modal-cell { display: block; overflow: hidden; border-radius: 8px; background: #fff; text-decoration: none; }
.android-modal-cell img { width: 100%; }
.android-modal-detail { width: 100%; max-width: 750px; margin: 0 auto; padding: 12px; }
.android-modal-detail[hidden] { display: none; }
.android-modal-pic { overflow: hidden; margin-bottom: 8px; border-radius: 8px; background: #fff; }
.android-modal-pic img { width: 100%; }

/* 后台可配的右下角浮动广告；无数据时模板不渲染。 */
.ad-float {
  position: fixed;
  right: 12px;
  bottom: 16px;
  z-index: 50;
  width: min(80px, 22vw);
  aspect-ratio: 1;
}
.ad-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .35s; }
.ad-slide.active { opacity: 1; }
.ad-slide img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; background: rgba(0,0,0,.12); }
.ad-close {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 1;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.65);
  color: #fff;
  cursor: pointer;
}

@media (min-width: 961px) {
  .ad-float { right: 24px; bottom: 24px; width: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  .ad-slide { transition: none; }
}
