/* 添加到主屏幕 guide (htmltibiu416/custom/add-to-screen.html, linked from the home quick links). */
.a2hs-page { width: min(760px, 100%); margin: 0 auto 32px; color: var(--tb-ink, #14171a); }
.a2hs-page [hidden] { display: none !important; }

.a2hs-intro { display: flex; align-items: center; gap: 14px; padding: 16px; }
.a2hs-intro__icon { flex: none; width: 56px; height: 56px; overflow: hidden; border-radius: 14px; background: var(--tb-fill, #f4f4f4); }
.a2hs-intro__icon img { display: block; width: 100%; height: 100%; object-fit: cover; }
.a2hs-intro h2 { margin: 0 0 4px; font-size: 17px; font-weight: 600; line-height: 1.4; }
.a2hs-intro p { margin: 0; color: var(--tb-muted, #6b7279); font-size: 14px; line-height: 1.6; }

.a2hs-note { margin: 0 16px 12px; padding: 12px 14px; border-radius: 12px; background: #fff4e5; color: #8a4b00; font-size: 14px; line-height: 1.6; }
.a2hs-note--ok { background: #e8f5ee; color: var(--tb-success, #147e56); }

.a2hs-tabs { padding: 0 16px; border-bottom: 1px solid var(--tb-divider, #eff3f4); }

.a2hs-steps { margin: 0; padding: 0 16px; list-style: none; counter-reset: a2hs-step; }
.a2hs-step { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--tb-divider, #eff3f4); }
.a2hs-step::before {
  counter-increment: a2hs-step; content: counter(a2hs-step);
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--tb-btn-primary, #14171a); color: #fff; font-size: 14px; font-weight: 600;
}
.a2hs-step h3 { margin: 3px 0 4px; font-size: 15px; font-weight: 600; line-height: 1.5; }
.a2hs-step p { margin: 0; color: var(--tb-ink-2, #4f555b); font-size: 14px; line-height: 1.7; }

.a2hs-key {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 6px; background: var(--tb-fill, #f4f4f4); color: var(--tb-ink, #14171a);
  font-size: 13px; font-weight: 500; line-height: 1; white-space: nowrap; vertical-align: 1px;
}
.a2hs-key ti-icon { --ti-icon-size: 16px; width: 16px; height: 16px; }

.a2hs-help { padding: 8px 16px 0; }
.a2hs-help h2 { margin: 16px 0 4px; font-size: 15px; font-weight: 600; line-height: 1.5; }
.a2hs-help p { margin: 0 0 12px; color: var(--tb-muted, #6b7279); font-size: 14px; line-height: 1.6; }
.a2hs-help__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Animated phone demo ----------
 * The page script sets data-scene 1–5 on .a2hs-demo (4 steps, then the home screen).
 * The screen is 164×340; --fx/--fy place the tap marker in screen pixels. */
.a2hs-guide { padding: 16px 16px 0; }
.a2hs-guide .a2hs-steps { padding: 0; }
.a2hs-guide .a2hs-step { cursor: pointer; }
.a2hs-step.is-current::before { background: var(--tb-primary, #2196f3); }
@media (min-width: 600px) {
  .a2hs-guide { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 28px; align-items: start; }
}
.a2hs-demo { display: flex; justify-content: center; padding-bottom: 8px; }
.a2hs-phone { flex: none; padding: 6px; border-radius: 30px; background: #14171a; box-shadow: 0 10px 28px rgb(17 24 39 / 16%); }
.a2hs-screen {
  position: relative; width: 164px; height: 340px; overflow: hidden; border-radius: 24px;
  background: #fff; color: #1c1c1e; font-size: 10px; line-height: 1.3; user-select: none;
}
.a2hs-screen *, .a2hs-screen *::before, .a2hs-screen *::after { box-sizing: border-box; }
.a2hs-mini-icon { display: block; flex: none; width: 26px; aspect-ratio: 1; border-radius: 22%; background: #2196f3 url(/apple-touch-icon.png?v=20261204e) center / cover no-repeat; }
.a2hs-target { transition: background-color .2s ease; }

/* Page behind the browser chrome */
.a2hs-web { position: absolute; left: 0; right: 0; top: 0; bottom: 72px; padding: 14px 10px 0; }
.a2hs-web__bar { display: flex; align-items: center; height: 22px; }
.a2hs-web__logo { color: #2196f3; font-size: 14px; font-weight: 700; letter-spacing: -.02em; }
.a2hs-web__body { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.a2hs-web__body i { display: block; height: 86px; border-radius: 6px; background: #eceef1; }

/* iPhone Safari */
.a2hs-safari { position: absolute; left: 0; right: 0; bottom: 0; height: 72px; border-top: 1px solid #e5e5ea; background: #f6f6f8; }
.a2hs-safari__url {
  position: absolute; left: 8px; right: 8px; top: 6px; height: 30px; display: flex; align-items: center; justify-content: center;
  overflow: hidden; border-radius: 10px; background: #e9e9ee; color: #3c3c43; font-size: 9px; white-space: nowrap; transition: box-shadow .2s ease;
}
.a2hs-safari__tools { position: absolute; left: 0; right: 0; bottom: 8px; height: 24px; display: grid; grid-template-columns: repeat(5, 1fr); place-items: center; color: #007aff; font-size: 16px; }
.a2hs-safari__share { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; transition: background-color .2s ease; }
.a2hs-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; height: 200px; padding: 0 8px; border-radius: 14px 14px 0 0;
  background: #f2f2f7; box-shadow: 0 -4px 16px rgb(0 0 0 / 12%); transform: translateY(105%); transition: transform .45s ease;
}
.a2hs-sheet__head { display: flex; align-items: center; gap: 6px; height: 40px; overflow: hidden; white-space: nowrap; }
.a2hs-sheet__head .a2hs-mini-icon { width: 22px; }
.a2hs-sheet__rows { display: grid; overflow: hidden; border-radius: 10px; background: #fff; }
.a2hs-sheet__rows span { display: flex; align-items: center; justify-content: space-between; height: 30px; padding: 0 10px; border-top: 1px solid #ececf0; }
.a2hs-sheet__rows span:first-child { border-top: 0; }
.a2hs-confirm { position: absolute; inset: 0; padding: 12px 10px; background: #f2f2f7; transform: translateY(100%); transition: transform .45s ease; }
.a2hs-confirm__bar { display: flex; align-items: center; justify-content: space-between; height: 30px; }
.a2hs-confirm__bar span { padding: 2px 4px; border-radius: 6px; color: #007aff; }
.a2hs-confirm__bar b { font-weight: 600; }
.a2hs-confirm__app { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px; overflow: hidden; border-radius: 10px; background: #fff; white-space: nowrap; }
.a2hs-confirm__app .a2hs-mini-icon { width: 36px; }

/* Android Chrome */
.a2hs-demo--android .a2hs-web { top: 44px; bottom: 0; padding-top: 6px; }
.a2hs-chrome { position: absolute; left: 0; right: 0; top: 0; height: 44px; border-bottom: 1px solid #eceef1; background: #fff; }
.a2hs-chrome__url {
  position: absolute; left: 8px; right: 30px; top: 10px; height: 26px; display: flex; align-items: center; padding-left: 10px;
  overflow: hidden; border-radius: 13px; background: #f1f3f4; color: #3c4043; font-size: 9px; white-space: nowrap; transition: box-shadow .2s ease;
}
.a2hs-chrome__more { position: absolute; right: 6px; top: 10px; display: grid; place-items: center; width: 20px; height: 26px; border-radius: 6px; color: #3c4043; font-size: 14px; font-weight: 700; transition: background-color .2s ease; }
.a2hs-menu {
  position: absolute; top: 6px; right: 6px; width: 112px; display: grid; padding: 4px 0; border-radius: 8px; background: #fff;
  box-shadow: 0 4px 16px rgb(0 0 0 / 18%); opacity: 0; transform: scale(.6); transform-origin: top right; transition: transform .25s ease, opacity .25s ease;
}
.a2hs-menu span { display: flex; align-items: center; height: 26px; padding: 0 12px; }
.a2hs-dialog { position: absolute; inset: 0; background: rgb(0 0 0 / 32%); opacity: 0; transition: opacity .3s ease; }
.a2hs-dialog__card { position: absolute; left: 14px; right: 14px; top: 115px; height: 110px; padding: 14px; border-radius: 14px; background: #fff; }
.a2hs-dialog__card b { font-size: 11px; font-weight: 600; }
.a2hs-dialog__app { display: flex; align-items: center; gap: 8px; margin-top: 10px; overflow: hidden; white-space: nowrap; }
.a2hs-dialog__app .a2hs-mini-icon { width: 28px; }
.a2hs-dialog__actions { position: absolute; right: 14px; bottom: 8px; display: flex; align-items: center; gap: 14px; height: 26px; color: #1a73e8; font-weight: 600; }
.a2hs-dialog__actions span { padding: 2px 4px; border-radius: 6px; }

/* Home screen with the new icon */
.a2hs-home {
  position: absolute; inset: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-content: start; gap: 16px 10px; padding: 34px 14px;
  background: linear-gradient(160deg, #a1c4fd, #c2e9fb 45%, #fbc2eb); opacity: 0; transition: opacity .4s ease;
}
.a2hs-home i { display: block; aspect-ratio: 1; border-radius: 22%; background: rgb(255 255 255 / 55%); }
.a2hs-home__new { display: grid; justify-items: center; gap: 3px; transform: scale(0); }
.a2hs-home__new .a2hs-mini-icon { width: 100%; box-shadow: 0 2px 6px rgb(0 0 0 / 18%); }
.a2hs-home__new em { max-width: 100%; overflow: hidden; color: #fff; font-size: 7px; font-style: normal; white-space: nowrap; text-shadow: 0 1px 2px rgb(0 0 0 / 35%); }

/* Tap marker */
.a2hs-finger {
  position: absolute; left: 0; top: 0; z-index: 5; width: 22px; height: 22px; border: 2px solid #fff; border-radius: 50%;
  background: rgb(20 23 26 / 28%); box-shadow: 0 1px 4px rgb(0 0 0 / 30%); pointer-events: none;
  transform: translate(calc(var(--fx, 82px) - 11px), calc(var(--fy, 289px) - 11px));
  transition: transform .55s cubic-bezier(.3, .7, .3, 1), opacity .3s ease;
}
.a2hs-finger::after { content: ""; position: absolute; inset: -2px; border: 2px solid #fff; border-radius: 50%; opacity: 0; animation: a2hs-tap 1.1s ease-out .55s infinite; }
@keyframes a2hs-tap { from { opacity: .9; transform: scale(.8); } to { opacity: 0; transform: scale(2.1); } }
@keyframes a2hs-pop { 0% { transform: scale(0); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* Scenes: iPhone */
.a2hs-demo--ios[data-scene="1"] .a2hs-safari__url { box-shadow: inset 0 0 0 2px #007aff; }
.a2hs-demo--ios[data-scene="2"] .a2hs-finger { --fx: 82px; --fy: 320px; }
.a2hs-demo--ios[data-scene="2"] .a2hs-safari__share { background: rgb(0 122 255 / 14%); }
.a2hs-demo--ios[data-scene="3"] .a2hs-finger { --fx: 64px; --fy: 255px; }
.a2hs-demo--ios:is([data-scene="4"], [data-scene="5"]) .a2hs-finger { --fx: 140px; --fy: 27px; }
.a2hs-demo--ios:is([data-scene="3"], [data-scene="4"], [data-scene="5"]) .a2hs-sheet { transform: none; }
.a2hs-demo--ios[data-scene="3"] .a2hs-sheet .a2hs-target { background: #e5e5ea; }
.a2hs-demo--ios:is([data-scene="4"], [data-scene="5"]) .a2hs-confirm { transform: none; }
.a2hs-demo--ios[data-scene="4"] .a2hs-confirm .a2hs-target { background: rgb(0 122 255 / 14%); }

/* Scenes: Android */
.a2hs-demo--android .a2hs-finger { --fx: 71px; --fy: 23px; }
.a2hs-demo--android[data-scene="1"] .a2hs-chrome__url { box-shadow: inset 0 0 0 2px #1a73e8; }
.a2hs-demo--android[data-scene="2"] .a2hs-finger { --fx: 148px; --fy: 23px; }
.a2hs-demo--android[data-scene="2"] .a2hs-chrome__more { background: #f1f3f4; }
.a2hs-demo--android[data-scene="3"] .a2hs-finger { --fx: 88px; --fy: 101px; }
.a2hs-demo--android[data-scene="3"] .a2hs-menu { opacity: 1; transform: none; }
.a2hs-demo--android[data-scene="3"] .a2hs-menu .a2hs-target { background: #f1f3f4; }
.a2hs-demo--android:is([data-scene="4"], [data-scene="5"]) .a2hs-finger { --fx: 122px; --fy: 204px; }
.a2hs-demo--android:is([data-scene="4"], [data-scene="5"]) .a2hs-dialog { opacity: 1; }
.a2hs-demo--android[data-scene="4"] .a2hs-dialog .a2hs-target { background: rgb(26 115 232 / 12%); }

/* Scene 5 (both): home screen, the icon pops in, the marker fades where it last tapped */
.a2hs-demo[data-scene="5"] .a2hs-home { opacity: 1; }
.a2hs-demo[data-scene="5"] .a2hs-home__new { animation: a2hs-pop .5s ease-out .35s both; }
.a2hs-demo[data-scene="5"] .a2hs-finger { opacity: 0; }

/* Restarting from scene 5 jumps back without sliding everything out. */
.a2hs-demo[data-instant] *, .a2hs-demo[data-instant] *::after { transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .a2hs-demo *, .a2hs-demo *::after { transition: none !important; animation: none !important; }
  .a2hs-demo[data-scene="5"] .a2hs-home__new { transform: none; }
}
