:root {
  --bg: #0b0b0b;
  --surface: #141414;
  --surface-2: #1e1e1e;
  --text: #e6e6e6;
  --text-2: #9a9a9a;
  --accent: #e63946;
  --accent-2: #ff6b6b;
  --border: #2a2a2a;
  --radius: 8px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); text-decoration: none; transition: opacity .2s; }
a:hover { opacity: .8; text-decoration: underline; }
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11,11,11,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
nav {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
}
.brand { font-size: 20px; font-weight: 800; letter-spacing: .5px; color: var(--text); }
.brand span { color: var(--accent); }
.nav-links { display: flex; gap: 24px; }
.nav-links a { color: var(--text-2); font-size: 14px; font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--text); text-decoration: none; }
main { max-width: 1200px; margin: 0 auto; padding: 40px 24px; }
.hero { padding: 80px 0 60px; text-align: center; }
.hero h1 { font-size: clamp(36px, 6vw, 64px); font-weight: 900; line-height: 1.1; margin-bottom: 16px; }
.hero h1 span { color: var(--accent); }
.hero p { color: var(--text-2); font-size: 18px; max-width: 640px; margin: 0 auto 32px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-top: 48px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; text-align: center; }
.stat .num { font-size: 36px; font-weight: 900; color: var(--accent); }
.stat .label { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius);
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); font-size: 14px; font-weight: 600;
  transition: transform .15s, border-color .2s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); }
.section-title { font-size: 24px; font-weight: 800; margin-bottom: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; transition: border-color .2s;
}
.card:hover { border-color: #444; }
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.tag {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2); font-size: 12px; border: 1px solid var(--border);
}
input[type="text"] {
  width: 100%; padding: 12px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-size: 14px; outline: none;
}
input[type="text"]:focus { border-color: var(--accent); }
article { max-width: 760px; margin: 0 auto; }
article h1 { font-size: 32px; font-weight: 900; margin-bottom: 8px; line-height: 1.3; }
article .meta { color: var(--text-2); font-size: 14px; margin-bottom: 32px; }
article .content { font-size: 17px; line-height: 1.8; color: #d4d4d4; }
article .content h2 { font-size: 24px; font-weight: 800; margin: 32px 0 12px; color: var(--text); }
article .content h3 { font-size: 20px; font-weight: 700; margin: 24px 0 10px; color: var(--text); }
article .content p { margin-bottom: 16px; }
article .content ul, article .content ol { margin: 0 0 16px 24px; }
article .content li { margin-bottom: 6px; }
article .content blockquote {
  border-left: 3px solid var(--accent); padding: 8px 16px; margin: 16px 0;
  background: var(--surface); color: var(--text-2); font-style: italic;
}
article .content code {
  background: var(--surface-2); padding: 2px 6px; border-radius: 4px;
  font-family: "SF Mono", Monaco, monospace; font-size: 14px; color: var(--accent-2);
}
article .content pre {
  background: var(--surface); padding: 16px; border-radius: var(--radius);
  overflow-x: auto; margin: 16px 0; border: 1px solid var(--border);
}
article .content pre code { background: none; padding: 0; color: var(--text); }
article .content strong { color: #fff; font-weight: 700; }
article .content a { text-decoration: underline; text-underline-offset: 3px; }
article .back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 20px; color: var(--text-2); }
article .back:hover { color: var(--text); text-decoration: none; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 8px 16px; border-radius: var(--radius); cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
  font-size: 13px; font-weight: 600; user-select: none;
}
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.leaderboard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.leaderboard-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--border); font-size: 14px;
}
.leaderboard-item:last-child { border-bottom: none; }
.rank { width: 28px; text-align: center; font-weight: 900; color: var(--accent); }
.lb-name { flex: 1; font-weight: 600; }
.lb-desc { color: var(--text-2); font-size: 12px; flex: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-metric { color: var(--text-2); font-size: 12px; width: 60px; text-align: right; }
#graph-container { width: 100%; height: 70vh; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); position: relative; overflow: hidden; }
#graph-container svg { width: 100%; height: 100%; cursor: grab; }
#graph-container svg:active { cursor: grabbing; }
.graph-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; }
@media (max-width: 900px) {
  .graph-layout { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
.node-detail {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; min-height: 120px;
}
.node-detail h3 { font-size: 16px; margin-bottom: 8px; color: var(--text); }
.node-detail p { font-size: 13px; color: var(--text-2); }
.empty-state { color: var(--text-2); font-size: 14px; text-align: center; padding: 40px 0; }
.footer {
  text-align: center; padding: 40px 24px; color: var(--text-2);
  font-size: 13px; border-top: 1px solid var(--border); margin-top: 60px;
}
