/* 8 个 Bit 为什么组成一个 Byte？ */

.byte-story {
    color: var(--article-text-color);
    font-size: 14px;
    line-height: 1.6;
}

.byte-story * { box-sizing: border-box; }
.byte-story img { display: block; max-width: 100%; }
.byte-story p { margin: 0 0 12px; }
.byte-story strong { color: var(--article-heading-color); }
.byte-story code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.byte-section {
    margin-top: 22px;
    scroll-margin-top: 110px;
}

.byte-story .byte-section > h2 {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 8px;
    color: var(--article-heading-color);
    font-size: 20px;
    line-height: 1.35;
    font-weight: 900;
}

.byte-number {
    display: inline-flex;
    flex: 0 0 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #0752ff;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}

.byte-key,
.byte-note,
.byte-warning {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 14px;
}

.byte-key { background: #eaf5ff; }
.byte-note { background: #fff8e5; }
.byte-warning {
    border: 1px solid #ffd0dc;
    background: #fff2f6;
}

.byte-key img,
.byte-warning img {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    object-fit: contain;
}

.byte-note__icon {
    display: inline-flex;
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

.byte-story .byte-key h3,
.byte-story .byte-note h3,
.byte-story .byte-warning h3 {
    margin: 0 0 4px;
    font-size: 15px;
}

.byte-story .byte-key h3 { color: #0752ff; }
.byte-story .byte-note h3 { color: #9a6800; }
.byte-story .byte-warning h3 { color: #d83265; }

.byte-key p,
.byte-note p,
.byte-warning p { margin: 0; }

/* 8 bit = 1 byte */

.byte-eight {
    display: grid;
    grid-template-columns: 1.8fr 45px 1fr;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
}

.byte-eight__bits {
    display: grid;
    grid-template-columns: repeat(8,1fr);
    gap: 5px;
    padding: 16px;
    border-radius: 15px;
    background: #eef5ff;
}

.byte-eight__bits span {
    display: flex;
    aspect-ratio: 1;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #fff;
    color: #0752ff;
    font-size: 16px;
    font-weight: 900;
}

.byte-eight__arrow,
.byte-history__arrow {
    color: #4f82ff;
    font-size: 26px;
    font-weight: 900;
    text-align: center;
}

.byte-eight__result {
    display: flex;
    min-height: 145px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border-radius: 15px;
    background: #eef9f0;
    text-align: center;
}

.byte-eight__symbol {
    display: inline-flex;
    width: 62px;
    height: 62px;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: #fff;
    color: #2a9b55;
    font-size: 31px;
    font-weight: 900;
}

.byte-story .byte-eight__result h3 {
    margin: 7px 0 2px;
    color: var(--article-heading-color);
    font-size: 15px;
}

.byte-eight__result p {
    margin: 0;
    color: #617296;
    font-size: 11px;
}

/* 为什么是8 */

.byte-why {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 10px;
    margin-top: 14px;
}

.byte-why article,
.byte-chars > div {
    min-width: 0;
    padding: 14px 9px;
    border: 1px solid #e1ebff;
    border-radius: 14px;
    background: #f9fbff;
    text-align: center;
}

.byte-why article > span,
.byte-chars > div > span {
    display: inline-flex;
    width: 64px;
    height: 64px;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    border-radius: 19px;
    background: #eaf3ff;
    color: #0752ff;
    font-size: 27px;
}

.byte-story .byte-why h3,
.byte-story .byte-chars h3 {
    margin: 0 0 4px;
    color: var(--article-heading-color);
    font-size: 13px;
}

.byte-why p,
.byte-chars p {
    margin: 0;
    color: #617296;
    font-size: 10px;
}

/* 组合数量 */

.byte-count {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 10px;
    margin-top: 14px;
}

.byte-count article {
    padding: 14px 10px;
    border-radius: 14px;
    background: #f7f8fc;
    text-align: center;
}

.byte-count article strong {
    display: block;
    color: var(--article-heading-color);
    font-size: 13px;
}

.byte-count article span {
    display: block;
    margin: 6px 0 0;
    color: #0752ff;
    font-size: 31px;
    font-weight: 900;
}

.byte-count article p {
    margin: 0;
    color: #617296;
    font-size: 10px;
}

.byte-count__highlight {
    border: 2px solid #4f82ff;
    background: #eef5ff !important;
}

.byte-formula,
.byte-convert {
    display: flex;
    gap: 11px;
    align-items: center;
    margin-top: 12px;
    padding: 13px 15px;
    border-radius: 14px;
}

.byte-formula { background: #eef5ff; }
.byte-convert { background: #eef9f0; }

.byte-formula > span,
.byte-convert > span {
    font-size: 28px;
}

.byte-formula > span { color: #0752ff; }
.byte-convert > span { color: #2a9b55; }

.byte-formula p,
.byte-convert p { margin: 0; }

.byte-range {
    display: grid;
    grid-template-columns: 1fr 55px 1fr;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
}

.byte-range > div:not(.byte-range__dots) {
    padding: 14px;
    border-radius: 14px;
    background: #f7f8fc;
    text-align: center;
}

.byte-range code {
    display: inline-block;
    padding: 7px 9px;
    border-radius: 8px;
    background: #fff;
    color: #1d3d75;
    font-size: 12px;
    font-weight: 800;
}

.byte-range span {
    display: block;
    margin-top: 6px;
    color: #617296;
    font-size: 10px;
}

.byte-range__dots {
    color: #7888a5;
    font-size: 18px;
    font-weight: 900;
    text-align: center;
}

/* 字符与 Byte */

.byte-chars {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 10px;
    margin-top: 14px;
}

.byte-chars__unicode > span { color: #7654d6 !important; }
.byte-chars__emoji > span {
    background: #fff6df !important;
    font-size: 33px !important;
}

.byte-chars code {
    display: inline-block;
    margin-top: 7px;
    padding: 6px 9px;
    border-radius: 8px;
    background: #eef5ff;
    color: #1d3d75;
    font-size: 14px;
}

.byte-key--chars { background: #eaf5ff; }

/* 历史 */

.byte-history {
    display: grid;
    grid-template-columns: 1fr 45px 1fr;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
}

.byte-history__old,
.byte-history__today {
    display: flex;
    min-height: 175px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 14px;
    border-radius: 15px;
    text-align: center;
}

.byte-history__old { background: #fff6df; }
.byte-history__today { background: #eef9f0; }

.byte-history > div > span {
    font-size: 56px;
}

.byte-history__old > span { color: #d58d00; }
.byte-history__today > span { color: #2a9b55; }

.byte-story .byte-history h3 {
    margin: 7px 0 4px;
    color: var(--article-heading-color);
    font-size: 15px;
}

.byte-history p {
    margin: 0;
    color: #617296;
    font-size: 11px;
}

/* 内存地址 */

.byte-memory {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 12px;
    align-items: center;
    margin-top: 14px;
}

.byte-memory__addresses {
    display: grid;
    gap: 6px;
    padding: 14px;
    border-radius: 15px;
    background: #f7f8fc;
}

.byte-memory__addresses > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 11px;
    border-radius: 9px;
    background: #fff;
}

.byte-memory__addresses strong {
    color: #1d3d75;
    font-size: 11px;
}

.byte-memory__addresses span {
    color: #617296;
    font-size: 10px;
}

.byte-memory__explain {
    display: flex;
    min-height: 175px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 14px;
    border-radius: 15px;
    background: #eef5ff;
    text-align: center;
}

.byte-memory__explain > span {
    color: #0752ff;
    font-size: 54px;
}

.byte-story .byte-memory__explain h3 {
    margin: 7px 0 4px;
    color: var(--article-heading-color);
    font-size: 15px;
}

.byte-memory__explain p {
    margin: 0;
    color: #617296;
    font-size: 10px;
}

.byte-int {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
    padding: 13px 14px;
    border-radius: 14px;
    background: #f3efff;
}

.byte-int > strong {
    color: #6049b8;
    font-size: 12px;
}

.byte-int > div {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 5px;
}

.byte-int span {
    padding: 8px 4px;
    border-radius: 8px;
    background: #fff;
    color: #6049b8;
    font-size: 10px;
    font-weight: 800;
    text-align: center;
}

/* bit vs byte */

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

.byte-compare > div {
    padding: 16px;
    border-radius: 15px;
    text-align: center;
}

.byte-compare__bit { background: #eef5ff; }
.byte-compare__byte { background: #eef9f0; }

.byte-compare__symbol {
    display: inline-flex;
    min-width: 84px;
    height: 54px;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border-radius: 14px;
    background: #fff;
    font-size: 19px;
    font-weight: 900;
}

.byte-compare__bit .byte-compare__symbol { color: #0752ff; }
.byte-compare__byte .byte-compare__symbol { color: #2a9b55; }

.byte-story .byte-compare h3 {
    margin: 8px 0 4px;
    color: var(--article-heading-color);
    font-size: 15px;
}

.byte-compare p {
    margin: 0;
    color: #617296;
    font-size: 11px;
}

.byte-compare small {
    display: block;
    margin-top: 4px;
    color: #8692a8;
    font-size: 10px;
}

/* 总结 */

.byte-summary {
    display: flex;
    gap: 12px;
    margin-top: 22px;
    padding: 18px;
    border-radius: 16px;
    background: #e9f3ff;
    scroll-margin-top: 110px;
}

.byte-summary__icon {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    object-fit: contain;
}

.byte-story .byte-summary h2 {
    margin: 0 0 7px;
    color: #0752ff;
    font-size: 19px;
}

.byte-summary ul {
    margin: 0;
    padding-left: 20px;
    line-height: 1.75;
}

.byte-summary__next {
    margin: 10px 0 0 !important;
    padding-top: 10px;
    border-top: 1px dashed #b8d3f6;
}

.byte-summary__next em {
    color: #0752ff;
    font-style: normal;
    font-weight: 800;
}

/* 翻页 */

.byte-pagination {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-top: 14px;
}

.byte-pagination a {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 49%;
    padding: 10px 13px;
    border: 1px solid #d9e7ff;
    border-radius: 12px;
    background: #ffffffb3;
    text-decoration: none;
    box-shadow: 0 3px 10px #c5dbff30;
}

.byte-pagination a:last-child { text-align: right; }

.byte-pagination strong {
    display: block;
    color: #0752ff;
    font-size: 16px;
}

.byte-pagination small {
    display: block;
    color: #576b9f;
    font-size: 12px;
}

.byte-pagination__arrow {
    display: inline-flex;
    width: 31px;
    height: 31px;
    flex: 0 0 31px;
    align-items: center;
    justify-content: center;
    border: 1px solid #d9e7ff;
    border-radius: 7px;
    color: #0752ff;
    font-size: 22px;
}

.byte-pagination a:hover { background: #edf4ff; }

.byte-pagination a:focus-visible {
    outline: 3px solid #0752ff;
    outline-offset: 3px;
}

@media (max-width: 900px) {
    .byte-why {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }
}

@media (max-width: 640px) {
    .byte-story {
        font-size: 12px;
        line-height: 1.6;
    }

    .byte-section { margin-top: 18px; }

    .byte-story .byte-section > h2 {
        gap: 9px;
        margin-bottom: 6px;
        font-size: 16px;
    }

    .byte-number {
        flex-basis: 31px;
        height: 31px;
        font-size: 14px;
    }

    .byte-eight,
    .byte-history,
    .byte-memory {
        grid-template-columns: minmax(0,1fr);
        gap: 7px;
    }

    .byte-eight__arrow,
    .byte-history__arrow {
        transform: rotate(90deg);
        line-height: 1;
    }

    .byte-eight__bits {
        grid-template-columns: repeat(4,1fr);
    }

    .byte-why,
    .byte-count {
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: 8px;
    }

    .byte-chars,
    .byte-compare {
        grid-template-columns: minmax(0,1fr);
        gap: 8px;
    }

    .byte-range {
        grid-template-columns: minmax(0,1fr);
        gap: 6px;
    }

    .byte-key,
    .byte-note,
    .byte-warning {
        gap: 9px;
        padding: 11px 12px;
    }

    .byte-key img,
    .byte-warning img,
    .byte-note__icon {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

    .byte-int {
        grid-template-columns: minmax(0,1fr);
    }

    .byte-summary {
        gap: 8px;
        padding: 14px;
    }

    .byte-summary__icon {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

    .byte-story .byte-summary h2 { font-size: 17px; }

    .byte-pagination { gap: 9px; }

    .byte-pagination a {
        flex: 1;
        min-width: 0;
        gap: 5px;
        padding: 8px 6px;
    }

    .byte-pagination strong { font-size: 13px; }

    .byte-pagination small {
        font-size: 10px;
        line-height: 1.35;
    }

    .byte-pagination__arrow {
        width: 26px;
        height: 27px;
        flex-basis: 26px;
        font-size: 18px;
    }
}
