/* KiddoMind 博客首页 + 文章页共用样式
 * 备案服务名称「儿童早教经验分享」——博客文章流为主视觉
 */
body.page-blog {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--km-bg, #050510);
    color: var(--km-text, #ffffff);
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

a { color: inherit; }

/* ---------- 氛围背景（轻量 CSS，无 JS） ---------- */
.blog-ambient {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(100, 200, 255, 0.16), transparent 55%),
        radial-gradient(ellipse 45% 35% at 90% 20%, rgba(167, 139, 250, 0.12), transparent 50%),
        radial-gradient(ellipse 40% 30% at 8% 60%, rgba(56, 189, 248, 0.08), transparent 55%),
        radial-gradient(ellipse 50% 40% at 70% 90%, rgba(45, 212, 191, 0.06), transparent 50%);
}

body.page-blog > :not(.blog-ambient) {
    position: relative;
    z-index: 1;
}

/* ---------- 博客头部 ---------- */
.blog-header {
    max-width: 840px;
    margin: 0 auto;
    padding: 48px 20px 12px;
    text-align: center;
}

.blog-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--km-accent, #64c8ff);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    margin-bottom: 16px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(100, 200, 255, 0.1);
    border: 1px solid rgba(100, 200, 255, 0.22);
}

.blog-header h1 {
    font-size: clamp(28px, 5.5vw, 42px);
    font-weight: 800;
    letter-spacing: 0.2px;
    line-height: 1.25;
    margin-bottom: 14px;
    background: linear-gradient(180deg, #ffffff 30%, rgba(180, 220, 255, 0.88));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.blog-sub {
    color: var(--km-muted, rgba(255,255,255,0.65));
    font-size: clamp(14px, 2.4vw, 16px);
    max-width: 520px;
    margin: 0 auto 22px;
    line-height: 1.7;
}

.trust-row {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0 0 24px;
    padding: 0;
}

.trust-row li {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.72);
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

/* ---------- 分区通用 ---------- */
.blog-section {
    max-width: 1000px;
    margin: 0 auto;
    padding: 32px 20px;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.section-head--center {
    justify-content: center;
    text-align: center;
}

.section-head .section-desc {
    margin-bottom: 0;
}

.section-title {
    font-size: clamp(18px, 3vw, 22px);
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}

.section-desc {
    color: var(--km-muted, rgba(255,255,255,0.65));
    font-size: 14px;
    margin-bottom: 18px;
    line-height: 1.55;
}

.section-link {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
    color: #9ad8ff;
    text-decoration: none;
    padding: 8px 4px;
    white-space: nowrap;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.section-link:hover {
    color: #fff;
}

/* ---------- 世界入口双卡 ---------- */
.worlds-strip {
    padding-top: 12px;
}

.world-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.world-card {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 14px;
    row-gap: 12px;
    align-items: center;
    padding: 20px 18px;
    border-radius: 20px;
    text-decoration: none;
    overflow: hidden;
    border: 1px solid transparent;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.world-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.9;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.world-card--space {
    border-color: rgba(100, 200, 255, 0.32);
    background: rgba(12, 22, 48, 0.75);
}

.world-card--space::before {
    background:
        radial-gradient(ellipse 80% 90% at 0% 50%, rgba(100, 200, 255, 0.22), transparent 60%),
        linear-gradient(135deg, rgba(100, 200, 255, 0.12), rgba(167, 139, 250, 0.08));
}

.world-card--ocean {
    border-color: rgba(45, 212, 191, 0.32);
    background: rgba(6, 28, 36, 0.75);
}

.world-card--ocean::before {
    background:
        radial-gradient(ellipse 80% 90% at 0% 50%, rgba(45, 212, 191, 0.2), transparent 60%),
        linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(45, 212, 191, 0.08));
}

.world-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}

.world-card--space:hover {
    border-color: rgba(100, 200, 255, 0.55);
    box-shadow: 0 14px 36px rgba(56, 140, 255, 0.18);
}

.world-card--ocean:hover {
    border-color: rgba(45, 212, 191, 0.55);
    box-shadow: 0 14px 36px rgba(45, 212, 191, 0.16);
}

.world-card__emoji {
    position: relative;
    z-index: 1;
    grid-row: 1 / span 2;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    font-size: 28px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.world-card__body {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.world-card__label {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--km-ok, #86efac);
    margin-bottom: 4px;
}

.world-card h3 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 4px;
}

.world-card p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.68);
    line-height: 1.45;
}

.world-card__cta {
    position: relative;
    z-index: 1;
    grid-column: 2;
    justify-self: start;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.world-card--space .world-card__cta {
    background: rgba(100, 200, 255, 0.2);
    border-color: rgba(100, 200, 255, 0.35);
}

.world-card--ocean .world-card__cta {
    background: rgba(45, 212, 191, 0.18);
    border-color: rgba(45, 212, 191, 0.35);
}

/* ---------- 精选文章 ---------- */
.post-featured {
    margin-bottom: 22px;
}

.featured-card {
    position: relative;
    display: block;
    padding: 28px 28px 24px;
    border-radius: 22px;
    background:
        linear-gradient(145deg, rgba(100, 200, 255, 0.18), rgba(167, 139, 250, 0.1) 55%, rgba(12, 18, 40, 0.6));
    border: 1px solid rgba(100, 200, 255, 0.38);
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.featured-card::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(100, 200, 255, 0.2), transparent 68%);
    pointer-events: none;
}

.featured-card:hover {
    transform: translateY(-3px);
    border-color: rgba(100, 200, 255, 0.55);
    box-shadow: 0 16px 40px rgba(56, 140, 255, 0.2);
}

.featured-card .meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.featured-card .meta time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.featured-card h3 {
    position: relative;
    z-index: 1;
    font-size: clamp(20px, 3.2vw, 26px);
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 10px;
    max-width: 34em;
}

.featured-card p {
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, 0.78);
    font-size: 15px;
    max-width: 40em;
    margin-bottom: 16px;
}

.featured-flag {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(134, 239, 172, 0.18);
    color: var(--km-ok, #86efac);
    border: 1px solid rgba(134, 239, 172, 0.28);
}

.featured-more {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 800;
    color: #9ad8ff;
}

.featured-card:hover .featured-more {
    color: #fff;
}

/* ---------- 分类筛选 ---------- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding: 4px;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.78);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.filter-btn.is-active {
    background: linear-gradient(135deg, #64c8ff, #4a9eff);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(100, 200, 255, 0.28);
}

.filter-btn:focus-visible {
    outline: 2px solid rgba(100, 200, 255, 0.7);
    outline-offset: 2px;
}

.filter-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    padding: 28px 12px;
}

/* ---------- 文章卡片网格 ---------- */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.post-card {
    position: relative;
    padding: 20px 22px 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(18, 26, 52, 0.92), rgba(10, 14, 32, 0.92));
    border: 1px solid rgba(100, 200, 255, 0.18);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    min-height: 168px;
}

.post-card:hover {
    transform: translateY(-3px);
    border-color: rgba(100, 200, 255, 0.4);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

.post-card .meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: rgba(255,255,255,0.48);
}

.post-card h3 {
    font-size: 17px;
    font-weight: 800;
    line-height: 1.4;
}

.post-card h3 a {
    text-decoration: none;
}

/* 整卡可点：扩大标题链接热区 */
.post-card h3 a::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.post-card h3 a:hover {
    color: var(--km-accent, #64c8ff);
}

.post-card > p {
    color: rgba(255,255,255,0.62);
    font-size: 14px;
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    position: relative;
    z-index: 2;
}

.tag {
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255,255,255,0.62);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.category-chip {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(100, 200, 255, 0.16);
    color: #9ad8ff;
}

/* 分类色 */
.cat-太空,
.category-chip.cat-太空 {
    background: rgba(100, 200, 255, 0.18);
    color: #9ad8ff;
}

.cat-海洋,
.category-chip.cat-海洋 {
    background: rgba(45, 212, 191, 0.16);
    color: #5eead4;
}

.cat-家长经验,
.category-chip.cat-家长经验 {
    background: rgba(251, 191, 36, 0.14);
    color: #fcd34d;
}

.cat-关于本站,
.category-chip.cat-关于本站 {
    background: rgba(167, 139, 250, 0.16);
    color: #c4b5fd;
}

.post-card[data-category="海洋"] {
    border-color: rgba(45, 212, 191, 0.2);
}

.post-card[data-category="海洋"]:hover {
    border-color: rgba(45, 212, 191, 0.42);
}

.post-card[data-category="家长经验"] {
    border-color: rgba(251, 191, 36, 0.18);
}

.post-card[data-category="家长经验"]:hover {
    border-color: rgba(251, 191, 36, 0.4);
}

.post-card[data-category="关于本站"] {
    border-color: rgba(167, 139, 250, 0.22);
}

/* ---------- 怎么玩三步 ---------- */
.how-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.how-step {
    padding: 22px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.how-step__num {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-bottom: 12px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #64c8ff, #7c6af0);
    box-shadow: 0 6px 16px rgba(100, 200, 255, 0.22);
}

.how-step h3 {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 8px;
}

.how-step p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.62);
    line-height: 1.55;
}

/* ---------- 按钮 ---------- */
.btn-explore {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 26px;
    border-radius: 999px;
    background: linear-gradient(135deg, #64c8ff, #4a9eff);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(100, 200, 255, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-explore:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(100, 200, 255, 0.4);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 800;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
}

.btn-soft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 18px;
    border-radius: 999px;
    background: rgba(167, 139, 250, 0.2);
    border: 1px solid rgba(167, 139, 250, 0.4);
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.2s ease;
}

.btn-soft:hover {
    background: rgba(167, 139, 250, 0.3);
    transform: translateY(-1px);
}

/* ---------- 徽章预览 ---------- */
.badge-panel {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 20px;
    align-items: center;
    padding: 28px 26px;
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(167, 139, 250, 0.14), rgba(100, 200, 255, 0.08));
    border: 1px solid rgba(167, 139, 250, 0.3);
}

.badge-panel .section-title {
    margin-bottom: 8px;
}

.badge-panel .section-desc {
    margin-bottom: 16px;
}

.badge-preview {
    text-align: center;
}

.badge-preview .row {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.mini-badge {
    width: 104px;
    padding: 16px 10px 14px;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    font-weight: 700;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.mini-badge .ico {
    font-size: 30px;
    display: block;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 10px rgba(167, 139, 250, 0.35));
}

.mini-badge__name {
    display: block;
    line-height: 1.3;
}

.mini-badge.locked {
    opacity: 0.42;
    filter: grayscale(0.7);
}

.mini-badge.locked .ico {
    filter: none;
}

/* ---------- 文章页排版 ---------- */
.km-article {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px 48px;
}

.post-header {
    margin-bottom: 28px;
    text-align: center;
}

.post-category {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 999px;
    background: rgba(100, 200, 255, 0.18);
    color: #9ad8ff;
    margin-bottom: 14px;
}

.post-header h1 {
    font-size: clamp(24px, 4.5vw, 32px);
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 12px;
}

.post-meta {
    color: rgba(255,255,255,0.5);
    font-size: 13px;
}

.post-body {
    color: rgba(255,255,255,0.88);
    font-size: 16px;
    line-height: 1.85;
}

.post-body h2 {
    font-size: 21px;
    font-weight: 800;
    margin: 32px 0 12px;
    color: #fff;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.post-body h3 {
    font-size: 18px;
    font-weight: 800;
    margin: 26px 0 10px;
    color: #9ad8ff;
}

.post-body p { margin-bottom: 16px; }

.post-body ul, .post-body ol {
    margin: 0 0 16px 22px;
}

.post-body li { margin-bottom: 8px; }

.post-body strong { color: #fff; }

.post-body blockquote {
    margin: 18px 0;
    padding: 14px 18px;
    border-left: 3px solid var(--km-accent, #64c8ff);
    background: rgba(100, 200, 255, 0.08);
    border-radius: 0 12px 12px 0;
    color: rgba(255,255,255,0.85);
}

.post-body a { color: #9ad8ff; text-decoration: underline; }

.post-body code {
    background: rgba(255,255,255,0.1);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 14px;
}

.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.post-nav a {
    flex: 1;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease;
}

.post-nav a:hover { background: rgba(255,255,255,0.1); }

.post-nav .nav-prev { text-align: left; }

.post-nav .nav-next { text-align: right; }

.post-nav .nav-label {
    display: block;
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    margin-bottom: 4px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
    .blog-header {
        padding-top: 36px;
    }

    .blog-section {
        padding: 24px 16px;
    }

    .section-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-head--center {
        align-items: center;
    }

    .world-cards {
        grid-template-columns: 1fr;
    }

    .world-card {
        grid-template-columns: auto 1fr;
    }

    .how-steps {
        grid-template-columns: 1fr;
    }

    .how-step {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        column-gap: 14px;
        text-align: left;
        align-items: start;
    }

    .how-step__num {
        grid-row: 1 / span 2;
        margin-bottom: 0;
        align-self: center;
    }

    .badge-panel {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 24px 18px;
    }

    .badge-panel__copy .btn-soft {
        margin-bottom: 4px;
    }

    .featured-card {
        padding: 22px 18px 20px;
    }

    .featured-flag {
        position: static;
        display: inline-flex;
        margin-bottom: 10px;
    }
}

@media (max-width: 420px) {
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .hero-actions .btn-explore,
    .hero-actions .btn-ghost {
        width: 100%;
    }

    .trust-row {
        gap: 6px;
    }

    .trust-row li {
        font-size: 11px;
        padding: 5px 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .featured-card,
    .post-card,
    .world-card,
    .btn-explore,
    .btn-soft {
        transition: none;
    }

    .featured-card:hover,
    .post-card:hover,
    .world-card:hover {
        transform: none;
    }
}
