* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* 主容器：1200px 居中 + 纯白背景 */
.course-wrapper {
    width: 1400px;
    margin: 0 auto;
    display: flex;
    background: #ffffff;
    min-height: 100vh;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* ===================================
 左侧目录（优雅精致）
=================================== */
/* 左侧导航 —— 最终清爽版 */
.course-nav-left {
    background: #ffffff;
    border-right: 1px solid #f0f0f0;
    padding: 20px 12px;
    width: 240px;
    /* 滚动固定核心样式 */
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    box-sizing: border-box;
}
.course-nav-left h3 {
    font-size: 16px;
    color: #222;
    margin: 0 0 14px 4px;
    font-weight: 600;
}
.course-nav-left .course-nav-main {
    list-style: none;
    padding: 0;
    margin: 0;
}
.course-nav-left .nav-item {
    margin-bottom: 2px;
}

/* 一级菜单 —— 清爽无背景 */
.course-nav-left .nav-item-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    color: #333;
    transition: all 0.2s;
}
.course-nav-left .nav-item a {
    color: inherit;
    text-decoration: none;
}
.course-nav-left .nav-item a:hover {
    color: #1677ff;
}

/* 箭头 靠右 */
.course-nav-left .nav-arrow {
    font-size: 10px;
    color: #999;
    transition: transform 0.2s;
    margin-left: 6px;
}
.course-nav-left .nav-open .nav-arrow {
    transform: rotate(90deg);
}

/* 一级菜单激活高亮 */
.course-nav-left .nav-item-title.course-active {
    color: #1677ff;
    font-weight: 500;
}

/* 二级菜单 */
.course-nav-left .nav-children {
    list-style: none;
    padding-left: 16px;
    margin: 2px 0 6px;
    display: none;
}
.course-nav-left .nav-open .nav-children {
    display: block;
}
.course-nav-left .nav-children li {
    padding: 0;
    margin: 0;
}
.course-nav-left .nav-children a {
    display: block;
    padding: 6px 10px;
    font-size: 13px;
    color: #555;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
}
.course-nav-left .nav-children a:hover {
    color: #1677ff;
}
.course-nav-left .nav-children a.course-active {
    color: #1677ff;
    font-weight: 500;
}
/* 一级菜单 hover 样式 */
.course-nav-left .nav-item-title:hover {
    background: #f5f7fa;
    color: #1677ff;
}
/* 一级菜单激活态 */
.course-nav-left .nav-item-title.course-active {
    background: #e6f7ff;
    color: #1677ff;
    font-weight: 500;
}

/* 二级菜单 hover 样式 */
.course-nav-left .nav-children a:hover {
    background: #f5f7fa;
    color: #1677ff;
}
/* 二级菜单激活态 */
.course-nav-left .nav-children a.course-active {
    background: #e6f7ff;
    color: #1677ff;
    font-weight: 500;
}
.course-nav-left .nav-item-title {
    border-radius: 6px;
    padding: 8px 10px;
}
.course-nav-left .nav-children a {
    border-radius: 6px;
    padding: 6px 10px;
}
/* ===================================
 中间内容（舒适排版）
=================================== */
.course-content-main {
    flex: 1;
    padding: 40px 48px;
    background: #ffffff;
    min-height: 100vh;
}

.course-content-main h1,
.course-content-main h2,
.course-content-main h3 {
    color: #111827;
    font-weight: 600;
    margin: 32px 0 16px;
    line-height: 1.4;
}

.course-content-main h1 { font-size: 26px; margin-top: 0; }
.course-content-main h2 { font-size: 22px; }
.course-content-main h3 { font-size: 19px; }

.course-content-main p {
    font-size: 15px;
    color: #374151;
    margin: 0 0 20px;
    line-height: 1.8;
}

.course-content-main img {
    max-width: 100%;
    border-radius: 8px;
    margin: 20px 0;
}

/* 👇 绝对不覆盖你的主题 */
.course-content-main pre {
    margin: 24px 0;
    border-radius: 8px;
    overflow-x: auto;
}

.course-content-main code {
    font-family: Menlo, Monaco, "Courier New", monospace;
}

/* ===================================
 右侧目录（优雅精致）
=================================== */
.course-toc-right {
    width: 220px;
    padding: 28px 20px;
    border-left: 1px solid #f3f4f6;
    background: #ffffff;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
}

.course-toc-right h3 {
    font-size: 16px;
    color: #111827;
    margin-bottom: 20px;
    font-weight: 600;
    padding-left: 4px;
}

.course-toc-right ul {
    list-style: none;
}

.course-toc-right li {
    padding: 8px 12px;
    color: #4b5563;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.course-toc-right li:hover {
    background: #f3f4f6;
    color: #111827;
}

.course-toc-right li.course-active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 500;
}

.article-base-info {
    text-align: right;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    font-size: 14px;
    color: #999;
}
.article-base-info span {
    margin-left: 15px;
}