/* article.css - Common styles for zh-CN article detail pages */

/* ─── Page layout ─── */
.article-page-wrap {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 80px;
    gap: 40px;
    align-items: flex-start;
}

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

.article-sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 88px;
}

/* ─── Breadcrumb ─── */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    color: var(--text-gray);
    margin-bottom: 24px;
    line-height: 1.5;
}

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

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

.breadcrumb-sep {
    color: #ccc;
    font-size: 10px;
    display: inline-flex;
    align-items: center;
}

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

/* ─── Article header ─── */
.article-header {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 2px solid var(--divider);
}

.art-meta-top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.art-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.art-tag {
    background: rgba(217, 77, 136, 0.1);
    color: var(--brand-pink);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
}

.art-badge-latest {
    background: var(--gradient-main);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.3px;
}

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

.art-meta-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-gray);
    margin-bottom: 16px;
}

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

.art-summary {
    font-size: 16px;
    color: var(--text-gray);
    line-height: 1.7;
    border-left: 4px solid var(--brand-pink);
    padding-left: 16px;
    margin: 0;
    background: rgba(217, 77, 136, 0.03);
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
}

/* ─── Article body typography ─── */
.article-body {
    line-height: 1.8;
    font-size: 16px;
    color: var(--text-dark);
    overflow-wrap: break-word;
    word-break: break-word;
}

.article-body h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 44px 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--divider);
    line-height: 1.3;
    scroll-margin-top: 88px;
}

.article-body h3 {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 28px 0 12px;
    scroll-margin-top: 88px;
}

.article-body h4 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 20px 0 8px;
    scroll-margin-top: 88px;
}

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

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

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

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

.article-body a {
    color: var(--brand-pink);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

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

.article-body strong {
    font-weight: 700;
}

.article-body em {
    font-style: italic;
}

.article-body code {
    background: rgba(64, 51, 99, 0.08);
    color: var(--brand-purple);
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
    word-break: break-all;
}

.article-body pre {
    background: #1e1b2e;
    color: #e2d9f3;
    border-radius: 12px;
    padding: 20px 24px;
    overflow-x: auto;
    margin: 0 0 24px;
    font-size: 14px;
    line-height: 1.65;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.14);
}

.article-body pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: inherit;
    border-radius: 0;
    word-break: normal;
}

.article-body blockquote {
    background: var(--bg-light);
    border-left: 4px solid var(--brand-pink);
    border-radius: 0 8px 8px 0;
    padding: 14px 20px;
    margin: 0 0 20px;
    color: var(--text-gray);
    font-style: italic;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    font-size: 14px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(64, 51, 99, 0.06);
}

.article-body th,
.article-body td {
    border: 1px solid var(--divider);
    padding: 10px 14px;
    text-align: left;
}

.article-body th {
    background: var(--bg-light);
    font-weight: 700;
    color: var(--text-dark);
}

.article-body td {
    color: var(--text-dark);
}

.article-body tr:hover td {
    background: rgba(217, 77, 136, 0.025);
}

.article-body img {
    max-width: 100%;
    height: auto;
}

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

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

.callout-tip i { color: #00c878; flex-shrink: 0; margin-top: 2px; }

.callout-warn {
    background: rgba(255, 180, 0, 0.07);
    border: 1px solid rgba(255, 180, 0, 0.25);
}

.callout-warn i { color: #f5a623; flex-shrink: 0; margin-top: 2px; }

.callout-info {
    background: rgba(64, 51, 99, 0.055);
    border: 1px solid rgba(64, 51, 99, 0.12);
}

.callout-info i { color: var(--brand-purple); flex-shrink: 0; margin-top: 2px; }

/* ─── TOC Sidebar ─── */
.toc-card {
    background: var(--bg-white);
    border: 1px solid var(--divider);
    border-radius: 14px;
    padding: 20px 20px 16px;
    box-shadow: var(--shadow-card);
}

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

.toc-title i {
    color: var(--brand-pink);
}

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

.toc-list li a {
    display: block;
    font-size: 13px;
    color: var(--text-gray);
    padding: 6px 8px;
    border-radius: 7px;
    text-decoration: none;
    transition: all 0.18s;
    line-height: 1.45;
    border-left: 2px solid transparent;
}

.toc-list li a:hover {
    color: var(--brand-pink);
    background: rgba(217, 77, 136, 0.05);
}

.toc-list li a.toc-active {
    color: var(--brand-pink);
    font-weight: 600;
    background: rgba(217, 77, 136, 0.07);
    border-left-color: var(--brand-pink);
}

/* ─── Product Recommend ─── */
.product-recommend {
    margin-top: 52px;
    background: linear-gradient(135deg, #f8f4ff 0%, #fff0f6 100%);
    border: 1px solid rgba(217, 77, 136, 0.16);
    border-radius: 20px;
    padding: 36px 40px;
    display: flex;
    gap: 28px;
    align-items: flex-start;
    box-shadow: 0 8px 32px rgba(217, 77, 136, 0.07);
}

.recommend-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.recommend-icon img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    display: block;
}

.recommend-content {
    flex: 1;
}

.recommend-content h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.recommend-content p {
    font-size: 14px;
    color: var(--text-gray);
    margin-bottom: 16px;
    line-height: 1.65;
}

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

.recommend-features li {
    font-size: 13px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.recommend-features li i {
    color: var(--brand-pink);
    font-size: 12px;
    flex-shrink: 0;
}

.recommend-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gradient-main);
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 4px 18px rgba(217, 77, 136, 0.3);
}

.recommend-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(217, 77, 136, 0.42);
    text-decoration: none;
}

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

.nav-article-card {
    display: block;
    background: var(--bg-white);
    border: 1px solid var(--divider);
    border-radius: 14px;
    padding: 18px 20px;
    text-decoration: none;
    color: inherit;
    transition: all 0.28s;
    box-shadow: var(--shadow-card);
}

.nav-article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(217, 77, 136, 0.22);
    text-decoration: none;
    color: inherit;
}

.nav-direction {
    font-size: 11px;
    color: var(--text-gray);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-article-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.nav-article-tags span {
    font-size: 11px;
    background: rgba(64, 51, 99, 0.06);
    color: var(--text-gray);
    padding: 2px 8px;
    border-radius: 10px;
}

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

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

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

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

.related-heading {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.related-heading i {
    color: var(--brand-pink);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.related-card {
    display: block;
    background: var(--bg-white);
    border: 1px solid var(--divider);
    border-radius: 14px;
    padding: 18px;
    text-decoration: none;
    color: inherit;
    transition: all 0.28s;
    box-shadow: var(--shadow-card);
}

.related-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(217, 77, 136, 0.2);
    text-decoration: none;
    color: inherit;
}

.related-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 18px;
    color: white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.related-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.45;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.related-card-tags span {
    font-size: 10px;
    background: rgba(64, 51, 99, 0.06);
    color: var(--text-gray);
    padding: 2px 7px;
    border-radius: 8px;
}

/* ─── Float widget ─── */
.float-widget {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 300px;
    background: var(--bg-white);
    border-radius: 18px;
    box-shadow: 0 12px 44px rgba(64, 51, 99, 0.18), 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--divider);
    padding: 22px 20px 18px;
    z-index: 800;
    transform: translateY(24px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.float-widget-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: rgba(0, 0, 0, 0.06);
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 3px 7px;
    border-radius: 5px;
    transition: all 0.2s;
}

.float-widget-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-dark);
}

.float-widget-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

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

.float-widget h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
    padding-right: 24px;
}

.float-widget p {
    font-size: 12px;
    color: var(--text-gray);
    line-height: 1.55;
    margin-bottom: 14px;
}

.float-widget-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--gradient-main);
    color: white;
    padding: 10px 0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s;
}

.float-widget-btn:hover {
    opacity: 0.88;
    transform: scale(1.02);
    text-decoration: none;
    color: white;
}

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

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

    .product-recommend {
        flex-direction: column;
        padding: 28px 24px;
    }
}

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

    .art-title {
        font-size: 24px;
    }

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

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

    .float-widget {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        border-radius: 18px 18px 0 0;
        border-bottom: none;
        padding: 18px 20px 24px;
    }

    .article-body table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }

    .article-body pre {
        font-size: 13px;
        padding: 16px;
    }
}

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

    .art-title {
        font-size: 21px;
    }
}
