:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #1c2129;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent: #58a6ff;
    --accent-hover: #79b8ff;
    --accent-subtle: #1f6feb22;
    --green: #3fb950;
    --border: #30363d;
    --border-light: #21262d;
    --max-width: 860px;
    --radius: 6px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* Header */
header {
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 0;
    background: var(--bg-secondary);
}
.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}
.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
.site-title:hover { color: var(--accent); }
.site-tagline {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Main */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
    flex: 1;
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: auto;
}

/* Index Header */
.index-header { margin-bottom: 2rem; }
.index-header h1 { font-size: 1.5rem; margin-bottom: 1rem; font-weight: 600; }
.back-link { font-size: 0.9rem; }

/* Filter Bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filter-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s;
}
.filter-btn:hover, .filter-btn.active {
    background: var(--accent-subtle);
    border-color: var(--accent);
    color: var(--accent);
}

/* Post List */
.post-list { display: flex; flex-direction: column; gap: 1.25rem; }

.post-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.15s;
}
.post-card:hover { border-color: var(--text-muted); }

.post-card-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.post-card-body { padding: 1.25rem; }

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.post-card-body h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.5rem; }
.post-card-body h2 a { color: var(--text-primary); }
.post-card-body h2 a:hover { color: var(--accent); }

.post-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Badges */
.category-badge, .tag-badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius);
    font-weight: 500;
}
.category-badge {
    background: var(--accent-subtle);
    color: var(--accent);
}
.tag-badge {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    margin-right: 0.25rem;
    margin-top: 0.25rem;
}
.tag-badge:hover { color: var(--accent); border-color: var(--accent); }

.post-tags { margin-top: 0.75rem; }

/* Single Post */
.post-single { margin-bottom: 2rem; }
.post-header { margin-bottom: 1.5rem; }
.post-header h1 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-top: 0.5rem;
}

.post-featured-image {
    margin-bottom: 2rem;
    border-radius: var(--radius);
    overflow: hidden;
}
.post-featured-image img { width: 100%; display: block; }

/* Post Content */
.post-content { font-size: 1rem; line-height: 1.8; }
.post-content p { margin-bottom: 1.25rem; }
.post-content h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border);
}
.post-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
}
.post-content ul, .post-content ol {
    margin: 0 0 1.25rem 1.5rem;
}
.post-content li { margin-bottom: 0.35rem; }
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin: 1rem 0;
}
.post-content figure {
    margin: 1.5rem 0;
}
.post-content figcaption {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    margin-top: 0.5rem;
}
.post-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.5rem 1rem;
    margin: 1.25rem 0;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: 0 var(--radius) var(--radius) 0;
}
.post-content pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-x: auto;
    margin: 1.25rem 0;
    font-size: 0.85rem;
    line-height: 1.5;
}
.post-content code {
    font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.85em;
}
.post-content p code, .post-content li code {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    font-size: 0.9rem;
}
.post-content th, .post-content td {
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    text-align: left;
}
.post-content th {
    background: var(--bg-secondary);
    font-weight: 600;
}
.post-content a { text-decoration: underline; text-underline-offset: 2px; }
.post-content a:hover { text-decoration-color: var(--accent-hover); }

/* Post Navigation */
.post-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.post-nav-link { font-size: 0.9rem; }
.post-nav-home { font-weight: 600; }

/* Responsive */
@media (max-width: 768px) {
    .post-header h1 { font-size: 1.5rem; }
    .post-card-image img { height: 160px; }
    main { padding: 1.5rem 1rem; }
}

@media (max-width: 480px) {
    .post-header h1 { font-size: 1.3rem; }
    .filter-bar { gap: 0.35rem; }
    .filter-btn { font-size: 0.7rem; padding: 0.25rem 0.5rem; }
}
