:root {
    color-scheme: light;
    --background: #ffffff;
    --surface: #f7f8fb;
    --border: #e5e7eb;
    --text: #20242c;
    --muted: #6b7280;
    --primary: #6657d9;
    --primary-soft: #eeecff;
    --code: #171923;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--text);
    background: var(--background);
    font: 15px/1.75 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.layout { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: 288px;
    padding: 28px 20px 20px;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    background: var(--surface);
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 8px 24px;
    color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-mark {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(145deg, #7768e8, #5545c8);
    box-shadow: 0 8px 24px rgba(102, 87, 217, .25);
    font-size: 20px;
    font-weight: 800;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; }
.brand small { color: var(--muted); font-size: 12px; }
.search-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.nav-search {
    width: 100%;
    margin-bottom: 16px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: none;
    background: #fff;
    font: inherit;
}
.nav-search:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.navigation { display: grid; gap: 3px; }
.navigation a {
    padding: 7px 10px;
    border-radius: 7px;
    color: #4b5563;
    line-height: 1.45;
}
.navigation a:hover { color: var(--text); background: #fff; text-decoration: none; }
.navigation a.active { color: #4f3fc0; background: var(--primary-soft); font-weight: 650; }
.sidebar-meta { margin: 24px 8px 0; color: var(--muted); font-size: 12px; }
.main { margin-left: 288px; }
.document { max-width: 920px; min-height: calc(100vh - 160px); margin: 0 auto; padding: 64px 64px 32px; }
.document h1 { margin: 0 0 32px; font-size: 38px; line-height: 1.25; letter-spacing: -.02em; }
.document h2 { margin: 42px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); font-size: 25px; line-height: 1.35; }
.document h3 { margin: 32px 0 10px; font-size: 19px; line-height: 1.45; }
.document h4 { margin: 24px 0 8px; font-size: 16px; }
.document p, .document ul, .document ol { margin: 0 0 16px; }
.document img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 10px; }
.document blockquote { margin: 20px 0; padding: 12px 18px; border-left: 4px solid var(--primary); color: #4b5563; background: var(--primary-soft); }
.document table { display: block; width: max-content; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.document th, .document td { padding: 9px 12px; border: 1px solid var(--border); text-align: left; }
.document th { background: var(--surface); }
.document code { padding: .15em .38em; border-radius: 4px; color: #5345bd; background: var(--primary-soft); font: .9em/1.6 SFMono-Regular, Consolas, "Liberation Mono", monospace; }
.document pre { margin: 18px 0 24px; padding: 18px 20px; overflow-x: auto; border-radius: 10px; background: var(--code); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.document pre code { padding: 0; color: #e8eaf2; background: transparent; font-size: 13px; }
.pager { display: flex; max-width: 792px; margin: 0 auto; padding: 24px 0 52px; gap: 16px; }
.pager-link { flex: 1; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); }
.pager-link:hover { border-color: #c9c3f4; background: var(--primary-soft); text-decoration: none; }
.pager-link span, .pager-link strong { display: block; }
.pager-link span { color: var(--muted); font-size: 12px; }
.pager-link.next { text-align: right; }
footer { max-width: 792px; margin: 0 auto; padding: 0 0 40px; color: var(--muted); text-align: center; font-size: 12px; }
.mobile-header { display: none; }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 10; background: rgba(17, 24, 39, .38); }

/* API reference. swagger-ui.css is linked before this file, so these win where they overlap */
body { background: var(--background); }
.api-document { min-height: 0; padding-bottom: 0; }
.api-document h1 { margin-bottom: 12px; }
.api-document p { color: var(--muted); }
#swagger-ui { max-width: 1040px; margin: 0 auto; padding: 0 40px 48px; }
#swagger-ui .swagger-ui .wrapper { max-width: none; padding: 0; }
#swagger-ui .swagger-ui .information-container { padding: 0; }
#swagger-ui .swagger-ui .info { margin: 0 0 24px; }
#swagger-ui .swagger-ui .info .title { font-size: 25px; }
#swagger-ui .swagger-ui .scheme-container { margin: 0 0 24px; padding: 16px 0; box-shadow: none; border-bottom: 1px solid var(--border); background: transparent; }

/* BaseLayout mounts an off-canvas operations drawer, and swagger-ui.css carries no rule for it --
   not a vendoring slip, the upstream 5.15.2 stylesheet has none either. Unpositioned it falls into
   the flow below the last operation as a bare checkbox and a column of links, and no control in
   this layout ever opens it, so there is nothing to keep */
#swagger-ui .EZDrawer { display: none; }

@media (max-width: 900px) {
    #swagger-ui { padding: 0 20px 32px; }
}

@media (max-width: 900px) {
    .mobile-header { position: sticky; top: 0; z-index: 15; display: flex; height: 58px; align-items: center; gap: 14px; padding: 0 18px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); }
    .menu-button { border: 0; color: var(--text); background: transparent; font-size: 23px; cursor: pointer; }
    .mobile-brand { color: var(--text); font-size: 17px; font-weight: 750; }
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .document { padding: 42px 24px 24px; }
    .document h1 { font-size: 31px; }
    .pager { margin: 0 24px; }
    footer { padding-inline: 24px; }
}

@media (max-width: 560px) {
    .pager { flex-direction: column; }
    .pager-link.next { text-align: left; }
}
