/* GitBook 三栏结构 + Koikode 站点主题 */
.docs-body {
  --docs-accent: var(--primary-deep);
  --docs-accent-soft: rgba(99, 115, 100, 0.12);
  --docs-rail: 272px;
  --docs-toc: 220px;
  --docs-top: 88px;
}

.docs-shell {
  position: relative;
  z-index: 1;
  width: min(100% - 48px, 1280px);
  max-width: 1280px;
  margin: var(--docs-top) auto 0;
  padding: 12px 0 36px;
  min-height: calc(100vh - var(--docs-top));
  box-sizing: border-box;
}

.docs-topbar {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(280px, 1fr) minmax(140px, 1fr);
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--glass-strong);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
  position: relative;
  z-index: 40;
}

.docs-topbar-side {
  display: flex;
  align-items: center;
  min-width: 0;
}

.docs-topbar-left {
  justify-content: flex-start;
  gap: 10px;
}

.docs-topbar-right {
  justify-content: flex-end;
}

.docs-topbar-brand {
  display: inline-block;
  margin-left: 18px;
  padding: 4px 4px 0 2px;
  font-family: 'Koikode Signature', 'Great Vibes', cursive;
  font-size: clamp(2.35rem, 3.2vw, 2.95rem);
  font-weight: 400;
  font-style: normal;
  line-height: 0.95;
  letter-spacing: 0;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  transform: translateY(2px);
  transition: color 0.2s ease, transform 0.2s ease;
}

.docs-topbar-brand:hover {
  color: var(--docs-accent);
  transform: translateY(1px);
}

.docs-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
}

.docs-search-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 6px 18px rgba(54, 62, 75, 0.05);
}

.docs-search-trigger span {
  flex: 1;
}

.docs-search-trigger kbd {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(246, 243, 238, 0.95);
  border: 1px solid var(--line);
  color: var(--muted);
}

.docs-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.docs-pill {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  color: var(--ink) !important;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.docs-pill:hover {
  background: rgba(143, 159, 145, 0.16);
}

.docs-pill.is-dark {
  background: var(--primary-deep);
  border-color: transparent;
  color: #fff !important;
}

.docs-workspace {
  display: grid;
  grid-template-columns: var(--docs-rail) minmax(0, 1fr) var(--docs-toc);
  gap: 0;
  align-items: stretch;
  margin: 14px 0 0;
  min-height: calc(100vh - var(--docs-top) - 100px);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
}

.docs-sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(246, 243, 238, 0.88));
  overflow: hidden;
}

.docs-sidebar-cover {
  position: relative;
  flex: 0 0 auto;
  height: 120px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(185, 168, 149, 0.25), rgba(143, 159, 145, 0.18));
}

.docs-sidebar-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.docs-sidebar-cover .docs-sidebar-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: none;
  background: rgba(255, 255, 255, 0.88);
}

.docs-sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
  font-size: 14px;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.docs-icon-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: rgba(42, 48, 58, 0.06);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.docs-tree {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 6px 10px 18px;
}

.docs-section {
  margin-bottom: 10px;
}

.docs-section-title {
  display: flex;
  width: calc(100% - 12px);
  align-items: center;
  gap: 8px;
  margin: 8px 6px;
  padding: 8px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(42, 48, 58, 0.05);
  border-radius: 10px;
  border: 1px solid transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.docs-section-title:hover {
  background: rgba(143, 159, 145, 0.14);
  color: var(--ink);
}

.docs-section-title > span:first-child {
  flex: 1;
  min-width: 0;
}

.docs-section-title .docs-caret {
  margin-left: auto;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.docs-section.is-open > .docs-section-title .docs-caret {
  transform: rotate(90deg);
}

.docs-section-body {
  display: none;
  padding: 0 0 4px;
}

.docs-section.is-open > .docs-section-body {
  display: block;
}

.docs-link,
.docs-group-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.docs-link .docs-ico,
.docs-group-toggle .docs-ico {
  flex: 0 0 auto;
  width: 1.2em;
  text-align: center;
  opacity: 0.9;
}

.docs-link-label {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.docs-upload-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.docs-upload-badge.is-danger {
  background: #d64545;
}

.docs-upload-badge.is-warn {
  background: #e2a100;
  color: #fff;
}

body:not(.docs-admin-viewer) .docs-upload-badge {
  display: none;
}

.docs-link:hover,
.docs-group-toggle:hover {
  background: rgba(143, 159, 145, 0.1);
}

.docs-link.is-active {
  background: var(--docs-accent-soft);
  color: var(--docs-accent);
  font-weight: 800;
  border-left-color: var(--docs-accent);
}

.docs-group {
  margin-bottom: 2px;
}

.docs-group-label {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.docs-group-toggle .docs-caret {
  margin-left: auto;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.docs-group.is-open > .docs-group-toggle .docs-caret {
  transform: rotate(90deg);
}

.docs-children {
  display: none;
  padding: 2px 0 4px 14px;
}

.docs-group.is-open > .docs-children {
  display: grid;
  gap: 1px;
}

.docs-children .docs-link {
  font-size: 13px;
  font-weight: 500;
  color: rgba(32, 36, 43, 0.82);
}

.docs-sidebar-foot {
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}

.docs-center {
  min-width: 0;
  padding: 18px 28px 64px;
  background: rgba(255, 255, 255, 0.45);
}

.docs-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 110px;
  margin-bottom: 22px;
  padding: 22px 24px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 88% 20%, rgba(185, 168, 149, 0.28), transparent 42%),
    radial-gradient(circle at 12% 80%, rgba(143, 159, 145, 0.22), transparent 40%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(246, 243, 238, 0.9));
  border: 1px solid var(--line);
}

.docs-banner-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  font-size: 26px;
  box-shadow: 0 8px 20px rgba(54, 62, 75, 0.06);
}

.docs-banner em {
  display: block;
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.docs-banner strong {
  font-size: 20px;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.docs-article-card {
  max-width: 780px;
  transform-origin: 50% 12%;
  will-change: opacity, transform, filter;
}

.docs-article-card.docs-page-leave {
  animation: docsPageOut 0.34s ease forwards;
  pointer-events: none;
}

.docs-article-card.docs-page-enter {
  animation: docsPageIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes docsPageOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
  to {
    opacity: 0;
    transform: translateY(22px) scale(0.975);
    filter: blur(5px);
  }
}

@keyframes docsPageIn {
  from {
    opacity: 0;
    transform: translateY(36px) scale(0.96);
    filter: blur(8px);
  }
  60% {
    opacity: 1;
    filter: blur(0);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.docs-toc-list.docs-toc-leave {
  animation: docsTocOut 0.28s ease forwards;
}

.docs-toc-list.docs-toc-enter {
  animation: docsTocIn 0.48s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes docsTocOut {
  to {
    opacity: 0;
    transform: translateX(10px);
  }
}

@keyframes docsTocIn {
  from {
    opacity: 0;
    transform: translateX(14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .docs-article-card,
  .docs-article-card.docs-page-leave,
  .docs-article-card.docs-page-enter,
  .docs-toc-list.docs-toc-leave,
  .docs-toc-list.docs-toc-enter {
    transition: none !important;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}

.docs-article-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.docs-eyebrow {
  margin: 0;
  color: var(--primary-deep);
  font-size: 13px;
  font-weight: 800;
}

.docs-copy-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.docs-copy-btn:hover {
  background: rgba(143, 159, 145, 0.14);
  color: var(--primary-deep);
}

.docs-article h1 {
  margin: 0 0 18px;
  font-size: clamp(28px, 3.6vw, 36px);
  letter-spacing: -0.04em;
  line-height: 1.2;
  color: var(--ink);
}

.docs-article h2 {
  margin: 28px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 22px;
  letter-spacing: -0.03em;
  scroll-margin-top: 160px;
  color: var(--ink);
}

.docs-article h2:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.docs-article h3 {
  margin: 20px 0 10px;
  font-size: 17px;
  scroll-margin-top: 160px;
  color: var(--ink);
}

.docs-article p,
.docs-article li {
  color: rgba(32, 36, 43, 0.88);
  line-height: 1.75;
  font-size: 15px;
}

.docs-article p {
  margin: 0 0 14px;
}

.docs-article ul,
.docs-article ol {
  margin: 0 0 16px;
  padding-left: 1.25em;
}

.docs-article li + li {
  margin-top: 7px;
}

.docs-article a {
  color: var(--primary-deep);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.docs-article blockquote {
  margin: 16px 0;
  padding: 4px 0 4px 14px;
  border-left: 3px solid var(--primary);
  background: transparent;
  border-radius: 0;
  color: rgba(32, 36, 43, 0.82);
}

.docs-article blockquote p {
  margin: 0 0 8px;
}

.docs-article em {
  font-style: italic;
  color: rgba(32, 36, 43, 0.78);
}

.docs-article u {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(99, 115, 100, 0.55);
}

.docs-article h4 {
  margin: 18px 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
}

.docs-article img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 14px 0;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.docs-code {
  margin: 18px 0 22px;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(28, 34, 42, 0.55);
  background: #1b2129;
  box-shadow: 0 8px 22px rgba(32, 36, 43, 0.1);
}

.docs-code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.035);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(244, 239, 232, 0.55);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* 行号 + 代码同一滚动容器：高度跟内容走，超出才出滚动条 */
.docs-code-scroll {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  max-height: min(48vh, 420px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 226, 216, 0.28) rgba(0, 0, 0, 0.28);
}

.docs-code-scroll::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.docs-code-scroll::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.28);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.docs-code-scroll::-webkit-scrollbar-thumb {
  background: rgba(232, 226, 216, 0.28);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.docs-code-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(232, 226, 216, 0.42);
  background-clip: padding-box;
  border: 2px solid transparent;
}

.docs-code-scroll::-webkit-scrollbar-corner {
  background: rgba(0, 0, 0, 0.28);
}

.docs-code-lines {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  min-width: 2.6em;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
  color: rgba(232, 226, 216, 0.38);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.65;
  text-align: right;
  user-select: none;
  position: sticky;
  left: 0;
  z-index: 1;
}

.docs-code-lines span {
  display: block;
  height: 1.65em;
  padding: 0 10px 0 12px;
  box-sizing: border-box;
}

.docs-code-copy {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #f4efe8;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  padding: 4px 10px;
  cursor: pointer;
}

.docs-code-copy:hover {
  background: rgba(255, 255, 255, 0.12);
}

.docs-article .docs-code pre {
  margin: 0;
  padding: 12px 14px 12px 12px;
  overflow: visible;
  max-height: none;
  border-radius: 0;
  background: transparent;
  border: 0;
  color: #e8e2d8;
  tab-size: 2;
}

.docs-article .docs-code pre code {
  display: block;
  padding: 0;
  background: transparent;
  color: #d6d0c6;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre;
}

.docs-code .tok-cmt { color: #6f8f72; font-style: italic; }
.docs-code .tok-str { color: #d9a56a; }
.docs-code .tok-kw { color: #7eb6e8; }
.docs-code .tok-num { color: #b7d18a; }
.docs-code .tok-fn { color: #e6d08a; }
.docs-code .tok-var { color: #9ccfd8; }
.docs-code .tok-id { color: #e8e2d8; }
.docs-code .tok-op { color: #a8b0bc; }

.docs-deps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin: 8px 0 22px;
}

.docs-dep-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 6px 16px rgba(54, 62, 75, 0.04);
}

.docs-dep-card strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  word-break: break-all;
  line-height: 1.35;
}

.docs-dep-card span {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.docs-dep-card.is-runtime {
  border-color: rgba(99, 115, 100, 0.35);
  background: rgba(99, 115, 100, 0.08);
}

.docs-dep-card.is-empty {
  grid-column: 1 / -1;
  background: rgba(246, 243, 238, 0.9);
}

/* 行内代码：浅底，不是整段代码块 */
.docs-article :not(pre) > code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  padding: 0.1em 0.38em;
  border-radius: 4px;
  background: rgba(42, 48, 58, 0.08);
  color: #2a3140;
}

.docs-article pre {
  margin: 0 0 18px;
  padding: 14px 16px;
  overflow: auto;
  border-radius: 16px;
  background: #2a3038;
  color: #f4efe8;
  border: 1px solid rgba(42, 48, 58, 0.2);
}

.docs-article pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: 13px;
  line-height: 1.55;
}

.docs-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 18px;
  font-size: 14px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.docs-article th,
.docs-article td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.docs-article th {
  background: rgba(143, 159, 145, 0.12);
  font-weight: 700;
}

.docs-article tr:last-child td {
  border-bottom: 0;
}

.docs-error {
  color: var(--muted);
}

.docs-loading {
  display: grid;
  gap: 18px;
  padding: 6px 0 12px;
}

.docs-loading-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.docs-loading-spin {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(99, 115, 100, 0.18);
  border-top-color: var(--docs-accent);
  animation: docsSpin 0.75s linear infinite;
  flex: 0 0 auto;
}

.docs-loading-copy {
  display: grid;
  gap: 4px;
}

.docs-loading-copy strong {
  font-size: 14px;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.docs-loading-copy span {
  font-size: 12px;
  color: var(--muted);
}

.docs-skeleton {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}

.docs-skeleton-line {
  height: 12px;
  border-radius: 999px;
  background:
    linear-gradient(
      90deg,
      rgba(42, 48, 58, 0.06) 0%,
      rgba(143, 159, 145, 0.16) 45%,
      rgba(42, 48, 58, 0.06) 100%
    );
  background-size: 220% 100%;
  animation: docsShimmer 1.35s ease-in-out infinite;
}

.docs-skeleton-line.is-title {
  height: 22px;
  width: min(68%, 420px);
  border-radius: 12px;
  margin-bottom: 6px;
}

.docs-skeleton-line.is-sub {
  width: min(42%, 260px);
  margin-bottom: 10px;
}

.docs-skeleton-line.is-short {
  width: 58%;
}

.docs-skeleton-line.is-mid {
  width: 78%;
}

.docs-skeleton-block {
  height: 84px;
  border-radius: 16px;
  margin: 8px 0 4px;
  background:
    linear-gradient(
      90deg,
      rgba(42, 48, 58, 0.05) 0%,
      rgba(185, 168, 149, 0.14) 48%,
      rgba(42, 48, 58, 0.05) 100%
    );
  background-size: 220% 100%;
  animation: docsShimmer 1.35s ease-in-out infinite;
  border: 1px solid rgba(42, 48, 58, 0.05);
}

@keyframes docsSpin {
  to { transform: rotate(360deg); }
}

@keyframes docsShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .docs-loading-spin,
  .docs-skeleton-line,
  .docs-skeleton-block {
    animation: none;
  }
}

.docs-toc {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 18px 14px 16px 8px;
  border-left: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.4);
  overflow: hidden;
}

.docs-toc-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin-bottom: 12px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.docs-toc-list {
  display: grid;
  gap: 2px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  align-content: start;
}

.docs-toc-list a {
  display: block;
  padding: 7px 10px;
  border-radius: 10px;
  border-left: 3px solid transparent;
  color: rgba(32, 36, 43, 0.78);
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
}

.docs-toc-list a.is-h3 {
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--muted);
}

.docs-toc-list a:hover {
  background: rgba(143, 159, 145, 0.1);
}

.docs-toc-list a.is-active {
  background: var(--docs-accent-soft);
  color: var(--docs-accent);
  font-weight: 800;
  border-left-color: var(--docs-accent);
}

.docs-toc-empty {
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
}

.docs-backdrop {
  display: none;
}

.docs-search-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: start center;
  padding: 12vh 16px 24px;
  background: rgba(32, 36, 43, 0.38);
}

.docs-search-modal[hidden] {
  display: none !important;
}

.docs-search-panel {
  width: min(640px, 100%);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(16px);
}

.docs-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.docs-search-row input {
  flex: 1;
  height: 36px;
  border: 0;
  outline: 0;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
}

.docs-search-results {
  max-height: 360px;
  overflow: auto;
  padding: 8px;
}

.docs-search-hit {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.docs-search-hit:hover,
.docs-search-hit.is-active {
  background: var(--docs-accent-soft);
}

.docs-search-hit strong {
  display: block;
  font-size: 14px;
  color: var(--ink);
}

.docs-search-hit span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.docs-search-empty {
  padding: 18px 12px;
  color: var(--muted);
  font-size: 13px;
}

.docs-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.docs-pager-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  color: var(--ink);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.docs-pager-link:hover {
  background: rgba(143, 159, 145, 0.12);
  border-color: rgba(99, 115, 100, 0.28);
}

.docs-pager-link.is-next {
  text-align: right;
  align-items: flex-end;
}

.docs-pager-link.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.docs-pager-link em {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.docs-pager-link strong {
  font-size: 15px;
  letter-spacing: -0.02em;
}

@media (max-width: 1180px) {
  .docs-workspace {
    grid-template-columns: var(--docs-rail) minmax(0, 1fr);
  }

  .docs-toc {
    display: none;
  }
}

@media (max-width: 960px) {
  .docs-body {
    --docs-top: 78px;
  }

  .docs-shell {
    width: min(100% - 20px, 1280px);
    padding-bottom: 24px;
  }

  .docs-topbar {
    grid-template-columns: auto minmax(0, 1fr);
    margin: 0;
  }

  .docs-topbar-right {
    display: none;
  }

  .docs-menu-btn {
    display: inline-flex;
  }

  .docs-topbar-brand {
    margin-left: 8px;
    font-size: 2rem;
  }

  .docs-search-trigger {
    height: 42px;
  }

  .docs-workspace {
    grid-template-columns: 1fr;
    margin: 12px 0 0;
  }

  .docs-sidebar {
    position: fixed;
    z-index: 90;
    left: 0;
    top: 0;
    width: min(88vw, 320px);
    height: 100vh;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow);
    border-radius: 0 20px 20px 0;
  }

  body.docs-nav-open .docs-sidebar {
    transform: translateX(0);
  }

  .docs-sidebar-close {
    display: inline-grid;
    place-items: center;
  }

  .docs-sidebar-cover .docs-sidebar-close {
    display: inline-grid;
    place-items: center;
  }

  .docs-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(32, 36, 43, 0.36);
  }

  .docs-backdrop[hidden] {
    display: none !important;
  }

  .docs-center {
    padding: 14px 14px 48px;
  }

  .docs-banner {
    min-height: 88px;
    padding: 16px;
  }

  .docs-pager {
    grid-template-columns: 1fr;
  }
}

/* Docs admin edit mode — in-place */
.docs-admin-drop {
  margin: 0 0 16px;
  border: 1px dashed rgba(99, 115, 100, 0.45);
  border-radius: 14px;
  background: rgba(99, 115, 100, 0.06);
  overflow: hidden;
}

.docs-admin-drop-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.docs-admin-drop-toggle em {
  margin-left: auto;
  font-style: normal;
  color: var(--muted);
}

.docs-admin-drop-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(99, 115, 100, 0.16);
  color: var(--primary-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.docs-admin-drop-panel {
  padding: 0 12px 12px;
}

.docs-admin-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 132px;
  padding: 18px 16px;
  border: 1px dashed rgba(42, 48, 58, 0.28);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.docs-admin-drop-zone strong {
  color: var(--ink);
  font-size: 15px;
}

.docs-admin-drop-zone span {
  font-size: 12px;
  line-height: 1.5;
  max-width: 36em;
}

.docs-admin-drop-zone.is-drag {
  border-color: var(--primary-deep);
  background: rgba(99, 115, 100, 0.12);
  transform: scale(1.01);
}

.docs-admin-drop-zone.is-busy {
  opacity: 0.65;
  pointer-events: none;
}

.docs-admin-drop-pick {
  margin-top: 6px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.docs-admin-drop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 4px;
}

.docs-admin-drop-actions .docs-admin-drop-pick {
  margin-top: 0;
}

.docs-admin-drop-hint {
  margin: 8px 2px 0;
  font-size: 11px;
  color: var(--muted);
}

.docs-edit-entry {
  position: fixed;
  right: 22px;
  bottom: 90px;
  z-index: 1260;
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.docs-edit-dock {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 1280;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(920px, calc(100vw - 24px));
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(32, 36, 43, 0.94);
  color: #f4efe8;
  box-shadow: 0 16px 40px rgba(32, 36, 43, 0.28);
  backdrop-filter: blur(14px);
}

.docs-edit-dock-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.docs-edit-dock-main strong {
  font-size: 13px;
}

.docs-edit-dock-main span {
  font-size: 12px;
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(42vw, 360px);
}

body.docs-edit-dirty .docs-edit-dock-main strong {
  color: #ffd7a8;
}

.docs-edit-dock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.docs-edit-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #f4efe8;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
}

.docs-edit-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.docs-edit-btn.is-primary {
  background: var(--primary-deep);
  border-color: transparent;
}

.docs-inline-editor {
  display: grid;
  gap: 12px;
  margin-bottom: 8px;
}

.docs-inline-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.docs-inline-meta label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.docs-inline-meta input,
.docs-inline-rename {
  width: 100%;
  box-sizing: border-box;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  color: var(--ink);
}

.docs-inline-tabs {
  display: flex;
  gap: 8px;
}

.docs-inline-tabs button {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  cursor: pointer;
}

.docs-inline-tabs button.is-active {
  background: var(--docs-accent-soft);
  color: var(--docs-accent);
  border-color: transparent;
}

.docs-inline-body,
.docs-inline-note {
  width: 100%;
  box-sizing: border-box;
  min-height: 420px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.7;
  resize: vertical;
}

/* 只有真正的 config / 代码粘贴区才用深色代码编辑器 */
.docs-inline-code {
  width: 100%;
  box-sizing: border-box;
  min-height: 420px;
  padding: 16px 18px;
  border: 1px solid rgba(42, 48, 58, 0.2);
  border-radius: 14px;
  background: #1b2129;
  color: #e8e2d8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.65;
  tab-size: 2;
  resize: vertical;
}

body.docs-edit-is-config .docs-inline-code {
  min-height: min(62vh, 640px);
}

.docs-inline-tip {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

body.docs-is-editing .docs-article-card {
  max-width: none;
}

body.docs-is-editing .docs-banner {
  display: none;
}

body.docs-is-editing:not(.docs-edit-previewing) .docs-article-meta {
  display: none;
}

body.docs-is-editing .docs-shell {
  padding-bottom: 96px;
}

body.docs-is-editing .docs-section-title {
  cursor: text;
}

.docs-toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  z-index: 1400;
  transform: translateX(-50%) translateY(12px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(32, 36, 43, 0.92);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.docs-toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.docs-toast.is-error {
  background: rgba(140, 52, 52, 0.94);
}

@media (max-width: 960px) {
  .docs-inline-meta {
    grid-template-columns: 1fr;
  }

  .docs-edit-entry {
    right: 14px;
    bottom: 86px;
  }

  .docs-edit-dock {
    bottom: 10px;
  }
}
