/* ============================================================
   article.css — Shared styles for zh-CN blog article detail pages.
   DO NOT inline any of these styles in individual article HTML files.
   All UI components are injected by article-recommend.js.
   ============================================================ */

/* ── Layout ─────────────────────────────────────────────── */
.article-page-wrap {
    display: flex;
    gap: 40px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 120px 5vw 80px;
    align-items: flex-start;
}

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

/* ── Sidebar TOC ─────────────────────────────────────────── */
.article-sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 96px;
}

.toc-card {
    background: #f8f9fa;
    border: 1px solid #e8eaed;
    border-radius: 16px;
    padding: 20px 20px 16px;
}

.toc-title {
    font-size: 0.82rem;
    font-weight: 500;
    color: #5f6368;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 7px;
}

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

.toc-list li a {
    display: block;
    font-size: 0.85rem;
    color: #5f6368;
    padding: 5px 8px;
    border-radius: 8px;
    line-height: 1.4;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
    border-left: 2px solid transparent;
}

.toc-list li a:hover {
    background: #e8eaed;
    color: #111;
}

.toc-list li a.active {
    background: #e8f0fe;
    color: #1a73e8;
    border-left-color: #1a73e8;
    font-weight: 500;
}

/* ── Breadcrumb ──────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: #5f6368;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

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

.breadcrumb a:hover {
    color: #111;
}

.breadcrumb .sep {
    color: #bdc1c6;
    font-size: 0.75rem;
}

.breadcrumb .current {
    color: #111;
    font-weight: 400;
}

/* ── Article Header ─────────────────────────────────────── */
.article-header {
    margin-bottom: 36px;
    padding-bottom: 28px;
    border-bottom: 1px solid #e8eaed;
}

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

.article-tag {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 500;
    background: #e8f0fe;
    color: #1a73e8;
    letter-spacing: 0.01em;
}

.article-tag.latest {
    background: #e6f4ea;
    color: #137333;
}

.article-header h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 500;
    line-height: 1.35;
    color: #111;
    margin-bottom: 16px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 0.83rem;
    color: #5f6368;
}

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

.article-summary {
    margin-top: 16px;
    font-size: 0.97rem;
    color: #444;
    line-height: 1.7;
    padding: 16px 20px;
    background: #f8f9fa;
    border-left: 3px solid #1a73e8;
    border-radius: 0 10px 10px 0;
}

/* ── Article Body ────────────────────────────────────────── */
.article-body {
    font-size: 1rem;
    line-height: 1.85;
    color: #222;
}

.article-body h2 {
    font-size: 1.3rem;
    font-weight: 500;
    color: #111;
    margin: 40px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8eaed;
}

.article-body h3 {
    font-size: 1.1rem;
    font-weight: 500;
    color: #111;
    margin: 28px 0 12px;
}

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

.article-body ul,
.article-body ol {
    padding-left: 24px;
    margin-bottom: 16px;
    list-style: revert;
}

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

.article-body a {
    color: #1a73e8;
    text-decoration: underline;
    text-underline-offset: 2px;
}

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

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

.article-body code {
    font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
    font-size: 0.88em;
    background: #f1f3f4;
    padding: 2px 6px;
    border-radius: 5px;
    color: #c7254e;
}

.article-body pre {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 20px 24px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 20px 0;
    font-size: 0.88rem;
    line-height: 1.65;
}

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

.article-body blockquote {
    border-left: 3px solid #1a73e8;
    margin: 20px 0;
    padding: 12px 18px;
    background: #f8f9fa;
    border-radius: 0 8px 8px 0;
    color: #444;
    font-style: normal;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.9rem;
}

.article-body th,
.article-body td {
    padding: 10px 14px;
    border: 1px solid #e8eaed;
    text-align: left;
}

.article-body th {
    background: #f8f9fa;
    font-weight: 500;
    color: #111;
}

.article-body tr:hover td {
    background: #f8f9fa;
}

/* Callout / tip box */
.callout {
    display: flex;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 10px;
    margin: 20px 0;
    font-size: 0.93rem;
    line-height: 1.65;
}

.callout.tip {
    background: #e6f4ea;
    border-left: 3px solid #34a853;
    color: #1e5128;
}

.callout.warning {
    background: #fef7e0;
    border-left: 3px solid #fbbc04;
    color: #5a3e00;
}

.callout.info {
    background: #e8f0fe;
    border-left: 3px solid #1a73e8;
    color: #1a237e;
}

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

/* ── Product Recommend ───────────────────────────────────── */
.product-recommend {
    margin-top: 48px;
    background: linear-gradient(135deg, #0d1b2a 0%, #1b3a5c 60%, #22577a 100%);
    border-radius: 20px;
    padding: 36px 40px;
    color: #fff;
}

.product-recommend-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.product-recommend-header img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.product-recommend-header h3 {
    font-size: 1.1rem;
    font-weight: 500;
    color: #fff;
    margin: 0;
}

.product-recommend p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.82);
    margin-bottom: 20px;
}

.product-recommend-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-recommend-features li {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.88);
}

.product-recommend-features li i {
    color: #4ade80;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.product-recommend .btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: #0d1b2a;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-recommend .btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

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

.article-nav-prev-next a {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 22px;
    background: #f8f9fa;
    border: 1px solid #e8eaed;
    border-radius: 14px;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.article-nav-prev-next a:hover {
    border-color: #1a73e8;
    background: #f0f4ff;
    transform: translateY(-2px);
}

.article-nav-prev-next .nav-direction {
    font-size: 0.75rem;
    color: #5f6368;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 5px;
}

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

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

.article-nav-prev-next .nav-title {
    font-size: 0.93rem;
    font-weight: 500;
    color: #111;
    line-height: 1.4;
}

.article-nav-prev-next .nav-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

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

.article-nav-prev-next .nav-tag {
    font-size: 0.73rem;
    padding: 2px 9px;
    border-radius: 12px;
    background: #e8eaed;
    color: #5f6368;
}

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

.article-related-title {
    font-size: 1rem;
    font-weight: 500;
    color: #111;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.related-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 18px 14px;
    background: #f8f9fa;
    border: 1px solid #e8eaed;
    border-radius: 14px;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.related-card:hover {
    border-color: #1a73e8;
    background: #f0f4ff;
    transform: translateY(-2px);
}

.related-card-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: #111;
    line-height: 1.45;
}

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

.related-card-tag {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: #e8eaed;
    color: #5f6368;
}

/* ── Float Widget ────────────────────────────────────────── */
.float-widget {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 300px;
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 20px;
    padding: 22px 22px 18px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.14);
    z-index: 900;
    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: 12px;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    color: #bdc1c6;
    font-size: 1rem;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.float-widget-close:hover {
    color: #5f6368;
}

.float-widget-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    margin-bottom: 10px;
}

.float-widget h4 {
    font-size: 0.95rem;
    font-weight: 500;
    color: #111;
    margin-bottom: 6px;
}

.float-widget p {
    font-size: 0.82rem;
    color: #5f6368;
    line-height: 1.55;
    margin-bottom: 14px;
}

.float-widget .btn-float-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 10px 0;
    background: #1f1f1f;
    color: #fff;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}

.float-widget .btn-float-download:hover {
    background: #333;
    transform: translateY(-1px);
}

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

@media (max-width: 768px) {
    .article-page-wrap {
        padding: 90px 5vw 60px;
    }
    .article-header h1 {
        font-size: 1.4rem;
    }
    .article-nav-prev-next {
        grid-template-columns: 1fr;
    }
    .related-grid {
        grid-template-columns: 1fr;
    }
    .product-recommend {
        padding: 24px 22px;
    }
    .float-widget {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        border-radius: 20px 20px 0 0;
        border-bottom: none;
    }
}
