:root {
  --bg: #0f1117;
  --surface: #1a1d2e;
  --border: #2d3148;
  --text: #e2e4f0;
  --muted: #8b90b0;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --link: #818cf8;
  --warn: #f59e0b;
  --max-w: 860px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.7; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 1.5rem; }
.site-header-inner { max-width: var(--max-w); margin: 0 auto; display: flex; align-items: center; gap: 1rem; height: 56px; }
.site-logo { font-size: 1.1rem; font-weight: 700; color: var(--text); text-decoration: none; }
.site-logo span { color: var(--accent); }
.site-nav { margin-left: auto; display: flex; gap: 1.25rem; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: 0.9rem; transition: color 0.15s; }
.site-nav a:hover { color: var(--text); }

/* Breadcrumbs */
.breadcrumb { max-width: var(--max-w); margin: 1rem auto; padding: 0 1.5rem; font-size: 0.85rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent-hover); }
.breadcrumb span { margin: 0 0.35rem; }

/* Article */
.article-wrap { max-width: var(--max-w); margin: 0 auto; padding: 1.5rem 1.5rem 4rem; }
.article-header { margin-bottom: 1.75rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.article-category { font-size: 0.8rem; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
h1.article-title { font-size: 2rem; font-weight: 800; line-height: 1.25; color: #fff; }
.article-meta { margin-top: 0.75rem; font-size: 0.85rem; color: var(--muted); }
.article-body h2 { font-size: 1.45rem; font-weight: 700; margin: 2rem 0 0.75rem; color: #fff; scroll-margin-top: 72px; }
.article-body h3 { font-size: 1.15rem; font-weight: 700; margin: 1.5rem 0 0.5rem; color: var(--text); }
.article-body h4 { font-size: 1rem; font-weight: 700; margin: 1.25rem 0 0.4rem; color: var(--text); }
.article-body p { margin: 0.9rem 0; }
.article-body ul, .article-body ol { padding-left: 1.5rem; margin: 0.75rem 0; }
.article-body li { margin: 0.3rem 0; }
.article-body a { color: var(--link); text-decoration: none; border-bottom: 1px solid transparent; }
.article-body a:hover { border-bottom-color: var(--accent-hover); }
.article-body strong { color: #fff; font-weight: 700; }
.article-body em { color: var(--warn); font-style: normal; }
.article-body blockquote { border-left: 3px solid var(--accent); padding: 0.75rem 1rem; background: var(--surface); border-radius: 0 6px 6px 0; margin: 1rem 0; color: var(--muted); }
.article-body hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.article-body code { font-family: var(--mono); font-size: 0.88em; background: var(--surface); border: 1px solid var(--border); padding: 0.1em 0.4em; border-radius: 4px; }
.article-body pre { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; overflow-x: auto; margin: 1rem 0; }
.article-body pre code { background: none; border: none; padding: 0; font-size: 0.85em; }
.table-wrap { overflow-x: auto; margin: 1rem 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { border: 1px solid var(--border); padding: 0.5rem 0.75rem; text-align: left; }
th { background: var(--surface); font-weight: 700; color: var(--accent); }
tr:nth-child(even) { background: rgba(255,255,255,0.02); }

/* Ad slot */
.ad-slot { background: var(--surface); border: 1px dashed var(--border); border-radius: 8px; padding: 2rem; text-align: center; color: var(--muted); font-size: 0.8rem; margin: 1.5rem 0; }

/* Index page */
.index-wrap { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.5rem 4rem; }
.index-hero { text-align: center; padding: 3rem 0 2rem; }
.index-hero h1 { font-size: 2.25rem; font-weight: 800; color: #fff; margin-bottom: 0.5rem; }
.index-hero p { color: var(--muted); font-size: 1.05rem; }
.search-bar { margin: 1.5rem auto 0; max-width: 480px; }
.search-bar input { width: 100%; padding: 0.75rem 1rem; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 1rem; outline: none; }
.search-bar input:focus { border-color: var(--accent); }
.category-section { margin-top: 2.5rem; }
.category-section h2 { font-size: 1rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.article-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.1rem; text-decoration: none; color: var(--text); transition: border-color 0.15s, transform 0.1s; }
.article-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.article-card-title { font-size: 0.95rem; font-weight: 600; line-height: 1.4; color: #fff; }
.article-card-desc { font-size: 0.8rem; color: var(--muted); margin-top: 0.35rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 2rem 1.5rem; text-align: center; color: var(--muted); font-size: 0.85rem; }
.site-footer a { color: var(--accent); text-decoration: none; }

/* Responsive */
@media (max-width: 600px) {
  h1.article-title { font-size: 1.5rem; }
  .index-hero h1 { font-size: 1.6rem; }
  .article-grid { grid-template-columns: 1fr; }
}

/* Search highlight */
.article-card.hidden { display: none; }