/* 乡土调查员 · 纸墨手记风（宣纸底 / 墨字 / 朱砂印；无渐变无 emoji） */
:root {
  --paper: #eef2ec;
  --paper-2: #e2ebe1;
  --ink: #24413d;
  --ink-2: #4a6157;
  --ink-3: #7d9188;
  --line: #c3d2c6;
  --cinnabar: #b5543f;
  --cinnabar-2: #9c4534;
  --green: #2f5d62;
  --gold: #b0713a;
  --shadow: 0 1px 0 rgba(70, 100, 82, .18), 0 6px 18px -10px rgba(35, 62, 50, .38);
  --radius: 6px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper);
  color: var(--ink);
  font-family: "Noto Serif SC", "Source Han Serif SC", "SimSun", "Songti SC", serif;
  line-height: 1.75;
  background-image: radial-gradient(rgba(60, 95, 75, .05) 1px, transparent 1px);
  background-size: 22px 22px;
}
#app { max-width: 1020px; margin: 0 auto; padding: 18px 16px 60px; }
a { color: var(--cinnabar); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 700; letter-spacing: .04em; }
h1 { font-size: 26px; margin: 10px 0 6px; }
h2 { font-size: 19px; margin: 26px 0 10px; padding-left: 10px; border-left: 4px solid var(--cinnabar); }
h3 { font-size: 16px; margin: 8px 0; }
p { margin: 8px 0; }
.empty { color: var(--ink-3); padding: 26px 0; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.hint { color: var(--ink-3); font-size: 13px; }

/* 首页 hero */
.hero { text-align: center; padding: 34px 12px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2); position: relative; box-shadow: var(--shadow); }
.hero::after { content: "乡土"; position: absolute; right: 18px; top: 16px; width: 46px; height: 46px; line-height: 46px; text-align: center; color: #fff; background: var(--cinnabar); border-radius: 4px; font-size: 15px; letter-spacing: 2px; opacity: .92; transform: rotate(6deg); }
.hero-badge { display: inline-block; border: 1px solid var(--line); background: #fff9; padding: 2px 12px; border-radius: 999px; font-size: 12px; color: var(--ink-2); margin-bottom: 10px; }
.hero h1 { font-size: 40px; margin: 6px 0 0; letter-spacing: .18em; }
.hero-sub { color: var(--ink-2); letter-spacing: .3em; margin: 4px 0 12px; }
.hero-saying { font-size: 15px; color: var(--ink-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: inline-block; padding: 6px 18px; margin: 6px 0 14px; }
.hero-stat { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 8px 0 14px; }
.hero-nav { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* chips 与按钮 */
.chip { display: inline-block; border: 1px solid var(--line); background: #fff8; border-radius: 999px; padding: 1px 10px; font-size: 12px; color: var(--ink-2); }
.chip.big { font-size: 14px; padding: 3px 14px; }
.chip.ok { border-color: var(--green); color: var(--green); }
.chip.bad { border-color: var(--cinnabar); color: var(--cinnabar); }
.chip.ghost { background: transparent; }
.chip.sm { font-size: 11px; padding: 0 8px; }
.btn { display: inline-block; border: 1px solid var(--ink-2); background: var(--paper-2); color: var(--ink); border-radius: var(--radius); padding: 6px 16px; font-size: 14px; cursor: pointer; font-family: inherit; letter-spacing: .05em; }
.btn:hover { background: #fff; text-decoration: none; }
.btn.primary { background: var(--cinnabar); border-color: var(--cinnabar); color: #fff; }
.btn.primary:hover { background: #9c4534; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 2px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 章节/村落卡 */
.sec-sub { color: var(--ink-2); font-size: 14px; margin-top: 0; }
.chgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.chcard { display: flex; gap: 12px; border: 1px solid var(--line); background: #fff7; border-radius: var(--radius); padding: 12px; color: inherit; box-shadow: var(--shadow); }
.chcard:hover { background: #fff; text-decoration: none; }
.chcard.read { background: var(--paper-2); }
.chno { flex: 0 0 auto; width: 40px; height: 40px; border: 1px solid var(--cinnabar); color: var(--cinnabar); border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.chbody { min-width: 0; }
.chtitle { font-weight: 700; font-size: 16px; }
.chtheme { font-size: 12px; color: var(--cinnabar); border: 1px solid var(--cinnabar); padding: 0 6px; border-radius: 999px; margin-left: 4px; font-weight: 400; }
.chblurb { font-size: 13px; color: var(--ink-2); margin: 4px 0; }
.chmeta { display: flex; gap: 6px; flex-wrap: wrap; }
.vilgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.vilcard { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; color: inherit; background: #fff7; box-shadow: var(--shadow); }
.vilcard:hover { background: #fff; text-decoration: none; }
.vilname { font-size: 18px; font-weight: 700; }
.viltype { font-size: 12px; color: var(--ink-3); margin: 2px 0 6px; }
.vilprog { font-size: 12px; color: var(--green); }

/* 章节详情 */
.crumb { margin: 8px 0; font-size: 13px; }
.geo-chip { color: var(--gold); font-size: 13px; margin: 0; }
.concgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.conc { border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: var(--radius); padding: 10px 12px; background: #fff7; }
.conc-name { font-weight: 700; }
.conc-def { font-size: 13px; color: var(--ink-2); }
.excerpt { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--cinnabar); background: #fff9; border-radius: var(--radius); }
.extag { display: inline-block; font-size: 11px; color: #fff; background: var(--cinnabar); border-radius: 3px; padding: 0 6px; margin-right: 8px; vertical-align: 2px; }
.tasks { padding-left: 20px; }
.tasks .hint { margin-left: 6px; }
.action-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }

/* 村落 */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin: 14px 0; }
.tabs a { padding: 6px 14px; color: var(--ink-2); border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0; }
.tabs a.on { background: var(--paper-2); border-color: var(--line); color: var(--ink); font-weight: 700; }
.progress-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.gtab, .atab, .ctab { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff7; }
.gtab th, .atab th, .ctab th, .gtab td, .atab td, .ctab td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.gtab th, .atab th, .ctab th { background: var(--paper-2); width: 130px; white-space: nowrap; }
.vmap { width: 100%; max-width: 640px; display: block; margin: 0 auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff7; box-shadow: var(--shadow); }
.npcgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.npccard { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; background: #fff7; }
.npc-name { font-weight: 700; font-size: 16px; }
.npc-role { color: var(--cinnabar); font-size: 12px; margin: 2px 0 6px; }
.npc-knows { font-size: 12px; color: var(--ink-2); margin-bottom: 8px; }
.findlist .find { border: 1px dashed var(--line); border-radius: var(--radius); padding: 8px 12px; margin: 6px 0; color: var(--ink-3); }
.findlist .find.on { border: 1px solid var(--gold); color: var(--ink); background: #fff9; }
.findlist .find.on b { color: var(--gold); }

/* 地图观察 */
.mapwrap { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 760px) { .mapwrap { grid-template-columns: 1fr; } }
.sidepanel { border: 1px solid var(--line); border-radius: var(--radius); background: #fff7; padding: 12px; min-height: 200px; box-shadow: var(--shadow); }
.fnote { color: var(--ink-2); font-size: 14px; }
.ask { margin: 10px 0 4px; font-size: 14px; }
.opts { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.opt { font-size: 14px; }
.ask-result { margin-top: 8px; padding: 8px 10px; border-radius: var(--radius); font-size: 13px; }
.ask-result.ok { border: 1px solid var(--green); color: var(--green); background: #e7efe9; }
.ask-result.bad { border: 1px solid var(--cinnabar); color: var(--cinnabar-2); background: #f7ece7; }
.okline { color: var(--green); font-size: 13px; }
.badline { color: var(--cinnabar-2); font-size: 13px; }
.taggrid, .tagrow { display: flex; flex-wrap: wrap; gap: 8px; }
.tagpick { border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 13px; background: #fff8; cursor: pointer; }
.tagpick.sm { font-size: 12px; padding: 2px 8px; }
.tagpick input { vertical-align: -2px; }
.tagfrom { color: var(--ink-3); font-size: 11px; margin-left: 4px; }
svg .fm { cursor: pointer; outline: none; }
svg .fm:focus text, svg .fm:hover text { fill: var(--cinnabar); }
svg .fm.seen > g { opacity: .95; }
svg .fm.seen text { fill: var(--green); }
svg .fm.seen > g:first-child { filter: none; }
svg .fm.seen circle:first-child, svg .fm.seen rect:first-child { stroke: var(--green); }

/* 访谈 */
.npctabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 12px; }
.npctab { border: 1px solid var(--line); background: #fff8; border-radius: var(--radius); padding: 6px 12px; cursor: pointer; font-family: inherit; font-size: 14px; }
.npctab span { display: block; font-size: 11px; color: var(--ink-3); }
.npctab.on { border-color: var(--cinnabar); background: var(--paper-2); box-shadow: var(--shadow); }
.modebadge { font-size: 12px; color: var(--ink-3); margin: 0; }
.chatwrap { border: 1px solid var(--line); border-radius: var(--radius); background: #fff9; box-shadow: var(--shadow); }
.chatlog { height: 340px; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.bub { max-width: 86%; }
.bub .bub-text { padding: 10px 14px; border-radius: 10px; font-size: 15px; white-space: pre-wrap; }
.bub.me { align-self: flex-end; }
.bub.me .bub-text { background: var(--cinnabar); color: #fff; border-bottom-right-radius: 2px; }
.bub.npc { align-self: flex-start; }
.bub.npc .bub-text { background: var(--paper-2); border: 1px solid var(--line); border-bottom-left-radius: 2px; }
.bub-sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.ansmeta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.chatbar { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chatbar input { flex: 1; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; font-family: inherit; font-size: 15px; background: #fff; }
.mat { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; margin: 8px 0; background: #fff7; }
.mat-meta { font-size: 12px; color: var(--ink-2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mat-text { font-size: 14px; margin-top: 4px; }

/* 分析 */
.score-ring { display: inline-flex; align-items: baseline; border: 2px solid var(--cinnabar); color: var(--cinnabar); border-radius: 50%; width: 72px; height: 72px; align-items: center; justify-content: center; font-size: 22px; }
.score-ring small { font-size: 12px; margin-left: 2px; }
.atab tr.ok td { background: #e7efe9; }
.atab td i { color: var(--ink-3); }
.atab td:nth-child(4) { font-weight: 700; }

/* 报告 */
textarea#report-text { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; font-family: inherit; font-size: 14px; line-height: 1.8; background: #fff9; }
.gradebox { border: 1px solid var(--gold); border-radius: var(--radius); background: #fff9; padding: 12px 16px; margin-top: 12px; }
.grade-score { font-size: 18px; color: var(--gold); font-weight: 700; }
.reportpre { white-space: pre-wrap; font-family: inherit; border: 1px dashed var(--line); padding: 12px; border-radius: var(--radius); background: #fff9; max-height: 320px; overflow: auto; }
.demo-note { border: 1px dashed var(--gold); color: var(--gold); background: #fff9; padding: 8px 12px; border-radius: var(--radius); font-size: 13px; }

/* 教师端 */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 10px 0; }
.kpi { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; text-align: center; background: #fff7; }
.kpi b { font-size: 24px; color: var(--cinnabar); display: block; }
.kpi span { font-size: 12px; color: var(--ink-2); }
.atab td.mis { font-size: 12px; color: var(--ink-2); max-width: 280px; }
.formrow { display: flex; gap: 10px; align-items: center; margin: 8px 0; }
.formrow label { flex: 0 0 84px; font-size: 14px; color: var(--ink-2); }
.formrow select, .formrow input { flex: 1; border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 10px; font-family: inherit; background: #fff; max-width: 460px; }
.task, .review { border: 1px solid var(--line); border-radius: var(--radius); background: #fff7; padding: 12px 16px; margin: 10px 0; box-shadow: var(--shadow); }
.review-head { margin-bottom: 6px; }
.verdict-in { flex: 1; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px; font-family: inherit; min-width: 200px; }

/* 成就 */
.lvlbar { height: 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff8; overflow: hidden; }
.lvl-fill { height: 100%; background: var(--cinnabar); }
.achgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.ach { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; color: var(--ink-3); background: #fff5; }
.ach.on { border-color: var(--gold); color: var(--ink); background: #fff9; box-shadow: var(--shadow); }
.ach-name { font-weight: 700; }
.ach.on .ach-name { color: var(--gold); }
.ach-desc { font-size: 12px; }

/* 设置 */
.promptcard { border: 1px solid var(--line); border-radius: var(--radius); background: #fff7; padding: 12px 16px; margin: 10px 0; }
.prompt-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.promptpre { white-space: pre-wrap; font-family: "FangSong", "STFangsong", serif; font-size: 13px; border: 1px dashed var(--line); border-radius: var(--radius); padding: 10px; max-height: 220px; overflow: auto; background: #fff9; }
.foot { text-align: center; color: var(--ink-3); font-size: 12px; margin-top: 40px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--paper); padding: 8px 20px; border-radius: 999px; font-size: 14px; opacity: 0; transition: all .3s; z-index: 99; pointer-events: none; max-width: 90vw; }
.toast.on { opacity: .95; transform: translateX(-50%) translateY(0); }

@media print { .toast, .btn { display: none; } }


/* ============================================================
 * 质感升级层（夜跑阶段A）：手绘田野手账风
 * ============================================================ */

/* hero 场景插画与手账元素 */
.hero-scenewrap { position: relative; margin: 10px auto 4px; max-width: 560px; }
.heroscene { width: 100%; display: block; filter: sepia(.08); }
.hero-anno {
  position: absolute; right: -6px; top: 6px;
  font-family: "Kaiti SC", "KaiTi", "STKaiti", serif;
  color: var(--cinnabar); font-size: 13px; line-height: 1.4;
  writing-mode: vertical-rl; letter-spacing: .18em;
  border-right: 1px solid var(--cinnabar);
  padding: 6px 4px 6px 8px; opacity: .85;
  background: rgba(244, 239, 226, .6);
}
.tapenote {
  position: absolute; left: -8px; bottom: -6px;
  background: rgba(106, 143, 113, .18);
  border-left: 3px solid rgba(106, 143, 113, .5);
  border-right: 3px solid rgba(106, 143, 113, .5);
  color: var(--ink-2); font-size: 12px; padding: 3px 16px;
  transform: rotate(-2.5deg); letter-spacing: .2em;
}
.hero-saying { margin-top: 16px; }

/* 章节卡：纸纹 + 印章 + 微动效 */
.chcard {
  position: relative; overflow: hidden;
  background-image: repeating-linear-gradient(0deg, transparent 0 26px, rgba(60, 95, 75, .06) 26px 27px);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.chcard:hover { transform: translateY(-3px); box-shadow: 0 2px 0 rgba(70, 100, 82, .18), 0 14px 26px -12px rgba(35, 62, 50, .48); text-decoration: none; }
.chcard:hover .chno { transform: rotate(-2deg) scale(1.06); }
.chno {
  background: var(--cinnabar); color: #f0f5ee;
  border: none; border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(255, 245, 225, .35), 0 2px 5px -2px rgba(130, 55, 42, .6);
  transform: rotate(-3deg);
  transition: transform .18s ease;
  font-weight: 700;
}
.stamp-read {
  position: absolute; top: 8px; right: 10px;
  border: 2px solid var(--green); color: var(--green);
  padding: 0 7px; font-size: 12px; letter-spacing: .3em;
  transform: rotate(7deg); border-radius: 3px;
  background: rgba(255, 255, 255, .4); opacity: .9;
  font-weight: 700;
}

/* 村落卡：脊色 + 悬停 */
.vilcard { position: relative; border-left: 5px solid var(--spine, #7a5a38); background-image: repeating-linear-gradient(0deg, transparent 0 26px, rgba(60, 95, 75, .06) 26px 27px); transition: transform .18s ease, box-shadow .18s ease; }
.vilcard:hover { transform: translateY(-3px); box-shadow: 0 2px 0 rgba(70, 100, 82, .18), 0 14px 26px -12px rgba(35, 62, 50, .48); text-decoration: none; }
.vilcard::after {
  content: "村"; position: absolute; right: 10px; top: 10px;
  width: 26px; height: 26px; line-height: 26px; text-align: center;
  background: var(--spine, #7a5a38); color: #f0f5ee;
  border-radius: 3px; font-size: 13px; transform: rotate(6deg);
  opacity: .9;
}

/* 按钮微动效 */
.btn { transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -8px rgba(150, 65, 50, .7); }

/* 地图图例（HTML，随图渲染） */
.maplegend { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; margin: 8px auto 0; max-width: 640px; font-size: 12px; color: var(--ink-2); }
.maplegend .lg { display: inline-flex; align-items: center; gap: 5px; }
.maplegend .lg i { width: 12px; height: 12px; border-radius: 2px; border: 1px solid #2b3a33; display: inline-block; }

/* 标题手账感：双线尾饰 */
.sec h2 { display: flex; align-items: center; gap: 10px; }
.sec h2::after { content: ""; flex: 1; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); height: 3px; opacity: .7; }

/* 表格斑马纹 */
.atab tr:nth-child(even) td, .ctab tr:nth-child(even) td, .gtab tr:nth-child(even) td { background: rgba(255, 255, 255, .5); }

/* ============================================================
 * 移动端适配（≤760px）
 * ============================================================ */
@media (max-width: 760px) {
  #app { padding: 12px 10px 50px; }
  h1 { font-size: 21px; }
  .hero { padding: 24px 10px 18px; }
  .hero h1 { font-size: 30px; letter-spacing: .12em; }
  .hero::after { width: 36px; height: 36px; line-height: 36px; font-size: 12px; right: 10px; top: 10px; }
  .hero-anno { font-size: 11px; right: -2px; }
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .tabs a { white-space: nowrap; flex: 0 0 auto; }
  .gtab, .atab, .ctab { display: block; overflow-x: auto; white-space: nowrap; }
  .chatlog { height: 300px; padding: 10px; }
  .bub { max-width: 94%; }
  .score-ring { width: 60px; height: 60px; font-size: 18px; }
  .hero-nav { gap: 6px; }
  .btn { padding: 6px 12px; font-size: 13px; }
  .review .action-row { flex-direction: column; align-items: stretch; }
  .verdict-in { min-width: 0; }
  .kpi b { font-size: 20px; }
  .reportpre { max-height: 220px; }
}


/* ============================================================
 * 批注框与打印样式（夜跑阶段C · 方向一/方向六）
 * ============================================================ */
.notebox { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 6px; }
.notebox summary { font-size: 12px; color: var(--gold); cursor: pointer; user-select: none; }
.notebox .note-text {
  width: 100%; min-height: 64px; margin-top: 6px;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 10px; font-family: "Kaiti SC", "KaiTi", "STFangsong", serif;
  font-size: 14px; line-height: 1.7; background: #fffdf6; color: var(--ink);
  resize: vertical;
}
details.notebox { margin: 8px 0 0; }

/* 打印：只输出 #print-sheet */
#print-sheet { display: none; }
@media print {
  body * { visibility: hidden !important; }
  #print-sheet, #print-sheet * { visibility: visible !important; }
  #print-sheet {
    display: block !important; position: absolute; inset: 0 auto auto 0;
    width: 100%; background: #fff; color: #111; padding: 24px;
  }
  #print-sheet h1 { font-size: 16pt; margin: 0 0 12px; border-bottom: 2px solid #333; padding-bottom: 6px; }
  #print-sheet .ps-line {
    white-space: pre-wrap; font-family: "Noto Serif SC", "SimSun", serif;
    font-size: 12pt; line-height: 1.8; margin: 0 0 4px;
    border: none; background: none; padding: 0;
  }
  .toast, .btn { display: none !important; }
}


/* ============================================================
 * 视觉二轮（用户反馈"还是不好看"后的大改）：
 * 宣纸肌理 / 手账双线边框 / 宽幅横卷场景 / 章节水印 / 波浪标题
 * ============================================================ */

/* 全页宣纸：肌理 + 原点网格双层 */
body {
  background-color: #edf2ec;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 0.24 0 0 0 0 0.32 0 0 0 0 0.26 0 0 0 0.055 0'/></filter><rect width='240' height='240' filter='url(%23g)'/></svg>"), radial-gradient(rgba(60, 95, 75, .05) 1px, transparent 1px);
  background-size: 240px 240px, 22px 22px;
}
/* 手账双线边框（固定视口，不随滚动） */
body::after {
  content: ""; position: fixed; inset: 10px;
  border: 1px solid rgba(70, 100, 82, .42);
  outline: 1px solid rgba(70, 100, 82, .22);
  outline-offset: 3px;
  pointer-events: none; z-index: 60;
}

/* 宽幅横卷场景 */
.hero-scenewrap {
  position: relative; margin: 16px -4px 2px; max-width: none;
  border: 1px solid var(--line); border-radius: 4px;
  background: #f7f2e3;
  box-shadow: 0 2px 0 rgba(70, 100, 82, .12), 0 10px 22px -14px rgba(35, 62, 50, .5);
  overflow: hidden;
}
.heroscene { width: 100%; display: block; }
.scene-cap {
  text-align: center; font-size: 11px; letter-spacing: .25em;
  color: var(--ink3); padding: 4px 0 8px;
  border-top: 1px dashed var(--line);
}
/* 胶带（左右上角） */
.tape {
  position: absolute; top: -9px; width: 96px; height: 24px;
  background: rgba(106, 143, 113, .22);
  border-left: 3px solid rgba(106, 143, 113, .45);
  border-right: 3px solid rgba(106, 143, 113, .45);
  z-index: 2;
}
.tape.tl { left: 7%; transform: rotate(-4deg); }
.tape.tr { right: 7%; transform: rotate(3.5deg); }
.tapenote {
  position: static; margin: 8px auto 0; display: table;
  transform: rotate(-.5deg);
}

/* 章节卡：对口村脊色 + 章号大水印 */
.chcard { border-left: 5px solid var(--spine, #b5543f); }
.chcard::before {
  content: attr(data-no);
  position: absolute; right: 8px; top: -18px;
  font-size: 76px; line-height: 1; font-weight: 700;
  color: rgba(181, 84, 63, .1);
  pointer-events: none; font-family: Georgia, "Times New Roman", serif;
}
.chcard:hover::before { color: rgba(181, 84, 63, .16); }

/* 村落图腾 */
.vilglyph { width: 26px; height: 26px; display: inline-block; vertical-align: -7px; margin-right: 7px; }
.vilglyph svg { width: 100%; height: 100%; display: block; }

/* 标题手账感：墨色短杠 + 朱砂波浪线 */
.sec h2::after {
  content: ""; flex: 1; height: 7px; border: none; opacity: .8;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='7'><path d='M0,4 q7,-5 14,0 t14,0' fill='none' stroke='%232f5d62' stroke-width='1.1' opacity='.55'/></svg>") repeat-x left center / 28px 7px;
}

/* 页脚：虚线 + 居中印章点 */
.foot { border-top: 1px dashed var(--line); padding-top: 16px; position: relative; }
.foot::before {
  content: "勘"; position: absolute; top: -13px; left: 50%; transform: translateX(-50%) rotate(-4deg);
  width: 26px; height: 26px; line-height: 26px; text-align: center;
  background: var(--paper); color: var(--cinnabar);
  border: 1.5px solid var(--cinnabar); border-radius: 4px; font-size: 13px;
}

/* 打印隐藏边框 */
@media print { body::after { display: none !important; } }

/* 移动端微调 */
@media (max-width: 760px) {
  body::after { inset: 6px; }
  .chcard::before { font-size: 56px; top: -12px; }
  .tape { width: 64px; height: 18px; }
  .hero-anno { writing-mode: horizontal-rl; border-right: none; border-left: 3px solid var(--cinnabar); padding: 2px 8px; right: 6px; top: 6px; background: rgba(244, 239, 226, .85); }
  .scene-cap { letter-spacing: .12em; }
}

/* ============================================================
 * 概念罗盘 + 调查本（驻村探案）
 * ============================================================ */
.compasswrap { text-align: center; padding: 6px 0 2px; }
.compass-svg { width: min(430px, 94%); height: auto; }
.compass-svg.compact { width: min(330px, 88%); }
.compass-svg a { cursor: pointer; }
.compass-svg a:hover circle { stroke: var(--cinnabar); stroke-width: 1.6; }
.conc-detail .atab td:first-child { width: 46%; color: var(--ink-2); }

.casecard {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(255, 255, 255, .5);
  padding: 12px 14px; margin: 10px 0;
}
.casecard h3 { margin: 0 0 4px; }
.caseitems { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; align-items: flex-start; }
.caseheard {
  border-left: 3px solid var(--green);
  background: rgba(255, 255, 255, .55);
  padding: 8px 12px; border-radius: 4px; width: 100%;
  box-sizing: border-box;
}
.caseheard-head { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; flex-wrap: wrap; }
.casetext { font-size: 14px; line-height: 1.7; }
.caselock {
  color: var(--ink-3); font-size: 13px;
  border: 1px dashed var(--line); border-radius: 4px; padding: 6px 10px;
}
.cmap-mark { cursor: pointer; outline: none; }
.cmap-mark:hover text, .cmap-mark:focus text { fill: var(--cinnabar); }
textarea#case-text {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; font-family: inherit; font-size: 14px; line-height: 1.8;
  background: rgba(255, 255, 255, .6); box-sizing: border-box;
}
@media (max-width: 760px) {
  .compass-svg, .compass-svg.compact { width: 100%; }
}
