/* 葬AI Web4 —— 灵堂黑红/报纸版 */
:root {
  --bg: #0b0a0a;
  --bg-soft: #151313;
  --bg-paper: #f4efe6;
  --ink: #f4efe6;
  --ink-dim: #b7ada0;
  --ink-mute: #796f66;
  --red: #d72828;
  --red-blood: #a01818;
  --gold: #c9a84a;
  --line: #2a2624;
  --paper-line: #cfc6b8;
  --serif: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --hei: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); font-family: var(--hei); -webkit-font-smoothing: antialiased; }
body.paper { background: var(--bg-paper); color: #1a1612; }
a { color: inherit; text-decoration: none; }

/* ===== 顶部导航 ===== */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11,10,10,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
body.paper .topbar { background: rgba(244,239,230,.92); border-color: var(--paper-line); }
.topbar-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
}
.brand {
  font-family: var(--serif);
  font-size: 22px; font-weight: 900; letter-spacing: 2px;
  display: flex; align-items: center; gap: 10px;
}
.brand .zang { color: var(--red); }
.brand .stamp {
  display: inline-block; font-size: 11px; letter-spacing: 1px;
  border: 1.5px solid var(--red); color: var(--red);
  padding: 2px 6px; transform: rotate(-3deg);
  font-family: var(--hei); font-weight: 700;
}
body.paper .brand .zang { color: var(--red-blood); }
.nav-links { display: flex; gap: 24px; font-size: 14px; }
.nav-links a {
  color: var(--ink-dim); position: relative; padding: 6px 2px;
  transition: color .2s;
}
body.paper .nav-links a { color: #5a4f44; }
.nav-links a:hover, .nav-links a.active { color: var(--red); }
body.paper .nav-links a:hover, body.paper .nav-links a.active { color: var(--red-blood); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--red);
}
body.paper .nav-links a.active::after { background: var(--red-blood); }

/* ===== 首页 Hero ===== */
.hero {
  max-width: 1200px; margin: 0 auto; padding: 80px 24px 60px;
  text-align: center; position: relative;
}
.hero::before {
  content: "奠"; position: absolute; top: 30px; left: 50%; transform: translateX(-50%);
  font-family: var(--serif); font-size: 380px; font-weight: 900;
  color: rgba(215,40,40,.04); pointer-events: none; line-height: 1;
}
.hero h1 {
  font-family: var(--serif); font-size: 84px; font-weight: 900;
  letter-spacing: 6px; line-height: 1.1; margin-bottom: 20px;
  position: relative;
}
.hero h1 .red { color: var(--red); }
.hero .subtitle {
  font-size: 17px; color: var(--ink-dim); max-width: 680px; margin: 0 auto 36px;
  line-height: 1.8;
}
.hero .tag-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }
.hero .tag {
  border: 1px solid var(--line); padding: 6px 14px; font-size: 13px; color: var(--ink-dim);
  border-radius: 2px;
}
.hero .tag.hot { border-color: var(--red); color: var(--red); }

.cta-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; font-size: 15px; font-weight: 700;
  border: 1px solid var(--red); color: var(--red);
  transition: all .2s; letter-spacing: 2px;
  background: transparent; cursor: pointer;
}
.btn:hover { background: var(--red); color: #fff; }
.btn.primary { background: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-blood); border-color: var(--red-blood); }
.btn.ghost { border-color: var(--ink-mute); color: var(--ink-dim); }
.btn.ghost:hover { border-color: var(--ink-dim); color: var(--ink); background: transparent; }

/* ===== 统计条 ===== */
.stats {
  max-width: 1200px; margin: 0 auto; padding: 0 24px 80px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stat { padding: 36px 20px; text-align: center; border-right: 1px solid var(--line); }
.stat:last-child { border-right: none; }
.stat .num { font-family: var(--serif); font-size: 56px; font-weight: 900; color: var(--red); line-height: 1; }
.stat .lbl { font-size: 13px; color: var(--ink-mute); margin-top: 8px; letter-spacing: 2px; }

/* ===== 文章块（首页） ===== */
section.block { max-width: 1200px; margin: 0 auto; padding: 60px 24px; }
.section-title {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 32px; padding-bottom: 12px; border-bottom: 2px solid var(--line);
}
.section-title h2 {
  font-family: var(--serif); font-size: 32px; font-weight: 900; letter-spacing: 3px;
}
.section-title h2::before { content: "▎"; color: var(--red); margin-right: 8px; }
.section-title .more { font-size: 13px; color: var(--ink-mute); }
.section-title .more:hover { color: var(--red); }

.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.article-card {
  border: 1px solid var(--line); padding: 24px;
  transition: all .25s; background: var(--bg-soft);
  display: flex; flex-direction: column; min-height: 220px;
}
.article-card:hover { border-color: var(--red); transform: translateY(-3px); }
.article-card .meta { display: flex; gap: 12px; font-size: 12px; color: var(--ink-mute); margin-bottom: 14px; }
.article-card .meta .author { color: var(--red); }
.article-card h3 {
  font-family: var(--serif); font-size: 20px; font-weight: 700; line-height: 1.5;
  margin-bottom: 14px; flex: 1;
}
.article-card .excerpt {
  font-size: 13px; color: var(--ink-dim); line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== 页脚 ===== */
footer {
  max-width: 1200px; margin: 80px auto 0; padding: 40px 24px;
  border-top: 1px solid var(--line);
  text-align: center; font-size: 12px; color: var(--ink-mute);
  letter-spacing: 1px;
}
footer .motto {
  font-family: var(--serif); font-size: 18px; color: var(--ink-dim);
  margin-bottom: 12px; letter-spacing: 4px;
}

/* ===== 文章列表页 ===== */
.page-head {
  max-width: 1200px; margin: 0 auto; padding: 60px 24px 30px;
  border-bottom: 1px solid var(--line);
}
.page-head h1 {
  font-family: var(--serif); font-size: 52px; font-weight: 900; letter-spacing: 4px;
}
.page-head h1::before { content: "■ "; color: var(--red); }
.page-head p { color: var(--ink-dim); margin-top: 12px; font-size: 15px; }
.article-list { max-width: 1200px; margin: 0 auto; padding: 40px 24px; }
.filters {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
  margin-bottom: 32px;
}
.filters input[type=text] {
  flex: 1; min-width: 240px;
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--ink);
  padding: 10px 14px; font-size: 14px; font-family: inherit;
}
.filters input[type=text]:focus { outline: none; border-color: var(--red); }
.filters select, .filters button {
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--ink);
  padding: 10px 14px; font-size: 13px; font-family: inherit; cursor: pointer;
}
.filters button.lucky { border-color: var(--red); color: var(--red); }

table.articles-tbl { width: 100%; border-collapse: collapse; }
table.articles-tbl th, table.articles-tbl td {
  padding: 14px 10px; text-align: left; border-bottom: 1px solid var(--line);
  font-size: 14px; vertical-align: top;
}
table.articles-tbl th {
  color: var(--ink-mute); font-weight: 400; font-size: 12px; letter-spacing: 2px;
  text-transform: uppercase;
}
table.articles-tbl td.num {
  font-family: var(--serif); font-size: 22px; color: var(--red); font-weight: 700;
  width: 70px;
}
table.articles-tbl td.date { color: var(--ink-mute); width: 110px; font-variant-numeric: tabular-nums; }
table.articles-tbl td.author {
  width: 100px;
}
table.articles-tbl td.author .tag {
  display: inline-block; font-size: 11px; padding: 2px 8px; border: 1px solid var(--line);
  color: var(--ink-dim);
}
table.articles-tbl tr { transition: background .2s; cursor: pointer; }
table.articles-tbl tr:hover { background: rgba(215,40,40,.06); }
table.articles-tbl tr:hover td.title a { color: var(--red); }
table.articles-tbl td.title a { font-family: var(--serif); font-size: 17px; font-weight: 700; line-height: 1.4; }

/* ===== 图谱页 ===== */
.graph-wrap {
  max-width: 1400px; margin: 0 auto; padding: 30px 24px;
}
.graph-layout {
  display: grid; grid-template-columns: 1fr 360px; gap: 24px;
}
.graph-canvas-wrap {
  position: relative; border: 1px solid var(--line); background: #060505;
  height: 720px; overflow: hidden;
}
#graph-canvas { width: 100%; height: 100%; display: block; cursor: grab; }
#graph-canvas:active { cursor: grabbing; }
.graph-legend {
  position: absolute; left: 14px; bottom: 14px;
  background: rgba(11,10,10,.85); border: 1px solid var(--line);
  padding: 10px 14px; font-size: 12px;
}
.legend-item { display: flex; align-items: center; gap: 8px; margin: 3px 0; color: var(--ink-dim); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.graph-controls {
  position: absolute; right: 14px; top: 14px; display: flex; gap: 6px;
}
.graph-controls button {
  background: rgba(21,19,19,.85); border: 1px solid var(--line); color: var(--ink-dim);
  width: 34px; height: 34px; font-size: 16px; cursor: pointer;
}
.graph-controls button:hover { color: var(--red); border-color: var(--red); }

.sidebar {
  display: flex; flex-direction: column; gap: 24px; max-height: 720px;
}
.leaderboard {
  border: 1px solid var(--line); background: var(--bg-soft);
  display: flex; flex-direction: column; min-height: 0;
}
.lb-tabs { display: flex; border-bottom: 1px solid var(--line); }
.lb-tab {
  flex: 1; padding: 12px 0; text-align: center; font-size: 13px;
  cursor: pointer; color: var(--ink-mute); letter-spacing: 2px;
  transition: all .2s; border-bottom: 2px solid transparent;
}
.lb-tab:hover { color: var(--ink); }
.lb-tab.active { color: var(--red); border-bottom-color: var(--red); font-weight: 700; }
.lb-body { flex: 1; overflow-y: auto; padding: 8px 0; }
.lb-item {
  display: grid; grid-template-columns: 36px 1fr auto; gap: 10px;
  padding: 10px 16px; align-items: center; cursor: pointer;
  transition: background .2s; border-bottom: 1px dashed rgba(255,255,255,.04);
}
.lb-item:hover { background: rgba(215,40,40,.08); }
.lb-item .rk {
  font-family: var(--serif); font-size: 20px; font-weight: 900; color: var(--ink-mute);
  text-align: center;
}
.lb-item.top3 .rk { color: var(--red); }
.lb-item .nm { font-size: 14px; font-weight: 700; }
.lb-item .desc { font-size: 11px; color: var(--ink-mute); margin-top: 2px; line-height: 1.4; }
.lb-item .wt { font-size: 11px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }

.node-detail {
  border: 1px solid var(--line); background: var(--bg-soft); padding: 20px;
  max-height: 320px; overflow-y: auto;
}
.node-detail h3 {
  font-family: var(--serif); font-size: 22px; font-weight: 900; margin-bottom: 6px;
}
.node-detail .type-tag {
  display: inline-block; font-size: 11px; padding: 2px 8px; border: 1px solid var(--red);
  color: var(--red); margin-bottom: 10px; letter-spacing: 1px;
}
.node-detail p { font-size: 13px; color: var(--ink-dim); line-height: 1.7; margin-bottom: 12px; }
.node-detail .metrics { display: flex; gap: 16px; font-size: 12px; color: var(--ink-mute); margin-bottom: 14px; }
.node-detail .metrics b { color: var(--red); font-family: var(--serif); font-size: 16px; }
.node-detail .links-list { font-size: 12px; }
.node-detail .links-list .lk {
  padding: 6px 0; border-bottom: 1px dashed rgba(255,255,255,.06);
  color: var(--ink-dim);
}
.node-detail .links-list .lk b { color: var(--ink); }
.node-detail .placeholder { color: var(--ink-mute); font-size: 13px; text-align: center; padding: 30px 0; }

/* ===== 文章详情页（报纸风格 paper） ===== */
.article-mast {
  max-width: 780px; margin: 0 auto; padding: 50px 24px 20px;
  text-align: center; border-bottom: 4px double #1a1612;
}
body.paper .article-mast { border-color: #1a1612; }
.article-mast .kicker {
  font-size: 12px; letter-spacing: 4px; color: var(--red-blood); margin-bottom: 20px;
}
.article-mast h1 {
  font-family: var(--serif); font-size: 42px; font-weight: 900;
  line-height: 1.3; margin-bottom: 20px; letter-spacing: 1px;
}
.article-mast .byline {
  font-size: 13px; color: #5a4f44; letter-spacing: 2px; margin-bottom: 8px;
}
.article-mast .byline .author { color: var(--red-blood); font-weight: 700; }
.article-nav {
  max-width: 780px; margin: 0 auto; padding: 16px 24px;
  display: flex; justify-content: space-between; font-size: 12px;
  color: #5a4f44; border-bottom: 1px solid var(--paper-line);
}
.article-nav a:hover { color: var(--red-blood); }

.article-body {
  max-width: 780px; margin: 0 auto; padding: 40px 24px 60px;
  font-family: var(--serif); font-size: 17px; line-height: 1.9;
  color: #1a1612;
}
.article-body h1, .article-body h2, .article-body h3, .article-body h4 {
  font-weight: 900; margin: 1.6em 0 .6em; line-height: 1.3;
}
.article-body h1 { font-size: 28px; }
.article-body h2 { font-size: 23px; border-bottom: 1px solid var(--paper-line); padding-bottom: 6px; }
.article-body h3 { font-size: 19px; }
.article-body p { margin: 1em 0; text-indent: 2em; }
.article-body ul, .article-body ol { margin: 1em 0; padding-left: 2.2em; }
.article-body li { margin: .4em 0; }
.article-body blockquote {
  border-left: 4px solid var(--red-blood); padding: 4px 16px; margin: 1.4em 0;
  color: #5a4f44; background: rgba(160,24,24,.04);
  text-indent: 0;
}
.article-body blockquote p { text-indent: 0; }
.article-body code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  background: #e9e2d4; padding: 2px 6px; font-size: 14px; border-radius: 2px;
}
.article-body pre {
  background: #1a1612; color: #f4efe6; padding: 16px; overflow-x: auto;
  margin: 1.4em 0; font-size: 13px;
}
.article-body pre code { background: transparent; color: inherit; padding: 0; }
.article-body a { color: var(--red-blood); border-bottom: 1px solid var(--red-blood); }
.article-body hr { border: none; border-top: 1px solid var(--paper-line); margin: 2em 0; }
.article-body strong { font-weight: 900; color: var(--red-blood); }
.article-body img { max-width: 100%; }
.article-body table { border-collapse: collapse; width: 100%; margin: 1em 0; text-indent: 0; }
.article-body th, .article-body td { border: 1px solid var(--paper-line); padding: 8px 12px; }

.paper-footer {
  max-width: 780px; margin: 0 auto; padding: 24px;
  border-top: 4px double #1a1612;
  text-align: center; font-size: 12px; color: #796f66;
  letter-spacing: 2px;
}

.entities-ref {
  max-width: 780px; margin: 0 auto; padding: 0 24px 60px;
}
.entities-ref h4 {
  font-family: var(--serif); font-size: 16px; margin-bottom: 12px;
  letter-spacing: 2px; color: var(--red-blood);
}
.entities-ref .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.entities-ref .chip {
  font-size: 12px; border: 1px solid #9b8f80; padding: 4px 10px; color: #5a4f44;
  cursor: default;
}
.entities-ref .chip .t { font-size: 10px; color: var(--red-blood); margin-right: 4px; }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .hero h1 { font-size: 52px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { border-right: none; border-bottom: 1px solid var(--line); }
  .stat:nth-child(2n) { border-right: none; }
  .article-grid { grid-template-columns: 1fr; }
  .graph-layout { grid-template-columns: 1fr; }
  .graph-canvas-wrap { height: 480px; }
  .sidebar { max-height: none; }
  table.articles-tbl td.num { font-size: 18px; width: 48px; }
  table.articles-tbl td.date, table.articles-tbl td.author { width: auto; }
  .article-mast h1 { font-size: 30px; }
}

/* scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); }
::-webkit-scrollbar-thumb:hover { background: var(--red); }
