/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

/* Container layout */
.container {
    max-width: 900px;
    margin: 0 auto;
    background-color: #fff;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* Header */
header {
    background-color: #fff;
    border-bottom: 1px solid #e1e4e8;
    padding: 2rem;
    text-align: center;
}

.site-title {
    font-size: 2.5rem;
    font-weight: 300;
    color: #2c3e50;
    text-decoration: none;
    margin-bottom: 0.5rem;
    display: block;
}

.site-title:hover {
    color: #34495e;
    text-decoration: none;
}

.site-description {
    color: #666;
    font-size: 1.1rem;
    font-weight: 300;
}

/* Main content */
main {
    padding: 3rem;
    padding-bottom: 0;
    min-height: 60vh;
}

.page-title {
    font-size: 2.2rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e1e4e8;
    padding-bottom: 0.5rem;
    font-weight: 300;
}

/* Content styling */
.content {
    font-size: 1.1rem;
    line-height: 1.8;
    max-width: none;
}

.content h1, .content h2, .content h3, .content h4, .content h5, .content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
    font-weight: 400;
}

.content h1 { 
    font-size: 2rem; 
    color: #2c3e50;
    border-bottom: 1px solid #e1e4e8;
    padding-bottom: 0.5rem;
    font-weight: 300;
}

.content h2 { 
    font-size: 1.6rem; 
    color: #34495e;
}

.content h3 { 
    font-size: 1.4rem; 
}

.content h4 { 
    font-size: 1.2rem; 
}

.content p {
    margin-bottom: 1.2rem;
}

.content ul, .content ol {
    margin-bottom: 1.2rem;
    padding-left: 2rem;
}

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

.content a {
    color: #0366d6;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.content a:hover {
    border-bottom-color: #0366d6;
}

/* Code styling */
.content code {
    background-color: #f6f8fa;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Consolas', monospace;
    font-size: 0.9rem;
    color: #d73a49;
}

.content pre {
    background-color: #f6f8fa;
    padding: 1.5rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid #e1e4e8;
}

.content pre code {
    background: none;
    padding: 0;
    color: #333;
}

/* Blockquotes */
.content blockquote {
    border-left: 3px solid #dfe2e5;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background-color: #f6f8fa;
    color: #666;
    font-style: italic;
}

/* Tables */
.content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.5rem 0;
    background-color: white;
    border: 1px solid #e1e4e8;
}

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

.content th {
    background-color: #f6f8fa;
    font-weight: 600;
    color: #24292e;
}

.content tr:nth-child(even) {
    background-color: #f6f8fa;
}

/* Details/Summary (collapsible sections) */
details {
    margin: 1.5rem 0;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    overflow: hidden;
}

summary {
    padding: 1rem 1.5rem;
    background-color: #f6f8fa;
    color: #24292e;
    cursor: pointer;
    font-weight: 600;
    user-select: none;
    transition: background-color 0.3s ease;
    border-bottom: 1px solid #e1e4e8;
}

summary:hover {
    background-color: #f1f3f4;
}

details[open] summary {
    border-bottom: 1px solid #e1e4e8;
}

details .content,
details > *:not(summary) {
    padding: 1.5rem;
    background-color: white;
}

/* Footer */
footer {
    background-color: #f6f8fa;
    border-top: 1px solid #e1e4e8;
    color: #666;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

footer p {
    margin-bottom: 0.5rem;
}

footer p:last-child {
    margin-bottom: 0;
}

footer a {
    color: #0366d6;
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover {
    color: #2c3e50;
    text-decoration: underline;
}

/* Tags section */
.tags-section {
    margin: 1rem 0 2rem 0;
}

.tag {
    display: inline-block;
    color: #666;
    font-size: 0.9rem;
    text-decoration: none;
    margin: 0.25rem 0.5rem 0.25rem 0;
    transition: color 0.2s ease;
}

.tag:before {
    content: "#";
}

.tag:hover {
    color: #0366d6;
    text-decoration: underline;
}

/* Edit link */
.edit-link {
    margin: 2rem 0 1rem 0;
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #e1e4e8;
}

.edit-link a {
    display: inline-block;
    color: #666;
    font-size: 0.9rem;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    background-color: #f6f8fa;
    transition: all 0.2s ease;
}

.edit-link a:hover {
    color: #0366d6;
    border-color: #0366d6;
    background-color: #fff;
    text-decoration: none;
}

/* Math support */
.MathJax {
    outline: none;
}

/* Images */
.content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid #e1e4e8;
    margin: 1rem 0;
}

/* Featured sections on home page - simplified */
.featured-section {
    background-color: #f6f8fa;
    border: 1px solid #e1e4e8;
    padding: 2rem;
    border-radius: 6px;
    margin: 2rem 0;
}

.featured-section h2 {
    color: #2c3e50 !important;
    margin-top: 0;
    font-weight: 400;
}

.featured-section a {
    color: #0366d6 !important;
}

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

.category-card {
    background: white;
    padding: 2rem;
    border-radius: 6px;
    border: 1px solid #e1e4e8;
    transition: box-shadow 0.3s ease;
}

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

.category-card h3 {
    color: #2c3e50 !important;
    margin-top: 0;
    margin-bottom: 1rem;
    font-weight: 400;
}

/* Article list styling */
.article-list {
    list-style: none;
    padding: 0;
}

.article-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e1e4e8;
}

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

.article-list a {
    color: #0366d6;
    text-decoration: none;
    font-weight: 500;
}

.article-list a:hover {
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        margin: 0;
        box-shadow: none;
    }
    
    header {
        padding: 1.5rem;
    }
    
    .site-title {
        font-size: 2rem;
    }
    
    .site-description {
        font-size: 1rem;
    }
    
    main {
        padding: 2rem 1.5rem;
        padding-bottom: 0;
    }
    
    .page-title {
        font-size: 1.8rem;
    }
    
    .content {
        font-size: 1rem;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .category-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1rem;
    }
    
    main {
        padding: 1.5rem 1rem;
    }
    
    .content h1 {
        font-size: 1.6rem;
    }
    
    .content h2 {
        font-size: 1.4rem;
    }
}