
:root {
  --bg: #0a0a0f;
  --bg2: #12121a;
  --bg3: #1a1a28;
  --fg: #e8e8f0;
  --fg2: #9898b0;
  --accent: #00ff88;
  --accent2: #6bcfff;
  --red: #ff6b6b;
  --yellow: #ffd93d;
  --border: #2a2a3a;
  --radius: 8px;
  --font: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "JetBrains Mono", "Fira Code", monospace;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent2); }

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,15,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px;
}
.nav-brand {
  font-size: 1.1rem; font-weight: 700; color: var(--fg);
  letter-spacing: -.02em;
}
.nav-brand span { color: var(--accent); }
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a {
  color: var(--fg2); font-size: .875rem; font-weight: 500;
  transition: color .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); }

/* LAYOUT */
.container { max-width: 1200px; margin: 0 auto; padding: 2rem; }
.page-title {
  font-size: 2rem; font-weight: 800; letter-spacing: -.03em;
  margin-bottom: .5rem;
}
.page-subtitle { color: var(--fg2); font-size: 1rem; margin-bottom: 2rem; }

/* HERO */
.hero {
  text-align: center; padding: 6rem 2rem 4rem;
  background: radial-gradient(ellipse at 50% 0%, rgba(0,255,136,.06) 0%, transparent 60%);
}
.hero h1 {
  font-size: 3.5rem; font-weight: 900; letter-spacing: -.04em;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 1rem;
}
.hero p { color: var(--fg2); font-size: 1.15rem; max-width: 600px; margin: 0 auto 2rem; }
.stats-row {
  display: flex; justify-content: center; gap: 3rem; margin: 2rem 0;
}
.stat { text-align: center; }
.stat-num {
  font-size: 2.5rem; font-weight: 900; color: var(--accent);
  font-family: var(--mono);
}
.stat-label { font-size: .8rem; color: var(--fg2); text-transform: uppercase; letter-spacing: .1em; }
.hero-nav {
  display: flex; justify-content: center; gap: 1rem; margin-top: 2rem;
}
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .75rem 1.5rem; border-radius: var(--radius);
  font-size: .9rem; font-weight: 600; transition: all .2s;
  border: 1px solid var(--border);
}
.btn-primary {
  background: var(--accent); color: var(--bg); border-color: var(--accent);
}
.btn-primary:hover { background: #00cc6e; color: var(--bg); }
.btn-ghost { background: transparent; color: var(--fg); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* CARDS */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  transition: border-color .2s, transform .15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-title { font-size: 1rem; font-weight: 700; margin-bottom: .5rem; }
.card-meta { font-size: .8rem; color: var(--fg2); display: flex; gap: 1rem; }

/* LEADERBOARD */
.lb-section { margin-bottom: 2.5rem; }
.lb-title {
  font-size: 1.25rem; font-weight: 800; margin-bottom: 1rem;
  display: flex; align-items: center; gap: .5rem;
}
.lb-dot {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block;
}
.lb-table { width: 100%; border-collapse: collapse; }
.lb-table th {
  text-align: left; font-size: .75rem; color: var(--fg2);
  text-transform: uppercase; letter-spacing: .08em;
  padding: .5rem .75rem; border-bottom: 1px solid var(--border);
}
.lb-table td {
  padding: .6rem .75rem; border-bottom: 1px solid rgba(42,42,58,.5);
  font-size: .875rem;
}
.lb-table tr:hover td { background: rgba(0,255,136,.03); }
.lb-rank {
  font-family: var(--mono); font-weight: 700; color: var(--fg2);
  width: 40px;
}
.lb-rank.top3 { color: var(--accent); }
.lb-name { font-weight: 600; }
.lb-desc { color: var(--fg2); font-size: .8rem; max-width: 400px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-num { font-family: var(--mono); text-align: right; color: var(--fg2); }

/* GRAPH */
#graph-container {
  width: 100%; height: 70vh; min-height: 500px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); position: relative; overflow: hidden;
}
#graph-container svg { width: 100%; height: 100%; }
.graph-controls {
  position: absolute; top: 1rem; right: 1rem; z-index: 10;
  display: flex; flex-direction: column; gap: .5rem;
}
.graph-controls button {
  width: 36px; height: 36px; border-radius: 6px;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--fg); font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.graph-controls button:hover { border-color: var(--accent); color: var(--accent); }
.graph-legend {
  display: flex; gap: 1.5rem; margin: 1rem 0; flex-wrap: wrap;
}
.legend-item {
  display: flex; align-items: center; gap: .4rem;
  font-size: .8rem; color: var(--fg2);
}
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.node-tooltip {
  position: absolute; pointer-events: none; z-index: 20;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; padding: .75rem 1rem;
  font-size: .8rem; max-width: 300px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  display: none;
}
.node-tooltip .tt-name { font-weight: 700; font-size: .95rem; margin-bottom: .25rem; }
.node-tooltip .tt-type { color: var(--fg2); font-size: .75rem; text-transform: uppercase; }
.node-tooltip .tt-desc { color: var(--fg2); margin-top: .4rem; }
.graph-filter {
  display: flex; gap: .5rem; margin: 1rem 0; flex-wrap: wrap;
}
.graph-filter button {
  padding: .4rem .8rem; border-radius: 20px;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--fg2); font-size: .8rem; cursor: pointer;
  transition: all .2s;
}
.graph-filter button:hover, .graph-filter button.active {
  border-color: var(--accent); color: var(--accent);
}

/* SEARCH */
.search-box {
  width: 100%; max-width: 500px; padding: .75rem 1rem;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--fg);
  font-size: .9rem; outline: none; transition: border-color .2s;
  margin-bottom: 1.5rem;
}
.search-box:focus { border-color: var(--accent); }
.filter-row {
  display: flex; gap: .5rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}
.filter-btn {
  padding: .4rem .8rem; border-radius: 20px;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--fg2); font-size: .8rem; cursor: pointer;
  transition: all .2s;
}
.filter-btn:hover, .filter-btn.active {
  border-color: var(--accent); color: var(--accent);
}

/* ARTICLE DETAIL */
.article-header {
  padding: 3rem 0 2rem; border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.article-header h1 {
  font-size: 2rem; font-weight: 800; letter-spacing: -.02em;
  line-height: 1.3; margin-bottom: 1rem;
}
.article-meta {
  display: flex; gap: 1.5rem; color: var(--fg2); font-size: .85rem;
}
.article-body {
  max-width: 720px; font-size: 1.05rem; line-height: 1.9;
}
.article-body h1 { font-size: 1.8rem; font-weight: 800; margin: 2rem 0 1rem; }
.article-body h2 { font-size: 1.4rem; font-weight: 700; margin: 1.8rem 0 .8rem; }
.article-body h3 { font-size: 1.2rem; font-weight: 600; margin: 1.5rem 0 .6rem; }
.article-body p { margin-bottom: 1.2rem; }
.article-body blockquote {
  border-left: 3px solid var(--accent); padding-left: 1rem;
  color: var(--fg2); margin: 1.5rem 0; font-style: italic;
}
.article-body ul, .article-body ol {
  padding-left: 1.5rem; margin-bottom: 1.2rem;
}
.article-body li { margin-bottom: .4rem; }
.article-body code {
  background: var(--bg3); padding: .15rem .4rem; border-radius: 4px;
  font-family: var(--mono); font-size: .9em;
}
.article-body pre {
  background: var(--bg3); padding: 1rem; border-radius: var(--radius);
  overflow-x: auto; margin: 1.5rem 0;
}
.article-body pre code { background: none; padding: 0; }
.article-body hr {
  border: none; border-top: 1px solid var(--border); margin: 2rem 0;
}
.article-body strong { color: #fff; }
.article-body img { max-width: 100%; border-radius: var(--radius); }
.article-nav {
  display: flex; justify-content: space-between; margin-top: 3rem;
  padding-top: 2rem; border-top: 1px solid var(--border);
}
.article-nav a {
  padding: .5rem 1rem; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: .85rem;
  transition: all .2s;
}
.article-nav a:hover { border-color: var(--accent); }

/* FOOTER */
.footer {
  text-align: center; padding: 3rem 2rem;
  color: var(--fg2); font-size: .8rem;
  border-top: 1px solid var(--border); margin-top: 4rem;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .hero h1 { font-size: 2.2rem; }
  .stats-row { gap: 1.5rem; }
  .stat-num { font-size: 1.8rem; }
  .card-grid { grid-template-columns: 1fr; }
  .nav-inner { padding: 0 .5rem; }
  .container { padding: 1rem; }
  .lb-desc { max-width: 200px; }
  #graph-container { height: 50vh; min-height: 350px; }
}
