/* 教程文章专用样式 */

/* 面包屑导航 */
.breadcrumb {
    background: var(--bg-light);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
}

.breadcrumb-list li {
    display: flex;
    align-items: center;
}

.breadcrumb-list li:not(:last-child)::after {
    content: '>';
    margin-left: 0.5rem;
    color: var(--text-muted);
}

.breadcrumb-list a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-list a:hover {
    color: var(--primary-dark);
}

.breadcrumb-list li:last-child {
    color: var(--text-muted);
}

/* 教程头部 */
.tutorial-header {
    background: linear-gradient(135deg, var(--primary-gradient));
    padding: 3rem 0;
    color: white;
    position: relative;
    overflow: hidden;
}

.tutorial-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../../images/tutorial-bg-pattern.svg') repeat;
    opacity: 0.1;
    z-index: 1;
}

.tutorial-header .container {
    position: relative;
    z-index: 2;
}

.tutorial-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.tutorial-meta .category {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tutorial-meta .date,
.tutorial-meta .read-time,
.tutorial-meta .difficulty {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.tutorial-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.tutorial-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 800px;
}

.tutorial-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.social-share {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.social-share span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.share-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.bookmark-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.bookmark-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.bookmark-btn.bookmarked {
    background: var(--accent-color);
}

.bookmark-btn.bookmarked i {
    color: white;
}

/* 教程内容 */
.tutorial-content {
    padding: 4rem 0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 3rem;
    align-items: start;
}

/* 目录 */
.table-of-contents {
    position: sticky;
    top: 2rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.table-of-contents h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.toc-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-nav ul ul {
    margin-left: 1rem;
    margin-top: 0.5rem;
}

.toc-nav li {
    margin-bottom: 0.5rem;
}

.toc-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.4;
    display: block;
    padding: 0.25rem 0;
    transition: color 0.3s ease;
    border-left: 2px solid transparent;
    padding-left: 0.5rem;
    margin-left: -0.5rem;
}

.toc-nav a:hover,
.toc-nav a.active {
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

/* 主要内容 */
.main-content {
    max-width: none;
}

.content-section {
    margin-bottom: 3rem;
    scroll-margin-top: 2rem;
}

.content-section h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.content-section h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 2rem 0 1rem;
}

.content-section h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.5rem 0 1rem;
}

.content-section p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.subsection {
    margin: 2rem 0;
    padding-left: 1rem;
    border-left: 3px solid var(--border-color);
}

/* 信息框样式 */
.info-box,
.warning-box,
.tip-box,
.success-box {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    border-left: 4px solid;
}

.info-box {
    background: #f0f9ff;
    border-left-color: #0ea5e9;
}

.warning-box {
    background: #fefce8;
    border-left-color: #eab308;
}

.tip-box {
    background: #f0fdf4;
    border-left-color: #22c55e;
}

.success-box {
    background: #ecfdf5;
    border-left-color: #10b981;
}

.info-icon,
.warning-icon,
.tip-icon,
.success-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    font-size: 0.9rem;
}

.info-icon {
    background: #0ea5e9;
}

.warning-icon {
    background: #eab308;
}

.tip-icon {
    background: #22c55e;
}

.success-icon {
    background: #10b981;
}

.info-content h4,
.warning-content h4,
.tip-content h4,
.success-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.info-content p,
.warning-content p,
.tip-content p,
.success-content p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.info-content ul,
.warning-content ul,
.tip-content ul,
.success-content ul {
    margin: 0.5rem 0 0 1rem;
    color: var(--text-secondary);
}

/* 网格布局 */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.card h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.card h3 i {
    color: var(--primary-color);
}

.card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.card li:last-child {
    border-bottom: none;
}

/* 代码块样式 */
.code-block {
    margin: 2rem 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #1e293b;
}

.code-block.small {
    margin: 1rem 0;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #334155;
    border-bottom: 1px solid #475569;
}

.code-title {
    color: #e2e8f0;
    font-size: 0.9rem;
    font-weight: 500;
}

.copy-btn {
    background: transparent;
    border: 1px solid #475569;
    color: #94a3b8;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #475569;
    color: white;
}

.code-block pre {
    margin: 0;
    padding: 1.5rem;
    background: #1e293b;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.code-block code {
    color: #e2e8f0;
    background: transparent;
}

/* 标签页样式 */
.tabs {
    margin: 2rem 0;
}

.tab-buttons {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content h4 {
    margin-top: 0;
}

/* 步骤列表 */
.step-by-step {
    margin: 2rem 0;
}

.steps-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.steps-list li {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.step-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.step-content p {
    margin: 0 0 0.5rem 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.step-content code {
    background: var(--bg-light);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--primary-color);
}

/* 故障排除网格 */
.troubleshooting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.issue-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.issue-card h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.issue-card h3 i {
    color: #ef4444;
}

.issue-description p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.issue-description ul {
    margin: 0.5rem 0 0 1rem;
    font-size: 0.9rem;
}

.issue-description li {
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
}

/* 下一步网格 */
.next-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.next-step-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.next-step-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.step-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 1.5rem;
}

.next-step-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.next-step-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.step-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.step-link:hover {
    color: var(--primary-dark);
    gap: 0.75rem;
}

/* 社区部分 */
.community-section {
    margin-top: 3rem;
    padding: 2rem;
    background: var(--bg-light);
    border-radius: 12px;
    text-align: center;
}

.community-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.community-section p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.community-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.community-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.community-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.community-link i {
    font-size: 1rem;
}

/* 相关教程 */
.related-tutorials {
    background: var(--bg-light);
    padding: 4rem 0;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.related-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.related-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-card:hover .related-image img {
    transform: scale(1.05);
}

.related-content {
    padding: 1.5rem;
}

.related-category {
    background: #e8f5e8;
    color: #2d5a2d;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.related-content h3 {
    margin: 1rem 0 0.75rem;
}

.related-content h3 a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.related-content h3 a:hover {
    color: var(--primary-color);
}

.related-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 200px 1fr;
        gap: 2rem;
    }
    
    .table-of-contents {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .tutorial-title {
        font-size: 2rem;
    }
    
    .tutorial-subtitle {
        font-size: 1.1rem;
    }
    
    .tutorial-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .table-of-contents {
        position: static;
        order: -1;
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .troubleshooting-grid {
        grid-template-columns: 1fr;
    }
    
    .next-steps-grid {
        grid-template-columns: 1fr;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .community-links {
        flex-direction: column;
        align-items: center;
    }
    
    .community-link {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .tutorial-header {
        padding: 2rem 0;
    }
    
    .tutorial-title {
        font-size: 1.8rem;
    }
    
    .tutorial-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .social-share {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .code-block pre {
        padding: 1rem;
        font-size: 0.8rem;
    }
    
    .steps-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .step-number {
        align-self: flex-start;
    }
} 