:root {
  color-scheme: light;
  --brand: #ff5b1b;
  --brand-dark: #e64b13;
  --brand-hover: #cc3c08;
  --blush: #fff2e9;
  --ink: #332d2a;
  --muted: #756861;
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 91, 27, .13), transparent 30rem),
    radial-gradient(circle at 92% 88%, rgba(255, 88, 60, .09), transparent 28rem),
    #fffafa;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.loading-screen {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--blush);
}

.loading-screen p {
  margin: 0;
  font-size: 16px;
  letter-spacing: .12em;
}

.loading-fallback { display: none; }
.loading-fallback p { margin-bottom: 18px; color: var(--muted); font-size: 14px; letter-spacing: normal; }
.loading-fallback button {
  min-height: 48px;
  padding: 0 28px;
  border: 0;
  border-radius: 12px;
  color: white;
  background: var(--brand-dark);
  font: 700 15px/1 inherit;
  cursor: pointer;
}
html.app-timeout .loading-text { display: none; }
html.app-timeout .loading-fallback { display: block; }

html:not(.app-ready) .download-page,
html:not(.app-ready) .wechat-guide {
  visibility: hidden;
}

html.app-ready .loading-screen,
html.wechat-mode .download-page,
html.browser-mode .wechat-guide {
  display: none;
}

button, a { -webkit-tap-highlight-color: transparent; }

.download-page {
  position: relative;
  color: white;
  background: #ff5b1b;
  overflow: hidden;
}

html.browser-mode,
html.browser-mode body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  background: #ff5b1b;
}

.download-hero {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  padding: 24px 24px 22px;
  text-align: center;
}

.download-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.download-logo-shell {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  padding: 8px;
  border: 2px solid rgba(255, 255, 255, .92);
  border-radius: 19px;
  background: white;
  box-shadow: 0 10px 30px rgba(173, 49, 0, .18);
}

.download-logo-shell img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.download-copy { margin-top: 18px; }

.download-copy p {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  color: rgba(255, 255, 255, .92);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .12em;
}

.download-copy p::before,
.download-copy p::after {
  width: 54px;
  height: 1px;
  background: rgba(255, 255, 255, .52);
  content: "";
}

.download-copy h1 {
  margin: 0;
  font-size: clamp(36px, 10.6vw, 48px);
  line-height: 1.08;
  letter-spacing: -.035em;
  text-shadow: 0 5px 18px rgba(157, 39, 0, .14);
}

.download-visual {
  position: relative;
  flex: 0 0 auto;
  width: min(88vw, 390px);
  display: grid;
  place-items: center;
  margin: 8px 0;
}

.download-visual img {
  position: relative;
  z-index: 1;
  width: min(76vw, 330px);
  height: auto;
  filter: drop-shadow(0 24px 24px rgba(144, 28, 0, .18));
}

.download-button {
  width: min(100%, 420px);
  min-height: 64px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 16px 24px;
  border: 2px solid rgba(255, 255, 255, .34);
  border-radius: 999px;
  color: #762307;
  background: #ffd477;
  box-shadow: 0 16px 34px rgba(144, 28, 0, .2);
  text-align: center;
  text-decoration: none;
  font-size: 22px;
  font-weight: 900;
}

.browser-mode .icp-footer {
  position: static;
  padding: 0 16px max(16px, env(safe-area-inset-bottom));
  background: #ff5b1b;
}

.browser-mode .icp-footer a { color: rgba(70, 55, 51, .72); }

.download-button:hover { background: #ffe09a; }
.download-button:focus-visible, button:focus-visible { outline: 3px solid rgba(255, 91, 27, .28); outline-offset: 3px; }

@media (max-height: 700px) {
  .download-hero { padding-top: 14px; padding-bottom: 14px; }
  .download-logo-shell { width: 50px; height: 50px; padding: 6px; border-radius: 14px; }
  .download-copy { margin-top: 14px; }
  .download-copy p { margin-bottom: 8px; font-size: 13px; }
  .download-copy h1 { font-size: 34px; }
  .download-visual { margin: 4px 0; }
  .download-visual img { width: min(62vw, 235px); }
  .download-button { min-height: 56px; font-size: 20px; }
}

.wechat-guide {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  color: var(--ink);
  background: white;
  overflow: hidden;
}

.guide-primary {
  position: relative;
  width: min(100%, 520px);
  min-height: 0;
  margin: 0 auto;
  padding: max(92px, calc(env(safe-area-inset-top) + 74px)) 28px 28px;
  background: var(--blush);
}

.guide-arrow {
  position: absolute;
  z-index: 1;
  top: max(34px, calc(env(safe-area-inset-top) + 24px));
  right: 10px;
  width: clamp(150px, 42vw, 182px);
  height: auto;
  filter: brightness(0) saturate(100%) invert(48%) sepia(98%) saturate(3600%) hue-rotate(351deg) brightness(104%) contrast(102%);
  mix-blend-mode: normal;
  pointer-events: none;
}

.guide-primary-copy {
  position: relative;
  z-index: 3;
  max-width: 430px;
  margin-top: clamp(56px, 10vh, 94px);
}

.guide-badge {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  margin: 0 0 22px;
  padding: 0 14px;
  border-radius: 10px;
  color: white;
  background: var(--brand-dark);
  font-size: 14px;
  font-weight: 800;
}

.guide-primary h1 {
  max-width: 360px;
  margin: 0;
  font-size: clamp(30px, 9vw, 42px);
  line-height: 1.16;
  letter-spacing: -.04em;
}

.guide-primary-copy > p:not(.guide-badge) {
  max-width: 370px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.guide-primary-copy strong { color: var(--ink); }

.guide-route {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 30px;
}

.route-node {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border: 1px solid rgba(255, 91, 27, .36);
  border-radius: 999px;
  color: var(--brand);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 2px;
}

.route-node.browser { letter-spacing: 0; }
.route-separator { color: var(--brand); font-size: 25px; }

.guide-fallback {
  border-top: 1px solid #f3d8cb;
  background: white;
}

.guide-fallback-inner {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 28px 28px max(26px, env(safe-area-inset-bottom));
}

.guide-fallback h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
}

.guide-fallback p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

@keyframes guide-flash { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.guide-fallback.flash h2 { animation: guide-flash 1s ease-in-out infinite; transform-origin: left center; }
@media (prefers-reduced-motion: reduce) {
  .guide-fallback.flash h2 { animation: none !important; }
}

.guide-copy {
  width: 100%;
  min-height: 54px;
  display: grid;
  place-items: center;
  margin: 22px auto 0;
  border: 0;
  border-radius: 14px;
  color: white;
  background: var(--brand-dark);
  font: 700 16px/1 inherit;
  cursor: pointer;
}

.guide-status { min-height: 20px; text-align: center; color: var(--brand) !important; font-size: 13px !important; }

.qq-mode .guide-arrow,
.qq-mode .guide-route,
.qq-mode .guide-badge { display: none; }
.qq-mode .guide-primary { padding-top: max(88px, calc(env(safe-area-inset-top) + 74px)); }
.qq-mode .guide-primary-copy { margin-top: 0; }

@media (max-height: 700px) {
  .guide-primary { padding-top: max(66px, calc(env(safe-area-inset-top) + 52px)); }
  .guide-primary-copy { margin-top: 30px; }
  .guide-badge { margin-bottom: 14px; }
  .guide-primary h1 { font-size: 30px; }
  .guide-primary-copy > p:not(.guide-badge) { margin-top: 12px; }
  .guide-route { margin-top: 18px; }
  .guide-fallback-inner { padding-top: 22px; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .guide-copy { margin-top: 16px; }
}
.icp-footer {
  position: fixed;
  z-index: 30;
  right: 16px;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 16px;
  text-align: center;
  font-size: 13px;
}

.icp-footer a { color: #556274; text-decoration: none; }
.wechat-mode .icp-footer a { color: #9b7667; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
