/* ===== ARTICLE PAGE SHARED STYLES ===== */

/* SEO: visually hidden but readable by crawlers — same text as JS-injected h1 */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
/* Covers: layout, breadcrumb, article header, body typography,
   code blocks, callout boxes, TOC sidebar, product recommend block,
   float widget, and all responsive breakpoints.
   DO NOT re-declare any of these styles inline in article HTML files. */

/* ==================== RESET: prevent main.css global header rule bleed ==================== */
/* main.css targets the bare <header> tag with display:flex + position:fixed.
   Any <header> element inside the article page must be overridden back to normal block flow. */
.article-page-wrap header,
.article-page-wrap .article-header {
    display: block;
    position: static;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0;
    width: auto;
    z-index: auto;
    box-shadow: none;
    border: none;
}

/* ==================== ARTICLE PAGE LAYOUT ==================== */
.article-page-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 112px 5% 100px;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 48px;
    align-items: start;
}

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

/* ==================== BREADCRUMB ==================== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 32px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: none;
}

.breadcrumb ol {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
}

.breadcrumb li,
.breadcrumb a {
    font-size: 13px;
    color: var(--text-muted);
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
}

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

.breadcrumb .bc-sep {
    font-size: 9px;
    color: var(--text-light);
    display: inline-flex;
    align-items: center;
}

.breadcrumb li[aria-current="page"] {
    color: var(--text-main);
    font-weight: 500;
}

/* ==================== ARTICLE HEADER ==================== */
.article-header {
    margin-bottom: 40px;
}

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

.article-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 13px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    background: var(--accent-blue-light);
    color: var(--accent-blue);
}

.article-tag.latest-badge {
    background: var(--accent-green-light);
    color: var(--accent-green);
}

.article-header h1 {
    font-size: clamp(26px, 3.2vw, 40px);
    font-weight: 500;
    letter-spacing: -1.2px;
    line-height: 1.25;
    color: var(--text-main);
    margin-bottom: 20px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.article-date,
.article-reading-time,
.article-category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.article-summary {
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1.75;
    background: var(--bg-card);
    border-left: 3px solid var(--accent-blue);
    padding: 18px 22px;
    border-radius: 0 12px 12px 0;
}

/* ==================== ARTICLE BODY ==================== */
.article-body {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-main);
}

.article-body h2 {
    font-size: clamp(20px, 2.2vw, 26px);
    font-weight: 500;
    letter-spacing: -0.6px;
    color: var(--text-main);
    margin: 52px 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    scroll-margin-top: 96px;
}

.article-body h2:first-child { margin-top: 0; }

.article-body h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    margin: 36px 0 14px;
    scroll-margin-top: 96px;
}

.article-body p {
    margin-bottom: 20px;
    color: var(--text-main);
}

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

.article-body a:hover { color: #1558b0; }

.article-body ul,
.article-body ol {
    padding-left: 24px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.article-body li { color: var(--text-main); line-height: 1.75; }

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

.article-body em { font-style: italic; color: var(--text-muted); }

/* Inline code */
.article-body code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875em;
    background: rgba(26,115,232,0.08);
    color: #1a73e8;
    padding: 2px 7px;
    border-radius: 5px;
    white-space: nowrap;
}

/* Code block */
.article-body pre {
    background: var(--bg-dark);
    border-radius: 14px;
    padding: 24px 28px;
    overflow-x: auto;
    margin: 24px 0;
    border: 1px solid rgba(255,255,255,0.06);
    position: relative;
}

.article-body pre code {
    background: transparent;
    color: #a8d8a8;
    font-size: 14px;
    padding: 0;
    border-radius: 0;
    word-break: normal;
    line-height: 1.75;
    display: block;
}

/* Code block language label */
.code-label {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Courier New', monospace;
}

/* Table */
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 14px;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.06);
}

.article-body th {
    background: var(--bg-card);
    padding: 14px 18px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-main);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.article-body td {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    color: var(--text-muted);
    vertical-align: top;
}

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

/* Callout 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-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

.callout.info {
    background: var(--accent-blue-light);
    border-left: 3px solid var(--accent-blue);
    color: #1a4e8a;
}

.callout.warning {
    background: var(--accent-orange-light);
    border-left: 3px solid var(--accent-orange);
    color: #7a3a00;
}

.callout.success {
    background: var(--accent-green-light);
    border-left: 3px solid var(--accent-green);
    color: #145a2e;
}

.callout.tip {
    background: var(--accent-purple-light);
    border-left: 3px solid var(--accent-purple);
    color: #4a1060;
}

.callout p { margin: 0; color: inherit; }

/* Step numbered list */
.step-list {
    counter-reset: step-counter;
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.step-list li {
    counter-increment: step-counter;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 18px 22px;
    background: var(--bg-card);
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,0.04);
}

.step-list li::before {
    content: counter(step-counter);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--text-main);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ==================== PRODUCT RECOMMEND BLOCK ==================== */
.product-recommend {
    margin-top: 60px;
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    border-radius: 24px;
    padding: 48px 52px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
}

.product-recommend::before {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(26,115,232,0.15) 0%, transparent 70%);
    top: -100px; right: -60px;
    pointer-events: none;
}

.product-recommend-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(26,115,232,0.15);
    color: #6ca9f5;
    padding: 5px 14px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 20px;
    border: 1px solid rgba(26,115,232,0.2);
}

.product-recommend h2 {
    font-size: clamp(22px, 2.5vw, 32px);
    font-weight: 500;
    color: white;
    letter-spacing: -0.8px;
    margin-bottom: 12px;
    border: none;
    padding: 0;
    margin-top: 0;
}

.product-recommend-desc {
    font-size: 16px;
    color: rgba(255,255,255,0.52);
    margin-bottom: 32px;
    max-width: 580px;
    line-height: 1.7;
}

.product-recommend-points {
    list-style: none;
    padding: 0;
    margin-bottom: 36px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
}

.product-recommend-points li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    line-height: 1.55;
}

.product-recommend-points li::before {
    content: '✓';
    color: #34a853;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.product-recommend-btns {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-recommend-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    color: var(--text-main);
    padding: 14px 28px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s;
}

.btn-recommend-primary:hover {
    background: #e8f0fe;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.btn-recommend-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.8);
    padding: 14px 28px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s;
    border: 1.5px solid rgba(255,255,255,0.14);
}

.btn-recommend-ghost:hover {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.28);
    transform: translateY(-2px);
}

/* ==================== FLOAT WIDGET ==================== */
.float-widget {
    position: fixed;
    right: 28px;
    bottom: 32px;
    width: 320px;
    background: var(--bg-dark);
    border-radius: 20px;
    padding: 24px 26px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.06);
    z-index: 200;
    transform: translateY(20px);
    opacity: 0;
    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: 14px;
    right: 14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

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

.float-widget-label {
    font-size: 10px;
    font-weight: 700;
    color: #4a9cf5;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.float-widget h4 {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin-bottom: 8px;
    line-height: 1.35;
}

.float-widget p {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 18px;
    line-height: 1.6;
}

.float-widget-features {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.float-widget-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255,255,255,0.6);
}

.float-widget-feature::before {
    content: '✓';
    color: #34a853;
    font-weight: 700;
    font-size: 11px;
    flex-shrink: 0;
}

.float-widget-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: white;
    color: var(--text-main);
    padding: 12px 20px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    text-align: center;
}

.float-widget-btn:hover {
    background: #e8f0fe;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

/* ==================== TOC SIDEBAR ==================== */
.article-sidebar {
    position: sticky;
    top: 96px;
}

.toc-card {
    background: var(--bg-card);
    border-radius: 18px;
    padding: 24px 22px;
    border: 1px solid rgba(0,0,0,0.04);
}

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

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

.toc-list li a {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    padding: 7px 10px;
    border-radius: 8px;
    transition: all 0.2s;
    line-height: 1.45;
}

.toc-list li a:hover {
    color: var(--text-main);
    background: rgba(0,0,0,0.04);
}

.toc-list li a.active {
    color: var(--accent-blue);
    background: var(--accent-blue-light);
    font-weight: 500;
}

.toc-list li.toc-h3 a {
    padding-left: 22px;
    font-size: 12px;
}

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

    .article-sidebar {
        display: none;
    }

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

@media (max-width: 768px) {
    .article-page-wrap {
        padding: 96px 5% 80px;
        gap: 32px;
    }

    .article-header h1 {
        font-size: 22px;
        letter-spacing: -0.5px;
    }

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

    .article-body table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    .article-body td code,
    .article-body th code {
        white-space: normal;
        word-break: break-word;
    }

    .step-list li {
        display: block;
        position: relative;
        padding: 16px 16px 16px 56px;
    }

    .step-list li::before {
        position: absolute;
        left: 14px;
        top: 16px;
    }

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

    .product-recommend h2 { font-size: 22px; }

    .float-widget {
        right: 12px;
        bottom: 12px;
        left: 12px;
        width: auto;
    }

    .product-recommend-btns {
        flex-direction: column;
    }
}
