/* Reset & Base Styles */
* {
    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: #333;
    background-color: #fff;
}

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

/* Header */
.header {
    background: #fff;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

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

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

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

.nav-links a:hover {
    color: #333;
}

/* Main Content */
.main {
    min-height: calc(100vh - 120px);
    padding: 2rem 0;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 3rem;
}

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

.hero-description p {
    margin-bottom: 0.5rem;
    color: #777;
}

/* Section Titles */
.section-title, .page-title {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: #333;
    border-bottom: 2px solid #333;
    padding-bottom: 0.5rem;
}

.page-subtitle {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* Post Cards */
.posts-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 3rem;
}

.post-card {
    padding: 1.5rem;
    border: 1px solid #eee;
    border-radius: 8px;
    transition: box-shadow 0.3s;
}

.post-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.post-title {
    margin: 0;
}

.post-title a {
    color: #333;
    text-decoration: none;
    font-size: 1.2rem;
}

.post-title a:hover {
    color: #0066cc;
}

.post-date {
    color: #999;
    font-size: 0.9rem;
    margin: 0;
}

.post-summary {
    color: #666;
    line-height: 1.6;
    margin: 0.5rem 0 0 0;
}

/* More Posts Button */
.more-posts {
    text-align: center;
    margin-top: 3rem;
}

.btn-more {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: #333;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.btn-more:hover {
    background: #555;
}

/* Post Detail */
.post-detail {
    max-width: 100%;
}

.post-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.post-detail .post-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

.post-meta {
    color: #999;
    font-size: 0.9rem;
}

.post-meta .post-updated {
    margin-left: 1rem;
}

/* Markdown Content Styles */
.post-content {
    line-height: 1.8;
    margin-bottom: 3rem;
}

.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;
    font-weight: 600;
}

.post-content h1 { font-size: 1.8rem; }
.post-content h2 { font-size: 1.5rem; }
.post-content h3 { font-size: 1.3rem; }
.post-content h4 { font-size: 1.1rem; }
.post-content h5 { font-size: 1rem; }
.post-content h6 { font-size: 0.9rem; }

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

.post-content ul,
.post-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content a {
    color: #0066cc;
    text-decoration: none;
}

.post-content a:hover {
    text-decoration: underline;
}

.post-content img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    border-radius: 4px;
}

.post-content code {
    background: #f5f5f5;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
    font-size: 0.9em;
}

.post-content pre {
    background: #f5f5f5;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1rem 0;
    padding: 1rem;
}

.post-content pre code {
    background: none;
    padding: 0;
}

.post-content blockquote {
    border-left: 4px solid #ddd;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #666;
    font-style: italic;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.post-content th,
.post-content td {
    border: 1px solid #ddd;
    padding: 0.5rem;
    text-align: left;
}

.post-content th {
    background: #f5f5f5;
    font-weight: 600;
}

.post-content hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 2rem 0;
}

.post-footer {
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.back-to-blog {
    color: #0066cc;
    text-decoration: none;
}

.back-to-blog:hover {
    text-decoration: underline;
}

/* Pagination */
.pagination {
    margin-top: 3rem;
    text-align: center;
}

.pagination-info {
    margin-bottom: 1rem;
    color: #666;
    font-size: 0.9rem;
}

.pagination-links {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination-link, .pagination-current {
    padding: 0.5rem 0.8rem;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
}

.pagination-link:hover {
    background: #f5f5f5;
}

.pagination-current {
    background: #333;
    color: white;
    border-color: #333;
}

.pagination-ellipsis {
    padding: 0.5rem;
    color: #999;
}

/* No Posts */
.no-posts {
    text-align: center;
    padding: 3rem 0;
    color: #666;
}

/* Footer */
.footer {
    background: #f8f9fa;
    border-top: 1px solid #eee;
    padding: 2rem 0;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

.icp-info {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.icp-info a {
    color: #666;
    text-decoration: none;
}

.icp-info a:hover {
    color: #333;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .nav {
        gap: 1rem;
    }
    
    .logo {
        font-size: 1.4rem;
    }
    
    .nav-links {
        gap: 0.8rem;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1.3rem;
    }
    
    .section-title, .page-title {
        font-size: 1.6rem;
    }
    
    .post-title a {
        font-size: 1.3rem;
    }
    
    .post-detail .post-title {
        font-size: 1.8rem;
    }
    
    .btn-more {
        padding: 1rem 1.8rem;
    }
    
    .post-content pre {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
}

/* Works Section */
.works-section {
    max-width: 100%;
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.work-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.work-card {
    background: #fff;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    padding: 1.2rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

@media (hover: hover) {
    .work-card-link:hover .work-card {
        box-shadow: 0 8px 24px rgba(0,0,0,0.15);
        transform: translateY(-4px);
        border-color: #0066cc;
    }

    .work-card-link:hover .work-title {
        color: #0066cc;
    }

    .work-card-link:hover .work-description {
        color: #333;
    }
}

.work-header {
    margin-bottom: 1rem;
}

.work-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.work-title {
    color: #333;
    transition: color 0.3s ease;
}

.work-card-link:hover .work-title {
    color: #0066cc;
}

.work-description {
    color: #666;
    line-height: 1.6;
    margin: 0 0 1rem 0;
    flex-grow: 1;
    transition: color 0.3s ease;
}

.work-card-link:hover .work-description {
    color: #333;
}

.work-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.work-tag {
    background: #e8f4fd;
    color: #0066cc;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-size: 0.8rem;
    border: 1px solid #b3d9ff;
}

.work-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.work-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #333;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.work-link:hover {
    background: #555;
}

.no-works {
    text-align: center;
    padding: 3rem 0;
    color: #666;
}

/* Works Responsive */
@media (max-width: 768px) {
    .works-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .work-card {
        padding: 1rem;
    }
    
    .work-title {
        font-size: 1.3rem;
    }
    
    .work-tag {
        font-size: 0.75rem;
    }
}
