/* =========================================================
   article.css — Blog article detail page styles
   Used by all blog article pages via article-recommend.js
   DO NOT re-declare any of these styles inline in article HTML
   ========================================================= */

/* ----- Layout: article page wrapper ----- */
.article-page-wrap {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 40px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    align-items: start;
}

/* ----- Breadcrumb navigation ----- */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    color: #888;
    margin-bottom: 28px;
    padding: 0;
    list-style: none;
}

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

.breadcrumb a:hover {
    color: var(--color-brand-orange);
}

.breadcrumb .sep {
    color: #ccc;
    font-size: 11px;
    user-select: none;
}

.breadcrumb .current {
    color: #555;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ----- Article header (injected by article-recommend.js) ----- */
.article-header {
    margin-bottom: 36px;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.article-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: #f5f5f5;
    border-radius: 2px;
    font-size: 12px;
    color: #555;
    font-weight: 500;
}

.article-tag.tag-latest {
    background: var(--color-brand-orange);
    color: #fff;
}

.article-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1a1c23;
    line-height: 1.35;
    margin-bottom: 20px;
}

.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 13px;
    color: #888;
    margin-bottom: 20px;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.article-meta i {
    font-size: 12px;
    color: #bbb;
}

.article-summary {
    font-size: 16px;
    color: #555;
    line-height: 1.7;
    padding: 20px 24px;
    background: #fafafa;
    border-left: 3px solid var(--color-brand-orange);
    border-radius: 0 4px 4px 0;
}

/* ----- Article body content ----- */
.article-body {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.article-body h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1c23;
    margin: 48px 0 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.article-body h3 {
    font-size: 18px;
    font-weight: 600;
    color: #222;
    margin: 32px 0 14px;
}

.article-body h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 24px 0 10px;
}

.article-body p {
    margin-bottom: 18px;
}

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

.article-body ul {
    list-style: disc;
}

.article-body ol {
    list-style: decimal;
}

.article-body li {
    margin-bottom: 8px;
    line-height: 1.75;
}

.article-body a {
    color: var(--color-brand-orange);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-body a:hover {
    color: var(--color-brand-orange-hover);
}

.article-body strong {
    font-weight: 600;
    color: #1a1c23;
}

.article-body em {
    font-style: italic;
    color: #555;
}

/* Code blocks */
.article-body pre {
    background: #1a1c23;
    color: #e0e0e0;
    border-radius: 4px;
    padding: 20px 24px;
    overflow-x: auto;
    margin: 24px 0;
    font-size: 14px;
    line-height: 1.65;
    font-family: 'Courier New', 'Consolas', monospace;
}

.article-body code {
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 0.9em;
    background: #f5f5f5;
    color: #c0392b;
    padding: 2px 6px;
    border-radius: 3px;
}

.article-body pre code {
    background: none;
    color: inherit;
    padding: 0;
    font-size: inherit;
    border-radius: 0;
}

/* Tables */
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 14px;
}

.article-body table th {
    background: #f5f5f5;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    border: 1px solid #e0e0e0;
    color: #333;
}

.article-body table td {
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    color: #444;
}

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

/* Callout / tip boxes */
.callout {
    display: flex;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 4px;
    margin: 24px 0;
    font-size: 15px;
    line-height: 1.7;
}

.callout-icon {
    flex-shrink: 0;
    font-size: 18px;
    margin-top: 2px;
}

.callout.tip {
    background: #fffbf0;
    border-left: 3px solid #f7931a;
    color: #6b4f10;
}

.callout.tip .callout-icon { color: #f7931a; }

.callout.info {
    background: #f0f7ff;
    border-left: 3px solid #3b82f6;
    color: #1e40af;
}

.callout.info .callout-icon { color: #3b82f6; }

.callout.warning {
    background: #fff7ed;
    border-left: 3px solid #ef4444;
    color: #7f1d1d;
}

.callout.warning .callout-icon { color: #ef4444; }

/* ----- Article main column ----- */
.article-main {
    min-width: 0;
}

/* ----- Sidebar TOC ----- */
.article-sidebar {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.toc-card {
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 4px;
    padding: 20px;
}

.toc-title {
    font-size: 13px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 7px;
}

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

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

.toc-list li {
    margin-bottom: 4px;
}

.toc-list a {
    display: block;
    font-size: 13px;
    color: #666;
    text-decoration: none;
    padding: 4px 8px 4px 0;
    border-left: 2px solid transparent;
    padding-left: 10px;
    transition: all 0.2s;
    line-height: 1.45;
}

.toc-list a:hover,
.toc-list a.active {
    color: var(--color-brand-orange);
    border-left-color: var(--color-brand-orange);
    background: #fffaf5;
}

.toc-list .toc-h3 a {
    font-size: 12px;
    padding-left: 20px;
    color: #888;
}

/* ----- Product recommendation block ----- */
.product-recommend {
    margin-top: 56px;
    padding: 36px 40px;
    background: linear-gradient(135deg, #1a1c23 0%, #252836 100%);
    border-radius: 6px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.product-recommend * {
    text-align: left !important;
}

.product-recommend::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(247,147,26,0.08);
    pointer-events: none;
}

.product-recommend h3 {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}

.product-recommend h3 i {
    display: none;
}

.product-recommend .recommend-desc {
    font-size: 14px;
    color: #a0a4b8;
    margin-bottom: 22px;
    line-height: 1.65;
}

.recommend-features {
    list-style: none;
    padding: 0;
    margin: 0 0 28px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 24px;
}

.recommend-features li {
    font-size: 14px;
    color: #d0d4e8;
    line-height: 1.5;
}

.recommend-features li i {
    display: none;
}

.recommend-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: var(--color-brand-orange);
    color: #fff;
    border-radius: 3px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.recommend-download-btn:hover {
    background: var(--color-brand-orange-hover);
    color: #fff;
}

/* ----- Prev / Next article navigation ----- */
.article-nav-prev-next {
    margin-top: 36px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.article-nav-prev-next .nav-card {
    display: flex;
    flex-direction: column;
    padding: 20px;
    border: 1px solid #ebebeb;
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-width: 0;
}

.article-nav-prev-next .nav-card:hover {
    border-color: var(--color-brand-orange);
    box-shadow: 0 2px 12px rgba(247,147,26,0.08);
}

.article-nav-prev-next .nav-direction {
    font-size: 11px;
    font-weight: 600;
    color: #bbb;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.article-nav-prev-next .nav-card.next-card .nav-direction {
    justify-content: flex-end;
}

.article-nav-prev-next .nav-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.45;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-nav-prev-next .nav-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: auto;
}

.article-nav-prev-next .nav-tag {
    font-size: 11px;
    padding: 2px 8px;
    background: #f5f5f5;
    color: #777;
    border-radius: 2px;
}

.article-nav-prev-next .next-card {
    text-align: right;
}

.article-nav-prev-next .next-card .nav-tags {
    justify-content: flex-end;
}

/* ----- Related articles block ----- */
.article-related {
    margin-top: 36px;
}

.article-related h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1a1c23;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-related h3 i {
    color: var(--color-brand-orange);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.related-card {
    display: flex;
    flex-direction: column;
    padding: 16px;
    border: 1px solid #ebebeb;
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, transform 0.2s;
}

.related-card:hover {
    border-color: var(--color-brand-orange);
    transform: translateY(-2px);
}

.related-card .related-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.related-card .related-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.related-card .related-tag {
    font-size: 10px;
    padding: 2px 6px;
    background: #f5f5f5;
    color: #777;
    border-radius: 2px;
}

/* ----- Float widget ----- */
.float-widget {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 300px;
    background: #1a1c23;
    border-radius: 6px;
    padding: 22px 22px 20px;
    color: #fff;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    z-index: 900;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.float-widget.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.float-widget-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 4px 7px;
    border-radius: 4px;
    transition: background 0.2s;
}

.float-widget-close:hover {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

.float-widget h4 {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    padding-right: 20px;
    text-align: left;
}

.float-widget h4 i {
    display: none;
}

.float-widget p {
    font-size: 12px;
    color: #a0a4b8;
    line-height: 1.55;
    margin-bottom: 14px;
    text-align: left;
}

.float-widget-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--color-brand-orange);
    color: #fff;
    border-radius: 3px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}

.float-widget-btn:hover {
    background: var(--color-brand-orange-hover);
    color: #fff;
}

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

    .article-sidebar {
        display: none;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .article-page-wrap {
        padding: 24px 16px 60px;
    }

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

    .product-recommend {
        padding: 24px 20px;
    }

    .recommend-features {
        grid-template-columns: 1fr;
    }

    .article-nav-prev-next {
        grid-template-columns: 1fr;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .float-widget {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        border-radius: 10px 10px 0 0;
        padding: 18px 18px 24px;
    }
}
