/* ================================================================
   Article page common styles — shared by all blog detail pages.
   DO NOT inline any of these styles in individual article HTML files.
   ================================================================ */

/* ------------------------------------------------------------------
   Page layout: two-column grid (main + sidebar)
   ------------------------------------------------------------------ */
.article-page-wrap {
    display: grid;
    grid-template-columns: 1fr 268px;
    gap: 3.5rem;
    max-width: 1600px;
    margin: 0 auto;
    padding: calc(var(--nav-h) + 4.5rem) clamp(32px, 7vw, 140px) 8rem;
    align-items: start;
}

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

/* ------------------------------------------------------------------
   Breadcrumb navigation (injected by article-recommend.js)
   ------------------------------------------------------------------ */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    font-size: 0.78rem;
    color: var(--text-400);
    font-family: var(--font-display);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

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

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

.breadcrumb-sep {
    color: var(--text-400);
    opacity: 0.35;
}

.breadcrumb-current {
    color: var(--text-300);
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ------------------------------------------------------------------
   Article header (injected by article-recommend.js).
   NOTE: must use <div class="article-header"> — never <header>,
   which conflicts with main.css global .navbar fixed positioning.
   ------------------------------------------------------------------ */
.article-header {
    margin-bottom: 3rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--line-strong);
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 1.5rem;
}

.article-tag {
    font-family: var(--font-display);
    font-size: 0.6rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold);
    border: 1px solid rgba(179, 155, 117, 0.35);
    padding: 4px 12px;
}

.article-tag.tag-latest {
    background: var(--gold);
    color: var(--bg-base);
    border-color: var(--gold);
}

.article-header h1 {
    font-family: var(--font-body);
    font-size: clamp(1.55rem, 2.8vw, 2.2rem);
    font-weight: 700;
    color: var(--text-100);
    line-height: 1.35;
    margin-bottom: 1.4rem;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.4rem;
    font-size: 0.78rem;
    color: var(--text-400);
    font-family: var(--font-display);
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

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

.article-meta-item svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
    stroke-width: 1.5;
}

.article-summary {
    font-size: 1rem;
    color: var(--text-300);
    line-height: 1.85;
    font-weight: 300;
    border-left: 3px solid var(--gold);
    padding-left: 1.5rem;
    background: rgba(179, 155, 117, 0.04);
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    padding-right: 1rem;
}

/* ------------------------------------------------------------------
   Article body content
   ------------------------------------------------------------------ */
.article-body {
    color: var(--text-200);
    font-size: 1rem;
    line-height: 1.85;
}

.article-body h2 {
    font-family: var(--font-body);
    font-size: clamp(1.15rem, 2.2vw, 1.5rem);
    font-weight: 700;
    color: var(--text-100);
    margin: 3rem 0 1.2rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--line-strong);
    scroll-margin-top: calc(var(--nav-h) + 1.5rem);
}

.article-body h3 {
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-100);
    margin: 2rem 0 0.7rem;
    scroll-margin-top: calc(var(--nav-h) + 1.5rem);
}

.article-body p {
    margin-bottom: 1.2rem;
    color: var(--text-200);
}

.article-body ul,
.article-body ol {
    padding-left: 1.6rem;
    margin-bottom: 1.5rem;
    list-style: revert;
}

.article-body li {
    margin-bottom: 0.5rem;
    color: var(--text-200);
    line-height: 1.75;
}

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

.article-body em {
    color: var(--gold);
    font-style: normal;
}

.article-body a {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(179, 155, 117, 0.4);
}

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

/* Inline code */
.article-body code {
    font-family: 'Fira Code', 'Cascadia Code', Consolas, 'Courier New', monospace;
    font-size: 0.87em;
    background: var(--bg-panel);
    border: 1px solid var(--line-strong);
    padding: 2px 7px;
    color: var(--gold);
    border-radius: 2px;
}

/* Code blocks */
.article-body pre {
    background: var(--bg-panel);
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--gold);
    padding: 1.4rem 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0 2rem;
    position: relative;
}

.article-body pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.875rem;
    color: var(--text-200);
    line-height: 1.72;
}

/* Callout / tip / warning boxes */
.callout {
    padding: 1.1rem 1.4rem;
    border-left: 3px solid var(--gold);
    background: rgba(179, 155, 117, 0.05);
    margin: 1.5rem 0 2rem;
}

.callout-tip {
    border-left-color: #4caf88;
    background: rgba(76, 175, 136, 0.05);
}

.callout-warning {
    border-left-color: #e09b3d;
    background: rgba(224, 155, 61, 0.05);
}

.callout strong {
    display: block;
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 0.45rem;
    color: var(--gold);
}

.callout-tip strong { color: #4caf88; }
.callout-warning strong { color: #e09b3d; }

.callout p { margin-bottom: 0; }

/* Tables */
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0 2rem;
    font-size: 0.9rem;
    display: block;
    overflow-x: auto;
}

.article-body th {
    text-align: left;
    padding: 0.7rem 1rem;
    background: var(--bg-panel);
    border-bottom: 2px solid var(--gold);
    font-family: var(--font-display);
    font-size: 0.72rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-300);
    white-space: nowrap;
}

.article-body td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--line);
    color: var(--text-200);
    vertical-align: top;
    line-height: 1.6;
}

.article-body tr:last-child td { border-bottom: none; }
.article-body tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* Horizontal rule */
.article-body hr {
    border: none;
    border-top: 1px solid var(--line-strong);
    margin: 2.5rem 0;
}

/* ------------------------------------------------------------------
   TOC sidebar
   ------------------------------------------------------------------ */
.article-sidebar {
    position: sticky;
    top: calc(var(--nav-h) + 2rem);
    max-height: calc(100vh - var(--nav-h) - 4rem);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}

.toc-card {
    background: var(--bg-panel);
    border: 1px solid var(--line-strong);
    padding: 1.5rem;
}

.toc-title {
    font-family: var(--font-display);
    font-size: 0.68rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.toc-list li { margin-bottom: 0; }

.toc-list li a {
    display: block;
    font-size: 0.8rem;
    color: var(--text-400);
    padding: 0.45rem 0.8rem;
    border-left: 2px solid transparent;
    transition: all 0.2s;
    line-height: 1.45;
}

.toc-list li a:hover {
    color: var(--text-200);
    border-left-color: var(--line-strong);
}

.toc-list li a.active {
    color: var(--gold);
    border-left-color: var(--gold);
    background: rgba(179, 155, 117, 0.05);
}

/* ------------------------------------------------------------------
   Product recommendation section (injected after article body)
   ------------------------------------------------------------------ */
.product-recommend {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--line-strong);
}

.recommend-label {
    font-family: var(--font-display);
    font-size: 0.68rem;
    color: var(--gold);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 1.8rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.recommend-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

.recommend-box {
    background: var(--bg-panel);
    border: 1px solid var(--line-strong);
    padding: clamp(2rem, 4vw, 3rem);
    position: relative;
    overflow: hidden;
}

.recommend-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), transparent);
}

.recommend-box-title {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 2.2vw, 1.5rem);
    font-weight: 400;
    color: var(--text-100);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.8rem;
}

.recommend-box-desc {
    color: var(--text-300);
    font-size: 0.93rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    max-width: 680px;
}

.recommend-features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 0.7rem;
    margin-bottom: 2rem;
    list-style: none;
    padding: 0;
}

.recommend-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.88rem;
    color: var(--text-200);
    line-height: 1.55;
}

.recommend-features li::before {
    content: '→';
    color: var(--gold);
    font-family: var(--font-display);
    flex-shrink: 0;
    margin-top: 1px;
}

/* ------------------------------------------------------------------
   Floating download widget
   ------------------------------------------------------------------ */
.float-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 296px;
    background: var(--bg-panel);
    border: 1px solid var(--line-strong);
    border-top: 2px solid var(--gold);
    padding: 1.4rem 1.4rem 1.4rem;
    z-index: 200;
    transform: translateY(calc(100% + 3rem));
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.19, 1, 0.22, 1),
                opacity 0.35s ease;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
    pointer-events: none;
}

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

.float-close {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-400);
    background: none;
    border: none;
    font-size: 0.9rem;
    line-height: 1;
    transition: color 0.2s;
    padding: 0;
}

.float-close:hover { color: var(--text-100); }

.float-widget-label {
    font-family: var(--font-display);
    font-size: 0.58rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.7rem;
}

.float-widget-title {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-100);
    line-height: 1.4;
    margin-bottom: 0.6rem;
}

.float-widget-desc {
    font-size: 0.78rem;
    color: var(--text-400);
    line-height: 1.6;
    margin-bottom: 1.1rem;
}

/* ------------------------------------------------------------------
   Previous / Next article navigation (injected by article-recommend.js)
   ------------------------------------------------------------------ */
.article-nav {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 1px solid var(--line-strong);
}

.article-nav-label {
    font-family: var(--font-display);
    font-size: 0.68rem;
    color: var(--gold);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.article-nav-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

.article-nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.article-nav-card {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 1.4rem 1.6rem;
    background: var(--bg-panel);
    border: 1px solid var(--line-strong);
    border-top: 2px solid transparent;
    text-decoration: none;
    transition: border-top-color 0.25s ease, background 0.25s ease;
}

.article-nav-card:hover {
    border-top-color: var(--gold);
    background: rgba(179, 155, 117, 0.04);
}

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

.article-nav-dir {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-display);
    font-size: 0.62rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold);
}

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

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

.article-nav-kws {
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    color: var(--text-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ------------------------------------------------------------------
   Related Articles section (injected by article-recommend.js)
   ------------------------------------------------------------------ */
.related-articles {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 1px solid var(--line-strong);
}

.related-label {
    font-family: var(--font-display);
    font-size: 0.68rem;
    color: var(--gold);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.related-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

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

.related-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.4rem 1.6rem;
    background: var(--bg-panel);
    border: 1px solid var(--line-strong);
    border-left: 2px solid transparent;
    text-decoration: none;
    transition: border-left-color 0.25s ease, background 0.25s ease;
}

.related-card:hover {
    border-left-color: var(--gold);
    background: rgba(179, 155, 117, 0.04);
}

.related-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.related-card-cat {
    font-family: var(--font-display);
    font-size: 0.58rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold);
    border: 1px solid rgba(179, 155, 117, 0.35);
    padding: 3px 8px;
    white-space: nowrap;
}

.related-card-date {
    font-family: var(--font-display);
    font-size: 0.62rem;
    letter-spacing: 0.5px;
    color: var(--text-400);
    white-space: nowrap;
}

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

.related-card-excerpt {
    font-size: 0.8rem;
    color: var(--text-300);
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-card-kws {
    font-family: var(--font-display);
    font-size: 0.68rem;
    letter-spacing: 0.5px;
    color: var(--text-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

    .article-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .article-page-wrap {
        padding-top: calc(var(--nav-h) + 2.5rem);
        padding-bottom: 5rem;
    }

    .article-body h2 {
        margin-top: 2rem;
    }

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

    .article-nav-links,
    .related-grid {
        grid-template-columns: 1fr;
    }

    .article-nav-next {
        text-align: left;
    }

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

    .float-widget {
        width: calc(100vw - 2rem);
        right: 1rem;
        bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .article-header h1 {
        font-size: 1.4rem;
    }

    .article-body {
        font-size: 0.95rem;
    }
}
