:root {
  --paper: #f4efe6;
  --ink: #1f1a14;
  --muted: rgba(31, 26, 20, 0.62);
  --line: rgba(31, 26, 20, 0.12);
  --glass: rgba(255, 251, 245, 0.78);
  --shadow: 0 18px 40px rgba(31, 26, 20, 0.16);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "SF Pro Text", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 520px at 12% -8%, #f8d9a8 0%, transparent 52%),
    radial-gradient(720px 480px at 100% 0%, #c9d7c3 0%, transparent 46%),
    linear-gradient(180deg, #e7ddd0 0%, var(--paper) 38%, #efe6d8 100%);
}

body.page-hub,
body.page-install {
  min-height: 100dvh;
}

a {
  color: inherit;
}

.wrap {
  width: min(440px, 100%);
  margin: 0 auto;
  padding: 28px 20px calc(32px + env(safe-area-inset-bottom));
}

.kicker {
  margin: 0 0 8px;
  letter-spacing: 0.22em;
  font-size: 11px;
  color: var(--muted);
}

h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.lead {
  margin: 0 0 28px;
  line-height: 1.7;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding: 16px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--glass);
  box-shadow: var(--shadow);
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.card:active {
  transform: scale(0.98);
}

.card.selected {
  outline: 3px solid var(--ink);
  box-shadow: 0 0 0 4px rgba(31, 26, 20, 0.12), var(--shadow);
}

.icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  box-shadow: 0 10px 20px rgba(31, 26, 20, 0.18);
  object-fit: cover;
}

.card h2,
.site-name {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.card p,
.site-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.card .go {
  margin-top: auto;
  padding: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 8px 8px;
}

.hero .icon {
  width: 92px;
  height: 92px;
  border-radius: 24px;
}

.hero .site-name {
  margin-top: 18px;
  font-size: 24px;
}

.hero .site-url {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
  word-break: break-all;
}

.panel {
  margin-top: 24px;
  padding: 18px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--glass);
  box-shadow: var(--shadow);
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

button,
.btn {
  appearance: none;
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  font: inherit;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  color: #fff;
  background: var(--ink);
}

.btn-primary:disabled {
  cursor: wait;
  opacity: 0.55;
}

.btn-ghost {
  color: var(--ink);
  background: rgba(31, 26, 20, 0.06);
}

.hint,
.steps {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.steps {
  padding-left: 18px;
}

.steps li + li {
  margin-top: 8px;
}

.share-ico,
.menu-ico {
  display: inline-flex;
  width: 18px;
  height: 18px;
  vertical-align: -3px;
  margin: 0 2px;
}

.back {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
}

.sheet {
  position: fixed;
  inset: 0;
  display: none;
  place-items: end center;
  background: rgba(31, 26, 20, 0.42);
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  z-index: 20;
}

.sheet.open {
  display: grid;
}

.sheet-card {
  width: min(440px, 100%);
  padding: 20px 18px 16px;
  border-radius: 24px;
  background: #fffaf3;
  box-shadow: var(--shadow);
}

.sheet-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.sheet-hero .icon {
  width: 56px;
  height: 56px;
}

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

.footer-tip {
  margin: 28px 0 0;
}

.ok {
  color: #047857;
  font-weight: 650;
}

.active-site {
  margin-top: 8px;
}

.active-site[hidden],
.card[hidden],
#hubTitle[hidden],
#hubLead[hidden],
#grid[hidden] {
  display: none !important;
}

.install-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px 16px calc(88px + env(safe-area-inset-bottom));
  background: rgba(15, 12, 8, 0.72);
  backdrop-filter: blur(8px);
}

.install-overlay.open {
  display: flex;
}

.install-overlay-inner {
  width: min(400px, 100%);
  padding: 24px 20px 18px;
  border-radius: 28px;
  background: #fffaf3;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  text-align: center;
  counter-reset: step;
}

.install-overlay-icon {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  box-shadow: 0 14px 28px rgba(31, 26, 20, 0.22);
}

.install-overlay-kicker {
  margin: 16px 0 6px;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--muted);
}

.install-overlay-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
}

.install-overlay-lead {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.install-steps-big {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
  font-size: 15px;
  line-height: 1.55;
}

.install-steps-big li {
  position: relative;
  padding: 10px 0 10px 36px;
  border-top: 1px solid var(--line);
}

.install-steps-big li:first-child {
  border-top: 0;
}

.install-steps-big .ios-share-ico {
  margin: 0 1px;
}

.install-steps-big li::before {
  content: counter(step);
  counter-increment: step;
  position: absolute;
  left: 0;
  top: 10px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
}

.install-overlay-btn {
  width: 100%;
  margin-top: 18px;
  min-height: 52px;
  padding: 16px;
  font-size: 17px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.install-overlay-btn.pulse {
  animation: install-pulse 1.6s ease-in-out infinite;
}

@keyframes install-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(31, 26, 20, 0.35);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(31, 26, 20, 0);
  }
}

.install-overlay-status {
  margin: 12px 0 0;
  min-height: 1.4em;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.install-overlay-skip {
  margin-top: 10px;
  padding: 8px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.ios-coachmark {
  position: fixed;
  inset: 0;
  z-index: 200;
  cursor: pointer;
}

.ios-coachmark[hidden] {
  display: none !important;
}

.ios-coachmark-dim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
}

.ios-coachmark-bubble {
  position: absolute;
  width: min(340px, calc(100% - 32px));
  padding: 16px 18px;
  border-radius: 16px;
  background: #fff;
  color: #111;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  cursor: default;
}

.ios-coachmark.is-safari .ios-coachmark-bubble {
  left: 16px;
  right: 16px;
  width: auto;
  bottom: calc(138px + env(safe-area-inset-bottom));
}

.ios-coachmark.is-chrome .ios-coachmark-bubble {
  top: calc(86px + env(safe-area-inset-top));
  right: 14px;
}

.ios-coachmark-share {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  color: #3a3a3c;
}

.ios-share-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #007aff;
  vertical-align: -4px;
}

.ios-share-ico svg {
  display: block;
  width: 20px;
  height: 20px;
}

.ios-coachmark-tap {
  margin: 12px 0 0;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.45);
  text-align: center;
}

.ios-coachmark-title {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

.ios-coachmark-steps {
  margin: 0;
  padding: 0 0 0 22px;
  font-size: 15px;
  line-height: 1.55;
}

.ios-coachmark-steps li + li {
  margin-top: 8px;
}

.ios-coachmark-arrow {
  position: absolute;
}

.ios-coachmark-arrow svg {
  width: 28px;
  height: 58px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45));
}

.ios-coachmark.is-safari .ios-coachmark-arrow {
  left: 0;
  right: 0;
  bottom: calc(50px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  animation: coachmark-arrow-bounce-down 1.1s ease-in-out infinite;
}

.ios-coachmark.is-chrome .ios-coachmark-arrow {
  top: calc(10px + env(safe-area-inset-top));
  right: 18px;
  animation: coachmark-arrow-bounce-up 1.1s ease-in-out infinite;
}

.ios-coachmark.is-chrome .ios-coachmark-arrow svg {
  transform: rotate(180deg);
}

@keyframes coachmark-arrow-bounce-down {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(8px);
  }
}

@keyframes coachmark-arrow-bounce {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(8px);
  }
}

@keyframes coachmark-arrow-bounce-up {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.install-page .hero {
  padding-top: 32px;
}

.install-page .hero .lead {
  margin: 10px 0 0;
  max-width: 22em;
}

.install-guide {
  margin-top: 22px;
}

.install-browser + .install-browser {
  margin-top: 16px;
}

.install-browser h2 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding: 0 4px;
  font-size: 15px;
  font-weight: 700;
}

.install-browser h2 small {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.install-browser .install-steps-big {
  margin-top: 0;
  padding: 4px 16px 8px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--glass);
  box-shadow: var(--shadow);
}

.install-browser.is-now .install-steps-big {
  outline: 3px solid var(--ink);
  box-shadow: 0 0 0 4px rgba(31, 26, 20, 0.12), var(--shadow);
}

.install-apk-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
  isolation: isolate;
}

.install-apk-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin: 0;
  position: relative;
  z-index: 1;
}

.install-apk-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  position: relative;
  z-index: 2;
}

.install-apk-row .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 48px;
  min-width: 0;
  min-height: 48px;
  max-height: 48px;
  margin: 0;
  padding: 0 8px;
  font-size: 15px;
  overflow: hidden;
}

.btn-open {
  color: #fff;
  background: #00bec9;
}

.install-apk-ico {
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  overflow: hidden;
  line-height: 0;
}

.install-apk-ico svg {
  display: block;
  width: 18px;
  height: 18px;
  max-width: 18px;
  max-height: 18px;
}

.install-apk-actions .btn:disabled,
.install-apk-actions .btn.is-off,
.install-apk-btn.is-off {
  pointer-events: none;
  opacity: 0.45;
  cursor: not-allowed;
}

.install-apk-btn.pulse {
  animation: install-pulse 1.6s ease-in-out infinite;
}

.install-note {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  text-align: center;
}

.install-note + .install-note {
  margin-top: 8px;
}
