/* 葬AI Web4 - Dark, Sharp, Independent */
:root {
  --bg: #0a0a0a;
  --bg-card: #141414;
  --bg-hover: #1a1a1a;
  --text: #e5e5e5;
  --text-dim: #888;
  --text-muted: #555;
  --accent: #dc2626;
  --accent-glow: #ef4444;
  --border: #222;
  --product: #3b82f6;
  --person: #f59e0b;
  --company: #10b981;
  --vc: #a855f7;
  --radius: 4px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Consolas", 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(--text);
  line-height: 1.7;
  min-height: 100vh;
}

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

/* Navigation */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.brand .accent { color: var(--accent); }

.nav-links { display: flex; gap: 1.5rem; }
.nav-links a {
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Hero Section */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  padding: 6rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  align-items: center;
}

.hero-title {
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.3rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 480px;
}

.stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.stat { display: flex; flex-direction: column; }
.stat-num {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent);
  font-family: var(--font-mono);
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-actions { display: flex; gap: 1rem; }

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius);
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-glow);
  color: #fff;
  box-shadow: 0 0 20px rgba(220, 38, 38, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

/* Hero Visual */
.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.glitch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 280px;
  height: 280px;
}

.glitch-cell {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 2px;
  animation: glitch-pulse 3s infinite;
}
.glitch-cell:nth-child(2) { animation-delay: 0.5s; background: rgba(220,38,38,0.1); }
.glitch-cell:nth-child(4) { animation-delay: 1s; }
.glitch-cell:nth-child(5) { animation-delay: 1.5s; background: rgba(220,38,38,0.05); }
.glitch-cell:nth-child(6) { animation-delay: 2s; }

@keyframes glitch-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
}

.feature {
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}
.feature:hover { border-color: var(--accent); }

.feature-icon {
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.feature h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.feature p {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.feature a {
  font-size: 0.85rem;
  font-weight: 600;
}

/* Page Header */
.page-header {
  padding: 3rem 2rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
.page-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.page-header p {
  color: var(--text-dim);
  font-size: 1rem;
}

/* Graph Page */
.graph-main { max-width: 100%; }

.graph-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.legend { display: flex; gap: 1rem; }
.legend-item { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--text-dim); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-product { background: var(--product); }
.dot-person { background: var(--person); }
.dot-company { background: var(--company); }
.dot-vc { background: var(--vc); }

.graph-search input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  width: 200px;
  outline: none;
}
.graph-search input:focus { border-color: var(--accent); }

.graph-container {
  width: 100%;
  height: 600px;
  margin: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

#graph-svg { width: 100%; height: 100%; }

.node-detail {
  display: none;
  position: fixed;
  top: 80px;
  right: 20px;
  width: 360px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  z-index: 50;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.node-detail.visible { display: block; }

.detail-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
}
.detail-close:hover { color: var(--text); }

.detail-name { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.5rem; }
.detail-type {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}
.detail-type-product { background: rgba(59,130,246,0.2); color: var(--product); }
.detail-type-person { background: rgba(245,158,11,0.2); color: var(--person); }
.detail-type-company { background: rgba(16,185,129,0.2); color: var(--company); }
.detail-type-vc_firm { background: rgba(168,85,247,0.2); color: var(--vc); }

.detail-desc { font-size: 0.9rem; color: var(--text-dim); margin-bottom: 1rem; line-height: 1.6; }
.detail-stats { display: flex; gap: 1.5rem; margin-bottom: 1rem; }
.detail-stat { text-align: center; }
.detail-stat-num { font-size: 1.2rem; font-weight: 700; color: var(--accent); display: block; }
.detail-stat-label { font-size: 0.75rem; color: var(--text-muted); }
.detail-aliases { font-size: 0.8rem; color: var(--text-muted); }

/* Leaderboards */
.leaderboards {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}
.leaderboards h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}

.lb-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.lb-tab {
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}
.lb-tab:hover { border-color: var(--text-dim); color: var(--text); }
.lb-tab.active { border-color: var(--accent); color: var(--accent); background: rgba(220,38,38,0.05); }

.lb-table {
  width: 100%;
  border-collapse: collapse;
}
.lb-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
.lb-table td {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(34,34,34,0.5);
}
.lb-table tr:hover td { background: var(--bg-hover); }
.lb-rank { font-family: var(--font-mono); color: var(--accent); font-weight: 700; width: 50px; }
.lb-name { font-weight: 600; }
.lb-desc { color: var(--text-dim); font-size: 0.8rem; max-width: 400px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-bar {
  width: 100px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.lb-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; }

/* Articles Page */
.articles-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

.articles-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

#search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  font-size: 0.95rem;
  outline: none;
}
#search-input:focus { border-color: var(--accent); }

.filter-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filter-btn {
  padding: 0.4rem 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}
.filter-btn:hover { border-color: var(--text-dim); color: var(--text); }
.filter-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(220,38,38,0.05); }

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

.article-card {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 1rem;
  padding: 1.2rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
  align-items: center;
}
.article-card:hover { border-color: var(--accent); }

.article-card .art-id {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.article-card .art-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.article-card .art-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.article-card .art-author {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
}

.article-card .art-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Article Detail Page */
.article-detail {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem;
}

.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.article-id {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}

.article-header h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.3;
  margin: 0.5rem 0;
}

.article-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.article-meta .author { color: var(--accent); font-weight: 500; }

.article-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  margin: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.article-nav a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
}
.article-nav a:hover { color: var(--accent); }
.nav-disabled { font-size: 0.85rem; color: var(--text-muted); }

.article-content {
  font-size: 1rem;
  line-height: 1.8;
}
.article-content h1 { font-size: 1.8rem; font-weight: 800; margin: 2rem 0 1rem; }
.article-content h2 { font-size: 1.4rem; font-weight: 700; margin: 1.8rem 0 0.8rem; color: var(--text); }
.article-content h3 { font-size: 1.2rem; font-weight: 600; margin: 1.5rem 0 0.6rem; }
.article-content p { margin-bottom: 1.2rem; }
.article-content ul, .article-content ol { margin: 0.5rem 0 1.2rem 1.5rem; }
.article-content li { margin-bottom: 0.4rem; }
.article-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  color: var(--text-dim);
  background: var(--bg-card);
}
.article-content code {
  background: var(--bg-card);
  padding: 0.15rem 0.4rem;
  border-radius: 2px;
  font-size: 0.9em;
  font-family: var(--font-mono);
}
.article-content pre {
  background: var(--bg-card);
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1rem 0;
}
.article-content pre code { background: none; padding: 0; }
.article-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}
.article-content strong { color: var(--text); font-weight: 700; }
.article-content em { color: var(--text-dim); }
.article-content a { color: var(--accent); text-decoration: underline; }
.article-content img { max-width: 100%; border-radius: var(--radius); }
.article-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.article-content th, .article-content td {
  padding: 0.5rem;
  border: 1px solid var(--border);
  text-align: left;
}
.article-content th { background: var(--bg-card); font-weight: 600; }

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 768px) {
  .hero { grid-template-columns: 1fr; padding: 3rem 1.5rem; gap: 2rem; }
  .hero-title { font-size: 2.5rem; }
  .hero-visual { display: none; }
  .features { grid-template-columns: 1fr; padding: 2rem 1.5rem; }
  .stats { gap: 1.5rem; }
  .stat-num { font-size: 1.6rem; }
  .graph-container { height: 400px; }
  .article-card { grid-template-columns: 40px 1fr; }
  .article-card .art-meta { grid-column: 1 / -1; flex-direction: row; align-items: center; }
  .site-nav { padding: 0.8rem 1rem; }
  .leaderboards { padding: 2rem 1rem; }
  .node-detail { width: calc(100% - 40px); right: 20px; }
}
