/* ========================================
   Article Detail Page Styles
   B2B Professional Theme
   ======================================== */

/* CSS Variables */
:root {
    --article-primary: #003366;
    --article-secondary: #1a56db;
    --article-accent: #0066cc;
    --article-text: #333333;
    --article-text-light: #666666;
    --article-bg: #ffffff;
    --article-bg-alt: #f8f9fa;
    --article-border: #e5e7eb;
    --article-radius: 8px;
    --article-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --article-max-width: 1200px;
}

/* Mobile TOC - shown below featured image on mobile */
.mobile-toc-wrapper {
    display: none;
}
.mobile-toc {
    background: var(--article-bg-alt);
    border-radius: var(--article-radius);
    padding: 15px;
    margin-bottom: 20px;
}
.mobile-toc .widget-title {
    margin: 0 0 16px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Desktop TOC - shown in sidebar */
.desktop-toc {
    /* Visible by default on desktop */
}

/* Responsive: Show mobile TOC on small screens */
@media (max-width: 768px) {
    .mobile-toc-wrapper {
        display: block !important;
    }
    .mobile-toc-wrapper .toc-list {
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 15px;
        margin: 0 0 20px 0;
    }
    .mobile-toc-wrapper .toc-list li {
        padding: 8px 0;
        border-bottom: 1px solid #f0f0f0;
    }
    .mobile-toc-wrapper .toc-list li:last-child {
        border-bottom: none;
    }
    .sidebar-widget.desktop-toc {
        display: none !important;
    }
    .desktop-only {
        display: none !important;
    }
}

/* Reset for article page */
.article-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--article-text);
    line-height: 1.7;
    background: var(--article-bg);
}

/* Container */
.article-container {
    max-width: var(--article-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Breadcrumb */
.article-breadcrumb {
    background: var(--article-bg-alt);
    padding: 12px 0;
    border-bottom: 1px solid var(--article-border);
}

.breadcrumb-wrap {
    max-width: var(--article-max-width);
    margin: 0 auto;
    padding: 0 20px;
    font-size: 14px;
}

.article-breadcrumb a {
    color: var(--article-secondary);
    text-decoration: none;
}

.article-breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-sep {
    margin: 0 8px;
    color: var(--article-text-light);
}

.breadcrumb-current {
    color: var(--article-text-light);
}

/* Article Header */
.article-header {
    max-width: var(--article-max-width);
    margin: 0 auto;
    padding: 40px 20px 30px;
}

.article-category {
    display: inline-block;
    background: var(--article-primary);
    color: #fff;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
}

.article-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--article-primary);
    margin: 0 0 20px;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 20px;
}

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

.meta-item svg {
    opacity: 0.7;
}

/* Share Buttons */
.article-share {
    display: flex;
    align-items: center;
    gap: 10px;
}

.share-label {
    font-size: 14px;
    color: var(--article-text-light);
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--article-bg-alt);
    color: var(--article-text);
    border-radius: 50%;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.share-btn:hover {
    background: var(--article-primary);
    color: #fff;
}

/* Featured Image */
.article-featured {
    max-width: var(--article-max-width);
    margin: 0 auto 30px;
    padding: 0 20px;
}

.article-featured img {
    width: 100%;
    height: auto;
    border-radius: var(--article-radius);
    display: block;
}

/* Main Layout */
.article-main {
    max-width: var(--article-max-width);
    margin: 0 auto;
    padding: 0 20px 60px;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
}

/* Article Content */
.article-content {
    min-width: 0;
}

.article-content h2,
.article-content h3,
.article-content h4 {
    color: var(--article-primary);
    margin: 32px 0 16px;
    line-height: 1.4;
}

.article-content h2 {
    font-size: 26px;
    border-bottom: 2px solid var(--article-primary);
    padding-bottom: 10px;
}

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

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

.article-content p {
    margin: 0 0 20px;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--article-radius);
    margin: 20px 0;
}

.article-content ul,
.article-content ol {
    margin: 0 0 20px 24px;
}

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

.article-content a {
    color: var(--article-accent);
    text-decoration: none;
}

.article-content a:hover {
    text-decoration: underline;
}

.article-content blockquote {
    margin: 24px 0;
    padding: 20px 24px;
    background: var(--article-bg-alt);
    border-left: 4px solid var(--article-primary);
    border-radius: 0 var(--article-radius) var(--article-radius) 0;
    font-style: italic;
}

.article-content code {
    background: var(--article-bg-alt);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 14px;
}

.article-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: var(--article-radius);
    overflow-x: auto;
    margin: 24px 0;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
}

.article-content th,
.article-content td {
    padding: 12px 16px;
    border: 1px solid var(--article-border);
    text-align: left;
}

.article-content th {
    background: var(--article-bg-alt);
    font-weight: 600;
}

/* Tags */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 40px 0 30px;
    padding-top: 30px;
    border-top: 1px solid var(--article-border);
}

.tags-label {
    font-weight: 600;
    color: var(--article-text);
}

.tag-link {
    display: inline-block;
    padding: 6px 14px;
    background: var(--article-bg-alt);
    color: var(--article-text);
    border-radius: 20px;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
}

.tag-link:hover {
    background: var(--article-primary);
    color: #fff;
}

/* Author Box */
.article-author {
    display: flex;
    gap: 20px;
    padding: 24px;
    background: var(--article-bg-alt);
    border-radius: var(--article-radius);
    margin-top: 30px;
}

.author-avatar img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
}

.author-name {
    font-weight: 600;
    color: var(--article-primary);
    margin-bottom: 6px;
}

.author-bio {
    font-size: 14px;
    color: var(--article-text-light);
}

/* Sidebar */
.article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Sidebar Widget - matches category-wz style */
.sidebar-widget {
    background: #fff;
    border-radius: 8px;
    padding: 0;
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.widget-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    padding: 14px 18px;
    margin: 0;
    background: linear-gradient(135deg, #1e3a5f, #2d5a87);
}
.widget-title a {
    color: #fff;
    text-decoration: none;
    transition: opacity 0.2s;
}
.widget-title a:hover {
    opacity: 0.85;
}

/* Page Navigation - same style as category-wz */
.page-nav {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}
.page-nav .nav-title {
    background: #1a3a5c;
    color: #fff;
    padding: 12px 18px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.page-nav .nav-title a {
    color: #fff;
    text-decoration: none;
}
.page-nav .nav-title a:hover {
    text-decoration: underline;
}
.page-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.page-nav li {
    border-bottom: 1px solid #eef2f7;
}
.page-nav li:last-child {
    border-bottom: none;
}
.page-nav li a {
    display: flex;
    align-items: center;
    padding: 10px 18px;
    color: #444;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}
.page-nav li a::before {
    content: '›';
    margin-right: 8px;
    color: #c9a04e;
    font-weight: bold;
    font-size: 16px;
}
.page-nav li a:hover {
    color: #1a3a5c;
    background: #f8f9fb;
}
.page-nav li.current a {
    color: #1a3a5c;
    font-weight: 600;
    background: #f0f4f8;
}

/* Table of Contents */
.article-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.article-toc li {
    margin-bottom: 2px;
}

.article-toc a {
    display: block;
    padding: 10px 14px;
    color: var(--article-text);
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.article-toc a:hover {
    background: var(--article-bg-alt);
    color: var(--article-primary);
    border-left-color: var(--article-primary);
}

.article-toc a.active {
    background: var(--article-bg-alt);
    color: var(--article-primary);
    font-weight: 600;
    border-left-color: var(--article-accent);
}

.toc-level-2 {
    padding-left: 0;
}

.toc-level-2 > li > a {
    font-weight: 500;
    color: var(--article-primary);
}

.toc-level-3 {
    padding-left: 12px;
    margin-top: 4px;
}

.toc-level-3 a {
    font-size: 13px;
    color: #666;
    padding: 8px 12px 8px 20px;
    position: relative;
}

.toc-level-3 a::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: #ccc;
    border-radius: 50%;
}

.toc-level-3 a:hover::before,
.toc-level-3 a.active::before {
    background: var(--article-accent);
}


/* Sidebar CTA */
.sidebar-cta {
    background: linear-gradient(135deg, var(--article-primary), var(--article-secondary));
    color: #fff;
    padding: 24px;
    border-radius: var(--article-radius);
    text-align: center;
}

.sidebar-cta h3 {
    font-size: 18px;
    margin: 0 0 12px;
}

.sidebar-cta p {
    font-size: 14px;
    opacity: 0.9;
    margin: 0 0 20px;
}

.cta-button {
    display: inline-block;
    padding: 12px 28px;
    background: #fff;
    color: var(--article-primary);
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s;
}

.cta-button:hover {
    transform: scale(1.05);
}

/* Related Posts */
.related-articles-widget .widget-title {
    margin-bottom: 20px;
}

.related-posts {
    list-style: none;
    margin: 0;
    padding: 0;
}

.related-posts li {
    margin-bottom: 12px;
}

.related-posts li:last-child {
    margin-bottom: 0;
}

.related-posts a {
    display: flex;
    gap: 12px;
    text-decoration: none;
    color: var(--article-text);
}

.related-thumb {
    flex-shrink: 0;
    width: 70px;
}

.related-thumb img {
    width: 70px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.related-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.related-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 4px;
}

.related-date {
    font-size: 12px;
    color: var(--article-text-light);
}

.related-posts a:hover .related-title {
    color: var(--article-primary);
}

/* Article Navigation */
.article-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: var(--article-max-width);
    margin: 0 auto;
    padding: 40px 20px;
    border-top: 1px solid var(--article-border);
    gap: 20px;
}

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

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

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

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

.nav-label {
    font-size: 13px;
    color: var(--article-text-light);
    margin-bottom: 8px;
}


/* Responsive Design */
@media (max-width: 1024px) {
    .article-main {
        grid-template-columns: 1fr;
    }
    
    .article-sidebar {
        order: 1;
    }
    
    .article-nav {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .article-sidebar {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
    }
    
    .sidebar-widget {
        flex: 1 1 calc(50% - 5px) !important;
        min-width: 140px !important;
    }
    
    .article-title {
        font-size: 28px;
    }
    
    .article-meta {
        gap: 16px;
    }
    
    .article-header {
        padding: 30px 20px 20px;
    }
    
    .article-content h2 {
        font-size: 22px;
    }
    
    .article-content h3 {
        font-size: 18px;
    }
    
    .sidebar-cta {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .article-title {
        font-size: 24px;
    }
    
    .article-meta {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .article-share {
        flex-wrap: wrap;
    }
    
    .article-author {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* CTA 区块 */
.article-cta {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    color: #fff;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    margin: 30px 0;
}

.article-cta h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #fff;
}

.article-cta p {
    margin-bottom: 20px;
    opacity: 0.9;
}

.article-cta .cta-button {
    display: inline-block;
    background: #e74c3c;
    color: #fff;
    padding: 12px 30px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s;
}

.article-cta .cta-button:hover {
    background: #c0392b;
}

/* Page Featured Products */
.popular-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popular-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.popular-item:first-child {
    padding-top: 20px;
}

.popular-item:last-child {
    border-bottom: none;
}

.popular-thumb img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.popular-info {
    flex: 1;
    min-width: 0;
}

.popular-title {
    display: block;
    color: #1a3352;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.4;
    overflow-wrap: break-word;
    word-break: break-word;
}

.popular-title:hover {
    color: #d4a843;
}

.popular-price {
    display: block;
    color: #d4a843;
    font-size: 13px;
    font-weight: 600;
    margin-top: 3px;
}
