:root {
  --background: #F7F8FC;
  --surface: #FFFFFF;
  --surface-soft: #FAFBFD;
  --primary: #6C63FF;
  --secondary: #9B6BFF;
  --gold: #F6C85F;
  --text-1: #1F2638;
  --text-2: #667085;
  --text-3: #8C94AA;
  --border: #E5E9F2;
  --dark: #070B1C;
  --dark-alt: #0C1230;
  --dark-surface: #121936;
  --dark-surface-2: #182145;
  --dark-border: #35406F;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-width: 320px; min-height: 100%; background: var(--background); }
body { color: var(--text-1); }
button, input { font: inherit; letter-spacing: 0; }
button { border: 0; }
.hidden { display: none !important; }

#app { width: min(100%, 480px); min-height: 100svh; margin: 0 auto; background: var(--background); }
.h5-page { position: relative; min-height: 100svh; overflow: hidden; background: var(--background); }
.h5-wrap { position: relative; z-index: 1; width: 100%; min-height: 812px; overflow: hidden; }
.h5-hero { position: relative; height: 220px; overflow: hidden; padding: calc(var(--safe-top) + 28px) 20px 20px; color: #fff; background: linear-gradient(145deg, #08102E, #2B1765); }
.h5-hero::after { content: ""; position: absolute; width: 230px; height: 230px; right: -78px; top: -78px; border-radius: 50%; background: radial-gradient(circle, rgba(92,184,255,.35), transparent 65%); }
.h5-hero::before, .success-page::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 7% 8%, rgba(255,255,255,.8) 0 1px, transparent 1.5px), radial-gradient(circle at 18% 13%, rgba(255,255,255,.7) 0 1px, transparent 1.5px), radial-gradient(circle at 44% 16%, rgba(246,200,95,.8) 0 1px, transparent 1.5px), radial-gradient(circle at 73% 14%, rgba(255,255,255,.7) 0 1px, transparent 1.5px), radial-gradient(circle at 91% 31%, rgba(255,255,255,.65) 0 1px, transparent 1.5px), radial-gradient(circle at 19% 55%, rgba(255,255,255,.55) 0 1px, transparent 1.5px); }
.hero-content { position: relative; z-index: 2; }
.brand-mark { display: flex; align-items: center; white-space: nowrap; }
.brand-mark img { width: 48px; height: 48px; margin-right: 12px; border-radius: 14px; object-fit: cover; }
.brand-name { font-size: 26px; line-height: 34px; font-weight: 600; }
.brand-subtitle { margin-top: 2px; color: #D6D9EB; font-size: 13px; line-height: 20px; }
.welcome-title { margin-top: 24px; font-size: 18px; line-height: 26px; font-weight: 600; }
.welcome-subtitle { margin-top: 5px; color: #D6D9EB; font-size: 13px; line-height: 20px; }

.h5-content { position: relative; z-index: 2; margin-top: -20px; padding: 0 20px 24px; }
.h5-card { padding: 20px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); box-shadow: 0 10px 30px rgba(28,36,66,.08); }
.field { margin: 0 0 14px; }
.field-label { display: block; margin: 0 0 6px 2px; color: var(--text-2); font-size: 13px; line-height: 20px; }
.input-wrap { display: flex; align-items: center; height: 52px; padding: 0 14px; border: 1px solid #E0E4EE; border-radius: 14px; background: var(--surface-soft); }
.input-wrap:focus-within { border-color: var(--primary); }
.input-icon { flex: 0 0 20px; width: 20px; height: 20px; margin-right: 10px; color: #B8C0D9; }
.input, .input-wrap .input { min-width: 0; flex: 1; width: 100%; height: 50px; padding: 0; color: var(--text-1); border: 0; outline: 0; background: transparent; font-size: 15px; line-height: 22px; }
.input::placeholder { color: #98A0B3; }
.input-tail { flex: 0 0 auto; margin-left: 8px; color: #5B5FEF; font-size: 13px; line-height: 20px; cursor: pointer; }
.input-tail:disabled { color: var(--text-3); cursor: default; }
.password-toggle { display: grid; flex: 0 0 24px; width: 24px; height: 24px; place-items: center; color: #8C94AA; background: transparent; cursor: pointer; }
.password-toggle svg { width: 20px; height: 20px; }
.agreement { display: flex; align-items: flex-start; gap: 6px; margin: 2px 0 14px; color: #667085; font-size: 12px; line-height: 18px; }
.agreement input { flex: 0 0 16px; width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--primary); }
.agreement a { color: #5B5FEF; text-decoration: none; }
.h5-btn { display: flex; width: 100%; height: 52px; align-items: center; justify-content: center; border-radius: 14px; color: #fff; background: linear-gradient(135deg, var(--primary), var(--secondary)); font-size: 16px; line-height: 20px; font-weight: 600; cursor: pointer; }
.h5-btn:disabled { opacity: .55; cursor: default; }
.h5-note { margin-top: 12px; color: var(--text-3); font-size: 12px; line-height: 18px; text-align: center; }

.success-page { position: relative; min-height: 100svh; overflow: hidden; padding: calc(var(--safe-top) + 92px) 24px 28px; color: #fff; text-align: center; background: linear-gradient(180deg, #09102B, #24165D); }
.state-icon { position: relative; z-index: 1; display: grid; width: 96px; height: 96px; margin: 0 auto; place-items: center; border: 1px solid rgba(67,214,163,.42); border-radius: 48px; color: #43D6A3; background: rgba(67,214,163,.14); }
.state-icon svg { width: 48px; height: 48px; }
.success-page h1 { position: relative; z-index: 1; margin: 24px 0 0; font-size: 26px; line-height: 34px; font-weight: 600; }
.success-page p { position: relative; z-index: 1; margin: 9px 0 0; color: #CDD2E5; font-size: 15px; line-height: 22px; }
.success-page .sub { margin-top: 6px; color: #929BBA; font-size: 13px; line-height: 20px; }
.progress { position: relative; z-index: 1; width: 260px; height: 4px; margin: 30px auto 0; overflow: hidden; border-radius: 4px; background: rgba(255,255,255,.12); }
.progress::after { content: ""; display: block; width: 72%; height: 4px; background: linear-gradient(90deg, var(--primary), var(--secondary)); }
.success-page .h5-btn { position: relative; z-index: 1; margin-top: 34px; }

.download-page { min-height: 100svh; background: var(--background); }
.download-hero { height: 260px; padding: calc(var(--safe-top) + 24px) 20px 20px; color: #fff; text-align: center; background: linear-gradient(145deg, #08102E, #2B1765); }
.download-hero .brand-mark { display: block; }
.download-hero .brand-mark img { width: 92px; height: 92px; margin: 0 auto; border-radius: 24px; box-shadow: 0 12px 30px rgba(0,0,0,.3); }
.download-hero .brand-name { margin-top: 10px; font-size: 24px; line-height: 32px; }
.download-hero .brand-subtitle { margin-top: 4px; }
.download-content { position: relative; z-index: 2; margin-top: -28px; padding: 0 20px 24px; }
.download-card { padding: 20px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); box-shadow: 0 10px 30px rgba(28,36,66,.08); }
.release-head { display: flex; justify-content: space-between; gap: 12px; color: var(--text-1); }
.release-name { font-size: 16px; line-height: 22px; font-weight: 600; }
.release-meta { margin-top: 4px; color: var(--text-3); font-size: 12px; line-height: 18px; }
.release-status { flex: 0 0 auto; color: #16A36A; font-size: 12px; line-height: 18px; }
.download-divider { height: 1px; margin: 16px 0; background: var(--border); }
.download-title { color: var(--text-1); font-size: 14px; line-height: 20px; font-weight: 600; }
.download-copy { margin-top: 7px; color: var(--text-2); font-size: 13px; line-height: 20px; }
.download-button { margin-top: 18px; }
.download-button svg { width: 20px; height: 20px; margin-right: 7px; color: #D6D9EB; }
.sha { margin-top: 13px; color: var(--text-3); font-size: 12px; line-height: 18px; overflow-wrap: anywhere; }
.install-card { margin-top: 12px; }

.document-page { min-height: 100svh; background: #fff; }
.topbar { display: flex; height: 56px; align-items: center; border-bottom: 1px solid var(--border); background: #fff; }
.topbar .back { display: grid; flex: 0 0 56px; width: 56px; height: 56px; place-items: center; color: #B8C0D9; background: transparent; cursor: pointer; }
.topbar .back svg { width: 22px; height: 22px; }
.topbar h1 { flex: 1; margin: 0; padding-right: 56px; color: var(--text-1); font-size: 18px; line-height: 26px; font-weight: 600; text-align: center; }
.legal-body { min-height: calc(100svh - 56px); padding: 18px 20px 28px; overflow: auto; }
.legal-body h2 { margin: 0 0 12px; color: var(--text-1); font-size: 18px; line-height: 26px; font-weight: 600; }
.legal-body p { margin: 0 0 14px; color: var(--text-2); font-size: 14px; line-height: 24px; }
.skeleton { height: 12px; margin-bottom: 9px; border-radius: 6px; background: #EEF1F6; }
.skeleton.w90 { width: 90%; }.skeleton.w76 { width: 76%; }.skeleton.w62 { width: 62%; }

.overlay { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.72); }
.dialog { width: min(328px, 100%); padding: 20px; border: 1px solid var(--dark-border); border-radius: 24px; color: #F8FAFF; background: var(--dark-surface); text-align: center; }
.dialog-icon { display: grid; width: 64px; height: 64px; margin: 0 auto; place-items: center; border: 1px solid rgba(246,200,95,.35); border-radius: 50%; color: var(--gold); background: rgba(246,200,95,.12); }
.dialog-icon svg { width: 32px; height: 32px; }
.dialog h2 { margin: 14px 0 0; color: #F8FAFF; font-size: 18px; line-height: 26px; font-weight: 600; }
.dialog .muted { margin: 4px 0 0; color: #B8C0D9; font-size: 13px; line-height: 20px; }
.question { min-height: 72px; margin: 14px 0 10px; display: grid; place-items: center; border-radius: 16px; color: var(--gold); background: var(--dark-surface-2); font-size: 24px; line-height: 32px; font-weight: 600; }
.dialog .input { display: block; width: 100%; height: 52px; padding: 0 14px; border: 1px solid #2B355F; border-radius: 14px; color: #F8FAFF; background: var(--dark-surface-2); font-size: 14px; }
.dialog .button { width: 100%; height: 52px; margin-top: 12px; border-radius: 16px; color: #fff; background: linear-gradient(135deg, var(--primary), var(--secondary)); font-size: 16px; font-weight: 600; cursor: pointer; }
.dialog .button.outline { color: #C8C4FF; background: transparent; border: 1px solid var(--primary); }
.toast { position: fixed; z-index: 20; left: 50%; bottom: calc(24px + var(--safe-bottom)); width: max-content; max-width: calc(100% - 40px); transform: translateX(-50%); padding: 10px 14px; border-radius: 12px; color: #F8FAFF; background: #202A52; font-size: 13px; line-height: 20px; text-align: center; }

@media (max-width: 375px) {
  .h5-content, .download-content { padding-left: 16px; padding-right: 16px; }
}
