/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

/* 导航栏 */
.site-header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    color: #333;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #666;
    transition: color 0.3s;
}

.nav-link:hover {
    color: #007acc;
}

/* 搜索框 */
.search-container {
    position: relative;
}

#search-input {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 20px;
    width: 250px;
    outline: none;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
}

.search-result-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.search-result-item:hover {
    background: #f5f5f5;
}

/* 主要内容区域 */
main {
    min-height: calc(100vh - 200px);
}

/* 首页样式 */
.home-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.hero-section {
    text-align: center;
    padding: 2rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 3rem;
}

.hero-section h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.posts-section h2 {
    margin-bottom: 2rem;
    font-size: 2rem;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.post-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.post-card:hover {
    transform: translateY(-2px);
}

.post-card h3 a {
    text-decoration: none;
    color: #333;
    font-size: 1.25rem;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0;
    color: #666;
    font-size: 0.9rem;
}

/* 点赞按钮 */
.like-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s;
}

.like-btn:hover {
    transform: scale(1.1);
}

.like-btn.liked {
    color: #e74c3c;
}

/* 标签 */
.post-tags {
    margin-top: 1rem;
}

.tag {
    display: inline-block;
    background: #f0f0f0;
    color: #666;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-right: 0.5rem;
}

/* 文章页面 */
.post-single {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.post-header {
    margin-bottom: 2rem;
    text-align: center;
}

.post-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

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

.post-content h2,
.post-content h3,
.post-content h4 {
    margin: 2rem 0 1rem 0;
}

.post-content p {
    margin-bottom: 1rem;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.post-content pre {
    background: #f4f4f4;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}

/* 文章导航 */
.post-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.prev-post,
.next-post {
    text-decoration: none;
    color: #007acc;
    padding: 0.5rem 1rem;
    border: 1px solid #007acc;
    border-radius: 4px;
    transition: all 0.3s;
}

.prev-post:hover,
.next-post:hover {
    background: #007acc;
    color: white;
}

/* 相关文章 */
.related-posts {
    max-width: 800px;
    margin: 3rem auto 0;
    padding: 0 2rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.related-post {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 8px;
}

/* 广告容器 */
.ad-container {
    margin: 2rem 0;
    text-align: center;
}

.hero-ad {
    margin-top: 2rem;
}

.article-top-ad,
.article-bottom-ad {
    margin: 2rem auto;
    max-width: 728px;
}

.footer-ad {
    margin-top: 2rem;
}

/* 按钮 */
.btn {
    display: inline-block;
    background: #007acc;
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s;
}

.btn:hover {
    background: #005a9e;
}

/* 页脚 */
.site-footer {
    background: #333;
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.footer-content a {
    color: #007acc;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-container {
        width: 100%;
    }
    
    #search-input {
        width: 100%;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .post-single {
        padding: 1rem;
    }
    
    .post-nav {
        flex-direction: column;
        gap: 1rem;
    }
}/*
 Alert 组件样式 */
.alert {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    margin: 16px 0;
    border-radius: 8px;
    border-left: 4px solid;
    background-color: #f8f9fa;
}

.alert-info {
    border-left-color: #17a2b8;
    background-color: #d1ecf1;
    color: #0c5460;
}

.alert-success {
    border-left-color: #28a745;
    background-color: #d4edda;
    color: #155724;
}

.alert-warning {
    border-left-color: #ffc107;
    background-color: #fff3cd;
    color: #856404;
}

.alert-danger {
    border-left-color: #dc3545;
    background-color: #f8d7da;
    color: #721c24;
}

.alert-icon {
    font-size: 18px;
    margin-right: 12px;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-content p {
    margin: 0;
}

.alert-content p:not(:last-child) {
    margin-bottom: 8px;
}