/*!
 * dl-fix.css —— 分享下载页 多端适配 / 点击热区 / 布局兜底
 * 说明：原构建产物中的 rpx 尺寸被编译成 "%?N?%" 占位符（浏览器不识别），
 *      导致按钮尺寸、弹窗尺寸、字号全部失效。此文件补齐真实尺寸。
 * 作用域前缀 html.dlp-* 由 dl-fix.js 注入。
 */

/* ---------- 1. 页面容器：修正 100vh 在移动端地址栏伸缩时的溢出 ---------- */
.index {
  min-height: 100vh !important;
  height: 100vh !important;
  -webkit-tap-highlight-color: transparent !important;
  touch-action: manipulation !important;
}
@supports (height: 100dvh) {
  .index { height: 100dvh !important; }
}

/* ---------- 2. 主下载按钮：补齐尺寸 + 扩大点击热区 ---------- */
.index .down-btn {
  position: fixed !important;
  left: 50% !important;
  margin-left: -36.665vw !important;
  width: 73.33vw !important;
  height: 18.61vw !important;
  bottom: 10% !important;
  bottom: calc(10% + constant(safe-area-inset-bottom)) !important;
  bottom: calc(10% + env(safe-area-inset-bottom)) !important;
  z-index: 100 !important;
  display: block !important;
  max-width: 460px !important;
  animation: none !important;
  -webkit-animation: none !important;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  pointer-events: auto !important;
}

/* uni-image 内部节点铺满，避免遗留 320x240 默认尺寸 */
.index .down-btn > div,
.index .down-btn > img,
.index .down-btn .uni-image,
.index .down-btn img {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: contain !important;
  pointer-events: none !important;
}

/* 呼吸动画移到内层图片，避免与定位 transform 冲突 */
.index .down-btn img {
  animation: dlp-pulse 1.6s ease-in-out infinite !important;
  -webkit-animation: dlp-pulse 1.6s ease-in-out infinite !important;
  transform-origin: 50% 60% !important;
}
@keyframes dlp-pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.045); }
  100% { transform: scale(1); }
}
@-webkit-keyframes dlp-pulse {
  0%   { -webkit-transform: scale(1); }
  50%  { -webkit-transform: scale(1.045); }
  100% { -webkit-transform: scale(1); }
}

@media (min-width: 628px) {
  .index .down-btn {
    width: 460px !important;
    height: 116.7px !important;
    margin-left: -230px !important;
  }
}

/* ---------- 3. 邀请码弹窗：补齐尺寸，并抬到引导层之下 ---------- */
.index .copy-dialog-mask {
  z-index: 1200 !important;
}
.index .copy-dialog {
  width: 82vw !important;
  max-width: 330px !important;
  padding: 24px 20px 18px !important;
  border-radius: 12px !important;
  box-sizing: border-box !important;
  text-align: center !important;
  overflow: hidden !important;
}
.index .copy-dialog-title {
  font-size: 17px !important;
  line-height: 1.4 !important;
  font-weight: 700 !important;
  color: #222 !important;
  margin-bottom: 12px !important;
}
.index .copy-dialog-msg {
  font-size: 14px !important;
  line-height: 1.6 !important;
  color: #666 !important;
  margin-bottom: 18px !important;
  word-break: break-word !important;
}
.index .copy-dialog-btn {
  height: 44px !important;
  line-height: 44px !important;
  min-height: 44px !important;
  border-radius: 22px !important;
  background: #ff7a28 !important;
  color: #fff !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  text-align: center !important;
  cursor: pointer !important;
  -webkit-tap-highlight-color: transparent !important;
  touch-action: manipulation !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}
.index .copy-dialog-btn:active {
  filter: brightness(.94);
}

/* ---------- 4. 内置浏览器引导层：点击下载后才出现，不再一进页面就遮挡 ---------- */
.index .mask {
  z-index: 2500 !important;
  background-color: #6b6b6b !important;
  -webkit-tap-highlight-color: transparent !important;
  pointer-events: auto !important;
}
/* 默认隐藏，覆盖 Vue 的 v-show 内联样式；仅在内置浏览器且用户已点击下载时显示 */
html .index .mask { display: none !important; }
html.dlp-inapp.dlp-guide-on .index .mask { display: block !important; }

/* ---------- 5. 自建 UI：Toast / 提示弹窗 / 复制链接按钮 ---------- */
.dlp-toast {
  position: fixed;
  left: 50%;
  bottom: 34%;
  transform: translateX(-50%);
  max-width: 78vw;
  padding: 11px 18px;
  background: rgba(0, 0, 0, .82);
  color: #fff;
  font-size: 14px;
  line-height: 1.45;
  border-radius: 8px;
  text-align: center;
  z-index: 3000;
  pointer-events: none;
  word-break: break-word;
  opacity: 0;
  transition: opacity .18s ease;
  -webkit-transition: opacity .18s ease;
}
.dlp-toast.dlp-show { opacity: 1; }

.dlp-modal-mask {
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 3200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
}
.dlp-modal {
  width: 100%;
  max-width: 320px;
  background: #fff;
  border-radius: 12px;
  padding: 24px 20px 18px;
  box-sizing: border-box;
  text-align: center;
}
.dlp-modal-title {
  font-size: 17px; font-weight: 700; color: #222; margin-bottom: 12px;
}
.dlp-modal-msg {
  font-size: 14px; line-height: 1.6; color: #666; margin-bottom: 18px;
  word-break: break-word;
}
.dlp-modal-btn {
  height: 44px; line-height: 44px; border-radius: 22px;
  background: #ff7a28; color: #fff; font-size: 16px; font-weight: 700;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.dlp-modal-btn:active { filter: brightness(.94); }

/* ---------- 5.1 邀请码高亮 ----------
 * 弹窗是白底：用主题橙 + 加大字号 + 等宽字体（0/O、1/l 不易看错）。
 * Toast 是深色底：换浅橙保证对比度，字号略降以适配单行气泡。 */
.dlp-code {
  display: inline-block;
  margin: 0 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 1.6em;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 1.5px;
  color: #ff6a00;
  word-break: break-all;
  vertical-align: -2px;
}
.dlp-toast .dlp-code {
  font-size: 1.28em;
  letter-spacing: 1px;
  color: #ffb067;
  margin: 0 4px;
  vertical-align: -1px;
}

.dlp-copy-link {
  position: fixed;
  left: 50%;
  bottom: calc(8% + constant(safe-area-inset-bottom));
  bottom: calc(8% + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 11px 26px;
  border-radius: 22px;
  background: rgba(255, 122, 40, .95);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  z-index: 2600;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
}
.dlp-copy-link:active { filter: brightness(.94); }
/* 仅在引导层出现时显示，避免挡住主下载按钮 */
.dlp-copy-link { display: none; }
html.dlp-guide-on .index .dlp-copy-link,
html.dlp-guide-on .dlp-copy-link { display: block; }

/* ---------- 6. 直下兜底条 ----------
 * 外部浏览器（百度、QQ浏览器、UC、夸克、各厂商自带、桌面等）优先直接下载。
 * 只有当内核静默吞掉下载时，5 秒后在按钮上方出一条非阻塞提示，
 * 给「复制链接」出口。位置用 vw 换算，任何屏宽都不会压住主按钮。 */
.dlp-fallback {
  position: fixed;
  left: 50%;
  bottom: calc(10% + 18.61vw + 20px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  max-width: 86vw;
  padding: 8px 8px 8px 16px;
  background: rgba(255, 255, 255, .96);
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .22);
  z-index: 2400;
  box-sizing: border-box;
}
.dlp-fallback-text {
  font-size: 13px;
  line-height: 1.3;
  color: #444;
  white-space: nowrap;
}
.dlp-fallback-btn {
  flex-shrink: 0;
  margin-left: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #ff7a28;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.dlp-fallback-btn:active { filter: brightness(.94); }
