/* ============================================================
   课程详情页样式 - lesson.css
   Brand: Red #C8102E | Navy #1B3A5C
   ============================================================ */

/* ========== Lesson Header ========== */
.lesson-header {
    padding: 60px 0 40px;
    background: linear-gradient(135deg, #0a1628 0%, #1B3A5C 50%, #0d2040 100%);
    color: #fff;
}
.lesson-header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
}
.lesson-icon-lg {
    font-size: 4em;
    width: 96px;
    height: 96px;
    background: rgba(255,255,255,0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.lesson-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 700;
    margin-bottom: 8px;
}
.lesson-badge.free { background: var(--red); color: #fff; }
.lesson-header h1 {
    font-size: 2.2em;
    margin-bottom: 8px;
}
.lesson-subtitle {
    color: rgba(255,255,255,0.6);
    font-size: 1em;
}

/* ========== Layout ========== */
.section-narrow { padding: 60px 0; }
.container-wide { max-width: 1400px; }
.lesson-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

/* ========== Sidebar ========== */
.lesson-sidebar {
    position: sticky;
    top: 90px;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 24px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
}
.lesson-sidebar h3 {
    font-size: 1.1em;
    color: var(--dark);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--red);
}
.lesson-toc { list-style: none; padding: 0; margin: 0; }
.toc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9em;
}
.toc-item:last-child { border-bottom: none; }
.toc-link {
    color: var(--navy);
    transition: var(--transition);
}
.toc-link:hover { color: var(--red); }
.toc-item.active .toc-link { color: var(--red); font-weight: 600; }
.toc-item.locked { opacity: 0.5; }
.lock-icon { font-size: 0.8em; }

/* Sidebar CTA */
.sidebar-cta {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}
.sidebar-cta p {
    text-align: center;
    font-size: 0.9em;
    color: var(--gray);
    margin-bottom: 12px;
}
.btn-block { display: block; width: 100%; }

/* Related */
.related-box {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}
.related-box h4 { font-size: 0.95em; margin-bottom: 12px; color: var(--dark); }
.related-item {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.88em;
    color: var(--navy);
    transition: var(--transition);
    margin-bottom: 4px;
}
.related-item:hover { background: var(--red-light); color: var(--red); }
.related-item.locked { opacity: 0.5; pointer-events: none; }

/* ========== Lesson Content ========== */
.lesson-content { min-width: 0; }
.lesson-article { margin-bottom: 64px; }

.article-head { margin-bottom: 32px; }
.article-tag {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    margin-bottom: 12px;
}
.free-tag { background: var(--red-light); color: var(--red); }
.article-head h2 { font-size: 1.8em; margin-bottom: 8px; color: var(--dark); }
.article-meta { color: var(--gray); font-size: 0.9em; }

/* Objective Box */
.objective-box {
    background: linear-gradient(135deg, #fff8f0, #fff5f5);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    border-left: 4px solid var(--red);
}
.objective-box h4 { margin-bottom: 12px; color: var(--dark); }
.objective-box ul { padding-left: 20px; }
.objective-box li { padding: 4px 0; color: #555; }

/* Article Body */
.article-body h3 {
    font-size: 1.4em;
    color: var(--dark);
    margin: 36px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}
.article-body p {
    line-height: 1.8;
    color: #444;
    margin-bottom: 16px;
}

/* Example Card */
.example-card {
    background: var(--light-gray);
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
}
.example-card h4 { margin-bottom: 16px; color: var(--dark); }
.example-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.example-item {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}
.example-icon { font-size: 2em; margin-bottom: 8px; }
.example-item p { font-size: 0.9em; color: #555; line-height: 1.5; margin: 0; }

/* Concept Box */
.concept-box {
    background: var(--navy-light);
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
    border-left: 4px solid var(--navy);
}
.concept-box h4 { margin-bottom: 12px; color: var(--navy); }
.concept-box p, .concept-box li { color: #445; line-height: 1.7; }
.concept-box ul { padding-left: 20px; }

/* Three Elements */
.three-elements {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 24px 0;
}
.element-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow);
    border-top: 3px solid var(--red);
}
.element-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    font-size: 1.2em;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.element-card h5 { color: var(--dark); margin-bottom: 8px; }
.element-card p { font-size: 0.9em; color: #666; line-height: 1.6; }

/* Install Steps */
.install-steps, .training-steps {
    padding-left: 24px;
    margin: 20px 0;
}
.install-steps li, .training-steps li {
    padding: 12px 0;
    line-height: 1.7;
    color: #444;
    border-bottom: 1px dashed #eee;
}
.install-steps li:last-child, .training-steps li:last-child { border-bottom: none; }

/* Tip Boxes */
.tip-box {
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}
.tip-info { background: #eff6ff; border-left: 4px solid #3b82f6; }
.tip-warn { background: #fffbeb; border-left: 4px solid #f59e0b; }
.tip-box h4 { margin-bottom: 8px; }
.tip-box ul { padding-left: 20px; }
.tip-box li { padding: 3px 0; font-size: 0.92em; color: #555; }

/* Code Block */
.code-block {
    background: #1e293b;
    border-radius: 10px;
    padding: 24px;
    margin: 24px 0;
    overflow-x: auto;
}
.code-block pre {
    color: #e2e8f0;
    font-size: 0.88em;
    line-height: 1.7;
    margin: 0;
    font-family: "Consolas", "Courier New", monospace;
}

/* FAQ */
.faq-box { margin: 24px 0; }
.faq-item {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}
.faq-item h4 { color: var(--red); margin-bottom: 8px; font-size: 1em; }
.faq-item p { font-size: 0.92em; color: #555; line-height: 1.6; margin: 0; }

/* Interface Guide */
.interface-guide { margin: 24px 0; }
.iface-region {
    background: var(--light-gray);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 12px;
}
.iface-label {
    font-size: 0.85em;
    font-weight: 700;
    color: var(--red);
    margin-bottom: 6px;
}
.param-list { padding-left: 20px; margin-top: 8px; }
.param-list li { padding: 4px 0; font-size: 0.9em; color: #555; }
code {
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.88em;
    color: var(--red);
}

/* Tip Inline */
.tip-inline {
    background: #fff8f0;
    border-left: 3px solid var(--red);
    padding: 12px 16px;
    margin-top: 8px;
    font-size: 0.9em;
    color: #665;
    border-radius: 0 8px 8px 0;
}

/* Lesson Summary */
.lesson-summary {
    background: linear-gradient(135deg, #fff8f0, #fef2f2);
    border-radius: 12px;
    padding: 28px;
    margin-top: 40px;
}
.lesson-summary h4 { margin-bottom: 12px; color: var(--dark); }
.lesson-summary ul { padding-left: 20px; margin-bottom: 20px; }
.lesson-summary li { padding: 4px 0; color: #555; }
.lesson-summary .btn { margin-top: 8px; }

/* End of Free */
.end-of-free {
    text-align: center;
    padding-top: 16px;
    border-top: 1px dashed var(--red);
}
.end-of-free p { color: #555; margin-bottom: 8px; }
.end-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    .lesson-layout { grid-template-columns: 1fr; }
    .lesson-sidebar {
        position: static;
        max-height: none;
        order: -1;
    }
    .three-elements { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .lesson-header-inner { flex-direction: column; text-align: center; }
    .lesson-icon-lg { width: 72px; height: 72px; font-size: 3em; }
    .lesson-header h1 { font-size: 1.6em; }
    .example-grid { grid-template-columns: 1fr; }
    .end-actions { flex-direction: column; align-items: center; }
}
