/* 教程内容页面布局 */
.tutorial-content {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 80px auto 0;
    padding: 2rem;
}

/* 侧边栏基础样式 */
.tutorial-sidebar {
    position: sticky;
    top: 100px;
    height: calc(100vh - 120px);
    width: 250px;
    padding: 1.5rem;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--light-bg);
    display: flex;
    flex-direction: column;
}

/* 自定义滚动条样式 */
.tutorial-sidebar::-webkit-scrollbar {
    width: 4px;
}

.tutorial-sidebar::-webkit-scrollbar-track {
    background: var(--light-bg);
}

.tutorial-sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

/* 阅读进度样式 */
.tutorial-progress {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--light-bg);
}

.progress-bar {
    height: 4px;
    background: var(--light-bg);
    border-radius: 2px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-text {
    display: block;
    margin-top: 0.8rem;
    font-size: 0.85rem;
    color: var(--text-color);
    text-align: center;
}

/* 章节导航样式 */
.chapter-nav {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.chapter-nav h3 {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--light-bg);
}

.chapter-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.chapter-nav li {
    position: relative;
}

/* 章节项样式 */
.chapter-nav a {
    display: flex;
    align-items: center;
    padding: 0.8rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    line-height: 1.4;
}

/* 章节序号点样式 */
.chapter-nav a::before {
    content: '';
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--light-bg);
    margin-right: 0.8rem;
    transition: all 0.3s ease;
}

/* 激活状态样式 */
.chapter-nav li.active a {
    background: var(--light-bg);
    color: var(--primary-color);
    font-weight: 500;
}

.chapter-nav li.active a::before {
    background: var(--primary-color);
    transform: scale(1.2);
}

/* 悬停效果 */
.chapter-nav a:hover {
    background: var(--light-bg);
    color: var(--primary-color);
}

.chapter-nav a:hover::before {
    background: var(--primary-color);
}

/* 底部导航 */
.chapter-nav-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--light-bg);
}

.chapter-nav-footer a {
    display: flex;
    align-items: center;
    padding: 0.8rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.chapter-nav-footer a:hover {
    background: var(--light-bg);
    color: var(--primary-color);
}

/* 文章内容样式 */
.tutorial-article {
    background: var(--white);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.article-header {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--light-bg);
}

.article-header h1 {
    font-size: 2.5rem;
    margin: 1rem 0;
    color: var(--text-color);
    line-height: 1.3;
}

.article-meta {
    display: flex;
    gap: 2rem;
    color: #666;
    font-size: 0.9rem;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
}

.article-content h2 {
    font-size: 1.8rem;
    margin: 2.5rem 0 1.5rem;
    color: var(--text-color);
}

.article-content p {
    margin-bottom: 1.5rem;
}

.info-box {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
}

.info-box h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.info-box ul {
    padding-left: 1.5rem;
}

.info-box li {
    margin-bottom: 0.5rem;
}

.step-guide .step {
    margin-bottom: 2.5rem;
}

.step h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.code-block {
    background: #1e1e1e;
    color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* 响应式调整 */
@media (max-width: 1024px) {
    .tutorial-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }

    .tutorial-sidebar.active {
        transform: translateX(0);
    }

    .tutorial-content {
        grid-template-columns: 1fr;
    }

    .tutorial-article {
        padding: 1.5rem;
    }

    .article-header h1 {
        font-size: 2rem;
    }

    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    .tutorial-categories {
        grid-template-columns: 1fr;
    }

    .tutorial-list {
        grid-template-columns: 1fr;
    }
} 