/* Tutorial Page Styles */

/* Tutorial Grid */
.tutorial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.tutorial-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    height: 100%;
    box-sizing: border-box;
}

.tutorial-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: var(--shadow);
}

.tutorial-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.tutorial-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.tutorial-icon.beginner {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.tutorial-icon.core {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.tutorial-icon.advanced {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.tutorial-icon.practice {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.tutorial-icon.appendix {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
}

.tutorial-icon i {
    font-size: 1.25rem;
    color: white;
}

.tutorial-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.tutorial-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.tutorial-content {
    padding: 16px 24px 24px;
    flex: 1;
    box-sizing: border-box;
}

/* Category Section */
.category-section {
    margin-bottom: 60px;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.category-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient-1);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-icon i {
    font-size: 1.25rem;
    color: white;
}

.category-title {
    font-size: 1.5rem;
    font-weight: 700;
    flex: 1;
}

.category-count {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Tutorial Card Link */
.tutorial-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.tutorial-card-link:hover .tutorial-card {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: rgba(99, 102, 241, 0.4);
}

.tutorial-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

.read-more {
    font-size: 0.8125rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.chapter-preview {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.chapter-preview .chapter-number {
    flex-shrink: 0;
    background: var(--gradient-1);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.chapter-preview .chapter-meta {
    color: var(--text-muted);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.tutorial-tag {
    display: inline-block;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
}

/* Tutorial Detail Page */

/* Article Header */
.article-header {
    padding: 100px 20px 40px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-bottom: 1px solid var(--border);
}

.article-header .container {
    max-width: 1200px;
    margin: 0 auto;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumbs a:hover {
    color: var(--primary);
}

.breadcrumbs .separator {
    opacity: 0.5;
}

.article-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 16px;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.article-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.article-meta .meta-item i {
    color: var(--primary);
}

.article-meta .meta-item.tag {
    background: rgba(99, 102, 241, 0.15);
    padding: 4px 12px;
    border-radius: 20px;
    color: var(--primary);
}

/* Article Main */
.article-main {
    padding: 40px 20px;
}

.article-main .container {
    max-width: 1200px;
    margin: 0 auto;
}

.article-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
}

/* Sidebar */
.article-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.toc-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
}

.toc-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toc-title i {
    color: var(--primary);
}

.toc-list {
    list-style: none;
}

.toc-item {
    margin-bottom: 8px;
}

.toc-item a {
    display: block;
    padding: 8px 12px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.3s;
    line-height: 1.4;
}

.toc-item a:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text);
}

.toc-h3 {
    padding-left: 20px;
}

.toc-h4 {
    padding-left: 32px;
    font-size: 0.8125rem;
}

.toc-empty {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
    padding: 20px 0;
}

/* Article Content */
.article-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
}

.content-body {
    padding: 40px;
    line-height: 1.8;
    color: var(--text);
}

.content-body h1,
.content-body h2,
.content-body h3,
.content-body h4,
.content-body h5,
.content-body h6 {
    margin-top: 32px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.content-body h1 {
    font-size: 1.75rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.content-body h2 {
    font-size: 1.5rem;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.content-body h3 {
    font-size: 1.25rem;
    color: var(--accent);
}

.content-body h4 {
    font-size: 1.125rem;
}

.content-body p {
    margin-bottom: 16px;
}

.content-body a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px dashed var(--primary);
    transition: all 0.3s;
}

.content-body a:hover {
    border-bottom-style: solid;
}

.content-body code {
    background: rgba(99, 102, 241, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
    color: var(--secondary);
}

.content-body pre {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    overflow-x: auto;
}

.content-body pre code {
    background: none;
    padding: 0;
    color: var(--text);
    font-size: 0.8125rem;
    line-height: 1.6;
}

.content-body blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 20px;
    margin: 20px 0;
    color: var(--text-muted);
    font-style: italic;
}

.content-body ul,
.content-body ol {
    margin: 16px 0;
    padding-left: 24px;
}

.content-body li {
    margin-bottom: 8px;
}

.content-body hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 32px 0;
}

.content-body img {
    max-width: 100%;
    border-radius: 12px;
    margin: 20px 0;
}

.content-body strong {
    color: var(--primary);
    font-weight: 600;
}

/* Article Navigation */
.article-nav {
    border-top: 1px solid var(--border);
    padding: 24px 40px;
    background: rgba(99, 102, 241, 0.05);
}

.article-nav .nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.article-nav .nav-link {
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s;
}

.article-nav .nav-link:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.article-nav .nav-link.prev {
    align-items: flex-start;
}

.article-nav .nav-link.next {
    align-items: flex-end;
    text-align: right;
}

.article-nav .nav-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.article-nav .nav-link.disabled:hover {
    border-color: var(--border);
    transform: none;
    box-shadow: none;
}

.article-nav .nav-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.article-nav .nav-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
}

/* Back to List */
.back-to-list {
    padding: 24px 40px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.back-to-list .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.3s;
}

.back-to-list .btn:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

/* Responsive */
@media (max-width: 1024px) {
    .article-layout {
        grid-template-columns: 1fr;
    }
    
    .article-sidebar {
        position: static;
        order: 2;
    }
    
    .toc-card {
        margin-top: 20px;
    }
    
    .tutorial-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .article-header {
        padding: 80px 16px 32px;
    }
    
    .article-title {
        font-size: 1.5rem;
    }
    
    .article-meta {
        gap: 12px;
    }
    
    .content-body {
        padding: 24px;
    }
    
    .content-body h1 {
        font-size: 1.375rem;
    }
    
    .content-body h2 {
        font-size: 1.25rem;
    }
    
    .content-body h3 {
        font-size: 1.125rem;
    }
    
    .article-nav {
        padding: 16px 24px;
    }
    
    .article-nav .nav-links {
        gap: 12px;
    }
    
    .article-nav .nav-link {
        padding: 12px 16px;
    }
    
    .article-nav .nav-title {
        font-size: 0.8125rem;
    }
    
    .back-to-list {
        padding: 16px 24px;
    }
}

@media (max-width: 480px) {
    .article-nav .nav-links {
        grid-template-columns: 1fr;
    }
    
    .article-nav .nav-link.next {
        align-items: flex-start;
        text-align: left;
    }
}
