@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;700&family=Noto+Sans+SC:wght@300;400;500;700;900&display=swap');

:root {
  --purple: #7351cf;
  --purple-dark: #5a3aa0;
  --purple-light: #9b7def;
  --purple-glow: rgba(115, 81, 207, 0.4);
  --bg-primary: #0a0a14;
  --bg-card: #12121f;
  --bg-card-hover: #1a1a2e;
  --bg-elevated: #1e1e32;
  --text-primary: #e8e4f4;
  --text-secondary: #9890b8;
  --text-muted: #5e5678;
  --border: #2a2540;
  --border-light: #3a3358;
  --product-color: #ff6b9d;
  --founder-color: #ffd166;
  --vc-color: #06d6a0;
  --company-color: #118ab2;
  --font-mono: 'JetBrains Mono', 'Menlo', 'Consolas', monospace;
  --font-sans: 'Noto Sans SC', system-ui, -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

::selection {
  background: var(--purple);
  color: white;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple-dark); }

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: rgba(10, 10, 20, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
}

.nav-brand .logo-dot {
  width: 10px;
  height: 10px;
  background: var(--purple);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--purple-glow);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 8px var(--purple-glow); }
  50% { box-shadow: 0 0 20px var(--purple-glow), 0 0 40px rgba(115, 81, 207, 0.2); }
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.2s;
  border: 1px solid transparent;
}
.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-card);
  border-color: var(--border);
}
.nav-link.active {
  color: var(--purple-light);
  background: rgba(115, 81, 207, 0.1);
  border-color: rgba(115, 81, 207, 0.3);
}

.main-content {
  padding-top: 52px;
  min-height: 100vh;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 52px);
  padding: 48px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(115, 81, 207, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-logo {
  width: 80px;
  height: 80px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  position: relative;
}

.hero-logo::after {
  content: '';
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(115, 81, 207, 0.2);
  border-radius: 50%;
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hero-title {
  font-family: var(--font-sans);
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--purple-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.hero-subtitle {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 480px;
  line-height: 1.8;
}

.hero-stats {
  display: flex;
  gap: 40px;
  margin-top: 40px;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--purple-light);
  line-height: 1;
}

.stat-label {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--purple);
  color: white;
  border-color: var(--purple);
  box-shadow: 0 0 20px rgba(115, 81, 207, 0.3);
}
.btn-primary:hover {
  background: var(--purple-light);
  box-shadow: 0 0 30px rgba(115, 81, 207, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-light);
}
.btn-secondary:hover {
  border-color: var(--purple);
  color: var(--purple-light);
  background: rgba(115, 81, 207, 0.05);
}

.section {
  padding: 64px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.section-title {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-badge {
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 11px;
  background: rgba(115, 81, 207, 0.15);
  color: var(--purple-light);
  border: 1px solid rgba(115, 81, 207, 0.2);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  transition: all 0.2s;
  cursor: pointer;
}
.card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.card-title {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
  flex: 1;
}

.card-type {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}
.type-product { background: rgba(255, 107, 157, 0.15); color: var(--product-color); }
.type-founder { background: rgba(255, 209, 102, 0.15); color: var(--founder-color); }
.type-vc { background: rgba(6, 214, 160, 0.15); color: var(--vc-color); }
.type-company { background: rgba(17, 138, 178, 0.15); color: var(--company-color); }

.card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.card-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.card-stat strong {
  color: var(--text-secondary);
  font-weight: 500;
}

.search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 240px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(115, 81, 207, 0.1);
}
.search-input::placeholder { color: var(--text-muted); }

.filter-btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all 0.2s;
}
.filter-btn:hover { border-color: var(--border-light); color: var(--text-primary); }
.filter-btn.active {
  background: rgba(115, 81, 207, 0.15);
  border-color: var(--purple);
  color: var(--purple-light);
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.article-item {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s;
  cursor: pointer;
}
.article-item:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
  transform: translateX(4px);
}

.article-id {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-align: center;
}

.article-info { min-width: 0; }

.article-title {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.article-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
}

.article-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.article-arrow {
  color: var(--text-muted);
  font-size: 16px;
  transition: all 0.2s;
}
.article-item:hover .article-arrow {
  color: var(--purple);
  transform: translateX(4px);
}

/* Article Detail */
.article-detail {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 32px;
  cursor: pointer;
  transition: color 0.2s;
}
.article-back:hover { color: var(--purple-light); }

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

.article-header h1 {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.article-header-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

.article-header-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.article-body {
  font-size: 14px;
  line-height: 2;
  color: var(--text-primary);
}

.article-body h1, .article-body h2, .article-body h3,
.article-body h4, .article-body h5, .article-body h6 {
  font-family: var(--font-sans);
  margin-top: 32px;
  margin-bottom: 16px;
  color: var(--text-primary);
}
.article-body h1 { font-size: 24px; }
.article-body h2 { font-size: 20px; }
.article-body h3 { font-size: 17px; }
.article-body h4 { font-size: 15px; }

.article-body p {
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.article-body ul, .article-body ol {
  margin-bottom: 16px;
  padding-left: 24px;
  color: var(--text-secondary);
}
.article-body li { margin-bottom: 6px; }

.article-body blockquote {
  border-left: 3px solid var(--purple);
  padding: 8px 16px;
  margin: 20px 0;
  background: rgba(115, 81, 207, 0.05);
  border-radius: 0 6px 6px 0;
  color: var(--text-secondary);
  font-style: italic;
}

.article-body code {
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--purple-light);
}

.article-body pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  margin: 20px 0;
}
.article-body pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}

.article-body strong { color: var(--text-primary); font-weight: 600; }
.article-body em { color: var(--purple-light); }

.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

.article-body a {
  color: var(--purple-light);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body img {
  max-width: 100%;
  border-radius: 8px;
  margin: 20px 0;
}

/* Graph Page */
.graph-container {
  position: relative;
  width: 100%;
  height: calc(100vh - 52px);
  overflow: hidden;
}

#graph-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}
#graph-canvas:active { cursor: grabbing; }

.graph-overlay {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}

.graph-btn {
  padding: 6px 14px;
  background: rgba(10, 10, 20, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}
.graph-btn:hover {
  border-color: var(--purple);
  color: var(--purple-light);
}

.graph-info {
  position: absolute;
  bottom: 16px;
  left: 16px;
  padding: 10px 16px;
  background: rgba(10, 10, 20, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11px;
  color: var(--text-muted);
  z-index: 10;
}

.graph-info strong { color: var(--text-secondary); }

.node-detail {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 300px;
  max-height: calc(100% - 80px);
  background: rgba(18, 18, 31, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  overflow-y: auto;
  z-index: 20;
  display: none;
}

.node-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.node-detail-name {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.node-detail-close {
  padding: 4px 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}
.node-detail-close:hover {
  border-color: var(--purple);
  color: var(--purple-light);
}

.node-detail-type {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.node-detail-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
}

.node-detail-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.node-stat {
  padding: 8px 12px;
  background: var(--bg-primary);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.node-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.node-stat-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--purple-light);
  margin-top: 2px;
}

.node-detail-articles {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.node-detail-articles-title {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.node-article-link {
  display: block;
  padding: 6px 0;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  transition: color 0.2s;
}
.node-article-link:hover { color: var(--purple-light); }
.node-article-link:last-child { border-bottom: none; }

/* Leaderboard */
.leaderboard-panel {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 320px;
  max-height: calc(100% - 80px);
  background: rgba(18, 18, 31, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  z-index: 10;
  display: flex;
  flex-direction: column;
}

.leaderboard-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.leaderboard-tab {
  flex: 1;
  padding: 10px 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
}
.leaderboard-tab:hover { color: var(--text-secondary); }
.leaderboard-tab.active {
  color: var(--purple-light);
  border-bottom-color: var(--purple);
}

.leaderboard-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.leaderboard-item:hover { background: var(--bg-card-hover); }

.leaderboard-rank {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  flex-shrink: 0;
}
.rank-1 { background: rgba(255, 215, 0, 0.2); color: #ffd700; }
.rank-2 { background: rgba(192, 192, 192, 0.2); color: #c0c0c0; }
.rank-3 { background: rgba(205, 127, 50, 0.2); color: #cd7f32; }
.rank-other { background: var(--bg-primary); color: var(--text-muted); }

.leaderboard-name {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-score {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Search highlight */
.highlight {
  background: rgba(115, 81, 207, 0.3);
  padding: 0 2px;
  border-radius: 2px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}
.empty-state-text {
  font-family: var(--font-sans);
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Footer */
.footer {
  padding: 32px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .hero-title { font-size: 28px; }
  .hero-stats { gap: 24px; }
  .stat-value { font-size: 24px; }
  .card-grid { grid-template-columns: 1fr; }
  .article-item { grid-template-columns: 50px 1fr auto; gap: 12px; }
  .leaderboard-panel { width: 260px; }
  .node-detail { width: 240px; }
}
