/* Keep PyData's native structure; brand overrides stay deliberately small. */
html { --pst-font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif; --pst-font-family-heading: var(--pst-font-family-base); --pst-header-height: 4rem; }
html[data-theme="light"] { --pst-color-primary: #28657b; --pst-color-link: #28657b; --pst-color-link-hover: #173e50; --pst-color-secondary: #5272c3; --pst-color-text-base: #222832; --pst-color-text-muted: #596370; --pst-color-background: #fff; --pst-color-on-background: #fff; --pst-color-surface: #f5f6f8; --am-line: #e6e8eb; --am-selected: #edf3f6; --am-accent: #28657b; --am-badge: #eff2f5; }
html[data-theme="dark"] { --pst-color-primary: #81bed4; --pst-color-link: #81bed4; --pst-color-link-hover: #b4d9e7; --pst-color-secondary: #a4b7ff; --pst-color-text-base: #e3e7ef; --pst-color-text-muted: #aab2c0; --pst-color-background: #161a21; --pst-color-on-background: #161a21; --pst-color-surface: #202630; --am-line: #343c49; --am-selected: #22313b; --am-accent: #81bed4; --am-badge: #29313d; }
body { -webkit-font-smoothing: antialiased; }
.bd-page-width { max-width: 1440px; }
.bd-header { box-shadow: 0 2px 5px #1823320b; border-bottom: 1px solid var(--am-line); }
.am-brand { display: inline-block; color: var(--pst-color-text-base) !important; text-decoration: none !important; font-size: 2rem; font-weight: 800; letter-spacing: -.075em; line-height: 1.1; padding: .2rem 0; }
.am-navbar { display: flex; align-items: center; gap: 1.25rem; }
.am-navbar a { font-size: 1rem; color: var(--pst-color-text-muted); text-decoration: none; padding: 1.25rem 0; white-space: nowrap; }
.am-navbar a:hover, .am-navbar a.active { color: var(--am-accent); }
.am-navbar a.active { box-shadow: 0 2px var(--am-accent); }
.bd-header .search-button-field { border-radius: 100px; font-size: .88rem; }
.bd-sidebar-primary { width: 248px; flex-basis: 248px; padding: 2rem 1.1rem 1rem; border-right: 1px solid var(--am-line); }
.am-nav-group { margin-bottom: 1.7rem; }
.am-nav-caption { font-size: .82rem; font-weight: 650; margin: 0 0 .5rem; padding: 0 .7rem; color: var(--pst-color-text-muted); }
.am-docs-nav ul { list-style: none; margin: 0; padding: 0; }
.am-docs-nav li a { display: block; font-size: .9rem; color: var(--pst-color-text-muted); padding: .45rem .7rem; margin: .2rem 0; text-decoration: none; border-left: 2px solid transparent; }
.am-docs-nav li a.active { border-left-color: var(--am-accent); color: var(--am-accent); background: var(--am-selected); font-weight: 600; }
.am-docs-nav li a:hover { color: var(--am-accent); }
.am-source-link { display: flex; align-items: center; gap: .7rem; border-top: 1px solid var(--am-line); padding: 1.1rem .6rem .2rem; font-size: .82rem; color: var(--pst-color-text-muted); text-decoration: none; }
.am-source-link > i { font-size: 1.2rem; }
.am-source-link small { display: block; margin-top: .3rem; font-size: .75rem; }
.bd-main .bd-content .bd-article-container { max-width: 960px; }
.bd-article h1 { font-size: 2.625rem; line-height: 1.15; font-weight: 650; letter-spacing: -.035em; margin: .4rem 0 1.4rem; }
.bd-article h2 { font-size: 2.05rem; line-height: 1.25; font-weight: 600; letter-spacing: -.025em; margin: 2.5rem 0 1.2rem; }
.bd-article h3 { font-size: 1.35rem; font-weight: 600; }
.bd-article p { line-height: 1.8; }
.bd-sidebar-secondary { width: 248px; flex-basis: 248px; }
.bd-sidebar-secondary .nav-link { line-height: 1.6; }
.am-project-links { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 1.5rem; }
.am-project-links a { display: inline-flex; align-items: center; min-height: 24px; text-decoration: none; border-radius: 3px; }
.am-project-links img { display: block; height: 24px; width: auto; max-width: 100%; }
html[data-theme="dark"] .am-project-links img { filter: none; }
.am-project-links a:hover { opacity: .85; }
.am-hero { margin: 0 0 2rem; }
.am-hero img { width: 100%; height: auto; display: block; }
html[data-theme="dark"] .am-hero img { filter: none; }
.am-hero figcaption { font-size: .78rem; text-align: left; color: var(--pst-color-text-muted); margin: .7rem 0 0; }
.am-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; margin: 1.4rem 0 2rem; }
.am-button { display: inline-flex; gap: .7rem; align-items: center; border: 1px solid var(--am-line); border-radius: 4px; padding: .6rem 1rem; text-decoration: none !important; font-weight: 550; font-size: .9rem; color: var(--pst-color-text-base) !important; }
.am-button.primary { background: #28657b; border-color: #28657b; color: #fff !important; }
.am-button:hover { border-color: var(--am-accent); }
.am-button.primary:hover { background: #1e5063; }
.am-text-link { font-size: .9rem; }
.am-specs { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; padding: 1rem 0; margin: 1.3rem 0 .5rem; }
.am-spec strong { display: block; font-size: 1.75rem; font-weight: 600; letter-spacing: -.045em; }
.am-spec strong small { font-size: .85rem; font-weight: 450; letter-spacing: 0; }
.am-spec span { font-size: .85rem; color: var(--pst-color-text-muted); }
.am-spec-note { font-size: .8rem; color: var(--pst-color-text-muted); }
.am-paths { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem 2.5rem; margin: 1.5rem 0; }
.am-path { display: block; padding: 1rem 0; border-top: 1px solid var(--am-line); text-decoration: none !important; }
.am-path strong { display: flex; justify-content: space-between; gap: .5rem; font-size: 1.06rem; font-weight: 600; }
.am-path strong span { font-weight: 400; }
.am-path p { color: var(--pst-color-text-muted); font-size: .94rem; margin: .6rem 0 0; }
.am-path:hover strong { text-decoration: underline; }
.am-update { margin: 1.7rem 0; }
.am-update time { color: var(--pst-color-text-muted); font-size: .84rem; }
.am-update p { margin-top: .45rem; }
.am-resource-row { display: flex; flex-wrap: wrap; gap: 1.3rem; }
.am-footer-note { font-size: .8rem; color: var(--pst-color-text-muted); }
.bd-article table { font-size: .94rem; }
.bd-article pre { font-size: .875rem; }
.bd-article .admonition { box-shadow: none; }
.bd-footer { border-top: 1px solid var(--am-line); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--am-accent); outline-offset: 4px; }
@media (min-width:960px) { .bd-main .bd-content .bd-article-container { padding: 1.75rem 2rem 2rem; } }
@media (max-width:1199px) and (min-width:960px) { .am-navbar { gap: .8rem; } .am-brand { font-size: 1.75rem; } .bd-header .search-button__kbd-shortcut { display: none; } }
@media (max-width:959px) { .am-navbar { flex-wrap: wrap; gap: .75rem 1.2rem; } .am-navbar a { padding: .5rem 0; } .bd-header .search-button-field { padding: .3rem .5rem; border: none; background: none; } .bd-header .search-button__default-text, .bd-header .search-button__kbd-shortcut { display: none; } .am-brand { font-size: 1.55rem; } }
@media (max-width:600px) { .bd-main .bd-content .bd-article-container { padding: 1.1rem 1.2rem; } .bd-article h1 { font-size: 2.2rem; } .bd-article h2 { font-size: 1.7rem; } .am-project-links { gap: .45rem; } .am-paths { grid-template-columns: 1fr; gap: .7rem; } .am-specs { grid-template-columns: 1fr 1fr; gap: 1.1rem; } }
@media (prefers-reduced-motion:reduce) { html { scroll-behavior: auto !important; } *,*::before,*::after { animation: none !important; transition: none !important; } }

/* Tutorial pages: readable steps, responsive figures, and long filenames. */
.bd-article li { line-height: 1.8; }
.bd-article li + li { margin-top: .3rem; }
.bd-article figure { margin: 1.5rem 0 2rem; }
.bd-article figure img { max-width: 100%; height: auto; }
.bd-article figcaption { color: var(--pst-color-text-muted); font-size: .84rem; line-height: 1.6; }
.bd-article td code { overflow-wrap: anywhere; white-space: normal; }
.bd-article .reference.internal code { overflow-wrap: anywhere; }

/* Model entry points use the same documentation typography and theme tokens. */
.am-models { gap: 1rem; }
.am-models .am-path { border: 1px solid var(--am-line); border-radius: 6px; padding: 1.2rem; }
.am-models .am-path:hover { border-color: var(--am-accent); background: var(--am-selected); }
.am-model-label { display: block; color: var(--pst-color-text-muted); font-size: .8rem; margin-bottom: .7rem; }
.am-models strong { font-size: 1.3rem; }
.am-model-entry { display: block; margin-top: 1rem; font-size: .88rem; font-weight: 600; }

.bd-article iframe, .bd-article video { max-width: 100%; }
.bd-article img { max-width: 100%; height: auto; }

/* Source photos rotated by the Yuque reader, without changing bitmap files. */
.yq-rotated-image { position: relative; width: min(100%, 560px); margin: 1.5rem auto; overflow: hidden; border-radius: 8px; }
.yq-rotated-image img { position: absolute; top: 50%; left: 50%; max-width: none !important; height: auto; margin: 0; }

.am-video-embed { width: 100%; aspect-ratio: 16 / 9; margin: 1.25rem 0 .65rem; overflow: hidden; border-radius: 8px; background: #111; }
.am-video-embed iframe { display: block; width: 100%; height: 100%; border: 0; }
.am-local-video { display: block; width: 100%; height: auto; margin: 1.25rem 0; border-radius: 8px; background: #111; }

/* Language remains reachable beside search on desktop and mobile. */
.am-language-switcher { display: inline-flex; align-items: center; gap: .35rem; color: var(--pst-color-text-base); font-size: .85rem; text-decoration: none; white-space: nowrap; padding: .45rem .35rem; border-radius: 4px; }
.am-language-switcher:hover { background: var(--am-selected); color: var(--am-accent); }
.am-language-switcher i { font-size: 1.15rem; }
html[lang="en"] .am-navbar { gap: .85rem; }
html[lang="en"] .am-navbar a { font-size: .9rem; }
@media (min-width:960px) and (max-width:1199px) { html[lang="en"] .am-navbar { gap: .5rem; } .bd-header .search-button__default-text { display: none; } }

/* A short navigation surface with details available on demand. */
.am-nav-fold { margin-bottom: .65rem; border-top: 1px solid var(--am-line); }
.am-nav-fold > summary { cursor: pointer; padding: .8rem .7rem; color: var(--pst-color-text-muted); font-size: .87rem; font-weight: 600; }
.am-nav-fold[open] > summary { color: var(--am-accent); }
.am-nav-fold ul { margin-bottom: .8rem; }
.am-nav-fold summary:focus-visible, .am-reading-step > summary:focus-visible, .am-reading-extra > summary:focus-visible { outline: 2px solid var(--am-accent); outline-offset: 3px; }
.am-step-route { display: flex; flex-wrap: wrap; gap: .4rem .8rem; padding: .5rem 0 1rem; margin-bottom: 1rem; }
.am-step-route a { font-size: .85rem; text-decoration: none; padding: .3rem 0; }
.am-reading-step { border: 1px solid var(--am-line); border-radius: 6px; margin: 0 0 .9rem; scroll-margin-top: 5.5rem; }
.am-reading-step > summary { cursor: pointer; padding: 1.1rem 1.25rem; font-size: 1.06rem; font-weight: 600; color: var(--pst-color-text-base); }
.am-reading-step[open] > summary { background: var(--am-selected); border-bottom: 1px solid var(--am-line); color: var(--am-accent); }
.am-step-content { padding: .7rem 1.3rem 1.2rem; }
.am-step-content > :last-child { margin-bottom: 0; }
.am-reading-extra { border-left: 2px solid var(--am-line); margin: 1.2rem 0; }
.am-reading-extra > summary { cursor: pointer; padding: .5rem .9rem; color: var(--am-accent); font-size: .9rem; }
.am-reading-extra .am-step-content { padding: .5rem 1rem; }
.am-step-content h2, .am-step-content h3 { margin-top: 1.7rem; }
.am-step-content .am-next { display: inline-flex; align-items: center; padding: .55rem .9rem; margin-top: .8rem; border-radius: 4px; background: var(--am-accent); color: var(--pst-color-background); text-decoration: none; font-weight: 600; font-size: .9rem; }
.am-step-content .am-step-done { border-top: 1px solid var(--am-line); margin-top: 1.5rem; padding-top: 1rem; font-size: .9rem; }
.am-step-content img { max-height: 540px; object-fit: contain; }
@media (min-width:960px) { .bd-main .bd-content .bd-article-container { max-width: 900px; } }
@media (max-width:600px) { .am-step-content { padding: .5rem .8rem 1rem; } .am-reading-step > summary { padding: .9rem .8rem; } }
