/* ============================================================
 * 齐e多多客 · 文章前台独立样式
 * 作用：文章列表页 / 内容页 / 关联商品 / 相关文章。
 * 命名空间统一以 .art- 开头，与主站 .qie- 解耦，避免样式冲突。
 * 依赖：Bootstrap 5.3.3 工具类 + 主站 CSS 变量（--qie / --qie-shadow 等）。
 * ============================================================ */

.art-wrap { max-width: 880px; margin: 0 auto; padding: 0 12px; }

/* ---------- 分类筛选（列表页） ---------- */
.art-cats { display: flex; gap: .5rem; overflow-x: auto; padding: .3rem 0 .9rem; scrollbar-width: none; -ms-overflow-style: none; }
.art-cats::-webkit-scrollbar { display: none; }
.art-cat {
    flex: 0 0 auto; padding: .42rem 1rem; border-radius: 999px;
    background: #fff; border: 1px solid #eee; color: #555; font-size: .9rem;
    text-decoration: none; transition: .15s;
}
.art-cat:hover { border-color: var(--qie); color: var(--qie); }
.art-cat.active { background: var(--qie); border-color: var(--qie); color: #fff; }

/* ---------- 列表卡片 ---------- */
.art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.art-card {
    background: #fff; border-radius: 14px; overflow: hidden;
    box-shadow: var(--qie-shadow); transition: transform .15s, box-shadow .15s;
    display: flex; flex-direction: column; text-decoration: none; color: inherit;
}
.art-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(226,46,31,.12); }
.art-card__cover {
    height: 156px; background: linear-gradient(135deg,#ffd9c2,#ffe7d6) center/cover no-repeat;
    display: flex; align-items: center; justify-content: center; font-size: 2.4rem;
}
.art-card__body { padding: 1rem; display: flex; flex-direction: column; flex: 1; }
.art-card__cat {
    align-self: flex-start; font-size: .72rem; color: var(--qie);
    background: #fff1ef; border: 1px solid #ffd9d3; border-radius: 999px;
    padding: .1rem .6rem; margin-bottom: .5rem;
}
.art-card__title {
    font-weight: 700; font-size: .98rem; line-height: 1.45; margin: 0 0 .5rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.art-card__summary {
    font-size: .82rem; color: #8a8a93; line-height: 1.5; margin-bottom: .6rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.art-card__meta { margin-top: auto; font-size: .76rem; color: #a0a0a8; display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.art-card__goods { font-size: .72rem; color: #1a8c5a; background: #eafaf1; border-radius: 999px; padding: .1rem .55rem; }

/* ---------- 分页 ---------- */
.art-pager { display: flex; justify-content: center; gap: .4rem; margin: 1.6rem 0; flex-wrap: wrap; }
.art-pager a, .art-pager span {
    min-width: 36px; text-align: center; padding: .42rem .7rem; border-radius: 10px;
    border: 1px solid #eee; color: #555; text-decoration: none; font-size: .85rem;
}
.art-pager a:hover { border-color: var(--qie); color: var(--qie); }
.art-pager .active { background: var(--qie); border-color: var(--qie); color: #fff; }
.art-pager .disabled { color: #ccc; pointer-events: none; }

/* ---------- 内容页 ---------- */
.art-detail { max-width: 760px; margin: 0 auto; padding: 0 12px 3rem; }
.art-detail__cover { width: 100%; border-radius: 14px; margin: 1rem 0; max-height: 380px; object-fit: cover; }
.art-detail__title { font-size: 1.5rem; font-weight: 800; line-height: 1.4; margin: .5rem 0; }
.art-detail__meta { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: #9aa0a8; border-bottom: 1px solid #f0f0f2; padding-bottom: .8rem; margin-bottom: 1.2rem; }
.art-detail__meta b { color: #555; font-weight: 600; }
.art-content { font-size: 16px; line-height: 1.9; color: #2a2a30; word-break: break-word; }
.art-content p { margin: 0 0 16px; }
.art-content h1, .art-content h2, .art-content h3, .art-content h4 { margin: 22px 0 12px; font-weight: 700; line-height: 1.4; }
.art-content h1 { font-size: 24px; } .art-content h2 { font-size: 21px; } .art-content h3 { font-size: 18px; } .art-content h4 { font-size: 16px; }
.art-content img { max-width: 100%; border-radius: 8px; margin: 8px 0; }
.art-content a { color: var(--qie); text-decoration: underline; }
.art-content blockquote { border-left: 3px solid var(--qie); background: #fff5f3; padding: 10px 14px; color: #4b5563; margin: 16px 0; border-radius: 0 8px 8px 0; }
.art-content pre { background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 8px; overflow: auto; font-family: 'Fira Code', Consolas, monospace; font-size: 13px; }
.art-content table { border-collapse: collapse; width: 100%; margin: 14px 0; }
.art-content th, .art-content td { border: 1px solid #e5e7eb; padding: 8px; }
.art-content th { background: #f6f7f9; }
.art-content hr { border: 0; border-top: 1px solid #eee; margin: 20px 0; }
.art-content ul, .art-content ol { padding-left: 1.4rem; margin: 0 0 16px; }

/* ---------- 文内商品卡片（编辑器插入） ---------- */
.art-content .qie-art-card {
    display: flex;
    gap: 14px;
    align-items: stretch;
    background: #fff;
    border: 1px solid #f0f0f2;
    border-radius: 16px;
    padding: 14px;
    margin: 20px 0;
    box-shadow: var(--qie-shadow);
    transition: transform .18s ease, box-shadow .18s ease;
    cursor: pointer;
    overflow: hidden;
}
.art-content .qie-art-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--qie-shadow-hover);
}
.qie-art-card__img {
    flex: 0 0 auto;
    width: 110px;
    height: 110px;
    border-radius: 12px;
    overflow: hidden;
    background: #f6f8fb;
    align-self: center;
}
.qie-art-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}
.art-content .qie-art-card:hover .qie-art-card__img img {
    transform: scale(1.05);
}
.qie-art-card__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
}
.qie-art-card__title {
    font-weight: 700;
    font-size: 1.02rem;
    line-height: 1.5;
    color: #1f1f26;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.qie-art-card__price {
    color: var(--qie);
    font-weight: 800;
    font-size: 1.25rem;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.qie-art-card__price::before {
    content: '券后价';
    font-size: .68rem;
    font-weight: 600;
    color: #fff;
    background: var(--qie);
    padding: 2px 6px;
    border-radius: 999px;
    line-height: 1;
}
.qie-art-card__coupon {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: #fff7e6;
    color: #fa8c16;
    border: 1px solid #ffd8a8;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    padding: 2px 8px;
}
.qie-art-card__btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: linear-gradient(135deg, #ff7a45, var(--qie));
    color: #fff;
    font-size: .85rem;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(226, 46, 31, .18);
    margin-top: auto;
    transition: transform .15s ease, box-shadow .15s ease;
    pointer-events: none;
}
.art-content .qie-art-card:hover .qie-art-card__btn {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(226, 46, 31, .24);
}

@media (max-width: 575.98px) {
    .art-content .qie-art-card {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .qie-art-card__img {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        max-height: 220px;
        align-self: stretch;
    }
    .qie-art-card__title {
        font-size: .98rem;
    }
    .qie-art-card__btn {
        align-self: stretch;
    }
}

/* ---------- 关联商品（内容页） ---------- */
.art-goods { margin: 2rem 0; }
.art-goods__hint { font-size: .82rem; color: #9aa0a8; margin-top: .4rem; }

/* ---------- 相关文章（内容页 / 商品详情页共用） ---------- */
.art-related { margin: 2rem 0; }
.art-related__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem; }
.art-related__item {
    display: flex; gap: .7rem; padding: .7rem; background: #fff; border-radius: 12px;
    box-shadow: var(--qie-shadow); text-decoration: none; color: inherit; transition: .15s;
}
.art-related__item:hover { transform: translateY(-2px); box-shadow: var(--qie-shadow-hover); }
.art-related__cover { width: 64px; height: 64px; border-radius: 8px; background: #f3f3f5 center/cover no-repeat; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.art-related__title { font-size: .88rem; font-weight: 600; line-height: 1.4; }

/* 商品详情页内的横向相关文章 */
.art-rel-articles { display: flex; gap: .8rem; overflow-x: auto; padding-bottom: .5rem; scrollbar-width: thin; }
.art-rel-articles::-webkit-scrollbar { height: 6px; }
.art-rel-articles::-webkit-scrollbar-thumb { background: #e2e2e6; border-radius: 999px; }
.art-rel-article { flex: 0 0 auto; width: 120px; text-decoration: none; color: inherit; }
.art-rel-article__cover { width: 120px; height: 120px; border-radius: 12px; background: #f3f3f5 center/cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.art-rel-article__cover--ph { background: linear-gradient(135deg,#ffe7d6,#ffd9c2); }
.art-rel-article__title { font-size: .8rem; line-height: 1.4; margin-top: .4rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.art-more { color: var(--qie); }

/* 空状态 */
.art-empty { text-align: center; color: #a0a0a8; padding: 3rem 1rem; }
