/**
 * 技术博客样式文件
 * 响应式设计，支持移动端和桌面端
 */

/* 基础样式重置 */
* {
    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: #f8f9fa;
}

/* 导航栏样式 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.nav-link:hover {
    background-color: rgba(255,255,255,0.1);
}

/* 主内容区域 */
.main-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    min-height: calc(100vh - 200px);
}

/* 首页样式 */
/* 情感化设计增强 */
.hero {
    text-align: center;
    padding: 4rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" patternUnits="userSpaceOnUse" width="100" height="100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: fadeInUp 0.8s ease-out;
}

.hero-content p {
    font-size: 1.2rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out;
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.category-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

/* 卡片悬停效果增强 */
.post-preview {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.post-preview:hover {
    transform: translateX(5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.15);
    border-left-color: #667eea;
}

/* 按钮样式优化 */
.read-more, .category-link {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.read-more:hover, .category-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.category-card h3 {
    color: #667eea;
    margin-bottom: 1rem;
}

.category-link {
    display: inline-block;
    margin-top: 1rem;
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
}

/* 文章列表 */
.post-list {
    display: grid;
    gap: 2rem;
}

.post-preview {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.post-preview-title a {
    color: #333;
    text-decoration: none;
    font-size: 1.5rem;
}

.post-preview-title a:hover {
    color: #667eea;
}

.post-preview-meta {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    color: #666;
    font-size: 0.9rem;
}

.post-preview-excerpt {
    color: #555;
    margin-bottom: 1rem;
}

.read-more {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
}

/* 文章页面样式 */
.post {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.post-header {
    text-align: center;
    margin-bottom: 3rem;
}

.post-title {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 1rem;
}

.post-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    color: #666;
    font-size: 0.9rem;
}

.post-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.post-tag {
    background: #e9ecef;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.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: 2rem 0 1rem 0;
    color: #333;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content code {
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', monospace;
}

.post-content pre {
    background: #2d2d2d;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: #f8f8f2;
}

.post-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: #666;
    font-style: italic;
}

/* 文章导航 */
.post-navigation {
    display: flex;
    justify-content: space-between;
    margin: 3rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.nav-prev,
.nav-next {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
}

/* 分享按钮 */
.post-share {
    text-align: center;
    margin: 2rem 0;
}

.post-share a {
    display: inline-block;
    margin: 0 0.5rem;
    padding: 0.5rem 1rem;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.post-share a:hover {
    background: #5a67d8;
}

/* 统计信息 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.stat-item {
    text-align: center;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.stat-item h3 {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 0.5rem;
}

/* 首页左右布局 */
.home-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    margin: 2rem 0;
}

/* 左侧内容区域 */
.content-left {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* 右侧分类导航 */
.sidebar-right {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

/* 分类网格布局 */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

/* 页脚样式 */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content p {
    margin: 0.5rem 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 0 1rem;
    }
    
    .post {
        padding: 2rem 1rem;
    }
    
    .post-title {
        font-size: 2rem;
    }
    
    .post-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    /* 移动端布局调整为单列 */
    .home-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    
    .category-card,
    .post-preview,
    .post,
    .stat-item {
        background: #2d2d2d;
        color: #e0e0e0;
    }
    
    .post-preview-title a {
        color: #e0e0e0;
    }
    
    .post-title {
        color: #e0e0e0;
    }
}