﻿
:root {
  --guide-bg: #f5f6f8;
  --guide-card: #ffffff;
  --guide-border: #dfe3ea;
  --guide-text: #020817;
  --guide-muted: #475569;
  --guide-link: #2563eb;
  --guide-soft: #f1f5f9;
  --guide-side: 380px;
  --guide-content: 760px;
  --guide-gap: 42px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

body {
  margin: 0;
  background: var(--guide-bg);
  color: var(--guide-text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  line-height: 1.72;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.menu-button {
  display: none;
}

main {
  width: calc(var(--guide-side) + var(--guide-gap) + var(--guide-content));
  max-width: calc(100vw - 48px);
  margin: 0 auto;
  padding: 34px 0 80px;
}

.hero {
  max-width: none;
  margin: 0 auto;
  padding: 0 0 54px;
  border: 0;
  text-align: center;
}

.eyebrow,
.hero::after,
.meta {
  display: none;
}

.hero h1 {
  margin: 0 0 8px;
  color: #020817;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  font-size: 36px;
  font-weight: 900;
  line-height: 1.24;
  letter-spacing: -1px;
}

.hero p {
  max-width: none;
  margin: 0;
  color: #334155;
  font-size: 16px;
}

.sidebar {
  position: fixed;
  top: 162px;
  left: max(24px, calc(50% - (var(--guide-side) + var(--guide-gap) + var(--guide-content)) / 2));
  z-index: 20;
  width: var(--guide-side);
  height: calc(100vh - 182px);
  padding: 18px 16px 22px;
  overflow: auto;
  border: 1px solid var(--guide-border);
  border-radius: 14px;
  background: var(--guide-card);
  box-shadow: none;
  color: var(--guide-text);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.sidebar::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #d9dde5;
}

.nav-panel-title {
  margin: 0 0 18px;
  padding: 0 2px 14px;
  border-bottom: 1px solid #eef1f5;
  color: #020817;
  font-size: 18px;
  font-weight: 900;
}

.brand {
  display: none;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}

.sidebar nav::before {
  display: none;
}

.nav-module {
  margin: 2px 0 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.nav-module.has-active {
  border: 0;
  background: transparent;
}

.nav-module-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  min-height: 34px;
}

.nav-toggle {
  order: 0;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.nav-toggle:hover {
  background: #eef2f7;
}

.nav-toggle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #334155;
  transform: translate(-50%, -42%) rotate(0deg);
  transform-origin: 50% 45%;
  transition: transform .16s ease;
}

.nav-module.collapsed .nav-toggle::before {
  transform: translate(-42%, -50%) rotate(-90deg);
}

.sidebar .nav-module-head a.module-main {
  display: flex;
  align-items: center;
  order: 1;
  flex: 1 1 auto;
  margin: 0;
  min-height: 34px;
  padding: 6px 8px 6px 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #1e293b;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}

.sidebar .nav-module-head a.module-main::before {
  display: none;
}

.nav-connectors .module-main::before {
  display: none !important;
}

.nav-advanced .module-main::before {
  display: none !important;
}

.nav-children {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0 0 28px;
}

.nav-module.collapsed .nav-children {
  display: none;
}

.sidebar a {
  position: relative;
  display: block;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #334155;
  text-decoration: none;
  transition: background .16s ease, color .16s ease;
}

.sidebar a:hover {
  border: 0;
  background: #f1f5f9;
  color: #0f172a;
}

.sidebar a.active {
  border: 0;
  background: rgb(237, 233, 254);
  box-shadow: none;
}

.sidebar .module-main.active {
  color: #1e293b;
}

.sidebar .chapter-link.active {
  color: #5b21b6;
  font-weight: 700;
}

.sidebar .topic-link.active {
  color: #5b21b6;
  font-weight: 400;
}

.sidebar a.active::before {
  display: none;
}

.sidebar a.chapter-link {
  margin: 3px 0;
  padding: 6px 8px;
  color: #334155;
  font-size: 13px;
  font-weight: 500;
}

.sidebar a.chapter-link::before {
  display: none;
}

.sidebar a.topic-link {
  margin: 1px 0 1px 20px;
  padding: 5px 8px;
  border: 0;
  border-left: 0;
  color: #334155;
  font-size: 12.5px;
}

.sidebar a.detail-link {
  margin: 1px 0 1px 38px;
  padding: 4px 8px;
  border: 0;
  border-left: 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
}

.sidebar a.topic-link::after,
.sidebar a.detail-link::after {
  display: none;
}

.sidebar a.topic-link::before,
.sidebar a.detail-link::before {
  display: none;
}

.sidebar a.topic-link::before {
  display: none;
}

.sidebar a.detail-link::before {
  display: none;
}

/* Final active-state override: keep selected navigation readable over the purple background. */
.sidebar nav a.chapter-link.active,
.sidebar nav a.topic-link.active {
  color: #5b21b6 !important;
  text-shadow: none !important;
}

.sidebar nav a.chapter-link.active {
  font-weight: 700 !important;
}

.sidebar nav a.topic-link.active {
  font-weight: 400 !important;
}

.doc-module.panel-hidden,
.chapter.panel-hidden,
.focus-hidden {
  display: none !important;
}

.doc-module {
  width: var(--guide-content);
  max-width: var(--guide-content);
  margin: 0 0 26px calc(var(--guide-side) + var(--guide-gap));
  padding: 48px 34px;
  border: 1px solid var(--guide-border);
  border-radius: 14px;
  background: var(--guide-card);
  box-shadow: none;
  scroll-margin-top: 22px;
}

.module-heading {
  margin: 0 0 34px;
  padding: 0 0 22px;
  border: 0;
  border-bottom: 1px solid #eef1f5;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none;
}

.module-heading::before,
.doc-module > .module-heading::before {
  display: none;
}

.module-kicker {
  display: none;
}

.module-heading h2 {
  margin: 0 0 10px;
  color: #020817;
  font-size: 26px;
  font-weight: 900;
  line-height: 1.28;
}

.module-heading p {
  max-width: none;
  color: #334155;
  font-size: 15px;
}

.module-grid {
  display: none;
}

.chapter {
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  scroll-margin-top: 24px;
}

.chapter + .chapter {
  margin-top: 46px;
  padding-top: 36px;
  border-top: 1px solid #eef1f5;
}

.chapter-title {
  display: block;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
}

.chapter-title > b {
  display: none;
}

.chapter-title h2 {
  margin: 0 0 10px;
  padding: 0;
  color: #020817;
  font-size: 25px;
  font-weight: 900;
  line-height: 1.35;
}

.chapter-title p {
  margin: 0;
  color: #334155;
  font-size: 14px;
}

.chapter h3 {
  margin: 30px 0 16px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #020817;
  font-size: 23px;
  font-weight: 900;
  line-height: 1.34;
  scroll-margin-top: 24px;
}

.chapter h4 {
  display: block;
  width: auto;
  max-width: none;
  margin: 24px 0 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #020817;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.45;
  scroll-margin-top: 24px;
}

.chapter h4::before {
  display: none;
}

.steps {
  margin: 12px 0 22px;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.steps > li {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  counter-increment: none;
}

.steps > li::before {
  display: none;
}

.steps > li > p {
  margin: 0 0 12px;
  color: #020817;
  font-size: 15.5px;
  font-weight: 400;
  line-height: 1.85;
}

.steps > li > p:first-child {
  font-weight: 500;
}

.notice {
  margin: 14px 0 18px;
  padding: 12px 14px;
  border: 1px solid #dbeafe;
  border-left: 4px solid #2563eb;
  border-radius: 10px;
  background: #eff6ff;
  color: #1e3a8a;
}

.inline-link {
  margin-left: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #4f46e5;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.gallery {
  display: block;
  margin: 14px 0 20px;
}

.gallery figure {
  margin: 0 0 18px;
  padding: 18px;
  border: 0;
  border-radius: 12px;
  background: #eef1f5;
  overflow: hidden;
}

.gallery img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 560px;
  object-fit: contain;
  border-radius: 8px;
  background: transparent;
  cursor: zoom-in;
}

.gallery figcaption {
  display: none;
}

.permission-code-card {
  border-color: #d7dee8;
  border-radius: 12px;
  background: #0f172a;
}

.permission-code-head {
  background: #111827;
}

.config-code {
  background: #0f172a;
}

.lightbox {
  background: rgba(2, 8, 23, .88);
}

@media (max-width: 1180px) {
  main {
    width: auto;
    max-width: 100%;
    padding: 28px 18px 70px;
  }

  .sidebar {
    left: 18px;
    width: 320px;
  }

  .doc-module {
    width: auto;
    max-width: none;
    margin-left: 352px;
  }
}

@media (max-width: 820px) {
  .menu-button {
    display: block;
    position: fixed;
    left: 14px;
    top: 14px;
    z-index: 40;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 10px;
    background: #2563eb;
    color: #fff;
    font-size: 22px;
  }

  .sidebar {
    top: 66px;
    left: 12px;
    width: min(360px, calc(100vw - 24px));
    height: calc(100vh - 82px);
    transform: translateX(calc(-100% - 24px));
    transition: transform .22s ease;
  }

  .sidebar.open {
    transform: none;
  }

  .hero {
    padding-top: 58px;
    padding-bottom: 30px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .doc-module {
    margin: 0 0 22px;
    padding: 28px 18px;
  }
}

/* Focused content spacing cleanup
   Removes the empty top area after selecting items from the left navigation. */
body.content-focused-view main {
  padding-top: 20px;
}

body.content-focused-view .hero {
  display: none;
}

body.content-focused-view .sidebar {
  top: 20px;
  height: calc(100vh - 40px);
}

.doc-module.is-focused-module {
  padding-top: 30px;
}
.doc-module.is-focused-module .chapter {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.chapter.is-heading-scope .chapter-title {
  display: none;
}

.chapter .focus-target {
  margin-top: 0 !important;
}

@media (max-width: 820px) {
  body.content-focused-view .sidebar {
    top: 66px;
    height: calc(100vh - 82px);
  }

  body.content-focused-view main {
    padding-top: 28px;
  }
}
/* Chapter link cleanup
   Chapter-level navigation should not keep separator spacing from previous chapters. */
body.chapter-focused-view .module-heading {
  display: none;
}

body.chapter-focused-view .doc-module.is-focused-module {
  padding-top: 30px;
}

body.chapter-focused-view .doc-module.is-focused-module .chapter:not(.panel-hidden) {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

/* Navigation UI polish
   Icons use Lucide open-source SVG paths (ISC License): https://lucide.dev/license */
.sidebar,
.sidebar a,
.nav-panel-title {
  font-family: "Inter", "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.nav-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #0f172a;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: .01em;
}

.nav-panel-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .12);
}

.sidebar .nav-module-head a.module-main {
  gap: 10px;
  padding: 7px 10px 7px 2px;
  color: #0f172a;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.35;
  letter-spacing: .01em;
}

.nav-main-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #f1f5f9;
  color: #475569;
}

.nav-main-icon svg {
  width: 17px;
  height: 17px;
}

.nav-main-text {
  display: inline-block;
  min-width: 0;
}

.nav-manual .nav-main-icon {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #2563eb;
}

.nav-connectors .nav-main-icon {
  border-color: #a5f3fc;
  background: #ecfeff;
  color: #0891b2;
}

.nav-module[data-nav-module="module-basic"] .nav-main-icon {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #16a34a;
}

.nav-module[data-nav-module="module-advanced"] .nav-main-icon {
  border-color: #ddd6fe;
  background: #f5f3ff;
  color: #7c3aed;
}

.sidebar a.chapter-link {
  color: #334155;
  font-size: 13px;
  font-weight: 620;
  line-height: 1.5;
}

.sidebar a.topic-link {
  color: #475569;
  font-size: 12.5px;
  font-weight: 450;
  line-height: 1.45;
}

.sidebar a:hover {
  color: #111827;
}

.sidebar a.active {
  color: #3730a3;
}

.sidebar .module-main.active {
  color: #0f172a;
}

.sidebar .module-main.active .nav-main-icon {
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, .12), 0 6px 16px rgba(15, 23, 42, .08);
}

