/* ==========================================================================
   设计 token  —  克制浅色游戏分发
   ========================================================================== */
:root {
  --primary:         #29B6F6;
  --primary-dark:    #0288D1;
  --primary-light:   #4FC3F7;
  --primary-glow:    rgba(41, 182, 246, .28);

  --bg-1:            #EEF4FA;
  --bg-2:            #DDE9F4;
  --bg-3:            #F7FAFD;

  --surface:         #ffffff;
  --surface-2:       #F4F7FB;
  --surface-3:       #EAF1F8;

  --text:            #1A1D29;
  --text-muted:      #5A6478;
  --text-faint:      #9098AD;

  --border:          #E4EAF1;
  --divider:         #EEF1F5;

  --warning-bg:      #FFF4E5;
  --warning-text:    #B05A00;
  --warning-icon:    #F59E0B;

  --shadow-card:     0 1px 2px rgba(20, 40, 80, .04),
                     0 12px 32px rgba(20, 40, 80, .08);
  --shadow-button:   0 6px 16px var(--primary-glow);
  --shadow-button-active: 0 2px 6px var(--primary-glow);

  --radius-xl:       20px;
  --radius-lg:       16px;
  --radius-md:       12px;
  --radius-sm:       8px;
  --radius-pill:     999px;

  --easing:          cubic-bezier(.4, 0, .2, 1);
}

body[data-theme="android"] {
  --primary:         #26A69A;
  --primary-dark:    #00897B;
  --primary-light:   #4DB6AC;
  --primary-glow:    rgba(38, 166, 154, .25);
  --bg-1:            #ECF7F4;
  --bg-2:            #D5EDE8;
  --bg-3:            #F4FAF8;
}

/* ==========================================================================
   基础
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
               "Microsoft YaHei", "Source Han Sans CN", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg-3) 0%, var(--bg-1) 100%);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

#app {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px 48px;
}

/* 全屏 loading */
.van-loading {
  min-height: 60vh;
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--text-muted) !important;
}
.van-loading__text { color: var(--text-muted) !important; margin-top: 12px; }

/* ==========================================================================
   主卡片（iOS = .page-container；Android = .container）
   ========================================================================== */
.page-container, .container {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 22px 22px;
  box-shadow: var(--shadow-card);
  animation: cardIn .45s var(--easing) both;
  position: relative;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   Hero 区  —  横排 icon + name/meta/desc（iOS / Android 共用结构）
   ========================================================================== */
.hero {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 4px 4px 18px;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 18px;
}
.hero-info {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 10px;
}
.meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  line-height: 1.4;
}
.meta-chip.meta-version {
  background: var(--surface-2);
  color: var(--primary-dark);
  border: 1px solid var(--border);
}
.meta-chip.meta-platform {
  background: var(--primary);
  color: #fff;
}
.hero-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-icon-wrapper {
  position: relative;
  width: 84px;
  height: 84px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}

/* Section label  —  用 sub-header 替代之前各自独立成块的卡片视觉 */
.section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-faint);
  letter-spacing: .8px;
  text-transform: uppercase;
  margin: 18px 4px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::before {
  content: "";
  width: 3px;
  height: 14px;
  background: var(--primary);
  border-radius: 2px;
}

.app-icon {
  width: 100%;
  height: 100%;
  border-radius: 24%;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  box-shadow:
    0 4px 14px rgba(20, 40, 80, .12),
    0 1px 2px rgba(20, 40, 80, .06);
  overflow: hidden;
}
.app-icon img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* ==========================================================================
   文案
   ========================================================================== */
.app-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--text);
  line-height: 1.25;
  margin: 0;
}

/* ==========================================================================
   渠道标签 banner（顶部 notice-bar）
   ========================================================================== */
.van-notice-bar.van-notice-bar--wrapable {
  margin: 0 0 18px !important;
  border-radius: var(--radius-md) !important;
  font-size: 13px !important;
}
.page-container > .van-notice-bar:first-child {
  margin-top: -8px !important;
}

/* ==========================================================================
   安装按钮
   ========================================================================== */
.install-button {
  height: 50px !important;
  margin: 20px 0 22px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  letter-spacing: .3px !important;
  color: #fff !important;
  background: linear-gradient(180deg, var(--primary-light), var(--primary)) !important;
  border: 0 !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-button) !important;
  transition: transform .15s var(--easing), box-shadow .25s var(--easing) !important;
}
.install-button:active {
  transform: scale(.98);
  box-shadow: var(--shadow-button-active) !important;
}

/* ==========================================================================
   信息组  —  bento 网格布局
   ========================================================================== */
.info-group {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 8px !important;
  margin: 0 0 4px !important;
  background: transparent !important;
}
.info-group .van-cell {
  flex-direction: column !important;
  align-items: center !important;
  text-align: center;
  padding: 14px 8px !important;
  background: var(--surface-2) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
  gap: 6px;
}
.info-group .van-cell::after { display: none !important; }
.info-group .van-cell__title {
  color: var(--text-faint) !important;
  font-weight: 500 !important;
  font-size: 11px !important;
  letter-spacing: .3px;
  margin: 0 !important;
  flex: none !important;
}
.info-group .van-cell__value {
  color: var(--text) !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  text-align: center !important;
  flex: none !important;
  word-break: break-all;
}
.info-group .van-icon {
  color: var(--primary) !important;
  font-size: 22px !important;
  margin: 0 !important;
}

/* ==========================================================================
   安装须知（橙色 notice-bar）
   ========================================================================== */
.install-notice {
  margin: 0 0 18px !important;
  padding: 14px 16px !important;
  background: var(--warning-bg) !important;
  color: var(--warning-text) !important;
  border-radius: var(--radius-md) !important;
  border: 1px solid rgba(245, 158, 11, .18);
  font-size: 13px !important;
  line-height: 1.6 !important;
  align-items: flex-start !important;
}
.install-notice .van-notice-bar__wrap,
.install-notice .van-notice-bar__content {
  white-space: normal !important;
  padding: 0 !important;
  height: auto !important;
}
.install-notice strong {
  display: block;
  font-weight: 600;
  color: var(--warning-icon);
  margin-bottom: 4px;
  font-size: 13px;
}
.install-notice .van-icon {
  color: var(--warning-icon) !important;
  margin-right: 8px !important;
}

/* ==========================================================================
   安装教程（自定义 step 列表，不依赖 vant-collapse / vant-step）
   ========================================================================== */
.tutorial {
  margin: 0 0 4px;
  padding: 16px 14px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
/* 教程头部内置标题已由外层 .section-label 替代，留 meta 计数 */
.tutorial-head {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  margin-bottom: 10px;
}
.tutorial-title { display: none; }
.tutorial-meta {
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 500;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.step {
  display: flex;
  gap: 14px;
  padding: 0 0 16px;
  position: relative;
}
.step:last-child { padding-bottom: 0; }
/* 序号之间的连接线 */
.step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary-light), var(--divider));
  opacity: .5;
}

.step-num {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 30%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--primary-glow), inset 0 1px 0 rgba(255, 255, 255, .35);
  position: relative;
  z-index: 1;
}
.step-emphasize .step-num {
  box-shadow:
    0 0 0 4px rgba(99, 102, 241, .12),
    0 6px 14px var(--primary-glow),
    inset 0 1px 0 rgba(255, 255, 255, .35);
}

.step-body { flex: 1; min-width: 0; padding-top: 4px; }
.step-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.step-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--warning-bg);
  color: var(--warning-text);
  letter-spacing: .5px;
}
.step-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-muted);
}
.step-desc em {
  font-style: normal;
  color: var(--primary-dark);
  font-weight: 600;
  padding: 1px 6px;
  background: var(--surface-2);
  border-radius: 4px;
}
.step-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-faint);
  font-style: italic;
}

/* 路径面包屑 */
.path-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin: 10px 0 4px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}
.crumb {
  display: inline-block;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}
.crumb-action {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #fff;
  border-color: transparent;
}
.crumb-sep {
  color: var(--text-faint);
  font-size: 14px;
  font-weight: 600;
}
.crumb-mini {
  display: inline-block;
  padding: 3px 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 12px;
  color: var(--text);
  font-family: -apple-system, "PingFang SC", sans-serif;
  margin: 0 2px;
  white-space: nowrap;
}

/* Android 厂商路径列表 */
.vendor-paths {
  list-style: none;
  margin: 8px 0 4px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vendor-paths li {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
}
.vendor-paths strong {
  color: var(--text);
  font-weight: 600;
  margin-right: 4px;
}

/* ==========================================================================
   FAQ（原生 details/summary）
   ========================================================================== */
.faq {
  margin: 0 0 14px;
}
.faq-title { display: none; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color .15s var(--easing), box-shadow .2s var(--easing);
}
.faq-item:hover { border-color: var(--primary-light); }
.faq-item[open] {
  border-color: var(--primary-light);
  box-shadow: 0 2px 8px rgba(20, 40, 80, .04);
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 18px;
  color: var(--primary);
  font-weight: 400;
  transition: transform .2s var(--easing);
  flex-shrink: 0;
}
.faq-item[open] summary::after {
  content: "−";
  transform: rotate(180deg);
}
.faq-item summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
.faq-answer {
  padding: 0 14px 14px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
  border-top: 1px dashed var(--divider);
  margin-top: 0;
  padding-top: 12px;
}

/* ==========================================================================
   页脚
   ========================================================================== */
.footer {
  margin-top: 8px;
  padding-top: 16px;
  text-align: center;
  border-top: 1px solid var(--divider);
}
.footer .van-divider { display: none; }
.footer-text {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 4px;
}
.footer-note {
  font-size: 11px;
  color: var(--text-faint);
  margin: 0;
}

/* ==========================================================================
   Captcha 弹窗
   ========================================================================== */
.captcha-container {
  padding: 8px 4px;
  text-align: center;
}
.captcha-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
}
.captcha-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 18px;
}
.turnstile-box {
  display: flex;
  justify-content: center;
  min-height: 65px;
  margin: 4px 0 0;
}

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 480px) {
  #app { padding: 16px 12px 32px; }
  .page-container, .container {
    padding: 24px 16px 18px;
    border-radius: 18px;
  }
  .app-name { font-size: 19px; }
  .hero { gap: 14px; padding-bottom: 16px; margin-bottom: 14px; }
  .app-icon-wrapper { width: 72px; height: 72px; }
  .install-button { height: 48px !important; font-size: 15px !important; }
  .info-group .van-cell__value { font-size: 13px !important; }
  .info-group .van-icon { font-size: 20px !important; }
  .section-label { margin-top: 14px; }
}

/* 大屏：稍微再放大一点 */
@media (min-width: 768px) {
  .page-container, .container {
    max-width: 520px;
    padding: 40px 32px 28px;
  }
}

/* ==========================================================================
   无障碍：focus 可见 + 减少动画
   ========================================================================== */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .install-button::after { display: none; }
}

/* ==========================================================================
   通用 Vant 覆盖
   ========================================================================== */
.van-button--primary {
  background: linear-gradient(135deg, var(--primary-light), var(--primary)) !important;
  border: 0 !important;
}
.van-button--primary:hover { opacity: .95; }
.van-cell { line-height: 1.5 !important; }
.van-cell-group { background: transparent !important; }
.van-popup { max-width: 90vw; }
