/* coursegen-gpu-style-chapter-shell-v2 */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
    background: linear-gradient(135deg, #e8f4f8 0%, #d1e9f0 100%);
    color: #1f2937;
    font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    line-height: 1.78;
    padding: 20px;
    -webkit-text-fill-color: currentColor;
}
.double-border {
    max-width: 1400px;
    margin: 0 auto;
    background: #ffffff;
    border: 2px solid #f1c40f;
    border-radius: 24px;
    box-shadow: 0 20px 30px -15px rgba(0, 0, 0, 0.2), inset 0 1px 0 0 #fff8e0;
    overflow: hidden;
}
.container {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 0;
    width: min(100%, 1300px);
    max-width: calc(100vw - 32px);
    min-width: 0;
    margin-left: auto;
    margin-right: auto;
}
.sidebar {
    background: #fefcf5;
    border-right: 2px solid #fdebb3;
    padding: 24px 16px;
    min-width: 220px;
    max-width: 280px;
}
.sidebar h3 {
    color: #b45f06;
    font-size: 1.4rem;
    border-left: 5px solid #f39c12;
    padding-left: 15px;
    margin-bottom: 25px;
}
.chapter-list {
    list-style: none;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}
.chapter-list li {
    margin-bottom: 6px;
}
.chapter-list a {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    color: #2c3e50;
    border-radius: 12px;
    transition: all 0.2s;
    font-weight: 500;
    overflow-wrap: anywhere;
    -webkit-text-fill-color: currentColor;
}
.chapter-list a:hover {
    background: #fdebd0;
    transform: translateX(3px);
}
.chapter-list .active {
    background: #3b82f6;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: 0 2px 5px rgba(59, 130, 246, 0.3);
}
.main-content {
    min-width: 0;
    padding: 30px 35px;
    background: #ffffff;
}
.course-title-top {
    text-align: center;
    color: #1e3a8a;
    font-size: 1.9rem;
    font-weight: 800;
    margin: 4px 0 24px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.main-content,
.chapter-content,
.chapter-content article,
.chapter-content section {
    min-width: 0;
    color: #1f2937;
}
.chapter-content h2 {
    color: #1e3a8a;
    border-left: 6px solid #f59e0b;
    padding-left: 15px;
    margin: 20px 0 15px;
    overflow-wrap: anywhere;
}
.chapter-content h3 {
    color: #2c3e50;
    margin: 20px 0 10px;
    overflow-wrap: anywhere;
}
.chapter-content p {
    margin: 12px 0;
    color: #1f2937;
    overflow-wrap: anywhere;
}
.chapter-content ul,
.chapter-content ol {
    margin: 12px 0 16px 1.3em;
    padding-left: 1.1em;
}
.chapter-content li {
    margin: 6px 0;
    color: #1f2937;
    overflow-wrap: anywhere;
}
.chapter-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    background: #fefce8;
    color: #1f2937;
}
.chapter-content th,
.chapter-content td {
    border: 1px solid #fcd34d;
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}
.chapter-content th {
    background: #fffbeb;
    color: #111827;
}
.chapter-content pre {
    background: #2d2f36;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 12px;
    overflow-x: auto;
    font-family: "JetBrains Mono", Consolas, "Courier New", monospace;
    margin: 15px 0;
}
.chapter-content pre,
.chapter-content pre * {
    -webkit-text-fill-color: currentColor;
}
.chapter-content code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.95em;
}
.chapter-content code:not(pre code) {
    color: #7c2d12;
    -webkit-text-fill-color: currentColor;
}
.chapter-content img,
.chapter-content video,
.chapter-content canvas,
.chapter-content svg {
    max-width: 100%;
    height: auto;
}
.chapter-content svg {
    display: block;
    margin: 18px auto;
}
.highlight,
.tip,
.warning {
    padding: 12px 18px;
    border-radius: 16px;
    margin: 15px 0;
}
.highlight {
    background: #fef9c3;
    border: 1px solid #facc15;
}
.tip {
    background: #e0f2fe;
    border-left: 6px solid #0ea5e9;
}
.warning {
    background: #fee2e2;
    border-left: 6px solid #ef4444;
}
.footer-nav {
    margin-top: 45px;
    padding-top: 20px;
    border-top: 2px solid #f0e6d2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: nowrap;
    width: 100%;
    clear: both;
}
.footer-nav a {
    min-width: 0;
    padding: 8px 24px;
    background: #f1f5f9;
    text-decoration: none;
    color: #1e40af;
    border-radius: 40px;
    font-weight: 500;
    transition: 0.2s;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
}
.footer-nav a:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}
footer {
    width: 100%;
    text-align: center;
    margin-top: 30px;
    padding: 15px 0 0;
    color: #64748b;
    border-top: 1px dashed #e2e8f0;
    font-size: 0.9rem;
}
@media (max-width: 820px) {
    body { padding: 12px; }
    .container {
        grid-template-columns: 1fr;
        max-width: 100%;
    }
    .sidebar {
        max-width: none;
        min-width: 0;
        border-right: 0;
        border-bottom: 2px solid #fdebb3;
    }
    .main-content {
        padding: 24px 18px;
    }
    .footer-nav {
        flex-wrap: wrap;
        gap: 10px;
    }
    .footer-nav a {
        flex: 1 1 100%;
    }
}

    

/* coursegen-layout-guard-v2 */
html, body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}
.page-wrapper, .course-wrapper, .course-container, .chapter-wrapper {
    width: min(1400px, 100%) !important;
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
.page-inner, .course-layout, .chapter-layout, .main-layout, .content-layout, .content-wrapper {
    display: flex !important;
    align-items: stretch !important;
    gap: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
}
.sidebar, aside.sidebar, .toc-sidebar, .catalog-sidebar, .chapter-sidebar, .chapter-list {
    flex: 0 0 clamp(220px, 20vw, 280px) !important;
    width: clamp(220px, 20vw, 280px) !important;
    min-width: 220px !important;
    max-width: 280px !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    overflow-y: visible !important;
    position: relative !important;
    top: auto !important;
    align-self: stretch !important;
}
.main-content, main.main-content, .chapter-content, .content-main, .article-content {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    overflow: visible !important;
}
.main-content > *, .chapter-content > *, .content-main > *, .article-content > * {
    max-width: 100% !important;
}
svg, img, video, canvas {
    max-width: 100% !important;
    height: auto !important;
}
pre, code {
    white-space: pre-wrap !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}
table {
    max-width: 100% !important;
}
.table-wrap, .code-wrap, .svg-container {
    max-width: 100% !important;
    overflow-x: auto !important;
}
@media (max-width: 820px) {
    .page-inner, .course-layout, .chapter-layout, .main-layout, .content-layout, .content-wrapper {
        display: block !important;
    }
    .sidebar, aside.sidebar, .toc-sidebar, .catalog-sidebar, .chapter-sidebar, .chapter-list {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        overflow-y: visible !important;
        position: relative !important;
    }
    .main-content, main.main-content, .chapter-content, .content-main, .article-content {
        width: 100% !important;
        min-width: 0 !important;
    }
}
