/* --- 全局样式 --- */
body {
    margin: 0;
    padding: 0;
    /* font-family: 'Noto Sans SC', sans-serif; */
    font-family: 'ZCOOL KuaiLe', 'Noto Sans SC', sans-serif; /* 更换字体 */
    background: linear-gradient(to bottom right, #e6f7ff, #fde2f3); /* 渐变背景 */
    color: #343a40;
    line-height: 1.7;
    overflow-x: hidden;
}

/* 链接样式 */
a {
    color: var(--secondary-color); /* 浅粉色链接 */
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease; /* 添加 transform 过渡 */
}

a:hover {
    color: var(--primary-color); /* 浅蓝色悬停链接 */
    text-decoration: none;
    transform: scale(1.1); /* 悬停时放大 */
}

/* --- 页面结构 --- */
header {
    background-color: #f8f9fa; /* 柔和的背景色 */
    color: #343a40;
    padding: 30px 0;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    /* overflow: hidden;  可选，如果不需要 header 背景溢出就保留 */
}


 header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../assets/img/stars-galaxy.gif') repeat;  像素风格背景
    opacity: 0.3;  降低透明度
    z-index: -1;  移除这一行
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
    color: var(--secondary-color); /* 浅粉色文字 */
    mix-blend-mode: screen; /* 使用 difference 混合模式 */
}


header p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8); /* 设置为白色，透明度为 0.8 */
    mix-blend-mode: screen; /* 使用 difference 混合模式 */
}

main {
    padding: 30px 0;
}

/* --- 页面结构 --- */
footer {
    background: linear-gradient(to top right, #fde2f3, #e6f7ff); /* 修改渐变方向并交换颜色值 */
    border-top: 1px solid #ddd; /* 更柔和的边框颜色 */
    padding: 20px 0;
    text-align: center;
    color: #555; /* 更深的文字颜色 */
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05); /* 添加阴影 */
    display: flex;
    justify-content: center; /* 水平居中 */
    align-items: center; /* 垂直居中 */
    transform: rotate(180deg); /* 旋转 180 度 */
    overflow: hidden; /* 防止溢出 */
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    transform: rotate(-180deg); /* 抵消旋转 */
}


/* --- 博客列表 --- */
.blog-list {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.blog-item {
    background-color: #fff;
    border-radius: 10px;
    /* box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); */
    box-shadow: 0 4px 10px var(--secondary-color-transparent); /* 浅粉色阴影 */
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* border: 2px dashed var(--primary-color);  虚线边框 - 移除这一行 */
    /* border: 1px solid #eee;  添加一个更 subtle 的边框 */
    /* 渐变边框 */
    /* border: 2px solid transparent;  透明边框
    background-image: linear-gradient(white, white), conic-gradient(from 180deg at top, var(--primary-color), var(--secondary-color), var(--primary-color));  渐变背景
    background-origin: border-box;
    background-clip: content-box, border-box; */
}

.blog-item:hover {
    transform: translateY(-5px);
    /* box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12); */
    box-shadow: 0 8px 20px var(--primary-color-transparent); /* 浅蓝色阴影 */
}

.blog-item a {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-thumbnail {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.blog-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-item:hover .blog-thumbnail img {
    transform: scale(1.2);
}

/* 添加一个覆盖层，实现颜色渐变效果 */
.blog-thumbnail::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255, 182, 193, 0.2), rgba(123, 181, 254, 0.2)); /* 浅粉色到浅蓝色的渐变 */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.blog-item:hover .blog-thumbnail::before {
    opacity: 1;
}

.blog-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.blog-content h2 {
    font-size: 1.7rem;
    margin-bottom: 10px;
    color: var(--secondary-color);
    font-weight: bold;
    transition: color 0.3s ease;
}

.blog-item:hover .blog-content h2 {
    color: var(--primary-color);
    transform: scale(1.05);
}

.blog-excerpt {
    font-size: 1rem;
    color: #555;
    margin-bottom: 15px;
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #777;
}

.blog-meta span {
    display: flex;
    align-items: center;
}

.blog-meta i {
    margin-right: 5px;
    color: #aaa;
    transition: transform 0.3s ease;
}

.blog-meta span:hover i {
    transform: rotate(30deg);
}

/* 分页 */
.pagination {
    max-width: 800px;
    margin: 30px auto;
    padding: 0 20px;
    display: flex; /* 修改为 Flex 布局 */
    flex-direction: column; /* 垂直排列 */
    align-items: center; /* 水平居中 */
    font-size: 1rem;
    color: #777;
}

.page-nav {
    display: flex; /* Flex 布局 */
    justify-content: center; /* 水平居中 */
    align-items: center; /* 垂直居中 */
}

.page-btn {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.page-btn:hover {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f8f9fa;
    border-color: #eee;
    color: #aaa;
    transform: none;
}

.page-info {
    font-size: 1rem;
    color: #777;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0 10px; /* 增加左右间距 */
}

.page-jump-container {
    display: flex;
    justify-content: center;
}

.page-jump {
    display: flex;
    align-items: center;
    margin-top: 7px; /* 向下移动 10 像素 */
}

.page-input {
    width: 50px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-align: center;
    font-size: 1rem;
    color: #777;
}

.jump-btn {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 5px 10px;
    margin-left: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.jump-btn:hover {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}





/* 主题色 */
:root {
    --primary-color: #77b5fe; /* 浅蓝色 */
    --secondary-color: #ffb6c1; /* 浅粉色 */
    --primary-color-transparent: rgba(119, 181, 254, 0.3); /* 浅蓝色透明 */
    --secondary-color-transparent: rgba(255, 182, 193, 0.3); /* 浅粉色透明 */
}

/* 博文页面样式 */
.blog-post {
    max-width: 800px;
    margin: 30px auto;
    padding: 30px;
    background-color: #fff;
    border-radius: 10px;
    /* box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); */
    box-shadow: 0 4px 10px var(--secondary-color-transparent); /* 浅粉色阴影 */
}

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

.blog-post-header h2 {
    font-size: 2.2rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--secondary-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.blog-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    color: #555; /* 更深的颜色 */
}

.blog-meta span {
    display: flex;
    align-items: center;
    margin: 0 10px;
}

.blog-meta i {
    margin-right: 5px;
    color: var(--primary-color); /* 浅蓝色图标 */
}

.blog-post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #555;
}

.blog-post-content p {
    margin-bottom: 20px;
}

.blog-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.blog-post-content ul,
.blog-post-content ol {
    margin-left: 30px;
    margin-bottom: 20px;
}

.blog-post-content li {
    margin-bottom: 10px;
}

/* 最近文章 */
.recent-posts {
    max-width: 800px;
    margin: 0 auto 30px; /* 增加底部外边距，与博文列表分隔开 */
    padding: 0 20px;
}

.recent-posts-container {
    display: flex;
    justify-content: center; /* 水平居中 */
    align-items: center;
    gap: 30px; /* 增加文章之间的间距 */
}

.recent-post-item {
    position: relative; /* 相对定位，用于绝对定位 overlay */
    width: 250px; /* 增加宽度 */
    height: 200px; /* 增加高度 */
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 10px var(--secondary-color-transparent); /* 浅粉色阴影 */
    transition: transform 0.3s ease;
}

.recent-post-item:hover {
    transform: translateY(-5px);
}

.recent-post-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.recent-post-item:hover img {
    transform: scale(1.2);
}

.recent-post-item a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative; /* 确保 overlay 相对于 a 元素定位 */
}

.recent-post-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* 水平垂直居中 */
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    text-align: center;
    padding: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.recent-post-overlay h3,
.recent-post-overlay p {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.recent-post-item:hover .recent-post-overlay {
    opacity: 1; /* 鼠标悬停时显示 */
}

.recent-post-overlay h3 {
    font-size: 1.1rem; /* 缩小原始标题字体 */
    margin-bottom: 5px;
}

.recent-post-overlay p {
    font-size: 0.8rem; /* 缩小原始简介字体 */
}

.recent-post-item:hover .recent-post-overlay h3 {
    font-size: 1.2rem; /* 缩小放大后的标题字体 */
}

.recent-post-item:hover .recent-post-overlay p {
    font-size: 0.9rem; /* 缩小放大后的简介字体 */
}

/* 响应式调整 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .blog-list {
        grid-template-columns: 1fr;
    }

    .blog-post {
        padding: 20px;
        margin: 20px;
    }

    .blog-post-header h2 {
        font-size: 2rem;
    }

    .blog-meta {
        flex-direction: column;
    }

    .blog-meta span {
        margin: 5px 0;
    }
    .recent-post-overlay h3 {
        font-size: 0.9rem; /* 缩小原始标题字体 */
        margin-bottom: 3px;
    }

    .recent-post-overlay p {
        font-size: 0.7rem; /* 缩小原始简介字体 */
    }

    .recent-post-item:hover .recent-post-overlay h3 {
        font-size: 1.0rem; /* 缩小放大后的标题字体 */
    }

    .recent-post-item:hover .recent-post-overlay p {
        font-size: 0.7rem; /* 缩小放大后的简介字体 */
    }

    .blog-post-content iframe {
        display: block; /* 确保 iframe 显示 */
        max-width: 100%; /* 限制 iframe 的最大宽度 */
        margin: 0 auto; /* 水平居中 iframe */
    }
}
