:root {
  color-scheme: light;
  --ink: #34495e;
  --heading: #24394f;
  --muted: #526b80;
  --accent: #65b5f0;
  --link: #226797;
  --border: #e0e7ed;
  --rule: #eaecef;
  --code-bg: #22374e;
  --mono: Consolas, "Source Code Pro", Monaco, "Microsoft YaHei", monospace;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
  color: var(--ink);
  background: #fff;
}

* { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; display: flex; flex-direction: column; }
main { flex: 1; }
h1, h2, h3 { margin: 0; line-height: 1.35; color: var(--heading); }
p, figure, pre { margin: 0; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .22em; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }
[hidden] { display: none !important; }
code, pre { font-family: var(--mono); }
:not(pre) > code {
  padding: .09em .3em;
  border-radius: .24em;
  background: #eef4f8;
  color: #2a506e;
  font-size: .91em;
}
.wrap { width: min(1140px, calc(100% - 80px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 10; top: 8px; left: 12px; transform: translateY(-160%); }
.skip-link:focus { transform: none; background: #fff; padding: 8px 18px; }

body > header { background: #fff; border-bottom: 1px solid var(--rule); }
.topbar { min-height: 70px; display: flex; align-items: center; gap: clamp(24px, 4vw, 58px); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--heading); white-space: nowrap; font-weight: 720; font-size: 1.12rem; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; object-fit: contain; }
.nav, .site-links { display: flex; align-items: center; gap: 24px; font-size: .93rem; }
.nav { align-self: stretch; align-items: stretch; }
.nav a { position: relative; display: inline-flex; align-items: center; color: var(--ink); white-space: nowrap; }
.nav a:hover, .site-links a:hover { color: var(--link); }
.nav a[aria-current="page"] { color: var(--link); font-weight: 650; }
.nav a[aria-current="page"]::after { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: var(--accent); content: ""; }
.site-links { margin-inline-start: auto; gap: 18px; }
.site-links a { color: var(--muted); white-space: nowrap; }

.home { padding-block: 48px 76px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .88fr); gap: clamp(32px, 6vw, 88px); align-items: center; padding: clamp(28px, 4.1vw, 62px); background: #f3f8fc; border: 1px solid #dce8f1; border-radius: 14px; }
.hero-copy, .sample { min-width: 0; }
.hero-copy h1 { font-size: clamp(2.2rem, 4vw, 3.6rem); line-height: 1.18; letter-spacing: -.045em; text-wrap: balance; }
.hero-copy p { margin-block: 14px 24px; color: var(--muted); max-width: 45ch; }
.search-field { display: flex; align-items: stretch; position: relative; width: 100%; max-width: 32rem; padding: 4px; background: #fff; border: 1px solid #bacbd8; border-radius: 8px; }
.search-field:focus-within { border-color: var(--link); box-shadow: 0 0 0 2px #65b5f044; }
.search-field::before, .search-field::after { position: absolute; content: ""; pointer-events: none; }
.search-field::before { width: 12px; height: 12px; border: 1.7px solid var(--muted); border-radius: 50%; left: 15px; top: calc(50% - 8px); }
.search-field::after { left: 26px; top: calc(50% + 4px); width: 6px; height: 1.7px; background: var(--muted); transform: rotate(45deg); transform-origin: left; }
.search-field input { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; border-radius: 4px; padding: 7px 8px 7px 36px; color: var(--heading); }
.search-field input::placeholder { color: #657a8b; }
.search-field button { flex: none; padding: 6px 17px; border: 0; border-radius: 5px; background: #305f83; color: #fff; font-weight: 600; }
.search-field button:hover { background: #234b6b; }
.sample, .code-example { overflow: hidden; border-radius: 9px; background: var(--code-bg); color: #edf6ff; }
.sample figcaption, .code-example figcaption { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3em .8em; padding: 12px 20px; font-family: var(--mono); font-size: .83rem; line-height: 1.5; color: #c4d9e9; border-bottom: 1px solid #ffffff24; }
.sample pre, .code-example pre { max-width: 100%; overflow-x: auto; padding: 20px; font-size: .9rem; line-height: 1.8; tab-size: 4; }
.sample pre code, .code-example pre code { color: inherit; font: inherit; }
.tok-keyword { color: #94ceff; }
.tok-number { color: #ffd29b; }
.tok-string { color: #afe2c2; }
.tok-comment { color: #acc2d4; }
.sample a { color: #b5e2ff; }
.sample > a { display: inline-block; margin: 0 20px 17px; font-size: .85rem; }

.section-title { margin-block: 43px 17px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 18px; }
.section-title h2 { font-size: clamp(1.45rem, 2.5vw, 1.85rem); letter-spacing: -.025em; }
.section-title > a { font-size: .93rem; }
.shelf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.shelf { min-width: 0; border: 1px solid var(--border); border-radius: 10px; padding: clamp(20px, 2.4vw, 31px); background: #fff; }
.shelf-head { display: flex; align-items: center; gap: 13px; }
.monogram { display: inline-grid; flex: none; place-items: center; min-width: 48px; height: 46px; padding-inline: 5px; border: 1px solid #cbdeec; border-radius: 8px; background: #eaf4fc; color: #2b6390; font: bold 1.09rem/1 var(--mono); }
.shelf-head h3 { font-size: 1.24rem; }
.shelf-head h3 a, .entry-row h3 a { color: var(--heading); }
.shelf-head h3 a:hover, .entry-row h3 a:hover { color: var(--link); }
.count { margin-inline-start: auto; color: var(--muted); font-size: .85rem; white-space: nowrap; }
.shelf > p { color: var(--muted); margin-block: 15px 17px; font-size: .96rem; }
.entry-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 16px; list-style: none; padding: 15px 0 0; border-top: 1px solid var(--rule); margin: 0; }
.entry-links a { font-size: .95rem; overflow-wrap: anywhere; }

.crumbs { display: flex; align-items: baseline; flex-wrap: wrap; gap: .45rem; margin-block: 31px 22px; font-size: .88rem; color: var(--muted); }
.reader { display: grid; grid-template-columns: minmax(0, 1fr) minmax(170px, 215px); align-items: start; gap: clamp(35px, 5vw, 78px); margin-block-end: 65px; }
.article, .contents { min-width: 0; }
.entry-title { margin-block: 0 14px; font-size: clamp(2.1rem, 3.6vw, 3rem); line-height: 1.22; overflow-wrap: anywhere; letter-spacing: -.04em; }
.lead { color: var(--muted); max-width: 67ch; font-size: 1.08rem; line-height: 1.85; }
.article-section, .related { margin-top: 33px; }
.article-section, .related { scroll-margin-top: 1.5rem; }
.article-section h2, .related h2 { margin-bottom: 13px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); font-size: 1.43rem; }
.article-section > p { line-height: 1.9; }
.article-section > p + p { margin-top: .8em; }
.article-section ul, .related ul { margin: .6em 0; padding-inline-start: 1.3em; }
.code-example { margin-block: 20px; }
.contents { position: sticky; top: 24px; border-inline-start: 2px solid #d5e5f1; padding: 3px 0 4px 20px; font-size: .93rem; }
.contents :is(h2, h3, strong) { display: block; margin: 0 0 10px; font-size: .98rem; color: var(--heading); }
.contents :is(ul, ol) { margin: 0; padding: 0; list-style: none; }
.contents a { display: block; width: fit-content; padding-block: 3px; }
.index-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 13px 24px; margin-block: 25px 18px; }
.index-tools .search-field { flex: 1 1 18rem; max-width: 32rem; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.filters a { border-radius: 5px; padding: 5px 11px; color: var(--muted); font-size: .9rem; }
.filters a[aria-current="page"] { color: #205c86; background: #e4f1fa; font-weight: 650; }
.search-status { color: var(--muted); font-size: .91rem; margin-block: 12px; }
.entries { margin-block: 16px 45px; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.entry-row { padding-block: 17px; border-bottom: 1px solid var(--rule); }
.entry-row h3 { font-size: 1.13rem; }
.entry-row p { color: var(--muted); margin-top: 4px; line-height: 1.7; }
.listing .entry-row p { max-width: 75ch; }

body > footer { margin-top: auto; border-top: 1px solid var(--rule); background: #f8fafb; }
.foot-inner { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 22px; padding-block: 22px; color: var(--muted); font-size: .86rem; }

@media (max-width: 880px) {
  .wrap { width: calc(100% - 48px); }
  .hero { gap: 24px; padding: 29px; }
  .topbar { gap: 22px; }
  .nav, .site-links { gap: 14px; }
  .reader { grid-template-columns: minmax(0, 1fr) 170px; gap: 25px; }
}
@media (max-width: 700px) {
  .wrap { width: calc(100% - 32px); }
  .topbar { flex-wrap: wrap; gap: 0 10px; padding-top: 11px; }
  .brand { font-size: 1.02rem; }
  .brand img { width: 30px; height: 30px; }
  .nav { order: 3; width: 100%; gap: 18px; flex-wrap: wrap; }
  .nav a { padding-block: 9px; }
  .site-links { font-size: .85rem; }
  .home { padding-block: 23px 40px; }
  .hero, .shelf-grid, .reader { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 22px; gap: 23px; }
  .hero-copy h1 { letter-spacing: -.035em; }
  .hero-copy p { margin-block: 10px 17px; }
  .section-title { margin-block: 28px 13px; }
  .shelf-grid { gap: 13px; }
  .crumbs { margin-block: 21px 15px; }
  .reader { margin-bottom: 38px; }
  .contents { position: static; }
  .entry-title { font-size: 2rem; }
}
@media (max-width: 380px) {
  .hero { padding: 16px; }
  .entry-links { column-gap: 10px; }
  .nav { gap: 12px; }
  .sample pre, .code-example pre { padding: 14px; }
}

.hero:not(:has(.sample)) { grid-template-columns: 1fr; }
.article-tags { display: flex; flex-wrap: wrap; gap: .5em; margin-top: .5em; }
.markdown-body { overflow-wrap: break-word; }
.markdown-body > * + * { margin-top: 1em; }
.markdown-body :is(h1, h2, h3, h4, h5, h6) { margin-top: 1.5em; scroll-margin-top: 1.5rem; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body img { max-width: 100%; height: auto; }
.markdown-body blockquote { margin-inline: 0; padding-inline-start: 1em; border-inline-start: 3px solid var(--accent); color: var(--muted); }
.markdown-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.markdown-body th, .markdown-body td { padding: .4em .75em; border: 1px solid var(--border); }
.markdown-body th { background: #f3f8fc; }
.markdown-body pre { overflow-wrap: normal; }

/* Wiki directories and reading tools */
.shelf-more { display: inline-block; margin-top: 15px; font-size: .93rem; }
.browse-tools { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 25px; }
.category-list, .tool-list { display: grid; gap: 12px; padding: 0; list-style: none; }
.category-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 185px), 1fr)); margin: 16px 0 24px; }
.category-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 7px; }
.category-list li a { overflow-wrap: anywhere; }
.category-list li span, .rank-count, .directory-section small, .related small { color: var(--muted); font-weight: 400; font-size: .87rem; white-space: nowrap; }
.directory { padding-bottom: 48px; }
.directory-section { margin-top: 30px; }
.directory-section h2 { margin: 0 0 12px; font-size: 1.35rem; }
.directory-section h2 small, .related h2 small { margin-left: .45rem; }
.tool-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); margin: 25px 0; }
.tool-list li { padding: 18px; border: 1px solid var(--border); border-radius: 9px; }
.tool-list a { font-weight: 650; }
.tool-list p { margin-top: 5px; color: var(--muted); }
.alias-list, .stat-list { margin: 16px 0; }
.alias-list > div { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.3fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
.alias-list dd, .stat-list dd { margin: 0; }
.stat-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(118px,1fr)); gap: 12px; }
.stat-list div { padding: 12px 18px; border-left: 3px solid var(--accent); background: #f3f8fc; }
.stat-list dt { color: var(--muted); }
.stat-list dd { color: var(--heading); font-size: 1.6rem; font-weight: 670; }
.ranking { padding-left: 1.6em; max-width: 45rem; }
.ranking li { padding: 4px 0; }
.rank-count { margin-left: .65em; }
.alias-line { color: var(--muted); font-size: .94rem; margin-top: .75em; overflow-wrap: anywhere; }
.article-tags { align-items: center; color: var(--muted); }
.article-tags a { background: #edf5fb; border-radius: 4px; padding: 1px 8px; font-size: .9rem; }
.backlinks-list { columns: 2 16em; column-gap: 2em; }
.backlinks-list li { break-inside: avoid; }
.markdown-body a.heading-anchor { margin-inline-start: .5em; color: var(--link); font-size: .75em; opacity: 0; }
.markdown-body :is(h1,h2,h3,h4,h5,h6):hover .heading-anchor, .markdown-body a.heading-anchor:focus-visible { opacity: 1; }
.footnotes { margin-top: 24px; font-size: .94rem; color: var(--muted); overflow-wrap: anywhere; }
.footnotes-list { padding-left: 1.5em; }
.cite-box, .mobile-toc { padding: 11px 15px; border: 1px solid var(--border); border-radius: 6px; background: #f8fafb; }
.cite-box { margin-top: 24px; }
.cite-box summary, .mobile-toc summary { cursor: pointer; color: var(--link); font-weight: 600; }
.cite-box label { display: block; margin: 12px 0 5px; color: var(--muted); }
.cite-box div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cite-box input { width: min(100%, 25em); padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; font-family: var(--mono); }
.cite-box button { padding: 6px 12px; border: 1px solid var(--border); border-radius: 4px; background: white; color: var(--link); }
.cite-box [role=status] { display: block; font-size: .9rem; }
.mobile-toc { display: none; }
.contents { max-height: calc(100vh - 50px); overflow: auto; }
@media (min-width: 1024px) {
  .shelf-grid:has(> :nth-child(3)) { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .mobile-toc { display: block; margin-top: 17px; }
  .mobile-toc ol { padding-inline-start: 1.5em; margin-bottom: 0; }
  .contents { display: none; }
  .markdown-body a.heading-anchor { opacity: .7; }
}
