:root {
    color-scheme: light;
    --page: #07182f;
    --panel: #fffdf8;
    --panel-soft: #f1f3f6;
    --ink: #192231;
    --muted: #7d8da1;
    --dim: #9aa7b5;
    --accent: #2167c8;
    --accent-2: #f2c967;
    --line: rgba(33, 103, 200, 0.12);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    color: var(--ink);
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    background:
        radial-gradient(circle at 50% 18%, rgba(77, 155, 234, 0.35), transparent 36%),
        linear-gradient(180deg, #092247 0%, #07182f 58%, #06111f 100%);
}

button,
a,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

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

.page-shell {
    min-height: 100svh;
    padding: 24px 20px 34px;
}

.poster-main {
    display: grid;
    gap: 14px;
    width: min(544px, 100%);
    margin: 0 auto;
    padding: 28px;
    border-radius: 44px;
    background: var(--panel);
    box-shadow:
        0 42px 90px rgba(4, 14, 30, 0.64),
        0 0 0 1px rgba(255, 255, 255, 0.72);
}

.brand-hero {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 16px 0 8px;
    text-align: center;
}

.brand-hero.has-logo {
    gap: 8px;
}

.brand-logo {
    display: block;
    width: auto;
    max-width: min(430px, 100%);
    height: auto;
    max-height: 132px;
    object-fit: contain;
}

.brand-text h1 {
    margin: 0;
    background: linear-gradient(180deg, #6bc0f1 0%, #2e70cf 56%, #183d86 100%);
    color: transparent;
    font-size: 72px;
    line-height: 0.9;
    font-weight: 900;
    letter-spacing: 0;
    -webkit-background-clip: text;
    background-clip: text;
    filter: drop-shadow(0 4px 0 rgba(11, 35, 82, 0.18));
}

.brand-text p {
    margin: 4px 0 0;
    color: #152034;
    font-size: 40px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0;
}

.brand-subtitle {
    margin: 2px 0 0;
    color: #152034;
    font-size: 40px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0;
}

.route-stack {
    display: grid;
    gap: 14px;
    margin-top: 4px;
}

.route-button {
    position: relative;
    display: grid;
    gap: 5px;
    min-width: 0;
    min-height: 86px;
    align-content: center;
    padding: 14px 18px;
    overflow: hidden;
    border: 0;
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 42%),
        linear-gradient(135deg, #17202d 0%, #0c1119 58%, #05070b 100%);
    color: var(--ink);
    text-align: center;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 0 rgba(0, 0, 0, 0.58),
        0 16px 34px rgba(5, 11, 19, 0.22);
    transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.route-button:hover {
    transform: translateY(-1px);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 44%),
        linear-gradient(135deg, #1d2836 0%, #101722 58%, #06080d 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.54),
        0 18px 38px rgba(5, 11, 19, 0.3);
}

.route-button[disabled] {
    cursor: not-allowed;
    opacity: 0.55;
}

.route-name {
    color: #ffffff;
    font-size: 20px;
    line-height: 1.25;
    font-weight: 800;
}

.route-url {
    min-width: 0;
    color: #c8d3e1;
    font-size: 18px;
    line-height: 1.3;
    word-break: break-all;
}

.utility-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 2px;
}

.utility-button {
    display: grid;
    align-items: center;
    align-content: center;
    justify-content: center;
    justify-items: center;
    gap: 4px;
    min-width: 0;
    min-height: 78px;
    padding: 12px;
    border: 0;
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.72), transparent 58%),
        #eef1f5;
    color: #1d2837;
    font-size: 21px;
    line-height: 1.2;
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 12px 24px rgba(28, 55, 87, 0.08);
    -webkit-tap-highlight-color: transparent;
}

.utility-label {
    font-weight: 800;
}

.utility-value {
    display: block;
    width: 100%;
    min-width: 0;
    color: #6f7f93;
    font-size: 16px;
    line-height: 1.25;
    word-break: break-all;
}

.utility-button.is-copyable {
    cursor: pointer;
}

.utility-button:nth-child(2) {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.7), transparent 58%),
        #fff2cf;
    color: #8a5a09;
}

.mail-line {
    margin-top: 16px;
    color: #6f7f93;
    font-size: 19px;
    line-height: 1.5;
    text-align: center;
}

.mail-line p {
    margin: 0;
}

.mail-line a {
    color: #1e67c6;
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.icon-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 16px;
    width: min(360px, 100%);
    margin: 18px auto 0;
}

.icon-link {
    display: grid;
    justify-items: center;
    gap: 8px;
    min-width: 0;
    color: #223045;
    font-size: 13px;
    line-height: 1.2;
    text-align: center;
}

.icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.8), transparent),
        #eef1f5;
    color: #233149;
    font-size: 27px;
    font-weight: 900;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 22px rgba(30, 62, 96, 0.1);
}

.icon-link:nth-child(2n) .icon-circle {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.8), transparent),
        #fff2cf;
    color: #805508;
}

.icon-link:nth-child(3n) .icon-circle {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.72), transparent),
        #d9ecff;
    color: #1e5da9;
}

.page-footer {
    display: grid;
    gap: 4px;
    margin-top: 92px;
    color: #718094;
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
}

.page-footer p {
    margin: 0;
}

.empty-state {
    padding: 16px;
    border: 1px dashed rgba(33, 103, 200, 0.28);
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
    text-align: center;
}

.qr-cache {
    position: absolute;
    left: -9999px;
    top: 0;
    width: 168px;
    height: 168px;
    overflow: hidden;
}

.qr-box {
    width: 168px;
    height: 168px;
    background: #ffffff;
}

.qr-box img,
.qr-box canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    object-fit: contain;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 50;
    min-width: 220px;
    max-width: calc(100% - 32px);
    padding: 12px 18px;
    transform: translate(-50%, 16px);
    border: 1px solid rgba(33, 103, 200, 0.22);
    border-radius: 10px;
    background: rgba(15, 22, 32, 0.96);
    color: #ffffff;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.route-button:focus-visible,
.utility-button:focus-visible,
.icon-link:focus-visible,
.qr-box.is-downloadable:focus-visible {
    outline: 3px solid rgba(33, 103, 200, 0.26);
    outline-offset: 3px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 720px) {
    body {
        overflow-x: hidden;
    }

    .page-shell {
        display: grid;
        align-items: center;
        padding: 8px 10px;
    }

    .poster-main {
        width: min(384px, 100%);
        min-height: calc(100svh - 16px);
        gap: 8px;
        padding: 16px 18px;
        border-radius: 32px;
    }

    .brand-hero {
        gap: 6px;
        padding: 2px 0;
    }

    .brand-hero.has-logo {
        gap: 3px;
    }

    .brand-logo {
        max-width: min(252px, 100%);
        max-height: 86px;
    }

    .brand-text h1 {
        font-size: 38px;
    }

    .brand-text p {
        margin-top: 2px;
        font-size: 22px;
    }

    .brand-subtitle {
        margin-top: 1px;
        font-size: 22px;
    }

    .route-stack {
        gap: 8px;
        margin-top: 2px;
    }

    .route-button {
        min-height: 58px;
        padding: 7px 10px;
        border-radius: 14px;
        gap: 2px;
    }

    .route-name {
        font-size: 14px;
    }

    .route-url {
        font-size: 12px;
        line-height: 1.25;
    }

    .utility-row {
        gap: 8px;
    }

    .utility-button {
        min-height: 50px;
        padding: 7px 8px;
        font-size: 14px;
        border-radius: 10px;
    }

    .utility-value {
        font-size: 11px;
        line-height: 1.2;
    }

    .mail-line {
        margin-top: 3px;
        font-size: 12px;
        line-height: 1.35;
    }

    .icon-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        width: min(260px, 100%);
        margin-top: 2px;
    }

    .icon-link {
        gap: 4px;
        font-size: 10.5px;
    }

    .icon-circle {
        width: 34px;
        height: 34px;
        font-size: 17px;
    }

    .page-footer {
        gap: 2px;
        margin-top: auto;
        font-size: 9.8px;
        line-height: 1.25;
    }
}

@media (max-width: 430px) {
    .page-shell {
        padding: 8px 12px;
    }

    .poster-main {
        min-height: calc(100svh - 16px);
        padding: 16px;
    }

    .brand-text h1 {
        font-size: 35px;
    }

    .brand-text p {
        font-size: 21px;
    }

    .brand-logo {
        max-width: min(244px, 100%);
        max-height: 82px;
    }

    .route-button {
        min-height: 56px;
    }

    .route-name {
        font-size: 13.5px;
    }

    .route-url {
        font-size: 11.5px;
    }

    .utility-button {
        min-height: 48px;
        font-size: 13px;
    }

    .utility-value {
        font-size: 10.5px;
    }

    .mail-line {
        font-size: 11.5px;
    }

    .icon-nav {
        gap: 7px;
    }

    .icon-link {
        font-size: 10px;
    }

    .icon-circle {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .page-footer {
        font-size: 9.5px;
    }
}

@media (max-width: 430px) and (max-height: 740px) {
    .page-shell {
        padding: 6px 10px;
    }

    .poster-main {
        min-height: calc(100svh - 12px);
        gap: 6px;
        padding: 12px 14px;
        border-radius: 28px;
    }

    .brand-hero {
        gap: 3px;
        padding: 0;
    }

    .brand-logo {
        max-width: min(196px, 100%);
        max-height: 64px;
    }

    .brand-text h1 {
        font-size: 30px;
    }

    .brand-text p {
        margin-top: 1px;
        font-size: 17px;
    }

    .brand-subtitle {
        margin-top: 1px;
        font-size: 17px;
    }

    .route-stack {
        gap: 6px;
        margin-top: 0;
    }

    .route-button {
        min-height: 47px;
        padding: 4px 8px;
        border-radius: 12px;
    }

    .route-name {
        font-size: 12px;
    }

    .route-url {
        font-size: 10.5px;
        line-height: 1.2;
    }

    .utility-row {
        gap: 6px;
    }

    .utility-button {
        min-height: 40px;
        padding: 4px 6px;
        font-size: 12px;
    }

    .utility-value {
        font-size: 9.8px;
    }

    .mail-line {
        margin-top: 0;
        font-size: 10.5px;
        line-height: 1.25;
    }

    .icon-nav {
        gap: 6px;
        margin-top: 0;
    }

    .icon-link {
        gap: 3px;
        font-size: 9.5px;
    }

    .icon-circle {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .page-footer {
        font-size: 8.6px;
        line-height: 1.16;
    }
}
