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

:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #334155;
  --border: #475569;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --accent: #818cf8;
  --accent-hover: #6366f1;
  --success: #34d399;
  --error: #f87171;
  --warning: #fbbf24;
  --radius: 8px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;
  --max-width: 800px;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  text-decoration: underline;
}

.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
}

.logo-icon {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 1.2rem;
}

.logo-sub {
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 400;
}

.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-dim);
  font-size: 0.9rem;
  transition: color 0.15s;
}

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

.hero {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  color: var(--text);
  line-height: 1.3;
}

.hero p {
  color: var(--text-dim);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.content {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem;
  width: 100%;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.15s;
  display: block;
  text-decoration: none;
  color: inherit;
}

.article-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}

.article-card h2 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text);
  line-height: 1.4;
}

.article-card p {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.6;
}

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

.article-tag {
  background: var(--surface-2);
  padding: 0.15rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--accent);
}

.article-date {
  font-size: 0.8rem;
}

.article-header {
  margin-bottom: 2rem;
}

.article-header h1 {
  font-size: 1.75rem;
  line-height: 1.35;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.article-header .article-meta {
  margin-bottom: 0;
}

.article-body {
  font-size: 1rem;
  line-height: 1.8;
}

.article-body h2 {
  font-size: 1.35rem;
  margin: 2rem 0 0.75rem;
  color: var(--text);
}

.article-body h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--text);
}

.article-body p {
  margin: 0.75rem 0;
  color: var(--text);
}

.article-body ul, .article-body ol {
  padding-left: 1.5rem;
  margin: 0.75rem 0;
}

.article-body li {
  margin: 0.35rem 0;
}

.article-body code {
  background: var(--surface-2);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--accent);
}

.article-body pre {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1rem 0;
}

.article-body pre code {
  background: none;
  padding: 0;
}

.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--text-dim);
  font-style: italic;
}

.article-body strong {
  color: var(--text);
}

.cta-box {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
  text-align: center;
}

.cta-box h3 {
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.cta-box p {
  color: var(--text-dim);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.cta-btn {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s;
}

.cta-btn:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

.affiliate-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1.5rem 0;
}

.affiliate-box h4 {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.affiliate-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s;
}

.affiliate-link:last-child {
  margin-bottom: 0;
}

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

.affiliate-icon {
  font-size: 1.5rem;
}

.affiliate-info {
  flex: 1;
}

.affiliate-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.affiliate-desc {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.article-nav a {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.article-nav a:hover {
  color: var(--accent);
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--text-dim);
}

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

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
}

.toc h4 {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.toc ul {
  list-style: none;
  padding: 0;
}

.toc li {
  padding: 0.2rem 0;
}

.toc a {
  color: var(--text-dim);
  font-size: 0.9rem;
}

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

.footer {
  text-align: center;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.85rem;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    text-align: center;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .article-header h1 {
    font-size: 1.4rem;
  }

  .article-nav {
    flex-direction: column;
  }
}
