/* =========================================
   Article Page — Common Styles
   Used by all blog detail pages (blog/articles/*.html)
   Loaded alongside main.css; never duplicate main.css rules.
   ========================================= */

/* ---- Page Layout ---- */
.article-page-wrap {
    display: flex;
    gap: 32px;
    max-width: 1160px;
    margin: 0 auto;
    padding: 104px 24px 60px;
    align-items: flex-start;
}

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

/* ---- Breadcrumb ---- */
.breadcrumb {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    color: var(--text-sub, #7A6A62);
    margin-bottom: 24px;
    padding: 8px 14px;
    background: var(--bg-gray, #F2EBE4);
    border-radius: 8px;
}

.breadcrumb a {
    color: var(--text-sub, #7A6A62);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--brand-orange, #BF5A1A);
}

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

.breadcrumb-current {
    color: var(--text-main, #1A1A1A);
    font-weight: 500;
}

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

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

.article-tag {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(191, 90, 26, 0.08);
    color: var(--brand-orange, #BF5A1A);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.article-tag.tag-latest {
    background: var(--brand-orange, #BF5A1A);
    color: #fff;
}

.article-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-main, #1A1A1A);
    margin-bottom: 14px;
}

.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--text-sub, #7A6A62);
    margin-bottom: 16px;
}

.article-meta i {
    margin-right: 4px;
    color: var(--brand-orange, #BF5A1A);
    opacity: 0.7;
}

.article-summary {
    font-size: 15px;
    color: var(--text-sub, #7A6A62);
    line-height: 1.7;
    padding: 16px 20px;
    background: var(--bg-gray, #F2EBE4);
    border-left: 4px solid var(--brand-orange, #BF5A1A);
    border-radius: 0 8px 8px 0;
}

/* ---- Divider ---- */
.article-divider {
    height: 1px;
    background: var(--border-color, #EAEAEA);
    margin: 28px 0;
}

/* ---- Article Body ---- */
.article-body {
    font-size: 15.5px;
    line-height: 1.85;
    color: var(--text-main, #1A1A1A);
}

.article-body h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 40px 0 16px;
    color: var(--text-main, #1A1A1A);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--bg-gray, #F2EBE4);
}

.article-body h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 28px 0 12px;
    color: var(--brand-dark, #2C1F18);
}

.article-body h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 20px 0 8px;
    color: var(--text-main, #1A1A1A);
}

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

.article-body ul,
.article-body ol {
    margin: 12px 0 16px 24px;
    list-style: initial;
}

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

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

.article-body a {
    color: var(--brand-orange, #BF5A1A);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-body a:hover {
    opacity: 0.8;
}

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

.article-body em {
    font-style: italic;
    color: var(--text-sub, #7A6A62);
}

/* Code blocks */
.article-body pre {
    background: #1A1C21;
    color: #E8E8E8;
    border-radius: 10px;
    padding: 18px 20px;
    overflow-x: auto;
    font-size: 13.5px;
    line-height: 1.65;
    margin: 20px 0;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.article-body code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 13px;
    background: rgba(191, 90, 26, 0.08);
    color: #C0430A;
    padding: 2px 6px;
    border-radius: 4px;
}

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

/* Tables */
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

.article-body th {
    background: var(--bg-gray, #F2EBE4);
    font-weight: 600;
    padding: 10px 14px;
    text-align: left;
    border: 1px solid var(--border-color, #EAEAEA);
}

.article-body td {
    padding: 10px 14px;
    border: 1px solid var(--border-color, #EAEAEA);
    vertical-align: top;
}

.article-body tr:nth-child(even) td {
    background: #FDFAF7;
}

/* Callout / Tip boxes */
.callout {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 18px;
    border-radius: 10px;
    margin: 20px 0;
    font-size: 14.5px;
    line-height: 1.7;
}

.callout.tip {
    background: rgba(191, 90, 26, 0.06);
    border-left: 4px solid var(--brand-orange, #BF5A1A);
}

.callout.warning {
    background: rgba(245, 158, 11, 0.07);
    border-left: 4px solid #F59E0B;
}

.callout.info {
    background: rgba(59, 130, 246, 0.07);
    border-left: 4px solid #3B82F6;
}

.callout i {
    margin-top: 2px;
    font-size: 16px;
}

.callout.tip i    { color: var(--brand-orange, #BF5A1A); }
.callout.warning i { color: #F59E0B; }
.callout.info i   { color: #3B82F6; }

/* Download CTA inside article body — use higher specificity to override .article-body a color */
.article-body a.article-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--brand-orange, #BF5A1A);
    color: #fff;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
    margin: 8px 0;
}

.article-body a.article-cta:hover {
    background: #A34A14;
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
    opacity: 1;
}

/* ---- Sidebar TOC ---- */
.article-sidebar {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 92px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.1) transparent;
}

.toc-card {
    background: #fff;
    border-radius: 12px;
    padding: 18px 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color, #EAEAEA);
}

.toc-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sub, #7A6A62);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.toc-list li {
    margin: 0;
}

.toc-list a {
    display: block;
    padding: 6px 10px;
    font-size: 13px;
    color: var(--text-sub, #7A6A62);
    border-radius: 6px;
    text-decoration: none;
    line-height: 1.5;
    transition: background 0.15s, color 0.15s;
    border-left: 2px solid transparent;
}

.toc-list a:hover {
    background: var(--bg-gray, #F2EBE4);
    color: var(--text-main, #1A1A1A);
}

.toc-list a.active {
    background: rgba(191, 90, 26, 0.08);
    color: var(--brand-orange, #BF5A1A);
    font-weight: 500;
    border-left-color: var(--brand-orange, #BF5A1A);
}

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

/* ---- Product Recommend Block ---- */
.product-recommend {
    background: linear-gradient(135deg, #FDF8F4 0%, #F5EDE2 100%);
    border: 1px solid rgba(191, 90, 26, 0.15);
    border-radius: 16px;
    padding: 32px;
    margin: 48px 0 32px;
}

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

.product-recommend-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.product-recommend-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.product-recommend-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main, #1A1A1A);
    margin: 0 0 4px;
}

.product-recommend-subtitle {
    font-size: 13px;
    color: var(--text-sub, #7A6A62);
}

.product-recommend-desc {
    font-size: 15px;
    color: var(--text-sub, #7A6A62);
    line-height: 1.7;
    margin-bottom: 18px;
}

.product-recommend-features {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.product-recommend-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-main, #1A1A1A);
    margin: 0;
}

.product-recommend-features li i {
    color: var(--brand-orange, #BF5A1A);
    font-size: 13px;
    width: 16px;
    text-align: center;
}

.product-recommend-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 28px;
    background: var(--brand-orange, #BF5A1A);
    color: #fff;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}

.product-recommend-btn:hover {
    background: #A34A14;
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

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

.article-nav-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--border-color, #EAEAEA);
    border-radius: 12px;
    text-decoration: none;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.article-nav-item:hover {
    border-color: var(--brand-orange, #BF5A1A);
    box-shadow: 0 4px 16px rgba(191, 90, 26, 0.1);
    text-decoration: none;
}

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

.article-nav-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-sub, #7A6A62);
    display: flex;
    align-items: center;
    gap: 5px;
}

.article-nav-item.nav-next .article-nav-label {
    flex-direction: row-reverse;
}

.article-nav-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main, #1A1A1A);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-nav-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

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

.article-nav-tag {
    font-size: 11px;
    padding: 2px 8px;
    background: var(--bg-gray, #F2EBE4);
    color: var(--text-sub, #7A6A62);
    border-radius: 20px;
}

/* ---- Related Articles ---- */
.article-related {
    margin: 16px 0 48px;
}

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

.article-related-title i {
    color: var(--brand-orange, #BF5A1A);
}

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

.article-related-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--border-color, #EAEAEA);
    border-radius: 10px;
    text-decoration: none;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.article-related-card:hover {
    border-color: var(--brand-orange, #BF5A1A);
    box-shadow: 0 4px 14px rgba(191, 90, 26, 0.08);
    text-decoration: none;
}

.article-related-card-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-main, #1A1A1A);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.article-related-tag {
    font-size: 11px;
    padding: 2px 7px;
    background: var(--bg-gray, #F2EBE4);
    color: var(--text-sub, #7A6A62);
    border-radius: 20px;
}

/* ---- Floating Widget ---- */
.float-widget {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 280px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.14);
    padding: 20px;
    z-index: 500;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    border: 1px solid rgba(191, 90, 26, 0.12);
}

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

.float-widget-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-sub, #7A6A62);
    font-size: 13px;
    border-radius: 50%;
    transition: background 0.15s;
}

.float-widget-close:hover {
    background: var(--bg-gray, #F2EBE4);
    color: var(--text-main, #1A1A1A);
}

.float-widget-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    overflow: hidden;
}
.float-widget-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.float-widget-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main, #1A1A1A);
    margin-bottom: 4px;
}

.float-widget-desc {
    font-size: 12.5px;
    color: var(--text-sub, #7A6A62);
    line-height: 1.6;
    margin-bottom: 12px;
}

.float-widget-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: var(--brand-orange, #BF5A1A);
    color: #fff;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.float-widget-btn:hover {
    background: #A34A14;
    color: #fff;
    text-decoration: none;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .article-sidebar {
        display: none;
    }

    .article-page-wrap {
        padding: 88px 20px 48px;
    }
}

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

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

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

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

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

    .float-widget {
        bottom: 16px;
        right: 12px;
        left: 12px;
        width: auto;
        border-radius: 12px;
        padding: 16px;
    }

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

@media (max-width: 480px) {
    .article-related-grid {
        grid-template-columns: 1fr;
    }

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

    .article-body pre {
        font-size: 12px;
        padding: 14px 14px;
    }
}

/* Article detail page: hide back-to-top FAB */
.floating-action-group { display: none !important; }
