* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    background-color: #fff;
    font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB",
                 "Helvetica Neue", Arial, sans-serif;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    padding: 14px;
    align-items: start;
}
.code-item {
    width: 100%;
    padding-bottom: 1px;
    display: none;
    background-color: #5c92ef;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .10);
    transition: transform .18s ease, box-shadow .18s ease;
    cursor: pointer;
}
.code-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .16);
}
.code-icon {
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f2f2f2;
    padding: 14px 12px;
}
.code-icon img {
    max-height: 52px;
    max-width: 78%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}
.code-area {
    text-align: center;
    padding: 22px 12px;
}
.code-area img {
    display: block;
    margin: 0 auto;
    width: 78%;
    max-width: 190px;
    min-width: 84px;
    aspect-ratio: 1 / 1;
    background: #fff;
    padding: 8px;
    border-radius: 6px;
}
.code-footer {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: #fff;
    color: #666;
    font-size: 15px;
    line-height: 1.45;
    padding: 12px 8px;
    margin: 0 4px 3px 4px;
    border-radius: 0 0 6px 6px;
}
#fallback {
    grid-column: 1 / -1;
    align-self: stretch;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 28px);
    padding: 40px 16px 48px;
    text-align: center;
}
#fallback.is-show { display: flex; }
.fb-logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 0 0 26px;
    padding: 0;
    max-width: 480px;
    list-style: none;
}
.fb-logos li {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 9px;
    background: #f4f6f9;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .07);
    transition: transform .18s ease, box-shadow .18s ease;
}
.fb-logos li:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, .12);
}
.fb-logos img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}
.fb-qr {
    width: 236px;
    max-width: 66vw;
    aspect-ratio: 1 / 1;
    padding: 12px;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .10);
}
.fb-title {
    margin: 0 0 18px;
    font-size: 19px;
    font-weight: 700;
    color: #333;
    letter-spacing: .5px;
}
.fb-tip {
    margin: 20px 0 22px;
    font-size: 14px;
    color: #999;
    line-height: 1.6;
}
.fb-btn {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 13px 32px;
    font-family: inherit;
    font-size: 16px;
    color: #fff;
    background: linear-gradient(135deg, #1677ff, #4f8ff5);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(22, 119, 255, .30);
    transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}
.fb-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(22, 119, 255, .38);
}
.fb-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(22, 119, 255, .30);
}
.fb-btn:focus-visible {
    outline: 3px solid rgba(22, 119, 255, .35);
    outline-offset: 2px;
}
.fb-btn .arrow {
    font-size: 13px;
    transition: transform .2s ease;
}
.fb-btn:hover .arrow { transform: translateY(2px); }
#qrfs {
    grid-column: 1 / -1;
    display: none;
    flex-direction: column;
    align-items: stretch;
    min-height: calc(100vh - 28px);
    padding: 0;
    text-align: center;
    background-color: #f4f6f9;
    overflow: hidden;
}
#qrfs.is-show { display: flex; }
.qf-top {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 16px 22px;
    background: #f4f6f9;
}
.qf-mid {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 26px 16px 30px;
    background-color: #5c92ef;
    transition: background-color .25s ease;
}
.qf-bottom {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 22px 16px 104px;
    background: #fff;
}
.qf-logo {
    --qf-logo-h: 72px;
    display: block;
    width: auto;
    height: var(--qf-logo-h);
    max-width: min(62%, 260px);
    object-fit: contain;
    object-position: center;
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}
.qf-logo.is-pixel {
    image-rendering: pixelated;
}
.qf-title {
    margin: 14px 0 4px;
    font-size: 20px;
    font-weight: 700;
    color: #333;
    letter-spacing: .5px;
}
.qf-sub {
    margin: 0;
    font-size: 14px;
    color: #8a8f99;
    letter-spacing: .5px;
}
.qf-qrwrap {
    padding: 16px 16px 14px;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .10);
}
.qf-qr {
    display: block;
    width: 272px;
    max-width: 70vw;
    aspect-ratio: 1 / 1;
    image-rendering: pixelated;
    -webkit-touch-callout: default;
}
.qf-qrbox {
    position: relative;
    display: inline-block;
    line-height: 0;
}
.qf-avatar {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20%;
    aspect-ratio: 1 / 1;
    background-color: #fff;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    border-radius: 4px;
    box-shadow: 0 0 0 4px #fff, 0 2px 6px rgba(0, 0, 0, .12);
    pointer-events: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}
.qf-avatar.hidden { display: none; }
.qf-name {
    margin: 11px 0 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    letter-spacing: .5px;
    line-height: 1.4;
}
.qf-name.hidden { display: none; }
.qf-guide {
    margin: 0;
    font-size: 16px;
    color: #666;
    letter-spacing: .5px;
    line-height: 1.6;
}
.qf-guide .app {
    font-weight: 700;
    color: var(--qf-brand, #333);
}
.qf-guide .hl {
    display: inline-block;
    margin: 0 2px;
    padding: 1px 8px;
    font-weight: 700;
    border-radius: 6px;
    color: var(--qf-brand, #333);
    background: var(--qf-tint, rgba(0, 0, 0, .06));
}
.qf-tip {
    margin: 8px 0 0;
    font-size: 13px;
    color: #9aa0a6;
    line-height: 1.6;
}
.bbar {
    position: fixed;
    left: 50%;
    bottom: calc(22px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
    display: none;
}
.bbar.is-show { display: block; }
.bbar.is-show .bbar-btn { pointer-events: auto; }
.bbar-btn {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 13px 34px;
    font-family: inherit;
    font-size: 16px;
    color: #fff;
    background: linear-gradient(135deg, #1677ff, #4f8ff5);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: 0 6px 18px rgba(22, 119, 255, .30);
    transition: transform .16s ease, box-shadow .16s ease;
}
.bbar-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(22, 119, 255, .38);
}
.bbar-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(22, 119, 255, .30);
}
.bbar-btn:focus-visible {
    outline: 3px solid rgba(22, 119, 255, .35);
    outline-offset: 2px;
}
.bbar-btn[data-mode="back"] {
    background: linear-gradient(135deg, #64748b, #94a3b8);
    box-shadow: 0 6px 18px rgba(100, 116, 139, .28);
}
.bbar-btn[data-mode="back"]:hover {
    box-shadow: 0 10px 24px rgba(100, 116, 139, .36);
}
body.is-grid { padding-bottom: 96px; }
@media (max-width: 1000px) {
    body { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
    body { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 12px; }
    .code-icon { height: 74px; }
    .code-icon img { max-height: 44px; }
    #fallback { min-height: calc(100vh - 24px); }
    .fb-logos li { width: 52px; height: 52px; }
}
@media (max-width: 560px) {
    body { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 10px; }
    .code-footer { font-size: 14px; min-height: 56px; }
    #fallback { min-height: calc(100vh - 20px); padding: 28px 14px 36px; }
    .fb-title { font-size: 17px; margin-bottom: 14px; }
    .fb-qr { width: 200px; max-width: 60vw; }
    .fb-logos { gap: 8px; margin-bottom: 20px; }
    .fb-logos li { width: 46px; height: 46px; padding: 7px; border-radius: 12px; }
    .fb-btn { width: 100%; max-width: 300px; font-size: 15px; padding: 12px 24px; }
    #qrfs { min-height: calc(100vh - 20px); }
    .qf-top { padding: 26px 14px 18px; }
    .qf-mid { padding: 22px 14px 24px; }
    .qf-bottom { padding: 18px 14px 96px; }
    .qf-logo { --qf-logo-h: 60px; }
    .qf-title { font-size: 18px; margin: 12px 0 3px; }
    .qf-sub { font-size: 13px; }
    .qf-qr { width: 226px; max-width: 78vw; }
    .qf-avatar { box-shadow: 0 0 0 3px #fff, 0 2px 6px rgba(0, 0, 0, .12); }
    .qf-name { margin-top: 9px; font-size: 14px; }
    .qf-guide { font-size: 15px; }
    .qf-tip { margin-top: 6px; font-size: 12px; }
    .bbar-btn { padding: 12px 26px; font-size: 15px; }
}
@media (max-width: 340px) {
    body { grid-template-columns: minmax(0, 1fr); }
    .fb-logos li { width: 42px; height: 42px; }
}
@media (max-height: 700px) {
    .qf-top { padding: 18px 16px 12px; }
    .qf-logo { --qf-logo-h: 54px; }
    .qf-title { font-size: 17px; margin: 8px 0 2px; }
    .qf-sub { font-size: 12px; }
    .qf-mid { padding: 14px 16px 16px; }
    .qf-name { margin-top: 7px; font-size: 13px; }
    .qf-bottom { padding: 14px 16px 82px; }
    .qf-guide { font-size: 14px; }
    .qf-tip { margin-top: 4px; font-size: 12px; }
}
@media (max-height: 600px) {
    .qf-top { padding: 14px 16px 10px; }
    .qf-logo { --qf-logo-h: 46px; }
    .qf-title { font-size: 16px; margin: 6px 0 2px; }
    .qf-mid { padding: 12px 16px 14px; }
    .qf-qr { width: min(226px, 29vh); }
    .qf-qrwrap { padding: 12px 12px 10px; }
    .qf-bottom { padding: 12px 16px 76px; }
}
.hidden { display: none !important; }
