/* ============================================================================
   消费者前台 · 一屏搞定（无滚动）
   设计目标：所有内容控制在 1 屏内，功能区尽量小、密、清。
   --fit 由 js/ui.js 的 fit() 自动测算写入（1 → 0.845），保证小屏手机也不出现滚动条。
   类名约定：.shell = 整页容器；.pbtn = 平台直达按钮（避免与容器 .app 重名冲突）
   ========================================================================== */

html, body { height: 100%; }
body.consumer { overflow: hidden; }

.shell {
  width: min(460px, 100%);
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;      /* 间距已统一，剩余空间只影响上下页边距 */
  gap: var(--gap, 8px);
  padding: calc(9px * var(--fit)) calc(11px * var(--fit)) 0;
}

/* ---------------------------------------------------------------- 顶栏 */
.topbar {
  display: flex;
  align-items: center;
  gap: calc(9px * var(--fit));
  padding: calc(8px * var(--fit)) calc(11px * var(--fit));
  border-radius: var(--r-lg);
  flex: none;
}
.brand-mark {
  width: calc(34px * var(--fit));
  height: calc(34px * var(--fit));
  flex: none;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(16px * var(--fit));
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #3d80ff, var(--blue));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 8px 18px -10px rgba(10, 92, 255, 0.9);
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-text { min-width: 0; flex: 1; }
.brand-name {
  font-size: calc(15px * var(--fit));
  font-weight: 650;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-sub {
  font-size: calc(11px * var(--fit));
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.pill {
  flex: none;
  font-size: calc(10px * var(--fit));
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 99px;
  padding: 3px 9px;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- 主区
   顶栏 / 四张卡片 / 底部说明之间的间距全部等于 --gap（由 js/ui.js 统一算出来）：
   先把内容按最小间距排好，再把富余空间平均分给每一处间距，保证「每个间距都一样」。 */
main {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--gap, 8px);
}
.card { padding: calc(10px * var(--fit)) calc(11px * var(--fit)); flex: none; }
.card-head { margin-bottom: calc(7px * var(--fit)); }
.card-head .push { margin-left: auto; }

/* 文案气泡 */
.review {
  position: relative;
  border-radius: 13px;
  border-top-left-radius: 4px;
  padding: calc(8px * var(--fit)) calc(10px * var(--fit));
  font-size: calc(14px * var(--fit));
  line-height: 1.55;
  color: var(--ink);
  background: rgba(10, 92, 255, 0.075);
  border: 1px solid rgba(10, 92, 255, 0.12);
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
}
.review::before {
  content: "";
  position: absolute;
  left: -1px;
  top: -1px;
  border: 6px solid transparent;
  border-top-color: rgba(10, 92, 255, 0.12);
  border-left-color: rgba(10, 92, 255, 0.12);
}
.review.is-full { -webkit-line-clamp: unset; overflow: visible; }

/* 图片选择 */
.thumbs { display: grid; gap: calc(6px * var(--fit)); }
.thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid var(--hair);
  background: rgba(11, 18, 32, 0.05);
  cursor: pointer;
  padding: 0;
  transition: transform var(--fast) var(--ease);
}
.thumb:active { transform: scale(0.95); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb[aria-pressed="false"] img { filter: saturate(0.5) opacity(0.75); }
.thumb[aria-pressed="true"] {
  border-color: rgba(10, 92, 255, 0.9);
  box-shadow: 0 0 0 2px rgba(10, 92, 255, 0.85), 0 6px 14px -10px rgba(10, 92, 255, 0.9);
}
.thumb .tick {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 1px 4px rgba(11, 18, 32, 0.3);
}
.thumb[aria-pressed="false"] .tick { display: none; }
.no-photo {
  font-size: calc(11.5px * var(--fit));
  color: var(--ink-3);
  padding: calc(9px * var(--fit)) 0;
  text-align: center;
}

/* 复制区 */
.copy-row { display: flex; gap: calc(6px * var(--fit)); }
.copy-row .btn { height: calc(38px * var(--fit)); font-size: calc(13px * var(--fit)); padding: 0 8px; flex: 1; white-space: nowrap; }
.copy-row .btn--primary { flex: 1.35; }

/* 一键直达 */
.apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: calc(4px * var(--fit)); }
.pbtn {
  /* 图标底板尺寸：默认 46px，5 个平台时收到 42px（由 js 设置 --tile-scale），并随 --fit 缩放 */
  --tile-size: calc(var(--tile-scale, 46) * var(--fit) * 1px);
  --tile-radius: 33%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(4px * var(--fit));
  padding: calc(3px * var(--fit)) 2px;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
  border-radius: 12px;
  transition: transform var(--fast) var(--ease);
}
.pbtn:active { transform: scale(0.93); }
.pbtn .btile { border-radius: calc(15px * var(--fit)); }
.pbtn .char {
  font-size: calc(19px * var(--fit));
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--ink);
}
.pbtn .name { font-size: calc(10.5px * var(--fit)); color: var(--ink-2); font-weight: 500; white-space: nowrap; }
/* 5 个平台时字号略收一点，保证「高德地图」四个字也放得下 */
.apps[data-count="5"] .pbtn .name { font-size: calc(9.8px * var(--fit)); }

/* 底部说明 */
.foot {
  flex: none;
  text-align: center;
  font-size: calc(10px * var(--fit));
  color: var(--ink-3);
  padding: calc(6px * var(--fit)) 0 calc(7px * var(--fit));
  padding-bottom: calc(7px * var(--fit) + env(safe-area-inset-bottom));
}

/* 全屏加载 / 出错 */
.state {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 24px;
  z-index: 70;
  background: transparent;
}
.state .spin {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2.5px solid rgba(10, 92, 255, 0.2);
  border-top-color: var(--blue);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.state h2 { font-size: 16px; font-weight: 650; }
.state p { font-size: 13px; color: var(--ink-2); max-width: 30em; }
.state[hidden] { display: none; }

/* 打开 App 时的提示（部分机型跳转瞬间会闪白） */
.jump-tip {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 88;
  font-size: 12px;
  color: #fff;
  background: rgba(11, 18, 32, 0.86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-radius: 99px;
  padding: 8px 15px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--norm) var(--ease);
}
.jump-tip.show { opacity: 1; }

/* 小屏兜底（极矮机型：进一步压缩留白） */
@media (max-height: 660px) {
  .shell { padding-top: 6px; }
}
@media (max-width: 340px) {
  .pbtn .name { font-size: 9.5px; }
}
