/* 基础样式 */
:root {
    --primary-color: #4a90d9;
    --secondary-color: #f5a623;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

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

/* Header */
.site-header {
    background: linear-gradient(135deg, var(--primary-color), #667eea);
    color: white;
    padding: 40px 0;
    text-align: center;
}

.site-title a {
    color: white;
    text-decoration: none;
    font-size: 2.5rem;
}

.site-tagline {
    margin-top: 10px;
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Navigation */
.main-nav {
    background: #333;
    padding: 0;
}

.main-nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    flex-wrap: wrap;
}

.main-nav li {
    margin: 0;
}

.main-nav a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 15px 20px;
    transition: background 0.3s;
}

.main-nav a:hover {
    background: var(--primary-color);
}

/* Main Content */
.site-main {
    min-height: 500px;
    padding: 40px 0;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 40px 20px;
    background: var(--light-bg);
    border-radius: 10px;
    margin-bottom: 40px;
}

.hero-section h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.hero-section p {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* Category Grid */
.featured-categories {
    margin-bottom: 50px;
}

.featured-categories h3 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.5rem;
}

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

.category-card {
    display: block;
    background: var(--light-bg);
    padding: 30px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-color);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.category-card h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.category-card p {
    color: #666;
    font-size: 0.95rem;
}

/* Post List */
.latest-posts h3 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.5rem;
}

.post-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.post-card {
    background: var(--light-bg);
    padding: 25px;
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: flex-start;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.post-icon {
    font-size: 2rem;
    margin-right: 15px;
    flex-shrink: 0;
}

.post-content {
    flex: 1;
    min-width: 0;
}

.post-content h4 {
    margin-bottom: 8px;
}

.post-content h4 a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.1rem;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-content h4 a:hover {
    color: var(--primary-color);
}

.post-meta {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.post-excerpt {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

.read-more {
    display: inline-block;
    margin-top: 10px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.read-more:hover {
    text-decoration: underline;
}

/* Article Page */
.article-page {
    max-width: 800px;
    margin: 0 auto;
}

.article-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--light-bg);
}

.category-tag {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.article-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    line-height: 1.3;
}

.article-content {
    font-size: 1.05rem;
    line-height: 1.8;
}

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

.article-content h2 {
    font-size: 1.5rem;
    margin: 30px 0 15px 0;
    color: var(--primary-color);
}

.article-content h3 {
    font-size: 1.2rem;
    margin: 25px 0 10px 0;
}

.article-content ul, .article-content ol {
    margin-bottom: 20px;
    padding-left: 25px;
}

.article-content li {
    margin-bottom: 8px;
}

/* Tool CTA */
.tool-cta {
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    padding: 25px;
    border-radius: 10px;
    margin: 30px 0;
    border-left: 4px solid var(--primary-color);
}

.tool-cta h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.cta-button {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    margin-top: 15px;
    transition: background 0.3s;
}

.cta-button:hover {
    background: #357abd;
}

/* Article Navigation */
.article-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.nav-prev, .nav-next {
    color: var(--primary-color);
    text-decoration: none;
    max-width: 45%;
}

.nav-prev:hover, .nav-next:hover {
    text-decoration: underline;
}

/* Pagination */
.page-info {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.page-link, .page-num {
    display: inline-block;
    padding: 8px 14px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9rem;
}

.page-link:hover, .page-num:hover {
    background: #357abd;
}

.page-num.active {
    background: #333;
}

.page-link.disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Footer */
.site-footer {
    background: #333;
    color: white;
    padding: 30px 0;
    text-align: center;
}

.site-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .site-title a {
        font-size: 1.8rem;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
    }
    
    .main-nav a {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .post-list {
        grid-template-columns: 1fr;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .article-header h1 {
        font-size: 1.5rem;
    }
    
    .article-nav {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-prev, .nav-next {
        max-width: 100%;
    }
}
