/* 章节页:编辑式长卷版面(窄文字栏 + 宽图),图文穿插。各章共用。 */

.chapter-page { font-size: 17px; line-height: 1.9; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 16px;
  padding: 10px var(--gutter); background: rgba(242, 237, 228, .94); border-bottom: 1px solid var(--rule);
  font-size: 14px;
}
.topbar a { color: var(--ink-soft); text-decoration: none; }
.topbar a:hover { color: var(--ink); }
.topbar-title { flex: 1; text-align: center; font-family: var(--font-title); letter-spacing: .12em; }
.topbar .sound-toggle { margin: 0; width: 32px; height: 32px; }

/* 版心:文字窄栏,.wide 撑到 960 */
.article { max-width: 680px; margin: 0 auto; padding: 0 16px 120px; }
.article figure { margin: 32px 0; }
/* 写成 .article .wide,优先级要高过上一行,否则居中会被 margin 盖掉 */
.article .wide { width: min(960px, calc(100vw - 32px)); margin-left: calc(50% - min(480px, 50vw - 16px)); }
.article figure img { width: 100%; height: auto; }
.article figcaption { font-size: 13px; color: var(--sea-text); margin-top: 8px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* 开篇 */
.opener { padding: 12vh 0 24px; }
.kicker { font: 600 13px/1.4 var(--font-title); letter-spacing: .3em; color: var(--seal); margin-bottom: 20px; }
.opener h1 { font: 700 clamp(40px, 7vw, 72px)/1.2 var(--font-display); line-height: 1.35; letter-spacing: .04em; margin-bottom: 32px; }
.lead { font-size: 19px; }

/* 小节 */
.sec { padding: 72px 0 24px; }
.sec h2 { font-size: clamp(24px, 3.4vw, 32px); margin-bottom: 24px; display: flex; align-items: baseline; gap: 14px; }
.sec h2 span { font-size: .8em; color: var(--stone); }
.rhythm { font: 500 12px/1 var(--font-latin); letter-spacing: .2em; color: var(--sea-text); margin-bottom: 14px; }
.rhythm b { color: var(--seal); font-weight: 700; }

/* 史料引文 */
.source {
  margin: 28px 0; padding: 20px 24px; background: var(--paper);
  border-left: 3px solid var(--seal); font-family: var(--font-quote); font-size: 19px; line-height: 2;
}
.source p { margin: 0; }
.source cite { display: block; margin-top: 10px; font: normal 13px var(--font-body); color: var(--sea-text); }

details.ask, details.deep { border-top: 1px solid var(--rule); padding: 14px 0; }
details summary { cursor: pointer; font-family: var(--font-title); font-weight: 600; letter-spacing: .04em; list-style: none; }
details summary::before { content: "＋"; color: var(--seal); margin-right: .6em; }
details[open] summary::before { content: "－"; }
details > :not(summary) { margin-top: 14px; }

/* 先猜组件 */
.guess { margin: 28px 0; padding: 24px; border: 1px solid var(--ink); background: rgba(232, 217, 196, .35); }
.guess-q { font-family: var(--font-title); font-weight: 600; font-size: 19px; }
.guess-row { display: flex; gap: 16px; align-items: center; margin: 8px 0 16px; }
.guess-row input { flex: 1; accent-color: var(--seal); }
.guess-val { min-width: 6.5em; text-align: right; font: 600 22px var(--font-num); color: var(--stone); }
.guess-scale { position: relative; height: 56px; margin: 8px 0 12px; border-bottom: 2px solid var(--ink); }
.guess-mark { position: absolute; bottom: 0; transform: translateX(-50%); font-size: 13px; white-space: nowrap; padding-bottom: 8px; }
.guess-mark::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px; border-radius: 50%; transform: translateX(-50%); }
.guess-mark--mine { color: var(--sea-text); bottom: 26px; }
.guess-mark--mine::after { background: var(--lime); border: 2px solid var(--sea); bottom: -33px; }
.guess-mark--real { color: var(--seal); font-weight: 700; }
.guess-mark--real::after { background: var(--seal); }
.guess-verdict { font-family: var(--font-title); font-weight: 600; color: var(--seal); margin-bottom: 4px; }

/* 规模方块阵 */
.box-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14px, 1fr)); gap: 3px; margin: 8px 0; }
.box-grid span { aspect-ratio: 1; }
.box-grid .is-real { background: var(--gold); animation: pop .3s var(--ease) both; }
.box-grid .is-mine { outline: 1.5px solid var(--sea); outline-offset: -1.5px; }
.box-grid .is-real.is-mine { outline-color: var(--ink); }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
.sw { display: inline-block; width: 12px; height: 12px; margin: 0 6px 0 14px; vertical-align: -1px; }
.sw-real { background: var(--gold); margin-left: 0; }
.sw-mine { outline: 1.5px solid var(--sea); outline-offset: -1.5px; }

/* 图 */
.fig-canvas { width: 100%; aspect-ratio: 16 / 8; display: block; border: 1px solid var(--ink); background: var(--lime); }
.fig-canvas--burn { aspect-ratio: 16 / 7; }
@media (max-width: 600px) { .fig-canvas, .fig-canvas--burn { aspect-ratio: 4 / 3; } }

/* 滚动搭建:桌面左图右文,手机图吸顶 */
/* 用 margin 居中撑宽(不用 transform,免得影响里面的 sticky 定位) */
.scrolly { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 32px; width: min(1040px, calc(100vw - 32px)); margin-left: calc(50% - min(520px, 50vw - 16px)); }
.scrolly-fig { position: sticky; top: 72px; align-self: start; margin: 0 !important; }
.scrolly-steps > div { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; opacity: .65; transition: opacity .4s; }   /* .65 时文字对比仍有 4.9:1 */
.scrolly-steps > div.is-active { opacity: 1; }
.scrolly-steps > div:last-child { min-height: 50vh; }
@media (max-width: 820px) {
  .scrolly { grid-template-columns: 1fr; gap: 0; }
  .scrolly-fig { top: 52px; z-index: 2; background: var(--lime); padding-bottom: 8px; }
  .scrolly-steps > div { min-height: 60vh; }
}

/* 解谜 */
.pool-stage { position: relative; }
.tide { position: absolute; right: 8px; top: 8px; width: 10px; height: 80px; border: 1px solid var(--ink); background: var(--lime); }
.tide-bar { position: absolute; left: 0; right: 0; bottom: 0; background: var(--sea); }
.tide-sill { position: absolute; left: -4px; right: -4px; bottom: 50%; border-top: 2px solid var(--seal); }
.tide-text { font-size: 13px; color: var(--sea-text); margin: 8px 0 12px; }
.tool-tray { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tool {
  padding: .55em 1.1em; border: 1px solid var(--ink); background: var(--lime);
  font-family: var(--font-title); letter-spacing: .1em; transition: background .15s, color .15s;
}
.tool:hover { background: var(--stone); color: var(--lime); border-color: var(--stone); }
.tool:active { transform: translateY(1px); }
.pool-log { list-style: none; padding: 0; margin: 0 0 12px; min-height: 7.5em; font-size: 15px; }
.pool-log li { padding: 4px 0 4px 12px; border-left: 3px solid var(--gold); color: var(--ink-soft); }
.pool-log li:first-child { color: var(--ink); border-left-color: var(--seal); }

/* 对照表 */
.cmp { width: 100%; border-collapse: collapse; font-size: 15px; margin: 16px 0; }
.cmp th, .cmp td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.cmp thead th { font-family: var(--font-title); border-bottom: 1px solid var(--ink); }
.cmp tbody th { font-family: var(--font-title); white-space: nowrap; color: var(--stone); }
.cmp tr.is-miss td { color: var(--seal); }
.reveal-sum { font-size: 19px; }
.reveal-sum b { color: var(--seal); }

/* 日历 */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; max-width: 420px; margin: 16px 0; font: 500 14px var(--font-num); text-align: center; }
.cal b { font: 600 12px var(--font-title); color: var(--sea-text); }
.cal span { padding: 8px 0; position: relative; }
.cal .is-on { background: var(--seal); color: var(--lime); animation: pop .3s var(--ease) both; }
.cal .is-pause { outline: 1.5px dashed var(--seal); outline-offset: -1.5px; color: var(--seal); }
.cal small { display: block; font: 600 10px var(--font-title); line-height: 1; }

/* 深挖 */
.reasons label { display: block; padding: 6px 0; cursor: pointer; }
.reasons input { accent-color: var(--seal); margin-right: 8px; }
.reasons .btn { margin-top: 8px; }
.clip-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.clip { padding: 0; border: 1px solid var(--rule); background: none; text-align: left; font-size: 12px; }
.clip img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.clip span { display: block; padding: 6px; }
.clip-player { width: 100%; margin-top: 12px; background: var(--ink); }
@media (max-width: 600px) { .clip-strip { grid-template-columns: repeat(2, 1fr); } }

/* 线索卡 */
.clue { margin: 56px 0 32px; padding: 28px; background: var(--stone); color: var(--lime); }
.clue .kicker { color: var(--gold-text); }
.clue .btn:disabled { opacity: 1; background: transparent; border-color: var(--gold-text); color: var(--gold-text); }
.clue-next { border-top: 1px solid rgba(242, 237, 228, .3); padding-top: 14px; font-family: var(--font-title); }
.source-list { font-size: 13px; color: var(--ink-soft); padding-left: 1.2em; }
.source-list a { color: var(--stone); }
.opener .script { display: block; margin-top: 10px; font: 400 clamp(24px, 3vw, 36px)/1.1 var(--font-script); color: var(--seal); letter-spacing: 0; }
