:root {
  --text: #1f1f1f;
  --muted: #565656;
  --soft: #777;
  --line: #ececec;
  --active: #e5e5e5;
  --code-bg: #fff;
  --code-line: #e2e2e2;
  --surface: #fff;
  --panel: #fff;
  --inline-code-bg: #f5f5f6;
  --link: #111827;
  --keyword: #b45309;
  --string: #1f497d;
  --admonition-note-bg: #fafafa;
  --admonition-note-border: #e5e7eb;
  --admonition-note-accent: #8b5cf6;
  --admonition-note-text: #334155;
  --admonition-note-title: #111827;
  --admonition-tip-accent: #22c55e;
  --admonition-info-accent: #3b82f6;
  --admonition-caution-accent: #f59e0b;
  --admonition-danger-accent: #ef4444;
  --admonition-tip-bg: #f0fbf3;
  --admonition-tip-border: #bbf7d0;
  --admonition-tip-text: #2f6f3e;
  --admonition-warning-bg: #fffbea;
  --admonition-warning-border: #fde68a;
  --admonition-warning-text: #875621;
  --shadow: 8px 8px 16px rgba(0, 0, 0, 0.18);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--surface);
  color: var(--text);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--surface);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

header[data-header] {
  display: block;
  min-height: 152px;
}

.topbar {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 8px 52px 0 50px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #000;
}

.brand-word {
  font-size: 36px;
  line-height: 1;
  font-weight: 750;
  letter-spacing: -1px;
}

.search-wrap {
  position: relative;
  width: min(560px, 47vw);
}

.search-field {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #dedede;
  border-radius: 17px;
  padding: 0 16px 0 20px;
  background: #fff;
  color: #777;
}

.search-field svg {
  width: 21px;
  height: 21px;
  color: #50565c;
  flex: 0 0 auto;
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #222;
  font: inherit;
  font-size: 14px;
  line-height: 24px;
}

.search-field input::placeholder {
  color: #858585;
}

.search-field input::-webkit-search-cancel-button {
  display: none;
}

.search-key {
  color: #777;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.primary-nav {
  height: 70px;
  display: flex;
  align-items: end;
  gap: 38px;
  padding: 0 72px 0 50px;
  border-bottom: 1px solid var(--line);
}

.primary-nav a {
  height: 54px;
  display: inline-flex;
  align-items: center;
  color: #555;
  font-size: 14px;
  line-height: 20px;
  border-bottom: 3px solid transparent;
}

.primary-nav a.active {
  color: #222;
  font-weight: 500;
  border-color: #1b1b1b;
}

.layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 900px) 260px;
  column-gap: 44px;
  min-height: calc(100vh - 152px);
}

.sidebar {
  height: calc(100vh - 152px);
  position: sticky;
  top: 0;
  overflow-y: auto;
  padding: 34px 46px 56px 26px;
}

.sidebar-group {
  margin-bottom: 42px;
}

.sidebar-heading {
  margin: 0 0 18px 24px;
  color: #222;
  font-size: 14px;
  line-height: 24px;
  font-weight: 600;
}

.sidebar-link {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 1px 0;
  padding: 6px 16px 6px 24px;
  border-radius: 12px;
  color: #505050;
  font-size: 14px;
  line-height: 24px;
}

.sidebar-link.active {
  color: #111;
  background: #ececec;
  font-weight: 400;
}

.sidebar-link .chevron {
  color: #999;
  font-size: 18px;
  line-height: 1;
}

.article-wrap {
  min-width: 0;
  padding: 36px 0 36px;
}

.article {
  max-width: 900px;
}

.page-toc {
  position: sticky;
  top: 0;
  height: calc(100vh - 152px);
  overflow-y: auto;
  padding: 76px 36px 56px 0;
}

.toc-inner {
  color: #7a7a7a;
}

.toc-inner h2 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: #272727;
  font-size: 14px;
  line-height: 22px;
  font-weight: 650;
}

.toc-inner h2 svg {
  width: 15px;
  height: 15px;
  color: #555;
}

.toc-inner nav {
  display: grid;
  gap: 11px;
}

.toc-link {
  display: block;
  color: #7a7a7a;
  font-size: 14px;
  line-height: 22px;
}

.toc-link:hover {
  color: #202020;
}

.toc-link.nested {
  padding-left: 16px;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 760;
  color: #111;
}

h1,
h2,
h3 {
  margin: 0;
  color: #111827;
  line-height: 1.15;
  letter-spacing: 0;
}

h1 {
  margin-bottom: 36px;
  font-size: 30px;
  font-weight: 700;
  line-height: 36px;
}

h2 {
  margin: 56px 0 18px;
  font-size: 24px;
  font-weight: 600;
  line-height: 32px;
}

h3 {
  margin: 36px 0 14px;
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
}

.article p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 16px;
  line-height: 28px;
}

.article .eyebrow {
  margin: 0 0 12px;
  color: #111;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

.sidebar .sidebar-heading {
  font-size: 14px;
  line-height: 24px;
  font-weight: 600;
}

.article strong {
  color: #252525;
  font-weight: 760;
}

.article em {
  font-style: italic;
}

.article a.inline-link {
  color: #333;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.article code:not(pre code) {
  padding: 2px 8px;
  border-radius: 6px;
  color: #242933;
  background: var(--inline-code-bg);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9em;
}

.doc-table {
  width: 100%;
  margin: 32px 0 58px;
  border-collapse: collapse;
  table-layout: auto;
}

.doc-table th {
  padding: 0 28px 12px 0;
  color: #111827;
  font-size: 14px;
  line-height: 20px;
  text-align: left;
  font-weight: 700;
  border-bottom: 1px solid #dcdcdc;
}

.doc-table td {
  padding: 14px 28px 14px 0;
  vertical-align: top;
  color: var(--muted);
  font-size: 14px;
  line-height: 21px;
  border-bottom: 1px solid #e7e7e7;
}

.doc-table td:first-child {
  color: #242933;
  font-weight: 700;
}

.code-caption {
  margin-top: 38px;
  color: #232323;
  font-size: 16px;
  line-height: 28px;
  font-weight: 600;
}

.code-card {
  position: relative;
  margin: 24px 0 56px;
  border: 1px solid var(--code-line);
  border-radius: 12px;
  background: var(--code-bg);
  box-shadow: 0 2px 0 rgba(17, 24, 39, 0.04);
  overflow: hidden;
}

.copy-button {
  position: absolute;
  top: 20px;
  right: 20px;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #9a9a9a;
  cursor: pointer;
}

.copy-button svg {
  width: 18px;
  height: 18px;
}

pre {
  margin: 0;
  padding: 24px 68px 28px 28px;
  overflow-x: auto;
  color: #1d4072;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 14px;
  line-height: 24px;
}

.tok-key {
  color: var(--keyword);
}

.tok-string {
  color: var(--string);
}

.admonition {
  margin: 24px 0;
  padding: 16px 18px;
  border: 1px solid var(--admonition-note-border);
  border-left: 4px solid var(--admonition-note-accent);
  border-radius: 12px;
  color: var(--admonition-note-text);
  background: var(--admonition-note-bg);
  font-size: 14px;
  line-height: 1.6;
}

.admonition-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  color: var(--admonition-note-title);
  font-size: 14px;
  line-height: 1.6;
}

.admonition-icon {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.admonition-icon::after {
  content: "";
  display: block;
  width: 4px;
  height: 7px;
  margin: 3px auto 0;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.admonition-body {
  padding-left: 0;
}

.admonition-body p,
.admonition-body ul,
.admonition-body ol {
  margin: 0 0 12px;
  color: currentColor;
  font-size: 14px;
  line-height: 1.6;
}

.admonition-body a {
  text-decoration: underline;
}

.admonition-body > :last-child {
  margin-bottom: 0;
}

.admonition-warning,
.admonition-caution {
  border-color: var(--admonition-warning-border);
  border-left-color: var(--admonition-caution-accent);
  color: var(--admonition-warning-text);
  background: var(--admonition-warning-bg);
}

.admonition-warning .admonition-icon,
.admonition-caution .admonition-icon {
  border-radius: 4px;
  transform: rotate(45deg);
}

.admonition-warning .admonition-icon::after,
.admonition-caution .admonition-icon::after {
  width: 2px;
  height: 8px;
  margin: 2px auto 0;
  border-right: 2px solid currentColor;
  border-bottom: 0;
  transform: rotate(-45deg);
}

.admonition-tip {
  border-color: var(--admonition-tip-border);
  border-left-color: var(--admonition-tip-accent);
  color: var(--admonition-tip-text);
  background: var(--admonition-tip-bg);
}

.admonition-info {
  border-left-color: var(--admonition-info-accent);
}

.admonition-danger {
  border-left-color: var(--admonition-danger-accent);
}

.admonition-tip .admonition-title,
.admonition-info .admonition-title,
.admonition-warning .admonition-title,
.admonition-caution .admonition-title,
.admonition-danger .admonition-title {
  color: currentColor;
}

.admonition-note .admonition-icon {
  display: none;
}

.article-footer {
  margin-top: 96px;
  border-top: 1px solid #e7e7e7;
  border-bottom: 1px solid #e7e7e7;
  min-height: 210px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  padding-top: 44px;
}

.article-footer > div {
  display: grid;
}

.article-footer > div:first-child {
  justify-items: start;
}

.article-footer > div:last-child {
  justify-items: end;
}

.page-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #454545;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

.page-link.next {
  justify-self: end;
}

.page-link .arrow {
  color: #9e9e9e;
  font-size: 26px;
  line-height: 1;
}

.site-footer {
  margin-top: 72px;
  color: #868686;
  text-align: center;
  font-size: 16px;
  line-height: 24px;
}

.site-footer a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.search-panel {
  position: absolute;
  top: 62px;
  right: 0;
  z-index: 20;
  width: min(840px, calc(100vw - 96px));
  max-height: min(620px, calc(100vh - 112px));
  overflow-y: auto;
  padding: 16px 24px;
  border: 1px solid #eee;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.search-panel[hidden] {
  display: none;
}

.search-empty {
  padding: 12px 0;
  color: #777;
  font-size: 14px;
}

.result {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: 16px;
  padding: 12px 0 28px;
  color: #1f1f1f;
  border-bottom: 2px solid #eeeeee;
}

.result:last-child {
  border-bottom: 0;
}

.result-icon {
  margin-top: 29px;
  color: #737373;
}

.result-icon svg {
  width: 20px;
  height: 20px;
}

.result > span:last-child,
.result-path {
  display: block;
  min-width: 0;
}

.result-path {
  margin-bottom: 3px;
  color: #747474;
  font-size: 14px;
  line-height: 20px;
}

.result-title {
  display: block;
  overflow: hidden;
  color: #202020;
  font-size: 16px;
  line-height: 24px;
  font-weight: 760;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.result-excerpt {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: #707070;
  font-size: 14px;
  line-height: 20px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

mark {
  background: transparent;
  color: inherit;
  font-weight: 760;
}

@media (max-width: 1180px) {
  body {
    font-size: 16px;
  }

  header[data-header] {
    min-height: 146px;
  }

  .topbar {
    height: auto;
    padding: 8px 22px 0;
    flex-wrap: wrap;
  }

  .brand-word {
    font-size: 36px;
  }

  .search-wrap {
    width: 100%;
  }

  .primary-nav {
    height: 64px;
    padding: 0 22px;
    overflow-x: auto;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    max-height: 220px;
    padding: 32px 22px;
    border-bottom: 1px solid var(--line);
  }

  .article-wrap {
    padding: 36px 56px 36px 42px;
  }

  .page-toc {
    display: none;
  }

  h1 {
    margin-bottom: 34px;
    font-size: 30px;
  }

  .article p,
  .code-caption {
    font-size: 16px;
  }

  .doc-table {
    display: block;
    overflow-x: auto;
  }

  .doc-table th,
  .doc-table td {
    min-width: 220px;
    font-size: 14px;
  }

  .search-panel {
    right: auto;
    left: 0;
    width: 100%;
    padding: 16px 24px;
  }
}

@media (max-width: 620px) {
  .brand-word {
    font-size: 36px;
  }

  .search-field {
    height: 54px;
    border-radius: 16px;
  }

  .primary-nav a,
  .sidebar-heading,
  .sidebar-link {
    font-size: 14px;
  }

  h1 {
    font-size: 24px;
    line-height: 32px;
  }

  h2 {
    font-size: 24px;
  }

  .article p {
    font-size: 16px;
  }

  .article-footer {
    min-height: 190px;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
  }

  .article-wrap {
    padding: 32px 22px;
  }

  .admonition {
    padding: 18px 18px 20px;
  }

  .admonition-body {
    padding-left: 0;
  }

}
