/* 博客：与悬浮顶栏留白（与 common .page-main 对齐） */
#page-blog.page-main,
.page-main:has(.blog-article-wrap) {
    padding-top: var(--nav-stack-clearance, 104px);
}
@media (max-width: 768px) {
    #page-blog.page-main,
    .page-main:has(.blog-article-wrap) {
        padding-top: max(96px, var(--nav-stack-clearance, 104px));
    }
}

.page-main:has(.blog-article-wrap) .blog-article-back {
    margin-top: 18px;
}

/* ==================== 博客列表页 · 全幅 Hero + 杂志栅格 ==================== */
.blog-page {
    padding-bottom: clamp(72px, 12vw, 120px);
}

.blog-hero {
    position: relative;
    margin: 0 calc(50% - 50vw);
    width: 100vw;
    max-width: 100vw;
    padding: clamp(20px, 4vw, 40px) 0 clamp(36px, 6vw, 56px);
    overflow: hidden;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    background:
        radial-gradient(ellipse 70% 55% at 12% 20%, rgba(99, 102, 241, 0.14), transparent 58%),
        radial-gradient(ellipse 60% 50% at 88% 30%, rgba(56, 189, 248, 0.12), transparent 52%),
        linear-gradient(175deg, rgba(248, 250, 252, 0.98) 0%, rgba(238, 242, 255, 0.96) 45%, rgba(240, 249, 255, 0.94) 100%);
    box-sizing: border-box;
}

.blog-hero__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.045) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 85% 70% at 50% 35%, #000 22%, transparent 72%);
    pointer-events: none;
}

.blog-hero__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    opacity: 0.42;
}
.blog-hero__glow--a {
    width: min(420px, 55vw);
    height: min(420px, 55vw);
    top: -18%;
    right: -6%;
    background: rgba(129, 140, 248, 0.5);
}
.blog-hero__glow--b {
    width: min(320px, 45vw);
    height: min(320px, 45vw);
    bottom: -25%;
    left: -5%;
    background: rgba(56, 189, 248, 0.42);
}

@media (prefers-reduced-motion: no-preference) {
    .blog-hero__glow--a {
        animation: blogHeroGlowA 18s ease-in-out infinite;
    }
    .blog-hero__glow--b {
        animation: blogHeroGlowB 20s ease-in-out infinite;
    }
    @keyframes blogHeroGlowA {
        0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.38; }
        50% { transform: translate(-16px, 12px) scale(1.06); opacity: 0.5; }
    }
    @keyframes blogHeroGlowB {
        0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.35; }
        50% { transform: translate(14px, -10px) scale(1.05); opacity: 0.48; }
    }
}
@media (prefers-reduced-motion: reduce) {
    .blog-hero__glow--a,
    .blog-hero__glow--b {
        animation: none;
    }
}

.blog-hero__inner {
    position: relative;
    z-index: 1;
    max-width: 720px;
}

.blog-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    padding: 6px 14px 6px 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--signal);
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 999px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.blog-hero__eyebrow i {
    width: 16px;
    height: 16px;
    opacity: 0.85;
}

.blog-hero__title {
    margin: 0 0 16px;
    font-size: clamp(2rem, 5vw, 2.85rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.045em;
    color: var(--ink);
}
.blog-hero__title-accent {
    display: inline;
    background: linear-gradient(120deg, #6366f1, #38bdf8, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.blog-hero__lead {
    margin: 0 0 28px;
    max-width: 38em;
    font-size: clamp(16px, 2.1vw, 18px);
    line-height: 1.65;
    color: var(--ink-light);
    font-weight: 500;
}

.blog-page__body {
    padding-top: clamp(28px, 5vw, 44px);
}

/* ── Blog Tab Buttons ── */
.blog-tab-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.48);
    backdrop-filter: blur(16px) saturate(1.5);
    -webkit-backdrop-filter: blur(16px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 13px;
    box-shadow:
        0 2px 12px rgba(15, 23, 42, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.blog-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: var(--ink-muted, #64748b);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
    font-family: inherit;
    cursor: pointer;
    transition:
        background 0.18s ease,
        color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.15s ease;
    white-space: nowrap;
}

.blog-tab-btn i,
.blog-tab-btn svg {
    width: 15px;
    height: 15px;
    stroke-width: 2px;
    flex-shrink: 0;
}

.blog-tab-btn:hover:not(.blog-dual-tab--active) {
    background: rgba(255, 255, 255, 0.85);
    color: var(--ink, #0f172a);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.blog-tab-btn.blog-dual-tab--active {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e8 55%, #0ea5e9 100%);
    color: #fff;
    box-shadow:
        0 4px 14px rgba(99, 102, 241, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: none;
}

@media (max-width: 480px) {
    .blog-tab-btn {
        padding: 7px 13px;
        font-size: 13px;
    }
}

/* 分栏内容区标题条 */
.blog-panel-intro {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: clamp(22px, 4vw, 32px);
    padding: 20px 22px;
    border-radius: var(--radius-lg);
    background: var(--surface-glass);
    backdrop-filter: blur(18px) saturate(1.45);
    -webkit-backdrop-filter: blur(18px) saturate(1.45);
    border: 1px solid var(--stroke-glass);
    box-shadow: var(--shadow-sketch);
}
.blog-panel-intro__mark {
    width: 5px;
    align-self: stretch;
    min-height: 52px;
    border-radius: 999px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #6366f1 0%, #38bdf8 100%);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.35);
}
.blog-panel-intro--openclaw .blog-panel-intro__mark {
    background: linear-gradient(180deg, #f59e0b 0%, #f472b6 55%, #a78bfa 100%);
    box-shadow: 0 0 20px rgba(244, 114, 182, 0.28);
}
.blog-panel-intro__title {
    margin: 0 0 6px;
    font-size: clamp(1.35rem, 2.8vw, 1.6rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: var(--ink);
}
.blog-panel-intro__desc {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink-light);
    font-weight: 600;
    max-width: 42em;
}

.blog-panel[hidden] {
    display: none !important;
}

#page-blog .blog-panel-openclaw {
    padding-bottom: 40px;
}

/* 文章栅格：大屏横向卡片 */
#page-blog .blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(16px, 2.5vw, 22px);
}

@media (min-width: 880px) {
    #page-blog .blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

#page-blog .blog-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    min-height: 0;
}

@media (min-width: 880px) {
    #page-blog .blog-card.blog-card--link {
        flex-direction: row;
        align-items: stretch;
        min-height: 200px;
    }
}

.blog-card[hidden] {
    display: none !important;
}

#page-blog .blog-image {
    position: relative;
    flex-shrink: 0;
    height: 168px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    overflow: hidden;
    isolation: isolate;
}

@media (min-width: 880px) {
    #page-blog .blog-image {
        width: min(280px, 34%);
        height: auto;
        min-height: 100%;
        border-bottom: none;
        border-right: 1px solid rgba(15, 23, 42, 0.06);
    }
}

.blog-image__mesh {
    position: absolute;
    inset: 0;
    opacity: 0.35;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.5), transparent 45%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.25), transparent 40%);
    pointer-events: none;
}

.blog-card[data-blog-thumb='violet'] .blog-image {
    background: linear-gradient(145deg, #ede9fe 0%, #e0e7ff 40%, #cffafe 100%);
    color: #4f46e5;
}
.blog-card[data-blog-thumb='mint'] .blog-image {
    background: linear-gradient(145deg, #d1fae5 0%, #ccfbf1 50%, #e0f2fe 100%);
    color: #0d9488;
}
.blog-card[data-blog-thumb='rose'] .blog-image {
    background: linear-gradient(145deg, #fce7f3 0%, #ffe4e6 45%, #fef3c7 100%);
    color: #be185d;
}
.blog-card[data-blog-thumb='sky'] .blog-image {
    background: linear-gradient(145deg, #e0f2fe 0%, #dbeafe 50%, #e0e7ff 100%);
    color: #0369a1;
}
.blog-card[data-blog-thumb='amber'] .blog-image {
    background: linear-gradient(145deg, #fef3c7 0%, #ffedd5 50%, #fce7f3 100%);
    color: #b45309;
}

.blog-card[data-blog-thumb] .blog-image i {
    width: clamp(56px, 12vw, 72px);
    height: clamp(56px, 12vw, 72px);
    position: relative;
    z-index: 1;
    opacity: 0.92;
    filter: drop-shadow(0 8px 24px rgba(15, 23, 42, 0.12));
}

#page-blog .blog-content {
    padding: clamp(20px, 3vw, 28px) clamp(20px, 3vw, 32px);
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0;
    min-width: 0;
}

.blog-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink-light);
}
.blog-meta__tag {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--signal);
    border: 1px solid rgba(99, 102, 241, 0.12);
}
.blog-meta__dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--ink-light);
    opacity: 0.45;
}
.blog-meta time {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

#page-blog .blog-content h3 {
    margin: 0 0 10px;
    font-size: clamp(1.1rem, 2.2vw, 1.28rem);
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -0.025em;
    color: var(--ink);
}

.blog-excerpt {
    margin: 0 0 18px;
    font-size: 15px;
    line-height: 1.62;
    color: var(--ink-light);
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

a.blog-card.blog-card--link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    outline-offset: 4px;
    transition:
        box-shadow 0.38s var(--ease-smooth, cubic-bezier(0.22, 1, 0.36, 1)),
        transform 0.38s var(--ease-spring, cubic-bezier(0.34, 1.35, 0.64, 1)),
        border-color 0.3s ease;
}
a.blog-card.blog-card--link:focus-visible {
    outline: 3px solid var(--signal);
    outline-offset: 3px;
}
a.blog-card.blog-card--link:hover {
    box-shadow: var(--shadow-sketch-hover);
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.22);
}
a.blog-card.blog-card--link:active {
    box-shadow: var(--shadow-pressed);
    transform: translateY(-1px);
}

.blog-card--series-openclaw .blog-image {
    position: relative;
}
.blog-card--series-openclaw .blog-image::after {
    content: 'OpenClaw';
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 5px 10px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.58);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.88);
    color: var(--ink);
    line-height: 1;
    pointer-events: none;
}

.blog-read-more {
    font-size: 15px;
    font-weight: 700;
    color: var(--signal);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: max-content;
    margin-top: auto;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s, gap 0.25s var(--ease-spring);
}
.blog-read-more i {
    width: 18px;
    height: 18px;
    transition: transform 0.25s var(--ease-spring);
}
a.blog-card.blog-card--link:hover .blog-read-more {
    color: var(--accent);
    border-bottom-color: rgba(99, 102, 241, 0.35);
    gap: 12px;
}
a.blog-card.blog-card--link:hover .blog-read-more i {
    transform: translateX(3px);
}

/* 分页：紧凑居中胶囊条（不占满宽） */
.blog-pager {
    margin-top: clamp(24px, 4vw, 36px);
    padding: 0;
    display: flex;
    justify-content: center;
}
.blog-pager[hidden] {
    display: none !important;
}
.blog-pager__bar {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 10px;
    max-width: 100%;
    padding: 8px 12px 8px 18px;
    border-radius: 999px;
    background: var(--surface-glass);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid var(--stroke-glass);
    box-shadow:
        0 4px 20px rgba(15, 23, 42, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.88);
    position: relative;
    isolation: isolate;
}
.blog-pager__bar::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    margin-top: -14px;
    width: 3px;
    height: 28px;
    border-radius: 999px;
    background: linear-gradient(180deg, #6366f1, #38bdf8);
    opacity: 0.55;
    pointer-events: none;
    z-index: 0;
}
.blog-pager__bar > * {
    position: relative;
    z-index: 1;
}
.blog-pager__goto {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 5px 6px;
    padding: 4px 8px 4px 10px;
    margin-left: 2px;
    background: rgba(255, 255, 255, 0.42);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 999px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.blog-pager__goto-text {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0.02em;
}
.blog-pager__goto-total {
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-light);
    white-space: nowrap;
}
.blog-pager__input {
    width: 2.75rem;
    min-width: 2.75rem;
    padding: 5px 6px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    text-align: center;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 8px;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
    -moz-appearance: textfield;
}
.blog-pager__input::-webkit-outer-spin-button,
.blog-pager__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.blog-pager__input:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}
.blog-pager__goto-btn {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 999px;
}
.blog-pager__info {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink-light);
    min-width: 6em;
    text-align: center;
}
.blog-pager__btn {
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: transform 0.22s var(--ease-spring), box-shadow 0.25s ease, border-color 0.2s ease;
}
.blog-pager__btn:hover:not(:disabled) {
    border-color: rgba(99, 102, 241, 0.22);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
}
.blog-pager__btn:active:not(:disabled) {
    box-shadow: var(--shadow-pressed);
    transform: translateY(0);
}
.blog-pager__btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

@media (max-width: 640px) {
    .blog-hero__inner {
        padding-left: 0;
        padding-right: 0;
        text-align: center;
    }
    .blog-hero__lead {
        margin-left: auto;
        margin-right: auto;
    }
    .blog-hero .blog-dual-rail-wrap {
        margin-left: auto;
        margin-right: auto;
    }
    .blog-dual-tab {
        padding: 7px 12px;
    }
    .blog-panel-intro {
        flex-direction: column;
        gap: 12px;
        padding: 16px 18px;
    }
    .blog-panel-intro__mark {
        width: 100%;
        min-height: 4px;
        height: 4px;
        align-self: stretch;
    }
    #page-blog .blog-content h3 {
        font-size: 1.05rem;
    }
    .blog-pager__bar {
        padding: 8px 10px 8px 14px;
        gap: 6px 8px;
    }
    .blog-pager__btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    .blog-pager__goto {
        padding: 4px 6px;
        gap: 4px;
    }
}

/* ==================== 文章详情页（保持兼容） ==================== */
.blog-article-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding-bottom: 100px;
}
.blog-article-back {
    display: inline-block;
    margin-top: 32px;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.blog-article-back:hover {
    color: var(--accent-hot);
    border-bottom-color: var(--accent-hot);
}
.blog-article-head {
    margin-top: 28px;
    margin-bottom: 32px;
}
.blog-article-head h1 {
    font-size: clamp(26px, 4vw, 34px);
    line-height: 1.25;
    margin-bottom: 12px;
    letter-spacing: -0.03em;
}
.blog-article-head .blog-article-lead {
    font-size: 17px;
    color: var(--ink-light);
    font-weight: 600;
}
.blog-article-body {
    font-size: 17px;
    line-height: 1.82;
    color: var(--ink);
}
.blog-article-body p {
    margin: 0 0 1.2em;
}
.blog-article-body h2 {
    font-size: 20px;
    margin: 1.6em 0 0.6em;
    font-weight: 800;
    letter-spacing: -0.02em;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line);
}
.blog-article-body ul {
    margin: 0 0 1.2em 1.2em;
    padding: 0;
}
.blog-article-body li {
    margin-bottom: 0.5em;
}

/* ==================== 文章图示与提示块 ==================== */
.blog-article-figure {
    margin: 2em 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    background: var(--surface-glass-muted);
    box-shadow: var(--shadow-sketch);
}
.blog-article-figure svg {
    width: 100%;
    height: auto;
    display: block;
}
.blog-article-figure figcaption {
    padding: 9px 16px;
    font-size: 13px;
    color: var(--ink-light);
    border-top: 1px solid var(--line);
    text-align: center;
    letter-spacing: 0.01em;
}
.blog-article-callout {
    margin: 1.6em 0;
    padding: 14px 18px 14px 16px;
    border-left: 3px solid var(--accent);
    background: rgba(59, 130, 246, 0.055);
    border-radius: 0 10px 10px 0;
    font-size: 16px;
    line-height: 1.7;
    color: var(--ink);
}
