/* 从文件到程序：电脑世界大串联 */

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

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

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

.chain-story .chain-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;
}

.chain-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;
}

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

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

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

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

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

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

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

/* 存储 */

.chain-storage,
.chain-memory {
    display: grid;
    grid-template-columns: .9fr 50px 1.4fr;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
}

.chain-storage__drive,
.chain-memory__storage,
.chain-memory__ram {
    display: flex;
    min-height: 180px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 14px;
    border-radius: 15px;
    text-align: center;
}

.chain-storage__drive,
.chain-memory__storage { background: #eef5ff; }

.chain-memory__ram { background: #eef9f0; }

.chain-storage__drive > span,
.chain-memory > div > span {
    font-size: 58px;
}

.chain-storage__drive > span,
.chain-memory__storage > span { color: #0752ff; }

.chain-memory__ram > span { color: #2a9b55; }

.chain-storage__files {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px;
    padding: 14px;
    border-radius: 15px;
    background: #f7f8fc;
}

.chain-storage__files span {
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px;
    border-radius: 10px;
    background: #fff;
    color: #1d3d75;
    font-size: 10px;
    font-weight: 800;
    text-align: center;
}

.chain-storage__arrow,
.chain-memory__arrow,
.chain-cpu__arrow,
.chain-launch__arrow,
.chain-full__arrow {
    color: #4f82ff;
    font-size: 23px;
    font-weight: 900;
    text-align: center;
}

.chain-story .chain-storage h3,
.chain-story .chain-memory h3 {
    margin: 8px 0 4px;
    color: var(--article-heading-color);
    font-size: 14px;
}

.chain-storage p,
.chain-memory p {
    margin: 0;
    color: #617296;
    font-size: 10px;
}

/* 目录树 */

.chain-folder-tree {
    margin-top: 14px;
    padding: 18px;
    border-radius: 15px;
    background: #f7f8fc;
}

.chain-folder-tree__root {
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    margin: 0 auto 14px;
    padding: 10px 13px;
    border-radius: 10px;
    background: #fff6df;
    color: #9a6800;
}

.chain-folder-tree__items {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 8px;
}

.chain-folder-tree__items span {
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px;
    border-radius: 10px;
    background: #fff;
    color: #1d3d75;
    font-size: 10px;
    font-weight: 800;
    text-align: center;
}

/* 启动 */

.chain-launch {
    display: grid;
    grid-template-columns: 1fr 28px 1fr 28px 1fr;
    gap: 7px;
    align-items: center;
    margin-top: 14px;
}

.chain-launch article,
.chain-full article {
    position: relative;
    min-width: 0;
    min-height: 185px;
    padding: 14px 8px;
    border: 1px solid #e1ebff;
    border-radius: 14px;
    background: #f9fbff;
    text-align: center;
}

.chain-launch__badge,
.chain-full article > span {
    position: absolute;
    top: 8px;
    left: 8px;
    display: inline-flex;
    width: 25px;
    height: 25px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #0752ff;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.chain-launch article > i,
.chain-full article > i {
    margin: 16px 0 8px;
    color: #0752ff;
    font-size: 39px;
}

.chain-story .chain-launch h3,
.chain-story .chain-full h3 {
    margin: 0 0 4px;
    color: var(--article-heading-color);
    font-size: 13px;
}

.chain-launch p,
.chain-full p {
    margin: 0;
    color: #617296;
    font-size: 10px;
}

/* CPU */

.chain-cpu {
    display: grid;
    grid-template-columns: 1.2fr 28px .8fr 28px 1fr;
    gap: 7px;
    align-items: center;
    margin-top: 14px;
}

.chain-cpu > div:not(.chain-cpu__arrow) {
    display: flex;
    min-height: 180px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 13px;
    border-radius: 15px;
    text-align: center;
}

.chain-cpu__ram { background: #eef5ff; }
.chain-cpu__processor { background: #fff6df; }
.chain-cpu__result { background: #eef9f0; }

.chain-cpu > div > span {
    font-size: 54px;
}

.chain-cpu__ram > span { color: #0752ff; }
.chain-cpu__processor > span { color: #d58d00; }
.chain-cpu__result > span { color: #2a9b55; }

.chain-cpu__ram code {
    margin-top: 7px;
    padding: 7px 9px;
    border-radius: 8px;
    background: #fff;
    color: #1d3d75;
    font-size: 10px;
    font-weight: 800;
}

.chain-story .chain-cpu h3 {
    margin: 7px 0 4px;
    color: var(--article-heading-color);
    font-size: 13px;
}

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

/* 读写文件 */

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

.chain-read-write article {
    min-width: 0;
    padding: 14px 10px;
    border: 1px solid #e1ebff;
    border-radius: 14px;
    background: #f9fbff;
    text-align: center;
}

.chain-read-write article > 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;
}

.chain-story .chain-read-write h3 {
    margin: 0 0 4px;
    color: var(--article-heading-color);
    font-size: 13px;
}

.chain-read-write p {
    margin: 0;
    color: #617296;
    font-size: 10px;
}

/* 完整链路 */

.chain-full {
    display: grid;
    grid-template-columns: 1fr 18px 1fr 18px 1fr 18px 1fr 18px 1fr;
    gap: 4px;
    align-items: center;
    margin-top: 14px;
}

.chain-full article {
    min-height: 190px;
}

.chain-full-more {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
    padding: 13px 15px;
    border-radius: 14px;
    background: #f3efff;
}

.chain-full-more span {
    color: #6049b8;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.chain-full-more b {
    color: #554c70;
    font-size: 11px;
    font-weight: 700;
}

/* 易错点 */

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

.chain-mistakes article {
    padding: 14px;
    border: 1px solid #e6e9f1;
    border-radius: 14px;
    background: #f9fbff;
}

.chain-mistakes article > strong {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: #fff2f5;
    color: #d83265;
    font-size: 10px;
}

.chain-story .chain-mistakes h3 {
    margin: 8px 0 4px;
    color: var(--article-heading-color);
    font-size: 13px;
}

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

/* 总结 */

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

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

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

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

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

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

/* 翻页 */

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

.chain-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;
}

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

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

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

.chain-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;
}

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

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

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

    .chain-full {
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: 9px;
    }

    .chain-full__arrow { display: none; }
}

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

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

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

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

    .chain-storage,
    .chain-memory,
    .chain-launch,
    .chain-cpu,
    .chain-full {
        grid-template-columns: minmax(0,1fr);
        gap: 7px;
    }

    .chain-storage__arrow,
    .chain-memory__arrow,
    .chain-launch__arrow,
    .chain-cpu__arrow,
    .chain-full__arrow {
        display: block;
        transform: rotate(90deg);
        line-height: 1;
    }

    .chain-folder-tree__items,
    .chain-read-write,
    .chain-mistakes {
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: 8px;
    }

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

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

    .chain-launch article,
    .chain-full article {
        min-height: auto;
    }

    .chain-full-more {
        align-items: flex-start;
        flex-direction: column;
    }

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

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

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

    .chain-pagination { gap: 9px; }

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

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

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

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