/* ============================================================
 *  独立“添加到桌面”引导页样式（a2h- 前缀防冲突）
 * ============================================================ */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: #1f2333;
  background: linear-gradient(180deg, #f5ecff 0%, #ffffff 42%);
  min-height: 100vh;
}
.page { max-width: 640px; margin: 0 auto; padding: 44px 20px calc(120px + env(safe-area-inset-bottom)); }
.hero { text-align: center; padding-top: 20px; }
.logo-demo { display: inline-flex; border-radius: 24px; box-shadow: 0 12px 32px rgba(175, 82, 238, .28); overflow: hidden; }
.logo-demo img { display: block; }
h1 { font-size: 25px; margin: 22px 0 10px; }
.subtitle { color: #6b7088; font-size: 15px; margin: 0 0 28px; line-height: 1.6; }

.btn-install {
  display: inline-flex; align-items: center; gap: 10px;
  border: 0; border-radius: 999px; cursor: pointer;
  padding: 15px 34px; font-size: 17px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #b450f0, #d958d5);
  box-shadow: 0 10px 26px rgba(180, 80, 240, .38);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-install:active { transform: scale(.97); }
.btn-install__icon { display: inline-flex; }

.enter-line { margin: 16px 0 0; font-size: 14px; color: #8a8fa6; }
.enter-line a { color: #af52ee; font-weight: 700; text-decoration: none; }
.enter-line a:active { opacity: .7; }

.platforms { list-style: none; padding: 0; margin: 30px 0 0; text-align: left; display: grid; gap: 10px; }
.platforms li {
  background: #fff; border: 1px solid #f1e6fd; border-radius: 14px;
  padding: 12px 16px; font-size: 14px; color: #4a4f66; line-height: 1.6;
}
.platforms strong { color: #af52ee; margin-right: 6px; }

.debug-card, .tips {
  margin-top: 26px; background: #fff; border: 1px solid #f1e6fd;
  border-radius: 16px; padding: 18px 20px;
}
.debug-card h2, .tips h2 { font-size: 15px; margin: 0 0 12px; }
.debug-card dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13px; }
.debug-card dt { color: #8a8fa6; }
.debug-card dd { margin: 0; font-weight: 600; word-break: break-all; }
.tips details { border-top: 1px solid #f7f0fe; padding: 12px 0; font-size: 14px; }
.tips details:first-of-type { border-top: 0; }
.tips summary { cursor: pointer; font-weight: 600; color: #3a3f55; }
.tips p { color: #6b7088; line-height: 1.7; margin: 10px 0 0; }

/* ---------- 悬浮按钮 ---------- */
.a2h-fab {
  position: fixed; right: 16px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 9998;
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-radius: 999px; cursor: pointer;
  padding: 13px 20px; font-size: 15px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #b450f0, #d958d5);
  box-shadow: 0 8px 24px rgba(180, 80, 240, .42);
  opacity: 0; transform: translateY(18px) scale(.9);
  transition: opacity .35s ease, transform .35s cubic-bezier(.2,.9,.3,1.3);
}
.a2h-fab.a2h-show { opacity: 1; transform: translateY(0) scale(1); }
.a2h-fab.a2h-ready { animation: a2h-pulse 1.8s ease-in-out infinite; }
@keyframes a2h-pulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(180, 80, 240, .42); }
  50% { box-shadow: 0 8px 30px rgba(180, 80, 240, .75); }
}

/* ---------- 遮罩 + 底部卡片 ---------- */
.a2h-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(24, 12, 38, .55);
  backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.a2h-overlay.a2h-show { opacity: 1; visibility: visible; }
.a2h-sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: #fff; border-radius: 22px 22px 0 0;
  padding: 22px 22px calc(26px + env(safe-area-inset-bottom));
  max-width: 520px; margin: 0 auto;
  transform: translateY(110%);
  transition: transform .32s cubic-bezier(.22,.9,.3,1.1);
}
.a2h-overlay.a2h-show .a2h-sheet { transform: translateY(0); }
.a2h-sheet__close {
  position: absolute; top: 12px; right: 14px;
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: #f6f0fc; color: #777; font-size: 18px; line-height: 1; cursor: pointer;
}
.a2h-sheet__title { margin: 4px 0 4px; font-size: 19px; font-weight: 800; }
.a2h-sheet__desc { margin: 0 0 16px; font-size: 13.5px; color: #8a8fa6; line-height: 1.6; }
.a2h-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.a2h-step { display: flex; gap: 12px; align-items: flex-start; }
.a2h-step__num {
  flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%;
  background: #f3e8fd; color: #af52ee; font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.a2h-step__body { flex: 1; min-width: 0; }
.a2h-step__t { font-size: 15.5px; font-weight: 700; color: #262a3d; }
.a2h-step__d { font-size: 13px; color: #8a8fa6; margin-top: 3px; line-height: 1.6; }
.a2h-step__ic { vertical-align: -3px; margin: 0 3px; }
.a2h-sheet__foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid #f7f0fe; font-size: 13px; color: #8a8fa6; line-height: 1.6; }
.a2h-sheet__foot a { color: #af52ee; font-weight: 700; text-decoration: none; }

/* 内置浏览器：右上角箭头指引 */
.a2h-toparrow {
  position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 18px;
  width: 70px; height: 70px;
  animation: a2h-bounce 1.2s ease-in-out infinite;
}
@keyframes a2h-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.a2h-intip {
  position: absolute; top: calc(96px + env(safe-area-inset-top)); right: 16px; left: 70px;
  color: #fff; font-size: 16px; line-height: 1.7; font-weight: 600; text-align: right;
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.a2h-bounce-x { display: inline-block; animation: a2h-bounce-x 1.1s ease-in-out infinite; }
@keyframes a2h-bounce-x {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(7px); }
}

/* ---------- 安装成功轻提示 ---------- */
.a2h-toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  background: rgba(30, 20, 44, .92); color: #fff;
  padding: 12px 20px; border-radius: 12px; font-size: 14px; line-height: 1.5;
  z-index: 10000; opacity: 0; pointer-events: none; max-width: 86%; text-align: center;
  transition: opacity .25s ease, transform .25s ease;
}
.a2h-toast.a2h-show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 600px) {
  .a2h-sheet { border-radius: 22px; bottom: 24px; }
}

/* ============================================================
 *  通用按钮
 * ============================================================ */
.a2h-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; border: 0; border-radius: 13px; cursor: pointer;
  padding: 14px 18px; font-size: 15px; font-weight: 700;
  text-decoration: none; line-height: 1.35;
}
.a2h-btn--primary {
  color: #fff;
  background: linear-gradient(135deg, #b450f0, #d958d5);
  box-shadow: 0 8px 20px rgba(180, 80, 240, .32);
}
.a2h-btn--primary:active { transform: scale(.98); }
.a2h-btn--ghost { background: #f4f0f9; color: #6b6480; }
.a2h-btn__ic { display: inline-flex; align-items: center; }
.a2h-sheet { max-height: 88vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* ============================================================
 *  安卓权限引导卡
 * ============================================================ */
.a2h-warn {
  width: 48px; height: 48px; border-radius: 50%; margin: 2px 0 10px;
  background: linear-gradient(135deg, #ff9f43, #ff6b6b);
  color: #fff; font-size: 26px; font-weight: 900; font-style: italic;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px rgba(255, 120, 80, .35);
}
.a2h-perm__sub { font-size: 14px; font-weight: 700; margin: 14px 0 6px; color: #3a3f55; }
.a2h-rompath { list-style: none; margin: 0 0 10px; padding: 0; counter-reset: rp; }
.a2h-rompath li {
  display: flex; align-items: center; gap: 10px;
  background: #f8f4fe; border-radius: 10px;
  padding: 9px 12px; margin-bottom: 7px; font-size: 13.5px; color: #3a3450;
}
.a2h-rompath__n {
  flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%;
  background: #e7d8fb; color: #8a3fd8; font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.a2h-perm__tip {
  font-size: 13px; line-height: 1.6; color: #8a5a10;
  background: #fff6e3; border-radius: 10px; padding: 10px 12px; margin: 6px 0 14px;
}
.a2h-perm__actions { display: grid; gap: 10px; }
.a2h-perm__actions .a2h-btn--ghost { background: transparent; color: #9a93a8; font-weight: 500; padding: 8px; }
.a2h-permdetail { border-top: 1px solid #f7f0fe; padding: 12px 0; font-size: 13.5px; }
.a2h-permdetail summary { cursor: pointer; font-weight: 700; color: #af52ee; }
.a2h-permdetail__p { margin: 10px 0 6px; color: #6b7088; }

/* ============================================================
 *  iPhone 分步可视化教练
 * ============================================================ */
.a2h-overlay--coach { background: rgba(18, 10, 30, .82); backdrop-filter: blur(3px); }
.cs {
  position: relative; z-index: 1;
  width: 100%; max-width: 460px; height: 100vh; height: 100dvh;
  margin: 0 auto; display: flex; flex-direction: column;
}
.cs-close {
  position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 12px; z-index: 5;
  width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.16); color: #fff; font-size: 22px; line-height: 1; cursor: pointer;
}
.cs-browser { position: relative; flex: 1; min-height: 0; overflow: hidden; }

/* 场景容器 */
.cs-stage { position: absolute; inset: 0; display: flex; flex-direction: column; }
.cs-stage--sheet, .cs-stage--center { display: block; }
.cs-fakepage {
  flex: 1;
  background:
    radial-gradient(120px 70px at 30% 18%, rgba(180,80,240,.12), transparent),
    linear-gradient(180deg, #f6f2fc 0%, #ece6f6 55%, #e3dcef 100%);
}
.cs-fakepage--dim { height: 46%; flex: none; }
.cs-scene-note {
  text-align: center; font-size: 12.5px; color: #5d5470;
  margin: 8px 20px 0; line-height: 1.5;
}
.cs-scene-note--light { color: #fff; text-shadow: 0 1px 5px rgba(0,0,0,.4); }

/* 定位脉冲环 + 箭头 */
.cs-ring {
  position: absolute; inset: -9px; border-radius: 50%;
  border: 3px solid #ffd60a; pointer-events: none; z-index: 4;
  animation: cs-ring 1.5s ease-out infinite;
}
@keyframes cs-ring {
  0% { transform: scale(.85); opacity: .95; }
  70% { transform: scale(1.3); opacity: 0; }
  100% { transform: scale(1.3); opacity: 0; }
}
.cs-arrow {
  position: absolute; z-index: 5; pointer-events: none;
  font-style: normal; font-weight: 900; font-size: 20px; color: #ffd60a;
  text-shadow: 0 1px 6px rgba(0,0,0,.35);
  animation: cs-bob-up 1s ease-in-out infinite;
}
@keyframes cs-bob-up { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes cs-bob-right { 0%,100% { transform: translateX(0); } 50% { transform: translateX(6px); } }

/* Safari / Edge 底部工具栏 */
.cs-safaribar {
  flex: none; display: flex; align-items: center; justify-content: space-around;
  height: 66px; padding: 4px 14px calc(6px + env(safe-area-inset-bottom));
  background: rgba(248, 248, 250, .97);
  border-top: 1px solid #dcdce2;
  color: #1c1c1e; font-size: 17px;
}
.cs-sb-slot {
  position: relative; min-width: 54px; text-align: center;
  display: inline-flex; align-items: center; justify-content: center;
  color: #1c1c1e; opacity: .85;
}
.cs-sb-slot--small { font-size: 15px; letter-spacing: 2px; }
.cs-sb-share {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #0a84ff;
}
.cs-sb-target { color: #0a84ff; }
.cs-sb-target .cs-arrow { bottom: calc(100% + 4px); left: 50%; margin-left: -7px; }
.cs-edge-dots {
  width: 52px; height: 36px; border-radius: 18px; background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.18); letter-spacing: 2px; font-weight: 800;
}

/* Chrome 地址栏 */
.cs-chromebar-wrap { flex: none; padding: 0 12px 14px; }
.cs-chromebar {
  display: flex; align-items: center; gap: 8px;
  height: 46px; border-radius: 23px; padding: 0 14px;
  background: #f1f3f4; box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.cs-lock { color: #5f6368; display: inline-flex; }
.cs-url { flex: 1; font-size: 13px; color: #3c4043; white-space: nowrap; overflow: hidden; }
.cs-chrome-share {
  position: relative; flex: none; width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #0a84ff; border-radius: 50%;
}
.cs-chrome-share svg { width: 19px; height: 19px; }
.cs-chrome-share .cs-arrow { bottom: calc(100% + 2px); left: 50%; margin-left: -7px; }

/* 分享菜单卡片（图标宫格） */
.cs-sheetcard {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: #fff; border-radius: 20px 20px 0 0;
  padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 30px rgba(0,0,0,.25);
}
.cs-grab { width: 38px; height: 5px; border-radius: 3px; background: #d9d9de; margin: 4px auto 14px; }
.cs-tilegrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 8px; }
.cs-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; }
.cs-tile__ic {
  width: 46px; height: 46px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #b450f0, #d958d5); color: #fff;
}
.cs-tile__ic--gray { background: #e8e9ee; color: #c2c4cc; font-size: 18px; }
.cs-tile__lb { font-size: 11px; color: #777; text-align: center; line-height: 1.25; }
.cs-tile--target .cs-tile__lb { color: #8a3fd8; font-weight: 700; }
.cs-tile--target .cs-ring { border-radius: 15px; }
.cs-tile--target .cs-arrow { top: -26px; left: 50%; margin-left: -7px; }

/* 分享菜单（列表行） */
.cs-sheetcard--rows { padding-top: 8px; }
.cs-row {
  position: relative; display: flex; align-items: center; gap: 12px;
  height: 50px; border-bottom: 1px solid #f1f1f4; font-size: 15px; color: #333;
}
.cs-row:last-child { border-bottom: 0; }
.cs-row__ic {
  width: 30px; display: flex; align-items: center; justify-content: center;
  color: #8b8e98;
}
.cs-row__ic svg { width: 20px; height: 20px; }
.cs-row__tx { flex: 1; }
.cs-row__chev { color: #c4c6cf; font-size: 20px; }
.cs-row--target { color: #8a3fd8; font-weight: 700; }
.cs-row--target .cs-row__ic { color: #af52ee; }
.cs-row--target .cs-arrow--left {
  right: calc(100% + 4px); top: 50%; margin-top: -10px;
  animation: cs-bob-right 1s ease-in-out infinite;
}

/* 确认添加弹窗 */
.cs-confirm {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: #fff; border-radius: 20px 20px 0 0;
  padding: 6px 18px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 30px rgba(0,0,0,.25);
}
.cs-confirm__nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 46px; font-size: 16px; color: #333;
}
.cs-confirm__add { position: relative; color: #0a84ff; font-weight: 700; padding: 4px 6px; }
.cs-confirm__add .cs-ring { inset: -6px -10px; border-radius: 12px; }
.cs-confirm__title { text-align: center; font-size: 16px; font-weight: 700; margin: 6px 0 14px; }
.cs-confirm__row {
  display: flex; align-items: center; gap: 12px;
  background: #f7f7fa; border-radius: 12px; padding: 10px 14px; margin-bottom: 12px;
}
.cs-confirm__logo {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, #b450f0, #d958d5);
}
.cs-confirm__name { font-size: 15px; font-weight: 600; }
.cs-confirm__switch {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  border-radius: 12px; padding: 12px 14px; margin-bottom: 6px;
  background: #f0f9f1; color: #1c7a2e; font-size: 14px; font-weight: 700;
}
.cs-confirm__switch--on::after {
  content: ""; width: 46px; height: 28px; border-radius: 14px; background: #34c759; flex: none;
  position: relative; order: 2; margin-left: 10px;
}
.cs-switch-dot {
  position: absolute; right: 17px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: 50%; background: #fff; z-index: 2;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.cs-confirm__switch .cs-arrow { left: auto; right: 72px; top: 50%; margin-top: -10px; animation: cs-bob-up 1s ease-in-out infinite; }
.cs-arrow--topright { top: 42%; right: 16%; }

/* “在 Safari 中打开”场景 */
.cs-stage--center {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px;
}
.cs-opensafari { display: flex; align-items: center; gap: 18px; }
.cs-os-item { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cs-os-ic {
  width: 68px; height: 68px; border-radius: 20px; background: #fff;
  display: flex; align-items: center; justify-content: center; color: #0a84ff;
  box-shadow: 0 10px 26px rgba(0,0,0,.28);
}
.cs-os-ic--compass { color: #0a84ff; }
.cs-os-lb { font-size: 12.5px; color: #fff; text-align: center; line-height: 1.5; max-width: 110px; }
.cs-os-arrow { font-size: 30px; color: rgba(255,255,255,.75); }

/* 底部讲解卡 */
.cs-caption {
  flex: none; margin: 0 10px calc(10px + env(safe-area-inset-bottom));
  background: #fff; border-radius: 20px; padding: 16px 18px 18px;
  box-shadow: 0 -4px 30px rgba(0,0,0,.25);
}
.cs-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 10px; }
.cs-dot { width: 7px; height: 7px; border-radius: 4px; background: #e0d9ec; transition: all .25s; }
.cs-dot.is-on { width: 20px; background: #af52ee; }
.cs-title { margin: 0 0 6px; font-size: 17px; font-weight: 800; color: #221c33; }
.cs-desc { margin: 0 0 14px; font-size: 13.5px; line-height: 1.65; color: #6b7088; }
.cs-nav { display: flex; align-items: center; gap: 12px; }
.cs-nav > span { flex: 0 0 1px; }
.cs-nav .a2h-btn--ghost {
  width: auto; background: transparent; color: #9a8fb0;
  padding: 12px 4px; box-shadow: none;
}
.cs-nav .a2h-btn--primary { flex: 1; }

@media (max-height: 640px) {
  .cs-title { font-size: 16px; }
  .cs-desc { font-size: 13px; margin-bottom: 10px; }
  .cs-os-ic { width: 56px; height: 56px; border-radius: 16px; }
  .cs-fakepage--dim { height: 38%; }
}
