/* ==========================================
   Blog - 列表页 & 文章页 共用样式
========================================== */

/* ── Blog Hero ────────────────────────── */
.blog-hero {
    padding: 110px 5% 72px;
    text-align: center;
    background:
        radial-gradient(ellipse 80% 50% at 30% -10%, rgba(37,99,235,0.10) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 80% 90%, rgba(124,58,237,0.07) 0%, transparent 55%);
    position: relative; overflow: hidden;
    border-bottom: 1px solid var(--border);
}
.blog-hero::before {
    content: '';
    position: absolute; inset: 0; pointer-events: none;
    background-image: radial-gradient(circle, rgba(37,99,235,0.10) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 0%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 0%, transparent 100%);
}
.blog-hero h1 {
    font-size: clamp(32px, 5vw, 60px);
    font-weight: 900; letter-spacing: -2px;
    color: var(--text-1); margin-bottom: 16px; position: relative;
}
.blog-hero p {
    font-size: 16px; color: var(--text-3);
    max-width: 500px; margin: 0 auto; line-height: 1.8; position: relative;
}

/* ── Filter Bar ───────────────────────── */
.blog-filters {
    display: flex; justify-content: center;
    gap: 8px; flex-wrap: wrap;
    padding: 32px 5% 0;
}
.bf-tab {
    padding: 7px 18px; border-radius: 20px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    border: 1px solid var(--border);
    background: white; color: var(--text-3);
    transition: var(--trans);
}
.bf-tab:hover { border-color: var(--primary); color: var(--primary); }
.bf-tab.active {
    background: var(--primary); color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}

/* ── Article Grid ─────────────────────── */
.blog-grid-wrap { padding: 48px 5% 100px; }
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1200px; margin: 0 auto;
}

/* ── Article Card ─────────────────────── */
@keyframes cardIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.blog-card {
    border-radius: 20px; overflow: hidden;
    background: white; border: 1px solid var(--border);
    transition: var(--trans);
    display: flex; flex-direction: column;
    text-decoration: none; color: inherit;
    animation: cardIn 0.4s ease both;
}
.blog-card:nth-child(2) { animation-delay: 0.06s; }
.blog-card:nth-child(3) { animation-delay: 0.12s; }
.blog-card:nth-child(4) { animation-delay: 0.18s; }
.blog-card:nth-child(5) { animation-delay: 0.24s; }
.blog-card:nth-child(n+6) { animation-delay: 0.30s; }
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: transparent; }

.blog-card-cover {
    height: 140px;
    display: flex; align-items: center; justify-content: center;
    font-size: 40px; position: relative; overflow: hidden;
}
.blog-card-cover::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.12) 100%);
}
.cover-blue   { background: linear-gradient(135deg, #dbeafe, #ede9fe); color: #2563eb; }
.cover-purple { background: linear-gradient(135deg, #ede9fe, #fce7f3); color: #7c3aed; }
.cover-green  { background: linear-gradient(135deg, #d1fae5, #cffafe); color: #059669; }
.cover-orange { background: linear-gradient(135deg, #fef3c7, #fee2e2); color: #d97706; }
.cover-dark   { background: linear-gradient(135deg, #1e293b, #334155); color: #93c5fd; }

.blog-card-body { padding: 22px 24px 24px; flex: 1; display: flex; flex-direction: column; }
.blog-card-cat {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
    padding: 3px 10px; border-radius: 20px; margin-bottom: 10px;
    background: var(--primary-light); color: var(--primary);
}
.blog-card-title {
    font-size: 16px; font-weight: 800; color: var(--text-1);
    line-height: 1.45; letter-spacing: -0.3px; margin-bottom: 10px;
}
.blog-card-excerpt {
    font-size: 13.5px; color: var(--text-3); line-height: 1.75;
    flex: 1; margin-bottom: 16px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-card-meta {
    display: flex; align-items: center; gap: 12px;
    font-size: 12px; color: var(--text-4);
    border-top: 1px solid var(--border); padding-top: 14px;
}
.blog-card-avatar {
    width: 26px; height: 26px; border-radius: 50%;
    object-fit: cover; border: 1.5px solid var(--bg-3);
}
.blog-card-meta-right { margin-left: auto; display: flex; gap: 10px; }

/* no results */
.blog-empty {
    grid-column: 1/-1; text-align: center;
    padding: 60px 0; color: var(--text-4); font-size: 15px;
}

/* ── Breadcrumb ───────────────────────── */
.article-breadcrumb {
    display: flex; align-items: center; flex-wrap: wrap;
    gap: 6px; font-size: 13px; color: var(--text-4);
    margin-bottom: 24px;
}
.article-breadcrumb a {
    color: var(--text-3); text-decoration: none;
    transition: color 0.2s;
}
.article-breadcrumb a:hover { color: var(--primary); }
.article-breadcrumb .bc-sep {
    color: var(--border); font-size: 12px;
}
.article-breadcrumb .bc-current {
    color: var(--text-2); font-weight: 500;
    max-width: 260px; overflow: hidden;
    white-space: nowrap; text-overflow: ellipsis;
}

/* ── Article Download CTA (bottom) ────── */
.article-cta {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px; border-radius: 20px; margin: 48px 0 32px;
    background: linear-gradient(135deg, #1e3a8a 0%, #4f46e5 100%);
    color: white; position: relative; overflow: hidden;
}
.article-cta::before {
    content: '';
    position: absolute; right: -40px; top: -40px;
    width: 180px; height: 180px; border-radius: 50%;
    background: rgba(255,255,255,0.06);
}
.article-cta::after {
    content: '';
    position: absolute; right: 40px; bottom: -60px;
    width: 120px; height: 120px; border-radius: 50%;
    background: rgba(255,255,255,0.05);
}
.article-cta-emoji {
    font-size: 48px; flex-shrink: 0; line-height: 1; position: relative; z-index: 1;
}
.article-cta-body { flex: 1; position: relative; z-index: 1; }
.article-cta-title {
    font-size: 18px; font-weight: 800; margin-bottom: 6px; letter-spacing: -0.3px;
}
.article-cta-desc {
    font-size: 13px; opacity: 0.8; line-height: 1.6;
}
.article-cta-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 11px 24px; border-radius: 50px; font-weight: 700; font-size: 14px;
    background: white; color: #1e3a8a; text-decoration: none;
    white-space: nowrap; flex-shrink: 0;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    position: relative; z-index: 1;
}
.article-cta-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
@media (max-width: 600px) {
    .article-cta { flex-direction: column; align-items: flex-start; gap: 16px; padding: 24px 20px; }
    .article-cta-btn { width: 100%; justify-content: center; }
}

/* ── Floating Download Widget ─────────── */
.dl-float {
    position: fixed; bottom: 28px; right: 28px; z-index: 900;
    background: white; border: 1px solid var(--border);
    border-radius: 16px; padding: 16px 20px;
    box-shadow: 0 8px 40px rgba(0,0,30,0.14);
    display: flex; align-items: center; gap: 14px;
    transform: translateY(100px); opacity: 0;
    transition: transform 0.4s cubic-bezier(.34,1.56,.64,1), opacity 0.3s;
    max-width: 280px;
}
.dl-float.show { transform: translateY(0); opacity: 1; }
.dl-float-close {
    position: absolute; top: 8px; right: 10px;
    font-size: 15px; color: var(--text-4); cursor: pointer;
    background: none; border: none; line-height: 1; padding: 2px;
}
.dl-float-close:hover { color: var(--text-2); }
.dl-float-icon {
    width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
    background: var(--bg-2); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
}
.dl-float-body {}
.dl-float-title { font-size: 13px; font-weight: 700; color: var(--text-1); margin-bottom: 3px; }
.dl-float-sub { font-size: 11px; color: var(--text-4); margin-bottom: 10px; }
.dl-float-btn {
    display: block; text-align: center;
    padding: 7px 0; border-radius: 8px; font-size: 12px; font-weight: 700;
    background: var(--primary); color: white; text-decoration: none;
    transition: background 0.2s;
}
.dl-float-btn:hover { background: var(--primary-dark, #1d4ed8); }
@media (max-width: 480px) {
    .dl-float { bottom: 16px; right: 16px; max-width: calc(100vw - 32px); }
}

/* ── Article Page ─────────────────────── */
.article-wrap {
    max-width: 1100px; margin: 0 auto;
    padding: 100px 5% 100px;
    display: grid; grid-template-columns: 1fr 260px; gap: 56px; align-items: start;
    overflow-x: hidden;
}
.article-main { min-width: 0; }
.article-back {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13px; font-weight: 600; color: var(--text-3);
    text-decoration: none; margin-bottom: 28px;
    padding: 6px 14px; border-radius: 20px;
    background: var(--bg-2); border: 1px solid var(--border);
    transition: var(--trans);
}
.article-back:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }

.article-cat {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
    padding: 3px 10px; border-radius: 20px; margin-bottom: 14px;
    background: var(--primary-light); color: var(--primary);
}
.article-title {
    font-size: clamp(26px, 3.5vw, 38px);
    font-weight: 900; letter-spacing: -1px; line-height: 1.2;
    color: var(--text-1); margin-bottom: 20px;
}
.article-meta {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    font-size: 13px; color: var(--text-4);
    padding-bottom: 24px; border-bottom: 1px solid var(--border);
    margin-bottom: 36px;
}
.article-meta-author {
    display: flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 600;
}
.article-meta-author img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.article-meta-sep { color: var(--border); }

/* Article content typography */
.article-content h2 {
    font-size: 22px; font-weight: 800; color: var(--text-1);
    letter-spacing: -0.4px; margin: 40px 0 14px;
    padding-bottom: 10px; border-bottom: 2px solid var(--border);
}
.article-content h3 {
    font-size: 17px; font-weight: 700; color: var(--text-1);
    margin: 28px 0 10px;
}
.article-content p {
    font-size: 15px; color: var(--text-2); line-height: 1.95; margin-bottom: 18px;
}
.article-content ul, .article-content ol {
    padding-left: 24px; margin-bottom: 18px;
    display: flex; flex-direction: column; gap: 6px;
}
.article-content li { font-size: 15px; color: var(--text-2); line-height: 1.8; }
.article-content strong { color: var(--text-1); font-weight: 700; }
.article-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }

.article-content .tip {
    background: rgba(37,99,235,0.05);
    border-left: 3px solid var(--primary);
    border-radius: 0 10px 10px 0;
    padding: 14px 18px; margin: 20px 0;
    font-size: 14px; color: var(--text-2); line-height: 1.8;
}
.article-content .warn {
    background: rgba(245,158,11,0.06);
    border-left: 3px solid var(--warning);
    border-radius: 0 10px 10px 0;
    padding: 14px 18px; margin: 20px 0;
    font-size: 14px; color: var(--text-2); line-height: 1.8;
}
.article-content pre {
    background: #0f172a; border-radius: 12px;
    padding: 20px 24px; overflow-x: auto;
    margin: 20px 0; font-size: 13px; line-height: 1.75;
    border: 1px solid rgba(255,255,255,0.06);
    max-width: 100%;
}
.article-content code {
    font-family: var(--font-mono); color: #e2e8f0;
}
.article-content :not(pre) > code {
    background: var(--bg-3); color: var(--primary);
    padding: 2px 6px; border-radius: 5px;
    font-size: 13px; border: 1px solid var(--border);
}
.article-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--border); }
.article-tag {
    font-size: 12px; font-weight: 600; padding: 4px 12px;
    border-radius: 20px; background: var(--bg-2);
    border: 1px solid var(--border); color: var(--text-3);
}

/* Sidebar */
.article-sidebar { position: sticky; top: 90px; }
.sidebar-card {
    background: white; border: 1px solid var(--border);
    border-radius: 16px; padding: 20px;
    margin-bottom: 20px;
}
.sidebar-title {
    font-size: 11px; font-weight: 700; color: var(--text-4);
    letter-spacing: 1px; text-transform: uppercase;
    margin-bottom: 14px; padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.toc-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.toc-list a {
    font-size: 13px; color: var(--text-3); text-decoration: none;
    display: block; padding: 5px 8px; border-radius: 7px;
    transition: var(--trans); line-height: 1.5;
}
.toc-list a:hover, .toc-list a.active { background: var(--primary-light); color: var(--primary); }
.toc-list .toc-h3 { padding-left: 18px; font-size: 12px; }

/* ── Article Bottom Nav ───────────────── */
.article-bottom {
    max-width: 1100px; margin: 0 auto;
    padding: 0 5% 80px;
    overflow-x: hidden;
}

.article-nav-section { margin-bottom: 56px; }
.article-nav-title {
    font-size: 13px; font-weight: 700; color: var(--text-4);
    text-transform: uppercase; letter-spacing: 1px;
    margin-bottom: 16px;
}
.article-nav-cards {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.article-nav-card {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 20px; border-radius: 14px;
    border: 1px solid var(--border); background: white;
    text-decoration: none; color: inherit;
    transition: var(--trans);
}
.article-nav-card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(37,99,235,0.1); }
.article-nav-card.prev { grid-column: 1; }
.article-nav-card.next { grid-column: 2; justify-content: flex-end; text-align: right; }
.article-nav-arrow {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    background: var(--bg-2); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: var(--text-3);
}
.article-nav-info {}
.article-nav-label { font-size: 11px; color: var(--text-4); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.article-nav-name { font-size: 14px; font-weight: 700; color: var(--text-1); line-height: 1.4; }

.article-related-title {
    font-size: 13px; font-weight: 700; color: var(--text-4);
    text-transform: uppercase; letter-spacing: 1px;
    margin-bottom: 16px;
}
.article-related-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.article-related-card {
    padding: 18px 20px; border-radius: 14px;
    border: 1px solid var(--border); background: white;
    text-decoration: none; color: inherit; transition: var(--trans);
}
.article-related-card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(37,99,235,0.1); }
.article-related-cat {
    font-size: 10px; font-weight: 800; letter-spacing: 0.8px;
    text-transform: uppercase; color: var(--primary);
    margin-bottom: 8px;
}
.article-related-name {
    font-size: 14px; font-weight: 700; color: var(--text-1); line-height: 1.5;
}

@media (max-width: 640px) {
    .article-nav-cards, .article-related-grid { grid-template-columns: 1fr; }
    .article-nav-card.next { grid-column: 1; justify-content: flex-start; text-align: left; }
}

/* ── Responsive ───────────────────────── */
@media (max-width: 1024px) {
    .blog-grid { grid-template-columns: repeat(2, 1fr); }
    .article-wrap { grid-template-columns: 1fr; padding: 88px 5% 72px; }
    .article-sidebar { position: static; display: none; }
}
@media (max-width: 768px) {
    .blog-hero { padding: 88px 5% 48px; }
    .article-wrap { padding: 80px 5% 80px; }
    .article-breadcrumb { font-size: 12px; }
    .article-breadcrumb .bc-current { max-width: 180px; }
    .blog-hero h1 { font-size: 28px; }
}
@media (max-width: 640px) {
    .blog-grid { grid-template-columns: 1fr; }
    .blog-card-cover { height: 110px; font-size: 32px; }
    .blog-hero { padding: 80px 5% 40px; }
    .article-wrap { padding: 76px 5% 100px; }
    .article-nav-cards, .article-related-grid { grid-template-columns: 1fr; }
    .article-nav-card.next { grid-column: 1; justify-content: flex-start; text-align: left; }
}
@media (max-width: 600px) {
    /* 浮动下载组件在手机底部通栏展开 */
    .dl-float {
        bottom: 0; right: 0; left: 0;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        border-bottom: none;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)) 16px;
        gap: 12px;
    }
    .dl-float-icon { width: 36px; height: 36px; border-radius: 10px; }
    .dl-float-icon img { width: 22px !important; height: 22px !important; }
    .dl-float-title { font-size: 13px; margin-bottom: 2px; }
    .dl-float-sub { font-size: 11px; margin-bottom: 8px; }
    .dl-float-btn { padding: 8px 0; font-size: 13px; }
    .dl-float-close { top: 10px; right: 12px; }
}
@media (max-width: 480px) {
    .blog-hero { padding: 76px 5% 36px; }
    .article-wrap { padding: 72px 4% 100px; }
}
