/* Wrap long interface names without changing the shared documentation theme. */
.ap-fluid-doc table.docutils {
    width: 100%;
    table-layout: fixed;
}

.ap-fluid-doc table.docutils th,
.ap-fluid-doc table.docutils td {
    white-space: normal;
    overflow-wrap: anywhere;
}

.ap-fluid-doc table.docutils code {
    white-space: normal;
}

/* Keep RTD pages readable on wide monitors. */
.wy-nav-content {
    max-width: 1200px;
}

/* Let the foundations tutorial's explanatory tables wrap in both languages. */
.ap-diagnostics-foundations table.docutils {
    width: 100%;
}

.ap-diagnostics-foundations table.docutils th,
.ap-diagnostics-foundations table.docutils td {
    white-space: normal;
    overflow-wrap: break-word;
}

/* Distinguish optional knowledge notes from the main tutorial. */
.rst-content .admonition.ap-knowledge-box {
    border: 1px solid #c9dce8;
    border-left: 4px solid #2980b9;
    background: #f7fbfd;
}

.rst-content .ap-knowledge-box .admonition-title {
    background: #e7f2fa;
    color: #245776;
}

.ap-language-switch {
    display: inline-flex;
    gap: 0;
    margin: 0 0 1.2rem;
    border: 1px solid #cfd7df;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.ap-lang-button {
    min-width: 72px;
    padding: 0.35rem 0.75rem;
    border: 0;
    border-right: 1px solid #cfd7df;
    background: #fff;
    color: #2f3b45;
    cursor: pointer;
    font: inherit;
}

.ap-lang-button:last-child {
    border-right: 0;
}

.ap-lang-button:hover,
.ap-lang-button:focus {
    background: #edf3f8;
}

.ap-lang-button.is-active {
    background: #2980b9;
    color: #fff;
}

.ap-lang-zh {
    display: block;
}

.ap-lang-zh {
    display: none;
}

.ap-lang-en {
    display: block;
}

html[data-ap-lang="zh"] .ap-lang-zh {
    display: block;
}

html[data-ap-lang="zh"] .ap-lang-en {
    display: none;
}

html[data-ap-lang="en"] .ap-lang-zh {
    display: none;
}

html[data-ap-lang="en"] .ap-lang-en {
    display: block;
}

.ap-home-preload {
    display: none;
}

.ap-home-document-title > h1 {
    display: none;
}

.ap-home-switch {
    margin-top: 0.25rem;
}

.ap-home {
    max-width: 1180px;
}

.ap-home-hero {
    position: relative;
    overflow: hidden;
    min-height: 360px;
    margin: 0.5rem 0 2rem;
    padding: 3.25rem 3rem;
    border-radius: 8px;
    background: #102235;
    color: #fff;
}

.ap-home-hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% auto;      /* 高度铺满，宽度按比例 */
    filter: blur(3px);
    opacity: 0.9;
    transform: scale(1.03);
    transform-origin: center;
}

.ap-home-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(12, 30, 48, 0.96) 0%, rgba(12, 30, 48, 0.78) 48%, rgba(12, 30, 48, 0.2) 100%);
}

.ap-home-hero-content {
    position: relative;
    z-index: 1;
    max-width: 760px;
}

.ap-home-eyebrow {
    margin: 0 0 0.4rem;
    color: #8ee7cf;
    font-size: 0.95rem;
    font-weight: 700;
}

.ap-home-hero h1 {
    margin: 0 0 0.85rem;
    color: #fff;
    font-size: 2.8rem;
    line-height: 1.05;
}

.ap-home-logo {
    display: block;
    position: absolute;
    top: 1.4rem;
    right: 1.4rem;
    z-index: 1;
    width: min(27%, 280px);
    max-width: 280px;
    height: auto;
    margin: 0;
    padding: 0.75rem;
    border: 1px solid rgba(220, 226, 232, 0.24);
    border-radius: 8px;
    background: rgba(235, 238, 242, 0.8);
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.22));
    backdrop-filter: blur(2px);
}

.ap-home-lead {
    max-width: 680px;
    margin: 0;
    color: #e7f1f7;
    font-size: 1.16rem;
    line-height: 1.75;
}

.ap-home-caption {
    position: absolute;
    right: 2rem;
    bottom: 1.25rem;
    z-index: 1;
    max-width: 520px;
    margin: 0;
    color: rgba(231, 241, 247, 0.78);
    font-size: 0.82rem;
    line-height: 1.45;
    text-align: right;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.ap-home-caption a {
    color: #9af0dc;
    font-weight: 700;
}

.ap-home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1.55rem;
}

.ap-home-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.45rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 6px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    font-weight: 700;
}

.ap-home-action:hover,
.ap-home-action:focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
}

.ap-home-action-primary {
    border-color: #7ee4cd;
    color: #092238;
    background: #7ee4cd;
}

.ap-home-action-primary:hover,
.ap-home-action-primary:focus {
    color: #092238;
    background: #9af0dc;
}

.ap-home-section {
    margin: 2rem 0;
}

.ap-home-section h2,
.ap-home-panel h2 {
    margin-top: 0;
}

.ap-home-section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.ap-home-feature-grid,
.ap-home-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.ap-home-module-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.8rem;
}

.ap-home-feature,
.ap-home-panel,
.ap-module-card {
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 34, 53, 0.05);
}

.ap-home-feature,
.ap-home-panel {
    padding: 1rem;
}

.ap-home-feature h3,
.ap-home-feature p,
.ap-home-panel p {
    margin-top: 0;
}

.ap-home-feature p,
.ap-home-panel p,
.ap-module-card span {
    color: #4f5f6f;
}

.ap-figure-equal-height {
    margin: 1rem auto 1.6rem;
    text-align: center;
}

.ap-figure-medium {
    max-width: 760px;
}

.ap-figure-wide {
    max-width: 1080px;
}

.ap-figure-readable {
    max-width: 760px;
}

/* Shared presentation for the four Kunpeng comparison reports. */
.ap-kunpeng-compare {
    max-width: 1240px;
}

.ap-kunpeng-compare .rubric {
    margin: 1.65rem 0 0.75rem;
    padding: 0 0 0.38rem;
    border-bottom: 1px solid #d8e2ea;
    color: #172b3a;
    font-size: 1.24rem;
    font-weight: 700;
}

.ap-kunpeng-compare .rubric::before {
    content: "";
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    margin-right: 0.45rem;
    border-radius: 2px;
    background: #287c76;
    vertical-align: 0.05rem;
}

.ap-kunpeng-compare .wy-table-responsive {
    margin: 0.9rem 0 1.35rem;
    border: 1px solid #d8e2ea;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 34, 53, 0.04);
}

.ap-kunpeng-compare table.docutils {
    width: 100%;
    margin: 0;
    border: 0;
}

.ap-kunpeng-compare table.docutils th {
    border-color: #d8e2ea;
    background: #eef4f7;
    color: #172b3a;
}

.ap-kunpeng-compare table.docutils td {
    border-color: #e2e9ef;
    vertical-align: top;
}

.ap-kunpeng-compare figure,
.ap-kunpeng-compare .figure {
    padding: 0.8rem 0.8rem 0.65rem;
    border: 1px solid #d8e2ea;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 34, 53, 0.05);
}

.ap-figure-equal-height > a {
    display: block;
}

/* The B01 two-panel plots need more room than ordinary single-panel figures. */
.ap-figure-panorama {
    position: relative;
    left: 50%;
    width: min(1450px, calc(100vw - 340px));
    max-width: none;
    transform: translateX(-50%);
}

.ap-figure-equal-height img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto;
}

.ap-figure-equal-height figcaption,
.ap-figure-equal-height .caption {
    max-width: inherit;
    margin: 0.55rem auto 0;
    color: #425466;
    font-size: 0.92rem;
    line-height: 1.55;
    text-align: left;
}

@media screen and (max-width: 768px) {
    .ap-figure-panorama {
        left: auto;
        width: 100%;
        max-width: 100%;
        transform: none;
    }
}

.ap-triptych {
    margin: 1rem 0 1.35rem;
}

.ap-triptych td {
    text-align: center;
    vertical-align: top;
}

.ap-triptych img {
    max-width: 100%;
    height: auto;
}

.ap-module-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-height: 108px;
    padding: 0.9rem;
    border-top: 4px solid var(--accent, #2980b9);
    color: #1f2d3a;
}

.ap-onboarding {
    max-width: 1120px;
}

.ap-onboarding-hero {
    margin: 0.25rem 0 1.25rem;
    padding: 1.45rem 1.55rem;
    border: 1px solid #cfdbe7;
    border-left: 6px solid #2c7be5;
    border-radius: 8px;
    background: #f7fbff;
}

.ap-onboarding-hero .rubric {
    margin: 0 0 0.45rem;
    color: #172b3a;
    font-size: 1.45rem;
}

.ap-onboarding-hero p {
    max-width: 820px;
    margin-bottom: 0;
    color: #425466;
    font-size: 1.02rem;
    line-height: 1.7;
}

.ap-onboarding-path {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1.1rem;
}

.ap-onboarding-path span {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 0.55rem 0.75rem;
    border: 1px solid #cfdbe7;
    border-radius: 6px;
    background: #fff;
    color: #1f2d3a;
    font-weight: 700;
}

.ap-onboarding-path span::before {
    content: "";
    display: inline-block;
    width: 0.52rem;
    height: 0.52rem;
    margin-right: 0.55rem;
    border-radius: 50%;
    background: #00a887;
}

.ap-onboarding-done,
.ap-onboarding-step,
.ap-onboarding-note {
    margin: 1rem 0;
    padding: 1rem 1.1rem;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 34, 53, 0.04);
}

.ap-onboarding-done {
    border-left: 6px solid #00a887;
    background: #f6fffb;
}

.ap-onboarding-step {
    border-top: 4px solid #5964d8;
}

.ap-onboarding-step-primary {
    border-top-color: #d9822b;
    background: #fffaf4;
}

.ap-onboarding-note {
    border-top: 4px solid #1f9bb4;
    background: #fbfdff;
}

.ap-onboarding-route {
    border-top-color: #7b61ff;
}

.ap-onboarding-user {
    border-top-color: #00a887;
}

.ap-onboarding-dev {
    border-top-color: #5964d8;
}

.ap-onboarding-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.ap-onboarding .rubric {
    margin-top: 0;
    color: #172b3a;
    font-weight: 700;
}

.ap-onboarding ul {
    margin-bottom: 0.25rem;
}

.ap-onboarding .highlight {
    margin-bottom: 0.75rem;
}

.ap-onboarding .highlight pre {
    white-space: pre-wrap;
}

.ap-onboarding table.docutils {
    margin-bottom: 0.25rem;
}

.ap-onboarding .ap-details {
    margin: 0.8rem 0;
    padding: 0.85rem 1rem;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    background: #fbfdff;
    box-shadow: 0 1px 2px rgba(16, 34, 53, 0.04);
}

.ap-onboarding .ap-details summary {
    color: #172b3a;
    cursor: pointer;
    font-weight: 700;
}

.ap-onboarding .ap-details summary:hover,
.ap-onboarding .ap-details summary:focus {
    color: #2980b9;
}

.ap-onboarding .ap-details p,
.ap-onboarding .ap-details ul,
.ap-onboarding .ap-details pre {
    margin-top: 0.65rem;
}

.ap-onboarding .ap-details p:last-child,
.ap-onboarding .ap-details ul:last-child,
.ap-onboarding .ap-details pre:last-child {
    margin-bottom: 0;
}

.ap-onboarding .ap-details pre {
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid #2c3d52;
    background: #0f1724;
    color: #f8fafc;
    overflow-x: auto;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    word-break: break-word;
}

.ap-onboarding .ap-details pre code {
    padding: 0;
    border: 0;
    background: transparent;
    color: #f8fafc;
    overflow-wrap: inherit;
    white-space: inherit;
    word-break: inherit;
}

.ap-onboarding .ap-details p code,
.ap-onboarding .ap-details li code {
    padding: 0.08rem 0.28rem;
    border: 1px solid #d5e3ef;
    border-radius: 4px;
    background: #eef6fc;
    color: #153247;
}

.ap-git-visual {
    margin: 0.85rem 0;
    padding: 0.9rem;
    border: 1px solid #cfe1ef;
    border-radius: 8px;
    background: #f6fbff;
}

.ap-git-track {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 0.55rem;
    align-items: stretch;
}

.ap-git-node {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    min-height: 108px;
    padding: 0.72rem;
    border: 1px solid #d9e2ec;
    border-top: 4px solid #2c7be5;
    border-radius: 7px;
    background: #fff;
}

.ap-git-node-work {
    border-top-color: #2c7be5;
}

.ap-git-node-stage {
    border-top-color: #00a887;
}

.ap-git-node-commit {
    border-top-color: #5964d8;
}

.ap-git-node-remote {
    border-top-color: #d9822b;
}

.ap-git-node strong {
    color: #102235;
    font-size: 0.98rem;
}

.ap-git-node span {
    color: #4f5f6f;
    font-size: 0.88rem;
    line-height: 1.35;
}

.ap-git-node code {
    align-self: flex-start;
    margin-top: auto;
    padding: 0.08rem 0.28rem;
    border: 1px solid #d5e3ef;
    border-radius: 4px;
    background: #eef6fc;
    color: #153247;
}

.ap-git-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5964d8;
    font-weight: 700;
}

.ap-git-caption {
    margin: 0.75rem 0 0 !important;
    color: #425466;
    font-size: 0.9rem;
    line-height: 1.5;
.ap-mpi-guide .docutils.align-default,
.ap-mpi-guide table.docutils,
.ap-mpi-guide table.docutils colgroup {
    width: 100%;
}

.ap-mpi-guide .wy-table-responsive {
    overflow-x: auto;
}

.ap-mpi-guide table.docutils {
    table-layout: fixed;
}

.ap-mpi-guide table.docutils th,
.ap-mpi-guide table.docutils td {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: top;
}

.ap-mpi-guide table.docutils.ap-table-compact,
.ap-mpi-guide table.docutils.ap-table-compact colgroup {
    width: auto;
}

.ap-mpi-guide table.docutils.ap-table-compact {
    max-width: 100%;
    table-layout: auto;
}

.ap-topology-panel {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin: 0 0 1rem;
}

.ap-topology-label {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5b6b7c;
}

.ap-topology-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
    padding: 0.1rem 0 0;
}

.ap-topology-node {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.35rem;
    min-height: 4rem;
    padding: 0.9rem 1rem;
    border: 1px solid #d9e2ec;
    border-radius: 10px;
    background: linear-gradient(180deg, #f8fbfd 0%, #eef4f8 100%);
    color: #1f2d3a;
}

.ap-topology-node strong {
    font-size: 0.98rem;
    line-height: 1.2;
}

.ap-topology-node code {
    padding: 0.14rem 0.38rem;
    border-radius: 5px;
    background: #eaf2f8;
    color: #234;
    font-size: 0.88rem;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .ap-mpi-guide .wy-table-responsive table.docutils {
        width: max-content;
        min-width: 48rem;
        max-width: none;
        table-layout: auto;
    }

    .ap-mpi-guide .wy-table-responsive table.docutils colgroup {
        width: auto;
    }

    .ap-mpi-guide .wy-table-responsive table.docutils.ap-table-compact {
        width: max-content;
        min-width: 0;
    }

    .ap-topology-panel {
        gap: 0.7rem;
    }

    .ap-topology-grid {
        grid-template-columns: 1fr;
    }
}

.ap-module-card:hover,
.ap-module-card:focus {
    color: #1f2d3a;
    border-color: #b9c7d6;
    border-top-color: var(--accent, #2980b9);
    transform: translateY(-1px);
}

.ap-module-card strong {
    font-size: 1rem;
}

.ap-home-panel pre {
    margin: 0.75rem 0 0;
    padding: 0.85rem;
    border-radius: 6px;
    background: #162230;
    color: #eaf2f8;
    white-space: pre-wrap;
}

.ap-home-text-link {
    font-weight: 700;
}

.ap-home-footer-band {
    margin: 2rem 0 0;
    padding: 1.2rem 1.35rem;
    border-left: 4px solid #00a887;
    border-radius: 8px;
    background: #eef8f5;
}

.ap-home-footer-band p {
    margin: 0;
}

.ap-home-contact {
    margin-top: 0.4rem !important;
    color: #4f5f6f;
}

@media (max-width: 1100px) {
    .ap-home-module-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .ap-home-hero {
        min-height: 0;
        padding: 2.2rem 1.25rem;
    }

    .ap-home-hero::after {
        background: rgba(12, 30, 48, 0.88);
    }

    .ap-home-hero h1 {
        font-size: 2.2rem;
    }

    .ap-home-logo {
        position: relative;
        top: auto;
        right: auto;
        z-index: 1;
        width: min(220px, 100%);
        margin: 0 0 1rem;
        padding: 0.55rem;
    }

    .ap-home-lead {
        font-size: 1rem;
    }

    .ap-home-caption {
        position: relative;
        right: auto;
        bottom: auto;
        max-width: none;
        margin-top: 1.25rem;
        text-align: left;
    }

    .ap-home-feature-grid,
    .ap-home-info-grid,
    .ap-home-module-grid {
        grid-template-columns: 1fr;
    }

    .ap-home-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .ap-onboarding-hero,
    .ap-onboarding-done,
    .ap-onboarding-step,
    .ap-onboarding-note {
        padding: 0.9rem;
    }

    .ap-onboarding-path,
    .ap-onboarding-grid {
        grid-template-columns: 1fr;
    }

    .ap-git-track {
        grid-template-columns: 1fr;
    }

    .ap-git-node {
        min-height: 0;
    }

    .ap-git-arrow {
        min-height: 18px;
        transform: rotate(90deg);
    }
}

.ap-e03 {
    max-width: 1240px;
}

.ap-e03 .rubric {
    margin: 1.65rem 0 0.75rem;
    padding: 0 0 0.38rem;
    border-bottom: 1px solid #d8e2ea;
    color: #172b3a;
    font-size: 1.24rem;
    font-weight: 700;
}

.ap-e03 .rubric::before {
    content: "";
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    margin-right: 0.45rem;
    border-radius: 2px;
    background: #287c76;
    vertical-align: 0.05rem;
}

.ap-e03 .wy-table-responsive {
    margin: 0.9rem 0 1.35rem;
    border: 1px solid #d8e2ea;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 34, 53, 0.04);
}

.ap-e03 table.docutils {
    width: 100%;
    margin: 0;
    border: 0;
}

.ap-e03 table.docutils th {
    border-color: #d8e2ea;
    background: #eef4f7;
    color: #172b3a;
}

.ap-e03 table.docutils td {
    border-color: #e2e9ef;
    vertical-align: top;
}

.ap-e03 figure,
.ap-e03 .figure {
    margin: 1rem 0 1.55rem;
    padding: 0.8rem 0.8rem 0.65rem;
    border: 1px solid #d8e2ea;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 34, 53, 0.05);
}

.ap-e03 figure img,
.ap-e03 .figure img {
    border-radius: 4px;
}

.ap-e03 figcaption,
.ap-e03 .caption {
    color: #425466;
    font-size: 0.92rem;
    line-height: 1.55;
}

.ap-e03 div.admonition.note {
    margin: 0.45rem 0 1.2rem;
    border-radius: 6px;
}

.ap-e03 div.highlight {
    margin: 0.85rem 0 1.25rem;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(16, 34, 53, 0.05);
}
