/* ============ 墓园星图 ============ */
.field-controls {
  margin-bottom: 16px;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
}
.era-switch { display: flex; flex-wrap: wrap; gap: 6px; }
.era-switch button {
  padding: 8px 14px;
  border: 1px solid var(--hairline);
  background: transparent;
  font-size: 12px; color: var(--muted);
  transition: color var(--duration), background var(--duration), border-color var(--duration);
}
.era-switch button:hover { color: var(--text); border-color: var(--hairline-strong); }
.era-switch button.active { color: var(--ink); background: var(--paper); border-color: var(--paper); }
.search {
  min-width: min(320px, 100%);
  display: flex; align-items: center; gap: 10px;
  padding: 0 4px;
  border-bottom: 1px solid var(--hairline-strong);
}
.search span { color: var(--faint); }
.search input {
  width: 100%; padding: 10px 0;
  border: 0; outline: 0; background: transparent;
  font-size: 13px; color: var(--text);
}
.search input::placeholder { color: var(--faint); }

.era-context {
  margin-bottom: 16px;
  padding: 16px 22px;
  display: grid; grid-template-columns: minmax(170px, 250px) 1fr; gap: 22px; align-items: center;
  border: 1px solid var(--hairline);
  background: var(--bg-2);
}
.era-context span { font: 600 16px var(--font-display); color: var(--bronze); }
.era-context p { margin: 0; max-width: 780px; color: var(--muted); font-size: 13px; line-height: 1.8; }

.legend { display: flex; gap: 22px; font: 11px var(--font-mono); color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; }
.legend .alive { background: var(--cinnabar); box-shadow: 0 0 10px rgba(207, 74, 43, 0.6); }
.legend .mid { background: var(--text); }
.legend .cold { background: var(--faint); }

.cemetery-map {
  position: relative;
  height: 900px;
  overflow: hidden;
  border: 1px solid var(--hairline-strong);
  background:
    linear-gradient(rgba(216, 210, 195, 0.045) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(90deg, rgba(216, 210, 195, 0.04) 1px, transparent 1px) 0 0 / 20% 100%,
    linear-gradient(180deg, var(--bg-2), var(--bg-deep));
}
.depth-scale {
  position: absolute; top: 0; bottom: 34px; left: 0; z-index: 2;
  width: 62px;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 10px 8px;
  border-right: 1px solid var(--hairline);
  font: 9px var(--font-mono); color: var(--faint);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}
.year-scale {
  position: absolute; left: 62px; right: 0; bottom: 0; z-index: 2;
  height: 34px;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 10px;
  border-top: 1px solid var(--hairline);
  font: 10px var(--font-mono); color: var(--faint);
}
.nodes { position: absolute; inset: 10px 12px 46px 72px; transition: opacity 0.22s, transform 0.22s; }
.cemetery-map.changing .nodes { opacity: 0; transform: scale(0.99); }

/* 节点 = 圆点 + 标签。标签默认显示，碰撞者降级为纯圆点（dot-only） */
.word-node {
  position: absolute;
  display: flex; align-items: center; gap: 6px;
  padding: 3px 5px;
  border: 0; background: transparent;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  transition: transform 0.16s var(--ease-out);
}
.node-dot {
  flex: none;
  width: 6px; height: 6px; border-radius: 50%;
  transition: transform 0.16s var(--ease-out), box-shadow 0.16s;
}
.node-label {
  font: 500 13px/1.2 var(--font-body);
  transition: color 0.16s;
}
.word-node.dot-only { padding: 4px; }
.word-node.dot-only .node-label { display: none; }

/* 深度配色：浅埋（尚有余温）= 朱砂亮点，深埋（深度入土）= 暗淡 */
.word-node[data-depth="low"] .node-dot { background: var(--cinnabar); box-shadow: 0 0 8px rgba(207, 74, 43, 0.6); }
.word-node[data-depth="low"] .node-label { color: var(--cinnabar); }
.word-node[data-depth="mid"] .node-dot { background: var(--text); }
.word-node[data-depth="mid"] .node-label { color: var(--text); }
.word-node[data-depth="high"] .node-dot { background: var(--faint); }
.word-node[data-depth="high"] .node-label { color: var(--muted); }

/* 悬停/选中：放大圆点、强制显示入土系数徽标与标签 */
.word-node::after {
  content: attr(data-score);
  position: absolute; left: 50%; top: -14px;
  transform: translate(-50%, 4px);
  padding: 2px 5px;
  color: var(--paper); background: var(--cinnabar);
  font: 9px var(--font-mono);
  opacity: 0;
  transition: opacity 0.16s, transform 0.16s;
  pointer-events: none;
}
.word-node:hover, .word-node.active { z-index: 30; transform: translate(-50%, -50%) scale(1.18); }
.word-node:hover .node-dot, .word-node.active .node-dot {
  background: var(--paper); box-shadow: 0 0 14px rgba(234, 227, 209, 0.7);
}
.word-node:hover .node-label, .word-node.active .node-label {
  display: inline; color: var(--paper); text-shadow: 0 0 18px rgba(234, 227, 209, 0.5);
}
.word-node:hover::after, .word-node.active::after { opacity: 1; transform: translate(-50%, 0); }
/* dot-only 悬停时把标签浮在圆点右侧，避免撑开布局影响邻点 */
.word-node.dot-only:hover .node-label, .word-node.dot-only.active .node-label {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  padding: 2px 6px; background: color-mix(in srgb, var(--bg) 80%, transparent); border-radius: 3px;
}
.map-empty {
  position: absolute; inset: 0; z-index: 3;
  place-items: center;
  font: 26px var(--font-kai); color: var(--faint);
}
.map-empty:not([hidden]) { display: grid; }
.map-note { margin: 14px 0 0; font-size: 12px; color: var(--faint); }

/* ============ 遗骸名录（登记簿） ============ */
.ledger-head {
  display: grid;
  grid-template-columns: 64px 1fr 200px 64px 140px 170px;
  gap: 16px;
  padding: 0 10px 12px;
  border-bottom: 1px solid var(--hairline-strong);
  font: 10px var(--font-mono); letter-spacing: 0.16em; color: var(--faint);
}
.word-index { display: grid; }
.ledger-row {
  display: grid;
  grid-template-columns: 64px 1fr 200px 64px 140px 170px;
  gap: 16px; align-items: center;
  padding: 14px 10px;
  border: 0; border-bottom: 1px solid var(--hairline);
  background: transparent;
  text-align: left;
  transition: background var(--duration), color var(--duration);
}
.ledger-row:hover { background: var(--paper); }
.ledger-row:hover .lr-name { color: var(--ink); }
.ledger-row:hover .lr-num { color: var(--cinnabar-deep); }
.ledger-row:hover .lr-era, .ledger-row:hover .lr-peak, .ledger-row:hover .lr-state { color: #55503e; }
.lr-num { font: 11px var(--font-mono); color: var(--cinnabar); }
.lr-name { font: 600 19px var(--font-display); color: var(--paper); transition: color var(--duration); }
.lr-era, .lr-peak, .lr-state { font-size: 12px; color: var(--muted); transition: color var(--duration); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lr-burial { display: flex; align-items: center; gap: 12px; }
.lr-burial i { flex: 1; height: 3px; background: var(--hairline); position: relative; }
.lr-burial i::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p);
  background: var(--cinnabar);
}
.lr-burial b { min-width: 30px; font: 600 15px var(--font-display); color: var(--paper); text-align: right; }
.ledger-row:hover .lr-burial b { color: var(--ink); }
.index-meta { font: 12px var(--font-mono); color: var(--muted); }
.index-meta strong { color: var(--cinnabar); font-size: 20px; }

/* ============ 尸检报告（纸质卷宗） ============ */
.backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(8, 7, 6, 0.7);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.autopsy {
  position: fixed; inset: 0 0 0 auto; z-index: 90;
  width: min(700px, 100%);
  padding: 60px clamp(24px, 5vw, 64px) 80px;
  overflow-y: auto;
  color: var(--ink);
  background: linear-gradient(170deg, var(--paper) 0%, var(--paper-2) 100%);
  box-shadow: -40px 0 120px rgba(0, 0, 0, 0.6);
  transform: translateX(103%);
  transition: transform 0.4s var(--ease-out);
}
body.open { overflow: hidden; }
.open .autopsy { transform: none; }
.open .backdrop { opacity: 1; pointer-events: auto; }
.autopsy .close {
  position: absolute; top: 18px; right: 20px;
  width: 42px; height: 42px;
  border: 1px solid var(--ink-hairline); background: transparent;
  font-size: 22px; color: var(--ink);
  transition: background var(--duration), color var(--duration);
}
.autopsy .close:hover { background: var(--ink); color: var(--paper); }

.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-right: 52px; }
.report-code { font: 10px var(--font-mono); letter-spacing: 0.16em; color: var(--cinnabar-deep); }
.report-title {
  margin: 28px 0 8px;
  font: 700 clamp(52px, 9vw, 92px)/1.1 var(--font-display);
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}
.report-era { margin: 0; font: 11px var(--font-mono); letter-spacing: 0.1em; color: #6b6552; }
.burial-score {
  margin: 34px 0;
  padding: 26px 0;
  display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center;
  border-block: 1px solid var(--ink-hairline);
}
.score-ring {
  --score: 50;
  position: relative;
  width: 118px; aspect-ratio: 1;
  display: grid; place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--cinnabar-deep) calc(var(--score) * 1%), rgba(26, 24, 19, 0.12) 0);
}
.score-ring::before {
  content: "";
  position: absolute; width: 88px; aspect-ratio: 1;
  border-radius: 50%;
  background: var(--paper);
}
.score-ring b { z-index: 1; font: 700 26px var(--font-display); }
.score-copy small { font: 10px var(--font-mono); letter-spacing: 0.14em; color: #6b6552; }
.score-copy strong { display: block; margin: 6px 0 10px; font: 700 28px var(--font-display); }
.score-copy .epitaph { margin: 0; font: 15px/1.9 var(--font-kai); color: #45412f; }

.block-label { display: block; margin-bottom: 10px; font: 10px var(--font-mono); letter-spacing: 0.16em; color: var(--cinnabar-deep); }
.story-section { margin: 38px 0; }
.story-section > h3 { margin: 0 0 24px; font: 600 24px/1.7 var(--font-display); }
.story-flow { display: grid; border-left: 1px solid rgba(26, 24, 19, 0.4); }
.story-flow article { position: relative; padding: 0 0 26px 26px; }
.story-flow article::before {
  content: "";
  position: absolute; left: -5px; top: 7px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--cinnabar-deep);
}
.story-flow b { display: block; margin-bottom: 6px; font: 600 15px var(--font-display); }
.story-flow p { margin: 0; color: #4d4839; font-size: 14px; line-height: 1.9; }

.civilization-record { margin: 38px 0; padding-top: 26px; border-top: 2px solid var(--ink); }
.record-grid { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--ink-hairline); }
.record-grid article { padding: 16px 18px 16px 0; border-bottom: 1px solid var(--ink-hairline); }
.record-grid article:nth-child(even) { padding-left: 18px; border-left: 1px solid var(--ink-hairline); }
.record-grid small { display: block; margin-bottom: 8px; font-size: 11px; color: #6b6552; }
.record-grid strong { font: 600 14px/1.7 var(--font-body); }

.autopsy-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--ink-hairline); }
.autopsy-grid article { padding: 20px 18px 20px 0; border-bottom: 1px solid var(--ink-hairline); }
.autopsy-grid article:nth-child(even) { padding-left: 18px; border-left: 1px solid var(--ink-hairline); }
.autopsy-grid span { font: 10px var(--font-mono); letter-spacing: 0.12em; color: var(--cinnabar-deep); }
.autopsy-grid h3 { margin: 8px 0; font: 600 20px var(--font-display); }
.autopsy-grid p { margin: 0; font-size: 13px; line-height: 1.8; color: #4d4839; }
.report-tags { margin-top: 26px; font: 12px/2 var(--font-body); color: #6b6552; }

/* ---- 访客补录（评论区，纸质卷宗内） ---- */
.comments { margin-top: 40px; padding-top: 26px; border-top: 2px solid var(--ink); }
.comments-intro { margin: 8px 0 22px; font: 14px/1.8 var(--font-kai); color: #4d4839; }
.comments-intro b { color: var(--cinnabar-deep); font-weight: 600; }

.comment-state, .comment-count { margin: 0 0 14px; font: 12px var(--font-mono); color: #6b6552; }
.comment-count { letter-spacing: 0.08em; }

.comment-item { padding: 14px 0; border-bottom: 1px solid var(--ink-hairline); }
.comment-item:first-of-type { border-top: 1px solid var(--ink-hairline); }
.comment-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.comment-head b { font: 600 14px var(--font-display); color: var(--ink); }
.comment-head span { font: 10px var(--font-mono); color: #8a8472; flex: none; }
.comment-body { margin: 0; font: 14px/1.85 var(--font-body); color: #3f3b2f; overflow-wrap: anywhere; }

.comment-form { margin-top: 24px; }
.cf-row { display: flex; gap: 12px; }
.cf-nickname {
  width: 100%; max-width: 260px; padding: 9px 12px;
  border: 1px solid var(--ink-hairline); border-radius: 3px;
  background: rgba(255, 255, 255, 0.35);
  font: 13px var(--font-body); color: var(--ink);
}
/* 蜜罐：移出可视区，对真人不可见、对机器人可填 */
.cf-website { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cf-body {
  display: block; width: 100%; min-height: 92px; margin-top: 12px; padding: 11px 12px;
  border: 1px solid var(--ink-hairline); border-radius: 3px;
  background: rgba(255, 255, 255, 0.35);
  font: 14px/1.7 var(--font-body); color: var(--ink); resize: vertical;
}
.cf-nickname:focus, .cf-body:focus { outline: 0; border-color: var(--cinnabar); background: rgba(255, 255, 255, 0.6); }
.cf-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; }
.cf-hint { font: 12px var(--font-mono); color: var(--cinnabar-deep); line-height: 1.5; }
.cf-submit {
  flex: none; padding: 10px 22px;
  border: 1px solid var(--ink); border-radius: 3px;
  background: var(--ink); color: var(--paper);
  font: 13px var(--font-body); letter-spacing: 0.08em;
  transition: background 0.2s var(--ease-out), color 0.2s, opacity 0.2s;
}
.cf-submit:hover { background: var(--cinnabar); border-color: var(--cinnabar); }
.cf-submit:disabled { opacity: 0.5; cursor: progress; }
