/* =========================================================
   博客页面基础样式
   与应用列表页面保持统一的视觉系统
   ========================================================= */

.hero {
    background:
        linear-gradient(
            100deg,
            #0b0d3d 0%,
            #180f47 55%,
            #6a1718 100%
        );

    color: #ffffff;

    position: relative;

    overflow: hidden;
}


.hero-in {
    min-height: 310px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    text-align: center;

    position: relative;

    z-index: 1;
}


.hero h1 {
    font-size: 39px;

    line-height: 1.05;

    margin: 0;
}


.hero h1 span {
    display: block;

    color: var(--gold);

    font-size: 51px;
}


.hero p {
    font-size: 18px;

    font-weight: 700;

    margin: 8px 0 18px;
}


/* =========================================================
   搜索框
   ========================================================= */

.searchbox {
    width: min(680px, 100%);

    height: 48px;

    display: flex;

    background: #ffffff;

    border-radius: 28px;

    overflow: hidden;

    box-shadow: 0 10px 25px #0004;
}


.searchbox input {
    flex: 1;

    min-width: 0;

    border: 0;

    outline: 0;

    padding: 0 20px;

    color: var(--ink);

    font-size: 14px;
}


.searchbox button {
    width: 100px;

    border: 0;

    background: var(--red);

    color: #ffffff;

    font-weight: 900;

    cursor: pointer;
}


/* =========================================================
   旧版博客 Hero 兼容样式
   ========================================================= */

.blog-hero {
    background:
        linear-gradient(
            135deg,
            #10143b,
            #241052
        );

    color: #ffffff;

    padding: 34px 0;
}


.blog-hero h1 {
    font-size: 36px;

    margin: 0;
}


.blog-hero p {
    color: #dbe0f3;

    font-size: 13px;

    margin: 7px 0 0;
}


/* =========================================================
   博客主体区域
   ========================================================= */

.blog-layout {
    width: 100%;

    margin: 22px 0 30px;
}


.blog-posts {
    width: 100%;

    max-width: none;

    margin: 0;
}


/* =========================================================
   博客卡片网格
   与应用列表保持五列布局
   ========================================================= */

.post-grid {
    width: 100%;

    display: block;
}


[data-blog-index-list] {
    width: 100%;

    display: grid;

    grid-template-columns:
        repeat(5, minmax(0, 1fr));

    gap: 14px;

    align-items: stretch;

    counter-reset: blog-rank;
}


/* =========================================================
   博客卡片
   尺寸、圆角、阴影与应用列表卡片保持一致
   ========================================================= */

.post-card {
    position: relative;

    min-width: 0;

    min-height: 276px;

    padding: 28px 11px 12px;

    display: flex;

    flex-direction: column;

    background: #ffffff;

    border: 1px solid #dce4ef;

    border-radius: 15px;

    text-align: center;

    overflow: hidden;

    box-shadow:
        0 7px 20px rgba(16, 20, 59, 0.055);

    counter-increment: blog-rank;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}


.post-card:hover {
    transform: translateY(-4px);

    border-color: #cbd6e7;

    box-shadow:
        0 14px 30px rgba(16, 20, 59, 0.11);
}


/* =========================================================
   左上角排名
   与应用列表中的 #01、#02、#03 完全一致
   ========================================================= */

.post-card::before {
    content:
        "#" counter(blog-rank, decimal-leading-zero);

    position: absolute;

    top: 0;

    left: 0;

    min-width: 44px;

    height: 30px;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 0 10px;

    box-sizing: border-box;

    border-radius: 0 0 10px 0;

    background: #1769e8;

    color: #ffffff;

    font-size: 10px;

    line-height: 1;

    font-weight: 900;

    z-index: 20;
}


/* 第一张卡片 */

.post-card:nth-child(1)::before {
    background: #f7b900;
}


/* 第二张卡片 */

.post-card:nth-child(2)::before {
    background: #8997aa;
}


/* 第三张卡片 */

.post-card:nth-child(3)::before {
    background: #d47b2b;
}


/* 第四张及以后 */

.post-card:nth-child(n + 4)::before {
    background: #1769e8;
}


/* =========================================================
   博客图片区域
   注意：这里不再创建定位上下文
   这样右上角标签可以直接参考整个卡片
   ========================================================= */

.post-cover {
    width: 86px;

    height: 86px;

    position: static;

    flex: 0 0 86px;

    margin: 0 auto 9px;

    overflow: visible;

    border-radius: 22px;
}


.post-cover img {
    width: 86px;

    height: 86px;

    display: block;

    object-fit: cover;

    border-radius: 22px;

    box-shadow:
        0 10px 22px rgba(16, 20, 59, 0.14);
}


/* =========================================================
   右上角分类标签
   现在直接相对于整个博客卡片定位
   不再相对于图片定位
   ========================================================= */

.post-label {
    position: absolute;

    top: 9px;

    right: 8px;

    max-width: 110px;

    padding: 4px 7px;

    box-sizing: border-box;

    border-radius: 20px;

    background: var(--red);

    color: #ffffff;

    font-size: 8px;

    line-height: 1;

    font-weight: 900;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

    z-index: 30;
}


/* 第一张博客 */

.post-card:nth-child(1) .post-label {
    background: var(--red);
}


/* 第二张博客 */

.post-card:nth-child(2) .post-label {
    background: var(--green);
}


/* 第三张博客 */

.post-card:nth-child(3) .post-label {
    background: var(--red);
}


/* 第四张及以后 */

.post-card:nth-child(n + 4) .post-label {
    background: var(--green);
}


/* =========================================================
   博客正文区域
   ========================================================= */

.post-body {
    width: 100%;

    min-width: 0;

    padding: 0;

    display: flex;

    flex-direction: column;

    flex: 1;
}


/* =========================================================
   博客标题
   ========================================================= */

.post-body h2 {
    margin: 0;

    color: var(--navy);

    font-size: 14px;

    line-height: 1.3;

    font-weight: 800;

    text-align: center;
}


/* =========================================================
   博客简介
   控制为两行，避免卡片高度异常
   ========================================================= */

.post-body p {
    height: 30px;

    margin: 6px 0;

    overflow: hidden;

    color: var(--muted);

    font-size: 9px;

    line-height: 1.35;

    text-align: center;

    display: -webkit-box;

    -webkit-box-orient: vertical;

    -webkit-line-clamp: 2;
}


/* =========================================================
   日期和作者
   ========================================================= */

.post-meta {
    min-height: 21px;

    margin-top: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    color: #7a849c;

    font-size: 8px;

    line-height: 1.2;

    font-weight: 800;

    text-align: center;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


/* =========================================================
   阅读按钮
   与应用列表绿色按钮保持一致
   ========================================================= */

.read-more {
    width: 100%;

    min-height: 39px;

    margin-top: 9px;

    display: flex;

    align-items: center;

    justify-content: center;

    border: 0;

    border-radius: 8px;

    background: var(--green);

    color: #ffffff;

    text-decoration: none;

    font-size: 11px;

    line-height: 1;

    font-weight: 900;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}


.read-more:hover {
    background: #098b49;

    color: #ffffff;

    transform: translateY(-1px);
}


/* =========================================================
   平板：四列
   ========================================================= */

@media (max-width: 1100px) {

    [data-blog-index-list] {
        grid-template-columns:
            repeat(4, minmax(0, 1fr));
    }

}


/* =========================================================
   小平板：三列
   ========================================================= */

@media (max-width: 850px) {

    [data-blog-index-list] {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));

        gap: 10px;
    }

}


/* =========================================================
   手机：两列
   与应用列表手机布局保持一致
   ========================================================= */

@media (max-width: 680px) {

    .hero-in {
        min-height: 235px;

        padding: 18px 10px;
    }


    .hero h1 {
        font-size: 25px;

        line-height: 1.08;
    }


    .hero h1 span {
        font-size: 31px;

        line-height: 1.08;
    }


    .hero p {
        font-size: 11px;

        line-height: 1.4;

        margin: 9px 0 14px;
    }


    .searchbox {
        width: 100%;

        height: 42px;
    }


    .searchbox input {
        padding: 0 13px;

        font-size: 12px;
    }


    .searchbox button {
        width: 70px;

        font-size: 11px;
    }


    .blog-layout {
        margin: 14px 0 25px;
    }


    [data-blog-index-list] {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 10px;
    }


    /* =====================================================
       手机端卡片
       ===================================================== */

    .post-card {
        min-height: 252px;

        padding:
            31px 8px
            10px;

        border-radius: 13px;

        box-shadow:
            0 6px 16px
            rgba(16, 20, 59, 0.07);
    }


    /* =====================================================
       手机端排名
       ===================================================== */

    .post-card::before {
        min-width: 39px;

        height: 28px;

        padding: 0 8px;

        border-radius: 0 0 9px 0;

        font-size: 9px;
    }


    /* =====================================================
       手机端分类标签
       仍然相对于整个卡片定位
       ===================================================== */

    .post-label {
        top: 8px;

        right: 7px;

        max-width: 82px;

        padding: 4px 6px;

        font-size: 7px;
    }


    /* =====================================================
       手机端图片
       ===================================================== */

    .post-cover {
        width: 70px;

        height: 70px;

        flex-basis: 70px;

        margin-bottom: 9px;

        border-radius: 18px;
    }


    .post-cover img {
        width: 70px;

        height: 70px;

        border-radius: 18px;

        box-shadow:
            0 8px 18px
            rgba(16, 20, 59, 0.13);
    }


    /* =====================================================
       手机端标题
       ===================================================== */

    .post-body h2 {
        font-size: 13px;

        line-height: 1.35;
    }


    /* =====================================================
       手机端简介
       ===================================================== */

    .post-body p {
        height: 31px;

        margin: 5px 0;

        font-size: 9px;

        line-height: 1.35;
    }


    /* =====================================================
       手机端日期作者
       ===================================================== */

    .post-meta {
        min-height: 19px;

        font-size: 7px;
    }


    /* =====================================================
       手机端按钮
       ===================================================== */

    .read-more {
        min-height: 40px;

        margin-top: 8px;

        border-radius: 8px;

        font-size: 10px;
    }

}


/* =========================================================
   小屏手机
   ========================================================= */

@media (max-width: 430px) {

    [data-blog-index-list] {
        gap: 8px;
    }


    .post-card {
        min-height: 252px;

        padding:
            30px 7px
            9px;
    }


    .post-label {
        top: 8px;

        right: 7px;

        max-width: 76px;

        font-size: 6.5px;
    }


    .post-cover {
        width: 64px;

        height: 64px;

        flex-basis: 64px;
    }


    .post-cover img {
        width: 64px;

        height: 64px;
    }


    .post-body h2 {
        font-size: 12px;
    }


    .post-body p {
        height: 30px;

        font-size: 8px;
    }


    .post-meta {
        font-size: 6.8px;
    }


    .read-more {
        min-height: 38px;

        font-size: 9px;
    }

}