/* ==========================================================================
   闪连VPN - 知识库与教程中心专用样式 (Knowledge Base & Tutorial System)
   特性：极简排版、高可读性、技术文档流、侧边栏目录跳转、排障诊断卡片
   ========================================================================== */

.kb-page {
  background-color: #F8FAFC;
  min-height: 100vh;
}

/* 知识库导航与面包屑 */
.kb-breadcrumb-bar {
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-light);
  padding: 12px 0;
  font-size: 0.85rem;
  font-family: var(--font-mono);
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  color: var(--text-muted);
}

.breadcrumb-list a {
  color: var(--text-main);
  text-decoration: none;
}

.breadcrumb-list a:hover {
  text-decoration: underline;
}

.breadcrumb-separator {
  color: var(--text-light);
}

/* 知识库首页 Hero */
.kb-hero-section {
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-light);
  padding: 60px 0 40px;
  text-align: center;
}

.kb-search-box {
  max-width: 580px;
  margin: 28px auto 0;
  position: relative;
}

.kb-search-input {
  width: 100%;
  padding: 14px 20px 14px 44px;
  font-size: 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  outline: none;
  background: var(--bg-secondary);
  transition: all var(--transition-fast);
}

.kb-search-input:focus {
  background: #FFFFFF;
  border-color: var(--accent-black);
  box-shadow: var(--shadow-sm);
}

.kb-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* 知识库分类标签栏 */
.kb-category-filter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 32px 0;
  flex-wrap: wrap;
}

.kb-cat-btn {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.kb-cat-btn:hover, .kb-cat-btn.active {
  background: var(--accent-black);
  color: #FFFFFF;
  border-color: var(--accent-black);
}

/* 文章列表网格 */
.kb-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  margin-bottom: 80px;
}

.kb-article-card {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-fast);
  position: relative;
}

.kb-article-card:hover {
  border-color: var(--text-main);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.article-card-header {
  margin-bottom: 12px;
}

.article-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.article-tag {
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: 4px;
  color: #334155;
  font-weight: 600;
}

.article-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 10px;
}

.article-card-excerpt {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}

.article-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  padding-top: 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.read-more-link {
  font-weight: 700;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   单篇长文技术文档布局 (Article Detail Layout)
   ========================================================================== */
.article-detail-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  padding: 48px 0 96px;
  align-items: start;
}

/* 侧边栏目录 */
.article-toc-sidebar {
  position: sticky;
  top: 96px;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.toc-title {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 14px;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 6px;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.88rem;
}

.toc-list a {
  color: var(--text-muted);
  text-decoration: none;
  display: block;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all var(--transition-fast);
  line-height: 1.4;
}

.toc-list a:hover {
  background: var(--bg-tertiary);
  color: var(--text-main);
}

/* 侧边栏快捷转化卡片 */
.sidebar-cta-card {
  margin-top: 24px;
  background: var(--accent-black);
  color: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.sidebar-cta-card h5 {
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.sidebar-cta-card p {
  font-size: 0.78rem;
  color: #CBD5E1;
  margin-bottom: 12px;
}

.sidebar-cta-card .btn {
  width: 100%;
  font-size: 0.8rem;
  padding: 8px;
}

/* 文章正文区域 */
.article-main-content {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 48px;
  box-shadow: var(--shadow-sm);
  color: #1E293B;
  line-height: 1.85;
}

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

.article-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 16px;
}

.article-meta-info {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

/* 深度长文正文排版规范 */
.article-body h2 {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
  letter-spacing: -0.02em;
}

.article-body h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 28px 0 12px;
}

.article-body p {
  margin-bottom: 20px;
  font-size: 1rem;
  color: #334155;
}

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

.article-body ul, .article-body ol {
  margin: 0 0 24px 24px;
  color: #334155;
}

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

/* 提示警示框 */
.article-callout {
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin: 28px 0;
  font-size: 0.95rem;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.callout-info {
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
  color: #0369A1;
}

.callout-warning {
  background: var(--status-warning-bg);
  border: 1px solid #FDE68A;
  color: #B45309;
}

.callout-danger {
  background: var(--status-danger-bg);
  border: 1px solid var(--status-danger-border);
  color: #991B1B;
}

/* 性能参数对比表格 */
.article-table-wrap {
  overflow-x: auto;
  margin: 28px 0;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.comparison-table th, .comparison-table td {
  padding: 12px 16px;
  border: 1px solid var(--border-light);
}

.comparison-table th {
  background: var(--bg-secondary);
  font-weight: 700;
  color: var(--text-main);
}

.comparison-table tr:nth-child(even) td {
  background: #FAFAFA;
}

/* 配置代码块 */
.code-block-wrap {
  background: #09090B;
  color: #E2E8F0;
  border-radius: var(--radius-md);
  padding: 18px;
  margin: 24px 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  overflow-x: auto;
  line-height: 1.6;
}

/* 文章结尾强力解药推荐卡片 */
.article-end-solution {
  margin-top: 48px;
  padding: 32px;
  background: var(--bg-secondary);
  border: 2px solid var(--text-main);
  border-radius: var(--radius-lg);
  text-align: center;
}

.article-end-solution h3 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.article-end-solution p {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 20px;
}

@media (max-width: 900px) {
  .article-detail-layout {
    grid-template-columns: 1fr;
  }
  .article-toc-sidebar {
    display: none;
  }
  .article-main-content {
    padding: 24px 18px;
  }
  .article-title {
    font-size: 1.7rem;
  }
}
