:root {
  --bg: #0a0a0a;
  --bg-elevated: #111111;
  --bg-card: #151515;
  --bg-hover: #1a1a1a;
  --border: #2a2a2a;
  --text: #f2f2f2;
  --text-muted: #888888;
  --text-dim: #555555;
  --accent: #e53935;
  --accent-hover: #ff5252;
  --product: #ff6b6b;
  --founder: #4ecdc4;
  --vc: #ffe66d;
  --company: #95e1d3;
  --radius: 6px;
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

.container { width: min(1100px, 92%); margin: 0 auto; }

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

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand-mark {
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.brand:hover { color: var(--text); }
.brand:hover .brand-mark { background: var(--accent-hover); }

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
}
.nav-links a { color: var(--text-muted); font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active { border-bottom: 2px solid var(--accent); padding-bottom: 4px; }

/* Hero */
.hero {
  padding: 100px 0 80px;
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: 1.05;
  margin: 0 0 24px;
  letter-spacing: -0.03em;
}
.hero h1 span { color: var(--accent); }
.hero p.lead {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 0 36px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn:hover { background: var(--bg-hover); }
.btn-primary:hover { background: var(--accent-hover); }

/* Stats */
.stats {
  padding: 64px 0;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
}
.stat-card .number {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}
.stat-card .label { color: var(--text-muted); font-size: 0.95rem; }

/* Sections */
.section { padding: 80px 0; border-bottom: 1px solid var(--border); }
.section-title {
  font-size: 1.6rem;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-title::before {
  content: "";
  display: block;
  width: 6px;
  height: 28px;
  background: var(--accent);
  border-radius: 3px;
}
.section-desc { color: var(--text-muted); margin: 0 0 36px; max-width: 640px; }

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.2s, border-color 0.2s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { margin: 0 0 10px; font-size: 1.15rem; }
.card p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }
.card-meta { display: flex; gap: 12px; margin-top: 16px; font-size: 0.85rem; color: var(--text-dim); }

/* Article list */
.list-toolbar {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.list-toolbar input, .list-toolbar select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  min-width: 220px;
}
.list-toolbar input:focus, .list-toolbar select:focus { outline: none; border-color: var(--accent); }

.article-list { display: flex; flex-direction: column; gap: 16px; }
.article-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}
.article-item:hover { border-color: var(--accent); }
.article-item-info { flex: 1; }
.article-item h4 { margin: 0 0 6px; font-size: 1.1rem; }
.article-item h4 a { color: var(--text); }
.article-item h4 a:hover { color: var(--accent); }
.article-item-meta { color: var(--text-dim); font-size: 0.85rem; }
.article-item-date { color: var(--text-muted); font-size: 0.9rem; white-space: nowrap; }

/* Article detail */
.article-header {
  padding: 64px 0 40px;
  border-bottom: 1px solid var(--border);
}
.article-header h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin: 0 0 16px; line-height: 1.2; }
.article-header-meta { color: var(--text-muted); font-size: 0.95rem; }
.article-header-meta span { margin-right: 16px; }

.article-body {
  padding: 48px 0 80px;
  max-width: 760px;
}
.article-body h2 { font-size: 1.5rem; margin: 48px 0 16px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.article-body h3 { font-size: 1.25rem; margin: 32px 0 12px; color: var(--text); }
.article-body p { margin: 0 0 18px; color: #c8c8c8; }
.article-body a { text-decoration: underline; text-underline-offset: 3px; }
.article-body blockquote {
  margin: 24px 0;
  padding: 16px 24px;
  border-left: 4px solid var(--accent);
  background: var(--bg-card);
  color: var(--text-muted);
}
.article-body ul, .article-body ol { margin: 0 0 18px; padding-left: 24px; }
.article-body li { margin-bottom: 6px; }
.article-body code {
  background: var(--bg-hover);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}
.article-body pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 0 0 24px;
}
.article-body pre code { background: transparent; padding: 0; }
.article-body img { max-width: 100%; border-radius: var(--radius); }
.article-body hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }

.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 32px 0 64px;
  border-top: 1px solid var(--border);
}
.article-nav a { color: var(--text-muted); }
.article-nav a:hover { color: var(--accent); }

/* Graph page */
.graph-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; height: calc(100vh - 65px); }
.graph-canvas { position: relative; background: var(--bg-elevated); min-height: 0; }
.graph-canvas svg { width: 100%; height: 100%; cursor: grab; }
.graph-canvas svg:active { cursor: grabbing; }
.graph-sidebar {
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  padding: 24px;
  overflow-y: auto;
}
.graph-controls {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  gap: 8px;
  z-index: 10;
}
.graph-legend {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(10,10,10,0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  z-index: 10;
}
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; margin-bottom: 6px; color: var(--text-muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }

.node-detail h3 { margin: 0 0 12px; font-size: 1.3rem; }
.node-detail .type-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.node-detail p { color: var(--text-muted); font-size: 0.95rem; margin: 0 0 16px; }
.node-detail .stat-row { display: flex; gap: 16px; margin-bottom: 20px; }
.node-detail .stat-row div { background: var(--bg-hover); padding: 10px 14px; border-radius: var(--radius); font-size: 0.85rem; }
.node-detail .stat-row strong { color: var(--accent); }

.leaderboard { margin-top: 32px; }
.leaderboard h4 { margin: 0 0 14px; font-size: 1.05rem; color: var(--text-muted); }
.lb-list { display: flex; flex-direction: column; gap: 8px; }
.lb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-hover);
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}
.lb-item:hover { background: #252525; }
.lb-rank { width: 24px; text-align: center; font-weight: 700; color: var(--text-dim); }
.lb-rank.top { color: var(--accent); }
.lb-name { flex: 1; color: var(--text); }
.lb-score { color: var(--text-muted); font-size: 0.8rem; }

/* Footer */
.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.9rem;
  text-align: center;
}

/* 404 */
.notfound { text-align: center; padding: 120px 0; }
.notfound h2 { font-size: 4rem; margin: 0; color: var(--accent); }

@media (max-width: 860px) {
  .graph-layout { grid-template-columns: 1fr; grid-template-rows: 60vh auto; height: auto; }
  .graph-sidebar { border-left: none; border-top: 1px solid var(--border); }
  .nav-links { gap: 18px; }
  .article-item { flex-direction: column; align-items: flex-start; }
}
