/* ============================================================
   AI全自动获客工具平台 — 文章详情页样式（全新响应式设计）
   依赖 style.css，在其后加载
   适配：手机 / 平板 / 桌面
   ============================================================ */

/* ---------- 页面骨架 ---------- */
/* 文章详情页无 Hero，面包屑需为固定头部留出高度 */
.breadcrumb-bar { margin-top: var(--header-h); }
.article-main {
    padding: 48px 0 72px;
    background: var(--bg);
}
.article-layout {
    display: grid; grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px; align-items: start;
}
.article-content {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 2.8rem 3rem; box-shadow: var(--shadow-sm);
    min-width: 0;
}

/* ---------- 文章头部 ---------- */
.article-page-header { margin-bottom: 1.6rem; }
.article-category-badge {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .35rem .95rem; border-radius: 999px;
    background: rgba(99, 102, 241, .1); color: var(--primary);
    font-size: .85rem; font-weight: 600; margin-bottom: 1rem;
}
.article-page-title {
    font-size: clamp(1.45rem, 3.4vw, 2rem); font-weight: 800;
    color: var(--ink); line-height: 1.4; margin-bottom: 1.1rem;
}
.article-meta-info { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.article-meta-item {
    display: inline-flex; align-items: center; gap: .4rem;
    color: var(--muted); font-size: .88rem;
}
.article-meta-icon { font-size: .95rem; }

/* ---------- 分享/收藏操作条 ---------- */
.article-actions {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
    padding: 1rem 0; margin: 1.4rem 0 1.8rem;
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.article-share { display: flex; align-items: center; gap: .6rem; }
.article-share-label { color: var(--muted); font-size: .9rem; }
.article-share-btn {
    width: 40px; height: 40px; border-radius: 50%;
    background: #f1f5f9; color: var(--ink-2);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem; transition: background .25s, transform .25s;
}
.article-share-btn:hover { background: #e0e7ff; transform: translateY(-2px); }
.article-bookmark {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .55rem 1.2rem; border-radius: 999px;
    background: #f1f5f9; color: var(--ink-2);
    font-size: .9rem; font-weight: 600; font-family: inherit;
    transition: background .25s, color .25s;
}
.article-bookmark:hover { background: #e0e7ff; color: var(--primary); }
.article-bookmark.bookmarked { background: var(--gradient); color: #fff; }

/* ---------- 正文排版 ---------- */
.article-body { color: #334155; font-size: 1rem; line-height: 1.9; }
.article-body > *:first-child { margin-top: 0; }
.article-body p { margin: 0 0 1.15rem; }
.article-body h2 {
    font-size: 1.4rem; font-weight: 700; color: var(--ink);
    margin: 2rem 0 1rem; padding-left: .85rem;
    border-left: 4px solid var(--primary); line-height: 1.4;
}
.article-body h3 {
    font-size: 1.15rem; font-weight: 700; color: var(--ink);
    margin: 1.6rem 0 .8rem;
}
.article-body ul, .article-body ol { margin: 0 0 1.15rem; padding-left: 1.4rem; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: .5rem; }
.article-body a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.article-body img {
    max-width: 100%; height: auto; border-radius: 12px;
    margin: 1.4rem auto; box-shadow: var(--shadow-sm); cursor: zoom-in;
}
.article-body blockquote {
    margin: 1.4rem 0; padding: 1rem 1.4rem;
    background: #f8faff; border-left: 4px solid var(--cyan);
    border-radius: 0 12px 12px 0; color: var(--ink-2);
}
.article-body table {
    width: 100%; border-collapse: collapse; margin: 1.4rem 0;
    display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.article-body th, .article-body td { border: 1px solid var(--line); padding: .7rem .9rem; text-align: left; }
.article-body th { background: #f8fafc; }
.article-lead {
    font-size: 1.05rem; line-height: 1.8; color: var(--body);
    padding: 1rem 1.25rem; margin: 0 0 1.5rem;
    background: #f8fafc; border-left: 4px solid var(--primary);
    border-radius: 0 10px 10px 0;
}

/* ---------- 标签 ---------- */
.article-tags {
    display: flex; align-items: center; flex-wrap: wrap; gap: .6rem;
    margin: 2rem 0 0; padding-top: 1.6rem; border-top: 1px solid var(--line);
}
.article-tags-label { color: var(--muted); font-size: .9rem; }
.article-tag {
    display: inline-flex; align-items: center;
    padding: .4rem 1rem; border-radius: 999px;
    background: #f1f5f9; color: var(--ink-2);
    font-size: .85rem; font-weight: 500;
    transition: background .25s, color .25s;
}
.article-tag:hover { background: #e0e7ff; color: var(--primary); }

/* ---------- 文内 CTA 卡片 ---------- */
.article-cta-box { margin: 2rem 0; }
.cta-box-highlight {
    position: relative; overflow: hidden;
    text-align: center; padding: 2.4rem 2rem;
    border-radius: var(--radius-lg); color: #fff;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 45%, #06b6d4 100%);
    box-shadow: 0 20px 44px rgba(79, 70, 229, .3);
}
.cta-box-highlight::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(420px 200px at 85% 0%, rgba(255,255,255,.16), transparent 60%);
}
.cta-box-highlight-2 {
    background: linear-gradient(135deg, #0f172a 0%, #312e81 55%, #0e7490 100%);
    box-shadow: 0 20px 44px rgba(15, 23, 42, .3);
}
.cta-box-highlight > * { position: relative; }
.cta-box-badge {
    display: inline-block; padding: .35rem 1.05rem; border-radius: 999px;
    background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3);
    font-size: .85rem; font-weight: 600; margin-bottom: 1rem;
}
.cta-box-highlight h3 { color: #fff; font-size: 1.3rem; margin-bottom: .6rem; }
.cta-box-highlight p { color: rgba(255,255,255,.9); font-size: .95rem; margin-bottom: 1.2rem; }
.cta-box-features {
    display: flex; justify-content: center; gap: 1.2rem; flex-wrap: wrap;
    margin-bottom: 1.4rem;
}
.cta-box-features span {
    font-size: .88rem; color: rgba(255,255,255,.92); font-weight: 500;
}
.cta-box-highlight .btn { background: #fff; color: var(--primary-dark); box-shadow: 0 10px 24px rgba(0,0,0,.2); }
.cta-box-highlight .btn:hover { transform: translateY(-2px); }
.cta-box-wechat {
    display: flex; align-items: center; justify-content: center; gap: .5rem; flex-wrap: wrap;
    margin-bottom: 1.4rem; color: rgba(255,255,255,.9); font-size: .95rem;
}
.cta-box-wechat strong { font-size: 1.15rem; letter-spacing: .5px; }

/* ---------- 相关案例 ---------- */
.article-cases { margin: 2.2rem 0; }
.article-cases h3, .article-faq h3, .article-cities h3 {
    font-size: 1.2rem; color: var(--ink); margin-bottom: 1.1rem;
}
.cases-mini-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
.case-mini-card {
    background: #f8faff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.4rem;
}
.case-mini-badge {
    display: inline-block; padding: .25rem .8rem; border-radius: 999px;
    background: rgba(99,102,241,.1); color: var(--primary);
    font-size: .78rem; font-weight: 600; margin-bottom: .7rem;
}
.case-mini-card p { color: var(--body); font-size: .92rem; margin-bottom: .8rem; line-height: 1.7; }
.case-mini-data { color: #059669; font-weight: 700; font-size: .95rem; }

/* ---------- 文内 FAQ ---------- */
.article-faq { margin: 2.2rem 0; }
.faq-mini-list { display: flex; flex-direction: column; gap: 12px; }
.faq-mini-item {
    background: #f8faff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.2rem 1.4rem;
}
.faq-mini-item h4 { font-size: 1rem; color: var(--ink); margin-bottom: .5rem; }
.faq-mini-item p { color: var(--body); font-size: .92rem; line-height: 1.75; margin: 0; }

/* ---------- 城市内链 ---------- */
.article-cities { margin: 2.2rem 0; }
.article-cities-grid { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.article-city-link {
    display: inline-flex; align-items: center;
    padding: .45rem 1.05rem; border-radius: 999px;
    background: #fff; border: 1px solid var(--line); color: var(--ink-2);
    font-size: .88rem; font-weight: 500;
    transition: all .25s;
}
.article-city-link:hover { border-color: var(--primary); color: var(--primary); background: #eef2ff; transform: translateY(-2px); }
.article-cities-more { color: var(--primary); font-weight: 600; font-size: .92rem; }
.article-cities-more:hover { text-decoration: underline; }

/* ---------- 文章导航 ---------- */
.article-nav-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
    margin-top: 2.2rem;
}
.article-nav-btn {
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    padding: 1rem; border-radius: var(--radius);
    background: #f1f5f9; color: var(--ink-2);
    font-weight: 600; font-size: .95rem; text-align: center;
    transition: background .25s, color .25s, transform .25s;
}
.article-nav-btn:hover { transform: translateY(-2px); }
.article-nav-btn-highlight {
    background: var(--gradient); color: #fff;
    box-shadow: 0 10px 24px rgba(99,102,241,.32);
}

/* ---------- 侧边栏 ---------- */
.article-sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: calc(var(--header-h) + 20px); }
.sidebar-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 1.6rem; box-shadow: var(--shadow-sm);
}
.sidebar-cta-card {
    background: linear-gradient(150deg, #4f46e5 0%, #6366f1 50%, #06b6d4 120%);
    border: none; color: #fff; text-align: center;
}
.sidebar-cta-card h3 { color: #fff; font-size: 1.2rem; margin-bottom: .5rem; }
.sidebar-cta-card p { color: rgba(255,255,255,.9); font-size: .9rem; margin-bottom: 1.2rem; }
.sidebar-cta-icon { font-size: 2.4rem; margin-bottom: .6rem; }
.sidebar-cta-card .btn { background: #fff; color: var(--primary-dark); box-shadow: 0 8px 20px rgba(0,0,0,.18); }
.sidebar-title {
    display: flex; align-items: center; gap: .5rem;
    font-size: 1.05rem; color: var(--ink); margin-bottom: 1.1rem;
}
.sidebar-title-icon { font-size: 1.1rem; }
.sidebar-articles { display: flex; flex-direction: column; gap: 1rem; }
.sidebar-article-item { display: flex; gap: .9rem; align-items: center; }
.sidebar-article-item + .sidebar-article-item { padding-top: 1rem; border-top: 1px solid #f1f5f9; }
.sidebar-article-image {
    width: 72px; height: 56px; border-radius: 10px; overflow: hidden;
    background: #e2e8f0; flex-shrink: 0;
}
.sidebar-article-image img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-article-info { min-width: 0; }
.sidebar-article-info h4 {
    font-size: .88rem; color: var(--ink); line-height: 1.5; font-weight: 600;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    margin-bottom: .25rem;
}
.sidebar-article-info span { font-size: .78rem; color: var(--muted); }
.sidebar-tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.sidebar-tag {
    display: inline-flex; align-items: center;
    padding: .35rem .85rem; border-radius: 999px;
    background: #f1f5f9; color: var(--ink-2);
    font-size: .82rem; transition: all .25s;
}
.sidebar-tag:hover { background: #e0e7ff; color: var(--primary); }
.sidebar-contact-card {
    background: linear-gradient(150deg, #eef2ff 0%, #ecfeff 120%);
    border-color: rgba(99,102,241,.25); text-align: center;
}
.sidebar-contact-header {
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    margin-bottom: .6rem;
}
.sidebar-contact-header h3 { font-size: 1.1rem; color: var(--ink); }
.sidebar-contact-icon { font-size: 1.3rem; }
.sidebar-contact-card p { color: var(--body); font-size: .9rem; margin-bottom: 1.1rem; }
.sidebar-mini-cta {
    text-align: center; background: #fff8f2; border-color: #fed7aa;
}
.mini-cta-icon { font-size: 1.8rem; margin-bottom: .5rem; }
.sidebar-mini-cta p { color: #9a3412; font-weight: 700; margin-bottom: .9rem; font-size: .95rem; }
.sidebar-mini-cta .btn-secondary { background: #fff; }

/* ---------- 404 文章不存在 ---------- */
.not-found-content { text-align: center; max-width: 480px; margin: 0 auto; }
.not-found-icon { font-size: 4rem; margin-bottom: 1rem; }
.not-found-content h1 { font-size: 1.8rem; color: var(--ink); margin-bottom: .7rem; }
.not-found-content p { color: var(--body); margin-bottom: 1.8rem; }
.not-found-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

/* ---------- 图片灯箱 ---------- */
.lightbox-overlay {
    position: fixed; inset: 0; z-index: 400;
    background: rgba(10, 15, 30, .92); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity .3s ease;
}
.lightbox-overlay.active { opacity: 1; pointer-events: auto; }
.lightbox-content {
    position: relative; max-width: 92vw; max-height: 92vh;
    display: flex; flex-direction: column; align-items: center; gap: .8rem;
}
.lightbox-image {
    max-width: 92vw; max-height: 80vh; border-radius: 12px;
    box-shadow: 0 30px 80px rgba(0,0,0,.5); object-fit: contain;
}
.lightbox-caption { color: #cbd5e1; font-size: .88rem; text-align: center; }
.lightbox-close, .lightbox-nav {
    position: absolute; z-index: 2;
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(255,255,255,.12); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; line-height: 1;
    transition: background .25s, transform .25s;
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255,255,255,.25); transform: scale(1.06); }
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-prev:hover, .lightbox-next:hover { transform: translateY(-50%) scale(1.06); }

/* ============================================================
   响应式 — 平板
   ============================================================ */
@media (max-width: 1024px) {
    .article-layout { grid-template-columns: 1fr; }
    .article-sidebar {
        position: static;
        display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
    }
    .sidebar-cta-card, .sidebar-contact-card, .sidebar-mini-cta { grid-column: span 1; }
}

/* ============================================================
   响应式 — 手机
   ============================================================ */
@media (max-width: 768px) {
    .article-main { padding: 28px 0 48px; }
    .article-content { padding: 1.5rem 1.15rem; border-radius: 16px; }
    .article-page-title { font-size: 1.35rem; }
    .article-meta-info { gap: .8rem 1.2rem; }
    .article-actions { flex-direction: column; align-items: stretch; }
    .article-share { justify-content: center; }
    .article-bookmark { width: 100%; justify-content: center; }

    .article-body { font-size: .95rem; }
    .article-body h2 { font-size: 1.2rem; }
    .article-body h3 { font-size: 1.05rem; }

    .cta-box-highlight { padding: 1.8rem 1.2rem; }
    .cta-box-features { gap: .6rem 1rem; }

    .cases-mini-grid { grid-template-columns: 1fr; }
    .article-nav-grid { grid-template-columns: 1fr; }

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

    .lightbox-nav { width: 40px; height: 40px; font-size: 1.2rem; }
    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
    .lightbox-close { top: 12px; right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .article-share-btn, .article-tag { transition: none; }
}
