/* Primary page title for non-JS crawlers; paired with JS-injected .article-title in the header block */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* === Article Page Layout === */
.article-page-wrap {
    display: flex;
    gap: 40px;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: calc(var(--nav-height) + 48px) 24px 80px;
    align-items: flex-start;
}

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

/* === Breadcrumb (injected by article-recommend.js) === */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

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

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

.breadcrumb .sep {
    color: var(--border-color);
    font-size: 12px;
}

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

/* === Article Header (injected by article-recommend.js) === */
.article-header {
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
}

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

.article-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(51, 112, 255, 0.08);
    color: var(--brand-primary);
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 500;
}

.article-tag.latest {
    background: rgba(0, 179, 101, 0.1);
    color: #00B365;
}

.article-title {
    font-size: 34px;
    font-weight: 800;
    color: var(--text-title);
    line-height: 1.25;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
}

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

.article-meta i {
    margin-right: 4px;
}

.article-summary {
    margin-top: 20px;
    font-size: 16.5px;
    color: var(--text-body);
    line-height: 1.75;
    background: rgba(51, 112, 255, 0.04);
    border-left: 3px solid var(--brand-primary);
    padding: 16px 20px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* === Article Body === */
.article-body {
    font-size: 16.5px;
    line-height: 1.85;
    color: #374151;
}

.article-body h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-title);
    margin: 52px 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bg-section);
    line-height: 1.3;
    scroll-margin-top: 90px;
}

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

.article-body h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-title);
    margin: 32px 0 14px;
    line-height: 1.35;
    scroll-margin-top: 90px;
}

.article-body h4 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-title);
    margin: 24px 0 10px;
    scroll-margin-top: 90px;
}

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

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

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

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

.article-body li ul,
.article-body li ol {
    margin-top: 8px;
    margin-bottom: 8px;
}

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

.article-body a {
    color: var(--brand-primary);
    text-decoration: underline;
    text-decoration-color: rgba(51, 112, 255, 0.3);
    transition: text-decoration-color 0.2s;
}

.article-body a:hover {
    text-decoration-color: var(--brand-primary);
}

/* Code blocks */
.article-body pre {
    background: #1E2330;
    border-radius: var(--radius-md);
    padding: 24px 28px;
    overflow-x: auto;
    margin: 24px 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.article-body code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
    font-size: 0.9em;
}

.article-body pre code {
    color: #E2E8F0;
    font-size: 14px;
    line-height: 1.75;
    background: none;
    padding: 0;
    border-radius: 0;
}

.article-body :not(pre) > code {
    background: rgba(51, 112, 255, 0.08);
    color: #2558e0;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 0.87em;
    border: 1px solid rgba(51, 112, 255, 0.15);
}

/* Tables */
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 15px;
    display: block;
    overflow-x: auto;
}

.article-body th {
    background: var(--bg-section);
    color: var(--text-title);
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.article-body td {
    padding: 11px 16px;
    border: 1px solid var(--border-color);
    vertical-align: top;
}

.article-body tr:nth-child(even) td {
    background: var(--bg-light);
}

/* Callout boxes */
.callout {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin: 24px 0;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.callout-tip {
    background: rgba(0, 179, 101, 0.07);
    border: 1px solid rgba(0, 179, 101, 0.2);
}

.callout-tip > i {
    color: #00B365;
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.callout-warning {
    background: rgba(255, 125, 0, 0.07);
    border: 1px solid rgba(255, 125, 0, 0.2);
}

.callout-warning > i {
    color: #FF7D00;
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.callout-info {
    background: rgba(51, 112, 255, 0.07);
    border: 1px solid rgba(51, 112, 255, 0.2);
}

.callout-info > i {
    color: var(--brand-primary);
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.callout p {
    margin: 0;
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-body);
}

.callout strong {
    color: var(--text-title);
}

/* === Sidebar TOC === */
.article-sidebar {
    width: 256px;
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--nav-height) + 24px);
    max-height: calc(100vh - var(--nav-height) - 48px);
    overflow-y: auto;
}

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

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

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

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

.toc-list li a:hover {
    background: rgba(51, 112, 255, 0.06);
    color: var(--brand-primary);
    border-left-color: rgba(51, 112, 255, 0.3);
}

.toc-list li a.active {
    background: rgba(51, 112, 255, 0.1);
    color: var(--brand-primary);
    font-weight: 600;
    border-left-color: var(--brand-primary);
}

/* === Product Recommend Section (injected by article-recommend.js) === */
.product-recommend {
    background: linear-gradient(135deg, #EDF4FF 0%, #F3EDFF 100%);
    border: 1px solid rgba(51, 112, 255, 0.15);
    border-radius: var(--radius-xl);
    margin-top: 56px;
    overflow: hidden;
    display: flex;
    align-items: stretch;
}

.product-recommend-brand {
    flex: 0 0 200px;
    background: linear-gradient(160deg, rgba(51, 112, 255, 0.12) 0%, rgba(139, 92, 255, 0.12) 100%);
    border-right: 1px solid rgba(51, 112, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 40px 24px;
}

.product-recommend-logo-img {
    width: 84px;
    height: 84px;
    object-fit: contain;
}

.product-recommend-content {
    flex: 1;
    padding: 36px 40px;
}

.product-recommend-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--gradient-primary);
    color: #fff;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: 0.3px;
}

.product-recommend-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-title);
    margin-bottom: 8px;
    line-height: 1.3;
}

.product-recommend-desc {
    font-size: 14px;
    color: var(--text-body);
    line-height: 1.65;
    margin-bottom: 20px;
}

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

.product-recommend-points li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13.5px;
    color: var(--text-body);
    line-height: 1.5;
}

.product-recommend-points li i {
    color: #00B365;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.product-recommend-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 20px;
    background: var(--gradient-primary);
    color: #fff;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(51, 112, 255, 0.3);
    text-align: center;
    white-space: nowrap;
}

.product-recommend-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(51, 112, 255, 0.4);
    color: #fff;
}

/* === Prev / Next Navigation (injected by article-recommend.js) === */
.article-nav-prev-next {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 28px;
}

.nav-prev-next-item {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-decoration: none !important;
}

.nav-prev-next-item:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

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

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

.nav-pn-title {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-title);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nav-pn-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.nav-pn-tag {
    font-size: 12px;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.04);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
}

/* === Related Articles (injected by article-recommend.js) === */
.article-related {
    margin-top: 28px;
}

.article-related-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-title);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.related-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-decoration: none !important;
}

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

.related-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-title);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.related-card-tag {
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.04);
    padding: 2px 7px;
    border-radius: var(--radius-pill);
}

/* === Floating Download Widget (injected by article-recommend.js) === */
.float-widget {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 284px;
    background: #fff;
    border-radius: var(--radius-xl);
    box-shadow: 0 24px 60px rgba(31, 35, 41, 0.18), 0 0 0 1px rgba(0,0,0,0.04);
    padding: 24px;
    z-index: 500;
    transform: translateY(140%) scale(0.95);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    pointer-events: none;
}

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

.float-widget-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 26px;
    height: 26px;
    border: none;
    background: var(--bg-section);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--text-muted);
    transition: all 0.2s;
}

.float-widget-close:hover {
    background: var(--border-color);
    color: var(--text-title);
}

.float-widget-logo {
    margin-bottom: 14px;
}

.float-widget-logo img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.float-widget-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-title);
    margin-bottom: 6px;
}

.float-widget-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
}

.float-widget-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    background: var(--gradient-primary);
    color: #fff;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(51, 112, 255, 0.25);
    text-decoration: none !important;
}

.float-widget-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(51, 112, 255, 0.35);
}

/* === Responsive Breakpoints === */
@media (max-width: 1100px) {
    .article-sidebar {
        display: none;
    }
    .article-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .article-page-wrap {
        padding: calc(var(--nav-height) + 24px) 16px 60px;
    }
    .article-title {
        font-size: 26px;
    }
    .article-body h2 {
        font-size: 22px;
        margin: 36px 0 14px;
    }
    .article-body h3 {
        font-size: 18px;
    }
    .article-body {
        font-size: 15.5px;
    }
    .product-recommend {
        flex-direction: column;
    }
    .product-recommend-brand {
        flex: none;
        border-right: none;
        border-bottom: 1px solid rgba(51, 112, 255, 0.1);
        flex-direction: row;
        justify-content: flex-start;
        padding: 24px 24px;
        gap: 20px;
    }
    .product-recommend-logo-img {
        width: 64px;
        height: 64px;
    }
    .product-recommend-btn {
        width: auto;
    }
    .product-recommend-content {
        padding: 24px;
    }
    .product-recommend-points {
        grid-template-columns: 1fr;
    }
    .article-nav-prev-next {
        grid-template-columns: 1fr;
    }
    .article-related-grid {
        grid-template-columns: 1fr;
    }
    .float-widget {
        bottom: 16px;
        right: 16px;
        left: 16px;
        width: auto;
        border-radius: var(--radius-lg);
        padding: 20px;
    }
}
