/**
 * 红杏云机场 HongXin Cloud - 知识库与全平台配置手册专用样式
 * 桌面端左侧文章主内容 (72%) + 右侧垂直 Sticky 目录 (28%)
 * 柔嫩杏白底色与深松烟墨高对比度排版 (WCAG AA 达标)
 */

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

.knowledge-header-wrapper {
  background: linear-gradient(180deg, #fff1f2 0%, #fffbfb 100%);
  border-bottom: 1px solid var(--border-spring-split);
  padding: 56px 0 36px;
  position: relative;
}

.knowledge-hero-content {
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}

.knowledge-hero-title {
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.knowledge-hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* 知识库主体双栏布局 (左侧文章 72% + 右侧目录 28%) */
.knowledge-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 72%) minmax(0, 28%);
  gap: 40px;
  padding: 48px 0 88px;
  align-items: flex-start;
}

/* 左侧主内容流 */
.knowledge-articles-stream {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* 单篇文章卡片容器 */
.knowledge-long-article {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 96px;
  position: relative;
}

.knowledge-long-article::before {
  content: "";
  position: absolute;
  top: 0;
  left: 40px;
  width: 64px;
  height: 3px;
  background: var(--primary-cta);
  border-radius: 2px;
}

.article-meta-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.article-num-tag {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--primary-cta);
  background: #fff1f2;
  border: 1px solid rgba(190, 18, 60, 0.2);
  border-radius: var(--radius-pill);
  padding: 3px 12px;
  margin-bottom: 12px;
}

.article-h2-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 10px;
}

.article-lead-text {
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* 正文段落排版 (600-900字长文深度阅读规范) */
.article-prose {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.85;
}

.article-prose p {
  margin-bottom: 18px;
  text-align: justify;
}

.article-prose h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 28px 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.article-prose h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 16px;
  background: var(--primary-cta);
  border-radius: 2px;
}

.article-prose ul, .article-prose ol {
  margin: 14px 0 20px 24px;
  list-style-type: disc;
}

.article-prose li {
  margin-bottom: 8px;
}

/* SEO 锚文本内链规范 */
.seo-inline-link {
  color: var(--primary-cta);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}

.seo-inline-link:hover {
  color: var(--primary-cta-hover);
}

/* 右侧垂直 Sticky 目录 (28%) */
.knowledge-toc-sidebar {
  position: sticky;
  top: 96px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 26px 20px;
  box-shadow: var(--shadow-sm);
}

.toc-header-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--primary-cta);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toc-nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toc-nav-link {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  min-height: 44px;
  border-radius: var(--radius-xs);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.45;
  transition: all var(--transition-fast);
}

.toc-nav-link:hover, .toc-nav-link.active {
  background: #fff1f2;
  color: var(--primary-cta);
}

.toc-index-badge {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary-cta);
  background: rgba(190, 18, 60, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* 响应式适配 */
@media (max-width: 1024px) {
  .knowledge-layout-grid {
    grid-template-columns: 1fr;
  }
  .knowledge-toc-sidebar {
    position: static;
    margin-bottom: 32px;
  }
  .knowledge-long-article {
    padding: 32px 24px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
  .knowledge-long-article {
    padding: 24px 16px;
    border-radius: var(--radius-lg);
  }
  .article-h2-title {
    font-size: 1.35rem;
  }
  .article-prose {
    font-size: 0.95rem;
    line-height: 1.75;
  }
  .knowledge-hero-title {
    font-size: 1.65rem;
  }
}
