* {
    box-sizing: border-box;
}

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

body {
    color: #16304b;
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    background: radial-gradient(circle at 12% 18%, rgba(93, 181, 255, 0.36), rgba(93, 181, 255, 0) 28%),
    radial-gradient(circle at 84% 14%, rgba(75, 231, 214, 0.24), rgba(75, 231, 214, 0) 26%),
    radial-gradient(circle at 76% 82%, rgba(80, 128, 255, 0.2), rgba(80, 128, 255, 0) 30%),
    linear-gradient(135deg, #e7f6ff 0%, #f7fbff 52%, #dcefff 100%);
    overflow-x: hidden;
    overflow-y: auto;
}

.grid-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.grid-layer {
    z-index: 1;
    opacity: 0.58;
    background-image: linear-gradient(rgba(41, 126, 214, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(41, 126, 214, 0.09) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 76%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 76%, transparent 100%);
}

.grid-layer:after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 8%;
    height: 96px;
    background: linear-gradient(90deg, transparent, rgba(75, 181, 255, 0.12), transparent);
    opacity: 0.55;
}

.board-page {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 34px 56px 46px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 52px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #17385d;
    font-size: 20px;
    font-weight: 700;
}

.brand-mark {
    width: 100px;
    height: 52px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(51, 126, 212, 0.24);
    border-radius: 8px;
    color: #2474d2;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 10px 24px rgba(42, 126, 210, 0.12);
}

.signal {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    border: 1px solid rgba(55, 144, 220, 0.2);
    border-radius: 8px;
    color: #236dae;
    font-size: 14px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 8px 20px rgba(73, 132, 204, 0.1);
}

.signal-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #21c48c;
    box-shadow: 0 0 0 6px rgba(33, 196, 140, 0.14);
}

.hero {
    flex: 1;
    display: flex;
    align-items: center;
    width: 100%;
    padding-right: 592px;
}

.copy {
    max-width: 760px;
}

.kicker {
    margin: 0 0 18px;
    color: #2474d2;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 800;
    letter-spacing: 0;
}

.copy h1 {
    margin: 0;
    color: #122f4f;
    font-size: clamp(42px, 6vw, 86px);
    line-height: 1.06;
    font-weight: 800;
    letter-spacing: 0;
}

.copy-text {
    max-width: 610px;
    margin: 26px 0 0;
    color: #49647f;
    font-size: 24px;
    line-height: 1.55;
}

.status-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    max-width: 660px;
    margin-top: 44px;
}

.status-item {
    min-height: 92px;
    padding: 18px;
    border: 1px solid rgba(49, 128, 212, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.62);
    box-shadow: 0 10px 22px rgba(60, 126, 200, 0.08);
}

.status-item strong {
    display: block;
    color: #1c4772;
    font-size: 26px;
    line-height: 1;
}

.status-item span {
    display: block;
    margin-top: 10px;
    color: #65788e;
    font-size: 14px;
}

.machine-alert {
    max-width: 620px;
    margin-top: 26px;
    padding: 18px 20px;
    border: 1px solid rgba(234, 157, 36, 0.28);
    border-radius: 8px;
    color: #7a4d08;
    font-size: 18px;
    line-height: 1.5;
    background: rgba(255, 247, 226, 0.82);
    box-shadow: 0 8px 18px rgba(197, 139, 32, 0.1);
}

.machine-alert span {
    display: inline-block;
    margin-left: 8px;
    color: #143a60;
    font-weight: 800;
}

.scan-panel {
    position: fixed;
    top: 50%;
    right: 56px;
    width: 520px;
    transform: translateY(-50%);
    min-height: 612px;
    padding: 30px;
    border: 1px solid rgba(57, 137, 222, 0.18);
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(239, 249, 255, 0.88)),
    rgba(255, 255, 255, 0.86);
    box-shadow: 0 14px 34px rgba(49, 116, 188, 0.14);
    overflow: hidden;
}

.scan-panel:before {
    content: "";
    position: absolute;
    inset: 14px;
    border: 1px solid rgba(37, 140, 223, 0.16);
    border-radius: 8px;
    pointer-events: none;
}

.scan-panel:after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 16%, rgba(54, 183, 255, 0.08) 48%, transparent 78%);
    opacity: 0.72;
    pointer-events: none;
}

.scan-content {
    position: relative;
    z-index: 1;
    min-height: 552px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.scan-header {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.scan-header h2 {
    margin: 0;
    color: #15375b;
    font-size: 32px;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: 0;
}

.scan-header p {
    margin: 8px 0 0;
    color: #5d7288;
    font-size: 15px;
}

.tag {
    flex: 0 0 auto;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid rgba(33, 196, 140, 0.24);
    border-radius: 8px;
    color: #0f8d68;
    font-size: 13px;
    font-weight: 800;
    background: rgba(235, 255, 248, 0.86);
}

.qr-stage {
    position: relative;
    width: 330px;
    height: 330px;
    max-width: 78vw;
    max-height: 78vw;
    width: min(78vw, 330px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, #5ab8ff, #39dcc3) border-box;
    border: 2px solid transparent;
    box-shadow: 0 10px 26px rgba(46, 125, 203, 0.14),
    inset 0 0 18px rgba(59, 181, 255, 0.08);
}

.qr-stage:before,
.qr-stage:after {
    content: "";
    position: absolute;
    inset: -22px;
    border: 1px solid rgba(44, 144, 226, 0.14);
    border-radius: 8px;
}

.qr-stage:after {
    display: none;
}

.qr-box {
    position: relative;
    width: 78%;
    height: 78%;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(44, 112, 184, 0.1);
    overflow: hidden;
}

.qr-box img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    cursor: pointer;
}

.qr-box:after {
    content: "";
    position: absolute;
    left: 7%;
    right: 7%;
    top: 8%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(38, 185, 255, 0.65), transparent);
    box-shadow: 0 0 8px rgba(38, 185, 255, 0.36);
    pointer-events: none;
}

.corner {
    position: absolute;
    width: 34px;
    height: 34px;
    border-color: #1d8fe5;
    border-style: solid;
    pointer-events: none;
}

.corner-1 {
    left: 15px;
    top: 15px;
    border-width: 3px 0 0 3px;
}

.corner-2 {
    right: 15px;
    top: 15px;
    border-width: 3px 3px 0 0;
}

.corner-3 {
    right: 15px;
    bottom: 15px;
    border-width: 0 3px 3px 0;
}

.corner-4 {
    left: 15px;
    bottom: 15px;
    border-width: 0 0 3px 3px;
}

.scan-footer {
    width: 100%;
    display: grid;
    gap: 14px;
}

.scan-status {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border: 1px solid rgba(49, 128, 212, 0.14);
    border-radius: 8px;
    color: #2d638f;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    background: rgba(241, 249, 255, 0.82);
}

.miniapp-tip {
    margin: 0;
    color: #2b74d6;
    font-size: 15px;
    line-height: 1.45;
    font-weight: 700;
    text-align: center;
}

.flow-line {
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(37, 116, 210, 0.12), rgba(54, 210, 190, 0.92), rgba(37, 116, 210, 0.12));
}

.class-bind {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 36px;
    background: rgba(15, 39, 64, 0.56);
}

.class-bind.show {
    display: flex;
}

.bind-panel {
    width: min(960px, 100%);
    max-height: 80vh;
    padding: 28px;
    border: 1px solid rgba(100, 186, 255, 0.32);
    border-radius: 8px;
    background: rgba(244, 250, 255, 0.96);
    box-shadow: 0 14px 36px rgba(7, 26, 45, 0.22);
    overflow: auto;
}

.bind-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.bind-head h2 {
    margin: 0;
    color: #17385d;
    font-size: 26px;
    line-height: 1.25;
}

.bind-close,
.btn {
    border: 0;
    border-radius: 8px;
    font-family: inherit;
    cursor: pointer;
}

.bind-close {
    min-width: 72px;
    height: 38px;
    color: #276aa8;
    font-size: 15px;
    font-weight: 700;
    background: #e2f2ff;
}

.bind-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 12px;
}

.btn {
    min-height: 42px;
    padding: 0 14px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #2474d2, #18bda5);
    box-shadow: 0 8px 18px rgba(32, 125, 190, 0.14);
}

.is-authorized .qr-stage {
    box-shadow: 0 10px 26px rgba(33, 196, 140, 0.16),
    inset 0 0 18px rgba(33, 196, 140, 0.08);
}

@media (max-width: 1060px) {
    .board-page {
        padding: 28px 24px 36px;
    }

    .hero {
        display: flex;
        padding-right: 464px;
        padding-top: 32px;
    }

    .copy {
        max-width: calc(100vw - 520px);
    }

    .copy h1 {
        font-size: clamp(34px, 6vw, 62px);
    }

    .copy-text {
        font-size: 20px;
        max-width: 460px;
    }

    .status-row {
        display: none;
    }

    .scan-panel {
        position: fixed;
        top: 50%;
        right: 24px;
        width: 420px;
        transform: translateY(-50%);
        min-height: auto;
        max-height: calc(100vh - 48px);
        overflow: auto;
        padding: 24px;
    }

    .scan-content {
        min-height: 500px;
    }

    .qr-stage {
        width: 260px;
        height: 260px;
        max-width: 58vw;
        max-height: 58vw;
    }
}

@media (max-width: 640px) {
    .topbar,
    .scan-header,
    .bind-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .signal,
    .tag {
        align-self: flex-start;
    }

    .scan-panel {
        right: 12px;
        width: calc(100vw - 24px);
        padding: 22px;
    }

    .scan-content {
        min-height: 460px;
    }

    .scan-header h2 {
        font-size: 26px;
    }
}
