:root {
  --bg-color: #090a0f;
  --surface-color: #12151e;
  --surface-border: #1e2433;
  --surface-hover: #181d2a;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent-blue: #38bdf8;
  --accent-indigo: #818cf8;
  --accent-cyan: #22d3ee;
  --code-bg: #030712;
  --border-radius: 12px;
  --container-max: 960px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  background: rgba(9, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--surface-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.05rem;
}

.brand-badge {
  background: linear-gradient(135deg, #0070f3, #00dfd8);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.site-nav a:hover {
  color: #fff;
  background: var(--surface-hover);
}

.site-nav a.active {
  color: var(--accent-blue);
  background: rgba(56, 189, 248, 0.1);
  font-weight: 600;
}

/* Breadcrumbs */
.breadcrumbs-wrapper {
  background: var(--surface-color);
  border-bottom: 1px solid var(--surface-border);
  padding: 10px 0;
  font-size: 0.82rem;
}

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

.breadcrumbs span {
  color: var(--text-dim);
}

/* Main Content */
.main-content {
  padding: 48px 0 80px;
}

.article-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.article-header {
  margin-bottom: 40px;
  border-bottom: 1px solid var(--surface-border);
  padding-bottom: 32px;
}

.meta-tags {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.badge {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-blue);
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
}

.article-title {
  font-size: 2.3rem;
  line-height: 1.25;
  font-weight: 800;
  color: #fff;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.article-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.author-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.author-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-weight: 600;
  color: #fff;
  font-size: 0.95rem;
}

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

/* Article Body */
.article-body h2 {
  font-size: 1.55rem;
  color: #fff;
  margin: 40px 0 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  border-left: 3px solid var(--accent-blue);
  padding-left: 12px;
}

.article-body h3 {
  font-size: 1.25rem;
  color: #f1f5f9;
  margin: 28px 0 12px;
  font-weight: 600;
}

.article-body p {
  margin-bottom: 20px;
  color: var(--text-main);
  font-size: 1.05rem;
}

.article-body ul {
  margin: 0 0 24px 24px;
  color: var(--text-main);
}

.article-body li {
  margin-bottom: 10px;
}

.article-body strong {
  color: #fff;
  font-weight: 600;
}

.article-body code {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-cyan);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
}

/* Contextual Backlink */
.contextual-backlink {
  color: var(--accent-blue);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  transition: all 0.2s ease;
}

.contextual-backlink:hover {
  color: #fff;
  text-decoration-color: var(--accent-cyan);
}

/* Code Blocks */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  margin: 24px 0;
  overflow: hidden;
}

.code-header {
  background: #0d1117;
  padding: 8px 16px;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--surface-border);
}

.code-block pre {
  padding: 16px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #e2e8f0;
}

/* Tables */
.table-container {
  overflow-x: auto;
  margin: 28px 0;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

th {
  background: var(--surface-color);
  color: #fff;
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--surface-border);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--surface-border);
  color: var(--text-main);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--surface-hover);
}

/* Callout Box */
.callout, .callout-box {
  background: var(--surface-color);
  border-left: 4px solid var(--accent-indigo);
  padding: 20px;
  border-radius: 0 8px 8px 0;
  margin: 28px 0;
}

.callout-box h4 {
  color: #fff;
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.callout-box p {
  margin-bottom: 0;
  font-size: 0.98rem;
  color: var(--text-muted);
}

/* Footer CTA */
.article-footer {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--surface-border);
}

.footer-cta {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.9));
  border: 1px solid var(--surface-border);
  border-radius: var(--border-radius);
  padding: 36px;
  text-align: center;
}

.footer-cta h3 {
  font-size: 1.5rem;
  color: #fff;
  margin-bottom: 10px;
}

.footer-cta p {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 24px;
  font-size: 1rem;
}

.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, #0070f3, #00a6ff);
  color: #fff;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.95rem;
  box-shadow: 0 4px 14px rgba(0, 118, 255, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 118, 255, 0.45);
}

/* Site Footer */
.site-footer {
  background: #05070a;
  border-top: 1px solid var(--surface-border);
  padding: 56px 0 32px;
  color: var(--text-dim);
  font-size: 0.88rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h4 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 16px;
}

.footer-col p {
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 10px;
}

.footer-col a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid #131722;
  padding-top: 24px;
  text-align: center;
  font-size: 0.8rem;
}

@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .article-title {
    font-size: 1.8rem;
  }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}