/* 功能介绍：门户风格文档三栏 */

.docs-body {
  background: var(--paper, #f5f7fb);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.docs-body .page-bg { display: none; }

.docs-body .topbar {
  background: #fff;
}

.docs-shell {
  flex: 1;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 200px;
  width: min(1280px, 100%);
  margin: 0 auto;
  min-height: calc(100vh - var(--header-h, 72px) - 120px);
  position: relative;
  background: #fff;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.docs-aside {
  border-right: 1px solid var(--line);
  background: #f8fafc;
  position: sticky;
  top: var(--header-h, 72px);
  align-self: start;
  height: calc(100vh - var(--header-h, 72px));
  overflow: auto;
  padding: 16px 12px 32px;
}

.docs-aside-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.docs-aside-head strong {
  font-size: 15px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.docs-aside-head strong::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--brand);
}

.docs-aside-close {
  display: none;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.docs-group { margin-bottom: 18px; }

.docs-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #e53935;
  padding: 6px 10px 10px;
  line-height: 1.35;
}
.docs-group-title::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 4h7v7H4V4zm9 0h7v7h-7V4zM4 13h7v7H4v-7zm9 0h7v7h-7v-7z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 4h7v7H4V4zm9 0h7v7h-7V4zM4 13h7v7H4v-7zm9 0h7v7h-7v-7z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.docs-group-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-link {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13.5px;
  line-height: 1.4;
  border-left: 2px solid transparent;
}

.docs-link:hover {
  background: rgba(43, 125, 233, 0.08);
  color: var(--brand-deep);
  text-decoration: none;
}

.docs-link.active {
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-weight: 600;
  border-left-color: var(--brand);
}

.docs-main-wrap {
  padding: 28px clamp(18px, 3vw, 40px) 48px;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  background: #fff;
}

.docs-article.docs-prose {
  max-width: 720px;
}

.docs-loading, .docs-prose .empty-hint {
  color: var(--muted);
}

.docs-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.docs-pager a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  background: #f8fafc;
  transition: border-color .15s, box-shadow .15s;
}

.docs-pager a:hover {
  border-color: rgba(43, 125, 233, 0.45);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.docs-pager a span {
  font-size: 12px;
  color: var(--muted);
}

.docs-pager a strong {
  font-size: 14px;
  font-weight: 600;
}

.docs-pager-next { text-align: right; align-items: flex-end; }

.docs-outline {
  position: sticky;
  top: var(--header-h, 72px);
  align-self: start;
  height: calc(100vh - var(--header-h, 72px));
  overflow: auto;
  padding: 28px 12px 32px 8px;
  border-left: 1px solid var(--line);
  background: #fff;
}

.docs-outline-title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.docs-outline ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-outline li { margin: 0 0 6px; }
.docs-outline li.sub { padding-left: 12px; }
.docs-outline li.muted {
  color: var(--muted);
  font-size: 12px;
}

.docs-outline a {
  color: var(--muted);
  text-decoration: none;
  font-size: 12.5px;
  line-height: 1.45;
  display: block;
  border-left: 2px solid transparent;
  padding-left: 10px;
}

.docs-outline a:hover {
  color: var(--brand-deep);
  border-left-color: var(--brand);
}

.docs-aside-toggle {
  display: none;
  position: fixed;
  left: 12px;
  bottom: 20px;
  z-index: 35;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand-deep);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
}

.docs-mask {
  position: fixed;
  inset: 0;
  background: rgba(27, 43, 69, 0.35);
  z-index: 36;
}

@media (max-width: 1100px) {
  .docs-shell { grid-template-columns: 240px minmax(0, 1fr); }
  .docs-outline { display: none; }
}

@media (max-width: 860px) {
  .docs-shell {
    grid-template-columns: 1fr;
    border: none;
    box-shadow: none;
    background: transparent;
  }
  .docs-aside-toggle { display: inline-flex; }
  .docs-aside {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(300px, 86vw);
    height: 100vh;
    z-index: 37;
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: var(--shadow-lg);
  }
  .docs-aside.open { transform: translateX(0); }
  .docs-aside-close { display: inline-flex; }
  .docs-main-wrap {
    padding: 20px 16px 64px;
    max-width: none;
    border-radius: 0;
  }
  .docs-pager { grid-template-columns: 1fr; }
  .docs-pager-next { text-align: left; align-items: flex-start; }
}
