/* Article page layout and component styles */

/* ─── Page Layout ─── */
.article-page-wrap {
    display: flex;
    gap: 40px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 108px 24px 80px;
    align-items: flex-start;
}

.article-main {
    flex: 1;
    min-width: 0;
}

/* ─── Breadcrumb ─── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-gray);
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--primary-blue);
}

.breadcrumb .sep {
    color: #cbd5e1;
    font-size: 11px;
}

.breadcrumb .current {
    color: var(--text-dark);
    font-weight: 500;
}

/* ─── Article Header ─── */
.article-header {
    margin-bottom: 40px;
}

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

.article-tag {
    display: inline-flex;
    align-items: center;
    background: var(--bg-blue-light);
    color: var(--primary-blue);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--border-radius-pill);
}

.article-tag.tag-latest {
    background: #dcfce7;
    color: #15803d;
}

.article-title {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.5px;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    color: var(--text-gray);
    font-size: 14px;
    margin-bottom: 20px;
}

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

.article-meta-item i {
    font-size: 13px;
    color: var(--text-light);
}

.article-summary {
    font-size: 17px;
    line-height: 1.75;
    color: var(--text-gray);
    padding: 20px 24px;
    background: var(--bg-gray);
    border-left: 4px solid var(--primary-blue);
    border-radius: 0 12px 12px 0;
}

/* ─── Article Body Typography ─── */
.article-body {
    font-size: 16px;
    line-height: 1.85;
    color: var(--text-dark);
    padding-bottom: 40px;
    border-bottom: 1px solid #e2e8f0;
}

.article-body h2 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin: 48px 0 20px;
    color: var(--text-dark);
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.article-body h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 32px 0 14px;
    color: var(--text-dark);
}

.article-body p {
    margin-bottom: 20px;
    color: #334155;
}

.article-body ul,
.article-body ol {
    margin: 0 0 20px 28px;
    list-style: initial;
}

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

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

.article-body a {
    color: var(--primary-blue);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.article-body a:hover {
    color: var(--primary-blue-hover);
}

.article-body strong {
    font-weight: 700;
    color: var(--text-dark);
}

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

.article-body code {
    background: #f1f5f9;
    color: #0f172a;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13.5px;
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid #e2e8f0;
}

.article-body pre {
    background: #0d1117;
    border-radius: 12px;
    padding: 24px 28px;
    overflow-x: auto;
    margin: 24px 0;
    border: 1px solid #21262d;
}

.article-body pre code {
    background: transparent;
    border: none;
    color: #e6edf3;
    font-size: 13.5px;
    line-height: 1.8;
    padding: 0;
}

.article-body blockquote {
    margin: 24px 0;
    padding: 16px 24px;
    border-left: 4px solid #e2e8f0;
    background: var(--bg-gray);
    color: var(--text-gray);
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 14.5px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.article-body th {
    background: #f8fafc;
    padding: 14px 18px;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid #e2e8f0;
}

.article-body td {
    padding: 12px 18px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-gray);
}

.article-body tr:last-child td {
    border-bottom: none;
}

/* Callout / tip / warning boxes */
.callout {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 18px 22px;
    border-radius: 12px;
    margin: 24px 0;
    font-size: 15px;
    line-height: 1.7;
}

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

.callout-tip {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #14532d;
}

.callout-tip i { color: #22c55e; }

.callout-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #78350f;
}

.callout-warning i { color: #f59e0b; }

.callout-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a5f;
}

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

/* Step list */
.step-list {
    list-style: none;
    margin: 0 0 24px;
    counter-reset: step-counter;
}

.step-list li {
    counter-increment: step-counter;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-left: 0;
}

.step-list li::before {
    content: counter(step-counter);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary-blue);
    color: white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ─── Product Recommend Aside ─── */
.product-recommend {
    margin-top: 48px;
    padding: 40px;
    background: linear-gradient(135deg, #0d1e38 0%, #1e477b 100%);
    border-radius: var(--border-radius-xl);
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.product-recommend::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
    pointer-events: none;
}

.product-recommend-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #93c5fd;
    margin-bottom: 12px;
}

.product-recommend h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.product-recommend .product-desc {
    font-size: 15px;
    color: #94a3b8;
    margin-bottom: 24px;
    line-height: 1.7;
}

.product-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}

.product-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #e2e8f0;
}

.product-feature i {
    color: #34d399;
    font-size: 14px;
    flex-shrink: 0;
}

.product-recommend .btn-dl {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    color: var(--primary-blue);
    font-weight: 700;
    font-size: 15px;
    padding: 14px 32px;
    border-radius: var(--border-radius-pill);
    transition: all 0.2s;
}

.product-recommend .btn-dl:hover {
    background: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

/* ─── Prev / Next Navigation ─── */
.article-nav-prev-next {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 40px;
}

.nav-article-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 22px 24px;
    background: var(--bg-gray);
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
    text-decoration: none;
    color: inherit;
}

.nav-article-card:hover {
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.nav-direction {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-direction i {
    font-size: 11px;
}

.nav-article-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.45;
}

.nav-article-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.nav-article-tag {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 9px;
    background: #e8f0f8;
    color: var(--primary-blue);
    border-radius: 20px;
}

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

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

/* ─── Related Articles ─── */
.article-related {
    margin-top: 40px;
}

.related-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.related-title i {
    color: var(--primary-blue);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.related-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    background: var(--bg-gray);
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius-lg);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.related-card:hover {
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.related-card-title {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.5;
}

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

.related-card-tag {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 9px;
    background: #e8f0f8;
    color: var(--primary-blue);
    border-radius: 20px;
}

/* ─── Sidebar TOC ─── */
.article-sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 108px;
    max-height: calc(100vh - 128px);
    overflow-y: auto;
}

.toc-card {
    background: var(--bg-gray);
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius-lg);
    padding: 24px;
}

.toc-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toc-title i {
    color: var(--primary-blue);
}

.toc-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    list-style: none;
}

.toc-list a {
    display: block;
    font-size: 13.5px;
    color: var(--text-gray);
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    line-height: 1.5;
}

.toc-list a:hover,
.toc-list a.toc-active {
    background: var(--bg-blue-light);
    color: var(--primary-blue);
    font-weight: 600;
}

.toc-list li.toc-sub > a {
    padding-left: 20px;
    font-size: 13px;
    color: var(--text-light);
}

.toc-list li.toc-sub > a:hover,
.toc-list li.toc-sub > a.toc-active {
    color: var(--primary-blue);
}

/* ─── Float Widget ─── */
.float-widget {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 300px;
    background: linear-gradient(135deg, #0d1e38 0%, #1e477b 100%);
    border-radius: 20px;
    padding: 24px;
    color: #ffffff;
    box-shadow: 0 20px 60px rgba(13, 30, 56, 0.5);
    z-index: 900;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

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

.float-widget-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: rgba(255,255,255,0.12);
    border: none;
    color: #ffffff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.float-widget-close:hover {
    background: rgba(255,255,255,0.22);
}

.float-widget-icon {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.12);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 14px;
}

.float-widget h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}

.float-widget p {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 16px;
}

.float-widget .btn-fw {
    display: block;
    text-align: center;
    background: #ffffff;
    color: var(--primary-blue);
    font-weight: 700;
    font-size: 14px;
    padding: 11px 20px;
    border-radius: var(--border-radius-pill);
    transition: all 0.2s;
}

.float-widget .btn-fw:hover {
    background: #e8f0f8;
}

/* ─── Responsive ─── */
@media (max-width: 1100px) {
    .article-sidebar {
        display: none;
    }
    .article-page-wrap {
        padding-top: 100px;
    }
}

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

    .article-title {
        font-size: 26px;
    }

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

    .nav-article-card.nav-next {
        align-items: flex-start;
        text-align: left;
    }

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

    .product-recommend {
        padding: 28px 22px;
    }

    .product-recommend h3 {
        font-size: 20px;
    }

    .float-widget {
        width: calc(100vw - 32px);
        left: 16px;
        right: 16px;
        bottom: 16px;
        border-radius: 16px;
    }

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

@media (max-width: 480px) {
    .article-title {
        font-size: 22px;
    }

    .article-body h2 {
        font-size: 21px;
    }

    .article-body h3 {
        font-size: 17px;
    }

    .article-summary {
        font-size: 15px;
    }
}
