.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  color: var(--color-text);
}

.content-area.with-sidebar {
  border-left: 1px solid var(--color-border);
}

.content-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 1.75rem clamp(2rem, 5vw, 3rem) 1.25rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 0.8rem;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.breadcrumb-separator {
  color: rgba(31, 42, 68, 0.3);
}

.breadcrumb-text {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(58, 122, 254, 0.08);
}

.content-title {
  margin: 0;
  font-size: clamp(2rem, 3.5vw, 2.6rem);
  font-weight: 600;
  color: var(--color-text);
}

.content-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  padding: clamp(2rem, 6vw, 3.5rem);
}

.markdown-pane {
  width: min(860px, 100%);
}

.markdown-content {
  line-height: 1.75;
  font-size: 1rem;
}

.markdown-content > *:first-child {
  margin-top: 0;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
  margin: 2rem 0 1rem;
  font-weight: 600;
  color: var(--color-text);
  position: relative;
}

.markdown-content h1 {
  font-size: clamp(2.1rem, 3vw, 2.8rem);
  border-bottom: 2px solid rgba(31, 42, 68, 0.08);
  padding-bottom: 0.6rem;
}

.markdown-content h2 {
  font-size: clamp(1.7rem, 2.5vw, 2.2rem);
  border-bottom: 1px solid rgba(31, 42, 68, 0.08);
  padding-bottom: 0.45rem;
}

.markdown-content h3 {
  font-size: clamp(1.4rem, 2vw, 1.7rem);
}

.markdown-content h4 {
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}

.heading-anchor {
  position: absolute;
  left: -1.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: rgba(31, 42, 68, 0.35);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.markdown-content h1:hover .heading-anchor,
.markdown-content h2:hover .heading-anchor,
.markdown-content h3:hover .heading-anchor,
.markdown-content h4:hover .heading-anchor {
  opacity: 1;
  transform: translate(-4px, -50%);
}

.markdown-content p,
.markdown-content ul,
.markdown-content ol,
.markdown-content blockquote,
.markdown-content pre,
.markdown-content table {
  margin: 0 0 1.35rem;
}

.markdown-content ul,
.markdown-content ol {
  padding-left: 1.5rem;
}

.markdown-content li + li {
  margin-top: 0.4rem;
}

.markdown-content a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.inline-code {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: rgba(58, 122, 254, 0.08);
  border: 1px solid rgba(58, 122, 254, 0.16);
  color: var(--color-text);
  font-size: 0.95em;
}

.code-block-wrapper {
  background: #f6f8ff;
  border: 1px solid rgba(58, 122, 254, 0.15);
  border-radius: 14px;
  overflow: hidden;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(58, 122, 254, 0.08);
  color: var(--color-muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.code-copy-button {
  border: 1px solid rgba(58, 122, 254, 0.25);
  background: #fff;
  color: var(--color-muted);
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.code-copy-button:hover {
  color: var(--color-accent);
  border-color: rgba(58, 122, 254, 0.5);
}

.code-copy-button.copied {
  color: var(--color-accent);
  border-color: rgba(58, 122, 254, 0.7);
}

pre {
  margin: 0;
  padding: 1.1rem 1.35rem;
  overflow-x: auto;
  font-size: 0.95rem;
}

pre code {
  background: transparent !important;
  color: #1f2a44;
}

.markdown-image {
  margin: 1.6rem 0;
  text-align: center;
}

.markdown-image img {
  border-radius: 14px;
  border: 1px solid rgba(31, 42, 68, 0.1);
  box-shadow: 0 18px 38px rgba(31, 42, 68, 0.12);
}

.markdown-image figcaption {
  margin-top: 0.55rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.markdown-content blockquote {
  margin: 1.6rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid rgba(58, 122, 254, 0.45);
  background: rgba(58, 122, 254, 0.1);
  border-radius: 0 14px 14px 0;
  color: var(--color-text);
}

.markdown-content hr {
  border: none;
  border-top: 1px dashed rgba(31, 42, 68, 0.12);
  margin: 2.25rem 0;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid rgba(31, 42, 68, 0.12);
  background: #ffffff;
}

.table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.table-wrapper th,
.table-wrapper td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(31, 42, 68, 0.1);
  text-align: left;
}

.table-wrapper th {
  color: var(--color-muted);
  font-weight: 600;
}

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

.external-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.external-link-icon {
  font-size: 0.8rem;
}

.loading-content {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 3rem 0;
  color: var(--color-muted);
}

.loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(111, 123, 146, 0.25);
  border-top: 2px solid var(--color-accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.welcome-message {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 6vw, 4rem);
  min-height: calc(100vh - 7rem);
}

.welcome-content {
  text-align: center;
  max-width: 520px;
  padding: 2.4rem;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  box-shadow: 0 24px 48px rgba(86, 105, 141, 0.18);
}

.welcome-content h1 {
  margin-bottom: 0.9rem;
  font-size: clamp(2.1rem, 3.2vw, 2.6rem);
}

.welcome-content p {
  margin: 0 auto 1.6rem;
  color: var(--color-muted);
}

.welcome-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.8rem;
}

.feature-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  color: var(--color-muted);
}

.feature-icon {
  font-size: 1.1rem;
}

@media (max-width: 768px) {
  .content-header {
    padding: 1.2rem 1.5rem 0.9rem;
  }

  .content-body {
    padding: 1.5rem;
  }

  .markdown-pane {
    width: 100%;
  }

  .heading-anchor {
    display: none;
  }
}

@media (max-width: 480px) {
  .content-header {
    padding: 1rem 1.1rem 0.75rem;
  }

  .content-body {
    padding: 1rem;
  }

  .feature-item {
    flex-direction: column;
  }
}
