/* 《邕城社区行》纸片戏台版全局样式：背景是落下的纸景、纸偶插签上台；界面是白边模切的纸卡，深色描线、硬投影；只用系统字体 */

/* ======================================================================
   一、配色与基础
   ====================================================================== */
:root {
  color-scheme: light;
  --ink: #2e2219;          /* 描线与正文：深褐黑 */
  --ink-soft: #66513f;     /* 次要文字：奶油底上对比度约 6.5 */
  --line: #b9a68f;         /* 内层纸卡的边线 */
  --paper: #fffaf0;        /* 纸卡底色：奶油白 */
  --paper-2: #fbf0dd;      /* 纸卡里的浅槽：引用、说明框 */
  --cut: #ffffff;          /* 模切白边 */
  --shadow: rgba(46, 30, 16, 0.34);
  --shadow-soft: rgba(46, 30, 16, 0.16);
  --note: #fff2bf;         /* 便签黄 */
  --red: #c8402a;          /* 白字对比度约 5.0：按钮、标签 */
  --red-dark: #9c2f1c;
  --red-soft: #fde6df;
  --green: #2f7d4f;        /* 白字对比度约 5.0 */
  --green-dark: #225c3a;
  --green-soft: #e3f2e7;
  --orange: #c9701c;
  --need: #b35f12;         /* 需求线索：深橙，白字对比度约 4.6 */
  --blue: #2f6fb3;
  --wood: #4a3626;
  --radius: 16px;
  --radius-s: 11px;
  --gutter: 16px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --fs-body: clamp(16px, 1.1vw + 11px, 24px);
  /* 一级纸卡（答题卡、选项板、字幕、弹窗）：白边 + 描线 + 硬投影 */
  --card-edge: 0 0 0 2px var(--ink), 7px 9px 0 0 var(--shadow);
  /* 纸浆纤维：一张很淡的噪点小图铺在纸卡上，大屏上不再像平涂的网页卡片 */
  --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.36 0 0 0 0 0.24 0 0 0 0 0.12 0 0 0 0.07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  /* 二级纸片（选项、人物卡、槽位）：细线 + 小投影 */
  --chip-edge: 3px 4px 0 0 var(--shadow-soft);
  /* 纸偶尺寸：手机竖屏 */
  --cast-h: min(72vh, 150vw);
  --cast-w: calc(var(--cast-h) * 0.62);
  /* 模块主题色：进度条、标签、竖条等中性装饰；红色另外专用于"错误 / 风险" */
  --mod: var(--red);
  --mod-soft: var(--red-soft);
  --mod-dark: var(--red-dark);
}
[data-module="m1"] { --mod: #c8402a; --mod-soft: #fde6df; --mod-dark: #9c2f1c; }
[data-module="m2"] { --mod: #2f6fb3; --mod-soft: #e4effa; --mod-dark: #22558c; }
[data-module="m3"] { --mod: #2f7d4f; --mod-soft: #e3f2e7; --mod-dark: #225c3a; }
[data-module="m4"] { --mod: #4b6a8a; --mod-soft: #e7eef5; --mod-dark: #38536f; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--wood);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.35; }
.muted { color: var(--ink-soft); }
/* 只给读屏软件看的文字 */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* 键盘焦点：统一一圈模块色粗框，投影仪上也看得见 */
:focus-visible { outline: 3px solid var(--mod); outline-offset: 3px; }
.sheet-head h2:focus, .choice-list > h3:focus, .modal:focus { outline: none; }

/* ======================================================================
   二、按钮：白边模切的胶囊纸牌，按下去影子变短
   ====================================================================== */
.btn {
  display: inline-block;
  min-height: 48px;
  padding: 9px 28px;
  border: 3px solid var(--cut);
  border-radius: 999px;
  background: var(--mod); /* 主按钮用模块色；红色留给错误、风险和居民名牌 */
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 0 0 2px var(--ink), 4px 5px 0 0 var(--shadow);
  transition: transform 0.1s, box-shadow 0.1s, filter 0.15s;
}
.btn:active:not(:disabled) { transform: translate(2px, 3px); box-shadow: 0 0 0 2px var(--ink), 1px 1px 0 0 var(--shadow); }
.btn:disabled { background: #e9dfd2; color: var(--ink-soft); box-shadow: 0 0 0 2px var(--line); cursor: default; }
.btn-small { min-height: 42px; padding: 5px 20px; font-size: 0.9em; }
.btn-ghost { background: var(--paper); color: var(--ink); }
.btn-choice { background: var(--green); }
.btn-need { background: var(--need); }

/* ======================================================================
   三、首屏：纸景作底，标题是一块描边纸牌，模块是一排"入场券"
   ====================================================================== */
.start-screen {
  --frame: clamp(10px, 1.8vw, 34px); /* 纸框宽度，内容都退在框里面 */
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: max(6vh, 28px) calc(var(--frame) + var(--gutter)) max(8vh, 44px);
  /* 标题页纸景叠在黄昏天色的渐变上：图片缺失时仍有底色 */
  background:
    url("../../assets/images/IMG_00_TITLE.webp") center 62% / cover no-repeat,
    linear-gradient(#f2d2b0, #f7dcbc 40%, #c9c3bd 62%, #a9bccb);
  text-align: center;
}
/* 标题纸景拆层（theater.js titleSet：楼群、榕树依次翻起）时不铺整张背景图，只留底色 */
.start-screen.has-set { background: linear-gradient(#f2d2b0, #f7dcbc 40%, #c9c3bd 62%, #a9bccb); }
.start-set { position: absolute; top: 0; right: 0; bottom: 0; left: 0; overflow: hidden; pointer-events: none; }
/* 纸框：原来画在主图里，现在用 CSS 画一个硬纸板立体书框——两级台阶往里收，每级描一道墨线，
   纸板中间一道压痕虚线，最里面一圈阴影压在纸景边上 */
.start-screen::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  pointer-events: none;
  border: var(--frame) solid #c9a273;
  outline: 2px dashed rgba(94, 60, 30, 0.38);
  outline-offset: calc(var(--frame) / -2);
  box-shadow:
    inset 0 0 0 2px #4b2e17,
    inset 0 0 0 calc(var(--frame) * 0.32) #b38757,
    inset 0 0 0 calc(var(--frame) * 0.32 + 2px) #4b2e17,
    inset 0 0 0 calc(var(--frame) * 0.6) #9c7244,
    inset 0 0 0 calc(var(--frame) * 0.6 + 2px) #4b2e17,
    inset 0 calc(var(--frame) * 0.5) calc(var(--frame) * 0.9) calc(var(--frame) * 0.5) rgba(46, 26, 10, 0.42);
}
.start-actions { position: relative; z-index: 2; }
.start-inner {
  position: relative;
  z-index: 2;
  padding: 18px clamp(26px, 4vw, 56px) 20px;
  border: 5px solid var(--cut);
  border-radius: 22px;
  background: var(--paper-grain), var(--paper);
  box-shadow: 0 0 0 3px var(--ink), 10px 12px 0 0 var(--shadow);
}
.start-kicker {
  position: absolute;
  left: 50%;
  top: 0;
  margin: 0;
  padding: 2px 16px;
  border: 3px solid var(--cut);
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 0.78em;
  font-weight: 700;
  letter-spacing: 0.16em;
  white-space: nowrap;
  box-shadow: 0 0 0 2px var(--ink);
  transform: translate(-50%, -62%) rotate(-2deg);
}
.start-title { margin: 0.25em 0 0; font-size: clamp(40px, 6vw, 92px); font-weight: 900; letter-spacing: 0.14em; line-height: 1.2; color: var(--ink); }
.start-module { margin: 0.2em 0 0; font-weight: 700; color: var(--ink-soft); }
.has-modules .start-module { display: none; }
.start-actions { width: 100%; }
.has-modules .start-actions { display: flex; flex-direction: column; align-items: center; }
.btn-start { font-size: 1.15em; padding: 12px 52px; }
.btn-start:disabled { background: var(--paper); color: var(--ink-soft); box-shadow: 0 0 0 2px var(--line), 4px 5px 0 0 var(--shadow-soft); }
.start-status {
  display: inline-block;
  margin: 0.9em 0 0;
  padding: 2px 14px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.92);
  box-shadow: 0 0 0 1.5px var(--line);
  color: var(--ink-soft);
  font-size: 0.85em;
}
.start-status:empty { display: none; }
/* 旧浏览器或非极速模式：首屏状态条改成醒目的提示 */
.start-status.is-problem { display: block; max-width: 32em; margin: 0.9em auto 0; padding: 10px 16px; border-radius: 12px; background: var(--red-soft); box-shadow: 0 0 0 2px var(--red); color: var(--red-dark); font-size: 0.95em; font-weight: 700; line-height: 1.6; }
.start-teacher {
  position: absolute;
  z-index: 2;
  right: calc(var(--frame) + 12px);
  bottom: calc(env(safe-area-inset-bottom) + var(--frame) + 10px);
  padding: 2px 12px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.9);
  box-shadow: 0 0 0 1.5px var(--line);
  color: var(--ink-soft);
  font-size: 0.8em;
  text-decoration: none;
}
.start-teacher:hover { color: var(--ink); }

/* 模块入场券：左边一条模块色票根，选中后盖一个绿色对勾 */
#start-modules {
  display: flex;
  justify-content: center;
  gap: 18px;
  width: min(1100px, calc(100vw - 2 * (var(--frame) + var(--gutter))));
  margin: 0 auto 26px;
}
.module-card {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 18px 14px 26px;
  border: 4px solid var(--cut);
  border-radius: 14px;
  background:
    linear-gradient(90deg, var(--mod) 0 10px, transparent 10px),
    var(--paper-grain),
    var(--paper);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 0 0 2px var(--ink), 5px 6px 0 0 var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}
.module-card:nth-child(odd) { transform: rotate(-0.6deg); }
.module-card:nth-child(even) { transform: rotate(0.6deg); }
.module-card:hover { transform: translateY(-4px) rotate(0); box-shadow: 0 0 0 2px var(--ink), 7px 10px 0 0 var(--shadow); }
.module-card-label { font-size: 0.78em; font-weight: 800; color: var(--mod-dark); letter-spacing: 0.1em; }
.module-card-name { font-size: 1.12em; font-weight: 800; line-height: 1.35; word-break: keep-all; overflow-wrap: anywhere; } /* 只在 main.js 插的断点处折行，实在放不下才任意断 */
.module-card-sub { font-size: 0.88em; color: var(--ink-soft); line-height: 1.5; }
.module-card[aria-pressed="true"] {
  background: linear-gradient(90deg, var(--mod) 0 10px, transparent 10px), var(--paper-grain), var(--green-soft);
  box-shadow: 0 0 0 3px var(--green-dark), 5px 6px 0 0 var(--shadow);
  transform: translateY(-4px) rotate(0);
}
.module-card[aria-pressed="true"]::after {
  content: "✓";
  position: absolute;
  top: -12px;
  right: -10px;
  width: 34px;
  height: 34px;
  border: 3px solid var(--cut);
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  line-height: 28px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--ink);
}

/* ======================================================================
   四、主界面骨架：顶栏、舞台层
   ====================================================================== */
.app {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  overflow: hidden;
}

/* 顶栏：一条奶油纸，下沿描线；左边是环节名，右边是纸签按钮 */
.topbar {
  position: absolute;
  z-index: 20;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(env(safe-area-inset-top) + 7px) var(--gutter) 9px;
  background: var(--paper-grain), var(--paper);
  box-shadow: 0 2px 0 var(--ink), 0 6px 0 var(--shadow-soft);
  font-size: 0.85em;
}
.progress-text {
  flex: 1;
  display: flex;
  gap: 10px;
  align-items: baseline;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.progress-text:focus-visible { border-radius: 6px; }
#progress-title { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#progress-title::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--mod);
  box-shadow: 0 0 0 2px var(--ink);
  vertical-align: 0.05em;
}
.progress-count { color: var(--ink-soft); white-space: nowrap; }
.progress-more { color: var(--ink-soft); font-size: 0.95em; line-height: 1; }
.btn-mute {
  min-height: 36px;
  padding: 2px 14px;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: var(--cut);
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 2px 3px 0 var(--shadow-soft);
}
.btn-mute:active { transform: translate(1px, 2px); box-shadow: none; }
.btn-mute[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
/* 笔记新增了内容：按钮用模块色闪两下 */
#notes-btn.is-updated { animation: notes-pulse 0.6s ease-out 2; }
@keyframes notes-pulse { 40% { background: var(--mod-soft); box-shadow: 0 0 0 4px var(--mod); } }
.progress-track { position: absolute; left: 0; right: 0; bottom: -2px; height: 4px; background: transparent; }
.progress-bar { height: 100%; width: 0; background: var(--mod); transition: width 0.4s; }

.stage {
  position: absolute;
  z-index: 10;
  top: 0; right: 0; bottom: 0; left: 0;
  padding: calc(env(safe-area-inset-top) + 68px) var(--gutter) calc(env(safe-area-inset-bottom) + 24px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  scroll-padding-top: calc(env(safe-area-inset-top) + 68px); /* 跳到页内某处时不压在顶栏下 */
}
.stage.is-sheet { justify-content: flex-start; padding-bottom: 0; scroll-padding-bottom: 96px; }
.stage.is-full, .stage.is-talk { padding: 0; overflow: hidden; }

/* ======================================================================
   五、纸片戏台：1920×1080 的台面按"铺满"缩放（脚本算好 transform），纸景、纸偶都在里面
   ====================================================================== */
.theater {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 38%, #5a4230 0%, #2a1d13 78%);
}
/* 台口暗角：四边压一圈暖黑，像戏台灯光只打在中间（不挡点击） */
.theater::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  pointer-events: none;
  box-shadow: inset 0 0 clamp(28px, 4vw, 72px) rgba(20, 12, 4, 0.42);
  /* 台口上方斜打下来的一束暖光，纸景和纸偶都笼在同一个光源里 */
  background: radial-gradient(ellipse 70% 58% at 46% 0%, rgba(255, 228, 176, 0.17), rgba(255, 228, 176, 0) 72%);
  transition: box-shadow 0.9s ease;
}
/* 下雨的纸景（data-rain）：顶上那束光换成冷青色，和平日走访的暖光拉开 */
.theater[data-rain]::after { background: radial-gradient(ellipse 70% 58% at 46% 0%, rgba(175, 215, 255, 0.16), rgba(175, 215, 255, 0) 72%); }
/* 局势告急（决策流变量亮警示）：暗角加深、泛暗红，台口上那束光不变 */
.theater[data-danger]::after { box-shadow: inset 0 0 clamp(60px, 10vw, 180px) rgba(120, 22, 12, 0.62); }
.paper-set { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; }
/* 竖屏：纸景只占上方 72%（见 theater.js fit），下面是一截木台板 */
@media (orientation: portrait) {
  .theater {
    background:
      linear-gradient(#1c130c, #1c130c) 0 72% / 100% 6px no-repeat,
      repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.12) 0 2px, transparent 2px 90px) 0 100% / 100% 28% no-repeat,
      linear-gradient(#8a6040, #5e4029) 0 100% / 100% 28% no-repeat,
      #2a1d13;
  }
}
/* 景深：台上有纸偶时（data-cast）纸景退后一步，饱和度和亮度都降一点，人从景里"跳"出来；
   单独合成一层，滤镜过渡交给显卡做，不带着整块纸景每帧重绘 */
.paper-scene { position: absolute; top: 0; right: 0; bottom: 0; left: 0; transition: filter 0.6s ease; will-change: filter; }
.theater[data-cast] .paper-scene { filter: saturate(0.85) brightness(0.92); }
.paper-board { position: absolute; left: 0; width: 100%; }
/* 左右镜像的纸景（CONFIG.sceneFlip）：整块翻过来 */
.paper-flip { position: absolute; top: 0; right: 0; bottom: 0; left: 0; transform: scaleX(-1); }
/* 翻过来的道具横向视差也跟着反了：系数取反，指针往右时近景照样往左错 */
.paper-flip .paper-prop { translate: calc(var(--px, 0) * var(--depth, 0) * 12px) calc(var(--py, 0) * var(--depth, 0) * -4px); }
.paper-back, .paper-prop { position: absolute; display: block; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.paper-back { top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.45)); }
/* 视差（theater.js parallax 写 --px、--py，-1 到 1）：道具按远近 --depth 错开，越靠前挪得越多；
   用单独的 translate 属性，和翻起、摇摆的 transform 叠在一起（旧内核不认 translate，就不动） */
.paper-prop {
  transform-origin: 50% 100%;
  filter: drop-shadow(3px 5px 0 rgba(20, 12, 4, 0.22));
  translate: calc(var(--px, 0) * var(--depth, 0) * -12px) calc(var(--py, 0) * var(--depth, 0) * -4px);
  transition: translate 0.9s cubic-bezier(0.2, 0.7, 0.3, 1);
}
/* 树和盆栽贴底边轻轻摆（入场动画 cancel 后释放 transform，兼容 Chromium 104 以下旧内核；暴雨场景摆得更快更大） */
.paper-prop.is-sway { animation: prop-sway 7s ease-in-out infinite alternate; }
.paper-prop.is-sway-storm { animation: prop-sway-storm 2.6s ease-in-out infinite alternate; }
@keyframes prop-sway { from { transform: rotate(-0.45deg); } to { transform: rotate(0.45deg); } }
@keyframes prop-sway-storm { from { transform: rotate(-1.1deg); } to { transform: rotate(1.35deg); } }
/* 背景板落地时整台轻轻一震 */
.theater.is-jolt .paper-scene { animation: set-jolt 0.26s ease-out; }
@keyframes set-jolt { 35% { transform: translateY(6px); } 70% { transform: translateY(-2px); } }

/* 下雨的纸景（CONFIG.sceneRain）：两层纸条雨丝斜着落，偶尔打闪；跟背景板一起落下 */
.paper-rain { position: absolute; top: 0; right: 0; bottom: 0; left: 0; overflow: hidden; pointer-events: none; }
.rain-far, .rain-near {
  position: absolute;
  top: -384px; right: -128px; bottom: 0; left: 0;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='240'><g stroke='%23eef4fa' stroke-width='3' stroke-linecap='round' opacity='.6'><path d='M62 8 52 38'/><path d='M22 66 9 105'/><path d='M74 122 64 152'/><path d='M38 176 25 215'/></g></svg>");
  will-change: transform;
}
.rain-far { background-size: 80px 240px; opacity: 0.55; animation: rain-far 0.9s linear infinite; }
.rain-near { background-size: 128px 384px; background-position: 37px 91px; opacity: 0.75; animation: rain-near 0.55s linear infinite; }
@keyframes rain-far { to { transform: translate(-80px, 240px); } }
@keyframes rain-near { to { transform: translate(-128px, 384px); } }
.paper-flash { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgb(214, 228, 255); opacity: 0; mix-blend-mode: screen; pointer-events: none; }
.paper-flash.is-on { animation: paper-flash 0.75s ease-out; }
@keyframes paper-flash { 7% { opacity: 0.7; } 15% { opacity: 0.08; } 24% { opacity: 0.5; } 100% { opacity: 0; } }
/* 群像剪影（CONFIG.sceneCrowd）：小号纸偶只露纸背——灰褐纸色的平剪影描一道白切边，看得出有人坐着，
   又不抢台上人的戏、不和台上的人撞脸；镜像纸景里投影反过来写，翻过去以后仍朝右 */
.paper-crowd {
  width: auto;
  filter: brightness(0) invert(0.52) sepia(0.55) saturate(0.55)
    drop-shadow(2px 0 0 #f6ead6) drop-shadow(-2px 0 0 #f6ead6) drop-shadow(0 -2px 0 #f6ead6)
    drop-shadow(3px 4px 0 rgba(20, 12, 4, 0.28));
}
.paper-flip .paper-crowd {
  filter: brightness(0) invert(0.52) sepia(0.55) saturate(0.55)
    drop-shadow(2px 0 0 #f6ead6) drop-shadow(-2px 0 0 #f6ead6) drop-shadow(0 -2px 0 #f6ead6)
    drop-shadow(-3px 4px 0 rgba(20, 12, 4, 0.28));
}

/* 答题时压一层暖纸色并虚化，纸景仍看得出是哪里；走访全景两侧压暗 */
.paper-veil {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s;
}
.theater[data-mode="dim"] .paper-veil { opacity: 1; background: rgba(255, 244, 226, 0.42); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.theater[data-mode="blur"] .paper-veil { opacity: 1; background: rgba(30, 20, 12, 0.4); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
/* 虚化时底下的画面一动，backdrop-filter 就得每帧重新模糊：树的摇摆、雨丝停在原处，闪电不打（data-mode 平时是空串，要按值匹配） */
.theater[data-mode="dim"] .paper-prop, .theater[data-mode="blur"] .paper-prop,
.theater[data-mode="dim"] .rain-far, .theater[data-mode="blur"] .rain-far,
.theater[data-mode="dim"] .rain-near, .theater[data-mode="blur"] .rain-near { animation-play-state: paused; }
.theater[data-mode="dim"] .paper-flash, .theater[data-mode="blur"] .paper-flash { animation: none; }

/* 追光：说话的人四周压暗，铺在纸景上、纸偶下。一张两倍台口大的遮罩，正中留一个椭圆亮区（半径 --spot-rx/ry），
   theater.js spotlight 只用 transform 把亮区中心挪到说话人身上（移动不重绘）；
   答题压暗、走访虚化、台外点评时全台已经暗了，不再叠一层 */
.paper-spot {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse var(--spot-rx, 400px) var(--spot-ry, 400px) at 50% 50%, rgba(20, 12, 4, 0) 38%, rgba(20, 12, 4, 0.3) 100%);
  transition: opacity 0.6s ease;
  will-change: transform;
}
.theater[data-spot] .paper-spot { opacity: 1; }
.theater[data-mode="dim"] .paper-spot, .theater[data-mode="blur"] .paper-spot, .theater[data-offstage] .paper-spot { opacity: 0; }

/* 前景雨（下雨的纸景立好后 data-rain）：纸偶前面一层稀疏、粗一点的淡雨丝，比纸景里的雨丝快 */
.paper-rain-front {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0s linear 0.8s;
}
.theater[data-rain] .paper-rain-front { opacity: 1; visibility: visible; transition: opacity 0.8s ease; }
.rain-front {
  position: absolute;
  top: -560px; right: -190px; bottom: 0; left: 0;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='190' height='560'><g stroke='%23f4f8fc' stroke-width='3.5' stroke-linecap='round'><path d='M150 30 133 84'/><path d='M44 250 26 306'/><path d='M120 420 104 470'/></g></svg>");
  background-size: 190px 560px;
  opacity: 0.3;
  animation: rain-front 0.42s linear infinite;
  will-change: transform;
}
@keyframes rain-front { to { transform: translate(-190px, 560px); } }
/* 答题压暗、走访虚化时前景雨收起（答题卡盖住大半个台，只剩左栏飘雨反而乱） */
.theater[data-mode="dim"] .paper-rain-front, .theater[data-mode="blur"] .paper-rain-front { opacity: 0; visibility: hidden; }
.theater[data-mode="dim"] .rain-front, .theater[data-mode="blur"] .rain-front { animation-play-state: paused; }

/* 纸偶层：签子插在屏幕下沿以下，从台下升起 */
.paper-cast { position: absolute; top: 0; right: 0; bottom: 0; left: 0; overflow: hidden; pointer-events: none; }
.puppet {
  position: absolute;
  display: none;
  left: 50%;
  bottom: calc(var(--cast-h) * -0.14);
  width: var(--cast-w);
  height: var(--cast-h);
  margin-left: calc(var(--cast-w) / -2);
  transition: margin-left 0.45s ease, left 0.45s ease;
}
.puppet.is-live { display: block; }
.puppet[data-slot="guest"] { z-index: 2; }
/* 纸偶每帧都在晃（theater.js update 写 transform）：提前单独合成一层，不带着整台重绘 */
.puppet-rig { position: relative; width: 100%; height: 100%; transform-origin: 50% 100%; will-change: transform; }
.puppet-face {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 100%;
  visibility: hidden;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(8px 10px 0 rgba(20, 12, 4, 0.3));
  transition: filter 0.6s;
}
.puppet-face.is-on { visibility: visible; }
/* 两人同框的纸偶：不说话那个人的定格层盖在差分图上面；遮罩是一张和立绘同比例的 SVG，按 contain 贴底缩放，跟图对齐（theater.js useStill） */
.puppet-still { z-index: 1; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-position: 50% 100%; mask-position: 50% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
/* 双人同台、对方在说话：稍微压暗（退后、少晃在 theater.js 里逐帧算） */
.puppet.is-idle .puppet-face { filter: brightness(0.88) drop-shadow(8px 10px 0 rgba(20, 12, 4, 0.3)); }
/* 失败：主位纸偶褪色 */
.puppet.is-gray .puppet-face { filter: grayscale(0.85) brightness(0.92) drop-shadow(8px 10px 0 rgba(20, 12, 4, 0.3)); }
/* 转身（舞台提示"背过身""转开脸"）：翻到背面只看到纸背，一张没有五官的剪影 */
.puppet-rig.is-back .puppet-face {
  filter: brightness(0) invert(0.82) sepia(0.45) saturate(0.8)
    drop-shadow(3px 0 0 var(--cut)) drop-shadow(-3px 0 0 var(--cut)) drop-shadow(0 3px 0 var(--cut)) drop-shadow(0 -3px 0 var(--cut))
    drop-shadow(8px 10px 0 rgba(20, 12, 4, 0.3));
  transition: none;
}
/* 拍桌、摔东西：整台横着一震 */
.theater.is-slam .paper-scene, .theater.is-slam .paper-cast { animation: set-slam 0.34s ease-out; }
@keyframes set-slam { 20% { transform: translate(-7px, 5px); } 45% { transform: translate(6px, -3px); } 70% { transform: translate(-3px, 1px); } }
/* 递过来的纸道具：从纸偶身侧推出，停一会儿落下 */
.paper-handoff { position: absolute; z-index: 3; filter: drop-shadow(5px 7px 0 rgba(20, 12, 4, 0.32)); }
.paper-handoff svg { display: block; width: 100%; height: 100%; filter: drop-shadow(3px 0 0 #fff) drop-shadow(-3px 0 0 #fff) drop-shadow(0 3px 0 #fff) drop-shadow(0 -3px 0 #fff); }

/* 说话的人不再往身上加暖光，改由 .paper-spot 把四周压暗（追光） */

/* 台沿：横屏时一条木台口压在纸偶脚下，挡住签子根；竖屏的台板画在 .theater 背景里 */
.paper-lip { display: none; }
@media (orientation: landscape) {
  .paper-lip {
    display: block;
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: clamp(22px, 5vh, 54px);
    border-top: 3px solid #b0845a;
    background:
      repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.14) 0 2px, transparent 2px 140px),
      linear-gradient(#7a5536, #4e3421 60%, #3a2617);
    box-shadow: 0 -8px 14px rgba(20, 12, 4, 0.4);
    pointer-events: none;
  }
  /* 台面上一道长槽，纸偶沿着它进出；上沿亮边是台口压条 */
  .paper-lip::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 5px;
    background: linear-gradient(#140b05, #2c1b0e);
    box-shadow: 0 1px 0 rgba(255, 214, 160, 0.22);
  }
  /* 给每根竹签开的槽（theater.js slotFor 对准签子）：台沿上沿切下去一个深 U 口，签子从这里插进台下 */
  .lip-slot {
    position: absolute;
    top: -3px;
    height: 58%;
    border-radius: 0 0 6px 6px;
    background: linear-gradient(#0d0703, #24160b 70%, #3a2617);
    box-shadow: inset 2px 0 0 rgba(0, 0, 0, 0.45), inset -2px 0 0 rgba(255, 214, 160, 0.18), 0 2px 0 rgba(255, 214, 160, 0.2);
    opacity: 0;
    transition: opacity 0.3s;
  }
  .lip-slot.is-on { opacity: 1; }
  /* 台外点评时督导从台侧斜着探进来，签子不在台沿上 */
  .theater[data-offstage] .lip-slot[data-slot="guest"] { opacity: 0; }
  /* 答题时台口跟着压暗虚化的纸景一起退后 */
  .theater[data-mode="dim"] .paper-lip, .theater[data-mode="blur"] .paper-lip { opacity: 0.55; }
}

/* 台外点评：全台压暗；台上的人一起暗下去，开口的督导不暗 */
.theater[data-offstage] .paper-veil { opacity: 1; background: rgba(24, 14, 6, 0.5); }
.theater[data-offstage] .puppet:not(.is-speaking) .puppet-face { filter: brightness(0.5) grayscale(0.6) drop-shadow(8px 10px 0 rgba(20, 12, 4, 0.3)); }

/* 开场拉幕：两片红幕向两边拉开，顶上一条垂帘 */
.paper-curtain { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 60; overflow: hidden; pointer-events: none; }
.curtain-half {
  position: absolute;
  top: 0; bottom: 0;
  width: 51%;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.26) 0, rgba(0, 0, 0, 0) 3%, rgba(255, 210, 170, 0.12) 5.5%, rgba(0, 0, 0, 0) 8%, rgba(0, 0, 0, 0.26) 11%),
    linear-gradient(#a3281c, #7c1a12);
}
.curtain-half.is-left { left: 0; box-shadow: inset -6px 0 0 #d9a441, inset -9px 0 0 var(--ink); }
.curtain-half.is-right { right: 0; box-shadow: inset 6px 0 0 #d9a441, inset 9px 0 0 var(--ink); }
.curtain-valance {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 9vh;
  background:
    radial-gradient(circle at 50% 0, transparent 58%, #6a150e 60%) 0 100% / 8vh 3.2vh repeat-x,
    linear-gradient(#8e2016, #6a150e);
  box-shadow: 0 4px 0 #d9a441, 0 7px 0 var(--ink);
}

/* 幕间牌：压暗的台口中间挂一块纸牌，两根挂绳；点一下就跳过 */
.interlude {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  background: rgba(24, 14, 6, 0.5);
  cursor: pointer;
}
/* 木牌：横纹木板，下沿露出一截板厚（深色侧边），两颗钉子挂在绳上；字是刻进木头里的深褐色 */
.interlude-card {
  position: relative;
  min-width: min(420px, 86vw);
  max-width: min(720px, 92vw);
  padding: 24px 44px 26px;
  border: 3px solid #5d3b1f;
  border-radius: 12px;
  background:
    radial-gradient(circle at 18% 13px, #e9d8b8 0 3px, #6b4a2c 3.5px 5.5px, transparent 6px),
    radial-gradient(circle at 82% 13px, #e9d8b8 0 3px, #6b4a2c 3.5px 5.5px, transparent 6px),
    repeating-linear-gradient(178deg, rgba(92, 56, 26, 0) 0 9px, rgba(92, 56, 26, 0.14) 9px 11px, rgba(92, 56, 26, 0) 11px 23px, rgba(255, 236, 200, 0.12) 23px 25px),
    linear-gradient(170deg, #d7ad76, #c4935c 55%, #b07f4b);
  color: #3b2312;
  box-shadow:
    inset 0 2px 0 rgba(255, 238, 205, 0.55), inset 0 -3px 0 rgba(70, 40, 16, 0.35),
    0 0 0 2px var(--ink),
    0 9px 0 0 #6e4526, 0 9px 0 2px var(--ink),
    10px 20px 0 0 var(--shadow);
  text-align: center;
}
/* 两根挂绳：麻绳色，穿过钉子往上通到台口外 */
.interlude-card::before, .interlude-card::after {
  content: "";
  position: absolute;
  bottom: calc(100% - 13px);
  width: 4px;
  height: 60vh;
  margin-left: -2px;
  background: repeating-linear-gradient(170deg, #d9c4a2 0 4px, #b49a72 4px 7px);
  box-shadow: 0 0 0 1px rgba(46, 34, 25, 0.5);
}
.interlude-card::before { left: 18%; }
.interlude-card::after { left: 82%; }
/* 第几场：一块刷了模块色的小漆牌 */
.interlude-kicker {
  display: inline-block;
  padding: 0 14px 0 calc(14px + 0.4em);
  border-radius: 6px;
  background: var(--mod-dark);
  box-shadow: 0 0 0 2px #5d3b1f, inset 0 1px 0 rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 0.95em;
  font-weight: 800;
  letter-spacing: 0.4em;
}
.interlude-kicker + .interlude-title { margin-top: 10px; }
.interlude-title {
  font-size: clamp(1.3em, 2.4vw, 2em);
  font-weight: 900;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 0 rgba(255, 236, 205, 0.6), 0 -1px 0 rgba(60, 30, 10, 0.35); /* 刻痕：下沿一道亮边、上沿一道暗边 */
}
.interlude-skip { position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 18px); color: rgba(255, 244, 226, 0.8); font-size: 0.8em; text-align: center; }

/* 手机竖屏：访谈时纸偶从说明条下面露出头和上身，下半身被选项板盖住；
   说明条（带状态牌、前期准备标签时更高）的底边由 theater.setTopEdge 写进 --cast-top，头紧贴在它下面 */
.paper-cast[data-layout="talk"] .puppet {
  bottom: auto;
  top: calc(max(env(safe-area-inset-top) + 12vh, var(--cast-top, 0px)) - var(--cast-h) * 0.015);
  transition: margin-left 0.45s ease, left 0.45s ease, top 0.45s ease;
}
.paper-cast[data-layout="talk"][data-guest] .puppet[data-slot="main"] { margin-left: calc(var(--cast-w) * -0.78); }
.paper-cast[data-layout="talk"] .puppet[data-slot="guest"] { margin-left: calc(var(--cast-w) * -0.22); }
/* 独白：站在屏幕中间偏上，字幕压住签子 */
.paper-cast[data-layout="center"] .puppet { bottom: auto; top: calc(env(safe-area-inset-top) + 15vh); }
.paper-cast[data-layout="center"] .puppet[data-slot="guest"] { margin-left: calc(var(--cast-w) * -0.15); }

/* ======================================================================
   六、图片与占位（缺图只显示文件名，不报错）
   ====================================================================== */
.img-box { position: relative; overflow: hidden; }
.img-box img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s;
}
.img-box.is-loaded img { opacity: 1; }
.img-box.is-missing { background: repeating-linear-gradient(45deg, #f3e8d6 0 12px, #efe2cd 12px 24px); }
.img-box.is-missing img { display: none; }
.img-missing-label {
  display: none;
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  place-items: center;
  padding: 8px;
  color: rgba(46, 34, 25, 0.6);
  font-size: 13px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  text-align: center;
  word-break: break-all;
}
.img-box.is-missing .img-missing-label { display: grid; }

/* ======================================================================
   七、居中面板、选社区卡
   ====================================================================== */
.panel, .sheet, .modal, .talk-choices, .subtitle {
  border: 4px solid var(--cut);
  background: var(--paper);
  background-image: var(--paper-grain);
  box-shadow: var(--card-edge);
}
.panel {
  width: 100%;
  max-width: 580px;
  padding: 26px 28px;
  border-radius: var(--radius);
  text-align: center;
}
.panel h2 { margin: 0 0 0.3em; font-size: 1.3em; }
.panel p { margin: 0 0 1.2em; color: var(--ink-soft); }
.panel.is-error h2 { color: var(--red-dark); }

.stage-title {
  margin: 0 0 18px;
  padding: 4px 22px;
  border: 3px solid var(--cut);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 0 0 2px var(--ink), 4px 5px 0 var(--shadow);
  font-size: 1.15em;
  font-weight: 800;
  transform: rotate(-1deg);
}
.card-list {
  width: 100%;
  max-width: 1120px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
/* 社区卡：一张带白边的明信片，图在上（手机在左），名字粗黑 */
.community-card {
  display: grid;
  grid-template-columns: 38% 1fr;
  grid-template-rows: auto 1fr;
  column-gap: 14px;
  padding: 0;
  border: 4px solid var(--cut);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-grain), var(--paper);
  box-shadow: 0 0 0 2px var(--ink), 6px 8px 0 0 var(--shadow);
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.community-card .card-img { grid-row: 1 / 3; min-height: 110px; border-radius: 10px; }
.card-name { padding-top: 12px; padding-right: 12px; font-weight: 800; font-size: 1.12em; }
.card-line { padding: 0 12px 12px 0; color: var(--ink-soft); font-size: 0.9em; line-height: 1.55; }

/* ======================================================================
   八、字幕：压在台口下沿的一条纸，说话人名牌斜贴在左上角
   ====================================================================== */
.subtitle {
  position: absolute;
  z-index: 30;
  left: var(--gutter);
  right: var(--gutter);
  bottom: calc(env(safe-area-inset-bottom) + 14px);
  max-width: 980px;
  margin: 0 auto;
  padding: 20px 22px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.sub-who {
  position: absolute;
  left: 16px;
  top: 0;
  padding: 1px 14px;
  border: 3px solid var(--cut);
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 0.8em;
  font-weight: 800;
  letter-spacing: 0.05em;
  box-shadow: 0 0 0 2px var(--ink);
  transform: translateY(-62%) rotate(-2.5deg);
}
.sub-who:empty { display: none; }
.sub-text { min-height: 3.2em; font-size: 1.04em; font-weight: 500; line-height: 1.6; }
.sub-text.is-new { animation: sub-in 0.15s ease-out; }
@keyframes sub-in { from { opacity: 0.25; transform: translateY(4px); } }
/* 舞台提示（括号里的动作）：小号灰字，纸偶会把它演出来 */
.sub-dir { margin-right: 0.3em; color: var(--ink-soft); font-size: 0.8em; font-weight: 400; letter-spacing: 0.02em; }
/* 旁白：名牌换成褐色，正文换成暖褐色（不用斜体，中文斜体难认） */
.subtitle.is-narrator .sub-who { background: #7a6552; }
.subtitle.is-narrator .sub-text { color: #4d3b2c; }
/* 督导黄姐：名牌换成蓝色，点拨和居民说话一眼分开 */
.subtitle[data-who="HUANG"] .sub-who { background: var(--blue); }
.sub-hint {
  text-align: right;
  color: var(--ink-soft);
  font-size: 0.72em;
  opacity: 0.55; /* 配音没播完时写"点击跳过"，淡一些 */
  transition: opacity 0.3s;
}
.subtitle.is-ready .sub-hint { opacity: 1; font-weight: 700; color: var(--mod-dark); animation: nudge 1.4s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(4px); } }

/* ======================================================================
   九、弹窗、轻提示、点拨便签
   ====================================================================== */
.modal-backdrop {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(36, 24, 14, 0.5);
}
.modal {
  width: 100%;
  max-width: 660px;
  max-height: 92%;
  overflow-y: auto;
  padding: 18px var(--gutter) calc(env(safe-area-inset-bottom) + 16px);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
}
.modal h2, .modal h3 { margin-top: 0; }
/* 弹窗出场：暗处淡入，手机上纸卡从下沿推上来，电脑上轻轻弹出（见横屏段） */
.modal-backdrop { animation: fade-in 0.2s ease-out; }
.modal { animation: drawer-up 0.24s cubic-bezier(0.2, 0.8, 0.3, 1); }
@keyframes fade-in { from { opacity: 0; } }
@keyframes drawer-up { from { opacity: 0; transform: translateY(36px); } }
@keyframes modal-pop { from { opacity: 0; transform: scale(0.94) rotate(-0.8deg); } }
/* 关闭时纸卡往下一沉、暗处淡出（ui.js 动画结束后拿掉；减少动态效果时直接拿掉） */
.modal-backdrop.is-closing { pointer-events: none; animation: fade-out 0.18s ease-in forwards; }
.modal-backdrop.is-closing .modal { animation: modal-out 0.18s ease-in forwards; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes modal-out { to { opacity: 0; transform: translateY(24px); } }
@keyframes modal-pop-out { to { opacity: 0; transform: scale(0.95) rotate(0.6deg); } }
/* 查看类弹窗右上角的 ×：内容长、往下滚时也一直钉在右上角；负的下外边距让它不占一行 */
.modal-x {
  position: sticky;
  top: 4px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin: -6px -4px -32px auto;
  padding: 0;
  border: 3px solid var(--cut);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 0 0 2px var(--ink), 2px 3px 0 var(--shadow);
  font: inherit;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
.modal-x:focus-visible { outline: 3px solid var(--mod); outline-offset: 3px; }

.toast {
  position: absolute;
  z-index: 50;
  left: 50%;
  top: calc(env(safe-area-inset-top) + 68px);
  transform: translate(-50%, -8px);
  max-width: calc(100% - 2 * var(--gutter));
  padding: 6px 20px;
  border: 3px solid var(--cut);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.88em;
  font-weight: 600;
  box-shadow: 0 0 0 2px var(--ink), 4px 5px 0 var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }
/* 记入笔记的提示做成一张斜贴的便签黄纸条 */
.toast.is-note {
  border-color: var(--ink);
  border-radius: 3px;
  background: var(--note);
  color: var(--ink);
  box-shadow: 4px 5px 0 var(--shadow);
  transform: translate(-50%, -8px) rotate(-1.5deg);
}
.toast.is-note.is-shown { transform: translate(-50%, 0) rotate(-1.5deg); }

.tip {
  margin: 12px 0;
  padding: 10px 14px;
  border: 2px solid rgba(46, 34, 25, 0.22);
  border-left: 6px solid var(--mod);
  border-radius: 10px;
  background: var(--note);
  text-align: left;
}
.sheet .tip { scroll-margin-bottom: calc(env(safe-area-inset-bottom) + 96px); } /* 滚出来时不被吸底的底栏挡住 */
.tip-who { font-size: 0.8em; font-weight: 800; color: var(--mod-dark); }
.tip-text { margin: 2px 0 0; }

/* ======================================================================
   十、走访全景：图钉标线索，底部一条纸
   ====================================================================== */
.pano { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; padding-top: calc(env(safe-area-inset-top) + 54px); }
.pano-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex;
  align-items: center;
}
.pano-inner { position: relative; flex: none; margin: 0 auto; box-shadow: 0 0 0 3px var(--cut), 0 0 0 5px var(--ink), 0 14px 30px rgba(0, 0, 0, 0.45); }
.pano-img { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
.pano-inner .hotspot { z-index: 1; }
/* 环境光：一道柔和的斜光缓慢扫过，图片本身不动 */
.pano-inner::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 236, 196, 0.14) 45%, rgba(255, 244, 220, 0.22) 50%, rgba(255, 236, 196, 0.14) 55%, transparent 70%) 0 0 / 300% 100% no-repeat;
  animation: pano-light 18s ease-in-out infinite alternate;
}
@keyframes pano-light { from { background-position: 100% 0; } to { background-position: 0 0; } }
/* 前景层：比全景略大，平移时边缘不露缝；外层裁到全景范围内，在热点下面，不挡点击 */
.pano-fg-wrap { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.pano-fg { position: absolute; top: -2%; right: -2%; bottom: -2%; left: -2%; z-index: 0; pointer-events: none; background: none !important; transition: transform 0.25s ease-out; }
.pano-fg img { object-fit: fill; }
.pano-fg.is-missing { display: none; }
.pano-fg .img-missing-label { display: none; }
.pano-bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px var(--gutter) calc(env(safe-area-inset-bottom) + 10px);
  background: var(--paper);
  box-shadow: 0 -2px 0 var(--ink);
  font-size: 0.88em;
}
/* 窄屏全景两侧的纸签箭头（walk.js syncArrows 按滑到哪儿显示） */
.pano-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 40px;
  height: 64px;
  margin-top: -32px;
  padding: 0 0 4px;
  border: 3px solid var(--cut);
  background: var(--paper);
  box-shadow: 0 0 0 2px var(--ink), 3px 4px 0 var(--shadow);
  color: var(--ink);
  font: inherit;
  font-size: 1.8em;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  opacity: 0.88;
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.1s;
}
.pano-arrow.is-left { left: 6px; border-radius: 0 12px 12px 0; }
.pano-arrow.is-right { right: 6px; border-radius: 12px 0 0 12px; }
.pano-arrow[hidden] { display: none; }
.pano-arrow:hover { opacity: 1; }
.pano-arrow:active { transform: translate(2px, 3px); box-shadow: 0 0 0 2px var(--ink), 1px 1px 0 var(--shadow); }
.pano-arrow:focus-visible { outline: 3px solid var(--mod); outline-offset: 2px; opacity: 1; }
.pano-count { padding: 1px 12px; border-radius: 999px; background: var(--mod-soft); box-shadow: 0 0 0 2px var(--mod); color: var(--ink); font-weight: 800; white-space: nowrap; }
.pano-hint { flex: 1; color: var(--ink-soft); text-align: center; }
.pano-bar .btn { margin-left: auto; }

.hotspot {
  position: absolute;
  display: grid;
  place-items: start center; /* 图钉钉在框的上沿，不挡住线索本身 */
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}
.hotspot-dot {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-top: -15px;
  border: 4px solid var(--cut);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #ff8f73, var(--red) 62%, var(--red-dark));
  box-shadow: 0 0 0 2px var(--ink), 3px 4px 0 var(--shadow), 0 0 0 0 rgba(200, 64, 42, 0.6);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  animation: ping 1.8s ease-out infinite;
  transition: transform 0.15s;
}
@keyframes ping {
  70% { box-shadow: 0 0 0 2px var(--ink), 3px 4px 0 var(--shadow), 0 0 0 16px rgba(200, 64, 42, 0); }
  100% { box-shadow: 0 0 0 2px var(--ink), 3px 4px 0 var(--shadow), 0 0 0 0 rgba(200, 64, 42, 0); }
}
.hotspot.is-visited .hotspot-dot { background: var(--green); animation: none; }
.hotspot.is-visited .hotspot-dot::after { content: "✓"; }
/* 按记录类型区分：需求线索橙"需"、社区资源绿"资"、不记录灰"—" */
.hotspot.is-need .hotspot-dot { background: var(--need); }
.hotspot.is-need .hotspot-dot::after { content: "需"; }
.hotspot.is-resource .hotspot-dot::after { content: "资"; }
.hotspot.is-skip .hotspot-dot { background: #8a7a6a; }
.hotspot.is-skip .hotspot-dot::after { content: "—"; }
.hotspot.is-temp { outline: 2px dashed rgba(255, 255, 255, 0.6); }
.hotspot-label {
  position: absolute;
  top: 100%;
  left: 50%;
  max-width: 9em; /* 名称居中挂在框下沿，太长就折行，相邻两处的名牌不叠在一起 */
  width: max-content;
  margin-top: 4px;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 0 0 0 1.5px var(--ink);
  font-size: clamp(13px, 0.55vw + 6px, 18px); /* 跟着屏幕放大：1366 宽约 13.5px，1920 宽约 16.5px */
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  transform: translateX(-50%);
}
.hotspot.is-visited .hotspot-label { background: var(--green); color: #fff; }
.hotspot.is-need .hotspot-label { background: var(--need); }
.hotspot.is-skip .hotspot-label { background: var(--paper); color: var(--ink-soft); }

/* 线索特写弹窗：特写图不超过屏幕高度的一半，矮屏上按钮也能完整露出 */
/* 像一张冲洗出来的照片：白边、描线、硬投影（都画在框外，不改图片和叠字的位置） */
.hot-img { width: min(100% - 12px, calc(50vh * 4 / 3)); aspect-ratio: 4 / 3; margin: 6px auto 22px; border-radius: 4px; box-shadow: 0 0 0 5px var(--cut), 0 0 0 7px var(--ink), 6px 8px 0 7px var(--shadow); }
.hot-title { margin: 0 0 4px; font-size: 1.15em; } /* 和照片的间距由照片的下外边距给（.modal h3 会把上外边距清零） */
.hot-detail { margin: 0 0 12px; }
.hot-ask, .hot-decided { margin: 0 0 8px; color: var(--ink-soft); font-size: 0.9em; }
.hot-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.hot-buttons .btn { flex: 1 1 auto; padding-left: 16px; padding-right: 16px; }
.hot-actions { margin-top: 4px; }
/* 特写图上的牌子、告示文字由网页叠加 */
.closeup-text {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  line-height: 1.25;
  text-align: center;
  white-space: pre-line;
  font-weight: 700;
  letter-spacing: 0.05em;
  pointer-events: none;
}
.closeup-text.is-sign { color: #34303c; }
.closeup-text.is-hand { color: #323a62; font-weight: 500; font-family: "Kaiti SC", STKaiti, KaiTi, "楷体", serif; }
.closeup-text.is-red { color: #b8282a; }
.closeup-text.is-vertical { writing-mode: vertical-rl; letter-spacing: 0.02em; white-space: nowrap; }
.img-box.is-missing .closeup-text, .img-box:not(.is-loaded) .closeup-text { visibility: hidden; }

/* ======================================================================
   十一、答题卡：从台下推上来的一大张纸，底栏吸底
   ====================================================================== */
.sheet {
  width: 100%;
  max-width: 780px;
  margin-bottom: 0;
  padding: 20px var(--gutter) 0;
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  animation: choices-in 0.24s ease-out; /* 答题卡从台下推上来 */
}
/* 答题卡总是从屏幕下沿立起来：内容短时纸卡也铺到底，底栏贴底 */
.stage.is-sheet > .sheet { flex: 1 0 auto; display: flex; flex-direction: column; }
.stage.is-sheet > .sheet > .sheet-foot { margin-top: auto; }
/* 底栏贴底后和上面的内容留 18px（底栏总是答题卡最后一个；不用 :has()，机房 Chromium 105 以下不认） */
.stage.is-sheet > .sheet > :nth-last-child(2) { margin-bottom: 18px; }
/* 大屏（1200×880 以上的横屏，如 1920×1080 投屏）：铺满一屏时短题下面空出大半张白纸。
   答题卡改成随内容高度、四边都有白边，挂在顶栏下面，下面露出压暗的纸景；内容长了照旧在台里滚动，底栏吸底 */
@media (min-width: 1200px) and (min-height: 880px) and (min-aspect-ratio: 4/3) {
  .stage.is-sheet { padding-bottom: 28px; }
  .stage.is-sheet > .sheet { flex: 0 0 auto; border-bottom: 4px solid var(--cut); border-radius: var(--radius); }
  .stage.is-sheet > .sheet > .sheet-foot { padding-bottom: 12px; border-radius: 0 0 calc(var(--radius) - 4px) calc(var(--radius) - 4px); }
}
.sheet-head { position: relative; }
.sheet-head h2 { margin: 0; font-size: 1.28em; font-weight: 800; }
.sheet-head h2::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 0.95em;
  margin-right: 10px;
  border-radius: 3px;
  background: var(--mod);
  vertical-align: -0.08em;
}
.sheet-sub { margin: 4px 0 16px; color: var(--ink-soft); line-height: 1.6; }
.sheet-head .link-btn { margin: -6px 0 12px; }
.sheet-foot {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin: 18px calc(-1 * var(--gutter)) 0;
  padding: 12px var(--gutter) calc(env(safe-area-inset-bottom) + 12px);
  background: var(--paper-grain), var(--paper);
  box-shadow: 0 -2px 0 rgba(46, 34, 25, 0.16);
}
.sheet-foot .btn { white-space: nowrap; flex: none; }
.sheet-count { margin-right: auto; color: var(--ink-soft); font-size: 0.9em; }
.sheet-count.is-problem { color: var(--red-dark); font-weight: 700; }
/* 分类题的进度：没答完时可点，跳到没答的题 */
button.sheet-count { padding: 0; border: 0; background: none; font: inherit; font-size: 0.9em; text-align: left; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
button.sheet-count[title=""] { text-decoration: none; cursor: default; }

/* 答题卡下面还有内容：底栏里写"往下还有"，正文底部加渐隐带（类名由 main.js 按滚动位置切换） */
.sheet-foot::before, .sheet-foot::after { display: none; pointer-events: none; }
.sheet-foot::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  height: 56px;
  background: linear-gradient(rgba(255, 250, 240, 0), rgba(255, 250, 240, 0.96));
}
.sheet-foot::before {
  content: "↓ 往下还有内容";
  order: -1;
  flex: none;
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.stage.has-more .sheet-foot::before, .stage.has-more .sheet-foot::after { display: block; }

/* ======================================================================
   十二、选人：一张张拍立得人物卡
   ====================================================================== */
.people-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.people-grid.is-numbered { counter-reset: pnum; }
.person-card {
  position: relative;
  padding: 6px 6px 10px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--cut);
  box-shadow: var(--chip-edge);
  text-align: left;
  cursor: pointer;
  transform: rotate(var(--card-rot, 0deg));
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  /* 按钮默认把内容垂直居中：同一行里身份写两行的那张会整体上移。改成从上往下排，图和名字对齐 */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
/* 拍立得随手摆在桌上：一张张略歪，歪法错开（用 CSS 变量配 transform，兼容 Chromium 104 以下旧内核） */
.person-card:nth-child(3n+1) { --card-rot: -0.8deg; }
.person-card:nth-child(3n+2) { --card-rot: 0.5deg; }
.person-card:nth-child(3n) { --card-rot: -0.3deg; }
.people-grid.is-numbered .person-card { counter-increment: pnum; }
.people-grid.is-numbered .person-card::before {
  content: counter(pnum);
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  min-width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(255, 250, 240, 0.92);
  box-shadow: 0 0 0 1.5px var(--ink);
  color: var(--ink);
  font-size: 0.72em;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
}
.person-img { aspect-ratio: 4 / 3; border-radius: 8px; background: linear-gradient(#dff0fb, #fbecd6); }
/* 卡片里只取纸偶的头肩：按高度放大到约 2.6 倍、贴顶居中（纸偶宽窄不一，按高度取景才统一） */
.person-img img { position: absolute; left: 50%; top: 0; width: auto; max-width: none; height: 265%; transform: translateX(-50%); }
.person-name { padding: 8px 6px 0; font-weight: 800; }
.person-id { padding: 0 6px; color: var(--ink-soft); font-size: 0.8em; line-height: 1.45; }
.person-card[aria-pressed="true"] { border-color: var(--green-dark); background: var(--green-soft); box-shadow: 0 0 0 2px var(--green-dark), 3px 4px 0 0 var(--shadow); }
.person-card[aria-pressed="true"]::after {
  content: "✓";
  position: absolute;
  top: -10px;
  right: -8px;
  z-index: 1;
  width: 30px;
  height: 30px;
  border: 3px solid var(--cut);
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  line-height: 24px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--ink);
}

/* 选中的人上台说一句：身份写在一块挂牌上 */
.speaker { display: flex; flex-direction: column; align-items: center; }
.stage.is-center .speaker { position: absolute; left: 50%; top: calc(env(safe-area-inset-top) + 74px); transform: translateX(-50%); }
.speaker-name {
  padding: 3px 16px;
  border: 3px solid var(--cut);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 0 0 2px var(--ink), 4px 5px 0 var(--shadow);
  font-weight: 800;
  font-size: 0.92em;
  white-space: nowrap;
  transform: rotate(-1.2deg);
  position: relative;
}
/* 挂牌的两根吊绳，往上一直伸到顶栏后面 */
.speaker-name::before, .speaker-name::after {
  content: "";
  position: absolute;
  bottom: calc(100% + 5px);
  width: 2px;
  height: 90px;
  background: rgba(46, 34, 25, 0.72);
}
.speaker-name::before { left: 16%; }
.speaker-name::after { right: 16%; }

/* ======================================================================
   十三、选项与点评
   ====================================================================== */
.choice-list { display: flex; flex-direction: column; gap: 10px; }
.choice-list > h3 { margin: 6px 0 4px; font-size: 1.04em; line-height: 1.6; }
.choice {
  position: relative;
  width: 100%;
  min-height: 50px;
  padding: 11px 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--cut);
  box-shadow: var(--chip-edge);
  text-align: left;
  line-height: 1.55;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s, background 0.12s;
}
.choice:active:not(:disabled) { transform: translate(1px, 2px); box-shadow: none; }
.choice:disabled { cursor: default; }
.choice.is-check, .choice.is-radio { padding-left: 46px; }
.choice.is-check::before, .choice.is-radio::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  border: 2px solid var(--ink);
  border-radius: 5px;
  background: var(--cut);
}
.choice.is-radio::before { border-radius: 50%; }
.choice[aria-pressed="true"] { border-color: var(--green-dark); background: var(--green-soft); box-shadow: 0 0 0 1px var(--green-dark), 3px 4px 0 0 var(--shadow-soft); }
.choice.is-check[aria-pressed="true"]::before, .choice.is-radio[aria-pressed="true"]::before {
  content: "✓";
  animation: tick-in 0.24s cubic-bezier(.34, 1.56, .64, 1); /* 勾上时像盖了一下：放大歪一点再落定 */
  border-color: var(--green-dark);
  background: var(--green);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  line-height: 16px;
  text-align: center;
}
.choice.is-radio[aria-pressed="true"]::before { content: ""; box-shadow: inset 0 0 0 4px var(--cut); }
@keyframes tick-in { from { transform: scale(1.25) rotate(-8deg); } }
/* 未发现的卡：虚线框、灰底，文字仍要看得清 */
.choice.is-locked { border-style: dashed; border-color: rgba(46, 34, 25, 0.4); background: rgba(46, 34, 25, 0.05); box-shadow: none; color: var(--ink-soft); }
.choice.is-locked::before { border-style: dashed; border-color: rgba(46, 34, 25, 0.3); background: transparent; }
/* 测验交卷后：对的标绿、选错的标红 */
.choice.is-good { border-color: var(--green-dark); background: var(--green-soft); }
.choice.is-good::before { border-color: var(--green-dark); background: var(--green); box-shadow: inset 0 0 0 3px var(--cut); }
.choice.is-bad { border-color: var(--red); background: var(--red-soft); }
.choice.is-bad::before { border-color: var(--red-dark); background: var(--red); box-shadow: inset 0 0 0 3px var(--cut); }
.choice.is-good:disabled, .choice.is-bad:disabled { color: var(--ink); }
.choice-tag { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 6px; font-size: 0.8em; font-weight: 800; color: #fff; vertical-align: 1px; }
.choice.is-good .choice-tag { background: var(--green); }
.choice.is-bad .choice-tag { background: var(--red); }
/* 选择题右上角的数字，对应键盘数字键 */
.choice-list.is-numbered { counter-reset: num; }
.choice-list.is-numbered .choice { padding-right: 38px; counter-increment: num; }
.choice-list.is-numbered .choice::after {
  content: counter(num);
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--paper-2);
  box-shadow: 0 0 0 1px var(--line);
  color: var(--ink-soft);
  font-size: 0.72em;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
}
.quiz-explain {
  margin: 4px 0 0;
  padding: 10px 14px;
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  background: #e9f2fb;
  font-size: 0.93em;
  line-height: 1.7;
}

/* 督导点评：左边一枚对错圆章 */
.review { display: flex; gap: 12px; padding: 11px 14px; border: 2px solid var(--line); border-radius: var(--radius-s); background: var(--cut); }
.review.is-good { border-color: rgba(47, 125, 79, 0.55); }
.review.is-bad { border-color: rgba(200, 64, 42, 0.55); }
.review-mark { flex: none; width: 30px; height: 30px; border: 2px solid var(--cut); border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 900; box-shadow: 0 0 0 2px var(--ink); }
.review.is-good .review-mark { background: var(--green); }
.review.is-bad .review-mark { background: var(--red); }
.review-text { margin: 0; font-weight: 600; }
.review-note { margin: 3px 0 0; color: var(--ink-soft); font-size: 0.9em; }
.review-better { margin: 6px 0 0; padding: 4px 10px; border-radius: 6px; background: var(--green-soft); color: var(--green-dark); font-size: 0.88em; font-weight: 600; }

/* ======================================================================
   十四、分类判定
   ====================================================================== */
.type-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 0 0 6px;
  padding: 12px 16px;
  border: 2px dashed rgba(46, 34, 25, 0.25);
  border-radius: 12px;
  background: var(--paper-2);
  font-size: 0.86em;
}
.type-card dt { font-weight: 800; }
.type-card dd { margin: 0; color: var(--ink-soft); }
.match { padding: 12px 14px; border: 2px solid var(--line); border-radius: var(--radius-s); background: var(--cut); box-shadow: var(--chip-edge); }
/* 答过的题：卡片退成浅纸色、左边一道绿，一眼看出还剩哪几道 */
.match.is-answered:not(.is-good):not(.is-bad) { border-color: var(--line); background: var(--paper-2); box-shadow: inset 5px 0 0 var(--green), var(--chip-edge); }
.match.is-flash { animation: match-flash 1.2s ease-out; }
@keyframes match-flash { 0%, 40% { border-color: var(--mod); box-shadow: 0 0 0 4px var(--mod), var(--chip-edge); } }
.match.is-good { border-color: var(--green-dark); }
.match.is-bad { border-color: var(--red); }
.match-text { margin: 0 0 8px; font-weight: 600; }
.match-opts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
/* 题目框窄（手机、两列排布）时类别排成两行两列，"规范性需求"这类五个字不被拆成两行 */
.match { container-type: inline-size; }
/* 旧内核（Chromium 105 以下）不认 @container：至少手机上照样排成两行两列 */
@supports not (container-type: inline-size) {
  @media (max-width: 599px) {
    .match-opts { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .match-opts[data-count="3"] { grid-template-columns: minmax(0, 1fr); }
  }
}
@container (max-width: 470px) {
  .match-opts { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* 三个类别不拆成 2+1（"需斟酌"单独掉一行，像漏了一个）：排一行三个 */
  .match-opts[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* 手机竖屏框太窄、三个挤一行要拆字：一个一行，按钮也更好点 */
@container (max-width: 329px) {
  .match-opts[data-count="3"] { grid-template-columns: minmax(0, 1fr); }
}
.match-result { margin: 8px 0 0; font-size: 0.9em; font-weight: 700; }
.match.is-good .match-result { color: var(--green-dark); }
.match.is-bad .match-result { color: var(--red-dark); }
.match-basis { margin: 6px 0 0; padding: 4px 0 4px 10px; border-left: 3px solid var(--line); color: var(--ink-soft); font-size: 0.86em; }
.chip {
  min-height: 42px;
  padding: 4px 3px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  font-size: 0.8em;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
}
.chip:disabled { cursor: default; }
/* 选中只用中性墨色；交卷后对的标绿、错的标红 */
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.chip.is-answer, .chip.is-answer:disabled { border-color: var(--green-dark); background: var(--green); color: #fff; opacity: 1; }
.chip.is-wrong, .chip.is-wrong:disabled { border-color: var(--red-dark); background: var(--red); color: #fff; opacity: 1; }

/* ======================================================================
   十五、访谈与连续决策：纸偶站左边，右边是情境便签、状态牌和选项板
   ====================================================================== */
.talk { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
.talk-top {
  position: absolute;
  z-index: 24;
  top: calc(env(safe-area-inset-top) + 64px);
  left: var(--gutter);
  right: var(--gutter);
  max-width: 660px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
/* 情境说明：一张便签 */
.talk-where {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 64px);
  left: var(--gutter);
  right: var(--gutter);
  max-width: 660px;
  margin: 0 auto;
  padding: 7px 14px;
  border: 3px solid var(--cut);
  border-radius: 10px;
  background: var(--note);
  box-shadow: 0 0 0 2px var(--ink), 4px 5px 0 var(--shadow);
  color: var(--ink);
  font-size: 0.88em;
  line-height: 1.55;
  text-align: left;
}
.talk-top .talk-where { position: relative; top: auto; right: auto; bottom: auto; left: auto; max-width: none; margin: 0; width: 100%; }
/* 便签顶上按一枚红图钉 */
.talk-where::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #f3a08f 0 18%, var(--red) 45%, var(--red-dark) 100%);
  box-shadow: 0 0 0 2px var(--ink), 1px 3px 0 var(--shadow);
  pointer-events: none;
}
.talk-where.can-compact { position: relative; top: auto; right: auto; bottom: auto; left: auto; cursor: pointer; }
.talk-where.can-compact .talk-where-text { display: block; padding-right: 4.5em; }
.talk-where.is-compact .talk-where-text { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.talk-where.is-compact .talk-plan-hint, .talk-where.is-compact .talk-vars-hint { display: none; }
.talk-where-toggle { position: absolute; top: 5px; right: 8px; padding: 0 6px; border: 0; border-radius: 6px; background: rgba(255, 255, 255, 0.7); color: var(--mod-dark); font-size: 0.85em; font-weight: 700; cursor: pointer; }
.talk-where.is-changed { animation: where-flash 1.4s ease-out; }
@keyframes where-flash { 0%, 35% { background: var(--mod-soft); box-shadow: 0 0 0 4px var(--mod), 4px 5px 0 var(--shadow); } }
.talk-vars-hint { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 0.92em; }
.talk-plan-hint { display: block; margin-top: 6px; font-size: 1em; line-height: 1.5; }
/* 前期准备：标签一行，点开看完整说明 */
.plan-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.plan-chips-label { color: var(--ink-soft); font-size: 0.85em; font-weight: 700; }
.plan-chip { padding: 1px 10px; border-radius: 999px; font-size: 0.85em; font-weight: 700; white-space: nowrap; }
.plan-chip.is-ready { background: var(--green-soft); box-shadow: 0 0 0 1.5px var(--green); color: var(--green-dark); }
.plan-chip.is-missing { background: #fdf0dc; box-shadow: 0 0 0 1.5px #d9a04a; color: #7a4800; }
.plan-chips-more { margin-left: auto; color: var(--ink-soft); font-size: 0.8em; text-decoration: underline; }
.plan-chips[aria-expanded="true"] .plan-chips-more { visibility: hidden; }
.plan-chips-detail { margin: 6px 0 0; padding-left: 1.2em; font-size: 0.85em; line-height: 1.55; }

/* 状态牌：信任、失控等用一排纸圆片表示 */
.stream-vars { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.stream-vars:empty { display: none; }
.stream-var {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: calc(2em + 12px); /* 给右侧浮出的 +1 / −1 留位 */
  padding: 4px 14px 4px 12px;
  border: 3px solid var(--cut);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 0 0 2px var(--ink), 3px 4px 0 var(--shadow);
  font-size: 0.92em;
  font-weight: 800;
}
.stream-var-label { color: var(--ink); }
/* 圆点旁直接写"3/5"：投屏时后排也看得清还剩几格 */
.stream-var-num { color: var(--ink-soft); font-size: 0.82em; font-variant-numeric: tabular-nums; }
.stream-pips { display: inline-flex; gap: 5px; }
.stream-pip {
  width: 16px;
  height: 16px;
  border: 2px dashed #b8a58f;
  border-radius: 50%;
  background: transparent;
  transition: background 0.3s, border-color 0.3s;
}
.stream-pip.is-on { border: 2px solid var(--ink); background: radial-gradient(circle at 35% 30%, #6fcf94, var(--green) 65%); }
/* 只剩一格：整条变红，提醒关系快断了 */
.stream-var.is-low { box-shadow: 0 0 0 2px var(--red), 3px 4px 0 var(--shadow); }
.stream-var.is-low .stream-pip.is-on { background: radial-gradient(circle at 35% 30%, #ff9a7e, var(--red) 65%); }
.stream-var.is-low .stream-var-label { color: var(--red-dark); }
/* 越高越糟的变量（失控）：橙色，离上限一步时整条变红并写"接近崩盘" */
.stream-var.is-risk .stream-pip.is-on { background: radial-gradient(circle at 35% 30%, #ffc27a, var(--orange) 65%); }
.stream-var.is-risk.is-high { box-shadow: 0 0 0 3px var(--red), 3px 4px 0 var(--shadow); }
.stream-var.is-risk.is-high .stream-pip.is-on { background: radial-gradient(circle at 35% 30%, #ff9a7e, var(--red) 65%); }
.stream-var.is-risk.is-high .stream-var-label { color: var(--red-dark); }
.stream-var-warn { display: none; color: var(--red-dark); font-size: 0.85em; }
.stream-var.is-risk.is-high .stream-var-warn { display: inline; }
.stream-delta {
  position: absolute;
  left: 100%;
  top: 50%;
  margin-left: 8px;
  font-weight: 900;
  font-size: 1.2em;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff;
  animation: delta-float 1.6s ease-out forwards;
}
.stream-delta.is-up { color: var(--green-dark); }
.stream-delta.is-down { color: var(--red-dark); }
@keyframes delta-float { 0% { opacity: 0; transform: translate(0, -50%); } 15% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(6px, -120%); } }
.stream-var.is-up { animation: var-up 0.7s ease-out; }
.stream-var.is-down { animation: var-down 0.7s ease-out; }
@keyframes var-up { 30% { transform: scale(1.08); } }
@keyframes var-down { 20%, 60% { transform: translateX(-3px); } 40%, 80% { transform: translateX(3px); } }

/* "我"说的话：一张绿色纸条 */
.my-line {
  position: absolute;
  z-index: 26;
  bottom: calc(env(safe-area-inset-bottom) + var(--subtitle-height, 154px) + 30px);
  right: var(--gutter);
  max-width: min(80%, 540px);
  padding: 10px 16px;
  border: 3px solid var(--cut);
  border-radius: 14px 14px 4px 14px;
  background: var(--green);
  color: #fff;
  font-size: 0.92em;
  font-weight: 600;
  box-shadow: 0 0 0 2px var(--ink), 4px 5px 0 var(--shadow);
}
.my-line::before { content: "我："; font-weight: 900; }
/* 对方回应到第 2 句起淡出，不挡客位插话和递过来的道具 */
.my-line.is-faded { opacity: 0; transform: translateY(6px); transition: opacity 0.3s ease, transform 0.3s ease; }
/* 回答纸条出现时从右下角轻弹出来，和纸偶的点头、跳一下对上 */
.my-line:not([hidden]) { transform-origin: 100% 100%; animation: my-line-in 0.24s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes my-line-in { from { opacity: 0; transform: translateY(10px) scale(0.92); } }

/* 选项板：手机贴底，电脑放右栏 */
.talk-choices {
  position: absolute;
  z-index: 25;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 780px;
  margin: 0 auto;
  padding: 14px var(--gutter) calc(env(safe-area-inset-bottom) + 14px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  counter-reset: opt;
  animation: choices-in 0.22s ease-out;
}
/* 台词说完，选项板轻轻浮上来（每次从隐藏变为显示都会重播） */
@keyframes choices-in { from { opacity: 0; transform: translateY(14px); } }
.talk.is-fitted .talk-choices { max-height: calc(100% - var(--talk-top-end) - 12px); overflow-y: auto; }
.talk.is-fitted .talk-choices > * { flex-shrink: 0; }
.talk-ask { margin: 0; font-weight: 800; }
.talk-step-no { display: inline-block; margin-right: 8px; padding: 0 10px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 0.78em; font-weight: 700; vertical-align: 1px; }
/* 居民刚说的最后一句，留在选项上方 */
.talk-quote { margin: 0; padding: 9px 14px; border-radius: 10px; background: var(--paper-2); font-size: 0.92em; line-height: 1.6; }
.talk-quote-who { display: inline-block; margin-right: 8px; padding: 0 9px; border-radius: 6px; background: var(--red); color: #fff; font-size: 0.85em; font-weight: 800; }
.talk-quote-who[data-who="HUANG"] { background: var(--blue); }
.talk-quote-who[data-who="NAR"] { background: #7a6552; }
.talk-choices:focus { outline: none; }
/* 选项序号 A/B/C：墨色圆片（顺序每人随机，序号只是位置） */
.talk-choices .choice { padding-left: 52px; }
.talk-choices .choice::before {
  counter-increment: opt;
  content: counter(opt, upper-alpha);
  position: absolute;
  left: 11px;
  top: 50%;
  width: 30px;
  height: 30px;
  margin-top: -15px;
  border: 2px solid var(--cut);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 2px var(--ink);
  color: #fff;
  font-size: 0.78em;
  font-weight: 900;
  line-height: 26px;
  text-align: center;
}
.choices-more { position: sticky; bottom: -1px; margin: 0 -4px; padding: 14px 0 2px; background: linear-gradient(rgba(255, 250, 240, 0), var(--paper) 55%); color: var(--ink-soft); font-size: 0.8em; font-weight: 700; text-align: center; pointer-events: none; }
.choices-more[hidden] { display: none; }
/* 失败：选项板里是失败说明 */
.talk-choices .stream-fail { max-width: none; padding: 4px 2px; border: 0; border-radius: 0; background: transparent; box-shadow: none; text-align: left; }
.stream-fail-tag { display: inline-block; margin-bottom: 8px; padding: 1px 12px; border: 2px solid var(--cut); border-radius: 8px; background: var(--red); color: #fff; font-size: 0.8em; font-weight: 800; box-shadow: 0 0 0 2px var(--ink); transform: rotate(-2deg); }
.stream-fail .stream-fail-msg { margin: 0 0 8px; color: var(--ink); font-weight: 800; font-size: 1.05em; }
.stream-fail .stream-fail-retry { margin: 0 0 14px; padding: 8px 12px; border-radius: 8px; background: var(--paper-2); color: var(--ink-soft); font-size: 0.9em; }
.stream-fail .btn { min-width: 9em; }

/* 键盘提示：只在有鼠标的电脑上显示 */
.kbd-hint { display: none; color: var(--ink-soft); font-size: 0.78em; }

/* ======================================================================
   十六、方案拼装与写作
   ====================================================================== */
.plan-slot { padding: 12px 14px 14px; border: 2px solid rgba(46, 34, 25, 0.14); border-radius: 12px; background: var(--paper-2); }
.plan-slot-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.plan-slot-head h3 { margin: 0; font-size: 1em; font-weight: 800; }
.plan-slot-head h3::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 0.95em;
  margin-right: 8px;
  border-radius: 2px;
  background: var(--mod);
  vertical-align: -0.1em;
}
.plan-slot-count {
  margin-left: auto;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--cut);
  box-shadow: 0 0 0 1.5px var(--line);
  color: var(--ink-soft);
  font-size: 0.8em;
  font-weight: 700;
  white-space: nowrap;
}
.plan-slot-count.is-done { background: var(--green); box-shadow: 0 0 0 1.5px var(--green-dark); color: #fff; }
.plan-cards { display: grid; grid-template-columns: 1fr; gap: 8px; }
.plan-cards .choice { font-size: 0.93em; }

.plan-write { padding: 12px 14px 14px; border: 2px solid rgba(46, 34, 25, 0.14); border-radius: 12px; background: var(--paper-2); }
.plan-write-label { display: block; font-weight: 800; }
.plan-write-hint { margin: 2px 0 8px; color: var(--ink-soft); font-size: 0.86em; }
.plan-write .link-btn { display: inline-block; margin-bottom: 8px; }
.plan-text {
  display: block;
  width: 100%;
  min-height: 8.5em;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--cut);
  color: var(--ink);
  font: inherit;
  font-size: 0.95em;
  line-height: 1.7;
  resize: vertical;
}
.plan-text:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--mod-soft); }
.plan-char-count { display: block; margin-top: 6px; color: var(--ink-soft); font-size: 0.8em; text-align: right; }
.plan-char-count.is-ok { color: var(--green-dark); font-weight: 700; }
.plan-char-count.is-over { color: var(--red-dark); font-weight: 700; }
.plan-review-title { margin: 10px 0 0; font-size: 0.98em; font-weight: 800; }
.plan-text-view {
  margin: 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--paper-2);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
  font-size: 0.93em;
  line-height: 1.75;
}
/* 资源与行动提醒 */
#plan-support-hints { border-left: 6px solid var(--green); }
#plan-support-hints ul { margin: 0; padding-left: 1.3em; }
#plan-support-hints li { margin: 8px 0; line-height: 1.65; }

/* 写作自查清单：点一下变绿勾 */
.self-check { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 10px; }
.self-check-label { color: var(--ink-soft); font-size: 0.85em; font-weight: 700; }
.self-check-item { padding: 2px 12px 2px 10px; border: 2px solid var(--line); border-radius: 999px; background: var(--cut); font-size: 0.85em; cursor: pointer; }
.self-check-item::before { content: "☐ "; color: var(--ink-soft); }
.self-check-item[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); color: var(--green-dark); font-weight: 700; }
.self-check-item[aria-pressed="true"]::before { content: "☑ "; color: var(--green-dark); }
.self-check-note { color: var(--ink-soft); font-size: 0.75em; }

/* 表单报错：框标红，原因写在框下 */
[aria-invalid="true"] { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(200, 64, 42, 0.2); }
.field-error { display: block; margin-top: 4px; color: var(--red-dark); font-size: 0.82em; font-weight: 600; line-height: 1.5; }
.field-error:empty, .field-error[hidden] { display: none; }
.form-error { margin: 8px 0 0; color: var(--red-dark); font-size: 0.9em; font-weight: 600; }
.link-btn { padding: 2px 0; border: 0; background: none; color: var(--mod-dark); font-size: 0.88em; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--ink); }

/* ======================================================================
   十七、应急工作成果
   ====================================================================== */
.emergency-group { display: flex; flex-direction: column; gap: 12px; }
.emergency-row { margin: 0; padding: 16px; border: 2px solid rgba(46, 34, 25, 0.16); border-radius: 12px; background: var(--paper-2); }
.emergency-row legend { padding: 0 8px; font-weight: 800; color: var(--ink); }
.emergency-row legend .plan-slot-count { display: inline-block; margin-left: 10px; vertical-align: 1px; }
.emergency-row h4 { margin: 0 0 6px; }
.emergency-row .plan-text-view { background: var(--cut); margin-top: 6px; }
.emergency-field { display: flex; flex-direction: column; min-width: 0; }
.emergency-field .plan-text { min-height: 5em; font-size: 0.95em; }
.emergency-field .plan-write-hint { min-height: 1.5em; }
.emergency-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.emergency-error ul { padding-left: 1.3em; }

/* ======================================================================
   十八、结算报告：总分像盖了一枚大章
   ====================================================================== */
.report-head { text-align: center; padding: 6px 0 4px; }
.report-meta { margin: 0; color: var(--ink-soft); font-size: 0.86em; }
.report-total { font-size: 3.2em; font-weight: 900; line-height: 1.1; color: var(--mod-dark); }
.report-total-max { margin-left: 4px; color: var(--ink-soft); font-size: 0.4em; font-weight: 700; }
.report-tier {
  display: inline-block;
  margin: 4px 0 0;
  padding: 1px 18px;
  border: 3px solid var(--mod);
  border-radius: 10px;
  background: var(--cut);
  color: var(--mod-dark);
  font-weight: 900;
  letter-spacing: 0.1em;
  transform: rotate(-3deg);
  /* 像盖章：停半秒后从大往下一按，落下时配盖章声（report.js） */
  animation: stamp-in 0.32s cubic-bezier(0.5, 0, 0.75, 0) 0.5s both;
}
.report-head.is-stamped { animation: set-jolt 0.22s ease-out; }
@keyframes stamp-in {
  from { opacity: 0; transform: rotate(-8deg) scale(1.9); }
  to { opacity: 1; transform: rotate(-3deg) scale(1); }
}
.report-cap { display: inline-block; margin: 6px 0 0; padding: 2px 12px; border-radius: 999px; background: var(--red-soft); color: var(--red-dark); font-size: 0.85em; font-weight: 700; }
.report-section { margin-top: 20px; }
.report-section h3 { margin: 0 0 8px; font-size: 1em; font-weight: 800; }
.report-section h3::before { content: ""; display: inline-block; width: 6px; height: 0.95em; margin-right: 8px; border-radius: 2px; background: var(--mod); vertical-align: -0.1em; }
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 5.5em 1fr 4.5em; align-items: center; gap: 10px; font-size: 0.86em; }
.bar-label { font-weight: 600; }
.bar-track { height: 14px; border-radius: 7px; background: var(--cut); box-shadow: inset 0 0 0 2px var(--ink); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 7px; background: var(--green); box-shadow: inset 0 0 0 2px var(--ink); transform-origin: 0 50%; animation: bar-grow 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both; }
@keyframes bar-grow { from { transform: scaleX(0); } }
.bar-fill.is-low { background: #e8893a; }
.bar-value { text-align: right; color: var(--ink-soft); font-weight: 600; }
.path-list { margin: 0; padding: 0; list-style: none; font-size: 0.9em; overflow-wrap: break-word; }
.path-list li { position: relative; margin: 0 0 6px; padding: 7px 12px 7px 28px; border-radius: 8px; background: var(--cut); box-shadow: 0 0 0 1.5px rgba(46, 34, 25, 0.12); }
.path-list li::before { content: ""; position: absolute; left: 11px; top: 1em; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); }
.path-what, .path-why { display: block; }
.path-why { margin-top: 2px; color: var(--ink-soft); font-size: 0.92em; }
.path-list li.is-flag { background: var(--red-soft); }
.path-list li.is-flag .path-what { color: var(--red-dark); font-weight: 700; }
.path-list li.is-flag::before { background: var(--red); }
.path-list li.is-failure { background: rgba(46, 34, 25, 0.06); }
.path-list li.is-failure::before { background: var(--ink-soft); }
.teacher-score { margin: 10px 0 0; padding: 10px 12px; border: 2px dashed rgba(46, 34, 25, 0.35); border-radius: 10px; font-weight: 700; }
.report-form { padding: 14px; border-radius: 12px; background: var(--paper-2); }
.form-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 140px; font-size: 0.86em; color: var(--ink-soft); font-weight: 600; }
.field input {
  min-height: 46px;
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--cut);
  color: var(--ink);
  font: inherit;
  font-size: 1.1em;
  font-weight: 500;
}
.field input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--mod-soft); }
.report-result { margin-top: 14px; }
.code-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 10px; }
.code-label { color: var(--ink-soft); }
.code-value { padding: 0 12px; border: 3px dashed var(--mod); border-radius: 10px; font-size: 2em; font-weight: 900; letter-spacing: 0.2em; color: var(--mod-dark); background: var(--cut); }
.report-result .muted { font-size: 0.86em; }
.report-img { display: block; width: 100%; max-width: 540px; margin-top: 10px; border: 4px solid var(--cut); border-radius: 10px; box-shadow: 0 0 0 2px var(--ink), 5px 6px 0 var(--shadow); }
.report-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.report-process-box summary { cursor: pointer; color: var(--ink-soft); font-size: 0.9em; font-weight: 600; }
.report-process li { margin: 8px 0; line-height: 1.65; overflow-wrap: anywhere; }
/* 督导点评：纸偶头像 + 常驻台词气泡 */
.report-coach { display: flex; align-items: center; gap: 14px; max-width: 580px; margin: 14px auto 0; text-align: left; }
.report-coach-img { flex: 0 0 auto; width: 76px; height: 76px; border-radius: 50%; background: var(--mod-soft); box-shadow: 0 0 0 3px var(--cut), 0 0 0 5px var(--ink); }
/* 纸偶连着竹签，脸只占全图高度 6%–38%：放大 3.1 倍再上移，圆框里正好是从头发到下巴的整张脸 */
.report-coach-img img { position: absolute; left: 50%; top: -19%; width: auto; max-width: none; height: 310%; transform: translateX(-50%); }
.report-coach-say { position: relative; margin: 0; padding: 10px 14px; border: 2px solid var(--ink); border-radius: 12px; background: var(--cut); font-size: 0.92em; line-height: 1.6; }
.report-coach-say::before { content: ""; position: absolute; left: -10px; top: 50%; margin-top: -8px; border: 8px solid transparent; border-left: 0; border-right: 10px solid var(--ink); }
.report-coach-who { display: block; margin-bottom: 2px; color: var(--mod-dark); font-size: 0.85em; font-weight: 800; }
/* 点评配音播放时（report.js speakOnCard）：头像跟着轻轻点头，气泡描一圈主题色，看得出是这句话正在被念 */
.report-coach.is-speaking .report-coach-say { border-color: var(--mod-dark); box-shadow: 0 0 0 3px var(--mod-soft); }
.report-coach.is-speaking .report-coach-say::before { border-right-color: var(--mod-dark); }
.report-coach.is-speaking .report-coach-img img { animation: coach-talk 0.34s ease-in-out infinite alternate; }
@keyframes coach-talk { to { transform: translateX(-50%) translateY(1.5%) rotate(-1.5deg); } }
/* "再做一次"的页面内确认框 */
.confirm-box h3 { margin: 0 0 6px; font-size: 1.1em; }
.confirm-box p { margin: 0 0 14px; color: var(--ink-soft); }
.confirm-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }

/* ======================================================================
   十九、笔记、环节列表、对话记录
   ====================================================================== */
.notes h3 { margin: 0 0 6px; }
.notes h4 { margin: 12px 0 4px; font-size: 0.9em; color: var(--mod-dark); }
.notes ul, .reflection { margin: 0; padding-left: 1.3em; font-size: 0.92em; }
.notes li, .reflection li { margin-bottom: 4px; }
.notes .btn { margin-top: 12px; }
.review-entry { margin: 6px 0 10px; padding: 8px 12px; border-left: 4px solid var(--mod); border-radius: 0 8px 8px 0; background: var(--paper-2); }
.review-entry-title { margin: 0 0 2px; font-weight: 700; }
.review-entry-line { margin: 2px 0 0; color: var(--ink-soft); font-size: 0.92em; line-height: 1.6; }
.step-list-items { margin: 8px 0 14px; padding: 0; list-style: none; }
.step-list-items li { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-bottom: 1px dashed rgba(46, 34, 25, 0.16); }
.step-list-mark { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--paper-2); box-shadow: 0 0 0 1.5px var(--line); color: var(--ink-soft); font-size: 0.8em; font-weight: 800; }
.step-list-items .is-done .step-list-mark { background: var(--green-soft); box-shadow: 0 0 0 1.5px var(--green); color: var(--green-dark); }
.step-list-items .is-done .step-list-name { color: var(--ink-soft); }
.step-list-items .is-current { background: var(--mod-soft); border-radius: 8px; }
.step-list-items .is-current .step-list-mark { background: var(--mod); box-shadow: 0 0 0 2px var(--ink); color: #fff; }
.step-list-items .is-current .step-list-name { font-weight: 800; }
.step-list-now { margin-left: auto; color: var(--mod-dark); font-size: 0.8em; font-weight: 800; }
/* 笔记的文件夹顶签：选中的那张和下面的纸连成一片 */
.notes-tabs { display: flex; gap: 4px; margin: 0 40px 0 0; padding: 0 4px; border-bottom: 3px solid var(--ink); }
.notes-tab {
  margin-bottom: -3px;
  padding: 5px 14px 6px;
  border: 2.5px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  border-radius: 10px 10px 0 0;
  background: var(--paper-2);
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.86em;
  font-weight: 700;
  cursor: pointer;
}
/* 手机窄屏：三张顶签平分一行，不折行（折到第二行就和下面的纸连不上了） */
@media (max-width: 479px) {
  .notes-tabs { padding: 0; }
  .notes-tab { flex: 1 1 0; min-width: 0; padding: 5px 4px 6px; white-space: nowrap; }
}
.notes-tab[aria-selected="true"] { border-bottom-color: var(--paper); background: var(--paper); color: var(--mod-dark); font-weight: 800; }
.notes-body { max-height: min(58vh, 520px); overflow-y: auto; padding: 4px 2px 0; }
.notes-panel.is-dialogue h4 { margin: 10px 0 4px; color: var(--ink-soft); font-size: 0.85em; }
.dialogue-line { margin: 4px 0; font-size: 0.9em; line-height: 1.6; }
.dialogue-who { margin-right: 6px; font-weight: 800; }
.dialogue-line.is-me { color: var(--green-dark); }

/* ======================================================================
   二十、屏幕适配
   ====================================================================== */
/* 横屏平板与电脑：选社区三列、人物卡三列、方案卡两列，弹窗居中 */
@media (min-width: 768px) and (min-aspect-ratio: 4/3) {
  .card-list { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .community-card { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; column-gap: 0; padding: 8px 8px 0; }
  .community-card .card-img { grid-row: auto; aspect-ratio: 4 / 3; min-height: 0; }
  .card-name, .card-line { padding-left: 10px; padding-right: 10px; }
  .card-line { padding-bottom: 14px; }
  .community-card:nth-child(1) { transform: rotate(-0.8deg); }
  .community-card:nth-child(3) { transform: rotate(0.8deg); }
  .people-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .plan-cards { grid-template-columns: 1fr 1fr; }
  .modal-backdrop { align-items: center; }
  .modal { border-bottom: 4px solid var(--cut); border-radius: var(--radius); padding: 22px 26px; animation-name: modal-pop; }
  .modal-backdrop.is-closing .modal { animation-name: modal-pop-out; }
}

/* 电脑横屏：纸偶站左半边，右栏放便签、状态牌、选项板；独白时纸偶站左侧、字幕居中 */
@media (min-width: 900px) and (min-aspect-ratio: 4/3) {
  :root { --cast-h: min(85vh, 920px); }
  .paper-cast[data-layout="talk"] .puppet { top: auto; bottom: calc(var(--cast-h) * -0.14); left: 2%; margin-left: 0; }
  .paper-cast[data-layout="talk"][data-guest] .puppet[data-slot="main"] { margin-left: 0; }
  .paper-cast[data-layout="talk"] .puppet[data-slot="guest"] { margin-left: calc(var(--cast-w) * 0.55); }
  .paper-cast[data-layout="center"] .puppet { top: auto; bottom: calc(var(--cast-h) * -0.16); left: 6%; margin-left: 0; }
  .paper-cast[data-layout="center"] .puppet[data-slot="guest"] { margin-left: calc(var(--cast-w) * 0.6); }
  .stage.is-center .speaker { left: calc(6% + var(--cast-w) / 2); top: calc(env(safe-area-inset-top) + 76px); }
  /* 台外点评：督导从左侧台边斜着探进半个身子，不和台上的人并排站 */
  .theater[data-offstage] .puppet[data-slot="guest"] { left: -3%; margin-left: 0; bottom: calc(var(--cast-h) * -0.34); rotate: 9deg; }
  .paper-cast[data-layout] .puppet { transition: margin-left 0.45s ease, left 0.45s ease, bottom 0.45s ease, rotate 0.45s ease; }

  .talk-top { left: auto; right: 4%; width: min(46%, 660px); max-width: none; margin: 0; align-items: flex-start; }
  .stream-vars { justify-content: flex-start; }
  .talk-where { left: auto; right: 4%; width: min(46%, 660px); max-width: none; margin: 0; }
  .talk-choices {
    left: auto;
    right: 4%;
    top: auto;
    bottom: calc(env(safe-area-inset-bottom) + 16px);
    width: min(46%, 660px);
    max-height: calc(100% - 210px);
    margin: 0;
    overflow-y: auto;
    border-bottom: 4px solid var(--cut);
    border-radius: var(--radius);
  }
  .talk.is-fitted .talk-choices { max-height: calc(100% - var(--talk-top-end) - env(safe-area-inset-bottom) - 30px); }
  /* 回答纸条贴在字幕右上方（位置沿用手机的 bottom）：先读"我说的"，视线往下就是对方的回应 */
  .my-line { right: 4%; max-width: min(46%, 660px); }
  .subtitle { padding: 22px 28px 10px; }
}

/* 证据墙（见 evidenceWall.js）：窄屏不显示，照旧用顶栏"笔记"和"回看对话记录"。
   需求研判、方案拼装、应急台账都是引导语念完后接替教练站进左栏（≥1100，.stage.has-side-wall，main.js showWall） */
.evidence-wall { display: none; }
@media (min-width: 1100px) and (min-aspect-ratio: 4/3) {
  /* 软木板 */
  .evidence-wall {
    padding: 12px 14px 16px;
    border-radius: 12px;
    background:
      radial-gradient(rgba(90, 58, 30, 0.22) 1px, transparent 1.4px) 0 0 / 9px 9px,
      #c9a274;
    box-shadow: inset 0 0 0 3px #8a6440, inset 0 0 18px rgba(60, 36, 16, 0.35);
  }
  .wall-title { margin: 0 0 6px; color: #3b2615; font-size: 1em; font-weight: 800; letter-spacing: 0.1em; }
  .wall-kind { display: inline-block; margin: 10px 0 6px; padding: 1px 10px; border-radius: 6px; background: var(--green); color: #fff; font-size: 0.78em; font-weight: 800; }
  .wall-kind.is-need { background: var(--need); }
  .wall-kind.is-finding { background: var(--blue); }
  .wall-kind.is-dialogue { background: var(--mod-dark); }
  .wall-notes { margin: 0; padding: 0; list-style: none; }
  .wall-note {
    position: relative;
    margin: 0 0 9px;
    padding: 9px 12px 9px 14px;
    border-left: 5px solid var(--green);
    background: var(--note);
    box-shadow: 2px 3px 0 rgba(46, 30, 16, 0.3);
    font-size: 0.84em;
    line-height: 1.55;
  }
  .wall-note.is-need { border-left-color: var(--need); }
  .wall-note.is-finding { border-left-color: var(--blue); background: #f4f0ff; }
  /* 右下角卷起一个小角 */
  .wall-note::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 14px;
    height: 14px;
    background: linear-gradient(to top left, #c9a274 50%, rgba(120, 90, 30, 0.35) 50%, #ead98f 62%);
  }
  .wall-note:nth-child(odd) { transform: rotate(-0.6deg); }
  .wall-note:nth-child(even) { transform: rotate(0.5deg); }
  /* 图钉（对话摘录的纸页也钉一颗） */
  .wall-note::before, .wall-talk::before {
    content: "";
    position: absolute;
    top: -5px;
    left: 50%;
    width: 11px;
    height: 11px;
    margin-left: -5px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 0 1.5px var(--ink), 1px 2px 0 rgba(0, 0, 0, 0.3);
  }
  /* 对话摘录：每个环节一页横格纸——淡褐横线对齐行高，左边一道红色装订线 */
  .wall-talk {
    position: relative;
    margin: 0 0 10px;
    padding: 8px 12px 6px 22px;
    background:
      linear-gradient(90deg, transparent 13px, rgba(200, 64, 42, 0.45) 13px, rgba(200, 64, 42, 0.45) 15px, transparent 15px),
      repeating-linear-gradient(transparent 0, transparent calc(1.302em - 1px), rgba(120, 90, 60, 0.2) calc(1.302em - 1px), rgba(120, 90, 60, 0.2) 1.302em) 0 8px,
      var(--paper);
    box-shadow: 2px 3px 0 rgba(46, 30, 16, 0.3);
    transform: rotate(-0.3deg);
  }
  .wall-talk .dialogue-line { margin: 0; font-size: 0.84em; line-height: 1.55; } /* 不留段距，字落在横线上 */
  /* 名字按身份上色，和字幕名牌一致：居民等砖红、黄姐蓝、旁白褐，"我"沿用绿色 */
  .wall-talk .is-other .dialogue-who { color: var(--red-dark); }
  .wall-talk .is-coach .dialogue-who { color: var(--blue); }
  .wall-talk .is-nar .dialogue-who { color: #7a6552; }
  /* 观察笔记 / 对话摘录两张顶签，和笔记弹窗的文件夹顶签同一画法 */
  .wall-tabs { display: flex; gap: 6px; margin: 0 0 4px; border-bottom: 2px solid #8a6440; }
  .wall-tab {
    margin-bottom: -2px;
    padding: 4px 12px 5px;
    border: 2px solid #8a6440;
    border-radius: 8px 8px 0 0;
    background: #e3c9a0;
    color: #3b2615;
    font: inherit;
    font-size: 0.86em;
    font-weight: 700;
    cursor: pointer;
  }
  .wall-tab[aria-selected="true"] { border-bottom-color: var(--paper); background: var(--paper); color: var(--mod-dark); font-weight: 800; }
  .wall-tab:focus-visible { outline: 3px solid var(--mod); outline-offset: 2px; }
  .wall-empty { margin: 10px 2px; color: #3b2615; font-size: 0.86em; }

  /* 接替教练：钉在教练栏里（答题卡已经让出这一栏），顶栏下到屏幕底边，板内自己滚动，答题卡怎么滚都在视野里 */
  .stage.has-side-wall > .evidence-wall.is-side {
    display: flex;
    flex-direction: column;
    position: fixed;
    z-index: 11;
    top: calc(env(safe-area-inset-top) + 68px);
    bottom: calc(env(safe-area-inset-bottom) + 14px);
    left: 14px; /* 和教练头顶的气泡同宽同位 */
    width: calc(var(--coach-col) - 28px);
    animation: wall-in 0.32s ease-out 0.12s backwards; /* 等教练先往下沉一点再钉上来 */
  }
  /* 交卷撤下：往上滑出、淡出，教练同时从台下升回来（main.js hideWall 220ms 后移除） */
  .evidence-wall.is-side.is-leaving { opacity: 0; transform: translateY(-14px); transition: opacity 0.22s ease-in, transform 0.22s ease-in; pointer-events: none; }
  .evidence-wall.is-side .wall-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 4px 0 2px; }
  /* 有证据墙就不用再点"回看对话记录"（它只是打开同样的对话） */
  .stage.has-side-wall .look-dialogue { display: none; }
}
@keyframes wall-in { from { opacity: 0; transform: translateY(-14px) rotate(-1deg); } }

/* 答题教练（≥1100 横屏，见 main.js coach）：答题卡让出左边一栏，黄姐站在栏底，引导语是她头顶的对话气泡 */
@media (min-width: 1100px) and (min-aspect-ratio: 4/3) {
  :root { --coach-col: clamp(300px, 26vw, 440px); --coach-h: min(64vh, 620px); }
  .stage.is-sheet.has-coach { padding-left: var(--coach-col); }
  .paper-cast[data-layout="coach"] .puppet {
    left: calc(var(--coach-col) / 2);
    bottom: calc(var(--coach-h) * -0.22);
    width: calc(var(--coach-h) * 0.62);
    height: var(--coach-h);
    margin-left: calc(var(--coach-h) * -0.31);
  }
  .stage.has-coach ~ .subtitle {
    left: 14px;
    right: auto;
    bottom: calc(var(--coach-h) * 0.8 + 22px);
    width: calc(var(--coach-col) - 28px);
    max-width: none;
    margin: 0;
    padding: 20px 18px 8px;
    font-size: 0.92em;
  }
  .stage.has-coach ~ .subtitle .sub-text { min-height: 0; }
  /* 气泡尾巴指向下面的黄姐 */
  .stage.has-coach ~ .subtitle::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -15px;
    width: 22px;
    height: 22px;
    margin-left: -11px;
    border-right: 4px solid var(--cut);
    border-bottom: 4px solid var(--cut);
    background: var(--paper);
    box-shadow: 2px 2px 0 0 var(--ink);
    transform: rotate(45deg);
  }
}

/* 宽屏答题卡（≥1200 横屏）：放宽到 1120px，分类题、提纲题两列 */
@media (min-width: 1200px) and (min-aspect-ratio: 4/3) {
  .sheet.is-wide { max-width: 1120px; padding-left: 26px; padding-right: 26px; }
  .sheet.is-wide .sheet-foot { margin-left: -26px; margin-right: -26px; padding-left: 26px; padding-right: 26px; }
  .choice-list.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; align-items: start; }
  .choice-list.match-grid > :not(.match) { grid-column: 1 / -1; }
  .choice-list.is-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
  .choice-list.is-grid2 > :not(.choice):not(.review) { grid-column: 1 / -1; }
  .sheet.is-wide .people-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sheet.is-wide .plan-cards { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1200px) and (orientation: landscape) {
  .sheet.report { max-width: 1040px; }
  .report-sections { column-count: 2; column-gap: 34px; }
  .report-sections .report-section { break-inside: avoid; -webkit-column-break-inside: avoid; }
  .report-sections .report-section:first-child { margin-top: 20px; }
}
@media (min-width: 900px) {
  fieldset.emergency-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
}
@media (max-width: 899px) {
  .emergency-field + .emergency-field { margin-top: 12px; }
  .emergency-row legend { float: left; width: 100%; margin-bottom: 8px; padding: 0; }
  .emergency-row > legend + * { clear: both; }
}

/* 矮屏（机房 1366×768）：答题卡收紧纵向间距；人物卡图压扁，6 张一屏放下 */
@media (max-height: 820px) and (min-width: 768px) {
  .sheet { padding-top: 14px; }
  .sheet-sub { margin-bottom: 10px; font-size: 0.92em; }
  .choice-list { gap: 8px; }
  .choice { padding-top: 8px; padding-bottom: 8px; min-height: 44px; }
  .type-card { padding: 8px 12px; }
  .match { padding: 9px 12px; }
  .match-text { margin-bottom: 6px; }
}
@media (min-width: 1200px) and (min-aspect-ratio: 4/3) and (max-height: 820px) {
  .sheet.is-wide .person-img { aspect-ratio: 16 / 7; }
}

/* 投屏（1600 宽以上）：状态牌放大，后排也看得清 */
@media (min-width: 1600px) {
  .stream-var { font-size: 1em; padding: 6px 18px 6px 14px; }
  .stream-pip { width: 20px; height: 20px; }
}

/* 首屏模块券：手机竖排 */
@media (max-width: 640px) {
  #start-modules { flex-direction: column; gap: 12px; margin-bottom: 18px; width: min(440px, calc(100vw - 2 * (var(--frame) + var(--gutter)))); }
  .module-card { flex: none; padding: 9px 16px 11px 24px; }
  .module-card:nth-child(odd), .module-card:nth-child(even) { transform: none; }
  .module-card-name { font-size: 1.04em; }
}

/* 手机竖屏的访谈：状态牌收小并成一行，+1 / −1 改从牌子上方飘出 */
@media (max-width: 640px) and (orientation: portrait) {
  .stream-vars { gap: 8px; }
  .stream-var { margin-right: 0; gap: 6px; padding: 3px 10px 3px 9px; font-size: 0.86em; }
  .stream-pips { gap: 4px; }
  .stream-pip { width: 13px; height: 13px; }
  .stream-delta { left: auto; right: 4px; top: 0; margin-left: 0; }
  /* 选项板最高到纸偶下巴（纸偶顶边见上，脸约占纸偶高度的前 36%），再长就在板内滚动；至少留 46% 屏高给选项 */
  .talk.is-fitted .talk-choices { max-height: max(46%, calc(100% - max(env(safe-area-inset-top) + 12vh, var(--talk-top-end)) - var(--cast-h) * 0.345)); }
}

/* 窄屏：顶栏隐藏"4 / 8"计数；底栏说明字号收小，报错单独占一行 */
@media (max-width: 420px) {
  .progress-count { display: none; }
  .topbar { gap: 6px; }
  .btn-mute { padding: 2px 9px; }
  .sheet-foot .sheet-count { font-size: 0.78em; line-height: 1.4; }
  .sheet-foot::before { content: "↓ 下面还有"; padding: 2px 8px; }
}
/* 手机：方案、应急页的进度说明长（"已完成：台账 0/3 · 流程 0/6……"），单独占上面一行，下面一行左"下面还有"、右提交按钮 */
@media (max-width: 640px) {
  .sheet-foot.is-stacked { flex-wrap: wrap; row-gap: 8px; }
  .sheet-foot.is-stacked .sheet-count { flex: 1 1 100%; order: -2; margin-right: 0; }
  .sheet-foot.is-stacked .btn { margin-left: auto; }
}
@media (max-width: 599px) {
  .sheet-foot.has-problem { flex-wrap: wrap; }
  .sheet-foot .sheet-count.is-problem { flex: 1 1 100%; order: -1; margin-right: 0; }
}

/* 鼠标悬停（机房电脑为主要使用环境）：纸片微微抬起 */
@media (hover: hover) {
  .btn:not(:disabled):hover { filter: brightness(1.07); transform: translateY(-2px); box-shadow: 0 0 0 2px var(--ink), 5px 7px 0 0 var(--shadow); }
  .choice:not(:disabled):hover, .person-card:hover, .match:hover { border-color: var(--ink); transform: translateY(-2px) rotate(0deg); box-shadow: 4px 6px 0 0 var(--shadow-soft); }
  .choice[aria-pressed="true"]:not(:disabled):hover { border-color: var(--green-dark); }
  .chip:not(:disabled):hover { border-color: var(--ink); }
  .community-card:hover { transform: translateY(-5px) rotate(0); box-shadow: 0 0 0 2px var(--ink), 9px 13px 0 0 var(--shadow); }
  .hotspot:hover .hotspot-dot { transform: scale(1.22); }
  .self-check-item:hover { border-color: var(--ink); }
}
@media (hover: hover) and (pointer: fine) {
  .kbd-hint { display: inline-block; margin-left: 10px; }
  .talk-choices .kbd-hint { display: block; margin: -4px 0 4px; }
}

/* 减少动态效果：关掉所有过渡与动画（纸景、纸偶的脚本动画也会直接跳到终态） */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .paper-rain, .paper-rain-front { display: none; }
  .module-card, .community-card { transform: none !important; }
  .pano-inner::after { opacity: 0; }
}
