:root {
  --brand: #7c3aed;
  --brand-light: #f5f3ff;
  --brand-soft: #ede9fe;
  --brand-dark: #6d28d9;
  --text: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --bg: #f8fafc;
  --surface: #ffffff;
  --sidebar-width: 272px;
  --topbar-height: 60px;
  --content-max: 960px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 30px rgba(124, 58, 237, 0.08);
  --shadow-lg: 0 18px 40px rgba(124, 58, 237, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', sans-serif;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--brand-dark);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(180deg, #ffffff 0%, #fcfbff 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.03);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
  background: linear-gradient(135deg, #faf5ff 0%, #ffffff 100%);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
}

.sidebar-brand:hover {
  color: var(--brand);
  text-decoration: none;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.sidebar-close {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px 8px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 10px 24px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

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

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 4px;
  color: var(--text);
  text-decoration: none;
  transition: all 0.15s ease;
  border-radius: 10px;
  border: 1px solid transparent;
}

.nav-link:hover {
  background: var(--brand-light);
  border-color: #e9d5ff;
  text-decoration: none;
  color: var(--brand-dark);
}

.nav-link.active {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border-color: #ddd6fe;
  color: var(--brand-dark);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.nav-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #ede9fe;
  color: #7c3aed;
  flex-shrink: 0;
}

.nav-icon svg {
  display: block;
}

.nav-link.active .nav-icon {
  background: rgba(255, 255, 255, 0.92);
}

.nav-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding-top: 2px;
}

.nav-title {
  font-size: 13px;
  line-height: 1.45;
}

.nav-group > .nav-link .nav-title {
  font-weight: 600;
  color: #1f2937;
}

.nav-sub {
  font-size: 11px;
  color: #6b7280;
  font-weight: 500;
}

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

.nav-sublist {
  list-style: none;
  margin: 0 0 6px 0;
  padding: 2px 0 4px 38px;
}

.nav-sublink {
  display: block;
  padding: 5px 10px;
  margin-bottom: 2px;
  font-size: 13px;
  line-height: 1.45;
  color: #374151;
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
}

.nav-sublink:hover {
  color: var(--brand-dark);
  background: rgba(245, 243, 255, 0.7);
  text-decoration: none;
}

.nav-sublink.active {
  color: var(--brand-dark);
  font-weight: 600;
  background: var(--brand-light);
  border-left-color: var(--brand);
}

.nav-group.open > .nav-link {
  color: var(--brand-dark);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 90;
  backdrop-filter: blur(2px);
}

/* Main */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--topbar-height);
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
}

.menu-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 11px;
  font-size: 16px;
  cursor: pointer;
  color: var(--text);
}

.breadcrumb {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
}

.breadcrumb a {
  color: var(--text-secondary);
}

.breadcrumb a:hover {
  color: var(--brand);
}

.breadcrumb .sep {
  margin: 0 8px;
  color: var(--text-muted);
}

.topbar-link {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--brand-light);
  border: 1px solid #e9d5ff;
}

.topbar-link:hover {
  background: var(--brand-soft);
  text-decoration: none;
}

.content {
  flex: 1;
  max-width: calc(var(--content-max) + 56px);
  width: 100%;
  margin: 0 auto;
  padding: 28px 28px 56px;
}

.footer {
  padding: 18px 28px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* Hero */
.hero {
  text-align: center;
  padding: 56px 32px 60px;
  background:
    radial-gradient(circle at top right, rgba(124, 58, 237, 0.12), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f5f3ff 100%);
  border: 1px solid #e9d5ff;
  border-radius: calc(var(--radius) + 2px);
  margin-bottom: 36px;
  box-shadow: var(--shadow-md);
}

.hero h1 {
  font-size: 2.125rem;
  font-weight: 800;
  margin: 0 0 14px;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto 18px;
}

.hero-stats {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid #e9d5ff;
  font-size: 13px;
  color: var(--text-secondary);
}

.hero-stat strong {
  color: var(--brand);
  font-size: 1rem;
}

.hero-stat-divider {
  opacity: 0.35;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.28);
}

.btn-primary:hover {
  transform: translateY(-1px);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 12px 24px rgba(124, 58, 237, 0.34);
}

.btn-outline {
  background: #fff;
  color: var(--brand);
  border: 1px solid #ddd6fe;
}

.btn-outline:hover {
  background: var(--brand-light);
  text-decoration: none;
}

.btn-sm {
  padding: 9px 16px;
  font-size: 13px;
}

.section-title {
  font-size: 1.375rem;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.section-desc {
  color: var(--text-secondary);
  margin: 0 0 24px;
  font-size: 14px;
}

.section-title--sm {
  font-size: 1.05rem;
  margin-bottom: 14px;
}

.module-groups {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.module-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  padding: 4px 0 4px 16px;
  border-left: 3px solid #ddd6fe;
  margin-left: 8px;
}

.feature-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  transition: all 0.15s ease;
}

.feature-card:hover {
  border-color: #c4b5fd;
  background: var(--brand-light);
  text-decoration: none;
  color: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.feature-card-title {
  flex: 1;
  line-height: 1.45;
}

.feature-card-arrow {
  color: var(--brand);
  font-size: 12px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}

.feature-card:hover .feature-card-arrow {
  opacity: 1;
}

.module-card {
  display: flex;
  gap: 18px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: all 0.18s ease;
  box-shadow: var(--shadow-sm);
}

.module-card:hover {
  border-color: #c4b5fd;
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}

.module-card-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: #ede9fe;
  color: #7c3aed;
  flex-shrink: 0;
}

.module-card-icon svg,
.card-icon svg {
  display: block;
}

.module-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
}

.module-card-sub {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 3px 8px;
  border-radius: 999px;
  vertical-align: middle;
}

.module-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 12px;
  line-height: 1.65;
}

.module-card-meta {
  font-size: 12px;
  color: var(--brand);
  font-weight: 600;
}

/* Article */
.doc-article {
  background: var(--surface);
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid var(--border);
  padding: 36px 40px;
  box-shadow: var(--shadow-md);
}

.doc-header {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
}

.doc-icon {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  color: #7c3aed;
  margin-bottom: 16px;
}

.doc-header h1 {
  font-size: 1.875rem;
  font-weight: 800;
  margin: 0 0 12px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.doc-subtitle {
  display: inline-block;
  margin-left: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 4px 10px;
  border-radius: 999px;
  vertical-align: middle;
}

.doc-lead {
  font-size: 15px;
  color: #111827;
  margin: 0;
  max-width: 760px;
  line-height: 1.75;
}

.doc-header--chapter h1 {
  font-size: 1.625rem;
}

.doc-module-tag {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 999px;
  text-decoration: none;
}

.doc-module-tag:hover {
  background: #ddd6fe;
  text-decoration: none;
}

.doc-hub-action {
  margin: 18px 0 0;
}

.chapter-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chapter-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: all 0.15s ease;
}

.chapter-card:hover {
  border-color: #c4b5fd;
  background: var(--brand-light);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.chapter-card-index {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #ede9fe;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.chapter-card-body {
  flex: 1;
  min-width: 0;
}

.chapter-card-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text);
}

.chapter-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.55;
}

.chapter-card-arrow {
  flex-shrink: 0;
  color: var(--brand);
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.15s;
  padding-top: 4px;
}

.chapter-card:hover .chapter-card-arrow {
  opacity: 1;
}

.empty-note {
  color: var(--text-muted);
  font-size: 14px;
}

.modules-grid--about {
  margin-top: 40px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

.doc-lead--hub {
  max-width: 820px;
}

.journey-hint {
  margin: 16px 0 0;
  padding: 12px 16px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: #92400e;
}

.team-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 22px;
}

.team-stat {
  padding: 16px 14px;
  text-align: center;
  background: linear-gradient(180deg, #faf5ff 0%, #ffffff 100%);
  border: 1px solid #e9d5ff;
  border-radius: var(--radius-sm);
}

.team-stat strong {
  display: block;
  font-size: 1.125rem;
  color: var(--brand);
  margin-bottom: 4px;
}

.team-stat span {
  font-size: 12px;
  color: var(--text-secondary);
}

.voice-stage {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #b45309;
  background: #fef3c7;
  border-radius: 999px;
}

.voice-body blockquote.voice-quote,
.voice-quote {
  margin: 20px 0 24px;
  padding: 18px 22px;
  border-left: 4px solid var(--brand);
  background: linear-gradient(135deg, #faf5ff 0%, #f5f3ff 100%);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 15px;
  line-height: 1.8;
  color: #374151;
}

.voice-body p strong:first-child {
  color: var(--text);
}

.chapter-card--voice .chapter-card-index,
.chapter-card--team .chapter-card-index {
  width: auto;
  min-width: 52px;
  height: auto;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.team-member-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 8px;
}

.team-avatar {
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.25);
}

.doc-header--team h1 {
  margin: 0 0 6px;
  font-size: 1.625rem;
}

.team-role {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
}

.team-slogan {
  margin: 28px 0 0;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border: 1px solid #ddd6fe;
  font-size: 15px;
  font-weight: 600;
  color: var(--brand-dark);
  text-align: center;
}

.team-body p {
  text-align: justify;
}

.doc-body h2 {
  position: relative;
  font-size: 1.3rem;
  font-weight: 800;
  margin: 44px 0 16px;
  padding: 10px 0 10px 16px;
  scroll-margin-top: calc(var(--topbar-height) + 20px);
  border-top: 1px solid var(--border-light);
  letter-spacing: -0.01em;
}

.doc-body h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #a78bfa 0%, #7c3aed 100%);
}

.doc-body h2:first-child {
  border-top: none;
  margin-top: 0;
}

.doc-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 28px 0 10px;
  color: #111827;
  scroll-margin-top: calc(var(--topbar-height) + 20px);
}

.doc-body h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 20px 0 8px;
  color: #111827;
}

.doc-body p {
  margin: 0 0 14px;
  color: #111827;
}

.doc-body ul {
  margin: 0 0 16px;
  padding-left: 22px;
}

.doc-body li {
  margin-bottom: 8px;
  color: #111827;
}

.doc-body strong {
  color: var(--text);
  font-weight: 700;
}

.doc-body a {
  font-weight: 500;
  word-break: break-all;
}

.doc-callout {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  color: #111827;
  font-size: 14px;
}

.doc-callout a {
  word-break: break-all;
}

.doc-figure {
  margin: 22px 0 28px;
  text-align: center;
}

.doc-figure img {
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  background: #fff;
}

.doc-figure figcaption {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 10px;
}

.doc-figure--no-caption figcaption {
  display: none;
}

.toc {
  margin-top: 36px;
  padding: 22px 24px;
  background: linear-gradient(180deg, #ffffff 0%, #faf5ff 100%);
  border: 1px solid #e9d5ff;
  border-radius: var(--radius);
}

.toc-title {
  font-size: 14px;
  font-weight: 800;
  margin: 0 0 12px;
  color: var(--text);
}

.toc-list {
  margin: 0;
  padding-left: 18px;
}

.toc-list li {
  margin-bottom: 8px;
}

.toc-list a {
  font-size: 13px;
  color: #4b5563;
}

.toc-list a:hover,
.toc-list a.active {
  color: var(--brand-dark);
}

.toc-list a.active {
  font-weight: 700;
}

.doc-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
}

.doc-nav a {
  font-size: 13px;
  font-weight: 600;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.15s ease;
  max-width: 46%;
}

.doc-nav a:hover {
  border-color: #c4b5fd;
  background: var(--brand-light);
  text-decoration: none;
  transform: translateY(-1px);
}

.doc-nav-next {
  margin-left: auto;
  text-align: right;
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: block;
  }

  .sidebar-overlay.open {
    display: block;
  }

  .main {
    margin-left: 0;
  }

  .menu-toggle {
    display: block;
  }

  .content {
    padding: 18px 16px 40px;
  }

  .doc-article {
    padding: 22px 18px;
  }

  .hero {
    padding: 36px 18px 42px;
  }

  .hero h1 {
    font-size: 1.625rem;
  }

  .feature-cards {
    margin-left: 0;
    padding-left: 12px;
    grid-template-columns: 1fr;
  }

  .doc-nav a {
    max-width: none;
    flex: 1;
  }

  .team-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
