:root {
    --paper: #f7f4ed;
    --paper-deep: #eee9de;
    --ink: #211f1c;
    --ink-soft: #66615a;
    --red: #b72c20;
    --red-dark: #8f1f17;
    --line: rgba(50, 45, 39, 0.14);
    --white: #fffdfa;
    --shadow: 0 24px 70px rgba(56, 44, 33, 0.13);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body.guide-open {
    overflow: hidden;
}

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

.paper-texture {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.34;
    background-image:
        radial-gradient(circle at 20% 10%, rgba(183, 44, 32, 0.05), transparent 26%),
        repeating-linear-gradient(90deg, rgba(56, 46, 34, 0.018) 0 1px, transparent 1px 5px),
        repeating-linear-gradient(0deg, rgba(56, 46, 34, 0.012) 0 1px, transparent 1px 7px);
}

.download-header {
    width: min(1180px, calc(100% - 48px));
    height: 88px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

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

.brand img,
.closing img {
    border-radius: 15px;
    box-shadow: 0 8px 22px rgba(46, 36, 27, 0.14);
}

.brand span {
    display: grid;
    gap: 2px;
}

.brand strong {
    font-family: "STKaiti", "KaiTi", serif;
    font-size: 21px;
    letter-spacing: 0.08em;
}

.brand small {
    color: var(--ink-soft);
    font-size: 12px;
}

.header-link {
    padding: 10px 17px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 14px;
    transition: 0.2s ease;
}

.header-link:hover {
    color: var(--red);
    border-color: rgba(183, 44, 32, 0.4);
}

.hero {
    width: min(1180px, calc(100% - 48px));
    min-height: 660px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(360px, 0.88fr) minmax(500px, 1.12fr);
    align-items: center;
    gap: 56px;
    padding: 72px 0 62px;
    overflow: hidden;
}

.hero-copy {
    min-width: 0;
}

.eyebrow {
    margin: 0 0 20px;
    color: var(--red);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.22em;
}

.hero h1 {
    margin: 0;
    font-family: "STKaiti", "KaiTi", serif;
    font-size: clamp(50px, 5.3vw, 78px);
    font-weight: 500;
    line-height: 1.16;
    letter-spacing: 0.015em;
}

.hero h1 em {
    color: var(--red);
    font-style: normal;
}

.lead {
    max-width: 560px;
    margin: 27px 0 31px;
    color: var(--ink-soft);
    font-size: 17px;
    line-height: 1.9;
}

.primary-download {
    width: min(100%, 330px);
    min-height: 72px;
    padding: 10px 24px 10px 14px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    border-radius: 18px;
    box-shadow: 0 18px 34px rgba(151, 35, 26, 0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 44px rgba(151, 35, 26, 0.3);
}

.primary-icon {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 14px;
    font-size: 29px;
    line-height: 1;
}

.primary-download > span:last-child {
    display: grid;
    gap: 2px;
}

.primary-download small {
    color: rgba(255, 255, 255, 0.72);
    font-size: 11px;
}

.primary-download strong {
    font-size: 18px;
    letter-spacing: 0.02em;
}

.safe-note {
    margin: 18px 0 0;
    color: #888178;
    font-size: 12px;
}

.app-showcase {
    position: relative;
    height: 560px;
    isolation: isolate;
}

.app-showcase::before {
    content: "";
    position: absolute;
    width: 430px;
    height: 430px;
    top: 67px;
    left: 50%;
    z-index: -2;
    transform: translateX(-50%);
    border: 1px solid rgba(183, 44, 32, 0.12);
    border-radius: 50%;
    box-shadow: inset 0 0 0 42px rgba(183, 44, 32, 0.025);
}

.seal-stamp {
    position: absolute;
    top: 36px;
    right: 30px;
    z-index: 6;
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    color: var(--red);
    border: 3px double var(--red);
    font-family: "STKaiti", "KaiTi", serif;
    font-size: 20px;
    letter-spacing: 0.06em;
    transform: rotate(7deg);
    opacity: 0.86;
}

.phone {
    position: absolute;
    margin: 0;
    overflow: hidden;
    background: #fff;
    border: 7px solid #1d1c1a;
    border-radius: 33px;
    box-shadow: var(--shadow);
}

.phone::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    z-index: 2;
    width: 36%;
    height: 13px;
    transform: translateX(-50%);
    background: #1d1c1a;
    border-radius: 0 0 10px 10px;
}

.phone img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.phone-main {
    width: 272px;
    height: 532px;
    top: 8px;
    left: 50%;
    z-index: 4;
    transform: translateX(-50%);
}

.phone-back {
    width: 214px;
    height: 418px;
    top: 82px;
    z-index: 2;
    opacity: 0.93;
}

.phone-left {
    left: 2%;
    transform: rotate(-7deg);
}

.phone-right {
    right: 2%;
    transform: rotate(7deg);
}

.feature-strip {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e9e2d7;
    background: #27231f;
    font-family: "STKaiti", "KaiTi", serif;
    font-size: 18px;
    letter-spacing: 0.16em;
}

.feature-strip p {
    margin: 0;
}

.store-section {
    width: min(1080px, calc(100% - 48px));
    margin: 0 auto;
    padding: 100px 0 90px;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 34px;
}

.section-heading h2 {
    margin: 0;
    font-family: "STKaiti", "KaiTi", serif;
    font-size: clamp(34px, 4vw, 50px);
    font-weight: 500;
}

.section-heading > p {
    max-width: 360px;
    margin: 0 0 7px;
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.7;
    text-align: right;
}

.store-layout {
    display: grid;
    grid-template-columns: 0.74fr 1.26fr;
    gap: 22px;
}

.ios-panel,
.android-panel {
    min-height: 365px;
    padding: 30px;
    background: rgba(255, 253, 250, 0.9);
    border: 1px solid var(--line);
    border-radius: 26px;
    box-shadow: 0 13px 38px rgba(52, 43, 34, 0.06);
}

.ios-panel {
    display: flex;
    flex-direction: column;
}

.store-mark {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    margin-bottom: 25px;
    border-radius: 17px;
}

.store-mark svg {
    width: 33px;
    height: 33px;
}

.apple-mark {
    color: white;
    background: #222;
}

.apple-mark svg {
    fill: currentColor;
}

.ios-panel small,
.android-title small {
    color: #8b847b;
    font-size: 12px;
}

.ios-panel h3,
.android-title h3 {
    margin: 4px 0 9px;
    font-size: 23px;
}

.store-button {
    min-height: 50px;
    margin-top: auto;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
}

.store-button-dark {
    color: white;
    background: #222;
}

.android-title {
    display: flex;
    align-items: center;
    gap: 17px;
    margin-bottom: 20px;
}

.android-title .store-mark {
    margin: 0;
}

.android-mark {
    color: var(--red);
    background: rgba(183, 44, 32, 0.08);
}

.android-mark svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.android-mark circle {
    fill: currentColor;
    stroke: none;
}

.android-title h3 {
    margin-bottom: 0;
}

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

.market-card {
    min-width: 0;
    min-height: 88px;
    padding: 13px;
    display: grid;
    grid-template-columns: 45px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.72);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.market-card:hover,
.market-card.is-recommended {
    transform: translateY(-2px);
    border-color: rgba(183, 44, 32, 0.34);
    box-shadow: 0 12px 24px rgba(52, 43, 34, 0.07);
}

.market-card.is-recommended::after {
    content: "当前设备推荐";
    position: absolute;
    top: -9px;
    right: 14px;
    padding: 3px 8px;
    color: white;
    background: var(--red);
    border-radius: 999px;
    font-size: 10px;
}

.market-card.is-recommended {
    position: relative;
}

.market-logo {
    width: 45px;
    height: 45px;
    display: grid;
    place-items: center;
    color: white;
    border-radius: 13px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.market-huawei .market-logo { background: #cf0a2c; }
.market-xiaomi .market-logo { background: #ff6900; }
.market-oppo .market-logo { background: #0a8245; font-size: 9px; }
.market-vivo .market-logo { background: #456fff; }

.market-card > span:nth-child(2) {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.market-card strong {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.market-card b {
    color: var(--red);
    font-size: 12px;
}

.download-help {
    margin-top: 20px;
    padding: 20px 24px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 15px;
    border: 1px dashed rgba(50, 45, 39, 0.2);
    border-radius: 19px;
}

.download-help > span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: var(--red);
    border: 1px solid rgba(183, 44, 32, 0.26);
    border-radius: 50%;
    font-family: serif;
    font-weight: 700;
}

.download-help strong {
    font-size: 14px;
}

.download-help p {
    margin: 4px 0 0;
    color: var(--ink-soft);
    font-size: 12px;
    line-height: 1.6;
}

.download-help button {
    min-height: 40px;
    padding: 0 16px;
    color: var(--red);
    background: transparent;
    border: 1px solid rgba(183, 44, 32, 0.28);
    border-radius: 12px;
    cursor: pointer;
}

footer {
    padding: 25px max(24px, calc((100% - 1080px) / 2));
    display: flex;
    justify-content: space-between;
    gap: 20px;
    color: #827b72;
    background: #1f1c19;
    font-size: 12px;
}

footer p {
    margin: 0;
}

footer nav {
    display: flex;
    gap: 18px;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: max(26px, env(safe-area-inset-bottom));
    z-index: 30;
    padding: 11px 18px;
    color: white;
    background: rgba(33, 31, 28, 0.92);
    border-radius: 999px;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: 0.2s ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.wechat-guide {
    position: fixed;
    inset: 0;
    z-index: 100;
    color: white;
    background: rgba(24, 25, 29, 0.82);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.wechat-guide.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.wechat-guide-arrow {
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    right: 10px;
    width: 150px;
    height: 120px;
    overflow: visible;
}

.wechat-guide-arrow path {
    fill: none;
    stroke: white;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 7 8;
}

.wechat-guide-arrow path:last-child {
    stroke-dasharray: none;
}

.wechat-guide-copy {
    width: min(100% - 44px, 420px);
    margin: 0 auto;
    padding-top: max(150px, calc(env(safe-area-inset-top) + 130px));
    display: grid;
    justify-items: center;
    text-align: center;
}

.wechat-guide-copy strong {
    font-size: clamp(30px, 9vw, 42px);
    line-height: 1.2;
}

.wechat-guide-copy span {
    margin-top: 18px;
    font-size: clamp(20px, 5.8vw, 28px);
    font-weight: 600;
    line-height: 1.5;
}

.wechat-guide-copy button {
    min-width: 170px;
    min-height: 52px;
    margin-top: 38px;
    padding: 0 28px;
    color: white;
    background: var(--red);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    font: inherit;
    font-size: 17px;
}

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 32px;
        padding-top: 52px;
        text-align: center;
    }

    .lead,
    .primary-download {
        margin-left: auto;
        margin-right: auto;
    }

    .app-showcase {
        width: min(100%, 650px);
        margin: 0 auto;
    }

    .store-layout {
        grid-template-columns: 1fr;
    }

    body.is-android .android-panel {
        order: -1;
    }

    .ios-panel {
        min-height: auto;
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 18px;
    }

    .ios-panel .store-mark,
    .ios-panel .store-button {
        margin: 0;
    }

    .ios-panel .store-button {
        min-width: 142px;
    }
}

@media (max-width: 620px) {
    .download-header,
    .hero,
    .store-section {
        width: min(100% - 30px, 1180px);
    }

    .download-header {
        height: 66px;
    }

    .brand img {
        width: 42px;
        height: 42px;
        border-radius: 13px;
    }

    .brand strong {
        font-size: 18px;
    }

    .brand small,
    .header-link {
        display: none;
    }

    .hero {
        min-height: auto;
        gap: 18px;
        padding: 32px 0 24px;
    }

    .eyebrow {
        margin-bottom: 11px;
        font-size: 11px;
        letter-spacing: 0.14em;
    }

    .hero h1 {
        font-size: clamp(36px, 10vw, 44px);
        line-height: 1.18;
        white-space: nowrap;
    }

    .lead {
        margin-top: 13px;
        margin-bottom: 20px;
        font-size: 15px;
        line-height: 1.5;
        white-space: nowrap;
    }

    .primary-download {
        width: 100%;
        min-height: 66px;
        padding-right: 16px;
        text-align: left;
    }

    .primary-icon {
        width: 46px;
        height: 46px;
        border-radius: 13px;
    }

    .primary-download > span:last-child {
        min-width: 0;
    }

    .primary-download small,
    .primary-download strong {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .primary-download strong {
        font-size: 16px;
    }

    .safe-note {
        line-height: 1.6;
    }

    .app-showcase {
        height: 336px;
        margin-top: 0;
    }

    .app-showcase::before {
        width: 250px;
        height: 250px;
        top: 42px;
    }

    .seal-stamp {
        display: none;
    }

    .phone-main {
        width: 170px;
        height: 332px;
        border-width: 5px;
        border-radius: 24px;
    }

    .phone-back {
        display: none;
    }

    .phone::before {
        top: 5px;
        height: 10px;
    }

    .feature-strip {
        min-height: 50px;
        padding: 0 15px;
        font-size: 14px;
    }

    .store-section {
        padding: 38px 0 42px;
    }

    .section-heading {
        display: block;
        margin-bottom: 19px;
    }

    .section-heading h2 {
        font-size: 31px;
    }

    .section-heading > p {
        margin-top: 6px;
        font-size: 13px;
        text-align: left;
    }

    .ios-panel,
    .android-panel {
        min-height: auto;
        padding: 18px;
        border-radius: 20px;
    }

    .ios-panel {
        grid-template-columns: 52px minmax(0, 1fr);
    }

    .ios-panel p {
        display: none;
    }

    .ios-panel .store-mark {
        width: 52px;
        height: 52px;
    }

    .ios-panel .store-button {
        min-width: 0;
        grid-column: 1 / -1;
        margin-top: 4px;
    }

    .android-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .market-card {
        min-height: 68px;
        padding: 10px 12px;
        grid-template-columns: 44px minmax(0, 1fr) auto;
        justify-items: stretch;
        gap: 12px;
        text-align: left;
    }

    .market-logo {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .market-card > span:nth-child(2) {
        min-width: 0;
        display: grid;
        align-items: center;
    }

    .market-card strong {
        font-size: 14px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .market-card b {
        display: block;
        align-self: center;
        white-space: nowrap;
    }

    .market-card.is-recommended::after {
        top: -7px;
        right: 12px;
    }

    .download-help {
        grid-template-columns: 34px minmax(0, 1fr);
        margin-top: 14px;
        padding: 16px;
    }

    .download-help button {
        grid-column: 1 / -1;
        width: 100%;
    }

    footer {
        display: block;
        padding: 24px;
        text-align: center;
    }

    footer nav {
        flex-wrap: wrap;
        justify-content: center;
        margin-top: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; }
}
