/* docs-shell — 限宽三栏：左目录｜顶栏+正文｜右本页大纲 */
.wa-layout--site-docs {
  --wa-docs-shell: 1280px;
  --wa-docs-sider: 236px;
  --wa-docs-outline: 176px;
  --wa-docs-top-h: 56px;
  --wa-docs-float-inset: 16px;
  --wa-docs-stage-gap: 20px;
  --wa-docs-gap: 24px;
  min-height: 100vh;
  color: var(--wa-color-text);
  background: var(--wa-color-bg);
  font-family: var(--wa-font-sans);
}
.wa-layout--site-docs *,
.wa-layout--site-docs *::before,
.wa-layout--site-docs *::after { box-sizing: border-box; }

.wa-layout--site-docs .wa-layout__docs-shell {
  width: min(100%, var(--wa-docs-shell));
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: var(--wa-docs-float-inset) var(--wa-docs-float-inset) 0;
}
.wa-layout--site-docs .wa-layout__docs-stage {
  display: grid;
  grid-template-columns: var(--wa-docs-sider) minmax(0, 1fr);
  align-items: stretch;
  flex: 1;
  min-height: 0;
  margin-top: var(--wa-docs-stage-gap);
  margin-bottom: var(--wa-docs-float-inset);
  border-radius: 16px;
  overflow: visible;
  border: 1px solid var(--wa-color-border-1);
  background: var(--wa-color-bg);
}

/* —— 左栏：品牌 + 目录 —— */
.wa-layout--site-docs .wa-layout__docs-sider {
  min-height: calc(100vh - var(--wa-docs-float-inset) - var(--wa-docs-top-h) - var(--wa-docs-stage-gap) - 16px);
  display: flex;
  flex-direction: column;
  padding: 14px 12px 16px;
  border-right: 1px solid var(--wa-color-border-1);
  background: color-mix(in srgb, var(--wa-color-surface) 82%, var(--wa-color-bg));
  overflow: auto;
  border-radius: 16px 0 0 16px;
}
.wa-layout--site-docs .wa-layout__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  flex-shrink: 0;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
}
.wa-layout--site-docs .wa-layout__brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--wa-color-on-primary, #fff);
  background: var(--wa-color-primary);
  flex-shrink: 0;
}
.wa-layout--site-docs .wa-layout__docs-nav {
  flex: 1;
  min-height: 0;
}
.wa-layout--site-docs .wa-layout__docs-link {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
}
.wa-layout--site-docs .wa-layout__docs-link--root {
  font-weight: 500;
  color: var(--wa-color-text);
}
.wa-layout--site-docs .wa-layout__docs-link--child {
  position: relative;
  margin-left: -1px;
  padding: 7px 10px 7px 12px;
  border-radius: 0;
  border-left: 2px solid transparent;
  font-weight: 400;
  color: color-mix(in srgb, var(--wa-color-text) 38%, var(--wa-color-muted));
}
.wa-layout--site-docs .wa-layout__docs-link--root:hover {
  color: var(--wa-color-text);
  background: color-mix(in srgb, var(--wa-color-fill-2, var(--wa-color-border-1)) 55%, transparent);
}
.wa-layout--site-docs .wa-layout__docs-link--child:hover {
  color: var(--wa-color-text);
  background: transparent;
}
.wa-layout--site-docs .wa-layout__docs-link--root.is-active {
  color: var(--wa-color-primary);
  font-weight: 500;
  background: transparent;
}
.wa-layout--site-docs .wa-layout__docs-link--child.is-active {
  color: var(--wa-color-primary);
  font-weight: 500;
  background: transparent;
  border-left-color: var(--wa-color-primary);
}
.wa-layout--site-docs .wa-layout__docs-folder {
  margin: 0;
}
.wa-layout--site-docs .wa-layout__docs-folder-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--wa-color-text);
  padding: 8px 10px;
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  cursor: pointer;
}
.wa-layout--site-docs .wa-layout__docs-folder-btn:hover {
  background: color-mix(in srgb, var(--wa-color-fill-2, var(--wa-color-border-1)) 55%, transparent);
}
.wa-layout--site-docs .wa-layout__docs-folder-btn i {
  font-size: 11px;
  color: var(--wa-color-muted);
  transition: transform 0.15s ease;
}
.wa-layout--site-docs .wa-layout__docs-folder.is-open .wa-layout__docs-folder-btn i {
  transform: rotate(180deg);
}
.wa-layout--site-docs .wa-layout__docs-folder-list {
  margin: 0 0 2px 12px;
  padding: 2px 0 6px 0;
  border-left: 1px solid var(--wa-color-border-2, var(--wa-color-border-1));
}
/* —— 悬浮导航条 —— */
.wa-layout--site-docs .wa-layout__docs-topbar {
  position: sticky;
  top: var(--wa-docs-float-inset);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: var(--wa-docs-top-h);
  padding: 8px 12px 8px 14px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--wa-color-border-1) 55%, transparent);
  background: color-mix(in srgb, var(--wa-color-surface) 72%, transparent);
  box-shadow:
    0 10px 28px -18px color-mix(in srgb, var(--wa-color-text) 16%, transparent),
    0 1px 0 color-mix(in srgb, #fff 40%, transparent) inset;
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
}
html[data-theme='dark'] .wa-layout--site-docs .wa-layout__docs-topbar {
  background: color-mix(in srgb, var(--wa-color-surface) 82%, transparent);
  box-shadow:
    0 12px 32px -16px rgba(0, 0, 0, 0.45),
    0 1px 0 color-mix(in srgb, #fff 8%, transparent) inset;
}
.wa-layout--site-docs .wa-layout__docs-right {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--wa-color-surface);
  border-radius: 0 16px 16px 0;
}
.wa-layout--site-docs .wa-layout__docs-search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  min-width: 180px;
  width: 220px;
  max-width: 240px;
  flex: 0 0 220px;
  height: 34px;
  padding: 0 10px 0 12px;
  border-radius: 999px;
  border: 1px solid var(--wa-color-border-2);
  background: color-mix(in srgb, var(--wa-color-bg) 55%, var(--wa-color-surface));
  color: var(--wa-color-muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.wa-layout--site-docs .wa-layout__docs-search-trigger span {
  flex: 1;
  min-width: 0;
}
.wa-layout--site-docs .wa-layout__docs-search-trigger kbd {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--wa-color-border-2);
  background: var(--wa-color-surface);
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: var(--wa-color-muted);
}
.wa-layout--site-docs .wa-layout__docs-toplinks {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.wa-layout--site-docs .wa-layout__docs-toplink {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 8px;
  color: color-mix(in srgb, var(--wa-color-text) 78%, var(--wa-color-muted));
  text-decoration: none;
  font-size: 13.5px;
  white-space: nowrap;
}
.wa-layout--site-docs .wa-layout__docs-toplink i {
  font-size: 10px;
  opacity: 0.7;
}
.wa-layout--site-docs .wa-layout__docs-toplink:hover {
  color: var(--wa-color-text);
  background: color-mix(in srgb, var(--wa-color-fill-2, var(--wa-color-border-1)) 60%, transparent);
}
.wa-layout--site-docs .wa-layout__docs-toplink.is-active {
  color: var(--wa-color-primary);
  font-weight: 600;
}
.wa-layout--site-docs .wa-layout__docs-top-actions {
  margin-left: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.wa-layout--site-docs .wa-layout__icon-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--wa-color-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wa-layout--site-docs .wa-layout__icon-btn:hover {
  background: color-mix(in srgb, var(--wa-color-fill-2, var(--wa-color-border-1)) 70%, transparent);
}

.wa-layout--site-docs .wa-layout__docs-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--wa-docs-outline);
  grid-template-areas:
    "title ."
    "meta ."
    "main toc";
  column-gap: var(--wa-docs-gap);
  row-gap: 0;
  padding: 28px 20px 64px 28px;
  align-items: stretch;
}
.wa-layout--site-docs .wa-layout__page-title {
  grid-area: title;
  max-width: 880px;
  margin: 0 0 8px;
  font-size: clamp(1.65rem, 2.4vw, 2rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
  font-weight: 750;
}
.wa-layout--site-docs .wa-layout__docs-meta {
  grid-area: meta;
  max-width: 880px;
  margin: 0 0 16px;
  font-size: 12.5px;
  color: var(--wa-color-muted);
}
.wa-layout--site-docs .wa-layout__docs-main {
  grid-area: main;
  min-width: 0;
}
.wa-layout--site-docs .wa-layout__docs-outline {
  grid-area: toc;
  min-width: 0;
  /* 必须撑满与正文同排高度，sticky 才有滚动吸顶空间 */
  align-self: stretch;
}
.wa-layout--site-docs .wa-layout__docs-article {
  max-width: 880px;
}
.wa-layout--site-docs .wa-layout__page-lead {
  margin: 0 0 20px;
  color: color-mix(in srgb, var(--wa-color-text) 48%, var(--wa-color-muted));
  font-size: 14px;
  line-height: 1.75;
}
.wa-layout--site-docs .wa-layout__docs-callout {
  margin: 0 0 28px;
  padding: 12px 16px 12px 16px;
  border-radius: 0;
  background: var(--wa-color-bg);
  border: 0;
  border-left: 3px solid var(--wa-color-primary);
}
.wa-layout--site-docs .wa-layout__docs-callout-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 650;
  color: var(--wa-color-text);
  line-height: 1.4;
}
.wa-layout--site-docs .wa-layout__docs-callout-title i {
  color: var(--wa-color-primary);
  font-size: 15px;
}
.wa-layout--site-docs .wa-layout__docs-callout ul {
  margin: 0;
  padding: 0 0 0 1.15em;
  display: grid;
  gap: 6px;
}
.wa-layout--site-docs .wa-layout__docs-callout li {
  font-size: 14px;
  line-height: 1.65;
  color: color-mix(in srgb, var(--wa-color-text) 58%, var(--wa-color-muted));
}
.wa-layout--site-docs .wa-layout__docs-callout-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--wa-color-primary);
  font: inherit;
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
}
.wa-layout--site-docs .wa-layout__docs-callout-link:hover {
  text-decoration: underline;
}
.wa-layout--site-docs .wa-layout__docs-section {
  margin: 0 0 28px;
  scroll-margin-top: calc(var(--wa-docs-float-inset) + var(--wa-docs-top-h) + var(--wa-docs-stage-gap));
}
.wa-layout--site-docs .wa-layout__docs-section h2 {
  margin: 0 0 12px;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.wa-layout--site-docs .wa-layout__docs-section p {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  color: color-mix(in srgb, var(--wa-color-text) 52%, var(--wa-color-muted));
}
.wa-layout--site-docs .wa-layout__docs-section p + p {
  margin-top: 12px;
}
.wa-layout--site-docs .wa-layout__docs-article code {
  font-size: 12.5px;
  padding: 0 5px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--wa-color-primary) 8%, transparent);
  color: var(--wa-color-text);
}
.wa-layout--site-docs .wa-layout__docs-list {
  margin: 10px 0 0;
  padding: 0 0 0 1.05em;
  display: grid;
  gap: 6px;
  list-style-position: outside;
}
.wa-layout--site-docs .wa-layout__docs-section p + .wa-layout__docs-list,
.wa-layout--site-docs .wa-layout__docs-section .wa-layout__docs-list + p {
  margin-top: 10px;
}
.wa-layout--site-docs .wa-layout__docs-list li {
  padding: 0;
  font-size: 14px;
  line-height: 1.65;
  color: color-mix(in srgb, var(--wa-color-text) 52%, var(--wa-color-muted));
}
.wa-layout--site-docs .wa-layout__docs-list strong {
  color: var(--wa-color-text);
  font-weight: 650;
}
.wa-layout--site-docs .wa-layout__docs-article > .wa-layout__docs-section + .wa-layout__docs-section {
  padding-top: 4px;
}
.wa-layout--site-docs .wa-layout__docs-section h3 {
  margin: 16px 0 8px;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.wa-layout--site-docs .wa-layout__docs-article kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid var(--wa-color-border-2);
  background: color-mix(in srgb, var(--wa-color-bg) 70%, var(--wa-color-surface));
  font-size: 12px;
  line-height: 1.4;
}

.wa-layout--site-docs .wa-layout__docs-footer {
  flex-shrink: 0;
  padding: 18px 6px 28px;
}
.wa-layout--site-docs .wa-layout__docs-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  color: var(--wa-color-muted);
  font-size: 12.5px;
}
.wa-layout--site-docs .wa-layout__docs-footer-copy {
  margin: 0;
}
.wa-layout--site-docs .wa-layout__docs-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.wa-layout--site-docs .wa-layout__docs-footer-links a {
  color: inherit;
  text-decoration: none;
}
.wa-layout--site-docs .wa-layout__docs-footer-links a:hover {
  color: var(--wa-color-text);
}

/* 右栏大纲 */
.wa-layout--site-docs .wa-layout__docs-outline-inner {
  position: sticky;
  top: calc(var(--wa-docs-float-inset) + var(--wa-docs-top-h) + var(--wa-docs-stage-gap));
  padding: 0;
}
.wa-layout--site-docs .wa-layout__docs-outline-title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--wa-color-muted);
  letter-spacing: 0.02em;
}
.wa-layout--site-docs .wa-layout__docs-outline-link {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 5px 0 5px 10px;
  border-left: 2px solid var(--wa-color-border-1);
  color: var(--wa-color-muted);
  font: inherit;
  font-size: 12.5px;
  line-height: 1.4;
  cursor: pointer;
}
.wa-layout--site-docs .wa-layout__docs-outline-link:hover {
  color: var(--wa-color-primary);
}
.wa-layout--site-docs .wa-layout__docs-outline-link.is-active {
  color: var(--wa-color-primary);
  font-weight: 600;
  border-left-color: var(--wa-color-primary);
}

/* 搜索弹层 */
.wa-layout__docs-search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--wa-color-border-2);
  background: var(--wa-color-bg);
  margin-bottom: 12px;
}
.wa-layout__docs-search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--wa-color-text);
}
.wa-layout__docs-search-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow: auto;
}
.wa-layout__docs-search-list button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  background: transparent;
  padding: 10px 8px;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--wa-color-text);
}
.wa-layout__docs-search-list button:hover {
  background: color-mix(in srgb, var(--wa-color-primary) 8%, transparent);
}
.wa-layout__docs-search-list em {
  font-style: normal;
  font-size: 12px;
  color: var(--wa-color-muted);
}
.wa-layout__docs-search-list .is-empty {
  padding: 16px 8px;
  font-size: 13px;
  color: var(--wa-color-muted);
}

@media (max-width: 1100px) {
  .wa-layout--site-docs {
    --wa-docs-outline: 168px;
    --wa-docs-sider: 220px;
  }
}

@media (max-width: 960px) {
  .wa-layout--site-docs .wa-layout__docs-stage {
    grid-template-columns: 1fr;
  }
  .wa-layout--site-docs .wa-layout__docs-sider {
    position: static;
    height: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--wa-color-border-1);
  }
  .wa-layout--site-docs .wa-layout__docs-body {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "meta"
      "toc"
      "main";
    padding: 22px 18px 48px;
  }
  .wa-layout--site-docs .wa-layout__docs-outline {
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--wa-color-border-1);
  }
  .wa-layout--site-docs .wa-layout__docs-outline-inner {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
  }
  .wa-layout--site-docs .wa-layout__docs-outline-title {
    width: 100%;
  }
  .wa-layout--site-docs .wa-layout__docs-outline-link {
    border-left: 0;
    padding: 4px 0;
  }
  .wa-layout--site-docs .wa-layout__docs-toplinks {
    display: none;
  }
}
