:root {
    color-scheme: dark;
    --accent: #ffd243;
    --surface: rgba(15, 12, 28, 0.88);
    --line: rgba(255, 255, 255, 0.14);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: #080610;
    color: #fff;
    font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

body {
    min-width: 320px;
}

button,
a {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

.desktop-page {
    position: relative;
    display: block;
    min-height: 100svh;
    overflow: hidden;
    isolation: isolate;
    background: #080610 url("../images/desktop/background.webp") center / cover no-repeat;
}

.desktop-page::after {
    position: absolute;
    inset: 0;
    z-index: -1;
    content: "";
    background: linear-gradient(90deg, rgba(5, 4, 12, 0.08), rgba(5, 4, 12, 0) 60%, rgba(5, 4, 12, 0.14));
}

.site-header {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(1760px, calc(100% - 96px));
    margin: 0 auto;
    padding-top: 30px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand img {
    width: 68px;
    height: 68px;
}

.brand-name {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 0;
}

.brand-tagline {
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 15px;
}

.header-actions {
    display: flex;
    gap: 14px;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 0 19px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(20, 16, 35, 0.7);
    color: rgba(255, 255, 255, 0.88);
    font-size: 15px;
    backdrop-filter: blur(8px);
}

.contact-link img {
    width: 23px;
    height: 23px;
}

.desktop-copy {
    position: absolute;
    z-index: 2;
    top: 21%;
    left: max(5.8vw, 56px);
    width: min(46vw, 885px);
}

.desktop-title {
    width: min(46vw, 885px);
}

.desktop-download {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-top: 5vh;
}

.qr-block {
    flex: 0 0 auto;
    text-align: center;
}

.qr-shell {
    position: relative;
    flex: 0 0 auto;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 7px;
    background: #fff;
}

.scan-corner {
    position: absolute;
    width: 22px;
    height: 22px;
    border-color: var(--accent);
    border-style: solid;
    pointer-events: none;
}

.scan-corner.top-left {
    top: -5px;
    left: -5px;
    border-width: 3px 0 0 3px;
    border-radius: 6px 0 0;
}

.scan-corner.top-right {
    top: -5px;
    right: -5px;
    border-width: 3px 3px 0 0;
    border-radius: 0 6px 0 0;
}

.scan-corner.bottom-left {
    bottom: -5px;
    left: -5px;
    border-width: 0 0 3px 3px;
    border-radius: 0 0 0 6px;
}

.scan-corner.bottom-right {
    right: -5px;
    bottom: -5px;
    border-width: 0 3px 3px 0;
    border-radius: 0 0 6px;
}

.qr-label {
    margin-top: 11px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 14px;
}

.qr,
.qr canvas {
    width: 138px;
    height: 138px;
}

.download-copy h2 {
    margin: 0 0 8px;
    color: #f8d917;
    font-size: clamp(25px, 1.875vw, 36px);
    font-weight: 500;
}

.download-copy .scan-copy {
    margin: 0 0 14px;
    color: #fff;
    font-size: clamp(16px, 1.05vw, 20px);
}

.browser-tip {
    position: relative;
    width: min(28vw, 413px);
    min-width: 310px;
    padding: 7px 16px 8px;
    background: #f8d917;
    clip-path: polygon(1.8% 0, 100% 0, 98.7% 100%, 0 100%);
    color: #000;
    font-size: clamp(15px, 1.05vw, 20px);
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
}

.download-copy .security-copy {
    margin: 16px 0 18px;
    color: #fff;
    font-size: clamp(12px, 0.84vw, 16px);
    line-height: 1.45;
}

.figma-download {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 214px;
    aspect-ratio: 214 / 64;
    overflow: hidden;
    border: 2px solid #fff;
    border-radius: 100px;
    background: linear-gradient(90deg, #f50c61, #dc0720);
    transition: transform 160ms ease, filter 160ms ease;
}

.figma-download:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.download-icon {
    flex: 0 0 auto;
    object-fit: contain;
}

.apple-icon {
    width: 16.36%;
    height: 65.63%;
}

.android-icon {
    width: 20.09%;
    height: 67.19%;
}

.download-label {
    display: flex;
    min-width: 0;
    margin-left: 7px;
    flex-direction: column;
    color: #fff;
    line-height: 1;
    white-space: nowrap;
}

.download-label strong {
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 0;
}

.download-label small {
    margin-top: 4px;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0;
}

.desktop-hero {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 1;
    width: min(63.6vw, 1221px);
    max-height: 90vh;
    object-fit: contain;
    object-position: right bottom;
}

.mobile-page {
    display: none;
}

.download-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.72);
}

.download-options {
    width: min(340px, 100%);
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #171321;
}

.download-options h3 {
    margin: 0 0 18px;
    text-align: center;
    font-size: 18px;
}

.download-options button {
    width: 100%;
    min-height: 48px;
    margin-top: 10px;
    border: 0;
    border-radius: 6px;
    background: #fff;
    color: #171321;
    cursor: pointer;
}

@media (max-width: 767px) {
    .desktop-page {
        display: none;
    }

    .mobile-page {
        display: block;
        min-height: 100svh;
        padding-bottom: calc(122px + env(safe-area-inset-bottom));
        background: #080610 url("../images/mobile/background.webp") top center / 100% auto no-repeat;
    }

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: calc(14px + env(safe-area-inset-top)) 16px 12px;
    }

    .mobile-header .brand {
        gap: 9px;
    }

    .mobile-header .brand img {
        width: 43px;
        height: 43px;
    }

    .mobile-header .brand-name {
        font-size: 19px;
    }

    .mobile-header .brand-tagline {
        font-size: 10px;
    }

    .mobile-contact {
        display: flex;
        gap: 8px;
    }

    .mobile-contact a {
        display: grid;
        width: 38px;
        height: 38px;
        place-items: center;
        border: 1px solid var(--line);
        border-radius: 7px;
        background: rgba(20, 16, 35, 0.72);
    }

    .mobile-contact img {
        width: 21px;
        height: 21px;
    }

    .mobile-hero {
        position: relative;
        width: 100%;
        aspect-ratio: 750 / 324;
        overflow: hidden;
    }

    .mobile-hero-image {
        position: absolute;
        top: -6.2%;
        right: 2.5%;
        width: 54.8%;
        max-width: none;
    }

    .mobile-title {
        position: absolute;
        top: 23.8%;
        left: 0;
        z-index: 1;
        width: 54.4%;
        max-width: none;
    }

    .mobile-category-tabs {
        display: grid;
        width: calc(100% - 24px);
        height: 40px;
        margin: 10px 12px 0;
        padding: 4px 5px;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        align-items: center;
        border-radius: 8px;
        background: #2d2c2f;
        color: #fff;
        font-size: 12px;
        font-weight: 600;
        text-align: center;
    }

    .mobile-category-tabs a {
        display: grid;
        height: 32px;
        padding: 0;
        border: 0;
        place-items: center;
        border-radius: 6px;
        background: transparent;
        color: inherit;
        cursor: pointer;
    }

    .mobile-category-tabs .is-active {
        background: linear-gradient(90deg, #f40c60, #dd0723);
    }

    .mobile-content {
        position: relative;
        z-index: 2;
        padding: 10px 12px 20px;
    }

    .content-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px 8px;
    }

    .content-card {
        display: block;
        min-width: 0;
        overflow: hidden;
        border-radius: 6px;
        background: #15111e;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .content-card:active {
        opacity: 0.82;
    }

    .content-card img {
        width: 100%;
        aspect-ratio: 16 / 9;
        object-fit: cover;
    }

    .content-card p {
        display: -webkit-box;
        min-height: 45px;
        margin: 0;
        padding: 8px 9px 9px;
        overflow: hidden;
        color: rgba(255, 255, 255, 0.88);
        font-size: 13px;
        line-height: 1.45;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .mobile-download-bar {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 20;
        padding: 7px 7px calc(7px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--line);
        background: rgba(8, 6, 16, 0.94);
        backdrop-filter: blur(14px);
    }

    .mobile-download-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
    }

    .mobile-download-actions .figma-download {
        width: 100%;
        aspect-ratio: 214 / 64;
        border-width: 1px;
    }

    .mobile-download-actions .download-label {
        margin-left: 3px;
    }

    .mobile-download-actions .download-label strong {
        font-size: clamp(10px, 2.93vw, 22px);
    }

    .mobile-download-actions .download-label small {
        margin-top: 2px;
        font-size: clamp(6px, 1.73vw, 13px);
    }

    .install-hint {
        display: flex;
        margin-top: 8px;
        color: #f5b927;
        flex-direction: column;
        font-size: 14px;
        font-weight: 600;
        line-height: 1.45;
        text-align: center;
    }

    .install-hint strong,
    .install-hint span {
        font: inherit;
    }
}

@media (min-width: 768px) and (max-height: 760px) {
    .site-header {
        padding-top: 18px;
    }

    .desktop-copy {
        top: 18%;
    }

    .desktop-title {
        width: min(41vw, 760px);
    }

    .desktop-download {
        margin-top: 2.5vh;
    }

    .qr,
    .qr canvas {
        width: 112px;
        height: 112px;
    }
}
