/* qiezi-go landing page styles
 *
 * 两套布局：PC（≥961px）+ H5（<961px），由 landing.js 在 detectDevice 后给
 * <main.landing> 加 data-layout="pc"/"h5" + data-os="ios"/"android"。
 * 热区位置全部精确测自 Figma node 637:260 的 absoluteBoundingBox（见
 * doc 落地页/landing板块实施方案.md §7）。
 *
 *  - PC 背景：3840×2160 (Figma node 637:26 @2x，原 1920×1080 设计稿)
 *  - H5 iOS：750×1270 (node 637:100 裁掉 iPhone 状态栏 88px + Safari 栏 266px)
 *  - H5 Android：750×1536 (node 637:159 仅裁状态栏 88px，无 Safari 栏)
 *
 * iOS / Android 两张 H5 背景图尺寸不同 → 热区百分比按各自图分别算，通过
 * .landing[data-os="ios|android"] 选择器切换。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; }
/* PC 版:锁 16:9 居中框(letterbox),露全图。
 * 原来 .pc-shell 走 background-size:cover 铺满视口,而 .pc-qr/按钮热区按「视口%」
 * 定位——仅当窗口正好 16:9 时才对齐;其它比例 cover 裁图,背景印刷的二维码白框位移,
 * 但热区仍钉死在视口 %,导致二维码/按钮压不准(两个浏览器窗口比例不同就"细节对不上")。
 * 改成:把 .pc-shell 尺寸锁成 16:9(min() 取能放进视口的最大 16:9 框)、居中,
 * 背景整张铺满该框(background-size:100% 100%,无裁剪),热区 % 相对该框 = 与
 * 1920×1080 设计稿基准一致 → 任何窗口都精确对齐。非 16:9 窗口出黑边(与 H5 同思路)。 */
.landing[data-layout="pc"] .pc-shell {
  display: block;
  inset: auto;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  background-size: 100% 100%;
}
.landing[data-layout="h5"] .h5-shell { display: block; }

/* ========== 背景 3 变体随机轮换（data-variant 由 base.gohtml 内联脚本随机设置） ==========
 * PC：背景铺在 .pc-shell（cover，桌面≈16:9 与 1920×1080 设计吻合）。
 * H5：.h5-shell 兼背景框，aspect-ratio 给自然高度、整页纵向滚动；热区 % 相对该框自动对齐。 */
.pc-shell {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
[data-variant="1"] .pc-shell { background-image: url(/static/assets/pc/bg1.jpg); }
[data-variant="2"] .pc-shell { background-image: url(/static/assets/pc/bg2.jpg); }
[data-variant="3"] .pc-shell { background-image: url(/static/assets/pc/bg3.jpg); }

.h5-bg {
  aspect-ratio: 750 / 1400;
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
}
[data-variant="1"] .h5-bg { background-image: url(/static/assets/h5/bg1.jpg); }
[data-variant="2"] .h5-bg { background-image: url(/static/assets/h5/bg2.jpg); }
[data-variant="3"] .h5-bg { background-image: url(/static/assets/h5/bg3.jpg); }

/* ========== 热区基础样式 ========== */
.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 设计 1920×1080；坐标从 WEB-例.jpg 量取） ========== */
/* 右上 2 个外链按钮：官方福利群(=GroupLink/pc-group) / 商务合作(=BusinessCooperation/pc-ad)。
   绿帽龟无「流量合作」，ChannelCooperation 留空 → pc-traffic 不渲染。 */
.pc-ad      { top: 6.8%; left: 85.0%; width: 11.2%; height: 5.6%; border-radius: 999px; } /* 商务合作 */
.pc-traffic { display: none; } /* 绿帽龟无「流量合作」，恒隐藏防种子配置冒出 */
.pc-group   { top: 6.8%; left: 72.5%; width: 11.2%; height: 5.6%; border-radius: 999px; } /* 官方福利群 */

/* 扫码下载二维码（qrcode.min.js 渲染当前 URL）：叠在下载说明框左侧空位 */
.pc-qr {
  position: absolute;
  top: 71.35%; left: 22.75%;
  width: 6.5%; aspect-ratio: 1/1;
  background: #fff;
  padding: 2px;
  z-index: 4;
}
.pc-qr canvas, .pc-qr img { width: 100% !important; height: 100% !important; display: block; }

/* ========== H5 热区（绿帽龟 H5 设计 750×1400；坐标从 H5-例.jpg 量取） ========== */
/* 顶部右侧 2 个外链：官方福利群(=h5-group) / 商务合作(=h5-ad)。流量(h5-traffic)未用不渲染。 */
.h5-ad      { top: 4.8%; left: 74.7%; width: 20.3%; height: 3.4%; border-radius: 999px; } /* 商务合作 */
.h5-traffic { display: none; } /* 绿帽龟无「流量合作」，恒隐藏 */
.h5-group   { top: 4.8%; left: 51.8%; width: 20.3%; height: 3.4%; border-radius: 999px; } /* 官方福利群 */
/* 绿帽龟 H5 无「安装教程」圆按钮与底部报毒文案，隐藏（DB 字段/模板保留，仅不显示） */
.h5-install { display: none; }
/* 底部双下载按钮：高速下载 / 备用下载 */
.h5-dl-fast   { top: 90.1%; left: 4.7%;  width: 44.2%; height: 5.7%; border-radius: 999px; } /* 高速下载 */
.h5-dl-normal { top: 90.2%; left: 51.3%; width: 44.0%; height: 5.7%; border-radius: 999px; } /* 备用下载 */
.h5-bottom-text { display: none; }

/* ========== H5 自适应：按设备宽度等比铺满，露全图不裁两侧 ========== */
/* 原 .h5-bg object-fit:cover + .landing position:fixed 满屏，在「设备宽高比 <
 * 背景图宽高比」的窄高屏（如 iPhone 12 Pro 390×844=0.46 vs iOS 图 750×1270=0.59）
 * 会按高铺满、裁掉左右两侧——横幅文案被切、热区（% 相对视口）与被裁图错位。
 * 改为：H5 走文档流，图片按设备宽等比缩放（露全图），热区 % 相对图片框（与
 * Figma bbox 测量基准一致，自动对齐），整页可纵向滚动（仿 .landing-b）。
 * 图比视口矮时下方留黑，与图底深色无缝；PC 仍走 cover（桌面≈16:9 与 PC 图吻合）。*/
.landing[data-layout="h5"] { position: relative; inset: auto; }
.landing[data-layout="h5"] .h5-shell {
  position: relative; inset: auto;
  width: 100%; max-width: 750px; margin: 0 auto;
  overflow: visible;
  /* 高度来自 .h5-bg 的 aspect-ratio:750/1624；背景图 cover 铺满本框，热区 % 相对本框对齐 */
}
body.landing-h5 { overflow: auto; }

/* ========== B 版（视频网格长落地页，Figma node 648:66 → 750×2212 裁后） ========== */
/* B 版是单页长滚动，覆盖默认 body 锁滚 + .landing 固定布局 */
body.b-version { overflow: auto; background: #000; }
.landing.landing-b {
  position: relative;
  inset: auto;
  display: block;
  width: 100%;
  max-width: 750px;
  margin: 0 auto;
  background: #000;
}
/* B 版移动长页容器：定位上下文 = 图片框，热区 % 相对它对齐。
 * PC 端（landing.js 切 data-layout="pc" 并去掉 .landing-b）隐藏本段、改显 pcShell。*/
.b-shell { position: relative; display: block; }
.landing[data-layout="pc"] .b-shell { display: none; }

.b-bg {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
}
.b-hot {
  position: absolute;
  display: block;
  background: transparent;
  text-decoration: none;
  border: 0;
  outline: 0;
  cursor: pointer;
  z-index: 5;
}
/* B 版热区（基于 bg-b.jpg 750×2212；精确测自 648:102/648:108/648:101 bbox） */
.b-btn-android { left:  4.00%; top: 91.14%; width: 44.80%; height: 3.71%; border-radius: 999px; }
.b-btn-ios     { left: 51.73%; top: 91.14%; width: 44.80%; height: 3.71%; border-radius: 999px; }
.b-bottom-text { left: 24.53%; top: 96.02%; width: 51.20%; height: 2.89%; }
/* B 版顶部右侧 3 个外链按钮（图标+文案为整块热区；目标与 PC pc-mail/telegram/sw 一致）
 * 商务合作(♥)→官网 t1t1.com、官方社群(✈)→Telegram、官方邮箱(✉)→mailto。
 * 坐标量自 bg-b.jpg 顶部 header（750×2212）。 */
.b-biz   { left: 57.60%; top: 1.18%; width: 14.67%; height: 4.43%; }
.b-group { left: 72.00%; top: 1.18%; width: 13.33%; height: 4.43%; }
.b-mail  { left: 84.93%; top: 1.18%; width: 14.67%; height: 4.43%; }
.landing.landing-b.debug-hotspots .b-hot { outline: 2px solid rgba(255,64,64,.6); background: rgba(255,64,64,.08); }

/* ========== 安卓「安装包报毒解决方案」弹层 ========== */
.android-modal {
  position: fixed; inset: 0;
  background: #f5f5f5;
  color: #222;
  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: #fff;
  border-bottom: 1px solid #eee;
  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; }
.android-modal-title { font-size: 16px; font-weight: 600; flex: 1; text-align: center; }
.android-modal-spacer { width: 32px; }

.android-modal-list { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.android-modal-cell {
  display: block;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
}
.android-modal-cell img { width: 100%; display: block; }

.android-modal-detail { padding: 12px; }
.android-modal-detail[hidden] { display: none; }
.android-modal-pic { background: #fff; border-radius: 8px; overflow: hidden; margin-bottom: 8px; }
.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; }
}
