/**
 * 首页增强样式
 */

/* ==================== Hero 区域 ==================== */
.home-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 20px;
    text-align: center;
    margin-bottom: 40px;
    border-radius: 0 0 40px 40px;
}

.home-hero h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
    color: white;
}

.home-hero p {
    font-size: 20px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 30px;
}

.home-hero .search-form {
    max-width: 600px;
    margin: 0 auto;
}

.home-hero .search-form input[type="search"] {
    width: calc(100% - 120px);
    padding: 15px 20px;
    font-size: 16px;
    border: none;
    border-radius: 50px 0 0 50px;
    outline: none;
}

.home-hero .search-form button {
    width: 120px;
    padding: 15px 20px;
    font-size: 16px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 0 50px 50px 0;
    cursor: pointer;
    font-weight: 600;
}

.home-hero .search-form button:hover {
    background: #059669;
}

/* ==================== 分类导航 ==================== */
.category-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 40px 20px;
    background: #f9fafb;
}

.category-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: white;
    border-radius: 12px;
    text-decoration: none;
    color: #1f2937;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.category-nav a:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    color: #2563eb;
}

.category-nav .icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
    font-size: 16px;
}

/* ==================== 文章网格 ==================== */
.posts-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

/* ==================== 文章卡片 ==================== */
.post-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.post-card .post-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

.post-card .post-category {
    display: inline-block;
    padding: 5px 12px;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 15px;
}

.post-card .post-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
    line-height: 1.4;
}

.post-card .post-title a {
    text-decoration: none;
    color: inherit;
}

.post-card .post-title a:hover {
    color: #2563eb;
}

.post-card .post-excerpt {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 15px;
}

.post-card .post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
    font-size: 13px;
    color: #9ca3af;
}

.post-card .post-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-card .author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e5e7eb;
}

/* ==================== 侧边栏 ==================== */
.sidebar {
    padding: 30px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.sidebar .widget {
    margin-bottom: 35px;
}

.sidebar .widget:last-child {
    margin-bottom: 0;
}

.sidebar .widget-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #2563eb;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li {
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.sidebar li:last-child {
    border-bottom: none;
}

.sidebar a {
    color: #4b5563;
    text-decoration: none;
    transition: color 0.2s;
}

.sidebar a:hover {
    color: #2563eb;
}

/* ==================== 统计数据 ==================== */
.stats-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px 20px;
    color: white;
}

.stats-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    text-align: center;
}

.stat-item .stat-number {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 10px;
}

.stat-item .stat-label {
    font-size: 16px;
    opacity: 0.9;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .home-hero {
        padding: 50px 15px;
    }
    
    .home-hero h1 {
        font-size: 32px;
    }
    
    .home-hero p {
        font-size: 16px;
    }
    
    .category-nav {
        padding: 30px 15px;
    }
    
    .category-nav a {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .posts-container {
        padding: 20px 15px;
    }
    
    .stats-section {
        padding: 40px 15px;
    }
    
    .stat-item .stat-number {
        font-size: 36px;
    }
}

/* ==================== 加载动画 ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card {
    animation: fadeInUp 0.5s ease;
}

.post-card:nth-child(1) { animation-delay: 0.1s; }
.post-card:nth-child(2) { animation-delay: 0.2s; }
.post-card:nth-child(3) { animation-delay: 0.3s; }
.post-card:nth-child(4) { animation-delay: 0.4s; }
.post-card:nth-child(5) { animation-delay: 0.5s; }
.post-card:nth-child(6) { animation-delay: 0.6s; }
