/* === 葬AI Web4 — Global Styles === */

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

:root {
  --bg: #0a0a0b;
  --bg-card: #131316;
  --bg-hover: #1a1a20;
  --text: #e0e0e0;
  --text-dim: #888;
  --text-strong: #fff;
  --accent: #e63946;
  --accent-glow: #ff4d5a;
  --accent-soft: #ff6b6b;
  --product: #4ecdc4;
  --founder: #ffe66d;
  --vc: #a29bfe;
  --company: #fd79a8;
  --border: #2a2a32;
  --radius: 8px;
  --font-serif: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
  --font-sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  min-height: 100vh;
}

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

/* === Navigation === */

nav.global-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10,10,11,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

nav.global-nav .nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

nav.global-nav .brand {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text-strong);
  letter-spacing: 0.04em;
}
nav.global-nav .brand span {
  color: var(--accent);
}

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

nav.global-nav .nav-links a {
  padding: 6px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: all 0.2s;
}
nav.global-nav .nav-links a:hover,
nav.global-nav .nav-links a.active {
  color: var(--text-strong);
  background: var(--bg-hover);
}

/* === Hero / Header === */

.hero {
  text-align: center;
  padding: 80px 24px 64px;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--text-strong);
  line-height: 1.2;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}
.hero h1 .accent { color: var(--accent); }

.hero .tagline {
  font-size: 1.125rem;
  color: var(--text-dim);
  margin-bottom: 32px;
  line-height: 1.6;
}

.hero .stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

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

.hero .stat .number {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}
.hero .stat .label {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

/* === Section Headers === */

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

.section-header h2 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--text-strong);
  margin-bottom: 4px;
}
.section-header p {
  color: var(--text-dim);
  font-size: 0.875rem;
}

/* === Cards / Grid === */

.card-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 64px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s, transform 0.15s;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 8px;
}
.card p {
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* === Buttons === */

.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-glow);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-glow);
}

/* === Leaderboard === */

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

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.leaderboard-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.leaderboard-panel .panel-header {
  padding: 16px 20px;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-strong);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.leaderboard-panel.products .panel-header { border-left: 3px solid var(--product); }
.leaderboard-panel.founders .panel-header { border-left: 3px solid var(--founder); }
.leaderboard-panel.vcs .panel-header { border-left: 3px solid var(--vc); }
.leaderboard-panel.companies .panel-header { border-left: 3px solid var(--company); }

.leaderboard-panel .panel-body {
  padding: 0;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  font-size: 0.85rem;
}
.leaderboard-item:last-child { border-bottom: none; }
.leaderboard-item:hover { background: var(--bg-hover); }

.leaderboard-item .rank {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 1rem;
  width: 28px;
  text-align: center;
  color: var(--text-dim);
  flex-shrink: 0;
}
.leaderboard-item:nth-child(1) .rank { color: #ffd700; }
.leaderboard-item:nth-child(2) .rank { color: #c0c0c0; }
.leaderboard-item:nth-child(3) .rank { color: #cd7f32; }

.leaderboard-item .info { flex: 1; min-width: 0; }
.leaderboard-item .name {
  color: var(--text-strong);
  font-weight: 600;
  font-size: 0.875rem;
}
.leaderboard-item .desc {
  color: var(--text-dim);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-item .degree {
  font-size: 0.75rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* === Graph Page === */

.graph-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.graph-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  width: 100%;
  height: 600px;
  margin-bottom: 32px;
}

.graph-wrapper svg {
  width: 100%;
  height: 100%;
}

.graph-legend {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(10,10,11,0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}

.graph-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.graph-legend .legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.graph-legend .legend-dot.product { background: var(--product); }
.graph-legend .legend-dot.founder { background: var(--founder); }
.graph-legend .legend-dot.vc { background: var(--vc); }
.graph-legend .legend-dot.company { background: var(--company); }

/* Node tooltip */
.graph-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.8rem;
  max-width: 280px;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.15s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.graph-tooltip.visible { opacity: 1; }
.graph-tooltip .tt-name {
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 4px;
  font-size: 0.9rem;
}
.graph-tooltip .tt-type {
  color: var(--text-dim);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.graph-tooltip .tt-desc {
  color: var(--text-dim);
  font-size: 0.75rem;
  line-height: 1.5;
}

/* === Article List === */

.article-filters {
  max-width: 1200px;
  margin: 0 auto 24px;
  padding: 0 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.875rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-dim); }

.filter-select {
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.875rem;
  font-family: var(--font-sans);
  outline: none;
  cursor: pointer;
  min-width: 140px;
}

.article-count {
  max-width: 1200px;
  margin: 0 auto 16px;
  padding: 0 24px;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.article-list {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.article-row {
  display: grid;
  grid-template-columns: 60px 1fr 130px;
  align-items: center;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  gap: 16px;
  transition: all 0.15s;
}
.article-row:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.article-row .art-id {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 700;
}

.article-row .art-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.article-row .art-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.article-row .art-date {
  font-size: 0.75rem;
  color: var(--text-dim);
}
.article-row .art-author {
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* === Article Detail === */

.article-detail {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

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

.article-detail .art-header h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-strong);
  line-height: 1.4;
  margin-bottom: 12px;
}

.article-detail .art-header .meta {
  display: flex;
  gap: 24px;
  color: var(--text-dim);
  font-size: 0.85rem;
  flex-wrap: wrap;
}

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

.article-detail .art-body {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text);
}

.article-detail .art-body h1,
.article-detail .art-body h2,
.article-detail .art-body h3 {
  font-family: var(--font-serif);
  color: var(--text-strong);
  margin-top: 2em;
  margin-bottom: 0.6em;
  line-height: 1.3;
}
.article-detail .art-body h1 { font-size: 1.6rem; font-weight: 900; }
.article-detail .art-body h2 { font-size: 1.3rem; font-weight: 700; }
.article-detail .art-body h3 { font-size: 1.1rem; font-weight: 700; }

.article-detail .art-body p {
  margin-bottom: 1.2em;
}

.article-detail .art-body strong {
  color: var(--text-strong);
  font-weight: 700;
}

.article-detail .art-body em {
  color: var(--accent-soft);
}

.article-detail .art-body ul,
.article-detail .art-body ol {
  margin: 0.8em 0;
  padding-left: 1.5em;
}

.article-detail .art-body li {
  margin-bottom: 0.4em;
}

.article-detail .art-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.2em 0;
  padding: 8px 20px;
  background: var(--bg-card);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-dim);
  font-style: italic;
}

.article-detail .art-body blockquote p {
  margin-bottom: 0.5em;
}

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

.article-detail .art-body code {
  background: var(--bg-hover);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--accent-soft);
}

.article-detail .art-body a {
  color: var(--accent);
  text-decoration: underline;
}

.article-detail .art-nav {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.article-detail .art-body img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 1em 0;
}

/* === Homepage Nav Cards === */

.nav-cards {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.nav-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: all 0.2s;
  display: block;
  color: var(--text);
}
.nav-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  color: var(--text);
}

.nav-card .nc-icon {
  font-size: 2rem;
  margin-bottom: 16px;
  line-height: 1;
}

.nav-card h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 8px;
}

.nav-card p {
  color: var(--text-dim);
  font-size: 0.875rem;
  line-height: 1.6;
}

.nav-card .nc-stat {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  margin: 16px 0 4px;
}
.nav-card .nc-stat-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* === Footer === */

footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
}

footer a {
  color: var(--text-dim);
}
footer a:hover { color: var(--accent); }

/* === Responsive === */

@media (max-width: 768px) {
  .hero h1 { font-size: 2.2rem; }
  .hero .stats { gap: 24px; }
  .hero .stat .number { font-size: 1.8rem; }

  .article-row {
    grid-template-columns: 40px 1fr;
  }
  .article-row .art-meta { display: none; }

  .article-detail .art-header h1 { font-size: 1.5rem; }

  .nav-cards { grid-template-columns: 1fr; }
  .leaderboard-grid { grid-template-columns: 1fr; }

  .graph-wrapper { height: 400px; }
}

@media (max-width: 480px) {
  nav.global-nav .nav-inner { flex-direction: column; height: auto; padding: 12px 0; gap: 8px; }
  .hero { padding: 48px 16px 32px; }
  .graph-wrapper { height: 320px; }
}
