/* learning-layout.css - 学习页布局样式 */

/* 主容器 */
.learning-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 150px); /* 减去导航和页脚高度 */
}

/* 左侧目录导航 */
.learning-sidebar {
    width: 300px;
    background-color: #f8f9fa;
    border-right: 1px solid #e2e8f0;
    padding: 2rem 0;
    position: sticky;
    top: 80px; /* 导航栏高度 */
    height: calc(100vh - 80px);
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 10;
}

.sidebar-header {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.sidebar-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1A202C;
    margin-bottom: 0.5rem;
}

.sidebar-description {
    color: #4A5568;
    font-size: 0.9rem;
}

/* 目录树 */
.learning-nav {
    padding: 0 1rem;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    color: #4A5568;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-link:hover {
    background-color: #edf2f7;
    color: #2D3748;
}

.nav-link.active {
    background-color: #ebf4ff;
    color: #3182CE;
    font-weight: 600;
}

.nav-icon {
    margin-right: 0.7rem;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 带子菜单的导航项 */
.nav-item-with-children {
    margin-bottom: 0.5rem;
}

.nav-parent {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    color: #4A5568;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-parent:hover {
    background-color: #edf2f7;
    color: #2D3748;
}

.nav-parent.active {
    background-color: #e6fffa;
    color: #319795;
    font-weight: 600;
}

.nav-parent-left {
    display: flex;
    align-items: center;
}

.nav-parent-icon {
    margin-right: 0.7rem;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-children {
    margin-left: 2.5rem;
    margin-top: 0.5rem;
    display: none;
}

.nav-children.open {
    display: block;
}

.nav-child {
    margin-bottom: 0.3rem;
}

.nav-child-link {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    color: #718096;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.nav-child-link:hover {
    background-color: #edf2f7;
    color: #2D3748;
}

.nav-child-link.active {
    background-color: #ebf4ff;
    color: #3182CE;
    font-weight: 600;
}

/* 测试/生成按钮 */
.sidebar-actions {
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
    margin-top: 1.5rem;
}

.test-btn {
    display: block;
    width: 100%;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, #764ba2, #667eea);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(118, 75, 162, 0.2);
    margin-bottom: 1rem;
}

.test-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(118, 75, 162, 0.3);
}

.sidebar-resources {
    padding-top: 1rem;
}

.resource-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2D3748;
    margin-bottom: 0.8rem;
}

.resource-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.resource-link {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: #3182CE;
    text-decoration: none;
}

.resource-link i {
    margin-right: 0.5rem;
    font-size: 1rem;
}

.resource-link:hover {
    text-decoration: underline;
}

/* 内容区域 */
.learning-content {
    flex: 1;
    padding: 2.5rem;
    background-color: white;
}

.content-header {
    margin-bottom: 2rem;
}

.content-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #1A202C;
    margin-bottom: 0.8rem;
}

.content-meta {
    display: flex;
    align-items: center;
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.meta-item {
    display: flex;
    align-items: center;
    margin-right: 1.5rem;
}

.meta-item i {
    margin-right: 0.4rem;
}

.content-breadcrumb {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.breadcrumb-item {
    color: #718096;
}

.breadcrumb-item:last-child {
    color: #3182CE;
    font-weight: 500;
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: #CBD5E0;
}

.content-body {
    color: #2D3748;
    line-height: 1.8;
}

.content-section {
    margin-bottom: 2.5rem;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1A202C;
    margin-bottom: 1.5rem;
}

.content-text {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.content-image {
    width: 100%;
    max-width: 700px;
    margin: 2rem auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: none !important;
}

/* .content-image {
    display: none !important;
} */

.content-image img {
    width: 100%;
    display: block;
}

.content-quote {
    background-color: #f7fafc;
    border-left: 4px solid #3182CE;
    padding: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #4A5568;
}

.content-cta {
    background: linear-gradient(135deg, #f6e05e, #f6ad55);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 20px 50px 40px 30px;
}

.cta-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #744210;
    margin-bottom: 0.8rem;
}

.cta-text {
    color: #744210;
    margin-bottom: 1.2rem;
}

.cta-btn {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    background-color: #744210;
    color: white;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.cta-btn:hover {
    background-color: #975a16;
    transform: translateY(-2px);
}

/* 页面导航 */
.content-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.prev-link, .next-link {
    display: flex;
    align-items: center;
    color: #3182CE;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.prev-link:hover, .next-link:hover {
    color: #2c5282;
}

.prev-link {
    margin-right: auto;
}

.next-link {
    margin-left: auto;
}

.prev-icon {
    margin-right: 0.5rem;
}

.next-icon {
    margin-left: 0.5rem;
}

/* 侧边栏切换按钮（移动端） */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #764ba2, #667eea);
    color: white;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 100;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}


.type-image-container {
    margin: 20px 0;
    text-align: left;
}

.type-image {
    max-width: 400px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 左右布局的content-cta样式 */
.content-cta-with-image {
    display: flex;
    background: linear-gradient(135deg, #f6e05e, #f6ad55);
    border-radius: 8px;
    gap: 20px;
    align-items: flex-start;
    margin: 20px 0;
}

.cta-image-container {
    flex-shrink: 0;
    margin: 20px 0;
}

.cta-image {
    max-width: 400px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin: 30px 10px 10px 10px;
}

.cta-image-big {
    max-width: 600px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin: 30px 10px 10px 10px;
}

.cta-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 30px 10px 5px 5px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .content-cta-with-image {
        flex-direction: column;
        gap: 15px;
    }
    
    .cta-image-container {
        align-self: center;
    }
    
    .cta-image-big {
        max-width: 400px;
        margin: 20px auto;
    }
}

/* 响应式调整 */
@media (max-width: 992px) {
    .learning-container {
        flex-direction: column;
    }
    
    .learning-sidebar {
        width: 100%;
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        z-index: 1000;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    }
    
    .learning-sidebar.open {
        left: 0;
    }
    
    .sidebar-close {
        display: block;
        position: absolute;
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: rgba(0, 0, 0, 0.1);
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .sidebar-toggle {
        display: flex;
    }
    
    .learning-content {
        padding: 1.5rem;
    }
    
    .cta-image-big {
        max-width: 500px;
        margin: 25px auto;
    }
    
    .content-cta {
        margin: 20px 30px 35px 30px;
    }
}


@media (max-width: 480px) {
    .content-title {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .content-nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .prev-link, .next-link {
        width: 100%;
    }
    
    .cta-image-big {
        max-width: 280px;
        margin: 15px auto;
        width: 90%;
    }
    
    .cta-image-container {
        text-align: center;
        padding: 0 10px;
    }
    
    .content-cta {
        margin: 20px 15px 30px 15px;
        padding: 1.2rem;
    }
}
