:root {
  color-scheme: light;
  --font-sans: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
  --font-mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --page: #f5f7f9;
  --surface: #ffffff;
  --surface-subtle: #f8fafb;
  --surface-strong: #eef2f4;
  --text: #17212b;
  --text-secondary: #4f5d6b;
  --text-muted: #667482;
  --border: #dce2e7;
  --border-strong: #c7d0d8;
  --sidebar: #22272d;
  --sidebar-hover: #30363d;
  --sidebar-border: #414850;
  --brand: #087f8c;
  --brand-strong: #05616b;
  --brand-soft: #edf9fa;
  --orange: #c2410c;
  --orange-soft: #fff4ed;
  --amber: #8a5a00;
  --amber-soft: #fff9e8;
  --green: #087443;
  --green-soft: #ecfdf3;
  --danger: #b42318;
  --danger-soft: #fff4f2;
  --focus: rgba(8, 127, 140, .24);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-menu: 0 18px 48px rgba(16, 24, 40, .22);
  --radius: 6px;
  --sidebar-width: 264px;
  --topbar-height: 68px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-height) + 18px);
  background: var(--page);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: var(--page);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body, body * {
  letter-spacing: 0;
}

body.menu-open {
  overflow: hidden;
}

button, input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

img {
  max-width: 100%;
}

::selection {
  color: #ffffff;
  background: var(--brand);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 12px;
  padding: 8px 12px;
  color: #ffffff;
  background: var(--sidebar);
  border-radius: 4px;
  text-decoration: none;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  z-index: 20;
  top: 0;
  align-self: start;
  width: var(--sidebar-width);
  height: 100vh;
  height: 100dvh;
  padding: 22px 16px 18px;
  overflow-y: auto;
  color: #d7dde3;
  background: var(--sidebar);
  border-right: 1px solid var(--sidebar-border);
  scrollbar-color: #555e67 transparent;
  scrollbar-width: thin;
}

.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  min-height: 52px;
  padding: 0 6px 17px;
  border-bottom: 1px solid var(--sidebar-border);
}

.brand-mark {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #59616a;
  border-radius: var(--radius);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.brand small {
  margin-top: 2px;
  color: #98a2ad;
  font-size: 11px;
  line-height: 1.4;
}

.side-intro {
  margin: 16px 7px 14px;
  color: #aeb7c0;
  font-size: 12px;
  line-height: 1.65;
}

.nav-title {
  margin: 20px 8px 6px;
  color: #8f99a4;
  font-size: 10px;
  font-weight: 700;
}

.nav a {
  display: flex;
  align-items: center;
  min-height: 36px;
  margin: 1px 0;
  padding: 7px 10px;
  color: #ced5dc;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  font-size: 12px;
  line-height: 1.55;
  text-decoration: none;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease;
}

.nav a:hover {
  color: #ffffff;
  background: var(--sidebar-hover);
}

.nav a.active,
.nav a[aria-current="location"] {
  color: #ffffff;
  background: #353c43;
  border-left-color: #2ac4cf;
}

.side-note {
  margin: 22px 6px 0;
  padding: 11px 12px;
  color: #bac2ca;
  border: 1px solid #454d55;
  border-radius: var(--radius);
  font-size: 11px;
  line-height: 1.6;
}

.content {
  min-width: 0;
  background: var(--surface);
}

.topbar {
  position: sticky;
  z-index: 15;
  top: 0;
  display: flex;
  gap: 18px;
  align-items: center;
  min-height: var(--topbar-height);
  padding: 11px clamp(24px, 3vw, 46px);
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(16, 24, 40, .02);
  backdrop-filter: blur(10px);
}

.menu-toggle {
  display: none;
  flex: 0 0 40px;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: #34404c;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 20px;
}

.topbar-context {
  flex: 0 0 auto;
  min-width: 190px;
}

.document-label,
.crumb {
  display: block;
}

.document-label {
  color: #283542;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.crumb {
  margin-top: 2px;
  color: #667482;
  font-size: 11px;
  line-height: 1.35;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  width: min(560px, 100%);
  margin-left: auto;
}

.search-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 14px;
  color: #667482;
  font-size: 16px;
  line-height: 1;
  pointer-events: none;
  transform: translateY(-50%);
}

.search input {
  width: 100%;
  height: 42px;
  padding: 8px 42px 8px 40px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  outline: 0;
  font-size: 13px;
}

.search input::placeholder {
  color: #667482;
}

.search input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus);
}

.search-clear {
  position: absolute;
  right: 7px;
  display: none;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  color: #667482;
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-size: 19px;
  line-height: 1;
}

.search-clear.visible {
  display: grid;
}

.search-clear:hover {
  color: #283542;
  background: var(--surface-strong);
}

.search-status {
  flex: 0 0 88px;
  color: #687684;
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
}

.main {
  width: min(1240px, 100%);
  padding: 30px clamp(34px, 4.4vw, 68px) 76px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, auto);
  gap: 48px;
  align-items: end;
  padding: 20px 0 34px;
  border-bottom: 1px solid var(--border-strong);
}

.eyebrow,
.kicker {
  color: var(--brand-strong);
  font-size: 10px;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 8px;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 0;
  color: #101820;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.3;
}

.hero p:not(.eyebrow) {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
  max-width: 360px;
}

.hero-meta-offset {
  margin-top: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  color: #42505e;
  background: #f0f3f5;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.35;
}

.hero + .callout {
  margin-top: 24px;
}

.section {
  scroll-margin-top: calc(var(--topbar-height) + 18px);
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid var(--border-strong);
}

.section-head {
  display: flex;
  gap: 36px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-head > div {
  flex: 1 1 auto;
  min-width: 230px;
}

.section-head h2 {
  margin: 3px 0 0;
  color: #14202b;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.35;
}

.section-head p {
  flex: 0 1 500px;
  max-width: 500px;
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  text-align: right;
}

.grid-2,
.grid-3 {
  display: grid;
  min-width: 0;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 42px;
}

.grid-3,
.grid-2.dense-grid {
  grid-template-columns: 1fr;
  gap: 0;
}

.section-grid,
.panel-offset,
.table-offset {
  margin-top: 14px;
}

.panel {
  min-width: 0;
  padding: 20px 0 22px;
  border-top: 1px solid var(--border);
}

.panel h3 {
  margin-bottom: 9px;
  color: #2d3b48;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
}

.panel p {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.panel > :first-child {
  margin-top: 0;
}

.muted {
  color: var(--text-muted);
  font-size: 12px;
}

.callout {
  margin-top: 18px;
  padding: 13px 15px;
  color: #31565b;
  background: #f2fafb;
  border: 1px solid #c7e8eb;
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 13px;
}

.callout.warn {
  color: #704900;
  background: var(--amber-soft);
  border-color: #efd994;
  border-left-color: #c88b12;
}

.callout.danger {
  color: #8f241c;
  background: var(--danger-soft);
  border-color: #f1c1bc;
  border-left-color: var(--danger);
}

.callout.ok {
  color: #075f39;
  background: var(--green-soft);
  border-color: #a9e6c4;
  border-left-color: var(--green);
}

.table-wrap {
  max-width: 100%;
  margin-top: 14px;
  overflow-x: auto;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  scrollbar-color: #aab4bd #eef2f4;
  scrollbar-width: thin;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  table-layout: auto;
}

table.table-medium {
  min-width: 560px;
}

table.table-wide {
  min-width: 640px;
}

th, td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.68;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

th {
  position: sticky;
  z-index: 1;
  top: 0;
  color: #465563;
  background: #f3f6f7;
  font-size: 11px;
  font-weight: 700;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:nth-child(even) td {
  background: #fbfcfc;
}

tbody tr:hover td {
  background: #f4f9f9;
}

td:first-child {
  width: 31%;
}

code {
  font-family: var(--font-mono);
}

:not(pre) > code:not(.command) {
  padding: 1px 4px;
  color: #075e68;
  background: #eef8f9;
  border: 1px solid #d4ecee;
  border-radius: 3px;
  font-size: .92em;
}

.command {
  display: inline-block;
  max-width: 100%;
  margin: 1px 0;
  padding: 2px 6px;
  color: #075e68;
  background: #eef8f9;
  border: 1px solid #cce7e9;
  border-radius: 3px;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: normal;
}

pre {
  position: relative;
  max-width: 100%;
  margin: 12px 0 0;
  padding: 16px 17px;
  overflow: auto;
  color: #e9eef2;
  background: #20262c;
  border: 1px solid #3a424a;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.72;
  tab-size: 2;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

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

.copy {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  min-width: 48px;
  height: 30px;
  padding: 0 9px;
  color: #dce3e8;
  background: #343c44;
  border: 1px solid #4b555e;
  border-radius: 4px;
  font-size: 11px;
}

.copy:hover {
  color: #ffffff;
  background: #424c55;
}

pre[data-copy] {
  padding-right: 72px;
}

.response,
pre.response {
  padding: 13px 15px;
  color: #34424f;
  background: #f7f9fa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
}

.response.mention,
pre.response.mention {
  border-left: 3px solid var(--orange);
}

.permission-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
}

.permission-badge.super {
  color: #8d350d;
  background: var(--orange-soft);
  border-color: #f0c5ad;
}

.permission-badge.member {
  color: #075e68;
  background: var(--brand-soft);
  border-color: #c9e8ea;
}

.step-list,
.rule-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-list {
  display: grid;
  gap: 15px;
}

.step-list li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 4px;
  align-items: start;
}

.step-list li > span:last-child > span {
  display: block;
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 13px;
}

.number {
  display: inline-grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: #ffffff;
  background: var(--brand);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.rule-list {
  display: grid;
  gap: 8px;
  color: var(--text-secondary);
}

.rule-list li {
  position: relative;
  padding-left: 16px;
}

.rule-list li::before {
  position: absolute;
  top: .76em;
  left: 1px;
  width: 5px;
  height: 5px;
  background: var(--brand);
  border-radius: 50%;
  content: "";
}

.flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.flow-item {
  min-width: 0;
  padding: 14px 15px;
  color: var(--text-secondary);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
}

.flow-item strong {
  display: block;
  margin-bottom: 3px;
  color: #2e3b47;
}

.example-grid {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  gap: 24px;
  min-width: 0;
}

.example-grid > * {
  min-width: 0;
}

.example-label {
  margin: 0 0 5px;
  color: #596775;
  font-size: 11px;
  font-weight: 700;
}

.example-offset {
  margin-top: 14px;
}

.faq {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border);
}

details {
  border-bottom: 1px solid var(--border);
}

summary {
  padding: 15px 2px;
  color: #2e3b47;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

details p {
  max-width: 900px;
  margin: 0;
  padding: 0 2px 17px 22px;
  color: var(--text-secondary);
  font-size: 13px;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
  margin-top: 66px;
  padding-top: 22px;
  color: #667482;
  border-top: 1px solid var(--border);
  font-size: 11px;
}

.footer span:last-child {
  flex-basis: 100%;
}

.no-results {
  margin-top: 36px;
  padding: 28px;
  color: var(--text-secondary);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  z-index: 80;
  right: 20px;
  bottom: 20px;
  padding: 9px 13px;
  color: #ffffff;
  background: #20262c;
  border: 1px solid #414951;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(16, 24, 40, .18);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.backdrop {
  display: none;
}

@media (max-width: 1120px) {
  :root {
    --sidebar-width: 232px;
  }

  .main {
    padding-right: 36px;
    padding-left: 36px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 19px;
  }

  .hero-meta {
    justify-content: flex-start;
    max-width: none;
  }

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

  .flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .app {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: 0;
    width: min(300px, 88vw);
    transform: translateX(-102%);
    transition: transform .2s ease;
    box-shadow: var(--shadow-menu);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .menu-toggle {
    display: inline-grid;
  }

  .backdrop {
    position: fixed;
    z-index: 18;
    inset: 0;
    background: rgba(18, 24, 30, .48);
  }

  .backdrop.open {
    display: block;
  }

  .topbar {
    padding-right: 20px;
    padding-left: 20px;
  }
}

@media (max-width: 700px) {
  :root {
    --topbar-height: 62px;
  }

  .topbar {
    gap: 10px;
    min-height: var(--topbar-height);
    padding: 10px 14px;
  }

  .topbar-context,
  .search-status {
    display: none;
  }

  .search {
    width: 100%;
    min-width: 0;
  }

  .search input {
    height: 40px;
  }

  .main {
    padding: 18px 16px 52px;
  }

  .hero {
    gap: 15px;
    padding: 16px 0 25px;
  }

  h1 {
    font-size: 29px;
  }

  .hero p:not(.eyebrow) {
    font-size: 13px;
  }

  .section {
    margin-top: 46px;
    padding-top: 24px;
  }

  .section-head {
    display: block;
    margin-bottom: 18px;
  }

  .section-head h2 {
    font-size: 22px;
  }

  .section-head p {
    margin-top: 7px;
    text-align: left;
  }

  .grid-2,
  .grid-3,
  .example-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 17px 0 19px;
  }

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

  pre {
    padding: 14px;
    font-size: 11px;
  }

  pre[data-copy] {
    padding-top: 48px;
    padding-right: 14px;
  }

  .callout {
    padding: 12px 13px;
  }

  .footer {
    display: grid;
    gap: 5px;
  }
}

@media (max-width: 760px) {
  .table-wrap.stacked-table {
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .stacked-table table,
  .stacked-table tbody,
  .stacked-table tr,
  .stacked-table td {
    display: block;
    width: 100%;
    min-width: 0 !important;
  }

  .stacked-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .stacked-table tbody {
    display: grid;
    gap: 10px;
  }

  .stacked-table tr {
    padding: 8px 0;
    background: #ffffff;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
  }

  .stacked-table tbody tr:nth-child(even) td,
  .stacked-table tbody tr:hover td {
    background: transparent;
  }

  .stacked-table td {
    display: grid;
    grid-template-columns: minmax(92px, 28%) minmax(0, 1fr);
    gap: 12px;
    padding: 9px 12px;
    background: transparent;
    border: 0;
  }

  .stacked-table td::before {
    color: #65727e;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.6;
    content: attr(data-label);
  }

  .stacked-table td[data-label=""] {
    grid-template-columns: 1fr;
  }

  .stacked-table td[data-label=""]::before {
    display: none;
  }

  .stacked-table td > * {
    min-width: 0;
  }

  .stacked-table td pre {
    margin-top: 8px;
  }
}

@media (max-width: 430px) {
  .stacked-table td {
    display: block;
  }

  .stacked-table td::before {
    display: block;
    margin-bottom: 3px;
  }

  .hero-meta {
    gap: 5px;
  }

  .tag {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  @page {
    margin: 14mm;
  }

  body,
  .content {
    color: #000000;
    background: #ffffff;
  }

  .app {
    display: block;
  }

  .sidebar,
  .topbar,
  .copy,
  .toast,
  .backdrop,
  .skip-link {
    display: none !important;
  }

  .main {
    width: 100%;
    padding: 0;
  }

  .hero {
    padding-top: 0;
  }

  .section {
    margin-top: 34px;
  }

  h1, h2, h3,
  tr,
  pre,
  .callout,
  .panel {
    break-inside: avoid;
  }

  .table-wrap,
  .table-wrap.stacked-table {
    overflow: visible;
    border: 1px solid #b8b8b8;
    box-shadow: none;
  }

  .stacked-table table {
    display: table;
    min-width: 0 !important;
  }

  .stacked-table thead {
    position: static;
    display: table-header-group;
    width: auto;
    height: auto;
    clip: auto;
    white-space: normal;
  }

  .stacked-table tbody {
    display: table-row-group;
  }

  .stacked-table tr {
    display: table-row;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .stacked-table td {
    display: table-cell;
    width: auto;
    padding: 8px;
    border-bottom: 1px solid #d0d0d0;
  }

  .stacked-table td::before {
    display: none;
  }

  pre {
    color: #000000;
    background: #f5f5f5;
    border-color: #c8c8c8;
  }

  details > *:not(summary) {
    display: block !important;
  }

  .footer {
    color: #444444;
  }
}
