:root {
  --bg: #0a0a0b;
  --bg-elev: #121214;
  --bg-card: #18181b;
  --bg-card-hover: #1f1f23;
  --border: #2a2a2e;
  --text: #f0f0f2;
  --muted: #9fa0a8;
  --accent: #ff3b3b;
  --accent-2: #ff6b35;
  --accent-glow: rgba(255, 59, 59, 0.25);
  --type-product: #ff4d4d;
  --type-person: #b967ff;
  --type-company: #00d4ff;
  --type-vc: #00ff9d;
  --radius: 10px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "JetBrains Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.7;
  font-size: 16px;
}

a { color: inherit; text-decoration: none; }

.container {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,11,0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-size: 1.05rem;
}
.brand-text { font-family: var(--font-mono); }
.main-nav { display: flex; gap: 6px; }
.nav-link {
  padding: 8px 14px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all .15s ease;
}
.nav-link:hover { color: var(--text); background: var(--bg-card); }
.nav-link.active { color: var(--accent); background: rgba(255,59,59,0.08); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 24px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 8px 30px rgba(255,59,59,0.35); }
.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-card-hover); }

/* Hero */
.hero {
  padding: 90px 0 70px;
  border-bottom: 1px solid var(--border);
}
.hero-inner { max-width: 760px; }
.hero-kicker {
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 16px;
}
.hero-title {
  margin: 0 0 18px;
  font-size: clamp(2.6rem, 7vw, 4.8rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.hero-title span { color: var(--accent); }
.hero-desc {
  margin: 0 0 34px;
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 640px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  padding: 40px 0 60px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform .15s, border-color .15s;
}
.stat-card:hover { transform: translateY(-2px); border-color: #3a3a3e; }
.stat-number {
  font-family: var(--font-mono);
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Sections */
.section { padding: 60px 0; }
.section-title {
  margin: 0 0 26px;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-title::before {
  content: "";
  width: 6px;
  height: 26px;
  background: var(--accent);
  border-radius: 3px;
}

/* Feature cards */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: all .15s;
}
.feature-card:hover { background: var(--bg-card-hover); border-color: #3a3a3e; }
.feature-card h3 { margin: 0 0 10px; font-size: 1.25rem; }
.feature-card p { margin: 0; color: var(--muted); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-inner { text-align: center; }
.footer-inner p { margin: 4px 0; }
.footer-meta { color: #6e6f75; }

/* Graph page */
.graph-wrap {
  position: relative;
  height: calc(100vh - 64px);
  min-height: 560px;
  background: var(--bg);
  overflow: hidden;
}
#graph-canvas {
  width: 100%;
  height: 100%;
  cursor: grab;
}
#graph-canvas:active { cursor: grabbing; }
.graph-ui {
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  gap: 12px;
  flex-wrap: wrap;
}
.graph-ui > * { pointer-events: auto; }
.graph-search {
  display: flex;
  gap: 8px;
  background: rgba(18,18,20,0.92);
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.graph-search input {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  width: 220px;
}
.graph-search button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-weight: 600;
  cursor: pointer;
}
.graph-controls {
  display: flex;
  gap: 8px;
  background: rgba(18,18,20,0.92);
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.graph-controls button {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.85rem;
}
.graph-controls button:hover { background: var(--bg-card-hover); }
.graph-legend {
  display: flex;
  gap: 14px;
  background: rgba(18,18,20,0.92);
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  font-size: 0.85rem;
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.graph-detail {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 320px;
  max-height: calc(100% - 36px);
  overflow: auto;
  background: rgba(18,18,20,0.96);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(12px);
  display: none;
}
.graph-detail.open { display: block; }
.graph-detail h3 { margin: 0 0 10px; font-size: 1.2rem; }
.graph-detail .meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 12px; }
.graph-detail .desc { color: #c9cacf; font-size: 0.95rem; line-height: 1.6; }
.graph-detail .close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
}
.graph-detail .links { margin-top: 16px; }
.graph-detail .links h4 { margin: 0 0 8px; font-size: 0.9rem; color: var(--muted); }
.graph-detail .link-chip {
  display: inline-block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  margin: 0 6px 6px 0;
  font-size: 0.82rem;
}

/* Leaderboards */
.leaderboards { padding: 50px 0 80px; }
.board-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.board-tab {
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  transition: all .12s;
}
.board-tab:hover { color: var(--text); }
.board-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.board-panel { display: none; }
.board-panel.active { display: block; }
.board-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.board-table th,
.board-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.board-table th {
  background: var(--bg-elev);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.board-table tr:last-child td { border-bottom: none; }
.board-table tr:hover { background: var(--bg-card-hover); }
.board-table .rank { font-family: var(--font-mono); font-weight: 700; color: var(--accent); width: 60px; }
.board-table .name { font-weight: 700; }
.board-table .metric { font-family: var(--font-mono); color: var(--muted); }
.board-table .desc { color: var(--muted); font-size: 0.9rem; max-width: 420px; }

/* Articles list */
.articles-page { padding: 50px 0 80px; }
.filters {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.search-box {
  flex: 1 1 260px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
}
.search-box:focus { border-color: var(--accent); }
.filter-pill {
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 500;
}
.filter-pill:hover { color: var(--text); }
.filter-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.articles-list { display: grid; gap: 14px; }
.article-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all .12s;
}
.article-card:hover { background: var(--bg-card-hover); border-color: #3a3a3e; }
.article-card h3 { margin: 0; font-size: 1.15rem; }
.article-card a { color: var(--text); }
.article-card a:hover { color: var(--accent); }
.article-meta { color: var(--muted); font-size: 0.88rem; }
.article-author {
  display: inline-block;
  background: rgba(255,59,59,0.08);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: 8px;
}
.empty-state { color: var(--muted); padding: 40px 0; text-align: center; }

/* Article detail */
.article-page { padding: 50px 0 80px; }
.article-header { margin-bottom: 36px; }
.article-header h1 {
  margin: 0 0 14px;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1.2;
}
.article-byline { color: var(--muted); font-size: 1rem; }
.article-divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0 36px;
}
.article-body {
  font-size: 1.05rem;
  color: #e4e4e7;
}
.article-body h1, .article-body h2, .article-body h3, .article-body h4 {
  margin-top: 1.8em;
  margin-bottom: 0.6em;
  line-height: 1.3;
}
.article-body h1 { font-size: 1.7rem; }
.article-body h2 { font-size: 1.4rem; }
.article-body h3 { font-size: 1.2rem; }
.article-body p { margin: 0 0 1.1em; }
.article-body ul, .article-body ol { margin: 0 0 1.1em; padding-left: 1.6em; }
.article-body li { margin: 0.25em 0; }
.article-body a { color: var(--accent-2); border-bottom: 1px solid rgba(255,107,53,0.3); }
.article-body a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.article-body blockquote {
  margin: 1.4em 0;
  padding: 12px 20px;
  border-left: 4px solid var(--accent);
  background: var(--bg-card);
  color: #d4d4d8;
}
.article-body pre {
  background: #0f0f11;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}
.article-body code {
  background: rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}
.article-body pre code { background: transparent; padding: 0; }
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 0.95rem;
}
.article-body th, .article-body td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
}
.article-body th { background: var(--bg-elev); }
.article-body img { max-width: 100%; height: auto; border-radius: 8px; }

.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 50px;
}
.article-nav a {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: all .12s;
}
.article-nav a:hover { background: var(--bg-card-hover); border-color: #3a3a3e; }
.article-nav .label { font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; }
.article-nav .title { font-weight: 700; }
.article-nav .next { text-align: right; }

.entity-tags { margin-top: 30px; }
.entity-tags h4 { margin: 0 0 10px; color: var(--muted); font-size: 0.9rem; }
.entity-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  margin: 0 8px 8px 0;
  font-size: 0.85rem;
}
.entity-chip .dot { width: 8px; height: 8px; border-radius: 50%; }

@media (max-width: 760px) {
  .header-inner { height: 58px; }
  .brand-text { font-size: 1rem; }
  .main-nav { gap: 2px; }
  .nav-link { padding: 7px 10px; font-size: 0.88rem; }
  .hero { padding: 60px 0 50px; }
  .graph-detail { width: calc(100% - 36px); top: auto; bottom: 18px; right: 18px; max-height: 45%; }
  .graph-ui { flex-direction: column; align-items: stretch; }
  .article-nav { grid-template-columns: 1fr; }
  .article-nav .next { text-align: left; }
}
