/* ==========================================================
   《畫裡真真》· 八号出口式找异常关卡
   在 style.css 的视觉体系上追加本页模块；不覆盖站点原有排版。
   ========================================================== */

/* ---------- 页面级调整 ---------- */

.entry--split .rail {
  position: static;
}

.site-foot {
  padding-bottom: 240px;
}

body.is-locked {
  overflow: hidden;
}

.noscript-note {
  margin: 0 0 24px;
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  font-size: 13px;
  letter-spacing: 0.03em;
  color: var(--muted);
}

/* ---------- 编者按：诗词选录 ---------- */

.ednote {
  font-size: 17.5px;
  line-height: 2.05;
  color: var(--ink-82);
}

.ednote p {
  margin-bottom: 0.9em;
}

.ednote-lead {
  margin: 0 0 36px;
}

.poem-set {
  margin: 0;
  columns: 3;
  column-gap: 40px;
}

.poem {
  margin: 0 0 30px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  text-align: center;
}

/* 三列时按 1–3 / 4–5 / 6–7 手动分栏，三栏高度最接近。 */
.poem-set > .poem:nth-child(4),
.poem-set > .poem:nth-child(6) {
  break-before: column;
}

.poem figcaption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin: 0 0 11px;
}

.poem-title {
  font-family: var(--sub);
  font-size: 15.5px;
  line-height: 1.7;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.poem-author {
  font-family: var(--sub);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.poem .poem-body {
  margin: 0;
  font-size: 16.5px;
  line-height: 2.05;
  letter-spacing: 0.02em;
  color: var(--ink-82);
}

.poem-mark {
  font-weight: 700;
  color: #8d4137;
  white-space: nowrap;
}

/* 诗词选录的落款小注 */
.poem-set .poem-note {
  margin: 2px 0 0;
  font-family: var(--sub);
  font-size: 12.5px;
  line-height: 1.9;
  letter-spacing: 0.24em;
  text-indent: 0;
  color: #9b968b;
  text-align: center;
  break-inside: avoid;
}

/* ---------- 原文朗读 ---------- */

.player {
  padding: 26px 28px 24px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.player-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.player-title {
  margin: 0;
  font-family: var(--sub);
  font-size: 17px;
  letter-spacing: 0.12em;
  color: var(--ink);
}

.player-toggle {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 44px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.player-toggle:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: #fcfbf8;
}

.player-toggle:focus-visible,
.player-vol:focus-visible {
  outline: 1px solid var(--line-strong);
  outline-offset: 3px;
}

.player-excerpt {
  margin: 18px 0 22px;
  padding-left: 14px;
  border-left: 2px solid var(--line-strong);
  font-size: 15.5px;
  line-height: 1.95;
  letter-spacing: 0.03em;
  color: var(--ink-82);
}

.player-track {
  position: relative;
  height: 19px;
  cursor: pointer;
}

.player-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 8px;
  height: 3px;
  background: var(--line);
}

.player-fill {
  position: absolute;
  left: 0;
  top: 8px;
  width: 0;
  height: 3px;
  background: var(--ink);
  transition: width 0.2s linear;
}

.player-track:focus-visible {
  outline: 1px solid var(--line-strong);
  outline-offset: 2px;
}

.player-time {
  display: flex;
  justify-content: space-between;
  margin-top: 9px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.player-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.player-vol {
  padding: 0;
  border: 0;
  border-bottom: 1px dotted var(--line-strong);
  background: transparent;
  color: var(--ink-82);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.player-vol:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* ---------- 图像资料 ---------- */

.plate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 22px;
}

.gallery-sec {
  margin-top: 84px;
}

.plate-grid--wide {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.plate {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
}

.plate-frame {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #efeadd;
  border: 1px solid var(--line);
}

.plate-frame::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  pointer-events: none;
}

.plate img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.plate:hover img {
  transform: scale(1.03);
}

.plate:focus-visible {
  outline: 1px solid var(--line-strong);
  outline-offset: 3px;
}

.plate-cap {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.plate-id {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.plate-title {
  font-size: 15.5px;
  letter-spacing: 0.07em;
  color: var(--ink);
}

.plate-meta {
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--muted);
}

/* ---------- 侧栏：相关条目 ---------- */

.rel-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rel-list li + li {
  border-top: 1px solid var(--line);
}

.rel {
  display: block;
  padding: 10px 0;
  color: var(--ink);
  text-decoration: none;
}

.rel-list li:first-child .rel {
  padding-top: 0;
}

.rel-list li:last-child .rel {
  padding-bottom: 0;
}

.rel-title {
  display: inline;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: 0.06em;
  border-bottom: 1px solid transparent;
  transition: border-color 0.18s ease;
}

.rel:hover .rel-title {
  border-bottom-color: var(--line-strong);
}

.rel:focus-visible {
  outline: 1px solid var(--line-strong);
  outline-offset: 2px;
}

/* ---------- 侧栏：地图 ---------- */

.map-box {
  border: 1px solid var(--line);
  background: #f3efe4;
  overflow: hidden;
}

.map-box svg {
  display: block;
  width: 100%;
  height: auto;
}

.map-cap {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.8;
  letter-spacing: 0.02em;
  color: var(--ink-82);
}

/* ---------- 侧栏：引用工具 ---------- */

.cite-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.cite-toggle::after {
  content: "＋";
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.cite-toggle[aria-expanded="true"]::after {
  content: "－";
}

.cite-toggle:hover {
  border-color: var(--line-strong);
  background: var(--wash);
}

.cite-toggle:focus-visible,
.cite-tab:focus-visible,
.cite-copy:focus-visible {
  outline: 1px solid var(--line-strong);
  outline-offset: 2px;
}

.cite-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.cite-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cite-tab {
  padding: 0 0 3px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.cite-tab:hover {
  color: var(--ink);
}

.cite-tab.is-active {
  color: var(--ink);
  border-bottom-color: var(--line-strong);
}

.cite-text {
  margin: 12px 0;
  padding: 11px 12px;
  background: rgba(28, 28, 28, 0.03);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.85;
  letter-spacing: 0.02em;
  color: var(--ink-82);
  word-break: break-all;
}

.cite-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cite-copy {
  padding: 5px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.cite-copy:hover {
  background: var(--ink);
  color: #fcfbf8;
}

.cite-feedback {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #3f5a45;
}

/* ---------- 页面底部：记录与统计 ---------- */

.page-notes {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 64px;
  margin-top: 84px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}

.foot-h {
  margin: 0 0 16px;
  font-family: var(--sub);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.26em;
  color: var(--muted);
}

.revlog {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.revlog li {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 4px 18px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  line-height: 1.75;
  letter-spacing: 0.03em;
  color: var(--ink-82);
}

.rev-date {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.stats {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.stats li {
  min-width: 0;
}

.stat-num {
  display: block;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.stat-label {
  display: block;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* ---------- 本轮判断 ---------- */

.judge {
  max-width: 760px;
  margin-top: 56px;
  padding: 30px 32px 28px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.35);
}

.judge-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.judge-kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.judge-title {
  margin: 6px 0 0;
  font-family: var(--sub);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--ink);
}

.judge-status {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}

.judge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}

.judge-btn {
  min-width: 172px;
  height: 48px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  font-family: var(--serif);
  font-size: 15.5px;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.judge-btn[hidden] {
  display: none;
}

.judge-btn--enter {
  min-width: 232px;
  border-color: var(--ink);
  background: var(--ink);
  color: #fcfbf8;
}

.judge-btn--enter:hover {
  background: #333;
  border-color: #333;
}

.judge-btn--safe {
  border-color: rgba(63, 90, 69, 0.5);
  color: #3f5a45;
}

.judge-btn--safe:hover {
  background: rgba(63, 90, 69, 0.08);
}

.judge-btn--anom {
  border-color: rgba(141, 65, 55, 0.5);
  color: #8d4137;
}

.judge-btn--anom:hover {
  background: rgba(141, 65, 55, 0.07);
}

.judge-btn:focus-visible {
  outline: 1px solid var(--line-strong);
  outline-offset: 2px;
}

.judge-btn:disabled {
  opacity: 0.42;
  cursor: default;
}

.judge-btn:disabled:hover {
  background: transparent;
}

.judge .judge-btn--enter:disabled,
.judge .judge-btn--enter:disabled:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: #fcfbf8;
  opacity: 0.32;
  cursor: default;
}

.judge-note {
  margin: 18px 0 0;
  max-width: 560px;
  font-size: 12.5px;
  line-height: 1.9;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.judge.is-cleared {
  border-color: var(--ink);
}

.judge.is-cleared .judge-status {
  color: var(--ink);
}

/* ---------- 判断过场 ---------- */

body.verdict-active {
  overflow: hidden;
}

body.verdict-active #inkpet-root {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.verdict {
  position: fixed;
  inset: 0;
  z-index: 90000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.verdict[hidden] {
  display: none;
}

.verdict.is-open {
  opacity: 1;
}

.verdict-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.verdict-loading,
.verdict-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.verdict-loading[hidden],
.verdict-result[hidden] {
  display: none;
}

.verdict-spinner {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: verdict-spin 0.9s linear infinite;
}

.verdict-caption {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.verdict-mark {
  width: 120px;
  height: 120px;
  display: none;
  animation: verdict-pop 0.32s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

.verdict-mark path {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.verdict.is-correct .verdict-mark--check {
  display: block;
  stroke: #3f5a45;
}

.verdict.is-wrong .verdict-mark--cross {
  display: block;
  stroke: #8d4137;
}

.verdict-hop {
  margin: 26px 0 0;
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.24em;
  color: var(--ink-82);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease 0.35s, transform 0.5s ease 0.35s;
}

.verdict.is-result .verdict-hop {
  opacity: 1;
  transform: none;
}

@keyframes verdict-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes verdict-pop {
  from {
    opacity: 0;
    transform: scale(0.82);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 图像预览 ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100010;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 32px 40px;
  background: rgba(22, 21, 18, 0.88);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-fig {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: min(1100px, 100%);
  max-height: 100%;
  margin: 0;
}

.lightbox-fig img {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  object-fit: contain;
  background: #f3efe4;
  border: 1px solid rgba(247, 244, 237, 0.22);
}

.lightbox-fig figcaption {
  font-size: 12px;
  line-height: 1.8;
  letter-spacing: 0.06em;
  color: #c9c5b9;
  text-align: center;
}

.lightbox-fig figcaption strong {
  display: block;
  margin-bottom: 3px;
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.1em;
  color: #f7f4ed;
}

.lightbox-close {
  position: fixed;
  top: 22px;
  right: 28px;
  padding: 7px 14px;
  border: 1px solid rgba(247, 244, 237, 0.35);
  border-radius: 4px;
  background: transparent;
  color: #f7f4ed;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(247, 244, 237, 0.12);
}

.lightbox-close:focus-visible {
  outline: 1px solid #f7f4ed;
  outline-offset: 2px;
}

/* ---------- 珍珍的「点我点我」提示 ---------- */

.pet-hint {
  position: fixed;
  z-index: 99998;
  padding: 11px 18px 12px;
  border: 1px solid var(--ink);
  border-radius: 14px;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(28, 28, 28, 0.14);
  animation: pet-hint-bob 1.9s ease-in-out infinite;
}

.pet-hint::after {
  content: "";
  position: absolute;
  left: var(--pet-hint-tail, 50%);
  bottom: -7px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  background: var(--cream);
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  transform: rotate(45deg);
}

.pet-hint:hover,
.pet-hint:focus-visible {
  box-shadow: 0 12px 30px rgba(28, 28, 28, 0.2);
}

.pet-hint:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

@keyframes pet-hint-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ---------- 珍珍的求助气泡与选择卡 ---------- */

.pet-help {
  position: fixed;
  z-index: 99998;
  max-width: min(245px, calc(100vw - 54px));
  padding: 9px 12px;
  border: 1px solid rgba(91, 87, 78, 0.16);
  border-radius: 4px 4px 4px 11px;
  background: rgba(250, 248, 241, 0.97);
  color: #4d4b43;
  font-family: "Songti SC", "Noto Serif CJK SC", serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.7;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(67, 62, 52, 0.1);
}

.pet-help:hover {
  box-shadow: 0 8px 26px rgba(67, 62, 52, 0.16);
}

.help-card {
  position: fixed;
  z-index: 100001;
  width: min(324px, calc(100vw - 28px));
  padding: 15px 17px 11px;
  border: 1px solid rgba(91, 87, 78, 0.2);
  border-radius: 15px;
  background: rgba(251, 249, 243, 0.995);
  color: #44423b;
  font-family: "Songti SC", "Noto Serif CJK SC", serif;
  box-shadow: 0 14px 36px rgba(50, 46, 38, 0.19);
}

.help-card::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 15px;
  height: 15px;
  margin-left: -7.5px;
  background: rgba(251, 249, 243, 0.995);
  border-right: 1px solid rgba(91, 87, 78, 0.2);
  border-bottom: 1px solid rgba(91, 87, 78, 0.2);
  border-bottom-right-radius: 3px;
  transform: rotate(45deg);
}

.help-text {
  margin: 0;
  min-height: 4.6em;
  padding-right: 16px;
  color: #44423b;
  font-size: 13.5px;
  line-height: 1.95;
  letter-spacing: 0.035em;
  word-break: normal;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.help-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
  min-height: 24px;
}

.help-actions[hidden] {
  display: none;
}

.help-btn {
  padding: 5px 12px;
  border: 1px solid rgba(120, 60, 52, 0.24);
  border-radius: 999px;
  background: #fffdf7;
  color: #8d4137;
  font: inherit;
  font-size: 11.5px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.help-btn--primary {
  background: #fff;
}

.help-btn:hover {
  background: #fff;
}

body.pet-talking .pet-help,
body.verdict-active .pet-help,
body.ending-active .pet-help,
body.verdict-active .help-card,
body.ending-active .help-card {
  display: none;
}

/* ---------- 异常状态 ---------- */

#gallerySec[hidden],
#ednoteSec[hidden],
#notesPanel[hidden] {
  display: none;
}

/* 编者按异常：红字标注全部变回普通正文 */
#ednoteSec.is-marks-off .poem-mark {
  font-weight: 400;
  color: inherit;
}

#plateGrid.is-tall .plate-frame {
  aspect-ratio: 3 / 4;
}

#plateGrid.is-black .plate img {
  filter: brightness(0);
}

#plateGrid.is-black .plate-frame {
  background: #000;
}

#crumbLast.is-you {
  color: #8d4137;
  font-weight: 700;
}

/* ---------- 通关 ---------- */

.ending {
  position: fixed;
  inset: 0;
  z-index: 90001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background: var(--cream);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ending[hidden] {
  display: none;
}

.ending.is-open {
  opacity: 1;
}

.ending-inner {
  max-width: 560px;
  text-align: center;
  transform: translateY(10px);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ending.is-open .ending-inner {
  transform: none;
}

.ending-kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.24em;
  color: var(--muted);
}

.ending-title {
  margin: 18px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, 7vw, 72px);
  letter-spacing: 0.18em;
  color: var(--ink);
}

.ending-line {
  margin: 24px 0 0;
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.ending-sub {
  margin: 10px 0 0;
  font-size: 13.5px;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.ending-seal {
  display: inline-block;
  margin-top: 26px;
  padding: 6px 10px;
  border: 1px solid #8d4137;
  color: #8d4137;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.32em;
  transform: rotate(-2deg);
}

.ending-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 34px;
}

.ending-btn {
  padding: 10px 22px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--sub);
  font-size: 13px;
  letter-spacing: 0.16em;
  cursor: pointer;
}

.ending-btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.ending-btn:hover {
  opacity: 0.86;
}

body.ending-active {
  overflow: hidden;
}

@media (max-width: 560px) {
  .ending-title {
    font-size: 40px;
  }

  .ending-actions {
    flex-direction: column;
  }
}

/* ---------- 送分题异常 ---------- */

body.is-night {
  --cream: #171614;
  --ink: #ece7d9;
  --ink-82: rgba(236, 231, 217, 0.82);
  --muted: #a39d90;
  --line: #302d27;
  --line-strong: rgba(236, 231, 217, 0.42);
  --wash: rgba(255, 255, 255, 0.035);
  background: #171614;
  color: #ece7d9;
}

body.is-night .map-box svg {
  filter: invert(0.92) hue-rotate(180deg);
}

body.is-night .plate-frame {
  background: #221f1a;
}

body.is-night .cite-text {
  background: rgba(255, 255, 255, 0.05);
}

body.is-night .judge {
  background: rgba(255, 255, 255, 0.04);
}

body.is-night .poem-mark {
  color: #d08b7e;
}

body.is-mirror .page-shell {
  transform: scaleX(-1);
}

body.is-shrink .page-shell {
  transform: scale(0.6);
  transform-origin: 50% 0;
  margin-top: 8vh;
}

body.is-yahei,
body.is-yahei * {
  font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Helvetica Neue", Arial, sans-serif !important;
}

#inkpet-root.is-gone {
  visibility: hidden !important;
  pointer-events: none !important;
}

.foot-whisper {
  margin: 22px 0 0;
  text-align: center;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.65em;
  color: var(--muted);
  opacity: 0.75;
}

/* ---------- 响应式 ---------- */

@media (max-width: 1120px) {
  .page-notes {
    gap: 48px;
  }

  .poem-set {
    columns: 2;
    column-gap: 30px;
  }

  .poem-set > .poem:nth-child(4),
  .poem-set > .poem:nth-child(6) {
    break-before: auto;
  }

  .plate-grid--wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #inkpet-root {
    width: 184px;
    height: 184px;
  }

  #inkpet-root .inkpet-face {
    font-size: 21px;
  }

  #inkpet-root .inkpet-message {
    max-width: 210px;
  }
}

@media (max-width: 820px) {
  .site-foot {
    padding-bottom: 220px;
  }

  .gallery-sec {
    margin-top: 52px;
  }

  .ednote {
    font-size: 16px;
    line-height: 1.98;
  }

  .ednote-lead {
    margin-bottom: 28px;
  }

  .poem-set {
    columns: 2;
    column-gap: 30px;
  }

  .poem {
    margin-bottom: 24px;
  }

  .poem .poem-body {
    font-size: 15.5px;
    line-height: 1.95;
  }

  .player {
    padding: 22px 20px 20px;
  }

  .player-excerpt {
    font-size: 14.5px;
    line-height: 1.9;
  }

  .plate-grid {
    gap: 18px;
  }

  .page-notes {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
    margin-top: 64px;
    padding-top: 30px;
  }

  .judge {
    padding: 24px 22px 22px;
    margin-top: 44px;
  }

  .judge-status {
    white-space: normal;
  }

  .stat-num {
    font-size: 26px;
  }

  .lightbox {
    padding: 48px 18px 28px;
  }

  .lightbox-close {
    top: 14px;
    right: 14px;
  }

  .lightbox-fig img {
    max-height: 70vh;
  }

  #inkpet-root {
    width: 160px;
    height: 160px;
  }

  #inkpet-root .inkpet-face {
    font-size: 18px;
  }

  #inkpet-root .inkpet-message {
    max-width: 200px;
  }
}

@media (max-width: 760px) {
  .poem-set {
    columns: 1;
  }

  .poem {
    margin-bottom: 22px;
  }

  #inkpet-root {
    width: 132px;
    height: 132px;
  }

  #inkpet-root .inkpet-face {
    font-size: 16px;
  }

  #inkpet-root .inkpet-face.inkpet-small-expression {
    font-size: 13px;
  }

  #inkpet-root .inkpet-face.inkpet-medium-expression {
    font-size: 14px;
  }

  #inkpet-root .inkpet-face.inkpet-long-expression {
    font-size: 11px;
  }

  #inkpet-root .inkpet-message {
    max-width: min(180px, calc(100vw - 150px));
  }

  .site-foot {
    padding-bottom: 190px;
  }
}

@media (max-width: 560px) {
  .plate-grid,
  .plate-grid--wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .judge-actions {
    flex-direction: column;
  }

  .judge-btn {
    width: 100%;
    min-width: 0;
  }

  .verdict-mark {
    width: 96px;
    height: 96px;
  }

  .verdict-caption {
    font-size: 10px;
  }

  .player-head {
    gap: 14px;
  }

  .player-title {
    font-size: 15.5px;
  }

  .player-toggle {
    width: 42px;
    height: 42px;
    line-height: 40px;
  }

  .stats {
    gap: 12px;
  }

  .stat-num {
    font-size: 23px;
  }

  .revlog li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .plate img,
  .rel-title {
    transition: none;
  }

  .verdict-spinner,
  .verdict-mark {
    animation: none;
  }

  .pet-hint {
    animation: none;
  }
}
