/* ============================================================
   销售版专用样式：开屏广告轮播、注册门禁、设置页分级
   （与 app.css 的设计变量保持一致，不引入新色板）
   ============================================================ */

/* ---------- 设置页分级：pro = 技术配置（销售版一律不出现）
   exp  = 进阶项（仅网页版保留）
   basic = 外观与语言（仅网页版保留）
   reg / about = 注册信息与软件信息（两端都显示，客户端只留这两张） ---------- */
[data-tier="pro"] {
  display: none !important;
}

body[data-platform="android"] [data-tier="exp"],
body[data-platform="ios"] [data-tier="exp"],
body[data-platform="android"] [data-tier="basic"],
body[data-platform="ios"] [data-tier="basic"] {
  display: none !important;
}

/* 键值行：注册信息 / 软件信息 */
.kv {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel-2);
}

.kv-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.kv-row > span {
  color: var(--ink-3);
  flex: 0 0 auto;
}

.kv-row > b {
  color: var(--ink);
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}

.kv-row > b.ok { color: var(--ok); }
.kv-row > b.warn { color: var(--warn); }
.kv-row > b.mono { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); }

/* ---------- 开屏广告：两张网站首屏海报，全屏轮播 ---------- */
.ad-splash {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: #05070c;
  overflow: hidden;
}

.ad-splash[hidden] { display: none !important; }

.ad-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .5s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ad-slide.is-on {
  opacity: 1;
  z-index: 1;
}

.ad-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* 打底层：同一张海报放大模糊，填满竖屏/宽屏两侧的空隙 */
.ad-bg--blur {
  object-fit: cover;
  filter: blur(42px) brightness(.3) saturate(1.2);
  transform: scale(1.2);
}

/* 海报主体：picture 按宽高比选横版/竖版，contain 保证图里的标题、地址、域名一个字都不被裁 */
.ad-bg--sharp {
  display: block;
  z-index: 1;
}

.ad-bg--sharp .ad-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* 轻微推近，静态图也有「在播」的感觉 */
.ad-slide.is-on .ad-bg--sharp {
  animation: ad-zoom 3s ease-out both;
}

@keyframes ad-zoom {
  from { transform: scale(1); }
  to { transform: scale(1.03); }
}

.ad-flag {
  position: absolute;
  left: 14px;
  top: calc(14px + env(safe-area-inset-top));
  z-index: 3;
  font-size: 11px;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, .45);
  border: 1px solid rgba(255, 255, 255, .3);
  padding: 4px 8px;
  border-radius: 6px;
}

.ad-hud {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
}

.ad-bars {
  display: flex;
  gap: 6px;
  flex: 1;
}

.ad-bars i {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .3);
  overflow: hidden;
}

.ad-bars i > span {
  display: block;
  height: 100%;
  width: 100%;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left;
}

.ad-skip {
  flex: 0 0 auto;
  font: inherit;
  font-size: 12px;
  color: #fff;
  background: rgba(0, 0, 0, .35);
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}

.ad-skip b { font-weight: 600; }

/* ---------- 注册门禁 ---------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  background: var(--bg);
  overflow-y: auto;
}

.gate[hidden] { display: none !important; }

.gate-card {
  width: min(430px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 22px;
  box-shadow: var(--shadow);
}

.gate-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 12px;
}

.gate-brand .logo {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--brand-grad);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-lao);
  font-size: 15px;
}

.gate-brand b { color: var(--ink); font-size: 15px; }

.gate-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.gate-desc {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2);
}

.gate-desc b { color: var(--brand); }

.gate-trial {
  margin: 0 0 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid #f3d9a4;
  border-radius: 10px;
  padding: 8px 10px;
}

.gate-trial[hidden] { display: none !important; }

.gate-trial.is-over {
  color: var(--err);
  background: var(--err-soft);
  border-color: #f5c2bd;
  font-weight: 600;
}

.gate-form[hidden],
.gate-pay[hidden] { display: none !important; }

.gate-pay {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r);
  background: var(--panel-2);
}

/* 两个收款码并排：中国用微信、老挝用 JDB，当前国家那张高亮 */
.pay-pair {
  display: flex;
  gap: 10px;
  width: 100%;
}

.pay-card {
  margin: 0;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: zoom-in;
}

.pay-card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.pay-card figcaption {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--ink-2);
  text-align: center;
}

.pay-card.is-on {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* 点一下放大到全屏，方便对着扫 */
.pay-card.zoom {
  position: fixed;
  inset: 0;
  z-index: 200;
  border: 0;
  border-radius: 0;
  background: #fff;
  justify-content: center;
  padding: 18px;
  cursor: zoom-out;
}

.pay-card.zoom img {
  width: auto;
  max-width: 94vw;
  max-height: 76vh;
  border-radius: 10px;
}

.pay-card.zoom figcaption {
  font-size: 14px;
}

.gate-pay-tip {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
  text-align: center;
}

.gate-pay-tip b { color: var(--ink); }

.gate-status {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
  min-height: 20px;
}

.gate-status.err { color: var(--err); }
.gate-status.ok { color: var(--ok); }

.gate-help {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12px;
  color: var(--ink-3);
}

.gate-help b { color: var(--ink-2); font-family: var(--font-mono); }

/* 门禁里的错误高亮（手机号校验） */
.input.invalid { border-color: var(--err); box-shadow: 0 0 0 3px var(--err-soft); }

/* 管理后台入口：网页版显示（管理员用电脑/手机浏览器），App 内不出现 */
.admin-entry {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

body[data-platform="android"] .admin-entry,
body[data-platform="ios"] .admin-entry {
  display: none !important;
}

/* 横屏/矮窗口：海报整体缩小，别糊满整屏 */
@media (orientation: landscape) and (max-height: 520px) {
  .ad-hud { padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); }
  .ad-flag { top: calc(8px + env(safe-area-inset-top)); left: 10px; }
}
