@font-face {
  font-family: "Cwei Sans";
  src: url("assets/cwei-sans.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  font-family: "Cwei Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  --ink: #25222e;
  --muted: #6b6578;
  --accent: #6741d9;
  --accent-hover: #5631be;
  --line: #e2dee9;
  --surface: #fcfbfe;
  --hero: #f5f3fa;
  --stage: #eae4f7;
  --gutter: 40px;
  color: var(--ink);
  background: var(--surface);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
body { margin: 0; line-height: 1.65; }
body.has-modal { overflow: hidden; }
h1, h2, p, figure { margin: 0; }
h1, h2 { line-height: 1.2; }
img { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
a, button, summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
.wrap { width: min(1200px, calc(100% - 2 * var(--gutter))); margin-inline: auto; }

.mast { background: var(--surface); }
.mast-inner { height: 88px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.mast-brand { display: inline-flex; align-items: center; gap: 11px; font-size: 20px; font-weight: 750; letter-spacing: -.035em; white-space: nowrap; }
.mast-brand img { border-radius: 9px; }
.mast nav { display: flex; gap: 34px; font-size: 14px; color: var(--muted); }
.mast nav a { display: inline-flex; align-items: center; min-height: 44px; }
.mast nav a:hover { color: var(--accent); }

.hero { background: var(--hero); }
.hero-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; padding-block: 52px 36px; }
.product { padding: 0 0 44px 14px; }
.app-icon { width: 88px; height: 88px; border-radius: 23px; margin-bottom: 25px; }
h1 { font-size: clamp(52px, 5.65vw, 78px); letter-spacing: -.055em; font-weight: 850; white-space: nowrap; }
.product-kind { margin-top: 20px; font-size: 22px; font-weight: 400; color: var(--muted); letter-spacing: .02em; }
.download-area { margin-top: 37px; display: flex; align-items: center; gap: 26px; }
.download-controls { display: flex; flex-direction: column; align-items: stretch; }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 11px; min-width: 212px; min-height: 60px; padding: 14px 28px; color: #fcfbff; background: var(--accent); border: 1px solid transparent; border-radius: 14px; font-size: 17px; font-weight: 650; white-space: nowrap; }
.primary:hover { background: var(--accent-hover); }
.release { display: flex; justify-content: center; align-items: center; gap: 9px; margin-top: 13px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.scan { flex: none; display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.scan > img { background: white; border: 1px solid var(--line); border-radius: 12px; width: 116px; height: 116px; image-rendering: pixelated; }
.scan > span { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.scan .qr { display: none; }
.scan:hover { color: var(--accent); }
.icon { display: inline-block; flex: none; width: 21px; height: 21px; background: currentColor; -webkit-mask: var(--glyph) center / contain no-repeat; mask: var(--glyph) center / contain no-repeat; }
.down { --glyph: url("assets/download.svg"); }
.qr { --glyph: url("assets/qr-code.svg"); }
.close { --glyph: url("assets/x.svg"); }

.home-preview { min-width: 0; scroll-margin-top: 24px; }
.preview-stage { display: grid; justify-items: center; position: relative; isolation: isolate; padding: 0 20px 0; }
.preview-stage::before { content: ""; position: absolute; z-index: -1; inset: 54px 6px 26px; background: var(--stage); border-radius: 120px 36px 120px 36px; }
.screenshot { position: relative; display: block; width: 294px; background: #24232b; padding: 8px 7px 10px; border: 1px solid #4c4957; border-radius: 38px; box-shadow: 0 28px 42px -21px rgb(62 44 98 / .4), inset 0 0 0 2px #57535f; cursor: zoom-in; }
.device-top { display: grid; place-items: center; height: 13px; margin-bottom: 5px; }
.device-top > span { display: block; width: 38px; height: 3px; background: #504c58; border-radius: 3px; }
.screenshot > img { width: 100%; height: auto; aspect-ratio: 720 / 1480; border-radius: 21px 21px 29px 29px; background: #f2f4f5; }
.home-preview figcaption { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin-top: 20px; font-size: 12px; color: var(--muted); }
#preview-title { font-weight: 650; }

.install { display: grid; grid-template-columns: .95fr 1fr; gap: 72px; padding-block: 42px 39px; }
.help-heading h2 { font-size: 23px; font-weight: 700; margin-top: 4px; }
.backup-line { color: var(--muted); font-size: 14px; margin-top: 13px; }
.text-link { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.help-items { min-width: 0; }
details + details { border-top: 1px solid var(--line); }
summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 48px; padding-block: 10px; cursor: pointer; font-size: 15px; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; flex: none; width: 17px; height: 17px; background: currentColor; -webkit-mask: url("assets/chevron-down.svg") center / contain no-repeat; mask: url("assets/chevron-down.svg") center / contain no-repeat; color: var(--muted); }
details[open] summary::after { transform: rotate(180deg); }
details p { padding: 0 25px 15px 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.footer, .footer div { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 24px; }
.footer { justify-content: space-between; border-top: 1px solid var(--line); padding-block: 22px 28px; font-size: 12px; color: var(--muted); }
.footer a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

dialog { max-width: calc(100% - 24px); max-height: calc(100% - 24px); margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink); }
dialog:not([open]) { display: none; }
dialog::backdrop { background: rgb(22 17 34 / .77); }
.viewer-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 52px; padding-inline: 16px 5px; }
.viewer-head strong { font-size: 16px; font-weight: 650; }
.symbol { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px; background: transparent; cursor: pointer; }
.symbol:hover { background: var(--hero); }
.symbol .icon { pointer-events: none; }
.symbol:focus-visible { outline-offset: -4px; }
#viewer { width: max-content; }
#viewer-image { max-width: 100%; width: auto; height: auto; max-height: calc(100vh - 86px); max-height: calc(100dvh - 86px); margin-inline: auto; }
#scan-dialog { width: 300px; text-align: center; }
#scan-dialog > img { margin: 12px auto 0; width: 216px; max-width: 100%; height: auto; image-rendering: pixelated; border-radius: 10px; }
#scan-dialog > p { margin: 12px 0 22px; color: var(--muted); font-size: 13px; }
#scan-dialog .text-link { margin-left: 12px; }

@media (min-width: 1600px) {
  .wrap { width: min(1280px, calc(100% - 2 * var(--gutter))); }
  .hero-inner { padding-block: 56px 40px; }
  .screenshot { width: 312px; }
  h1 { font-size: 84px; }
  .product-kind { font-size: 24px; }
  .preview-stage::before { inset-inline: 32px; }
}
@media (max-width: 1023px) and (min-width: 768px) {
  :root { --gutter: 28px; }
  .hero-inner { gap: 18px; padding-block: 38px 30px; }
  .product { padding-left: 0; }
  h1 { font-size: 50px; }
  .product-kind { font-size: 18px; }
  .download-area { gap: 16px; align-items: flex-start; }
  .primary { min-width: 176px; min-height: 54px; padding-inline: 18px; font-size: 16px; }
  .scan > img { width: 100px; height: 100px; }
  .screenshot { width: 264px; border-radius: 34px; }
  .preview-stage { padding-inline: 8px; }
  .preview-stage::before { inset-inline: 0; border-radius: 90px 28px 90px 28px; }
  .install { gap: 32px; }
}
@media (min-width: 1024px) and (max-height: 850px) {
  .mast-inner { height: 80px; }
  .hero-inner { padding-block: 30px 26px; }
  .screenshot { width: 264px; border-radius: 35px; }
  .app-icon { width: 80px; height: 80px; margin-bottom: 21px; }
  h1 { font-size: 70px; }
  .product { padding-bottom: 25px; }
  .product-kind { margin-top: 16px; }
  .download-area { margin-top: 28px; }
  .preview-stage::before { inset-block: 35px 22px; }
  .home-preview figcaption { margin-top: 16px; }
}
@media (max-width: 767px) {
  :root { --gutter: 24px; }
  .mast-inner { height: 70px; gap: 16px; }
  .mast-brand { font-size: 17px; gap: 8px; }
  .mast-brand img { width: 31px; height: 31px; border-radius: 8px; }
  .mast nav { gap: 18px; font-size: 13px; }
  .mast nav a:first-child { display: none; }
  .hero-inner { grid-template-columns: 1fr; gap: 34px; padding-block: 34px 26px; }
  .product { padding: 0; text-align: center; }
  .app-icon { display: none; }
  h1 { font-size: clamp(42px, 10vw, 62px); letter-spacing: -.055em; }
  .product-kind { margin-top: 11px; font-size: 17px; letter-spacing: 0; }
  .download-area { justify-content: center; align-items: flex-start; gap: 10px; margin-top: 25px; }
  .primary { min-width: 0; min-height: 54px; padding: 12px 22px; font-size: 16px; border-radius: 12px; gap: 8px; }
  .release { margin-top: 11px; font-size: 12px; }
  .scan { justify-content: center; min-height: 54px; padding: 12px 15px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 12px; font-size: 15px; }
  .scan > img { display: none; }
  .scan .qr { display: inline-block; width: 18px; height: 18px; }
  .preview-stage { padding-inline: 0; }
  .preview-stage::before { inset: 38px -7px 20px; border-radius: 90px 28px 90px 28px; }
  .screenshot { width: min(278px, 87%); border-radius: 35px; padding: 7px 6px 9px; }
  .home-preview figcaption { margin-top: 17px; font-size: 11px; gap: 4px 10px; }
  .install { grid-template-columns: 1fr; gap: 18px; padding-block: 29px 30px; }
  .help-heading h2 { font-size: 21px; }
  .backup-line { margin-top: 8px; font-size: 13px; }
  .footer { display: block; padding-block: 20px 25px; font-size: 11px; }
  .footer div { gap: 5px 14px; margin-top: 6px; }
}
@media (max-width: 359px) {
  :root { --gutter: 20px; }
  .primary { padding-inline: 14px; font-size: 15px; }
  .scan { padding-inline: 11px; font-size: 14px; }
  .product-kind { font-size: 16px; }
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #f0edf8; --muted: #b5aec4; --accent: #b9a1ff; --accent-hover: #cbb9ff; --line: #3a3448; --surface: #1c1924; --hero: #17151e; --stage: #2e2641; }
  .primary { background: #8358eb; color: #fff; }
  .primary:hover { background: #7446df; }
  .screenshot { box-shadow: 0 28px 42px -21px rgb(8 5 18 / .8), inset 0 0 0 2px #57535f; }
}
@media (prefers-reduced-motion: no-preference) {
  .primary, .scan, .symbol { transition: transform 160ms ease, background-color 160ms ease; }
  .primary:active, .scan:active, .symbol:active { transform: scale(.97); }
  .screenshot { transition: transform 200ms ease; }
  @media (hover: hover) {
    .screenshot:hover { transform: translateY(-4px); }
  }
}
