/* ===================================================================
   星岛梦官网 (xdmeng.sbs) - 知识库与深度教程专用样式
   设计风格：水墨波普与故障艺术（浅色调 · 高阅读性 · 内部导航跳转）
   =================================================================== */

/* 顶部阅读进度条 */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background: linear-gradient(90deg, var(--pop-cyan), var(--pop-magenta), var(--pop-yellow));
  z-index: 999;
  transition: width 0.1s ease-out;
}

/* 知识库 Hero 区域 */
.kb-hero {
  padding: 60px 0 40px;
  text-align: center;
  position: relative;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-light);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--ink-dark);
  text-decoration: none;
}

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

.breadcrumb-separator {
  color: var(--ink-mist);
}

/* 文章头部 */
.article-header {
  padding: 40px 0 30px;
  border-bottom: 2px dashed rgba(15, 23, 42, 0.15);
  margin-bottom: 40px;
}

.article-meta-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.article-title {
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 20px;
  color: var(--ink-black);
}

.article-meta-bottom {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-light);
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 文章主体双栏布局 (目录 + 正文) */
.article-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  align-items: flex-start;
  margin-bottom: 60px;
}

/* 侧边大纲目录 (Sticky TOC) */
.article-toc-wrapper {
  position: sticky;
  top: 96px;
  background: #ffffff;
  border: var(--ink-border);
  box-shadow: var(--pop-shadow-solid);
  border-radius: var(--radius-md);
  padding: 22px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.toc-title {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1.5px solid rgba(15, 23, 42, 0.1);
  padding-bottom: 8px;
}

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

.toc-link {
  text-decoration: none;
  color: var(--ink-medium);
  font-weight: 600;
  display: block;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  transition: all var(--transition-fast);
  line-height: 1.4;
}

.toc-link:hover,
.toc-link.active {
  color: var(--ink-black);
  background: rgba(0, 194, 255, 0.12);
  border-left: 3px solid var(--pop-cyan);
  padding-left: 10px;
}

.toc-sublink {
  padding-left: 18px;
  font-size: 0.82rem;
  color: var(--ink-light);
}

/* 文章正文排版 */
.article-content {
  background: #ffffff;
  border: var(--ink-border);
  box-shadow: var(--pop-shadow-solid);
  border-radius: var(--radius-md);
  padding: 44px 40px;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--ink-dark);
}

.article-content h2 {
  font-size: 1.7rem;
  font-weight: 900;
  margin: 40px 0 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink-black);
  display: flex;
  align-items: center;
  gap: 10px;
}

.article-content h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 28px 0 14px;
  color: var(--ink-black);
}

.article-content p {
  margin-bottom: 20px;
}

.article-content ul,
.article-content ol {
  margin: 16px 0 24px 24px;
}

.article-content li {
  margin-bottom: 10px;
}

.article-content strong {
  color: var(--ink-black);
  font-weight: 800;
}

/* 知识提示框 (Callouts) */
.callout {
  padding: 20px 24px;
  border-radius: var(--radius-sm);
  border: var(--ink-border);
  margin: 28px 0;
  font-size: 0.95rem;
  line-height: 1.65;
  position: relative;
}

.callout-info {
  background: #f0f9ff;
  border-left: 6px solid var(--pop-cyan);
  box-shadow: 3px 3px 0px rgba(0, 194, 255, 0.4);
}

.callout-warning {
  background: #fffbeb;
  border-left: 6px solid var(--pop-yellow);
  box-shadow: 3px 3px 0px rgba(255, 183, 3, 0.4);
}

.callout-danger {
  background: #fff1f2;
  border-left: 6px solid var(--pop-magenta);
  box-shadow: 3px 3px 0px rgba(255, 42, 109, 0.4);
}

/* 对比表格 */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 28px 0;
}

.styled-table {
  width: 100%;
  border-collapse: collapse;
  border: var(--ink-border);
  font-size: 0.92rem;
  background: #ffffff;
}

.styled-table th {
  background: #f1f5f9;
  border: 1px solid var(--ink-black);
  padding: 12px 16px;
  font-weight: 800;
  text-align: left;
}

.styled-table td {
  border: 1px solid rgba(15, 23, 42, 0.15);
  padding: 12px 16px;
}

.styled-table tr:hover {
  background: #f8fafc;
}

/* 代码与快捷配置框 */
.code-block {
  background: #0f172a;
  color: #f8fafc;
  border: 2px solid var(--ink-black);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  font-family: monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 24px 0;
  overflow-x: auto;
}

/* 内部跳转卡片与横幅 */
.internal-jump-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
  border: var(--ink-border);
  box-shadow: var(--pop-shadow-solid);
  border-radius: var(--radius-md);
  padding: 28px;
  margin: 40px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.jump-card-info h4 {
  font-size: 1.25rem;
  margin-bottom: 6px;
}

.jump-card-info p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-medium);
}

/* 底部相关文章与上一篇/下一篇 */
.article-nav-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 2px dashed rgba(15, 23, 42, 0.15);
}

.nav-link-box {
  background: #ffffff;
  border: var(--ink-border);
  box-shadow: var(--pop-shadow-solid);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
}

.nav-link-box:hover {
  transform: translate(-3px, -3px);
  box-shadow: var(--pop-shadow-solid-lg);
  border-color: var(--pop-cyan);
}

.nav-link-type {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ink-light);
  margin-bottom: 6px;
}

.nav-link-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--ink-black);
}

@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
  .article-toc-wrapper {
    display: none;
  }
  .article-content {
    padding: 28px 20px;
  }
  .article-title {
    font-size: 2rem;
  }
  .article-nav-links {
    grid-template-columns: 1fr;
  }
}
