:root {
    color-scheme: light;
    --ink: #172746;
    --muted: #465570;
    --accent: #294ea4;
    --selection-text: #152e60;
    --selection-bg: #d8e7ff;
    --line: #dfe5ee;
    --surface: #f5f7fc;
    --canvas: #f1f4f8;
    --navy: #101b3b;
    --hero: linear-gradient(118deg, #0d1732, #172d5c 58%, #223d78);
    --shadow: 0 14px 38px rgba(25, 43, 79, .07);
    --notice-ink: #684309;
    --notice-line: #bc8230;
    --notice-surface: #fff7e8;
    --rail: #fff;
    --header-height: 64px;
    --edge: clamp(1rem, 2vw, 2rem);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: calc(var(--header-height) + 1.5rem); }
body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font: 16px/1.85 system-ui, "Microsoft YaHei", "PingFang SC", sans-serif;
}
a { color: var(--accent); text-underline-offset: .22em; }
::selection { background-color: var(--selection-bg); color: var(--selection-text); }
.top ::selection, .article-header ::selection { background-color: #b8d2ff; color: var(--selection-text); }
a:focus-visible, summary:focus-visible, input:focus-visible, button:focus-visible, pre:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}
.skip {
    position: fixed;
    top: .5rem;
    left: .5rem;
    z-index: 5;
    padding: .4rem .8rem;
    background: white;
    transform: translateY(-160%);
}
.skip:focus { transform: none; }
.top {
    position: sticky;
    z-index: 2;
    top: 0;
    background: var(--navy);
    border-bottom: 1px solid #2a4070;
    color: #e1e9f9;
}
.top-inner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-height: var(--header-height);
    width: 100%;
    padding: 0 var(--edge);
    font-size: .9rem;
}
.brand {
    color: #fff;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -.04em;
    text-decoration: none;
}
.top-inner span { border-left: 1px solid #49608a; padding-left: 1.25rem; }
.product-link { margin-left: auto; color: #e1e9f9; }
.top a:focus-visible { outline-color: #b4cdff; }
.top-inner a { display: inline-flex; align-items: center; min-height: 44px; }
.shell {
    display: grid;
    grid-template-columns: 242px minmax(0, 1fr);
    gap: clamp(1.25rem, 3vw, 3rem);
    width: 100%;
    padding: 2rem var(--edge) 4rem;
}
.sidebar {
    position: sticky;
    top: calc(var(--header-height) + 1rem);
    align-self: start;
    max-height: calc(100vh - var(--header-height) - 2rem);
    overflow: auto;
    padding: 1.4rem .8rem 1.5rem 0;
    font-size: .875rem;
}
.sidebar {
    padding: .85rem .45rem 1rem;
    background: var(--rail);
    border: 1px solid var(--line);
    border-radius: .75rem;
    scrollbar-width: thin;
}
.navigation summary { cursor: pointer; padding: .5rem .65rem; font-weight: 700; }
.navigation nav { padding: .25rem .35rem .25rem .65rem; }
.navigation a { display: block; padding: .33rem .55rem; text-decoration: none; color: var(--muted); }
.navigation a:hover, .navigation a[aria-current="page"] {
    color: var(--accent);
    background: #eaf0ff;
    border-radius: .25rem;
}
.navigation a[aria-current="page"] {
    color: var(--selection-text);
    font-weight: 700;
    box-shadow: inset 2px 0 var(--accent);
}
.nav-group p { margin: .8rem 0 .2rem .55rem; font-weight: 700; }
.search { display: block; padding: .3rem .55rem .65rem; color: var(--muted); }
.search input {
    width: 100%;
    margin-top: .3rem;
    padding: .5rem .65rem;
    min-height: 44px;
    border: 1px solid #a4b2cb;
    border-radius: .3rem;
    font: inherit;
    color: var(--ink);
}
.no-results { margin: .3rem .55rem .8rem; }
main {
    min-width: 0;
    padding: clamp(1.25rem, 3vw, 2.5rem);
    overflow-wrap: break-word;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: .9rem;
    box-shadow: var(--shadow);
}
main.home { padding: 0; border: 0; background: none; box-shadow: none; }
h1, h2 { line-height: 1.35; }
h1 { font-size: clamp(1.9rem, 3.8vw, 2.9rem); margin: 0 0 .75rem; letter-spacing: -.035em; }
h2 { font-size: clamp(1.25rem, 2.5vw, 1.55rem); margin: 2.1rem 0 .65rem; padding-top: .85rem; border-top: 1px solid var(--line); }
main p, main li { color: var(--muted); }
main p { margin: .65rem 0 1rem; }
main li + li { margin-top: .4rem; }
.lead { font-size: 1.08rem; max-width: 38rem; }
.article-header {
    margin-bottom: 1.75rem;
    padding: clamp(1.15rem, 2.6vw, 1.85rem);
    border-radius: .6rem;
    background: var(--hero);
    color: #fff;
}
.article-header .lead { margin-bottom: 0; color: #d1def6; }
.article-header + h2 { margin-top: .6rem; }
.articles { padding-left: 1.5rem; }
.articles li { border-bottom: 1px solid var(--line); }
.articles a { display: block; padding: .75rem .3rem; text-decoration: none; }
.articles a:hover strong { text-decoration: underline; }
.articles span { display: block; color: var(--muted); font-size: .92rem; }
.home .articles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem 1.15rem;
    padding: 0;
    list-style: none;
}
.home .articles li { margin: 0; }
.home .articles a { min-height: 100%; padding: .8rem 0; }
.home-content { min-width: 0; }
.home-content > h1 { margin-bottom: 1.15rem; }
.home-content > section {
    padding: clamp(1.05rem, 2.6vw, 1.9rem);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: .75rem;
}
.home-content > section + section { margin-top: 1.15rem; }
.home-content > section > h2 { margin: 0 0 .65rem; padding: 0; border: 0; }
pre {
    overflow: auto;
    max-width: 100%;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: .35rem;
    margin: 0 0 1rem;
    background: var(--surface);
    color: #233f72;
}
code { font: .88em/1.75 Consolas, monospace; }
p code, li code {
    overflow-wrap: anywhere;
    padding: .1em .3em;
    border-radius: .2rem;
    background: var(--surface);
    color: #233f72;
}
.code-sample {
    margin: 0 0 1rem;
    border: 1px solid var(--line);
    border-radius: .35rem;
    background: var(--surface);
}
.code-sample pre { margin: 0; border: 0; background: transparent; }
.code-sample pre:focus-visible { outline-offset: -2px; }
.code-label { display: flex; justify-content: flex-end; padding: .25rem; border-bottom: 1px solid var(--line); }
.copy-command {
    min-height: 44px;
    padding: .35rem .75rem;
    border: 1px solid #a4b2cb;
    border-radius: .35rem;
    background: white;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    font-size: .875rem;
}
.copy-command:hover { background: var(--surface); }
.navigation[open] summary { color: var(--accent); }
h2:target { color: var(--accent); }
.next { border-top: 1px solid var(--line); padding-top: 1rem; }
.doc-callout {
    margin: 1rem 0 1.4rem;
    padding: .9rem 1.15rem;
    border-inline-start: 3px solid var(--accent);
    border-radius: .3rem;
    background: var(--surface);
}
.doc-callout p { margin: .35rem 0 0; }
.doc-callout.pending {
    border-color: var(--notice-line);
    background: var(--notice-surface);
}
.doc-callout.pending strong { color: var(--notice-ink); }
.rule-list { margin: .75rem 0 1.35rem; }
.rule-list dt { padding: .65rem 0 0; border-top: 1px solid var(--line); font-weight: 700; }
.rule-list dd { margin: .15rem 0 .75rem; color: var(--muted); }
.tech-table {
    width: 100%;
    margin: 1rem 0 1.5rem;
    border-collapse: collapse;
    font-size: .95rem;
    line-height: 1.65;
}
.tech-table th, .tech-table td {
    padding: .7rem .85rem;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}
.tech-table thead th { background: var(--surface); }
.tech-table tbody th { width: 25%; }
.tech-table td { color: var(--muted); }
.tech-table td code { overflow-wrap: anywhere; }

@media (prefers-reduced-motion: no-preference) {
    [data-enter] { animation: enter 260ms ease-out; }
    .home .articles a { transition: transform 150ms ease; }
    .home .articles a:hover { transform: translateY(-2px); }
}
@keyframes enter {
    from { opacity: .65; transform: translateY(5px); }
    to { opacity: 1; transform: none; }
}
@media (max-width: 1100px) {
    .shell { grid-template-columns: 220px minmax(0, 1fr); }
}
@media (max-width: 820px) {
    .top-inner { gap: .65rem; }
    .top-inner span { padding-left: .65rem; }
    .shell { display: block; padding-top: .85rem; }
    .sidebar { position: static; max-height: none; padding: .2rem .7rem; margin-bottom: .85rem; }
    .navigation summary { display: flex; align-items: center; gap: .5rem; padding-inline: .35rem; }
    .navigation summary::after { content: "▸"; }
    .navigation[open] summary::after { content: "▾"; }
    .navigation nav { padding-inline: 0; }
    .navigation summary, .navigation a { min-height: 44px; }
    .navigation a { display: flex; align-items: center; }
    .navigation[open] nav { max-height: 58vh; overflow: auto; }
}
@media (max-width: 490px) {
    .home .articles { grid-template-columns: 1fr; }
    .tech-table { font-size: .875rem; }
    .tech-table th, .tech-table td { padding: .55rem .5rem; }
    .tech-table tbody th { width: 32%; }
}
