/* BF Mall App 下载页 —— 无构建、无外部依赖（字体全用系统字，避免境内加载失败） */
:root {
  --navy: #13265C;
  --navy-deep: #0C1A42;
  --orange: #FF6B1A;
  --paper: #F5F7FB;
  --ink: #16224A;
  --slate: #5B6787;
  --line: #DCE3F0;
  --card: #FFFFFF;
  --radius-tag: 18px;
  --radius-btn: 12px;
  font-family: "PingFang HK", "PingFang TC", "Noto Sans HK", "Noto Sans TC",
    "Microsoft JhengHei", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, p { margin: 0; }
button, a { font: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 6px; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 64px);
}
.brand { height: 34px; width: auto; }
.lang { display: flex; gap: 2px; background: #E8EDF6; border-radius: 999px; padding: 3px; }
.lang button {
  border: 0; background: transparent; color: var(--slate); cursor: pointer;
  padding: 5px 12px; border-radius: 999px; font-size: 13px;
}
.lang button[aria-pressed="true"] { background: var(--card); color: var(--navy); font-weight: 600; }

/* ---------- 主体：桌面左右两栏 ---------- */
.stage {
  flex: 1;
  width: 100%; max-width: 1120px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(32px, 6vw, 96px);
  align-items: center;
  padding: 24px clamp(20px, 5vw, 64px) 48px;
}

.intro h1 {
  font-size: clamp(32px, 4.4vw, 52px); line-height: 1.15; font-weight: 800;
  color: var(--navy); letter-spacing: -0.01em;
}
.lead { margin-top: 14px; font-size: 17px; line-height: 1.7; color: var(--slate); max-width: 34em; }

.platforms { margin-top: 36px; display: grid; gap: 14px; max-width: 520px; }
.platform {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 16px 16px 18px;
}
.platform-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.os { width: 30px; height: 30px; fill: var(--navy); flex: none; }
.platform h2 { font-size: 17px; font-weight: 700; }
.meta { font-size: 13px; color: var(--slate); margin-top: 2px; }
.hint { grid-column: 1 / -1; font-size: 13px; color: var(--slate); line-height: 1.6; }
.hint:empty { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: var(--radius-btn);
  background: var(--navy); color: #fff; text-decoration: none; font-weight: 600; font-size: 15px;
  white-space: nowrap; transition: background .15s;
}
.btn:hover { background: var(--navy-deep); }
.btn.is-primary { background: var(--orange); }
.btn.is-primary:hover { background: #E95A0C; }
.btn[aria-disabled="true"] {
  background: #E8EDF6; color: #8A94AE; pointer-events: none;
}

.notes { margin-top: 22px; max-width: 520px; color: var(--slate); font-size: 14px; }
.notes summary { cursor: pointer; color: var(--navy); font-weight: 600; }
.notes h3 { margin: 14px 0 4px; font-size: 14px; color: var(--ink); }
.notes ul { margin: 0; padding-left: 1.2em; line-height: 1.8; }

/* ---------- 包裹吊牌（本页唯一的装饰重点） ---------- */
.tag {
  position: relative;
  background: var(--navy); color: #fff;
  border-radius: var(--radius-tag);
  padding: 44px 28px 26px;
  box-shadow: 0 24px 48px -20px rgba(19, 38, 92, .55);
  transform: rotate(2deg);
  animation: tag-in .7s cubic-bezier(.2, .8, .2, 1) both;
}
.tag-hole {
  position: absolute; top: 16px; left: 50%; width: 16px; height: 16px; margin-left: -8px;
  border-radius: 50%; background: var(--paper); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .25);
}
.tag-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.tag-title { font-size: 15px; font-weight: 600; }
.tag-ver { font-size: 13px; opacity: .8; white-space: nowrap; }
.tag-ver strong { font-size: 15px; opacity: 1; color: #FFD2B8; font-variant-numeric: tabular-nums; }
.tag-qr {
  margin-top: 18px; padding: 14px; background: #fff; border-radius: 12px;
  /* 撕线：吊牌上下两半之间的虚线 */
  border-top: 0;
}
.tag-qr canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.tag-foot {
  margin-top: 16px; padding-top: 14px; border-top: 2px dashed rgba(255, 255, 255, .28);
  font-size: 14px; line-height: 1.6; text-align: center;
}
.speed { position: absolute; left: -46px; top: 46%; display: grid; gap: 9px; }
.speed i { display: block; height: 6px; border-radius: 3px; background: var(--orange); }
.speed i:nth-child(1) { width: 56px; }
.speed i:nth-child(2) { width: 36px; margin-left: 20px; }
.speed i:nth-child(3) { width: 22px; margin-left: 34px; }

@keyframes tag-in {
  from { opacity: 0; transform: translateY(18px) rotate(-4deg); }
  to   { opacity: 1; transform: rotate(2deg); }
}

.foot { text-align: center; font-size: 12px; color: #8A94AE; padding: 0 20px 28px; }

/* ---------- 微信/QQ 内置浏览器遮罩 ---------- */
.inapp {
  position: fixed; inset: 0; z-index: 20; background: rgba(12, 26, 66, .92); color: #fff;
  display: flex; flex-direction: column; align-items: flex-end; padding: 18px 22px;
}
.inapp[hidden] { display: none; }
.inapp svg { width: 120px; }
.inapp p { margin-top: 12px; max-width: 18em; font-size: 17px; line-height: 1.7; text-align: right; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 30;
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 14px; max-width: calc(100vw - 40px); line-height: 1.6;
}
.toast[hidden] { display: none; }

/* ---------- 手机：吊牌移到顶部，当前系统的按钮紧随其后 ---------- */
@media (max-width: 820px) {
  .stage { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 8px; align-content: start; }
  .tag { order: -1; max-width: 360px; width: 100%; margin: 0 auto; transform: none; animation-name: tag-in-flat; }
  .speed { display: none; }
  .intro { text-align: left; }
  .platforms { margin-top: 24px; }
  .platform { grid-template-columns: 1fr; }
  .platform .btn { width: 100%; min-height: 50px; font-size: 16px; }
  /* 手机上扫自己没意义：二维码收起，吊牌只展示版本与安装说明 */
  body.is-mobile .tag-qr, body.is-mobile .tag-foot { display: none; }
  body.is-mobile .tag { padding-bottom: 22px; }
}

/* 手机（按 UA 判断，与屏宽无关）：只展示本机系统的安装方式，另一个收在「其他平台」后面 */
body.is-mobile .platform:not(.is-current) { display: none; }
body.is-mobile.show-all .platform:not(.is-current) { display: grid; }
body.is-mobile .platform.is-current { border-color: var(--orange); }
.other {
  justify-self: start; margin-top: 4px; padding: 0; border: 0; background: none;
  color: var(--navy); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.other[hidden] { display: none; }
@keyframes tag-in-flat { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .tag { animation: none; }
  .btn { transition: none; }
}
