/* learn.css - 学习页面样式 */

/* 主内容区域布局 */
.main-content-wrapper {
    display: flex;
    max-width: 1250px;
    margin: 120px auto 40px;
    padding: 0 20px;
    gap: 20px;
    min-height: calc(100vh - 140px);
}

/* 左侧目录区域 */
.sidebar-menu {
    flex: 0 0 250px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 90px;
}

.sidebar-menu h2 {
    color: #fff;
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-menu h2 i {
    color: #4fc3f7;
}

.chapter-list {
    min-width: 300px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.chapter-item {
    margin-bottom: 10px;
}

.chapter-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.chapter-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: translateX(5px);
    border-color: rgba(0, 255, 255, 0.2);
}

.chapter-link.active {
    background: rgba(79, 195, 247, 0.15);
    color: #4fc3f7;
    border-color: rgba(79, 195, 247, 0.3);
    box-shadow: 0 5px 15px rgba(79, 195, 247, 0.2);
}

.chapter-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: #4fc3f7;
    border-radius: 0 4px 4px 0;
}

.chapter-icon {
    font-size: 16px;
    width: 24px;
    text-align: center;
}

.chapter-title {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

/* 右侧内容区域 */
.content-area {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 30px;
    min-height: 500px;
}

.content-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.content-header h1 {
    color: #fff;
    font-size: 26px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.content-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    line-height: 1.5;
}

.content-body {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    font-size: 14px;
}

/* 章节内容样式 */
.chapter-content {
    animation: fadeIn 0.5s ease;
}

.chapter-content h2 {
    color: #4fc3f7;
    margin: 20px 0 12px;
    font-size: 20px;
}

.chapter-content h3 {
    color: #81c784;
    margin: 16px 0 10px;
    font-size: 18px;
}
.chapter-content h4{
    color:burlywood;
    margin: 12px 0 8px;
    font-size: 15px;
}
.chapter-content p {
    margin-bottom: 12px;
    text-align: justify;
}

.chapter-content ul, .chapter-content ol {
    margin: 12px 0;
    padding-left: 18px;
}

.chapter-content li {
    margin-bottom: 6px;
}

.chapter-content code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 5px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #ffcc80;
}

.chapter-content pre {
    background: rgba(0, 0, 0, 0.4);
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 16px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
}

.chapter-content pre code {
    background: none;
    padding: 0;
    color: #e6e6e6;
}

.chapter-content .highlight-box {
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid #4fc3f7;
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
}

.chapter-content .example-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 13px;
}
/* 搜索框样式 */
.search-container {
    margin-bottom: 20px;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    transition: all 0.3s ease;
    min-width: 300px;

}

.search-box:focus-within {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(79, 195, 247, 0.3);
    box-shadow: 0 0 15px rgba(79, 195, 247, 0.1);
}

.search-box i {
    color: rgba(255, 255, 255, 0.5);
    margin-right: 8px;
    font-size: 12px;
}

.search-box input {
    background: transparent;
    border: none;
    color: #fff;
    width: 100%;
    font-size: 13px;
    outline: none;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* 错误信息样式 */
.error-message {
    text-align: center;
    padding: 50px 20px;
    animation: fadeIn 0.5s ease;
}

.error-message h2 {
    color: #ff5252;
    margin-bottom: 20px;
}

.error-message p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 30px;
    font-size: 16px;
}

.retry-btn {
    background: rgba(79, 195, 247, 0.2);
    border: 1px solid rgba(79, 195, 247, 0.4);
    color: #4fc3f7;
    padding: 10px 25px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: rgba(79, 195, 247, 0.3);
    transform: translateY(-2px);
}

/* 代码高亮样式 */
pre .comment {
    color: #6a9955;
}

pre .keyword {
    color: #569cd6;
}

pre .property {
    color: #9cdcfe;
}

pre .string {
    color: #ce9178;
}

/* 章节动画效果 */
.chapter-link {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content-wrapper {
        margin: 0px 0px 0px 0px;
        max-width: 100%;
        padding: 0 15px;
    }
}

@media (max-width: 992px) {
    .main-content-wrapper {
        flex-direction: column;
        margin-top: 90px;
    }
    
    .sidebar-menu {
        position: static;
        width: 100%;
    }
    
    .content-area {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .main-content-wrapper {
        padding: 0 12px;
        gap: 15px;
    }
    
    .sidebar-menu,
    .content-area {
        padding: 15px;
    }
    
    .content-header h1 {
        font-size: 22px;
    }
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}