:root {
  color-scheme: light;
  --ink: #172622;
  --muted: #52635d;
  --border: #dce6e0;
  --connector: #8daba0;
  --accent: #12624c;
  --accent-soft: #e9f5ee;
  --surface: #f5f8f6;
  --code-bg: #1b2825;
  --code-ink: #ecf5ef;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --header-height: 62px;
}

* { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--header-height) + 18px); }

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 15px/1.72 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

a { color: var(--accent); text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid #188666;
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  z-index: 3;
  top: 8px;
  left: 8px;
  padding: 8px 14px;
  background: #fff;
  transform: translateY(calc(-100% - 10px));
}

.skip-link:focus { transform: none; }

.topbar {
  position: sticky;
  z-index: 2;
  top: 0;
  height: var(--header-height);
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.topbar-inner,
.layout {
  width: min(100% - 64px, 1180px);
  margin-inline: auto;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.brand-caption {
  margin-left: 4px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.updates-link { font-size: 14px; white-space: nowrap; }

.layout {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  align-items: start;
  gap: 44px;
}

.sidebar {
  position: sticky;
  top: var(--header-height);
  max-height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 40px 16px 24px 0;
  border-right: 1px solid var(--border);
}

.outline-heading {
  display: block;
  margin: 0 0 10px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.outline ul { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }

.outline a {
  display: block;
  padding: 6px 10px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.outline a:hover { background: var(--surface); color: var(--ink); }

.outline a[aria-current="location"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
}

main {
  min-width: 0;
  max-width: 865px;
  padding: 40px 0 0;
  overflow-wrap: anywhere;
}

.article-header { margin-bottom: 34px; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
}

.breadcrumb span { color: #729385; }

h1, h2, h3, p { margin-top: 0; }

h1 { margin-bottom: 11px; font-size: 40px; line-height: 1.23; font-weight: 750; }

h2 { margin-bottom: 10px; font-size: 25px; line-height: 1.4; }

h3 { margin: 21px 0 7px; font-size: 17px; line-height: 1.5; }

p { margin-bottom: 10px; }

.intro { font-size: 17px; color: #324c43; }

.prerequisite { margin-bottom: 0; color: var(--muted); font-size: 14px; }

.doc-section {
  padding: 28px 0 30px;
  border-top: 1px solid var(--border);
}

code {
  font: 0.92em/1.5 var(--mono);
  color: #175f4b;
}

p > code, td > code { padding: 1px 3px; border-radius: 3px; background: var(--surface); }

.flow { position: relative; margin: 18px 0 0; }

.flow-step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 10px 13px;
  border: 1px solid #bbd9c9;
  border-radius: 6px;
  background: #f2f9f5;
}

.flow-step strong, .flow-step code { display: block; }

.step-number {
  flex: 0 0 32px;
  width: 32px;
  padding: 4px 0;
  border-radius: 4px;
  background: #d9ede3;
  color: #245b49;
  text-align: center;
  font: 650 13px/24px var(--mono);
}

.flow-start::after,
.flow-branch::before,
.flow-branch:not(.flow-blocked)::after {
  position: absolute;
  left: 50%;
  width: 1px;
  background: var(--connector);
  content: "";
}

.flow-start::after { top: 100%; height: 16px; }

.flow-branches {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 30px 0 14px;
  padding: 0;
  list-style: none;
}

.flow-branches::before {
  position: absolute;
  top: -15px;
  right: calc((100% - 24px) / 6);
  left: calc((100% - 24px) / 6);
  height: 1px;
  background: var(--connector);
  content: "";
}

.flow-branch {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.flow-branch::before { bottom: 100%; height: 15px; }

.flow-branch:not(.flow-blocked)::after { top: 100%; height: 15px; }

.flow-branch > code { font-size: 12px; font-weight: 650; }

.flow-branch > span { color: var(--muted); font-size: 13px; line-height: 1.55; }

.flow-branch small { margin-top: auto; padding-top: 3px; color: var(--accent); font-size: 12px; }

.flow-blocked { border-color: #e6d5be; background: #fffaf2; }

.flow-blocked > code, .flow-blocked small { color: #854818; }

.flow-finish { margin-left: calc((100% + 12px) / 3); }

figcaption { margin-top: 10px; color: var(--muted); font-size: 13px; }

.code-block {
  overflow: hidden;
  margin: 13px 0 20px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--code-bg);
}

.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 4px 9px 4px 14px;
  background: #ebf2ed;
  color: #364f45;
  font-size: 13px;
  font-weight: 550;
}

.copy-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 84px;
  min-height: 31px;
  padding: 4px 7px;
  border: 1px solid #c5d5cd;
  border-radius: 5px;
  background: #fff;
  color: #284c3d;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.copy-button[hidden] { display: none; }

.copy-button:hover { background: #e2f3e8; border-color: #a8cab9; }

.copy-button:active { background: #d3e9dd; }

pre {
  overflow-x: auto;
  margin: 0;
  padding: 15px 16px;
  color: var(--code-ink);
  font: 13px/1.65 var(--mono);
  white-space: pre;
  overflow-wrap: normal;
  tab-size: 4;
}

pre:focus-visible { outline-offset: -3px; }

pre code { color: inherit; font: inherit; }

.table-wrap {
  overflow-x: auto;
  margin: 19px 0 0;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }

caption { padding: 0 0 6px; text-align: left; font-weight: 650; }

th, td { padding: 9px 11px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }

thead th { background: var(--surface); color: #344d43; font-weight: 650; }

tbody th { font-weight: 550; }

tbody th code { font-weight: 550; }

.note {
  margin: 15px 0 0;
  border-left: 3px solid #ade1c4;
  padding-left: 12px;
  color: var(--muted);
  font-size: 14px;
}

.updates { margin: 12px 0 0; padding: 0; list-style: none; }

.updates li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; }

.updates time { color: var(--muted); font: 13px/1.9 var(--mono); }

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 19px 0 28px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  margin: -1px;
  padding: 0;
  border: 0;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .topbar-inner, .layout { width: calc(100% - 44px); }
  .layout { grid-template-columns: 142px minmax(0, 1fr); gap: 24px; }
}

@media (max-width: 720px) {
  :root { --header-height: 56px; }
  .topbar-inner, .layout { width: calc(100% - 36px); }
  .layout { display: block; }
  .sidebar { position: static; max-height: none; padding: 12px 0; border-right: 0; border-bottom: 1px solid var(--border); }
  .outline-heading { display: none; }
  .outline ul { display: flex; flex-wrap: wrap; gap: 2px 5px; }
  .outline a { padding: 3px 6px; font-size: 13px; }
  main { padding-top: 24px; }
  .article-header { margin-bottom: 23px; }
  h1 { font-size: 34px; }
  h2 { font-size: 22px; }
  .intro { font-size: 16px; }
  .doc-section { padding: 20px 0 24px; }
  .flow-branches { gap: 8px; }
  .flow-branches::before { inset-inline: calc((100% - 16px) / 6); }
  .flow-finish { margin-left: calc((100% + 8px) / 3); }
}

@media (max-width: 520px) {
  .brand { gap: 7px; font-size: 16px; }
  .brand img { width: 26px; height: 26px; }
  .brand-caption { padding-left: 8px; margin-left: 1px; font-size: 12px; }
  .updates-link { font-size: 12px; }
  h1 { font-size: 30px; }
  .flow-branches { grid-template-columns: minmax(0, 1fr); margin: 10px 0; }
  .flow-start::after, .flow-branches::before, .flow-branch::before,
  .flow-branch:not(.flow-blocked)::after { display: none; }
  .flow-branch small { padding: 0; }
  .flow-finish { margin-left: 0; }
  th, td { padding: 7px 6px; }
  table { font-size: 13px; }
  .updates li { grid-template-columns: minmax(0, 1fr); row-gap: 1px; }
}
