@font-face {
    font-family: "OPPO Sans";
    src: url("/fonts/oppo-sans.woff2") format("woff2");
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --blue: #2f6fe4;
    --blue-dark: #2258b8;
    --blue-soft: #e8f2ff;
    --ink: #173a6d;
    --text: #2b4a71;
    --muted: #7d94b4;
    --line: #e3edfb;
    --surface: #f7faff;
    --card: #ffffff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 86px; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--surface);
    color: var(--text);
    font-family: "OPPO Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
    line-height: 1.7;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ header */

.docs-header {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 64px;
    padding: 10px 24px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(14px);
}

.docs-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    color: var(--ink);
}
.docs-brand:hover { text-decoration: none; }
.docs-brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--blue);
    color: #fff;
    font-size: .86rem;
    font-weight: 700;
    box-shadow: 0 5px 12px rgba(47, 111, 228, .22);
}
.docs-brand-copy { display: flex; flex-direction: column; line-height: 1.25; }
.docs-brand-copy strong { font-size: .86rem; }
.docs-brand-copy small { color: var(--muted); font-size: .63rem; }

.docs-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 7px;
    width: min(380px, 34vw);
    height: 36px;
    margin-left: auto;
    padding: 0 12px;
    border: 1px solid #d3e2f8;
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    transition: border-color .16s ease, box-shadow .16s ease;
}
.docs-search:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(47, 111, 228, .12);
}
.docs-search input {
    width: 100%;
    border: 0;
    background: transparent;
    color: #1d3557;
    font: 500 .76rem "OPPO Sans", sans-serif;
    outline: none;
}
.docs-search-results {
    position: absolute;
    top: calc(100% + 7px);
    left: 0;
    right: 0;
    max-height: 340px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid #d8e6fa;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(8, 35, 85, .18);
}
.docs-search-results a {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text);
    font-size: .74rem;
}
.docs-search-results a:hover,
.docs-search-results a.active { background: #eef6ff; color: var(--blue-dark); text-decoration: none; }
.docs-search-results small { display: block; color: var(--muted); font-size: .62rem; }
.docs-search-empty { padding: 9px 10px; color: var(--muted); font-size: .72rem; }

.docs-top-links {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    font-size: .72rem;
    font-weight: 600;
}
.docs-top-links a { color: #5d7ea4; }
.docs-top-links a:hover { color: var(--blue); text-decoration: none; }

.docs-menu-toggle {
    display: none;
    width: 34px;
    height: 34px;
    border: 1px solid #d3e2f8;
    border-radius: 8px;
    background: #fff;
    color: var(--blue);
    font-size: 1rem;
    cursor: pointer;
}

/* ----------------------------------------------------------------- layout */

.docs-layout {
    display: flex;
    align-items: flex-start;
    width: min(1280px, 100%);
    margin: 0 auto;
    padding: 26px 24px 60px;
    gap: 28px;
}

.docs-sidebar {
    position: sticky;
    top: 86px;
    flex: 0 0 244px;
    max-height: calc(100vh - 108px);
    overflow-y: auto;
    padding: 4px 2px 18px;
}

.docs-nav-group { margin-bottom: 16px; }
.docs-nav-title {
    padding: 0 10px 6px;
    color: #93a8c4;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .1em;
}
.docs-nav a {
    display: block;
    padding: 7px 10px;
    border-radius: 8px;
    color: #5d7ea4;
    font-size: .76rem;
    font-weight: 500;
}
.docs-nav a:hover { background: #eef6ff; color: var(--blue); text-decoration: none; }
.docs-nav a.active {
    background: #fff;
    color: var(--blue-dark);
    font-weight: 700;
    border: 1px solid #cfe0f7;
    box-shadow: 0 3px 10px rgba(23, 58, 109, .05);
}

.docs-sidebar-foot {
    margin-top: 18px;
    padding: 12px 10px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    color: #8096b3;
    font-size: .66rem;
    line-height: 1.6;
}
.docs-sidebar-foot strong { display: block; color: var(--ink); font-size: .72rem; margin-bottom: 3px; }
.docs-sidebar-foot a { color: var(--blue); font-weight: 600; }

.docs-main {
    flex: 1;
    min-width: 0;
    max-width: 850px;
    padding: 4px 0 30px;
}

.docs-breadcrumb {
    margin-bottom: 12px;
    color: #93a8c4;
    font-size: .68rem;
}
.docs-breadcrumb a { color: #5d7ea4; }

.docs-main h1 {
    margin: 0 0 10px;
    color: var(--ink);
    font-size: clamp(1.55rem, 3vw, 2.1rem);
    line-height: 1.3;
    letter-spacing: -.025em;
}
.docs-main h2 {
    margin: 34px 0 12px;
    padding-top: 10px;
    color: var(--ink);
    font-size: 1.22rem;
    line-height: 1.4;
    border-top: 1px solid var(--line);
}
.docs-main h3 {
    margin: 22px 0 8px;
    color: #2a4a72;
    font-size: .98rem;
}
.docs-main p { margin: 0 0 12px; color: #4b678c; font-size: .83rem; }
.docs-main li { margin: 4px 0; color: #4b678c; font-size: .82rem; }
.docs-main ul, .docs-main ol { margin: 8px 0 14px; padding-left: 22px; }
.docs-main strong { color: var(--ink); }
.docs-main code {
    padding: 2px 5px;
    border-radius: 4px;
    background: #eef4fc;
    color: #2258b8;
    font-family: Consolas, "SFMono-Regular", monospace;
    font-size: .76em;
}
.docs-main pre {
    margin: 12px 0 16px;
    padding: 12px 14px;
    overflow-x: auto;
    border-radius: 10px;
    background: #102746;
    color: #dcecff;
    font-family: Consolas, "SFMono-Regular", monospace;
    font-size: .72rem;
    line-height: 1.6;
}
.docs-main pre code { padding: 0; background: transparent; color: inherit; font-size: inherit; }
.docs-main hr { margin: 28px 0; border: 0; border-top: 1px solid var(--line); }
.docs-main table {
    width: 100%;
    margin: 12px 0 18px;
    border-collapse: collapse;
    font-size: .76rem;
}
.docs-main th, .docs-main td {
    padding: 9px 10px;
    border: 1px solid #e1ebf8;
    text-align: left;
    vertical-align: top;
}
.docs-main th { background: #f4f9ff; color: #2a4a72; }
.docs-main td { color: #4b678c; }

.docs-lead {
    max-width: 720px;
    color: #5d7ea4;
    font-size: .92rem !important;
    line-height: 1.75;
}

/* --------------------------------------------------------------- components */

.callout {
    margin: 16px 0;
    padding: 14px 16px;
    border: 1px solid #d8e6fa;
    border-left: 3px solid var(--blue);
    border-radius: 10px;
    background: #f4f9ff;
    color: #4b678c;
    font-size: .8rem;
}
.callout strong { display: block; color: var(--ink); margin-bottom: 3px; }
.callout p { margin: 0; color: #5d7ea4; font-size: .78rem; }
.callout.sponsor {
    border: 1px solid #f0d7b8;
    border-left-color: #d99b4e;
    background: #fffaf2;
}
.callout.sponsor strong { color: #8a5a20; }
.callout.sponsor p { color: #8a6a45; }

.button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 8px;
    background: var(--blue);
    color: #fff !important;
    font-size: .76rem;
    font-weight: 700;
    text-decoration: none !important;
}
.button:hover { background: var(--blue-dark); }
.button.secondary {
    border: 1px solid #c9d8ee;
    background: #fff;
    color: var(--blue) !important;
}
.button.secondary:hover { background: #f4f9ff; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 6px; }

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0 8px;
}
.project-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 13px 14px;
    border: 1px solid #dce9fb;
    border-radius: 12px;
    background: var(--card);
    color: var(--text);
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.project-card:hover {
    transform: translateY(-2px);
    border-color: #9fc2f4;
    box-shadow: 0 10px 24px rgba(8, 35, 85, .08);
    text-decoration: none;
}
.project-card strong { color: var(--ink); font-size: .84rem; }
.project-card span { color: var(--muted); font-size: .7rem; line-height: 1.55; }
.project-card small { color: var(--blue); font-size: .66rem; word-break: break-all; }
.project-card.planned { border-style: dashed; background: #fbfdff; }
.project-card.planned strong { color: #5d7ea4; }

.tag {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--blue-soft);
    color: var(--blue-dark);
    font-size: .58rem;
    font-weight: 700;
    vertical-align: 1px;
}
.tag.warm { background: #fff2df; color: #9a611f; }
.tag.green { background: #eafaf2; color: #18794a; }

.doc-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0;
}
.doc-card {
    padding: 14px;
    border: 1px solid #dce9fb;
    border-radius: 12px;
    background: #fff;
}
.doc-card strong { display: block; color: var(--ink); font-size: .84rem; margin-bottom: 3px; }
.doc-card p { margin: 0 0 8px; color: var(--muted); font-size: .72rem; }
.doc-card a { font-size: .7rem; font-weight: 700; }

.quote {
    margin: 16px 0;
    padding: 12px 16px;
    border-left: 3px solid #cfe0f7;
    color: #5d7ea4;
    background: #fbfdff;
    font-size: .8rem;
}

.docs-footer {
    width: min(1280px, 100%);
    margin: 0 auto;
    padding: 18px 24px 28px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #93a8c4;
    font-size: .66rem;
}
.docs-footer a { color: #5d7ea4; }

@media (max-width: 1000px) {
    .docs-top-links { display: none; }
    .docs-search { width: min(360px, 42vw); }
    .docs-sidebar { flex-basis: 210px; }
}

@media (max-width: 780px) {
    .docs-header { padding: 10px 14px; gap: 8px; }
    .docs-menu-toggle { display: block; }
    .docs-brand-copy small { display: none; }
    .docs-search { width: 100%; order: 3; }
    .docs-header { flex-wrap: wrap; }
    .docs-layout { padding: 18px 14px 40px; }
    .docs-sidebar {
        display: none;
        position: fixed;
        top: 64px;
        left: 0;
        bottom: 0;
        z-index: 35;
        width: 260px;
        max-height: none;
        padding: 16px 12px;
        border-right: 1px solid var(--line);
        background: #fff;
        box-shadow: 20px 0 40px rgba(8, 35, 85, .12);
    }
    .docs-sidebar.open { display: block; }
    .docs-main { max-width: none; }
    .project-grid, .doc-cards { grid-template-columns: 1fr; }
    .docs-footer { flex-direction: column; padding: 14px 14px 22px; }
}
