/* =========================================================
   清晨教育 - 知识库内页（文章详情页）样式
   依赖 style.css 设计变量与 knowledge.css 面包屑样式
   ========================================================= */

/* ---------- 面包屑条 ---------- */
.art-crumb-bar {
  padding: 22px 0 0;
}

/* ---------- 主体布局：文章 + 侧边栏 ---------- */
.art-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  padding-top: 20px;
  padding-bottom: 64px;
  align-items: start;
}

/* ---------- 文章主体 ---------- */
.art-main {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 40px 40px;
  box-shadow: var(--shadow);
}

/* 顶部推广横幅 */
.art-promo {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 30px;
}
.art-promo img { display: block; width: 100%; height: auto; }

/* 标题与 meta */
.art-head { margin-bottom: 26px; }
.art-head h1 {
  font-size: 24px;
  color: var(--blue-deep);
  margin-bottom: 16px;
  line-height: 1.35;
}
.art-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 13px;
  color: var(--text-sub);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.art-meta em { font-style: normal; color: var(--blue); }

/* 正文排版 */
.art-body { font-size: 14px; line-height: 1.9; color: var(--text); }
/* 正文视频：手机端铺满内容宽度，高度按视频比例自适应 */
.art-body video {
  display: block;
  width: 100% !important;
  max-width: 100%;
  height: auto !important;
}
.art-body h2 {
  font-size: 18px;
  color: var(--blue-deep);
  margin: 34px 0 14px;
  padding-left: 12px;
  border-left: 4px solid var(--blue);
  line-height: 1.4;
}
.art-body p { margin-bottom: 14px; }
.art-figure { margin: 20px 0 24px; }
.art-figure img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.art-figure figcaption {
  text-align: center;
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 10px;
}

/* 文内讲师推广条 */
.art-teacher-strip {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  margin: 30px 0 8px;
}
.art-teacher-strip img { display: block; width: 100%; height: auto; }

/* ---------- 上一篇 / 下一篇 ---------- */
.art-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.art-pager-item {
  display: block;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  transition: var(--transition);
}
.art-pager-item:hover { border-color: var(--blue); background: var(--blue-light); }
.art-pager-item.next { text-align: right; }
.art-pager-label {
  display: block;
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 6px;
}
.art-pager-title {
  display: block;
  font-size: 15px;
  color: var(--blue-deep);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.art-pager-item:hover .art-pager-title { color: var(--blue); }

/* ---------- 相关内容 ---------- */
.art-related { margin-top: 36px; }
.art-related-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.art-related-head h2 {
  font-size: 20px;
  color: var(--blue-deep);
  padding-left: 12px;
  border-left: 4px solid var(--blue);
  line-height: 1.4;
}
.art-related-more {
  font-size: 14px;
  color: var(--blue);
  transition: var(--transition);
}
.art-related-more:hover { color: var(--blue-dark); }
.art-related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.art-related-card a {
  display: block;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  height: 100%;
  transition: var(--transition);
}
.art-related-card a:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}
.art-related-card img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
}
.art-related-body { padding: 14px 14px 16px; }
.art-related-body h3 {
  font-size: 14px;
  color: var(--blue-deep);
  line-height: 1.45;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.art-related-body p {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.6;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.art-related-body time { font-size: 12px; color: var(--text-sub); }

/* ---------- 右侧侧边栏 ---------- */
.art-sidebar {
  position: sticky;
  top: 92px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.side-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.side-title {
  font-size: 17px;
  color: var(--blue-deep);
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
  position: relative;
}
.side-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 16px;
  background: var(--blue);
  border-radius: 2px;
  margin-right: 8px;
  vertical-align: -2px;
}
.side-list { padding: 8px 0; }
.side-item a {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  transition: var(--transition);
}
.side-item a:hover { background: var(--blue-light); }
.side-item img {
  width: 108px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}
.side-item-body h3 {
  font-size: 14px;
  color: var(--blue-deep);
  margin-bottom: 6px;
  line-height: 1.35;
}
.side-item a:hover .side-item-body h3 { color: var(--blue); }
.side-item-body p {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 1024px) {
  .art-layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; }
  .art-main { padding: 28px 24px 32px; }
  .art-related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .art-layout { grid-template-columns: 1fr; padding-bottom: 48px; }
  .art-sidebar { position: static; }
  .art-head h1 { font-size: 24px; }
  .art-body { font-size: 15px; }
  .art-pager { grid-template-columns: 1fr; }
  .art-pager-item.next { text-align: left; }
  .art-related-grid { grid-template-columns: 1fr; }
  .side-item a { grid-template-columns: 120px 1fr; }
  .side-item img { width: 120px; height: 80px; }

  /* 手机端隐藏文章底部“相关内容”，其余模块保持不变 */
  .art-related { display: none; }
}
/* ---------- 文章内容课程推荐 ---------- */
 * { box-sizing: border-box; margin: 0; padding: 0; }

    body {
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        background-color: #f5f5f5;
    }

    .course-container {
        margin: 0 auto;
        background-color: #ffffff;
        border: 1px solid #e4e7ed;
        border-radius: 4px;
        overflow: hidden;
    }

    /* 顶部标题栏 */
    .course-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        border-bottom: 1px solid #ebeef5;
    }

    .course-header h2 { font-size: 16px; font-weight: 600; color: #303133; }
    .course-header span { font-size: 13px; color: #909399; }

    /* 课程列表 */
    .course-list { list-style: none; counter-reset: course-counter; }

    .course-item {
        display: flex;
        align-items: center;
        padding: 16px 20px;
        border-bottom: 1px solid #ebeef5;
        transition: background-color 0.2s;
        counter-increment: course-counter;
    }

    .course-item:last-child { border-bottom: none; }
    .course-item.hidden { display: none; }

    /* 序号样式 */
    .item-number {
        width: 28px;
        height: 28px;
        border: 1px solid #dcdfe6;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 13px;
        color: #606266;
        margin-right: 16px;
        flex-shrink: 0;
    }

    .item-number::before { content: counter(course-counter, decimal-leading-zero); }

    /* 课程信息 */
    .item-info { flex: 1; display: flex; flex-direction: column; justify-content: center; }
    .item-title { font-size: 14px; margin-bottom: 6px; }

    .item-title a {
        color: #303133;
        text-decoration: none;
        transition: color 0.2s ease;
        display: inline-block;
    }

    .item-title a:hover { color: #409eff; }
    .item-subtitle { font-size: 12px; color: #909399; }

    /* 时长样式 */
    .item-duration { font-size: 13px; color: #909399; margin-left: 16px; flex-shrink: 0; }

    /* 激活状态（当前页面）样式 */
    .course-item.active { background-color: #f0f7ff; }

    .course-item.active .item-number {
        background-color: #409eff;
        border-color: #409eff;
        color: #ffffff;
    }

    .course-item.active .item-title a { color: #409eff; font-weight: 500; }
    .course-item.active .item-subtitle { color: #409eff; opacity: 0.8; }

    /* 查看更多/收起按钮样式 */
    .load-more-container {
        text-align: center;
        padding: 20px 0;
        border-top: 1px solid #ebeef5;
        display: none;
    }

    .load-more-btn {
        padding: 8px 24px;
        background-color: #f4f8fe;
        color: #409eff;
        border: 1px solid #409eff;
        border-radius: 20px;
        cursor: pointer;
        font-size: 14px;
        font-weight: 500;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        margin: 0 auto;
    }

    .load-more-btn:hover { background-color: #409eff; color: #ffffff; }
    .load-more-btn .icon { font-size: 12px; transition: transform 0.3s ease; }
    .load-more-btn.expanded .icon { transform: rotate(180deg); }
/* 文章正文表格整体样式 */
.art-body table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin: 16px 0 24px;
    line-height: 1.7;
    color: #333;
    background-color: #fff;
    border: 1px solid #e5e7eb;
    /* 如果模板有冲突，可保留 !important */
    /* border: 1px solid #e5e7eb !important; */
}

/* 表头和单元格：边框 + 内边距，让内容离左边框有距离 */
.art-body table th,
.art-body table td {
    padding: 10px 14px;          /* 上下10px，左右14px */
    padding-left: 16px;          /* 内容与左边框的间隔再大一点 */
    border: 1px solid #e5e7eb;   /* 柔和灰色边框 */
    text-align: left;
    vertical-align: middle;
    word-break: break-word;
}

/* 表头样式：浅色背景 + 深色文字，更清晰 */
.art-body table th {
    background-color: #f8fafc;
    color: #334155;
    font-weight: 600;
    white-space: nowrap;         /* 表头尽量不换行，可根据需要删除 */
}

/* 斑马纹：偶数行浅灰背景，提升可读性 */
.art-body table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

/* 鼠标悬停高亮 */
.art-body table tbody tr:hover {
    background-color: #f1f5f9;
}

/* 可选：表格在小屏幕下横向滚动，避免撑破页面 */
.art-body .table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 可选：小屏幕下适当缩小内边距 */
@media (max-width: 768px) {
    .art-body table th,
    .art-body table td {
        padding: 8px 10px;
        padding-left: 12px;
        font-size: 13px;
    }
}
