
:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent: #58a6ff;
    --accent-hover: #79b8ff;
    --border: #30363d;
    --code-bg: #161b22;
    --shadow: rgba(0, 0, 0, 0.3);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

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

/* Header */
header {
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 0;
    margin-bottom: 2rem;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo:hover {
    color: var(--accent);
    text-decoration: none;
}

nav {
    display: flex;
    gap: 1.5rem;
}

nav a {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

nav a:hover {
    color: var(--text-primary);
    text-decoration: none;
}

/* Main Content */
main {
    padding: 1rem 0 4rem;
}

/* Post List */
.post-list {
    list-style: none;
}

.post-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

.post-item:last-child {
    border-bottom: none;
}

.post-date {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-family: 'SF Mono', Monaco, monospace;
    margin-bottom: 0.5rem;
}

.post-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.post-title a {
    color: var(--text-primary);
}

.post-title a:hover {
    color: var(--accent);
}

.post-excerpt {
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.tag {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Single Post */
.post-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.post-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.post-header .post-date {
    margin-bottom: 0;
}

.post-content {
    font-size: 1.05rem;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
    margin: 2rem 0 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.post-content h2 {
    font-size: 1.5rem;
}

.post-content h3 {
    font-size: 1.25rem;
}

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

.post-content ul,
.post-content ol {
    margin: 1rem 0 1.5rem 1.5rem;
}

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

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

.post-content pre {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.post-content code {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    background: var(--bg-tertiary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

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

.post-content blockquote {
    border-left: 4px solid var(--accent);
    margin: 1.5rem 0;
    padding: 0.5rem 0 0.5rem 1.5rem;
    color: var(--text-secondary);
    font-style: italic;
}

.post-content a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-content figure {
    margin: 1.5rem 0;
    text-align: center;
}

.post-content figure img {
    margin: 0;
}

/* Comments */
.comments-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.comments-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.comment {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
}

.comment-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.comment-content {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.comment-content p {
    margin-bottom: 0.5rem;
}

.comment-content p:last-child {
    margin-bottom: 0;
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 2rem;
}

footer .container {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

footer a {
    color: var(--text-secondary);
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.back-link:hover {
    color: var(--accent);
    text-decoration: none;
}

/* Responsive */
@media (max-width: 640px) {
    header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .post-header h1 {
        font-size: 1.5rem;
    }
    
    .post-content {
        font-size: 1rem;
    }
}
