/* qiezi-go landing page styles
 *
 * 两套布局：PC（≥961px）+ H5（<961px），由 landing.js 在 detectDevice 后给
 * <main.landing> 加 data-layout="pc"/"h5" + data-os="ios"/"android"。
 * 默认 A 版使用 DFA05「互上阿姨」最终合成视觉稿：
 *  - PC：1920×1080
 *  - H5：750×1450
 * 链接、下载和二维码仍使用现有动态数据与客户端行为，仅按新稿重定位热区。
 * PC/H5 均使用完整合成图；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; }

/* ========== DFA05 默认落地页视觉 ==========
 * 保留 data-variant 合同，但三个 variant 统一指向封板稿，避免改动现有模板/JS。 */
.pc-shell {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
[data-variant="1"] .pc-shell,
[data-variant="2"] .pc-shell,
[data-variant="3"] .pc-shell { background-image: url(/static/assets/pc/hsay.png); }

.h5-bg {
  aspect-ratio: 750 / 1450;
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
}
[data-variant="1"] .h5-bg,
[data-variant="2"] .h5-bg,
[data-variant="3"] .h5-bg { background-image: url(/static/assets/h5/hsay.png); }

/* ========== 热区基础样式 ========== */
.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 热区（1920×1080） ========== */
/* 新稿从左到右：官方频道 / 渠道合作 / 商务合作。模板字段映射保持不变。 */
.pc-group   { top: 5.1852%; left: 51.3542%; width: 15.2083%; height: 8.8889%; border-radius: 999px; }
.pc-traffic { top: 5.1852%; left: 66.5104%; width: 15.2083%; height: 8.8889%; border-radius: 999px; }
.pc-ad      { top: 5.1852%; left: 81.7188%; width: 15.2083%; height: 8.8889%; border-radius: 999px; }

/* 右下扫码下载二维码：画布放进视觉稿空白二维码框的安全区。 */
.pc-qr {
  position: absolute;
  top: 71.2037%; left: 85.4167%;
  width: 10.4167%; 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 热区（750×1450） ========== */
/* 新稿从左到右：官方频道 / 渠道合作 / 商务合作。 */
.h5-group   { top: 3.1034%; left: 32.6667%; width: 21.8667%; height: 3.7241%; border-radius: 999px; }
.h5-traffic { top: 3.1034%; left: 54.5333%; width: 21.8667%; height: 3.7241%; border-radius: 999px; }
.h5-ad      { top: 3.1034%; left: 76.4000%; width: 21.8667%; height: 3.7241%; border-radius: 999px; }
/* Android 可见安装教程入口；复用既有 data-action 和弹层。 */
.h5-install {
  top: 81.8%; left: 39%; width: 22%; height: 4%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d3a950;
  border-radius: 999px;
  color: #f8dc95;
  background: linear-gradient(180deg, rgba(63,43,16,.96), rgba(12,8,3,.96));
  box-shadow: 0 4px 14px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,225,153,.22);
  font-size: clamp(12px, 3.2vw, 17px);
  font-weight: 700;
  letter-spacing: .08em;
}
.h5-install-label { pointer-events: none; white-space: nowrap; }
.landing[data-os="ios"] .h5-install { display: none; }
/* 底部双下载按钮 */
.h5-dl-normal { top: 86.6207%; left: 2.9333%; width: 45.4667%; height: 6.6207%; border-radius: 999px; }
.h5-dl-fast   { top: 86.6207%; left: 51.6000%; width: 45.4667%; height: 6.6207%; border-radius: 999px; }
/* 新稿没有底部报毒说明点击区，避免保留不可见热点。 */
.h5-bottom-text { display: none; }

/* ========== H5 自适应：按设备宽度等比铺满，露全图不裁两侧 ========== */
/* H5 走文档流，图片按设备宽等比缩放；热区百分比相对完整图片框定位。
 * 图比视口高时允许纵向滚动，图比视口矮时下方留黑。 */
.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/1450；背景图铺满本框，热区 % 相对本框对齐 */
}
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); }

/* 轻量 toast：下载链未配置时给用户可见反馈（见 landing.js trackThenGo）。 */
.landing-toast {
  position: fixed;
  left: 50%;
  bottom: 12%;
  z-index: 200;
  max-width: 80vw;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .82);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  transform: translate(-50%, 8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.landing-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ========== 安卓「安装包报毒解决方案」弹层 ========== */
.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; }
}
