body {
  background: var(--bg);
  padding-top: 0;
}

.docs-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.docs-layout {
  display: flex;
  gap: 48px;
  min-height: 100vh;
  padding-top: 80px;
}

/* Sidebar */
.docs-sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
  height: calc(100vh - 80px);
  overflow-y: auto;
  padding-bottom: 40px;
  scrollbar-width: thin;
}

.sidebar-section {
  margin-bottom: 28px;
}

.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-left: 12px;
}

.sidebar-link {
  display: block;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.15s;
}

.sidebar-link:hover {
  color: var(--text);
  background: rgba(167, 139, 250, 0.08);
}

.sidebar-link.active {
  color: #7c3aed;
  background: rgba(167, 139, 250, 0.1);
  font-weight: 600;
}

/* Content */
.docs-content {
  flex: 1;
  min-width: 0;
  max-width: 820px;
  padding-bottom: 80px;
}

.docs-section {
  padding: 32px 0 40px;
  border-bottom: 1px solid var(--border);
}

.docs-section:last-child {
  border-bottom: none;
}

.docs-section h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
}

.docs-section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.docs-section h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 24px;
  margin-bottom: 8px;
}

.docs-section p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 12px;
}

/* Notice */
.docs-notice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(253, 230, 138, 0.15);
  border: 1px solid rgba(253, 230, 138, 0.3);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-bottom: 28px;
}

.docs-notice.small {
  padding: 14px 16px;
  margin-top: 16px;
  margin-bottom: 0;
}

.docs-notice-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.docs-notice strong {
  display: block;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}

.docs-notice p {
  font-size: 13.5px;
  margin: 0;
  color: var(--text-muted);
}

/* Tables */
.docs-table-wrapper {
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.docs-table th {
  text-align: left;
  padding: 12px 16px;
  background: rgba(167, 139, 250, 0.06);
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.docs-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
}

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

.docs-table td code {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
  font-weight: 500;
}

/* Status badges */
.status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.status.implemented {
  background: rgba(134, 239, 172, 0.15);
  color: #16a34a;
}

.status.stub {
  background: rgba(253, 230, 138, 0.2);
  color: #d97706;
}

/* Code blocks */
.code-block {
  background: var(--bg-code);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 12px 0 16px;
}

.code-block.small {
  border-radius: 8px;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.code-dot.red { background: #ff5f57; }
.code-dot.yellow { background: #febc2e; }
.code-dot.green { background: #28c840; }

.code-title {
  margin-left: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  font-family: 'Inter', sans-serif;
}

.code-block pre {
  padding: 16px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.code-block pre code {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.code-block code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #e2e0e7;
  line-height: 1.6;
}

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 2;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.copy-btn.copied {
  color: #86efac;
  border-color: rgba(134, 239, 172, 0.3);
  background: rgba(134, 239, 172, 0.1);
}

/* Lists */
.docs-list {
  list-style: none;
  margin: 12px 0 16px;
}

.docs-list li {
  padding: 6px 0 6px 20px;
  position: relative;
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

.docs-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: #7c3aed;
  font-weight: 700;
}

.docs-list li strong {
  color: var(--text);
}

.docs-numbered-list {
  margin: 12px 0 16px;
  padding-left: 20px;
}

.docs-numbered-list li {
  padding: 6px 0;
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

.docs-numbered-list li strong {
  color: var(--text);
}

/* Notes */
.docs-note {
  font-size: 13.5px;
  color: var(--text-light);
  font-style: italic;
  margin-top: 4px;
}

/* Architecture diagram */
.architecture-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: 24px 0;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.arch-layer {
  width: 100%;
  max-width: 500px;
  background: var(--bg-code);
  border-radius: 8px;
  padding: 16px 20px;
  text-align: center;
}

.arch-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7c3aed;
  margin-bottom: 6px;
}

.arch-code {
  font-size: 13px;
  color: #e2e0e7;
  line-height: 1.5;
}

.arch-arrow {
  font-size: 20px;
  color: #7c3aed;
  padding: 4px 0;
}

/* Missing Modules Grid */
.missing-modules-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.missing-module-tag {
  display: inline-block;
  padding: 6px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 500;
  color: #9090a3;
  background: rgba(148, 144, 163, 0.06);
  border: 1px solid rgba(148, 144, 163, 0.15);
  border-radius: 8px;
  transition: all 0.2s;
}

.missing-module-tag:hover {
  background: rgba(148, 144, 163, 0.1);
  border-color: rgba(148, 144, 163, 0.25);
  color: #6c6c80;
}

/* Responsive */
@media (max-width: 1024px) {
  .docs-sidebar {
    display: none;
  }

  .docs-content {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .docs-page {
    padding: 0 16px;
  }

  .docs-layout {
    padding-top: 70px;
  }

  .docs-section h1 {
    font-size: 1.6rem;
  }

  .docs-section h2 {
    font-size: 1.2rem;
  }

  .docs-table {
    font-size: 13px;
  }

  .docs-table th,
  .docs-table td {
    padding: 8px 12px;
  }

  .architecture-diagram {
    padding: 16px;
  }

  .arch-layer {
    padding: 12px 14px;
  }
}

@media (max-width: 480px) {
  .docs-table td code {
    font-size: 12px;
  }
}
