/* =====================================================================
   article.css — Shared styles for all zh-CN blog article detail pages.
   Changes to UI layout / typography should be made here ONLY.
   Do NOT re-declare any of these styles inside article HTML files.
   ===================================================================== */

/* --- Page wrapper: two-column layout (main + sidebar) --- */
.article-page-wrap {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 48px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 24px 80px;
    align-items: start;
}

/* --- Breadcrumb --- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.breadcrumb a:hover { color: var(--brand-green); }
.breadcrumb .sep { color: #cbd5e1; font-size: 10px; }
.breadcrumb .current { color: var(--text-main); font-weight: 500; }

/* --- Article Header (div, not header tag — avoids main.css fixed-position rule) --- */
.article-header {
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid #e2e8f0;
}
.article-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    align-items: center;
}
.article-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--brand-green-light);
    color: var(--brand-green);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
}
.article-tag-latest {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-weight: 600;
}
.article-tag-category {
    background: #f0f9ff;
    color: #0284c7;
}
.article-title {
    font-size: clamp(26px, 4vw, 40px);
    font-weight: 700;
    line-height: 1.25;
    color: var(--dark-deep);
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}
.article-meta {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}
.article-meta i {
    margin-right: 4px;
    color: var(--brand-green);
}
.article-summary {
    font-size: 16px;
    color: #475569;
    line-height: 1.8;
    padding: 16px 20px;
    background: #f8fafc;
    border-left: 3px solid var(--brand-green);
    border-radius: 0 8px 8px 0;
    font-weight: 300;
}

/* --- Article Body --- */
.article-body {
    font-size: 16px;
    line-height: 1.85;
    color: #334155;
    font-weight: 300;
}
.article-body h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark-deep);
    margin: 48px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f1f5f9;
    position: relative;
}
.article-body h2::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 48px;
    height: 2px;
    background: var(--brand-green);
}
.article-body h2:first-child { margin-top: 0; }
.article-body h3 {
    font-size: 19px;
    font-weight: 600;
    color: #1e293b;
    margin: 32px 0 14px;
}
.article-body p { margin-bottom: 20px; }
.article-body ul,
.article-body ol {
    margin: 16px 0 20px 20px;
}
.article-body li { margin-bottom: 8px; line-height: 1.8; }
.article-body strong { color: #1e293b; font-weight: 600; }
.article-body a {
    color: var(--brand-green);
    text-decoration: none;
    border-bottom: 1px solid rgba(16, 185, 129, 0.3);
    transition: border-color 0.2s;
}
.article-body a:hover { border-color: var(--brand-green); }
.article-body code {
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    background: #f1f5f9;
    color: #e11d48;
    padding: 2px 6px;
    border-radius: 4px;
}
.article-body pre {
    background: #0f172a;
    border-radius: 12px;
    padding: 24px;
    overflow-x: auto;
    margin: 24px 0;
}
.article-body pre code {
    background: none;
    color: #e2e8f0;
    font-size: 14px;
    padding: 0;
    border-radius: 0;
}
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 14px;
}
.article-body th {
    background: #f8fafc;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--dark-deep);
    border-bottom: 2px solid #e2e8f0;
}
.article-body td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
}
.article-body tr:last-child td { border-bottom: none; }

/* Callout / notice boxes */
.callout {
    border-radius: 12px;
    padding: 16px 20px;
    margin: 24px 0;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 15px;
    line-height: 1.7;
}
.callout-icon {
    flex-shrink: 0;
    font-size: 18px;
    margin-top: 1px;
}
.callout-info {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
}
.callout-info .callout-icon { color: #3b82f6; }
.callout-tip {
    background: #f0fdf4;
    border-left: 4px solid var(--brand-green);
}
.callout-tip .callout-icon { color: var(--brand-green); }
.callout-warn {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
}
.callout-warn .callout-icon { color: #f59e0b; }

/* Numbered step list */
.step-list {
    list-style: none;
    margin: 20px 0;
    padding: 0;
    counter-reset: step-counter;
}
.step-list li {
    counter-increment: step-counter;
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    align-items: flex-start;
}
.step-list li::before {
    content: counter(step-counter);
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--brand-green);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    font-family: var(--font-en);
    margin-top: 2px;
}

/* Download CTA button inside article */
.article-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--brand-green);
    color: #fff !important;
    font-weight: 600;
    font-size: 15px;
    border-radius: 100px;
    text-decoration: none !important;
    border-bottom: none !important;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
    transition: 0.3s;
    margin: 8px 0;
}
.article-cta-btn:hover {
    background: #059669 !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.4);
}

/* --- Sidebar Table of Contents --- */
.article-sidebar {
    position: sticky;
    top: 100px;
}
.toc-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
.toc-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark-deep);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.toc-title i { color: var(--brand-green); }
.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.toc-list li { margin-bottom: 2px; }
.toc-list a {
    display: block;
    padding: 7px 10px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    line-height: 1.5;
    border-left: 2px solid transparent;
}
.toc-list a:hover {
    color: var(--brand-green);
    background: var(--brand-green-light);
    border-left-color: var(--brand-green);
}
.toc-list a.active {
    color: var(--brand-green);
    background: var(--brand-green-light);
    font-weight: 500;
    border-left-color: var(--brand-green);
}

/* --- Product Recommend Block (after article body) --- */
.product-recommend {
    margin-top: 64px;
    padding: 48px;
    background: linear-gradient(135deg, #020617 0%, #0d1929 100%);
    border-radius: 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.product-recommend::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
    pointer-events: none;
}
.pr-label {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--brand-green);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.pr-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}
.pr-desc {
    font-size: 15px;
    color: #94a3b8;
    margin-bottom: 28px;
    line-height: 1.7;
    max-width: 560px;
}
.pr-features {
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.pr-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #cbd5e1;
}
.pr-features li i {
    color: var(--brand-green);
    font-size: 12px;
    flex-shrink: 0;
}
.pr-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 36px;
    background: var(--brand-green);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    border-radius: 100px;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
    transition: 0.3s;
}
.pr-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.5);
}

/* --- Floating Download Widget --- */
.float-widget {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 300px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.06);
    padding: 24px;
    z-index: 500;
    transform: translateX(calc(100% + 48px));
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}
.float-widget.visible {
    transform: translateX(0);
    opacity: 1;
}
.fw-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 12px;
    transition: 0.2s;
}
.fw-close:hover { background: #e2e8f0; color: #1e293b; }
.fw-icon {
    width: 44px;
    height: 44px;
    background: var(--brand-green-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.fw-icon i { color: var(--brand-green); font-size: 20px; }
.fw-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark-deep);
    margin-bottom: 6px;
}
.fw-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.6;
}
.fw-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px;
    background: var(--brand-green);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    border-radius: 100px;
    text-decoration: none;
    transition: 0.2s;
}
.fw-btn:hover { background: #059669; transform: translateY(-1px); }

/* --- Responsive breakpoints --- */
@media (max-width: 1024px) {
    .article-page-wrap {
        grid-template-columns: 1fr;
        padding-top: 100px;
    }
    .article-sidebar {
        position: static;
        display: none;
    }
}

@media (max-width: 768px) {
    .article-page-wrap {
        padding: 90px 16px 60px;
        gap: 32px;
        overflow: hidden;
    }
    .article-body {
        font-size: 15px;
        overflow-wrap: break-word;
        word-break: break-word;
    }
    .article-body h2 { font-size: 20px; }
    .article-body h3 { font-size: 17px; }
    .article-title { font-size: 24px; }
    .article-summary { font-size: 15px; }
    .article-body table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    .article-body th,
    .article-body td {
        white-space: normal;
        min-width: 80px;
    }
    .product-recommend { padding: 32px 24px; }
    .pr-features { grid-template-columns: 1fr; }
    .pr-title { font-size: 22px; }
    .float-widget {
        width: calc(100% - 32px);
        left: 16px;
        right: 16px;
        bottom: 16px;
        transform: translateY(calc(100% + 32px));
    }
    .float-widget.visible { transform: translateY(0); }
}
