/* 操作系统是做什么的？ */

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

.os-story * { box-sizing: border-box; }
.os-story img { display: block; max-width: 100%; }
.os-story p { margin: 0 0 12px; }
.os-story strong { color: var(--article-heading-color); }

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

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

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

/* 层次结构 */

.os-layers {
    max-width: 630px;
    margin: 14px auto 0;
}

.os-layers > div:not(.os-layers__arrow) {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 13px 15px;
    border-radius: 14px;
}

.os-layers__user { background: #fff6df; }
.os-layers__apps { background: #f3efff; }
.os-layers__os { background: #eef9f0; }
.os-layers__hardware { background: #eef5ff; }

.os-layers > div > span {
    display: inline-flex;
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: #fff;
    color: #0752ff;
    font-size: 24px;
}

.os-layers strong {
    display: block;
    font-size: 14px;
}

.os-layers small {
    margin-left: auto;
    color: #71809f;
    font-size: 10px;
}

.os-layers__arrow {
    padding: 4px 0;
    color: #4f82ff;
    font-size: 22px;
    font-weight: 900;
    text-align: center;
}

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

.os-key { background: #eaf5ff; }

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

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

.os-story .os-key h3 { color: #0752ff; }

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

/* 硬件资源 */

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

.os-resources article {
    min-width: 0;
    padding: 14px 9px;
    border: 1px solid #e1ebff;
    border-radius: 14px;
    background: #f9fbff;
    text-align: center;
}

.os-resources article > img,
.os-resources__icon {
    width: 66px;
    height: 66px;
    object-fit: contain;
    margin: 0 auto 6px;
}

.os-resources__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 19px;
    background: #eaf3ff;
    color: #0752ff;
    font-size: 28px;
}

.os-story .os-resources h3 {
    margin: 0 0 4px;
    color: var(--article-heading-color);
    font-size: 14px;
}

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

.os-note { background: #fff8e5; }

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

.os-story .os-note h3 { color: #9a6800; }

/* 运行程序 */

.os-run-flow {
    display: grid;
    grid-template-columns: 1fr 25px 1fr 25px 1fr 25px 1fr;
    gap: 5px;
    align-items: center;
    margin-top: 14px;
}

.os-run-flow article {
    position: relative;
    min-width: 0;
    min-height: 195px;
    padding: 13px 8px;
    border: 1px solid #e1ebff;
    border-radius: 14px;
    background: #f9fbff;
    text-align: center;
}

.os-run-flow__badge {
    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;
}

.os-run-flow__icon,
.os-run-flow article > img {
    width: 62px;
    height: 62px;
    object-fit: contain;
    margin: 12px auto 7px;
}

.os-run-flow__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: #eaf3ff;
    color: #0752ff;
    font-size: 27px;
}

.os-story .os-run-flow h3 {
    margin: 0 0 4px;
    color: var(--article-heading-color);
    font-size: 13px;
}

.os-run-flow p {
    margin: 0;
    color: #607296;
    font-size: 10px;
}

.os-run-flow__arrow,
.os-files__arrow,
.os-device-flow__arrow,
.os-schedule__arrow {
    color: #4f82ff;
    font-size: 21px;
    font-weight: 900;
    text-align: center;
}

.os-warning {
    border: 1px solid #ffd0dc;
    background: #fff2f6;
}

.os-story .os-warning h3 { color: #d83265; }

/* 文件系统 */

.os-files {
    display: grid;
    grid-template-columns: 1fr 35px 1fr 35px 1fr;
    gap: 8px;
    align-items: center;
    margin-top: 14px;
}

.os-files__raw,
.os-files__fs,
.os-files__user {
    display: flex;
    min-height: 175px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 13px;
    border-radius: 15px;
    text-align: center;
}

.os-files__raw { background: #eef5ff; }
.os-files__fs { background: #f3efff; }
.os-files__user { background: #eef9f0; }

.os-files > div > span {
    color: #0752ff;
    font-size: 56px;
}

.os-files__fs > span { color: #7654d6; }
.os-files__user > span { color: #2a9b55; }

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

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

.os-file-example {
    display: flex;
    gap: 7px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 13px;
    background: #f7f8fc;
}

.os-file-example code {
    padding: 4px 7px;
    border-radius: 7px;
    background: #fff;
    color: #1d3d75;
    font-size: 12px;
}

.os-file-example span {
    color: #71809f;
    font-size: 11px;
}

.os-small-note {
    margin-top: 8px !important;
    color: #7382a0;
    font-size: 12px;
}

/* 设备和驱动 */

.os-device-flow {
    display: grid;
    grid-template-columns: 1fr 25px 1fr 25px 1fr 25px 1fr;
    gap: 5px;
    align-items: center;
    margin-top: 14px;
}

.os-device-flow article {
    min-width: 0;
    min-height: 180px;
    padding: 14px 9px;
    border: 1px solid #e1ebff;
    border-radius: 14px;
    background: #f9fbff;
    text-align: center;
}

.os-device-flow article > span {
    display: inline-flex;
    width: 62px;
    height: 62px;
    align-items: center;
    justify-content: center;
    margin-bottom: 7px;
    border-radius: 18px;
    background: #eaf3ff;
    color: #0752ff;
    font-size: 26px;
}

.os-story .os-device-flow h3 {
    margin: 0 0 4px;
    color: var(--article-heading-color);
    font-size: 13px;
}

.os-device-flow p {
    margin: 0;
    color: #607296;
    font-size: 10px;
}

.os-note--driver { background: #eef9f0; }

/* 调度 */

.os-schedule {
    display: grid;
    grid-template-columns: 1.4fr 35px 1.1fr 35px 1fr;
    gap: 8px;
    align-items: center;
    margin-top: 14px;
}

.os-schedule__apps {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 7px;
}

.os-schedule__apps article {
    display: flex;
    min-height: 100px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    border: 1px solid #e1ebff;
    border-radius: 13px;
    background: #f9fbff;
}

.os-schedule__apps i {
    color: #0752ff;
    font-size: 28px;
}

.os-schedule__apps span {
    font-size: 11px;
    font-weight: 800;
}

.os-schedule__os,
.os-schedule__cpu {
    display: flex;
    min-height: 165px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 13px;
    border-radius: 15px;
    text-align: center;
}

.os-schedule__os { background: #f3efff; }
.os-schedule__cpu { background: #eef5ff; }

.os-schedule__os > span {
    color: #7654d6;
    font-size: 54px;
}

.os-schedule__cpu img {
    width: 74px;
    height: 74px;
    object-fit: contain;
}

.os-story .os-schedule h3 {
    margin: 7px 0 4px;
    color: var(--article-heading-color);
    font-size: 14px;
}

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

/* 大总管比喻 */

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

.os-boss > div {
    min-width: 0;
    padding: 16px;
    border-radius: 15px;
}

.os-boss__helps { background: #effaf2; }
.os-boss__careful { background: #fff5e8; }

.os-story .os-boss h3 {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 0 0 8px;
    color: var(--article-heading-color);
    font-size: 15px;
}

.os-boss__helps h3 i { color: #2aa05a; }
.os-boss__careful h3 i { color: #d99400; }

.os-boss ul {
    margin: 0;
    padding-left: 20px;
    line-height: 1.8;
}

.os-key--final { background: #eaf5ff; }

/* 总结 */

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

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

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

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

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

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

/* 翻页 */

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

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

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

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

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

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

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

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

@media (max-width: 900px) {
    .os-run-flow,
    .os-device-flow {
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: 9px;
    }

    .os-run-flow > .os-run-flow__arrow,
    .os-device-flow > .os-device-flow__arrow {
        display: none;
    }
}

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

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

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

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

    .os-layers small {
        margin-left: 0;
        display: block;
    }

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

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

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

    .os-run-flow,
    .os-files,
    .os-device-flow,
    .os-schedule {
        grid-template-columns: minmax(0,1fr);
        gap: 7px;
    }

    .os-run-flow > .os-run-flow__arrow,
    .os-files__arrow,
    .os-device-flow > .os-device-flow__arrow,
    .os-schedule__arrow {
        display: block;
        transform: rotate(90deg);
        line-height: 1;
    }

    .os-run-flow article,
    .os-device-flow article {
        min-height: auto;
        padding: 12px 9px;
    }

    .os-files__raw,
    .os-files__fs,
    .os-files__user,
    .os-schedule__os,
    .os-schedule__cpu {
        min-height: auto;
        padding: 13px;
    }

    .os-schedule__apps {
        gap: 6px;
    }

    .os-schedule__apps article {
        min-height: 88px;
    }

    .os-boss {
        grid-template-columns: minmax(0,1fr);
        gap: 8px;
    }

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

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

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

    .os-pagination { gap: 9px; }

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

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

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

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