﻿*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

:root {
  --bg: #1a1a1a;
  --bg-soft: #0a0a0a;
  --bg-deep: #050505;
  --fg: #d0d0d0;
  --fg-mute: #888;
  --fg-faint: #666;
  --link: #aaccff;
  --warn: #f88;
  --danger: #c66;
  --hint: #f0d090;
  --quote: #7c9;
  --border: #333;
  --border-soft: #222;
}

html, body, button, input, textarea, select, code, pre,
h1, h2, h3, h4, h5, h6, p, span, div, a, li, td, th, label, kbd {
  font-family: "MS PGothic", "ＭＳ Ｐゴシック",
               "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ Pro W3",
               "Noto Sans SC", "Microsoft YaHei", "PingFang SC",
               Arial, sans-serif;
  font-size: 13px;
  line-height: 1.55;
}

body {
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─────────────────────  网易 2003 风格门户  ───────────────────── */

.warning-bar,
.site-head,
.counter,
.titlebar,
.board-layout { max-width: 1040px; }

/* 顶部导航条 */
.topnav {
  max-width: 1040px; margin: 0 auto; padding: 6px 12px;
  background: linear-gradient(#2a2a2a, #1a1a1a);
  border: 1px solid #555; border-top: 0;
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  font-size: 12px;
}
.topnav-item {
  color: var(--fg); padding: 3px 10px;
  text-decoration: none; border: 1px solid transparent;
}
.topnav-item:hover {
  background: #000; border-color: var(--hint); color: var(--hint);
  text-decoration: none;
}
.topnav-item.active {
  background: #1a1410; color: var(--hint);
  border-color: var(--hint); font-weight: bold;
}
.topnav-icon { color: var(--hint); margin-right: 2px; }
.topnav-sep { color: #555; margin: 0 6px; }
.topnav-secret { color: var(--warn) !important; }
.topnav-secret:hover { background: #1a0a0a; border-color: var(--warn); color: var(--warn) !important; }

/* 搜索条 */
.searchbar {
  max-width: 1040px; margin: 0 auto; padding: 8px 12px;
  background: #0e0e0e; border: 1px solid var(--border); border-top: 0;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px;
}
.searchbar-label { color: var(--hint); font-weight: bold; }
.searchbar input {
  flex: 1; min-width: 200px;
  padding: 5px 8px; background: #000; border: 1px solid #444;
  color: var(--fg); font-family: inherit; font-size: 12px;
}
.searchbar input:focus { outline: 0; border-color: var(--hint); }
.searchbar button {
  background: #1a1410; border: 1px solid var(--hint); color: var(--hint);
  padding: 4px 14px; cursor: pointer; font-family: inherit; font-size: 12px;
}
.searchbar button:hover { background: #2a1f15; }
.searchbar-tip { color: var(--fg-faint); font-size: 10px; }

/* Hero 焦点 */
.hero {
  max-width: 1040px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr; gap: 12px;
  padding: 12px;
}
.hero-focus {
  background: var(--bg-soft); border: 1px solid var(--border);
  padding: 14px; min-height: 240px;
  background-image: linear-gradient(135deg, #1a1410 0%, #0a0a0a 100%);
}
.hero-tag {
  display: inline-block; color: #000; background: var(--hint);
  padding: 2px 8px; font-size: 11px; font-weight: bold;
}
.hero-title { margin: 8px 0 4px; font-size: 18px; line-height: 1.4; }
.hero-title a { color: var(--hint); }
.hero-title a:hover { color: #fff; }
.hero-meta { color: var(--fg-faint); font-size: 11px; margin-bottom: 8px; }
.hero-excerpt { color: var(--fg); font-size: 13px; line-height: 1.7; margin: 6px 0 12px; }
.hero-comments {
  background: #050505; border: 1px dotted var(--border);
  padding: 6px 10px; margin-top: 8px;
}
.hero-comments h4 { color: var(--hint); font-size: 11px; margin: 0 0 4px; }
.hero-comments ul { list-style: none; padding: 0; margin: 0; font-size: 12px; }
.hero-comments li { padding: 3px 0; border-bottom: 1px dotted #1a1a1a; }
.hero-comments .cm-author { color: var(--link); }
.hero-comments .cm-body { color: var(--fg-mute); margin-left: 4px; }
.hero-comments .cm-votes { color: var(--fg-faint); font-size: 10px; margin-left: 4px; }
.hero-comments .cm-empty { color: var(--fg-faint); }
.hero-cta {
  display: inline-block; margin-top: 10px;
  background: var(--bg-deep); border: 1px solid var(--hint);
  color: var(--hint); padding: 4px 14px; font-size: 12px;
}
.hero-cta:hover { background: #1a1410; text-decoration: none; }

.hero-sub {
  background: var(--bg-soft); border: 1px solid var(--border);
  padding: 10px;
}
.block-head {
  margin: 0 0 6px; font-size: 12px; color: var(--hint);
  border-bottom: 1px dotted var(--border); padding-bottom: 4px;
}
.hero-sub-list { list-style: none; padding: 0; margin: 0; }
.hero-sub-list li {
  display: grid; grid-template-columns: 60px 1fr 40px; gap: 6px;
  padding: 4px 0; border-bottom: 1px dotted #1a1a1a; font-size: 12px;
  align-items: baseline;
}
.hero-sub-list .num { color: var(--fg-faint); }
.hero-sub-list .meta { color: var(--fg-faint); text-align: right; font-size: 10px; }
.hero-sub-list .is-main { color: var(--hint); }
/* (保留兼容：原 .is-main 标记已被 .is-hot 取代) */

/* 三栏门户：主区 + 侧栏 */
.portal {
  max-width: 1040px; margin: 0 auto; padding: 0 12px 12px;
  display: grid; grid-template-columns: 1fr 240px; gap: 12px;
}
.portal-main { display: flex; flex-direction: column; gap: 12px; }
.portal-side { display: flex; flex-direction: column; gap: 10px; }

/* 板块块 */
.portal-block {
  background: var(--bg-soft); border: 1px solid var(--border);
  padding: 8px 10px;
}
.portal-block-head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 2px solid #444; padding-bottom: 4px; margin-bottom: 6px;
}
.portal-block-head h2 {
  margin: 0; font-size: 14px; color: var(--hint);
  letter-spacing: .05em;
}
.portal-block-head .more { color: var(--fg-faint); font-size: 11px; }
.portal-block-head .more:hover { color: var(--hint); }
.block-tip {
  font-size: 11px; color: var(--fg-faint); margin-top: 6px;
  background: #0a0805; border-left: 2px solid var(--hint);
  padding: 4px 8px;
}

/* 帖子卡片网格 */
.thread-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px;
}
.thread-grid-main { grid-template-columns: 1fr; }
.thread-card {
  display: grid; grid-template-columns: 56px 1fr; gap: 6px;
  padding: 5px 4px; border-bottom: 1px dotted #222;
  transition: background .1s;
}
.thread-card:hover { background: #111; }
.thread-card-num {
  color: var(--fg-faint); font-size: 11px; text-align: right;
  padding-top: 2px;
}
.thread-card-title {
  color: var(--link); text-decoration: none; font-size: 13px;
  display: block; line-height: 1.4;
}
.thread-card-title:hover { text-decoration: underline; color: #fff; }
/* 热门帖子：左侧金边 + 标题加粗金色（不再绑定 main 标记） */
.thread-card.is-hot .thread-card-title { color: var(--hint); font-weight: bold; }
.thread-card.is-hot { border-left: 2px solid var(--hint); padding-left: 6px; }
.thread-card-meta {
  font-size: 10px; color: var(--fg-faint); margin-top: 2px;
}
.thread-card-meta .author { color: var(--fg-mute); }
.thread-card-meta .trip { color: #c8a060; }
.thread-card-meta .id { color: #888; margin-left: 2px; }
.thread-card-meta .dot { margin: 0 4px; color: #444; }
.thread-card-meta .replies { color: #6a8; }
.thread-card-meta .badge-hot {
  margin-left: 6px; background: #1a1410; border: 1px solid var(--hint);
  color: var(--hint); padding: 0 4px; font-size: 9px;
}

/* 公告列表 */
.announce-list { list-style: none; padding: 0; margin: 0; }
.announce-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0; border-bottom: 1px dotted #1a1a1a; font-size: 12px;
}
.announce-list .ann-tag {
  background: #1a1410; border: 1px solid var(--hint); color: var(--hint);
  padding: 0 6px; font-size: 10px; min-width: 28px; text-align: center;
}
.announce-list .ann-tag + .ann-tag { background: #0a0a0a; border-color: #555; color: #888; }
.announce-list a { color: var(--link); flex: 1; }
.announce-list .meta { color: var(--fg-faint); font-size: 10px; }

/* 友情链接 */
.friend-links { background: #0a0a0a; }
.friend-text { font-size: 12px; line-height: 1.8; color: var(--fg-mute); margin: 4px 0; }
.friend-text a { color: var(--link); margin: 0 4px; }

/* 侧栏块 */
.side-block {
  background: var(--bg-soft); border: 1px solid var(--border);
  padding: 8px 10px; font-size: 12px;
}
.side-block h3 {
  margin: 0 0 6px; font-size: 12px; color: var(--hint);
  border-bottom: 1px dotted var(--border); padding-bottom: 3px;
  letter-spacing: .05em;
}

/* 跟贴排行 */
.side-rank { list-style: none; padding: 0; margin: 0; counter-reset: rank; }
.side-rank li {
  display: grid; grid-template-columns: 22px 1fr 40px; gap: 6px;
  padding: 3px 0; border-bottom: 1px dotted #1a1a1a; font-size: 12px;
  align-items: baseline;
}
.side-rank .rank-no {
  background: #333; color: #fff; text-align: center;
  font-size: 10px; font-weight: bold; padding: 1px 0;
}
.side-rank li:nth-child(1) .rank-no { background: #c33; }
.side-rank li:nth-child(2) .rank-no { background: #c84; }
.side-rank li:nth-child(3) .rank-no { background: #68a; }
.side-rank a { color: var(--link); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-rank .rank-replies { color: var(--fg-faint); font-size: 10px; text-align: right; }

/* 新到访客 */
.side-users { list-style: none; padding: 0; margin: 0; }
.side-user {
  display: grid; grid-template-columns: 22px 1fr auto; gap: 6px;
  padding: 3px 0; border-bottom: 1px dotted #1a1a1a; font-size: 12px;
  align-items: center;
}
.side-user .avatar {
  background: #222; border: 1px solid #444; color: var(--hint);
  width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
  font-size: 10px;
}
.side-user .name { color: var(--fg-mute); }
.side-user .trip { color: #c8a060; font-size: 10px; }
.side-user.is-founder { background: #1a0a0a; }
.side-user.is-founder .avatar { background: #5a2020; border-color: var(--warn); color: var(--warn); }
.side-user.is-founder .name { color: var(--warn); font-weight: bold; }

/* 站务统计 */
.side-stats { width: 100%; border-collapse: collapse; font-size: 11px; }
.side-stats td { padding: 3px 4px; border-bottom: 1px dotted #1a1a1a; }
.side-stats td:first-child { color: var(--fg-faint); width: 90px; }
.side-stats td:last-child { color: var(--fg-mute); text-align: right; }
.side-stats .live { color: #9c6; font-weight: bold; }
.side-stats .founder { color: #c8a060; }

/* 站长寄语 */
.side-fade p { color: var(--fg-mute); font-size: 11px; line-height: 1.7; margin: 4px 0; }
.side-fade .signature {
  text-align: right; color: #c8a060; font-style: italic; margin-top: 6px;
}

/* 空状态 */
.empty-block {
  padding: 30px; text-align: center; color: var(--fg-mute);
  background: #0a0a0a; border: 1px dotted var(--border); margin: 10px 0;
}
.empty-block p { margin: 4px 0; }

/* Home / list (旧版兼容) */
.unknown-route { padding: 40px; text-align: center; color: var(--fg-mute); }

/* Thread detail */
.thread-missing { padding: 40px; text-align: center; color: var(--fg-mute); }

/* 帖子页布局 */
.thread-layout {
  max-width: 1040px; margin: 0 auto; padding: 0 12px;
  display: grid; grid-template-columns: 1fr 240px; gap: 12px;
}
.thread-main { display: flex; flex-direction: column; gap: 10px; }
.thread-side { display: flex; flex-direction: column; gap: 10px; }

.post {
  padding: 14px; background: var(--bg-soft); border: 1px solid var(--border);
}
.post-head {
  font-size: 11px; color: #777; margin-bottom: 6px;
  display: flex; justify-content: space-between; gap: 8px;
}
.post-head .author { color: var(--link); }
.post-head .trip { color: #c8a060; margin-left: 4px; }
.post-head .id { color: #888; margin-left: 6px; }
.post-body {
  font-size: 13px; color: var(--fg); line-height: 1.7;
  white-space: normal;
}
.post-actions {
  margin-top: 12px; padding-top: 10px;
  border-top: 1px dotted var(--border);
  display: flex; gap: 8px; flex-wrap: wrap;
}
.post-actions button {
  background: var(--bg-deep); border: 1px solid var(--border);
  color: var(--fg); padding: 4px 10px; font-size: 11px;
  cursor: pointer; font-family: inherit;
}
.post-actions button:hover { border-color: var(--hint); color: var(--hint); }

/* 跟贴区 */
.comments-block {
  background: var(--bg-soft); border: 1px solid var(--border);
  padding: 8px 12px;
}
.comments-block-head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 2px solid #444; padding-bottom: 4px; margin-bottom: 6px;
}
.comments-block-head h2 {
  margin: 0; font-size: 14px; color: var(--hint); letter-spacing: .05em;
}
.sort-tip { font-size: 11px; color: var(--fg-faint); }
.comments-list { list-style: none; padding: 0; margin: 0; }
.comment {
  display: grid; grid-template-columns: 36px 1fr; gap: 8px;
  padding: 10px 4px; border-bottom: 1px dotted #1a1a1a;
}
.comment:hover { background: #0a0a0a; }
.comment.is-op { background: #0e0a05; }
.comment.is-mine { background: #0a0e05; }
.comment-num {
  color: var(--fg-faint); text-align: right; font-size: 11px; padding-top: 2px;
}
.comment-body { font-size: 13px; }
.comment-head {
  display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap;
  font-size: 11px; color: var(--fg-faint); margin-bottom: 4px;
}
.comment-head .cm-author { color: var(--link); font-weight: bold; }
.comment-head .trip { color: #c8a060; }
.comment-head .cm-id { color: #888; }
.comment-head .cm-date { color: #555; margin-left: auto; }
.comment-head .cm-op {
  background: #2a1f15; border: 1px solid var(--hint); color: var(--hint);
  padding: 0 4px; font-size: 9px;
}
.comment-text { color: var(--fg); line-height: 1.7; white-space: pre-wrap; }
.comment-foot {
  margin-top: 4px; font-size: 11px; color: var(--fg-faint);
  display: flex; gap: 10px;
}
.comment-foot a { color: var(--link); }
.comment-foot a:hover { color: var(--hint); }
.comment-foot .cm-votes { color: #6a8; }

/* 跟贴表单 */
.comment-form {
  background: #0a0a0a; border: 1px dotted var(--border);
  padding: 8px 10px; margin-top: 8px;
}
.comment-form p { margin: 0 0 6px; color: var(--hint); font-size: 11px; }
.comment-form textarea {
  width: 100%; background: #000; border: 1px solid #444; color: var(--fg);
  font-family: inherit; font-size: 12px; padding: 6px; resize: vertical;
}
.comment-form textarea:focus { outline: 0; border-color: var(--hint); }
.comment-form-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 6px;
}
.comment-submit {
  background: #1a1410; border: 1px solid var(--hint); color: var(--hint);
  padding: 4px 14px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.comment-submit:hover { background: #2a1f15; }
.comment-tip { font-size: 10px; color: var(--fg-faint); }

.back-link { padding: 12px 14px; max-width: 1040px; margin: 0 auto; }
.back-link a { color: var(--link); font-size: 12px; }

/* HUD */
.hud {
  position: fixed; top: 8px; right: 12px; z-index: 100;
  background: var(--bg-soft); border: 1px solid #555; color: #888;
  padding: 4px 10px; font-size: 11px; letter-spacing: .05em;
  box-shadow: 1px 1px 0 #000;
  display: flex; gap: 12px; align-items: center;
}
.hud-player { color: var(--fg-mute); }
.hud-san { font-weight: bold; font-size: 14px; cursor: pointer; }
.hud-mute {
  background: transparent; border: 1px solid #444; color: var(--fg-mute);
  padding: 2px 6px; cursor: pointer; font-family: inherit;
}
.hud-mute:hover { color: var(--hint); border-color: var(--hint); }
.hud[data-threshold="anxious"] .hud-san { animation: blink 1s infinite; }
.hud[data-threshold="panicked"] .hud-san { color: var(--danger) !important; }
.hud[data-threshold="lost"] .hud-san { color: #a48 !important; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Modal */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center; z-index: 200;
}
.modal {
  background: var(--bg-soft); border: 1px solid #555; padding: 20px;
  max-width: 400px; width: 90%;
  box-shadow: 0 0 0 1px #000, 0 0 30px rgba(0,0,0,0.7);
  animation: modalIn .18s ease-out;
}
@keyframes modalIn {
  from { transform: scale(0.96); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.modal h3 { color: var(--hint); margin: 0 0 10px; font-size: 14px; }
.modal p { margin: 0 0 12px; font-size: 12px; color: var(--fg-mute); }
.modal input {
  width: 100%; padding: 6px 8px; background: var(--bg-deep);
  border: 1px solid #444; color: var(--fg); font-family: inherit;
  font-size: 13px; margin-bottom: 10px;
}
.modal .suggestions { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.modal .suggestions button {
  background: var(--bg-deep); border: 1px solid #444; color: var(--fg);
  padding: 3px 8px; font-size: 11px; cursor: pointer; font-family: inherit;
}
.modal .suggestions button:hover { border-color: var(--hint); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.modal-actions button {
  background: var(--bg-soft); border: 1px solid var(--border);
  color: var(--fg); padding: 4px 12px; font-size: 12px;
  cursor: pointer; font-family: inherit;
}
.modal-actions button:hover { border-color: var(--hint); }

/* Dice modal */
.dice-modal { text-align: center; min-width: 280px; }
.dice-rolling {
  font-size: 48px; padding: 20px; color: var(--hint);
  display: inline-block;
  animation: diceShake .12s infinite linear;
  text-shadow: 0 0 8px rgba(240, 208, 144, 0.4);
}
@keyframes diceShake {
  0%   { transform: translate(-2px, -1px) rotate(-2deg); }
  25%  { transform: translate( 2px,  1px) rotate( 1deg); }
  50%  { transform: translate(-1px,  2px) rotate(-1deg); }
  75%  { transform: translate( 1px, -2px) rotate( 2deg); }
  100% { transform: translate(-2px,  1px) rotate(-1deg); }
}
.dice-final { font-size: 64px; font-weight: bold; padding: 10px 0; }
.dice-final.dice-success { color: #9c6; }
.dice-final.dice-fail { color: var(--danger); }
.dice-final.dice-crit { color: #ff8; text-shadow: 0 0 12px rgba(255,200,80,0.5); }
.dice-final.dice-fumble { color: #a48; }
.dice-hint { color: var(--fg-faint); font-size: 11px; }
.dice-result { padding: 16px 0; }
.dice-num { font-size: 64px; font-weight: bold; line-height: 1; }
.dice-total { font-size: 14px; color: var(--fg-mute); margin-top: 6px; }
.dice-verdict { margin-top: 12px; font-size: 18px; font-weight: bold; }
.dice-result.hit .dice-num, .dice-result.hit .dice-verdict { color: var(--hint); }
.dice-result.crit .dice-num, .dice-result.crit .dice-verdict { color: #9c6; animation: pulse 0.5s infinite alternate; }
.dice-result.fail .dice-num, .dice-result.fail .dice-verdict { color: var(--danger); }
.dice-result.fumble .dice-num, .dice-result.fumble .dice-verdict { color: #a48; }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.05); } }

/* Board 4 */
.board4-shell {
  padding: 14px; border: 2px dashed #a06060; background: #0a0606;
  margin: 14px auto; max-width: 720px;
}
.board4-shell h2 { color: var(--warn); margin: 0 0 8px; }
.board4-shell .warn {
  color: var(--warn); font-size: 11px; border: 1px solid #a06060;
  padding: 4px 8px; display: inline-block; margin-bottom: 10px;
}
.board4-shell input {
  background: var(--bg-deep); border: 1px solid #444; color: var(--hint);
  padding: 6px; font-family: inherit; font-size: 13px; width: 220px; margin-right: 8px;
}
.board4-shell button {
  background: var(--bg-soft); border: 1px solid var(--hint); color: var(--hint);
  padding: 4px 14px; cursor: pointer; font-family: inherit;
}
.board4-post {
  background: #0a0606; border: 1px solid #5a2020; padding: 10px;
  margin: 8px 0; color: #c0a0a0;
}
.board4-post.unlocked { border-color: var(--warn); color: var(--warn); }
.board4-post pre { white-space: pre-wrap; font-family: inherit; margin: 0; }
.board4-image {
  padding: 20px; text-align: center; color: var(--hint); font-style: italic;
  border: 1px dotted #5a2020; margin: 8px 0;
}
.board4-actions button {
  background: var(--bg-soft); border: 1px solid #5a2020; color: #c0a0a0;
  padding: 4px 12px; cursor: pointer; font-family: inherit; font-size: 12px;
}

/* Endings */
.ending { padding: 40px; text-align: center; min-height: 60vh; }
.ending h2 { color: var(--hint); font-size: 28px; margin-bottom: 20px; }
.ending-body {
  max-width: 600px; margin: 0 auto; text-align: left;
  color: var(--fg); line-height: 1.8;
}
.ending-body p { margin: 8px 0; }
.ending-D { background: #0a0606; min-height: 100vh; color: #a06060; }
.ending-D h2 { color: #a06060; }

/* C ending */
.c-stage { padding: 30px; text-align: center; }
.c-btn {
  background: #1a1410; border: 1px solid var(--hint); color: var(--hint);
  padding: 8px 24px; font-size: 16px; cursor: pointer; margin: 0 8px; font-family: inherit;
}
.c-reject { background: #0a0a0a; border-color: #888; color: #888; }
.c-accept.giant {
  padding: 20px 60px; font-size: 24px; background: #1a0a0a;
  border: 2px solid var(--warn); color: var(--warn);
  animation: pulse 1s infinite;
}
.c-reject.tiny { padding: 2px 6px; font-size: 10px; }
.c-hint { color: var(--fg-faint); font-size: 12px; margin-top: 16px; }
.welcome-c {
  position: fixed; inset: 0; background: #000; color: var(--warn);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; letter-spacing: .3em; z-index: 500;
}
.c-bottom {
  position: fixed; bottom: 20px; left: 0; right: 0; text-align: center;
  color: #a06060; font-size: 12px; background: #0a0606; padding: 10px;
  border-top: 1px solid #a06060;
}

/* ============================================
   Board 4 · 密码解锁流程
   ============================================ */
.board4 {
  max-width: 760px;
  margin: 24px auto;
  padding: 0 16px;
  color: var(--fg);
}
.board4-header {
  border-bottom: 1px solid #5a2020;
  padding-bottom: 12px;
  margin-bottom: 20px;
}
.board4-title {
  margin: 0;
  font-size: 18px;
  color: #e0c0a0;
}
.board4-status {
  color: #c05050;
  font-weight: bold;
  font-family: monospace;
  letter-spacing: 0.1em;
}
.board4-subtitle {
  font-size: 12px;
  color: var(--fg-mute);
  margin-top: 6px;
}

.board4-warning {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(90, 32, 32, 0.15);
  border: 1px dashed #5a2020;
  padding: 14px 16px;
  margin: 16px 0;
  border-radius: 2px;
}
.board4-warning-icon {
  font-size: 22px;
  color: #c05050;
  line-height: 1.2;
}
.board4-warning-text {
  font-size: 13px;
  line-height: 1.7;
  color: #d0b0a0;
}

.board4-progress {
  margin: 20px 0;
}
.board4-progress-label {
  font-size: 12px;
  color: var(--fg-mute);
  margin-bottom: 6px;
  font-family: monospace;
}
.board4-progress-label strong {
  color: #e0c080;
  font-size: 14px;
}
.board4-progress-bar {
  height: 6px;
  background: #2a1a14;
  border: 1px solid #5a3030;
  overflow: hidden;
  border-radius: 2px;
}
.board4-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #c0a060, #c05050);
  transition: width 0.6s ease;
  box-shadow: 0 0 8px rgba(192, 80, 80, 0.6);
}

.board4-slots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 24px 0;
}
.board4-slot {
  width: 52px;
  height: 64px;
  border: 2px solid #5a3030;
  background: #1a1410;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Courier New', monospace;
  font-size: 32px;
  color: var(--fg-faint);
  transition: all 0.4s ease;
  border-radius: 2px;
}
.board4-slot.filled {
  border-color: #c08040;
  color: #e0c080;
  background: #2a1a14;
  box-shadow: 0 0 14px rgba(192, 128, 64, 0.5), inset 0 0 12px rgba(192, 80, 64, 0.2);
  animation: slot-fill 0.4s ease;
}
@keyframes slot-fill {
  0% { transform: scale(1.3); }
  50% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

.board4-post-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}
.board4-post-item {
  padding: 8px 0;
  border-bottom: 1px dotted #3a2a20;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.board4-post-mark {
  font-family: monospace;
  font-size: 14px;
  width: 18px;
  text-align: center;
}
.board4-post-item.found .board4-post-mark {
  color: #80c080;
}
.board4-post-item:not(.found) .board4-post-mark {
  color: var(--fg-faint);
}
.board4-post-item:not(.found) .board4-post-link {
  color: var(--fg-mute);
  filter: blur(0.3px);
}
.board4-post-item.found .board4-post-link {
  color: #e0c0a0;
}
.board4-post-link {
  text-decoration: none;
}
.board4-post-link:hover {
  text-decoration: underline;
  color: #ffe0c0;
}

.board4-hint {
  margin-top: 24px;
  padding: 10px;
  color: var(--fg-mute);
  font-style: italic;
  font-size: 12px;
  text-align: center;
}

.board4-input-wrap {
  margin-top: 24px;
  padding: 16px;
  background: rgba(90, 32, 32, 0.1);
  border: 1px solid #5a3030;
  text-align: center;
}
.board4-input-label {
  display: block;
  font-size: 13px;
  color: var(--fg);
  margin-bottom: 10px;
}
.board4-input {
  background: #0a0808;
  border: 1px solid #5a3030;
  color: #e0c080;
  padding: 10px 14px;
  font-family: 'Courier New', monospace;
  font-size: 22px;
  letter-spacing: 0.4em;
  text-align: center;
  width: 160px;
  outline: none;
}
.board4-input:focus {
  border-color: #c08040;
  box-shadow: 0 0 12px rgba(192, 128, 64, 0.4);
}
.board4-submit {
  display: block;
  margin: 12px auto 0;
  background: #2a1410;
  border: 1px solid #5a2020;
  color: #e0c0a0;
  padding: 8px 24px;
  font-family: inherit;
  cursor: pointer;
  font-size: 14px;
}
.board4-submit:hover {
  background: #3a2018;
  border-color: #c05050;
}
.board4-msg {
  margin-top: 10px;
  font-size: 12px;
  color: var(--fg-mute);
  min-height: 18px;
}
.board4-msg.err {
  color: #c05050;
  animation: shake 0.4s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* 解锁后的内容 */
.board4-unlocked {
  animation: fade-in 1s ease;
}
.board4-section {
  margin: 24px 0;
  padding: 14px 16px;
  background: #1a1410;
  border-left: 3px solid #5a2020;
}
.board4-section-title {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #e0c0a0;
  font-weight: normal;
}
.board4-content {
  margin: 0;
  white-space: pre-wrap;
  font-family: 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
  font-size: 13px;
  line-height: 1.9;
  color: #d0c0b0;
}
.board4-content-last {
  background: #0a0808;
  padding: 14px;
  border: 1px solid #5a3030;
  margin-top: 10px;
}
.board4-image {
  padding: 20px;
  text-align: center;
  border: 1px dotted #5a2020;
  margin: 8px 0;
  position: relative;
  background: #050505;
  overflow: hidden;
}
.board4-image-placeholder {
  position: relative;
  height: 120px;
}
.board4-image-noise {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent 0, transparent 2px, rgba(255,255,255,0.03) 2px, rgba(255,255,255,0.03) 3px),
    repeating-linear-gradient(90deg, transparent 0, transparent 2px, rgba(255,255,255,0.02) 2px, rgba(255,255,255,0.02) 3px);
  animation: noise-shift 0.2s steps(3) infinite;
}
@keyframes noise-shift {
  0% { transform: translate(0,0); }
  33% { transform: translate(-2px,1px); }
  66% { transform: translate(1px,-2px); }
}
.board4-image-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #806040;
  font-family: monospace;
  font-size: 12px;
  letter-spacing: 0.05em;
}
.board4-image-note {
  font-size: 11px;
  color: var(--fg-faint);
  font-style: italic;
  margin: 8px 0 0;
}
.board4-reveal {
  margin-top: 32px;
  padding: 20px;
  background: rgba(192, 128, 64, 0.08);
  border: 1px solid #5a3030;
  text-align: center;
}
.board4-reveal-mark {
  font-size: 32px;
  color: #c08040;
  margin-bottom: 12px;
}
.board4-reveal-text {
  font-size: 13px;
  line-height: 1.8;
  color: #d0b090;
}
.board4-reveal-text + .board4-reveal-text {
  margin-top: 6px;
  color: #c0a080;
  font-style: italic;
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   HUD · 密码进度
   ============================================ */
.hud-secret {
  font-size: 12px;
  color: #c08040;
  margin-left: 6px;
  padding: 1px 6px;
  border: 1px dashed #5a3030;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.05em;
  animation: hud-blink 2s ease-in-out infinite;
}
.hud-secret.unlocked {
  color: #80c080;
  border-color: #2a5030;
  animation: none;
  background: rgba(80, 192, 128, 0.08);
}
@keyframes hud-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ============================================
   帖子里嵌入的悬浮数字（found-digit）
   ============================================ */
.found-digit {
  display: inline-block;
  margin: 0 2px;
  padding: 0 4px;
  font-family: 'Courier New', monospace;
  font-size: 1.15em;
  color: #ff8060;
  background: rgba(192, 80, 64, 0.12);
  border-bottom: 1px dashed #c05050;
  animation: digit-flicker 1.8s ease-in-out infinite;
  text-shadow: 0 0 4px rgba(192, 80, 64, 0.6);
}
@keyframes digit-flicker {
  0%, 100% { opacity: 1; }
  48%, 52% { opacity: 0.55; }
  50% { color: #ffe0c0; text-shadow: 0 0 8px rgba(255, 200, 160, 0.9); }
}

/* ============================================
   结局动画（A/B/C/D 4 种不同）
   ============================================ */
.ending-wrap {
  position: relative;
  min-height: 100vh;
  padding: 80px 24px;
  background: var(--bg-deep);
  overflow: hidden;
  font-family: 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
}
.ending-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(192, 128, 64, 0.04) 0%, transparent 70%);
  pointer-events: none;
}
.ending-intro {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.95);
  animation: intro-fade 2.5s ease forwards;
  z-index: 10;
}
.ending-intro-text {
  color: #e0c0a0;
  font-size: 22px;
  font-family: 'Courier New', monospace;
  text-align: center;
  white-space: pre-line;
  text-shadow: 0 0 12px rgba(192, 80, 64, 0.5);
  animation: text-shake 0.3s ease-in-out infinite;
}
@keyframes text-shake {
  0%, 100% { transform: translate(0,0); }
  25% { transform: translate(-1px, 1px); }
  75% { transform: translate(1px, -1px); }
}
@keyframes intro-fade {
  0% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}

.ending-body {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
  z-index: 5;
}
.ending-line {
  font-size: 15px;
  line-height: 2.0;
  color: var(--fg);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  margin: 4px 0;
  white-space: pre-wrap;
  min-height: 1em;
}
.ending-line.typed {
  opacity: 1;
  transform: translateY(0);
}
.ending-line:empty {
  min-height: 1.4em;
}

.ending-actions {
  text-align: center;
  margin-top: 40px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
}
.ending-actions.show {
  opacity: 1;
  transform: translateY(0);
}
.ending-restart {
  background: #2a1410;
  border: 1px solid #5a2020;
  color: #e0c0a0;
  padding: 10px 32px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  letter-spacing: 0.1em;
}
.ending-restart:hover {
  background: #3a2018;
  border-color: #c05050;
}

/* —— Ending A：CRT 关闭 —— */
.ending-wrap.crt-collapse::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg-deep);
  animation: crt-shut 2s ease forwards;
  z-index: 20;
}
@keyframes crt-shut {
  0% { transform: scaleY(1); }
  100% { transform: scaleY(0.005); }
}
.ending-wrap.crt-recover::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg-deep);
  animation: crt-recover 0.6s ease;
  z-index: 20;
}
@keyframes crt-recover {
  0% { transform: scaleY(0.005); }
  100% { transform: scaleY(1); opacity: 0; }
}

/* —— Ending B：慢渐黑 + 底片 —— */
.ending-wrap.slow-fade .ending-bg {
  animation: bg-fade 6s ease forwards;
}
@keyframes bg-fade {
  to { background: #000; opacity: 0.95; }
}
.ending-wrap.film-negative .ending-line {
  mix-blend-mode: difference;
  filter: invert(1) hue-rotate(180deg);
}

/* —— Ending C：屏幕撕裂 + 血腥 —— */
.ending-wrap.screen-tear::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      transparent 0%, transparent 30%,
      rgba(160, 30, 30, 0.3) 30%, rgba(160, 30, 30, 0.3) 32%,
      transparent 32%, transparent 60%,
      rgba(160, 30, 30, 0.4) 60%, rgba(160, 30, 30, 0.4) 62%,
      transparent 62%);
  pointer-events: none;
  animation: tear-grow 0.8s ease-out forwards;
  z-index: 15;
}
@keyframes tear-grow {
  0% { clip-path: inset(0 0 100% 0); }
  100% { clip-path: inset(0 0 0 0); }
}
.ending-blood-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 80%, rgba(140, 20, 20, 0.45) 0%, transparent 40%),
    radial-gradient(circle at 70% 90%, rgba(160, 30, 30, 0.35) 0%, transparent 35%);
  pointer-events: none;
  opacity: 0;
  animation: blood-in 0.8s ease 0.6s forwards;
  z-index: 12;
}
@keyframes blood-in {
  to { opacity: 1; }
}

/* —— Ending D：闪烁 + 红色滤镜 —— */
.ending-wrap.red-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(160, 30, 30, 0.35);
  pointer-events: none;
  z-index: 15;
  animation: red-pulse 3s ease-in-out;
}
@keyframes red-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}
.ending-wrap.flash-strobe.flash {
  filter: invert(1) hue-rotate(180deg) brightness(1.5);
}
.ending-glitch-overlay {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg,
      transparent 0, transparent 2px,
      rgba(255, 0, 0, 0.05) 2px, rgba(255, 0, 0, 0.05) 3px);
  pointer-events: none;
  z-index: 18;
  animation: glitch-shift 0.2s steps(4) infinite;
}
@keyframes glitch-shift {
  0% { transform: translate(0,0); }
  25% { transform: translate(-2px, 1px); }
  50% { transform: translate(1px, -2px); }
  75% { transform: translate(2px, 2px); }
  100% { transform: translate(0, 0); }
}

/* —— 数据结尾（其他情况） —— */
.ending-line:empty + .ending-line:empty + .ending-line:empty + .ending-line:empty + .ending-line:empty + .ending-line:empty + .ending-line:empty + .ending-line:empty + .ending-line:empty + .ending-line:empty {
  /* 占位空行 */
}

/* ============================================
   相关线索区块（4 个主线帖子互链）
   ============================================ */
.related-clues {
  margin: 32px 0 16px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(40, 28, 20, 0.4) 0%, rgba(20, 14, 10, 0.6) 100%);
  border: 1px dashed #5a4030;
  border-radius: 2px;
  position: relative;
}
.related-clues::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg,
      transparent 0,
      transparent 6px,
      rgba(192, 128, 64, 0.025) 6px,
      rgba(192, 128, 64, 0.025) 12px);
  pointer-events: none;
}
.related-clues-title {
  font-size: 11px;
  font-family: 'Courier New', monospace;
  color: #c08040;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  position: relative;
}
.related-clues ul {
  margin: 0;
  padding: 0;
  list-style: none;
  position: relative;
}
.related-clues li {
  padding: 5px 0 5px 18px;
  font-size: 12px;
  color: var(--fg-mute);
  position: relative;
  line-height: 1.6;
}
.related-clues li::before {
  content: '▸';
  position: absolute;
  left: 2px;
  top: 5px;
  color: #806040;
}
.related-clues li a {
  color: #d0b090;
  text-decoration: none;
  border-bottom: 1px dotted #806040;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.related-clues li a:hover {
  color: #ffe0c0;
  border-bottom-color: #c08040;
  background: rgba(192, 128, 64, 0.08);
}

/* ============================================
   轻量化 found-digit（探险感更强：更像"线索残影"）
   ============================================ */
.found-digit {
  display: inline-block;
  margin: 0 1px;
  padding: 0 3px;
  font-family: 'Courier New', monospace;
  font-size: 1em;
  color: #d06040;
  background: rgba(208, 96, 64, 0.06);
  border-bottom: 1px dotted #c05050;
  text-shadow: 0 0 2px rgba(208, 96, 64, 0.4);
  position: relative;
  transition: all 0.3s ease;
}
.found-digit::before {
  content: '';
  position: absolute;
  inset: -2px -1px;
  border: 1px solid transparent;
  border-radius: 1px;
  animation: digit-pulse 3s ease-in-out infinite;
}
@keyframes digit-pulse {
  0%, 90%, 100% {
    border-color: transparent;
    box-shadow: 0 0 0 rgba(208, 96, 64, 0);
  }
  93% {
    border-color: #c05050;
    box-shadow: 0 0 8px rgba(208, 96, 64, 0.5);
  }
  96% {
    border-color: transparent;
  }
}
.found-digit:hover {
  color: #ff8060;
  background: rgba(208, 96, 64, 0.15);
  text-shadow: 0 0 4px rgba(208, 96, 64, 0.7);
}

/* ─────────────────────  调查系统（v2） ───────────────────── */

.post-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  padding: 10px 12px;
  background: rgba(20, 16, 12, 0.5);
  border: 1px solid #3a2a20;
  border-radius: 2px;
}
.post-actions.is-hot-investigation {
  border-color: #c08040;
  background: rgba(60, 32, 16, 0.4);
  box-shadow: 0 0 8px rgba(192, 128, 64, 0.18) inset;
}
.post-actions-row {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.post-actions button {
  background: #1a1410;
  color: var(--fg);
  border: 1px solid #5a4030;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 2px;
}
.post-actions button:hover { border-color: var(--hint); color: var(--hint); }
.post-actions button.invest-cached-success {
  border-color: #6a8a6a;
  color: #a0c0a0;
  background: rgba(60, 80, 60, 0.18);
}
.post-actions button.invest-cached-success::after { content: ' \2713'; color: #80c080; }
.post-actions button.invest-cached-fail {
  border-color: #8a5a4a;
  color: #c09888;
  background: rgba(80, 50, 40, 0.18);
}
.post-actions button.invest-cached-fail::after { content: ' \2717'; color: #c08070; }
.post-actions-hint {
  font-size: 11px;
  color: var(--fg-mute);
  margin-top: 4px;
  font-style: italic;
}
.post-actions-hint a { color: var(--warn); }
.post-actions-cache {
  display: flex; flex-direction: column; gap: 2px;
  margin-top: 4px;
  font-size: 11px;
}
.cache-line {
  padding: 2px 6px;
  border-left: 2px solid;
}
.cache-line.success {
  color: #a0c0a0;
  border-color: #6a8a6a;
  background: rgba(60, 80, 60, 0.10);
}
.cache-line.fail {
  color: #c09888;
  border-color: #8a5a4a;
  background: rgba(80, 50, 40, 0.10);
}
.cache-line .cache-tip {
  margin-left: 8px;
  color: var(--fg-faint);
  font-style: italic;
}

/* ─────────────────────  锁定帖子锁屏  ───────────────────── */

.locked-thread {
  max-width: 540px;
  margin: 36px auto;
  padding: 28px 24px;
  background: linear-gradient(180deg, #0a0606, #1a0e0a);
  border: 1px solid #5a3030;
  border-radius: 4px;
  text-align: center;
}
.locked-thread-icon { font-size: 48px; margin-bottom: 12px; }
.locked-thread-title { font-size: 16px; color: var(--warn); margin-bottom: 8px; }
.locked-thread-hint { color: var(--fg); font-size: 13px; margin-bottom: 16px; }
.locked-thread-form {
  display: flex; justify-content: center; gap: 8px; margin-bottom: 12px;
}
.locked-pwd-input {
  background: #0a0808;
  border: 1px solid #5a3030;
  color: #e0c080;
  padding: 8px 12px;
  font-family: 'Courier New', monospace;
  font-size: 18px;
  width: 120px; text-align: center; letter-spacing: 4px;
  border-radius: 2px;
}
.locked-pwd-input:focus { outline: 0; border-color: var(--hint); }
.locked-submit-btn {
  background: #2a1410;
  color: var(--warn);
  border: 1px solid var(--warn);
  padding: 8px 18px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 2px;
}
.locked-submit-btn:hover { background: #3a1a14; }
.locked-msg { color: var(--danger); font-size: 12px; min-height: 16px; }
.locked-msg.err { animation: shake 0.4s; }
.locked-thread-note {
  margin-top: 16px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed #5a3030;
  font-size: 11px;
  color: var(--fg-faint);
  line-height: 1.7;
}
.locked-thread-note b { color: var(--warn); }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.badge-locked {
  display: inline-block;
  padding: 0 6px;
  font-size: 10px;
  color: var(--warn);
  background: rgba(80, 30, 30, 0.4);
  border: 1px solid var(--warn);
  border-radius: 2px;
  margin-left: 6px;
  vertical-align: middle;
}

.meta-warning {
  margin-top: 16px;
  padding: 10px 12px;
  background: rgba(40, 20, 30, 0.5);
  border-left: 3px solid var(--warn);
  border-top: 1px dotted #5a3030;
  border-right: 1px dotted #5a3030;
  border-bottom: 1px dotted #5a3030;
  font-size: 11px;
  color: var(--fg-mute);
  line-height: 1.7;
}
.meta-warning b { color: var(--warn); }
.meta-warning code {
  background: rgba(0, 0, 0, 0.5);
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 10px;
  color: var(--hint);
}

/* ─────────────────────  跟贴区禁用  ───────────────────── */

.comment-form-disabled {
  margin-top: 18px;
  padding: 12px;
  background: rgba(30, 20, 16, 0.4);
  border: 1px dashed #5a3030;
  text-align: center;
  color: var(--fg-faint);
  font-size: 12px;
  line-height: 1.7;
}
.comment-form-disabled .comment-form-note {
  font-style: italic;
  font-size: 11px;
  color: #806850;
  margin-top: 4px;
}
.cm-locked {
  color: var(--warn);
  font-style: italic;
}

/* ─────────────────────  4 号板块 v2：句子填空 + 6 名字 ───────────────────── */

.board4-plea {
  margin: 20px 0;
  padding: 16px 18px;
  background: linear-gradient(180deg, #0a0808, #1a1008);
  border: 1px solid #5a3030;
  border-radius: 2px;
}
.board4-plea-title {
  color: var(--warn);
  margin: 0 0 8px;
  font-size: 14px;
  letter-spacing: 1px;
}
.board4-plea-hint {
  color: var(--fg-mute);
  font-size: 12px;
  margin-bottom: 12px;
  white-space: pre-line;
  line-height: 1.7;
}
.board4-sentence {
  font-family: 'Courier New', monospace;
  font-size: 15px;
  line-height: 2.6;
  color: var(--fg);
  letter-spacing: 1px;
}
.board4-sentence-text { color: var(--fg); }
.board4-blank-input {
  display: inline-block;
  background: #0a0808;
  border: none;
  border-bottom: 1px dotted #5a3030;
  color: #e0c080;
  padding: 2px 6px;
  font-family: inherit;
  font-size: 14px;
  margin: 0 4px;
  width: 60px;
  text-align: center;
}
.board4-blank-input:focus {
  outline: 0;
  border-bottom: 1px solid var(--hint);
  background: rgba(80, 30, 30, 0.2);
}
.board4-blank-input::placeholder {
  color: var(--fg-faint);
  font-size: 12px;
}

.board4-code-form {
  margin: 24px 0;
  padding: 18px;
  background: linear-gradient(180deg, #0a0808, #1a0e08);
  border: 1px solid #5a3030;
  text-align: center;
  border-radius: 2px;
}
.board4-code-slots {
  display: flex; justify-content: center; gap: 8px;
  margin: 16px 0;
}
.board4-code-slot {
  width: 44px; height: 56px;
  border: 2px solid #5a3030;
  background: #1a0e08;
  color: var(--fg-faint);
  font-family: 'Courier New', monospace;
  font-size: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 2px;
}
.board4-code-slot.filled {
  border-color: #c08040;
  color: #e0c080;
  background: #2a1a0e;
  box-shadow: 0 0 10px rgba(192, 128, 64, 0.4);
  animation: slot-fill 0.4s ease;
}
.board4-verify-row {
  display: flex; justify-content: center; gap: 8px; align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}
.board4-verify-btn {
  background: #2a1410;
  color: var(--warn);
  border: 1px solid var(--warn);
  padding: 8px 22px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 2px;
}
.board4-verify-btn:hover { background: #3a1a14; }
.board4-msg { margin-top: 10px; font-size: 12px; min-height: 18px; }
.board4-msg.err { color: var(--danger); animation: shake 0.4s; }
.board4-msg.ok { color: #80c080; }

.board4-content-raw {
  white-space: pre-wrap;
  font-family: 'Courier New', monospace;
  color: var(--fg);
  font-size: 13px;
  line-height: 1.7;
}

.board4-content-sos {
  white-space: pre-wrap;
  font-family: 'Courier New', monospace;
  color: var(--fg);
  font-size: 15px;
  line-height: 1.9;
  background: rgba(20, 14, 10, 0.5);
  border: 1px solid #3a2a20;
  border-left: 3px solid #5a3030;
  padding: 14px 18px;
  margin: 8px 0;
}
.board4-sentence-meta {
  font-size: 12px;
  color: var(--fg-mute);
  line-height: 1.7;
  margin-top: 10px;
}
.board4-sentence-order {
  display: inline-block;
  font-family: 'Courier New', monospace;
  color: var(--warn);
  background: rgba(80, 30, 30, 0.18);
  padding: 2px 8px;
  margin-top: 4px;
  border: 1px solid #5a3030;
  border-radius: 2px;
}

.board4-code-form {
  margin: 24px 0;
  padding: 18px;
  background: linear-gradient(180deg, #0a0808, #1a0e08);
  border: 1px solid #5a3030;
  text-align: center;
  border-radius: 2px;
}
.board4-pwd-input {
  background: #0a0808;
  border: 1px solid #5a3030;
  color: #e0c080;
  padding: 8px 14px;
  font-family: 'Courier New', monospace;
  font-size: 18px;
  width: 180px;
  text-align: center;
  letter-spacing: 4px;
  border-radius: 2px;
}
.board4-pwd-input:focus { outline: 0; border-color: var(--hint); }
.board4-verify-btn {
  background: #2a1410;
  color: var(--warn);
  border: 1px solid var(--warn);
  padding: 8px 22px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 2px;
  margin-left: 10px;
}
.board4-verify-btn:hover { background: #3a1a14; }
.board4-msg { margin-top: 12px; font-size: 12px; min-height: 18px; }
.board4-msg.err { color: var(--danger); animation: shake 0.4s; }
.board4-msg.ok { color: #80c080; }

/* 调查成功时显示的密码位线索 */
.clue-digit {
  display: inline-block;
  background: var(--warn);
  color: #000;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 16px;
  padding: 1px 8px;
  margin-left: 4px;
  border-radius: 2px;
}

.board4-jump {
  text-align: center;
  margin-top: 24px;
}
.board4-jump-btn {
  display: inline-block;
  padding: 12px 36px;
  background: #2a0e0a;
  color: var(--warn);
  border: 1px solid var(--warn);
  text-decoration: none;
  font-size: 16px;
  letter-spacing: 4px;
  border-radius: 2px;
}
.board4-jump-btn:hover { background: #3a1a14; text-decoration: none; }


/* ============================================================
   结局视觉特效：真相（BBS 风格）+ 混沌（视觉接管）
   ============================================================ */
.ending-wrap {
  position: relative;
  min-height: calc(100vh - 60px);
  background: #0a0a0a;
  color: #ccc;
  padding: 40px 20px 80px;
  overflow: hidden;
}

/* ─── 通用背景层 ─── */
.ending-static {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.15s;
}
.ending-static.on { opacity: 1; }
.ending-static canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.ending-garble {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}
.ending-garble .gc {
  position: absolute;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  opacity: 0;
  white-space: pre;
}
.ending-garble .gc.fly {
  animation: gcFly 4s linear forwards;
}
@keyframes gcFly {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: 0.8; }
  90% { opacity: 0.8; }
  100% { transform: translateY(-80px); opacity: 0; }
}

.ending-glitch {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}
.ending-glitch .gb {
  position: absolute;
  opacity: 0;
  mix-blend-mode: screen;
}
.ending-glitch .gb.flash {
  animation: gbFlash 0.15s steps(2) infinite;
}
@keyframes gbFlash {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.2; }
}

.ending-rgb {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 3;
  background: linear-gradient(90deg, rgba(255,0,0,0.04), transparent 30%, transparent 70%, rgba(0,255,255,0.04));
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.3s;
}
.ending-rgb.on { opacity: 1; }

/* ─── 第一段：真相（BBS 风格） ─── */
.ending-truth {
  position: relative;
  z-index: 5;
  max-width: 720px;
  margin: 0 auto;
  background: rgba(0,0,0,0.4);
  border: 1px solid #2a2a2a;
  padding: 24px 32px;
  font-size: 14px;
  line-height: 1.8;
  transition: opacity 0.5s;
}
.ending-truth.fade-out { opacity: 0; }
.ending-truth-tag {
  color: #9c6;
  font-size: 12px;
  letter-spacing: 4px;
  margin-bottom: 14px;
  text-align: center;
  border-bottom: 1px dotted #333;
  padding-bottom: 8px;
}
.ending-truth-line {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.5s, transform 0.5s;
  min-height: 1.5em;
}
.ending-truth-line.show { opacity: 1; transform: translateY(0); }

/* ─── 第二段：混沌 ─── */
.ending-chaos {
  position: relative;
  z-index: 5;
  max-width: 720px;
  margin: 0 auto;
  padding: 30px 20px;
  font-size: 14px;
  line-height: 1.8;
  text-align: center;
  min-height: 200px;
}
.ending-chaos-tag {
  color: #c66;
  font-size: 11px;
  letter-spacing: 6px;
  margin-bottom: 20px;
  text-align: center;
  opacity: 0.6;
}
.ending-line {
  min-height: 1.8em;
  opacity: 0;
  position: relative;
  z-index: 2;
}

/* ─── 行动按钮 ─── */
.ending-actions {
  position: relative;
  z-index: 50;
  text-align: center;
  margin-top: 40px;
  opacity: 0;
  transition: opacity 0.6s;
}
.ending-actions.show { opacity: 1; }
.ending-restart {
  padding: 12px 40px;
  background: #9c6;
  color: #0a0a0a;
  border: 1px solid #9c6;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 4px;
  cursor: pointer;
  transition: all 0.15s steps(2);
}
.ending-restart:hover { background: #bda; }

/* ============================================================
   A · 断锚者
   ============================================================ */
.ending-wrap[data-ending="A"] {
  background: #0a0a0a;
  color: #c66;
}
.ending-wrap[data-ending="A"].bg-green { background: #1a0a0a; }
.ending-wrap[data-ending="A"].bg-black { background: #000; }
.ending-wrap[data-ending="A"].crt-collapse {
  clip-path: inset(50% 0 50% 0);
  transition: clip-path 1.8s cubic-bezier(0.7, 0, 0.84, 0);
}
.ending-wrap[data-ending="A"].fade-white {
  background: #d0d0d0;
  color: #222;
  transition: background 1.5s, color 1.5s;
}
.ending-wrap[data-ending="A"].fade-white .ending-chaos,
.ending-wrap[data-ending="A"].fade-white .ending-chaos-tag,
.ending-wrap[data-ending="A"].fade-white .ending-line { color: #222 !important; }
.ending-wrap[data-ending="A"].fade-white .ending-static { opacity: 0 !important; }
.ending-wrap[data-ending="A"].fade-white .ending-restart { background: #222; color: #d0d0d0; border-color: #222; }

.ending-white-burst {
  position: fixed; inset: 0;
  background: #fff;
  z-index: 99;
  pointer-events: none;
  opacity: 0;
}
.ending-white-burst.flash { animation: whiteBurst 0.5s forwards; }
@keyframes whiteBurst {
  0% { opacity: 0; }
  20% { opacity: 1; }
  100% { opacity: 0; }
}

.ending-wrap[data-ending="A"] .ending-line {
  transform: scale(0);
  filter: blur(10px);
  transition: opacity 0.3s, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s;
  opacity: 0;
}
.ending-wrap[data-ending="A"] .ending-line.show {
  transform: scale(1);
  filter: blur(0);
  opacity: 1;
}

/* ============================================================
   B · 见死不救
   ============================================================ */
.ending-wrap[data-ending="B"] {
  background: #0a0a0a;
  color: #ccc;
  transition: filter 1s, background 1s;
}
.ending-wrap[data-ending="B"].invert {
  filter: invert(1) hue-rotate(200deg);
}
.ending-wrap[data-ending="B"].fade-black {
  background: #000;
  color: #000;
  filter: invert(0);
}
.ending-wrap[data-ending="B"].fade-black .ending-line { color: #ccc !important; filter: none !important; }
.ending-wrap[data-ending="B"].end-black { background: #000; }
.ending-wrap[data-ending="B"].end-black .ending-line.blink {
  color: #c66 !important;
  animation: blinkEnd 2s infinite;
}
@keyframes blinkEnd {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.1; }
}
.ending-wrap[data-ending="B"] .ending-line {
  transform: translateX(-100vw);
  transition: transform 0.4s, opacity 0.3s;
  opacity: 0;
}
.ending-wrap[data-ending="B"] .ending-line.show {
  transform: translateX(0);
  opacity: 1;
}
.ending-wrap[data-ending="B"] .ending-line.shake { animation: tinyShake 0.3s 1; }
@keyframes tinyShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

/* ============================================================
   C · 下一任站长
   ============================================================ */
.ending-wrap[data-ending="C"] {
  background: #0a0a0a;
  color: #ccc;
}
.ending-wrap[data-ending="C"].shake {
  animation: cShake 0.06s infinite;
}
@keyframes cShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-4px, 2px); }
  40% { transform: translate(3px, -3px); }
  60% { transform: translate(-2px, 4px); }
  80% { transform: translate(4px, -2px); }
}
.ending-wrap[data-ending="C"].distort-1 { transform: rotate(0.5deg) scale(1.01); transition: transform 0.1s steps(2); }
.ending-wrap[data-ending="C"].distort-2 { transform: rotate(1.2deg) scale(1.02) skewX(0.5deg); transition: transform 0.1s steps(2); }
.ending-wrap[data-ending="C"].distort-3 { transform: rotate(2deg) scale(1.03) skewX(1.5deg) skewY(0.5deg); transition: transform 0.1s steps(2); }
.ending-wrap[data-ending="C"].distort-4 { transform: rotate(3deg) scale(1.04) skewX(2.5deg) skewY(1deg); filter: hue-rotate(-10deg) saturate(1.4); transition: transform 0.1s steps(2); }
.ending-wrap[data-ending="C"].distort-5 { transform: rotate(4deg) scale(1.06) skewX(4deg) skewY(2deg); filter: hue-rotate(-20deg) saturate(1.6) contrast(1.2); transition: transform 0.1s steps(2); }

.ending-red-pulse {
  position: absolute; inset: 0;
  background: rgba(200, 30, 30, 0);
  z-index: 4;
  pointer-events: none;
  transition: background 0.4s;
}
.ending-red-pulse.peak { background: rgba(200, 30, 30, 0.6); }

/* C 结局弹窗 */
.ending-choice-modal {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: rgba(0,0,0,0.92);
  border: 1px solid #c66;
  padding: 30px 50px;
  z-index: 30;
  text-align: center;
  min-width: 400px;
  transition: transform 0.3s steps(4);
}
.ending-choice-modal.pop { transform: translate(-50%, -50%) scale(1); }
.ending-choice-modal .modal-title {
  color: #c66;
  font-size: 18px;
  margin-bottom: 6px;
  font-weight: bold;
  letter-spacing: 4px;
}
.ending-choice-modal .modal-subtitle {
  color: #888;
  font-size: 12px;
  margin-bottom: 30px;
  letter-spacing: 2px;
}
.ending-choice-modal .modal-buttons {
  display: flex; gap: 20px;
  justify-content: center;
}
.ending-choice-modal .modal-btn {
  padding: 12px 30px;
  background: linear-gradient(180deg, #e44 0%, #c33 50%, #a22 100%);
  border: 1px solid #600;
  border-bottom: 3px solid #400;
  border-radius: 4px;
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 4px;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(80, 0, 0, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 200, 200, 0.4),
    inset 0 -1px 0 rgba(80, 0, 0, 0.4),
    0 2px 0 #400,
    0 3px 4px rgba(0, 0, 0, 0.6);
  transition: transform 0.05s steps(2), box-shadow 0.05s steps(2);
  min-width: 100px;
}
.ending-choice-modal .modal-btn:hover {
  background: linear-gradient(180deg, #f55 0%, #d44 50%, #b33 100%);
}
.ending-choice-modal .modal-btn:active,
.ending-choice-modal .modal-btn.pressed {
  transform: translateY(2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 200, 200, 0.4),
    inset 0 -1px 0 rgba(80, 0, 0, 0.4),
    0 0 0 #400,
    0 1px 1px rgba(0, 0, 0, 0.3);
}
@keyframes keyShake1 { 0%,100%{transform:translate(0,0)} 25%{transform:translate(-1px,0)} 75%{transform:translate(1px,0)} }
@keyframes keyShake2 { 0%,100%{transform:translate(0,0)} 20%{transform:translate(-2px,1px)} 50%{transform:translate(2px,-1px)} 80%{transform:translate(-1px,-1px)} }
@keyframes keyShake3 { 0%,100%{transform:translate(0,0) rotate(0deg)} 20%{transform:translate(-2px,1px) rotate(-0.5deg)} 50%{transform:translate(2px,-1px) rotate(0.5deg)} 80%{transform:translate(-1px,-1px) rotate(-0.3deg)} }
@keyframes keyShake4 { 0%,100%{transform:translate(0,0) rotate(0deg) scale(1)} 20%{transform:translate(-3px,2px) rotate(-1deg) scale(1.03)} 50%{transform:translate(3px,-2px) rotate(1deg) scale(0.97)} 80%{transform:translate(-2px,-1px) rotate(-0.5deg) scale(1.02)} }
@keyframes keyShake5 { 0%,100%{transform:translate(0,0) rotate(0deg) scale(1)} 20%{transform:translate(-4px,3px) rotate(-2deg) scale(1.06)} 50%{transform:translate(4px,-3px) rotate(2deg) scale(0.94)} 80%{transform:translate(-3px,-2px) rotate(-1deg) scale(1.04)} }
.ending-choice-modal .modal-btn.accept.shake-1 { animation: keyShake1 0.2s steps(3) 3; }
.ending-choice-modal .modal-btn.accept.shake-2 { animation: keyShake2 0.18s steps(3) 4; }
.ending-choice-modal .modal-btn.accept.shake-3 { animation: keyShake3 0.15s steps(3) 5; }
.ending-choice-modal .modal-btn.accept.shake-4 { animation: keyShake4 0.12s steps(3) 6; background: linear-gradient(180deg, #f55, #d33, #b22) !important; }
.ending-choice-modal .modal-btn.accept.shake-5 { animation: keyShake5 0.1s steps(2) 8; background: linear-gradient(180deg, #f66, #e33, #c22) !important; box-shadow: 0 0 12px #c66, inset 0 1px 0 rgba(255,200,200,0.6), 0 2px 0 #400, 0 3px 4px rgba(0,0,0,0.6); }
.ending-choice-modal .modal-btn.reject.shrink {
  transform: scale(0.4);
  opacity: 0.3;
  border-color: #444;
  color: #444;
  transition: all 0.2s steps(3);
  pointer-events: none;
  background: linear-gradient(180deg, #555 0%, #333 50%, #222 100%);
  box-shadow: 0 1px 0 #000, 0 1px 2px rgba(0,0,0,0.4);
  border-bottom-width: 1px;
}

/* C 结局欢迎文字 */
.ending-welcome-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 40;
  text-align: center;
  color: #fff;
  font-size: 22px;
  letter-spacing: 6px;
  opacity: 0;
  transition: opacity 0.3s steps(3);
  text-shadow: 0 0 8px #c66;
  font-weight: bold;
}
.ending-welcome-text.show { opacity: 1; }
.ending-welcome-text .sub {
  font-size: 12px;
  color: #f88;
  margin-top: 16px;
  letter-spacing: 2px;
  font-weight: normal;
}

/* ============================================================
   D · 与祂同在
   ============================================================ */
.ending-wrap[data-ending="D"] {
  background: #0a0a0a;
  color: #c66;
  filter: hue-rotate(340deg);
}
.ending-wrap[data-ending="D"].d-pulse { animation: dPulse 1s 1; }
@keyframes dPulse {
  0%, 100% { background: #0a0a0a; }
  50% { background: #500; }
}
.ending-wrap[data-ending="D"].crt-slip { animation: crtSlip 0.1s infinite; }
@keyframes crtSlip {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(1px); }
}
.ending-wrap[data-ending="D"].end-black { background: #000; filter: none; }

.ending-wrap[data-ending="D"] .ending-line {
  min-height: 1.5em;
}
.ending-wrap[data-ending="D"] .d-char {
  display: inline-block;
  animation: dShake 0.2s infinite;
}
@keyframes dShake {
  0%, 100% { transform: translate(0,0); }
  33% { transform: translate(0.4px, -0.3px); }
  66% { transform: translate(-0.3px, 0.4px); }
}

/* D 结局：屏幕上下切开 */
.ending-split-top, .ending-split-bottom {
  position: absolute; left: 0; right: 0;
  background: #0a0a0a;
  z-index: 8;
  transition: transform 0.6s;
}
.ending-split-top { top: 0; height: 50%; transform: translateY(0); }
.ending-split-bottom { bottom: 0; height: 50%; transform: translateY(0); }
.ending-split-top.cut { transform: translateY(-30%); }
.ending-split-bottom.cut { transform: translateY(30%); }
.ending-split-light {
  position: absolute; left: 0; right: 0;
  top: 50%;
  height: 60px;
  transform: translateY(-50%);
  background: radial-gradient(ellipse, rgba(200, 30, 30, 0.5) 0%, transparent 70%);
  box-shadow: 0 0 30px rgba(200, 30, 30, 0.4);
  opacity: 0;
  z-index: 9;
  transition: opacity 0.3s;
}
.ending-split-light.show { opacity: 1; }

/* D 结局警告文字 */
.ending-warnings {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 30;
}
.ending-warnings .warn {
  position: absolute; left: 0; right: 0;
  text-align: center;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  color: #c66;
  text-shadow: 0 0 8px #c66;
  font-size: 20px;
  letter-spacing: 4px;
  opacity: 0;
}
.ending-warnings .w1 { top: 25%; animation: warnFlash 0.6s 4; }
.ending-warnings .w2 { top: 45%; animation: warnFlash 0.6s 4 0.15s; }
.ending-warnings .w3 { top: 65%; animation: warnFlash 0.6s 4 0.3s; }
@keyframes warnFlash {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

/* D 结局最终字幕 */
.ending-final-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #f88;
  font-size: 16px;
  max-width: 80%;
  line-height: 1.8;
  text-shadow: 0 0 6px #c66;
  opacity: 0;
  transition: opacity 1.5s;
  z-index: 20;
  font-weight: bold;
}
.ending-final-text.show { opacity: 1; }
