/* Article Container */
.article-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
}

/* Article */
.article {
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    overflow: hidden;
}

/* Breadcrumb */
.breadcrumb {
    padding: 16px 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.breadcrumb ol {
    display: flex;
    list-style: none;
    gap: 8px;
    font-size: 13px;
    color: #666;
}

.breadcrumb a {
    color: #009688;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #00796b;
}

.breadcrumb li:not(:last-child)::after {
    content: '/';
    color: #999;
}

/* Article Header */
.article-header {
    padding: 32px 32px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.article-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin-bottom: 16px;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #666;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Article Content */
.article-content {
    padding: 32px;
    line-height: 1.8;
    color: #444;
}

.article-content h2 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-top: 40px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

.article-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-top: 32px;
    margin-bottom: 16px;
}

.article-content h4 {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    margin-top: 24px;
    margin-bottom: 12px;
}

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

.article-content ul,
.article-content ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

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

.article-content strong {
    color: #333;
    font-weight: 600;
}

.article-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    color: #e74c3c;
}

.article-content pre {
    background: #1e1e1e;
    padding: 20px;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 24px;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: #d4d4d4;
    font-size: 14px;
    line-height: 1.6;
}

/* Table of Contents - Sidebar */
.toc-sidebar {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 4px;
}

.toc-sidebar ol {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: toc-counter;
}

.toc-sidebar li {
    margin-bottom: 10px;
    counter-increment: toc-counter;
}

.toc-sidebar li::before {
    content: counter(toc-counter) ". ";
    color: #4caf50;
    font-weight: 600;
    margin-right: 4px;
}

.toc-sidebar a {
    color: #666;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
    display: inline;
}

.toc-sidebar a:hover {
    color: #009688;
}

.toc-sidebar a.active {
    color: #4caf50;
    font-weight: 600;
}

/* Comparison Table */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 14px;
}

.comparison-table th,
.comparison-table td {
    padding: 12px 16px;
    text-align: left;
    border: 1px solid #e0e0e0;
}

.comparison-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.comparison-table tr:nth-child(even) {
    background: #fafafa;
}

.comparison-table td {
    color: #555;
}

.comparison-table code {
    background: none;
    padding: 0;
    color: #e74c3c;
}

/* Article Footer */
.article-footer {
    padding: 32px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.article-footer h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

/* Tags */
.article-tags {
    margin-bottom: 32px;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tags-list a {
    display: inline-block;
    padding: 6px 14px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 13px;
    color: #666;
    text-decoration: none;
    transition: all 0.2s;
}

.tags-list a:hover {
    background: #4caf50;
    color: white;
    border-color: #4caf50;
}

/* Share Buttons */
.article-share {
    margin-bottom: 32px;
}

.share-buttons {
    display: flex;
    gap: 12px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 1px solid #e0e0e0;
    color: #666;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.share-btn.twitter:hover {
    background: #000;
    color: white;
    border-color: #000;
}

.share-btn.facebook:hover {
    background: #1877f2;
    color: white;
    border-color: #1877f2;
}

.share-btn.linkedin:hover {
    background: #0a66c2;
    color: white;
    border-color: #0a66c2;
}

.share-btn.copy:hover {
    background: #4caf50;
    color: white;
    border-color: #4caf50;
}

/* Author */
.article-author {
    margin-bottom: 0;
}

.article-author p {
    font-size: 14px;
    color: #555;
    margin: 0;
}

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

.sidebar-widget {
    background: white;
    border-radius: 4px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.sidebar-widget h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

.sidebar-widget p {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
}

/* Related Articles */
.related-articles,
.popular-tools {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-articles li,
.popular-tools li {
    margin-bottom: 12px;
}

.related-articles a,
.popular-tools a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
    display: block;
}

.related-articles a:hover,
.popular-tools a:hover {
    color: #009688;
}

/* Newsletter Form */
.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.newsletter-form input {
    padding: 12px 16px;
    border: 1px solid #d0d0d0;
    border-radius: 3px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.newsletter-form input:focus {
    border-color: #4caf50;
}

.newsletter-form button {
    padding: 12px 16px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.newsletter-form button:hover {
    background: #43a047;
}

/* Responsive */
@media (max-width: 1024px) {
    .article-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .article-container {
        margin: 20px auto;
        padding: 0 16px;
    }

    .article-header h1 {
        font-size: 24px;
    }

    .article-meta {
        flex-direction: column;
        gap: 8px;
    }

    .article-content {
        padding: 24px;
    }

    .article-content h2 {
        font-size: 20px;
        margin-top: 32px;
    }

    .article-content h3 {
        font-size: 18px;
    }

    .toc {
        padding: 16px;
    }

    .article-footer {
        padding: 24px;
    }

    .comparison-table {
        font-size: 13px;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .breadcrumb ol {
        font-size: 12px;
    }

    .article-header h1 {
        font-size: 20px;
    }

    .article-content {
        padding: 20px;
    }

    .article-content pre {
        padding: 16px;
    }

    .article-content pre code {
        font-size: 13px;
    }

    .share-buttons {
        gap: 8px;
    }

    .share-btn {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }
}

/* Syntax Highlighting for Code Blocks */
.article-content pre code {
    display: block;
    counter-reset: line;
}

.article-content pre code .line {
    display: block;
    counter-increment: line;
}

.article-content pre code .line::before {
    content: counter(line);
    display: inline-block;
    width: 30px;
    margin-right: 12px;
    color: #666;
    text-align: right;
    font-size: 12px;
    user-select: none;
}

/* Scrollbar for code blocks */
.article-content pre::-webkit-scrollbar {
    height: 8px;
}

.article-content pre::-webkit-scrollbar-track {
    background: #2d2d2d;
}

.article-content pre::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.article-content pre::-webkit-scrollbar-thumb:hover {
    background: #666;
}