:root {
    --mp-bg: #f7f7f8;
    --mp-fg: #1d2327;
    --mp-muted: #646970;
    --mp-accent: #2271b1;
    --mp-accent-dark: #135e96;
    --mp-border: #dcdcde;
    --mp-card: #ffffff;
    --mp-max-width: 900px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --mp-bg: #14161a;
        --mp-fg: #e3e3e3;
        --mp-muted: #9a9ea3;
        --mp-accent: #4f9cf0;
        --mp-accent-dark: #7db8f5;
        --mp-border: #2c2f34;
        --mp-card: #1c1f24;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--mp-bg);
    color: var(--mp-fg);
    line-height: 1.65;
}

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

.mp-wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: minmax(0, var(--mp-max-width)) 280px;
    gap: 40px;
}

@media (max-width: 860px) {
    .mp-wrap { grid-template-columns: 1fr; }
}

.site-header {
    background: var(--mp-card);
    border-bottom: 1px solid var(--mp-border);
    padding: 24px 0;
    margin-bottom: 32px;
}

.site-header .mp-wrap { display: block; }
.site-title { font-size: 28px; font-weight: 700; margin: 0; }
.site-title a { color: var(--mp-fg); }
.site-tagline { color: var(--mp-muted); margin: 4px 0 16px; }

.nav-menu { list-style: none; display: flex; gap: 20px; padding: 0; margin: 0; flex-wrap: wrap; }
.nav-menu li a { font-weight: 600; }

main.content { min-width: 0; }

article.post-card {
    background: var(--mp-card);
    border: 1px solid var(--mp-border);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
}

article.post-card h2 { margin-top: 0; }
.post-meta { color: var(--mp-muted); font-size: 14px; margin-bottom: 12px; }
.post-meta a { color: var(--mp-muted); }

.post-content img { max-width: 100%; height: auto; border-radius: 6px; }
.post-content { font-size: 17px; }

.pagination { display: flex; gap: 12px; margin: 24px 0; }
.pagination a, .pagination span { padding: 8px 14px; border: 1px solid var(--mp-border); border-radius: 6px; }

.sidebar .widget {
    background: var(--mp-card);
    border: 1px solid var(--mp-border);
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 20px;
}
.widget-title { margin: 0 0 10px; font-size: 16px; text-transform: uppercase; letter-spacing: .04em; color: var(--mp-muted); }
.widget-list { list-style: none; margin: 0; padding: 0; }
.widget-list li { padding: 6px 0; border-bottom: 1px dashed var(--mp-border); }
.widget-list li:last-child { border-bottom: none; }
.widget-search input { width: 65%; padding: 8px; border: 1px solid var(--mp-border); border-radius: 6px; background: var(--mp-bg); color: var(--mp-fg); }
.widget-search button { padding: 8px 12px; border-radius: 6px; border: 1px solid var(--mp-accent); background: var(--mp-accent); color: #fff; cursor: pointer; }

.site-footer {
    border-top: 1px solid var(--mp-border);
    margin-top: 48px;
    padding: 24px 0 48px;
    color: var(--mp-muted);
    font-size: 14px;
}
.footer-widgets { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 20px; }
.footer-widgets .widget { flex: 1; min-width: 200px; }

.comments { margin-top: 40px; }
.comment-list { list-style: none; padding: 0; }
.comment { border: 1px solid var(--mp-border); border-radius: 8px; padding: 16px; margin-bottom: 14px; background: var(--mp-card); }
.comment-meta { font-size: 13px; color: var(--mp-muted); margin-bottom: 6px; }
.comment-form label { display: block; margin-bottom: 12px; font-weight: 600; }
.comment-form input[type=text], .comment-form input[type=email], .comment-form textarea {
    width: 100%; padding: 10px; border: 1px solid var(--mp-border); border-radius: 6px;
    background: var(--mp-bg); color: var(--mp-fg); font: inherit; margin-top: 4px;
}
.comment-form textarea { min-height: 120px; }
.btn {
    display: inline-block; padding: 10px 18px; border-radius: 6px; border: 1px solid var(--mp-accent);
    background: var(--mp-accent); color: #fff; cursor: pointer; font: inherit;
}
.btn:hover { background: var(--mp-accent-dark); text-decoration: none; }
.notice { padding: 12px 16px; border-radius: 6px; margin-bottom: 20px; }
.notice-success { background: #d4edda; color: #155724; }
.notice-info { background: #d1ecf1; color: #0c5460; }
