/* 落地页样式（红豆短剧）
 *
 * 两套布局：PC（≥961px）+ H5（<961px），由 landing.js 在 detectDevice 后给
 * <main.landing> 加 data-layout="pc"/"h5" + data-os="ios"/"android"。
 *
 *  - PC 背景：1920×1080（设计稿 Web端.png）
 *  - H5 背景：750×1260（设计稿 H5端.png，iOS / 安卓同图）
 *
 * 按钮、外链文字、底部说明都画在背景图上，页面只叠透明热区（.hotspot），
 * 坐标按设计稿像素换算成相对图片框的百分比。url 加 ?debug=1 可看红框对齐。
 */

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

.landing { position: fixed; inset: 0; }
.landing[data-layout="pending"] { visibility: hidden; }

.pc-shell, .h5-shell { display: none; position: absolute; inset: 0; overflow: hidden; }
/* 比例对不上时的留白：暗底 + 海报「模糊放大」做背景（frame 清晰叠在上层），和黑金底图自然衔接 */
.landing[data-layout="pc"] .pc-shell,
.landing[data-layout="h5"] .h5-shell { display: flex; align-items: center; justify-content: center; background: #0b0805; }
/* H5 贴底：底部说明条落在屏幕最下沿，多出的高度留在顶部（图顶本身是暗底，模糊后看不出接缝） */
.landing[data-layout="h5"] .h5-shell { align-items: flex-end; }
.landing[data-layout="pc"] .pc-shell::before,
.landing[data-layout="h5"] .h5-shell::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background-position: center top; background-repeat: no-repeat; background-size: cover;
  filter: blur(34px) brightness(.55);
  transform: scale(1.18);
}
/* 背景图 URL 由 landing.js 按 staticVersion 写进 --pc-bg / --h5-bg（带 ?v=，换图后不吃 CDN 旧缓存） */
.landing[data-layout="pc"] .pc-shell::before { background-image: var(--pc-bg); }
.landing[data-layout="h5"] .h5-shell::before { background-image: var(--h5-bg); filter: blur(34px) brightness(.32); }
.pc-frame, .h5-frame { z-index: 1; }

/* H5：按图宽高比(750×1260)框定、最大化填入视口；热区 % 相对 .h5-frame(=图片本身)，
   与屏幕比例无关、不漂移。设计稿已扣掉浏览器地址栏/工具栏，iOS Safari 基本满屏，
   安卓 Chrome 等更高的可视区会在顶部留一截模糊底。 */
.h5-frame {
  position: relative;
  width: 100%; height: 100%;
  max-width: calc(100vh * 750 / 1260);
  max-height: calc(100vw * 1260 / 750);
  aspect-ratio: 750 / 1260;
}

/* PC：按图宽高比(1920×1080)框定，最大化填入视口——16:9 窗口=满屏，
   其它比例=居中、四周模糊底；热区/二维码 % 相对 .pc-frame(=图片本身)。 */
.pc-frame {
  position: relative;
  width: 100%; height: 100%;
  max-width: calc(100vh * 1920 / 1080);
  max-height: calc(100vw * 1080 / 1920);
  aspect-ratio: 1920 / 1080;
}
.pc-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: fill;
  pointer-events: none;
  -webkit-user-drag: none;
}
.h5-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: fill;
  pointer-events: none;
  -webkit-user-drag: none;
  /* 图顶 2% 渐隐进模糊底，顶部留白时不出现硬接缝（logo 行在 3.6% 以下，不受影响） */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 2%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 2%);
}

/* ========== 热区基础样式 ========== */
.hotspot {
  position: absolute;
  display: block;
  background: transparent;
  text-decoration: none;
  border: 0;
  outline: 0;
  cursor: pointer;
  z-index: 5;
}
.landing.debug-hotspots .hotspot { outline: 2px solid rgba(255,64,64,.6); background: rgba(255,64,64,.08); }

/* ========== PC 热区（Web端.png 1920×1080 像素实测） ========== */
/* 右上 3 个外链：广告合作 x1088-1242 / 官方群组 x1274-1422 / 渠道合作 x1454-1602，y48-108 */
.pc-biz     { top: 4.44%; left: 56.67%; width: 8.02%; height: 5.56%; }
.pc-group   { top: 4.44%; left: 66.35%; width: 7.71%; height: 5.56%; }
.pc-channel { top: 4.44%; left: 75.73%; width: 7.71%; height: 5.56%; }

/* 二维码（qrcode.min.js 渲染当前 URL，含渠道码）：压在左下白方块 x521-745 y724-948 内，四周各留 8px */
.pc-qr {
  position: absolute;
  top: 67.78%; left: 27.55%;
  width: 10.89%; aspect-ratio: 1/1;
  background: #fff;
  padding: 4px;
  z-index: 4;
}
.pc-qr canvas, .pc-qr img { width: 100% !important; height: 100% !important; display: block; }

/* ========== H5 热区（H5端.png 750×1260 像素实测） ========== */
/* 顶部 3 个外链：广告合作 x310-432 / 官方群组 x453-574 / 渠道合作 x594-714，y46-98 */
.h5-biz         { top: 3.65%; left: 41.33%; width: 16.27%; height: 4.13%; }
.h5-group       { top: 3.65%; left: 60.40%; width: 16.13%; height: 4.13%; }
.h5-channel     { top: 3.65%; left: 79.20%; width: 16.00%; height: 4.13%; }
/* 底部 2 个金色按钮：Web网页 x18-366 / 高速下载 x384-734，y1080-1164 */
.h5-btn-web     { top: 85.71%; left: 2.40%;  width: 46.40%; height: 6.67%; border-radius: 999px; }
.h5-btn-fast    { top: 85.71%; left: 51.20%; width: 46.67%; height: 6.67%; border-radius: 999px; }
/* 底部说明条 y1205-1260，整条可点 */
.h5-bottom-text { top: 95.63%; left: 0;      width: 100%;   height: 4.37%; }

/* H5 一屏显示，不滚动 */
body.landing-h5 { overflow: hidden; }

/* ========== 安卓「安装包报毒解决方案」弹层（深色金主题，与落地页统一） ========== */
.android-modal {
  position: fixed; inset: 0;
  background: #0d0a07;
  color: #e8d9a8;
  z-index: 100;
  overflow-y: auto;
}
.android-modal[hidden] { display: none; }
.android-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(180deg, #241a0c, #1a1308);
  border-bottom: 1px solid rgba(212,175,55,.35);
  position: sticky; top: 0; z-index: 2;
}
.android-modal-back {
  width: 32px; height: 32px;
  background: none; border: 0; padding: 0;
  cursor: pointer;
}
/* 原黑色返回箭头图标，深色底下反相成浅金 */
.android-modal-back img { width: 100%; height: 100%; object-fit: contain; filter: invert(1) sepia(1) saturate(2) hue-rotate(5deg) brightness(1.1); }
.android-modal-title { font-size: 16px; font-weight: 700; flex: 1; text-align: center; color: #f2d675; letter-spacing: 1px; }
.android-modal-spacer { width: 32px; }

.android-modal-list { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
/* 修：列表 display:flex 会盖过 hidden 属性的 display:none，点「查看」进详情态时列表隐不掉 */
.android-modal-list[hidden] { display: none; }
.android-modal-cell {
  display: block;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(212,175,55,.22);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
}
.android-modal-cell img { width: 100%; display: block; }

.android-modal-detail { padding: 14px; }
.android-modal-detail[hidden] { display: none; }
.android-modal-pic { background: rgba(255,255,255,.04); border: 1px solid rgba(212,175,55,.22); border-radius: 10px; overflow: hidden; margin-bottom: 10px; }
.android-modal-pic img { width: 100%; display: block; }

/* ========== 浮动广告位（右下） ========== */
.ad-float {
  position: fixed;
  right: 12px;
  bottom: 16px;
  width: min(80px, 22vw);
  aspect-ratio: 1/1;
  z-index: 50;
}
.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,.2);
}
.ad-close {
  position: absolute;
  top: -8px; right: -8px;
  width: 20px; height: 20px;
  background: rgba(0,0,0,.6);
  color: #fff;
  border: 0;
  border-radius: 999px;
  font-size: 14px;
  line-height: 18px;
  cursor: pointer;
  z-index: 1;
}

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