:root {
  --docs-bg: #f4f6fb;
  --docs-surface: #ffffff;
  --docs-border: #e6e9f0;
  --docs-text: #0f172a;
  --docs-muted: #667085;
  --docs-accent: #1d4ed8;
  --docs-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.docs-page {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 220px;
  gap: 24px;
  padding: 96px 24px 24px;
  background: var(--docs-bg);
  min-height: 100vh;
}

.docs-page.is-collapsed {
  grid-template-columns: 72px minmax(0, 1fr) 220px;
}

.docs-sidebar {
  background: var(--docs-surface);
  border: 1px solid var(--docs-border);
  border-radius: 16px;
  padding: 20px;
  height: fit-content;
  position: sticky;
  top: 96px;
  box-shadow: var(--docs-shadow);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.docs-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--docs-border);
  background: #f8fafc;
  color: var(--docs-text);
  font-size: 18px;
  cursor: pointer;
}

.docs-sidebar-toggle:hover {
  background: #eef2ff;
}

.docs-page.is-collapsed .docs-sidebar {
  padding: 12px;
}

.docs-page.is-collapsed .docs-brand-title,
.docs-page.is-collapsed .docs-brand-tag,
.docs-page.is-collapsed .docs-search,
.docs-page.is-collapsed .docs-nav {
  display: none;
}

.docs-page.is-collapsed .docs-brand {
  margin-bottom: 0;
}

.docs-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.docs-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.docs-brand-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--docs-text);
}

.docs-brand-tag {
  align-self: flex-start;
  font-size: 12px;
  color: #2563eb;
  background: #e0e7ff;
  padding: 4px 10px;
  border-radius: 999px;
}

.docs-search input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--docs-border);
  background: #f8fafc;
}

.docs-nav {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.docs-nav-folder {
  font-size: 14px;
  color: var(--docs-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.docs-nav-folder.depth-0 {
  font-size: 16px;
  margin-top: 14px;
}

.docs-nav-folder.depth-1 {
  font-size: 14px;
  padding-left: 12px;
}

.docs-nav-folder.depth-2 {
  font-size: 13px;
  padding-left: 24px;
}

.docs-nav-link {
  color: var(--docs-text);
  font-size: 15px;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.docs-nav-link.depth-1 {
  padding-left: 22px;
}

.docs-nav-link.depth-2 {
  padding-left: 34px;
}

.docs-nav-link:hover {
  background: #eef2ff;
}

.docs-nav-link.is-active {
  color: #1e40af;
  font-weight: 400;
}

.docs-content {
  background: var(--docs-surface);
  border: 1px solid var(--docs-border);
  border-radius: 18px;
  padding: 28px 34px 36px;
  box-shadow: var(--docs-shadow);
}

.docs-breadcrumb {
  font-size: 13px;
  color: var(--docs-muted);
  margin-bottom: 18px;
}

.docs-article h1 {
  font-size: 28px;
  margin-bottom: 8px;
  color: var(--docs-text);
}

.docs-meta {
  font-size: 13px;
  color: var(--docs-muted);
  margin-bottom: 20px;
}

.docs-article h2 {
  font-size: 20px;
  margin: 28px 0 12px;
  color: var(--docs-text);
}

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

.docs-article h4 {
  font-size: 15px;
  margin: 16px 0 8px;
  color: var(--docs-text);
}

.docs-article p {
  color: #1f2937;
  line-height: 1.8;
  margin: 10px 0;
}

.docs-article ul {
  padding-left: 20px;
  margin: 12px 0;
  color: #1f2937;
}

.docs-article li {
  margin: 8px 0;
  line-height: 1.7;
}

.docs-pagination {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
}

.docs-pagination-link {
  flex: 1;
  display: inline-block;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--docs-border);
  text-decoration: none;
  color: var(--docs-text);
  background: #f8fafc;
}

.docs-pagination-link.next {
  text-align: right;
}

.docs-pagination-link:hover {
  background: #eef2ff;
}

.docs-pagination-link.is-empty {
  visibility: hidden;
}

.docs-related {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--docs-border);
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent;
  position: static;
  z-index: auto;
}

.docs-related-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--docs-text);
  margin-bottom: 10px;
}

.docs-related-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.docs-related-link {
  color: var(--docs-text);
  text-decoration: none;
  padding: 4px 0;
}

.docs-related-link:hover {
  color: var(--docs-accent);
}

.doc-code {
  background: #0f172a;
  color: #e2e8f0;
  padding: 16px;
  border-radius: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  margin: 16px 0;
}

.mermaid {
  background: #ffffff;
  border: 1px solid var(--docs-border);
  border-radius: 12px;
  padding: 16px;
  overflow-x: auto;
  margin: 16px 0;
}

.doc-figure {
  margin: 18px 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--docs-border);
}

.doc-figure img {
  width: 100%;
  display: block;
}

.doc-figure.is-compact {
  max-width: 220px;
  margin: 18px auto;
}

.doc-table {
  margin: 16px 0;
  border: 1px solid var(--docs-border);
  border-radius: 12px;
  overflow-x: auto;
  background: #ffffff;
  width: fit-content;
  max-width: 100%;
}

.doc-table table {
  width: max-content;
  max-width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.doc-table th,
.doc-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--docs-border);
  border-right: 1px solid var(--docs-border);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
  color: #1f2937;
  word-break: break-word;
}

.doc-table th:last-child,
.doc-table td:last-child {
  border-right: none;
}

.doc-table th {
  background: #f8fafc;
  font-weight: 600;
}

.doc-table tr:last-child td {
  border-bottom: none;
}

.doc-table p {
  margin: 4px 0;
}

.doc-table img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.doc-table .doc-code {
  margin: 8px 0;
}

.doc-table-excel td,
.doc-table-excel th {
  white-space: pre-wrap;
  word-break: break-word;
}

.doc-table-excel table {
  width: max-content;
  max-width: 100%;
  table-layout: auto;
}

.doc-table-mermaid table {
  width: 100%;
  min-width: 100%;
}

.doc-table-mermaid {
  width: 100%;
  max-width: none;
}

.doc-table-mermaid td {
  width: 100%;
}

.doc-table-mermaid .mermaid {
  width: 100%;
}

.doc-table-fixed table {
  table-layout: auto;
}

.doc-table-fixed .col-product-detail {
  width: 14%;
  min-width: 140px;
}

.doc-table-fixed .col-solution-intro {
  width: 18%;
  min-width: 160px;
}

.doc-table-fixed .col-name,
.doc-table-fixed .col-type {
  width: 10%;
  min-width: 110px;
  white-space: nowrap;
}

.doc-table-fixed th,
.doc-table-fixed td {
  word-break: break-word;
}

.docs-toc {
  background: var(--docs-surface);
  border: 1px solid var(--docs-border);
  border-radius: 16px;
  padding: 18px;
  height: fit-content;
  position: sticky;
  top: 96px;
  box-shadow: var(--docs-shadow);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.docs-toc-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--docs-text);
}

.docs-toc-link {
  display: block;
  font-size: 18px;
  color: var(--docs-muted);
  text-decoration: none;
  padding: 6px 0;
}

.docs-toc-link.level-3 {
  padding-left: 10px;
}

.docs-toc-link.level-4 {
  padding-left: 20px;
  font-size: 16px;
}

.docs-toc-link:hover {
  color: var(--docs-accent);
}

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

@media (max-width: 1200px) {
  .docs-page {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .docs-page.is-collapsed {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .docs-toc {
    display: none;
  }
}

@media (max-width: 900px) {
  .docs-page {
    grid-template-columns: 1fr;
    padding: 88px 16px 16px;
  }

  .docs-page.is-collapsed {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: static;
    order: 2;
  }

  .docs-content {
    order: 1;
    padding: 20px;
  }
}
