/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
    background-image: linear-gradient(to bottom, #f9f9f9 0%, #f3f3f3 100%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: #4285f4;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    text-decoration: underline;
    color: #3367d6;
}

/* 头部样式 */
header {
    background-color: #4285f4;
    background-image: linear-gradient(135deg, #4285f4 0%, #3367d6 100%);
    color: white;
    padding: 30px 0;
    margin-bottom: 30px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* 新增：头部布局样式 */
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 新增：头像样式 */
.avatar-container {
    margin-right: 20px;
}

.avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.avatar:hover {
    transform: scale(1.05);
}

/* 新增：站点信息样式 */
.site-info {
    flex-grow: 1;
}

header h1 {
    font-size: 2.2rem;
    margin-bottom: 5px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

header a {
    color: white;
    text-decoration: none;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 新增：头部链接样式 */
.header-links {
    margin-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.homepage-link, .github-link {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-block;
}

.homepage-link:hover, .github-link:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    text-decoration: none;
}

.github-link {
    background-color: rgba(36, 41, 46, 0.7); /* GitHub 的标志性深色 */
}

.github-link:hover {
    background-color: rgba(36, 41, 46, 0.9);
}

/* 新增：搜索和排序控件样式 */
.blog-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-container {
    display: flex;
    flex: 1;
    max-width: 500px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px 0 0 20px;
    font-size: 1rem;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: inset 0 1px 3px rgba(66, 133, 244, 0.3);
}

.search-button {
    background-color: #4285f4;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-button:hover {
    background-color: #3367d6;
}

.sort-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background-color: white;
    color: #333;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-select:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

/* 博客列表样式 */
.blog-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.blog-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer; /* 添加指针光标表明整个卡片是可点击的 */
    display: block; /* 确保卡片是一个块级元素，这样整个元素都可点击 */
    text-decoration: none; /* 移除默认的链接下划线 */
    color: inherit; /* 继承父元素的颜色 */
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.blog-card-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
}

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

.blog-card:hover img {
    transform: scale(1.05);
}

.blog-card-content {
    padding: 25px;
}

.blog-card h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #222;
}

.blog-card-date {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.blog-card-date i {
    margin-right: 5px;
    color: #4285f4;
}

.word-count {
    display: inline-flex;
    align-items: center;
    color: #666;
}

.blog-card-excerpt {
    color: #555;
    margin-bottom: 15px;
    line-height: 1.7;
}

.read-more {
    display: inline-block;
    color: #4285f4;
    font-weight: bold;
    padding: 5px 0;
    position: relative;
}

.read-more:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #4285f4;
    transition: width 0.3s ease;
}

.read-more:hover:after {
    width: 100%;
}

/* 新增：加载更多按钮样式 */
.load-more-container {
    display: flex;
    justify-content: center;
    margin: 30px 0 50px;
}

.load-more-button {
    background-color: #4285f4;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(66, 133, 244, 0.3);
}

.load-more-button:hover {
    background-color: #3367d6;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(66, 133, 244, 0.4);
}

.load-more-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(66, 133, 244, 0.3);
}

/* 单篇博客文章样式 */
.post-container {
    background-color: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.post-header {
    margin-bottom: 20px; /* 减小了标题与内容的间距 */
    border-bottom: 1px solid #eee;
    padding-bottom: 15px; /* 减小了内边距 */
}

.post-header h1 {
    font-size: 2.3rem;
    margin-bottom: 8px; /* 减小了标题与元数据的间距 */
    color: #222;
}

.post-meta {
    color: #666;
    font-size: 1rem;
    display: flex;
    align-items: center;
}

.post-meta i {
    margin-right: 5px;
    color: #4285f4;
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin: 1.5em 0 0.5em;
    color: #222;
}

.post-content p,
.post-content ul,
.post-content ol {
    margin-bottom: 1.2em;
}

/* 修复有序列表和无序列表的样式，防止数字标号溢出 */
.post-content ul,
.post-content ol {
    padding-left: 2em; /* 增加左边距，使数字标号不会溢出 */
}

.post-content li {
    margin-bottom: 0.5em; /* 为列表项添加间距 */
}

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

.post-content pre {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid #eee;
}

.post-content code {
    font-family: 'Consolas', 'Monaco', monospace;
    background-color: #f5f5f5;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.9em;
    border: 1px solid #eee;
}

.post-content blockquote {
    border-left: 4px solid #4285f4;
    padding-left: 20px;
    margin: 20px 0;
    color: #555;
    font-style: italic;
}

/* PDF容器样式 */
.pdf-container {
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.pdf-header {
    background-color: #f5f5f5;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

.pdf-title {
    font-weight: bold;
    color: #333;
}

.pdf-external-link {
    color: #4285f4;
    font-size: 0.9rem;
    background-color: rgba(66, 133, 244, 0.1);
    padding: 5px 10px;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.pdf-external-link:hover {
    background-color: rgba(66, 133, 244, 0.2);
    text-decoration: none;
}

.pdf-iframe {
    width: 100%;
    height: 600px;
    border: none;
}

/* PDF内容直接渲染样式 */
.pdf-content-wrapper {
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.8;
}

.pdf-toolbar {
    text-align: right;
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.pdf-external-link {
    display: inline-block;
    color: #4285f4;
    background-color: rgba(66, 133, 244, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.pdf-external-link:hover {
    background-color: rgba(66, 133, 244, 0.2);
    text-decoration: none;
    transform: translateY(-2px);
}

.pdf-page {
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    background-color: white;
    padding: 15px;
    border-radius: 8px;
}

.pdf-canvas {
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
}

.pdf-page-indicator {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin-top: 15px;
    padding: 8px 15px;
    background-color: #f5f5f5;
    border-radius: 20px;
    display: inline-block;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 在移动设备上减小PDF查看器高度 */
@media (max-width: 768px) {
    .pdf-iframe {
        height: 400px;
    }
}

/* 页脚样式 */
footer {
    background-color: #333;
    color: #fff;
    padding: 30px 0;
    text-align: center;
    margin-top: 50px;
    box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.1);
}

footer p {
    opacity: 0.8;
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
    color: #666;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .avatar-container {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .site-info {
        margin-bottom: 15px;
    }
    
    .header-links {
        margin-left: 0;
    }
    
    .post-container,
    .blog-card-content {
        padding: 20px;
    }
    
    .post-header h1 {
        font-size: 1.8rem;
    }
    
    /* 响应式搜索和排序控件 */
    .blog-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-container {
        max-width: 100%;
        margin-bottom: 15px;
    }
}

/* 新增：刷新按钮样式 */
.refresh-container {
    display: flex;
    align-items: center;
}

.refresh-button {
    background-color: #4285f4;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.refresh-button i {
    font-size: 0.9rem;
}

.refresh-button:hover {
    background-color: #3367d6;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(66, 133, 244, 0.3);
}

.refresh-button:active {
    transform: translateY(0);
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: white;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    max-width: 90%;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification-success {
    background-color: #4CAF50;
}

.notification-error {
    background-color: #f44336;
}

/* 旋转动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spinner.fa-spin {
    animation: spin 1s linear infinite;
}