:root {
    --primary-color: #0ea5e9;
    --primary-light: #f0f9ff;
    --primary-dark: #0284c7;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-heading: #1a1a1a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --footer-bg: #0f172a;
    --code-bg: #f1f5f9;
    --table-header-bg: #1e293b;
    --table-stripe: #f8fafc;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background-color: var(--bg-color); color: var(--text-main); line-height: 1.75; font-size: 16px; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary-color); }

body.admin-bar .navbar { top: 32px; }
@media (max-width: 782px) { body.admin-bar .navbar { top: 46px; } }

.navbar { background: #ffffff; border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 100; }
.nav-container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; height: 3.8rem; display: flex; align-items: center; justify-content: space-between; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text-main); }
.nav-links { display: flex; gap: 0.5rem; list-style: none; font-size: 0.9rem; font-weight: 500; color: var(--text-muted); }
.nav-links a { padding: 0.4rem 0.75rem; border-radius: 6px; transition: all 0.2s; }
.nav-links a:hover { color: var(--primary-color); background: #eff6ff; }

.main-container { max-width: 1100px; margin: 2rem auto; padding: 0 1rem; display: grid; grid-template-columns: 1fr 300px; gap: 2rem; }

.post-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; padding: 1.25rem; margin-bottom: 1rem; transition: border-color 0.2s, box-shadow 0.2s; }
.post-card:hover { border-color: var(--primary-color); box-shadow: 0 2px 8px rgba(14,165,233,0.08); }
.post-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.4rem; display: flex; gap: 1rem; }
.post-title { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.5rem; line-height: 1.4; }
.post-excerpt { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.75rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.75rem; color: var(--primary-color); }
.post-tags span { background: var(--primary-light); padding: 0.15rem 0.5rem; border-radius: 4px; margin-right: 0.2rem; }
.post-tags .tags-label { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.post-tags a { font-size: 0.8rem; padding: 0.2rem 0.6rem; background: var(--primary-light); color: var(--primary-color); border-radius: 4px; transition: background 0.2s, color 0.2s; text-decoration: none; }
.post-tags a:hover { background: var(--primary-color); color: #ffffff; }

.pagination { display: flex; gap: 0.5rem; margin-top: 1.5rem; font-size: 0.85rem; }
.pagination a, .pagination span { padding: 0.4rem 0.8rem; background: #fff; border: 1px solid var(--border-color); border-radius: 4px; transition: all 0.2s; }
.pagination a:hover { color: var(--primary-color); border-color: var(--primary-color); background: var(--primary-light); }
.pagination .current { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }

.sidebar-widget { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; padding: 1.25rem; margin-bottom: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.1); }
.widget-list { list-style: none; font-size: 0.875rem; }
.widget-list li { margin-bottom: 0.6rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.widget-list a { transition: color 0.2s; }
.widget-list a:hover { color: var(--primary-color); }

.toc-list { font-size: 0.85rem; }
.toc-list ul { list-style: none; font-size: 0.85rem; line-height: 2; }
.toc-list li { margin-bottom: 0.15rem; }
.toc-list a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; display: block; padding: 0.15rem 0.5rem; border-radius: 4px; }
.toc-list a:hover { color: var(--primary-color); background: var(--primary-light); }

.footer { background: var(--footer-bg); color: #94a3b8; padding: 2.5rem 1rem 1.5rem; font-size: 0.85rem; margin-top: 3rem; }
.footer-container { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-links { display: flex; gap: 1.25rem; }
.footer-bottom { max-width: 1100px; margin: 1.5rem auto 0; padding-top: 1rem; border-top: 1px solid #1e293b; text-align: center; color: #64748b; font-size: 0.75rem; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }
.section { padding: 2rem 0; }
.text-hero-sm { font-size: 2rem; font-weight: 700; line-height: 1.3; margin-bottom: 1rem; }
.text-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }

.text-body { font-size: 1rem; line-height: 1.8; color: var(--text-main); }
.text-body p { margin-bottom: 1.25em; }
.text-body h1, .text-body h2, .text-body h3, .text-body h4 { color: var(--text-heading); font-weight: 600; margin-top: 1.8em; margin-bottom: 0.8em; }
.text-body h2 { font-size: 1.5rem; padding-bottom: 0.4em; border-bottom: 1px solid var(--border-color); }
.text-body h3 { font-size: 1.25rem; }
.text-body h4 { font-size: 1.1rem; }
.text-body img { max-width: 100%; height: auto; border-radius: 6px; }
.text-body ul, .text-body ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.text-body li { margin-bottom: 0.5rem; }
.text-body strong { color: var(--text-heading); font-weight: 600; }
.text-body a { color: var(--primary-color); text-decoration: underline; text-decoration-color: rgba(14,165,233,0.3); text-underline-offset: 2px; transition: text-decoration-color 0.2s; }
.text-body a:hover { text-decoration-color: var(--primary-color); }
.text-body code { background: var(--code-bg); padding: 0.15em 0.4em; border-radius: 4px; font-size: 0.875em; font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; color: #e11d48; }
.text-body pre { background: var(--table-header-bg); color: #e2e8f0; padding: 1rem 1.25rem; border-radius: 8px; overflow-x: auto; margin-bottom: 1.25rem; line-height: 1.6; }
.text-body pre code { background: none; color: inherit; padding: 0; font-size: 0.875em; }
.text-body blockquote { border-left: 3px solid var(--primary-color); padding: 0.75rem 1rem; margin: 1.25rem 0; background: var(--primary-light); border-radius: 0 6px 6px 0; color: var(--text-muted); font-style: italic; }

.table-wrapper { width: 100%; overflow-x: auto; margin-bottom: 1.25rem; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.08); }
.text-body table { width: 100%; border-collapse: collapse; border-radius: 8px; overflow: hidden; }
.text-body th, .text-body td { padding: 0.7rem 1rem; border: 1px solid var(--border-color); text-align: left; font-size: 0.9rem; }
.text-body thead th { background: var(--table-header-bg); color: #ffffff; font-weight: 600; font-size: 0.85rem; letter-spacing: 0.02em; border-color: #334155; }
.text-body tbody tr:nth-child(odd) { background: var(--table-stripe); }
.text-body tbody tr:nth-child(even) { background: var(--card-bg); }
.text-body tbody tr { transition: background 0.15s; }
.text-body tbody tr:hover { background: var(--primary-light); }
.text-body tbody tr:hover td { color: var(--text-heading); }
.text-body td:first-child { font-weight: 500; }
.card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; padding: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.1); }

::selection { background: var(--primary-color); color: #ffffff; }
a:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; border-radius: 2px; }

.faq-section .faq-item { background-color: #f9fafb; border-left: 4px solid var(--primary-color); padding: 1rem 1.25rem; margin-bottom: 1rem; border-radius: 0 6px 6px 0; }
.faq-item h3 { margin: 0 0 0.5em 0; font-size: 1.1rem; color: var(--text-heading); }

.single-post-main { padding-top: 1rem; grid-template-columns: 1fr; max-width: 1300px; }
.single-post-grid { display: grid; grid-template-columns: 7fr 3fr; gap: 2rem; }
.single-post-grid { max-width: 800px; margin: 0 auto; }

.post-content { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; padding: 2.5rem; box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.1); }
.post-featured-image { margin-bottom: 1.5rem; border-radius: 8px; overflow: hidden; }
.post-featured-image img { width: 100%; height: auto; display: block; object-fit: cover; max-height: 420px; }
.post-content .post-meta { margin-bottom: 0.75rem; }
.post-content .post-title { font-size: 2rem; font-weight: 700; line-height: 1.3; margin-bottom: 1.25rem; color: var(--text-heading); }
.post-body { margin-bottom: 2rem; }

.post-share { display: flex; align-items: center; gap: 0.5rem; padding-top: 1rem; border-top: 1px solid var(--border-color); }
.post-share .share-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.post-share a { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--bg-color); color: var(--text-muted); transition: all 0.2s; }
.post-share a:hover { background: var(--primary-color); color: #fff; }

.related-posts-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.related-item { display: flex; gap: 0.75rem; padding: 0.5rem; border-radius: 6px; transition: background 0.2s; }
.related-item:hover { background: var(--bg-color); }
.related-thumb { flex-shrink: 0; width: 80px; height: 60px; border-radius: 4px; overflow: hidden; }
.related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.related-info { display: flex; flex-direction: column; justify-content: center; gap: 0.25rem; min-width: 0; }
.related-title { font-size: 0.85rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.related-date { font-size: 0.75rem; color: var(--text-muted); }

@media (max-width: 768px) {
    .main-container { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .text-hero-sm { font-size: 1.5rem; }
    .post-content { padding: 1.25rem; }
    .table-wrapper { margin-left: -1.25rem; margin-right: -1.25rem; border-radius: 0; }
    .text-body th, .text-body td { padding: 0.5rem 0.7rem; font-size: 0.82rem; white-space: nowrap; }
}
