:root {
  --bg-main: #0b0f19;
  --bg-card: #111827;
  --bg-card-hover: #162032;
  --bg-alt: #1e293b;
  --border: #334155;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: #818cf8;
  --teal: #14b8a6;
  --amber: #f59e0b;
  --rose: #f43f5e;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --radius: 12px;
  --container-width: 960px;
}

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

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

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: #c7d2fe;
}

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

/* Header & Nav */
header {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

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

.brand-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), #06b6d4);
  border-radius: 8px;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 8px;
}

nav a {
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

nav a:hover,
nav a.active {
  color: var(--text-main);
  background: var(--bg-alt);
}

/* Hero Section */
.hero {
  padding: 60px 0 40px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 999px;
  color: var(--accent-light);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 20px;
}

.hero-tag .dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 8px #22c55e;
}

.hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 680px;
}

/* Sections & Cards */
.section {
  padding: 30px 0;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: #475569;
  transform: translateY(-2px);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 10px;
  line-height: 1.35;
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  flex-grow: 1;
  margin-bottom: 16px;
}

.card-link {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent-light);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-blue { background: rgba(99, 102, 241, 0.2); color: var(--accent-light); }
.badge-teal { background: rgba(20, 184, 166, 0.2); color: #2dd4bf; }
.badge-amber { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge-rose { background: rgba(244, 63, 94, 0.2); color: #fb7185; }

/* Article Layout */
.article-container {
  max-width: 760px;
  margin: 40px auto;
  padding: 0 20px;
}

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

.article-header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
  line-height: 1.25;
}

.article-content {
  font-size: 1.05rem;
  color: #cbd5e1;
}

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 36px 0 16px;
  color: var(--text-main);
}

.article-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--text-main);
}

.article-content p {
  margin-bottom: 20px;
}

.article-content ul,
.article-content ol {
  margin: 0 0 20px 24px;
}

.article-content li {
  margin-bottom: 8px;
}

.article-content pre {
  background: #020617;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin: 24px 0;
  color: #e2e8f0;
}

.article-content code {
  background: var(--bg-alt);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: #e2e8f0;
}

pre code {
  background: transparent;
  padding: 0;
}

/* Callout */
.callout {
  border-left: 4px solid var(--accent);
  background: var(--bg-card);
  padding: 16px 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 24px 0;
  color: var(--text-muted);
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.95rem;
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg-card);
  color: var(--text-main);
  font-weight: 600;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Tool Widgets */
.tool-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.tool-box h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
  color: var(--text-main);
}

.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-alt);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: #334155;
}

.tool-result {
  margin-top: 16px;
  padding: 14px;
  background: #020617;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  word-break: break-all;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Footer */
footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 30px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

/* Responsive */
@media (max-width: 640px) {
  .hero h1 { font-size: 2rem; }
  .nav-wrapper { flex-direction: column; height: auto; padding: 14px 0; gap: 12px; }
  nav ul { flex-wrap: wrap; justify-content: center; }
  .cards-grid { grid-template-columns: 1fr; }
  .footer-content { flex-direction: column; text-align: center; }
}