/* ==================== 概率剧场 · 10-02 克克重做（第二版：锈湖记录页材质） ====================
   参考 锈湖 (4)(8) 记录页 + (9) 复印钟盘沙漏 + (5) 案卷拼贴：
   冷灰白纸 + 重颗粒（不要黄底）；舞台 = 沙地同心涟漪中央一张复印的钟盘沙漏；
   记录 = 居中打字机体「00:04 / 一句话」+ ███ 涂黑；红线手绘抖动、圈不闭合；前提 = 撕边纸 + 胶带。
   声音保留塔拉喜欢的「内在众声」：线稿脸 + 身份小字 + 四字大名 + 引号台词。
   没有彩色左边条（全局审美红线）。字体全离线（系统宋体 / 等宽）。
   z=12600，已登记返回键层表 azoth-overlay-history.js。 */

.probability-theater-layer {
    --pt-paper: #e3e3e1;
    --pt-ink: #161414;
    --pt-ink-2: rgba(22, 20, 20, 0.64);
    --pt-ink-3: rgba(22, 20, 20, 0.36);
    --pt-red: #b0141a;
    --pt-serif: 'SimSun', 'Songti SC', 'Noto Serif SC', 'Source Han Serif SC', Georgia, serif;
    --pt-mono: 'Courier New', ui-monospace, Consolas, monospace;
    --pt-grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.08  0 0 0 0 0.08  0 0 0 0 0.08  0 0 0 1.25 -0.38'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");

    display: none;
    position: fixed;
    inset: 0;
    z-index: 12600;
    flex-direction: column;
    overflow: hidden;
    background:
        radial-gradient(ellipse 80% 55% at 50% 30%, rgba(255, 255, 255, 0.55), transparent 75%),
        radial-gradient(ellipse 70% 50% at 0% 100%, rgba(22, 20, 20, 0.10), transparent 70%),
        var(--pt-paper);
    color: var(--pt-ink);
    font-family: var(--pt-serif);
    touch-action: manipulation;
}
.probability-theater-layer::before { /* 颗粒：一张 SVG 噪声铺满全层 */
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: var(--pt-grain);
    background-size: 220px 220px;
    opacity: 0.55;
    mix-blend-mode: multiply;
}
.probability-theater-layer.is-entering { animation: pt-layer-in 0.6s ease-out both; }
@keyframes pt-layer-in {
    from { opacity: 0; filter: blur(4px) contrast(1.4); }
    to { opacity: 1; filter: none; }
}

/* ─────────── 顶栏 / 案卷抬头（照记录页：居中打字机） ─────────── */

.probability-theater-layer .pt-top {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 6;
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 0;
}
.probability-theater-layer .pt-close {
    background: none;
    border: 0;
    padding: 6px 0 6px 12px;
    font-family: var(--pt-mono);
    font-size: 11px;
    letter-spacing: 0.25em;
    color: var(--pt-ink-2);
    cursor: pointer;
}
.probability-theater-layer .pt-head {
    position: relative;
    z-index: 2;
    flex: none;
    padding: calc(env(safe-area-inset-top, 0px) + 18px) 34px 0;
    text-align: center;
}
.probability-theater-layer .pt-case-tag {
    font-family: var(--pt-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
}
.probability-theater-layer .pt-title {
    margin-top: 6px;
    font-family: var(--pt-mono);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.probability-theater-layer .pt-head-sub {
    margin-top: 4px;
    font-family: var(--pt-mono);
    font-size: 10px;
    letter-spacing: 0.42em;
    color: var(--pt-red);
}

/* ─────────── 开演前：题纸 ─────────── */

.probability-theater-layer .pt-intro {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 30px calc(env(safe-area-inset-bottom, 0px) + 40px);
}
.probability-theater-layer .pt-intro-mark {
    font-family: var(--pt-mono);
    font-size: 30px;
    font-weight: 900;
    letter-spacing: 0.12em;
}
.probability-theater-layer .pt-intro-sub {
    margin: 10px 0 34px;
    font-family: var(--pt-mono);
    font-size: 11px;
    line-height: 1.9;
    color: var(--pt-ink-2);
}
.probability-theater-layer .pt-input {
    width: 100%;
    box-sizing: border-box;
    border: 0;
    border-bottom: 1px solid var(--pt-ink);
    background: transparent;
    color: var(--pt-ink);
    font-family: var(--pt-mono);
    font-size: 14px;
    line-height: 1.9;
    text-align: center;
    padding: 6px 0;
    resize: none;
    outline: none;
}
.probability-theater-layer .pt-input::placeholder { color: var(--pt-ink-3); }
.probability-theater-layer .pt-input,
.probability-theater-layer .pt-input:focus { /* 压住 App 全局 textarea:focus 的 !important 底色 / 框 / 光晕 */
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid var(--pt-ink) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    -webkit-user-select: text;
    user-select: text;
}
/* 开演：一枚打字机键 —— 方正墨框，按下去整块反白（10-21 红笔圈删了，塔拉嫌怪） */
.probability-theater-layer .pt-go {
    position: relative;
    margin-top: 34px;
    min-width: 128px;
    padding: 12px 22px 12px 30px;
    border: 1.5px solid var(--pt-ink);
    border-radius: 2px;
    background: #f4f3f0;
    box-shadow: 0 3px 0 var(--pt-ink);
    color: var(--pt-ink);
    font-family: var(--pt-mono);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.6em;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.08s ease, color 0.08s ease;
}
.probability-theater-layer .pt-go:active {
    transform: translateY(3px);
    box-shadow: 0 0 0 var(--pt-ink);
    background: var(--pt-ink);
    color: #f4f3f0;
}
.probability-theater-layer .pt-go:disabled { opacity: 0.5; }
/* 另一条路：不拆题，直接掷骰 */
.probability-theater-layer .pt-go-dice {
    margin-top: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: 0;
    padding: 4px 6px;
    color: var(--pt-ink);
    font-family: var(--pt-mono);
    cursor: pointer;
}
.probability-theater-layer .pt-go-dice-t {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.18em;
    border-bottom: 1px dashed var(--pt-ink-2);
    padding-bottom: 2px;
}
.probability-theater-layer .pt-go-dice-s { font-size: 10px; color: var(--pt-ink-2); letter-spacing: 0.06em; }
.probability-theater-layer .pt-go-dice:active .pt-go-dice-t { color: var(--pt-red); border-bottom-color: var(--pt-red); }

/* 场景切换 */
.probability-theater-layer[data-scene="intro"] .pt-stage,
.probability-theater-layer[data-scene="intro"] .pt-premises,
.probability-theater-layer[data-scene="intro"] .pt-log,
.probability-theater-layer[data-scene="intro"] .pt-head { display: none; }
.probability-theater-layer[data-scene="stage"] .pt-intro { display: none; }
.probability-theater-layer[data-scene="stage"] .pt-head { animation: pt-fold-in 0.5s ease-out both; }
@keyframes pt-fold-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

/* ─────────── 舞台：沙地涟漪 + 复印钟盘沙漏 ─────────── */

.probability-theater-layer .pt-stage {
    position: relative;
    z-index: 2;
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 8px;
}
.probability-theater-layer .pt-hg {
    position: relative;
    width: min(48vw, 196px);
    aspect-ratio: 1;
}
.probability-theater-layer .pt-ripples { /* 沙地耙出的同心涟漪：模糊的暗环，由内向外荡开 */
    position: absolute;
    left: 50%;
    top: 50%;
    width: 300%;
    height: 300%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: repeating-radial-gradient(circle,
        transparent 0, transparent 34px,
        rgba(22, 20, 20, 0.16) 41px, rgba(22, 20, 20, 0.05) 47px, transparent 54px);
    filter: blur(5px);
    -webkit-mask-image: radial-gradient(circle, #000 18%, transparent 58%);
    mask-image: radial-gradient(circle, #000 18%, transparent 58%);
    pointer-events: none;
}
.probability-theater-layer .pt-hg.is-drawn .pt-ripples { animation: pt-ripple 1.8s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes pt-ripple {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.35); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.probability-theater-layer .pt-hg-print {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}
.probability-theater-layer .pt-hg.is-drawn .pt-hg-print { animation: pt-print-in 0.9s steps(6) both; }
@keyframes pt-print-in { /* 像复印机一行行吐出来 */
    from { clip-path: inset(0 0 100% 0); opacity: 0.4; }
    to { clip-path: inset(0 0 0 0); opacity: 1; }
}

/* ─────────── 道具可以动手（10-21） ─────────── */
/* 沙漏：armed = 沙在下腔，轻轻晃着等你翻；rollable = 轻敲落一粒 */
.probability-theater-layer .pt-stage[data-prop="armed"] .pt-hg,
.probability-theater-layer .pt-stage[data-prop="rollable"] .pt-hg {
    cursor: grab;
    touch-action: none;
}
.probability-theater-layer .pt-stage[data-prop="armed"] .pt-hg:active { cursor: grabbing; }
.probability-theater-layer .pt-stage[data-prop="armed"] .pt-hg-print { animation: pt-hg-invite 2.8s ease-in-out 0.6s infinite; }
@keyframes pt-hg-invite {
    0%, 70%, 100% { transform: rotate(0); }
    78% { transform: rotate(-5deg); }
    88% { transform: rotate(3deg); }
}
.probability-theater-layer .pt-stage[data-prop="rollable"] .pt-hg:active .pt-hg-print { transform: scale(0.97); }
.probability-theater-layer .pt-prop-hint {
    min-height: 14px;
    margin-top: 2px;
    font-family: var(--pt-mono);
    font-size: 10px;
    letter-spacing: 0.22em;
    color: var(--pt-ink-2);
    opacity: 0;
    transition: opacity 0.4s ease;
}
.probability-theater-layer .pt-prop-hint.is-on { opacity: 1; }
/* 不祥之兆出场：道具打个寒颤 */
.probability-theater-layer .is-shudder { animation: pt-shudder 0.5s ease-in-out both; }
@keyframes pt-shudder {
    0%, 100% { translate: 0 0; }
    15% { translate: -3px 0; }
    30% { translate: 3px 0; }
    45% { translate: -2px 0; }
    60% { translate: 2px 0; }
    80% { translate: -1px 0; }
}

/* 掷骰案：舞台换成一片沙地 + 两枚十面骰（十位锈红、个位骨白，和沙漏同一套复印色） */
.probability-theater-layer .pt-dice-tray { display: none; }
.probability-theater-layer .pt-stage.is-dice .pt-hg,
.probability-theater-layer .pt-stage.is-dice .pt-legend,
.probability-theater-layer .pt-stage.is-dice .pt-seats { display: none; }
.probability-theater-layer .pt-stage.is-dice .pt-dice-tray {
    display: block;
    position: relative;
    width: min(calc(100vw - 32px), 340px);
    height: 168px;
    touch-action: none;
    cursor: grab;
}
.probability-theater-layer .pt-dice-tray::before { /* 耙过的沙地 */
    content: '';
    position: absolute;
    inset: -20px -10px;
    border-radius: 50%;
    background: repeating-radial-gradient(ellipse 60% 42% at 50% 50%,
        transparent 0, transparent 18px,
        rgba(22, 20, 20, 0.13) 22px, rgba(22, 20, 20, 0.04) 26px, transparent 30px);
    filter: blur(3px);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 70%);
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 70%);
    pointer-events: none;
}
.pt-die,
.pt-die-shadow {
    position: absolute;
    left: 0;
    top: 0;
    width: 58px;
    height: 58px;
    pointer-events: none;
    will-change: transform;
}
.pt-die-shadow {
    border-radius: 50%;
    height: 18px;
    top: 30px;
    background: radial-gradient(ellipse at center, rgba(22, 20, 20, 0.55), transparent 70%);
    opacity: 0.4;
}
.pt-die svg { display: block; width: 100%; height: 100%; overflow: visible; }
.pt-die .pt-die-body { stroke: #161414; stroke-width: 2.6; stroke-linejoin: round; }
.pt-die .pt-die-face { stroke: #161414; stroke-width: 1.6; stroke-linejoin: round; }
.pt-die .pt-die-edge { fill: none; stroke: #161414; stroke-width: 1.6; stroke-linecap: round; }
.pt-die-tens .pt-die-body { fill: rgb(122, 40, 25); }
.pt-die-tens .pt-die-face { fill: rgb(150, 52, 32); }
.pt-die-ones .pt-die-body { fill: #d8d5cf; }
.pt-die-ones .pt-die-face { fill: #f4f2ee; }
.pt-die-num {
    position: absolute;
    left: 0;
    right: 0;
    top: 34%;
    text-align: center;
    font-family: 'Courier New', ui-monospace, monospace;
    font-weight: 900;
    font-size: 15px;
    line-height: 1;
    letter-spacing: -0.02em;
}
.pt-die-tens .pt-die-num { color: #f4f2ee; }
.pt-die-ones .pt-die-num { color: #161414; font-size: 18px; top: 32%; }
.pt-die.is-landed .pt-die-num { animation: pt-die-lock 0.35s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes pt-die-lock { from { transform: scale(1.6); opacity: 0.4; } to { transform: none; opacity: 1; } }
.probability-theater-layer .pt-dice-tally {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 2px;
    text-align: center;
    font-family: var(--pt-mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    color: var(--pt-ink);
}
.probability-theater-layer .pt-legend {
    display: flex;
    gap: 14px;
    margin-top: 4px;
    font-family: var(--pt-mono);
    font-size: 9px;
    letter-spacing: 0.15em;
    color: var(--pt-ink-2);
}
.probability-theater-layer .pt-legend i {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 4px;
    vertical-align: -0.5px;
    border: 1px solid var(--pt-ink);
}
.probability-theater-layer .pt-legend i.is-hit { background: var(--pt-ink); }
.probability-theater-layer .pt-legend i.is-miss { background: #f6f4f0; }
.probability-theater-layer .pt-pending {
    margin-top: 6px;
    font-family: var(--pt-mono);
    font-size: 10px;
    letter-spacing: 0.4em;
    color: var(--pt-ink-2);
    display: none;
}
.probability-theater-layer .pt-pending.is-on { display: block; }

/* 座位 = 收据上的条码：每轮一条，被点到的是粗黑条，你的座位红色 */
.probability-theater-layer .pt-seats {
    display: none;
    flex-direction: column;
    gap: 3px;
    width: min(62vw, 240px);
    margin-top: 8px;
}
.probability-theater-layer .pt-stage.has-seats .pt-seats { display: flex; }
.probability-theater-layer .pt-seat-row {
    display: flex;
    align-items: center;
    gap: 6px;
    animation: pt-fold-in 0.4s ease-out both;
}
.probability-theater-layer .pt-seat-label {
    flex: none;
    width: 10px;
    font-family: var(--pt-mono);
    font-size: 8px;
    color: var(--pt-ink-3);
    text-align: right;
}
.probability-theater-layer .pt-seat-cells {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(var(--pt-cols, 42), minmax(0, 1fr));
    gap: 1px;
}
.probability-theater-layer .pt-seat {
    display: block;
    height: 9px;
    background: rgba(22, 20, 20, 0.16);
    transform: scaleX(0.45);
}
.probability-theater-layer .pt-seat.lit { background: var(--pt-ink); transform: none; }
.probability-theater-layer .pt-seat.mine { background: var(--pt-red); transform: none; opacity: 0.55; }
.probability-theater-layer .pt-seat.mine.lit { opacity: 1; }

/* ─────────── 前提：撕边纸 + 胶带（可点 = 审讯） ─────────── */

.probability-theater-layer .pt-premises {
    position: relative;
    z-index: 3;
    flex: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 12px;
    padding: 12px 16px 2px;
}
.probability-theater-layer .pt-premises:empty { display: none; }
.probability-theater-layer .pt-premise {
    position: relative;
    max-width: 100%;
    border: 0;
    padding: 6px 12px 7px;
    font-family: var(--pt-mono);
    font-size: 11px;
    line-height: 1.5;
    text-align: left;
    color: var(--pt-ink);
    background: #f7f6f3;
    box-shadow: 1px 3px 5px rgba(22, 20, 20, 0.16);
    clip-path: polygon(0 8%, 6% 2%, 14% 6%, 30% 0, 52% 5%, 70% 1%, 88% 6%, 100% 2%, 98% 40%, 100% 72%, 96% 100%, 78% 95%, 55% 100%, 33% 94%, 12% 100%, 2% 93%, 0 60%);
    transform: rotate(var(--pt-tilt, -1deg));
    animation: pt-slip-in 0.5s cubic-bezier(.2, 1.3, .4, 1) backwards; /* backwards：落定后交还 transform，被质疑时才拎得起来 */
    cursor: pointer;
}
.probability-theater-layer .pt-premise::before { /* 胶带 */
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    width: 30px;
    height: 9px;
    margin-left: -15px;
    background: rgba(190, 188, 182, 0.75);
    transform: rotate(-4deg);
}
.probability-theater-layer .pt-premise { transition: transform 0.35s cubic-bezier(.3, 1.4, .5, 1), box-shadow 0.35s ease, color 0.35s ease; }
/* 被质疑：纸条被拎起来一点（扶正、离开桌面、投影加深），字变红 —— 不再拉红线画红圈 */
.probability-theater-layer .pt-premise.is-accused {
    transform: translateY(-4px) scale(1.04) rotate(0deg);   /* 撕边 clip-path 会吃掉投影，靠位移 + 扶正 + 提亮 */
    background: #fffefb;
    color: var(--pt-red);
}
.probability-theater-layer .pt-ghost {
    display: block;
    margin-top: 2px;
    font-family: var(--pt-serif);
    font-size: 12px;
    font-weight: 900;
    color: var(--pt-red);
}
@keyframes pt-slip-in {
    from { opacity: 0; transform: translateY(-16px) rotate(calc(var(--pt-tilt, -1deg) * 6)); }
    to { opacity: 1; transform: rotate(var(--pt-tilt, -1deg)); }
}

/* ─────────── 记录 ─────────── */

.probability-theater-layer .pt-log {
    position: relative;
    z-index: 2;
    flex: 1;
    overflow-y: auto;
    padding: 14px 20px 18px;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22px);
    mask-image: linear-gradient(to bottom, transparent 0, #000 22px);
}
.probability-theater-layer .pt-line { margin: 0 0 16px; animation: pt-fold-in 0.4s ease-out both; }

/* 系统行：居中打字机「00:04 / 一句话」 */
.probability-theater-layer .pt-sys {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    font-family: var(--pt-mono);
    font-size: 12px;
    line-height: 1.7;
    color: #2a2726;
}
.probability-theater-layer .pt-sys-time { font-size: 12px; }
.probability-theater-layer .pt-sys-slash { color: var(--pt-ink-3); line-height: 1.2; }
.probability-theater-layer .pt-sys .pt-text { max-width: 30em; }
/* 开头交代一句就走：淡出并把高度收掉 */
.probability-theater-layer .pt-sys.is-fleeting {
    max-height: 140px;
    overflow: hidden;
    transition: opacity 0.5s ease, max-height 0.6s ease 0.1s, margin 0.6s ease 0.1s;
}
.probability-theater-layer .pt-sys.is-leaving { opacity: 0; max-height: 0; margin: 0; }

/* 声音：照「内在众声」样板 */
.probability-theater-layer .pt-voice,
.pt-dossier .pt-voice {
    position: relative;
    display: block;
    min-height: 74px;
    padding: 4px 0 10px 62px;
    margin-bottom: 18px;
    transition: opacity 0.6s ease, filter 0.6s ease;
}
.pt-voice .pt-sigil-box {
    position: absolute;
    left: -4px;
    top: -2px;
    width: 52px;
    height: 70px;
}
.pt-voice .pt-portrait {
    display: block;
    width: 100%;
    height: 100%;
    color: #1a1716;
    animation: pt-face-in 0.5s ease-out both;
}
.pt-voice .pt-portrait.is-mirror { transform: scaleX(-1); }
.pt-portrait.pt-patch-ash { --pt-patch: #6f6c69; --pt-patch-o: .26; }
.pt-portrait.pt-patch-rose { --pt-patch: #c4373f; --pt-patch-o: .26; }
.pt-portrait.pt-patch-ochre { --pt-patch: #7d6a52; --pt-patch-o: .28; }
@keyframes pt-face-in {
    from { opacity: 0; filter: blur(2px); }
    to { opacity: 0.85; filter: none; }
}
.pt-voice .pt-role {
    display: block;
    font-size: 9px;
    letter-spacing: 0.12em;
    color: rgba(22, 20, 20, 0.55);
    font-family: var(--pt-serif, serif);
}
.pt-voice .pt-name {
    position: relative;
    display: inline-block;
    min-height: 1.3em;
    margin: 2px 0 6px;
    font-family: var(--pt-serif, serif);
    font-size: 23px;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1.3;
    color: #b0141a;
}
.pt-voice.is-doubt .pt-name { color: #161414; }
.pt-voice .pt-reply {
    display: block;
    margin: -4px 0 2px;
    font-family: var(--pt-mono, monospace);
    font-size: 10px;
    color: rgba(22, 20, 20, 0.5);
}
.pt-voice .pt-text {
    margin: 0;
    font-family: var(--pt-serif, serif);
    font-size: 14px;
    line-height: 1.9;
    color: #201d1c;
}
.pt-voice.is-doubt .pt-text { color: #b0141a; font-weight: 700; }
.pt-voice.is-receded { opacity: 0.36; filter: grayscale(0.5); }
.pt-voice.is-reaction { min-height: 60px; }
.pt-voice.is-reaction .pt-name { font-size: 17px; }
.pt-text.pt-strike {
    text-decoration: line-through;
    text-decoration-color: rgba(176, 20, 26, 0.85);
    text-decoration-thickness: 1.5px;
    opacity: 0.6;
}
.pt-voice.pt-ruled .pt-name::after { /* 析理入微：名字下描一道直尺线 */
    content: '';
    position: absolute;
    left: 0;
    right: -6px;
    bottom: -2px;
    height: 1.4px;
    background: currentColor;
    transform-origin: left;
    animation: pt-rule 0.6s ease-out both;
}
@keyframes pt-rule { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.pt-voice.pt-drift .pt-text { animation: pt-drift 2.6s ease-in-out 2; }
@keyframes pt-drift {
    0%, 100% { transform: none; }
    30% { transform: translateX(1.5px); }
    65% { transform: translateX(-1px); }
}

/* ─────────── 判决 ─────────── */

.probability-theater-layer .pt-verdict { position: relative; margin-top: 8px; text-align: center; }
.probability-theater-layer .pt-verdict-tag {
    font-family: var(--pt-mono);
    font-size: 11px;
    letter-spacing: 0.35em;
    color: var(--pt-red);
}
.probability-theater-layer .pt-verdict-row {
    position: relative;
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    margin: 6px 0 2px;
}
.probability-theater-layer .pt-verdict-approx { font-family: var(--pt-mono); font-size: 16px; margin-right: 6px; color: var(--pt-ink-2); }
.probability-theater-layer .pt-verdict-num {
    font-family: var(--pt-mono);
    font-size: 50px;
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
    min-width: 2ch;
}
.probability-theater-layer .pt-verdict-pct { font-family: var(--pt-mono); font-size: 20px; font-weight: 900; }
.pt-stamp,
.pt-dossier-stamp {
    position: absolute;
    right: -48px;
    top: -6px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 10-21：圆圈章 → 方印（双框、端正），不再是红圈 */
    border: 2px solid #b0141a;
    border-radius: 3px;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5), inset 0 0 0 3px rgba(176, 20, 26, 0.75);
    color: #b0141a;
    font-family: var(--pt-serif, serif);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.04em;
    opacity: 0;
}
.probability-theater-layer .pt-verdict.is-fixed .pt-stamp { animation: pt-stamp 0.42s cubic-bezier(.3, 1.6, .5, 1) 0.12s forwards; }
@keyframes pt-stamp {
    0% { opacity: 0; transform: scale(1.9); }
    100% { opacity: 0.86; transform: scale(1); }
}
.probability-theater-layer .pt-verdict-label { font-family: var(--pt-mono); font-size: 11px; color: var(--pt-ink-2); }
.probability-theater-layer .pt-dist {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
    margin: 16px auto 0;
}
.probability-theater-layer .pt-dist-col { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 26px; }
.probability-theater-layer .pt-dist-bar {
    display: block;
    width: 13px;
    height: var(--pt-h, 2px);
    background: var(--pt-ink);
    transform-origin: bottom;
    animation: pt-bar-grow 0.5s cubic-bezier(.3, 1.2, .5, 1) both;
}
.probability-theater-layer .pt-dist-bar.pt-tail { background: var(--pt-red); }
@keyframes pt-bar-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.probability-theater-layer .pt-dist-k,
.probability-theater-layer .pt-dist-p { font-family: var(--pt-mono); font-size: 9px; color: var(--pt-ink-2); }
.probability-theater-layer .pt-dist-curve { margin-top: 10px; font-family: var(--pt-mono); font-size: 11px; color: var(--pt-ink-2); }
.probability-theater-layer .pt-rounds { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin-top: 12px; }
.probability-theater-layer .pt-round { font-family: var(--pt-mono); font-size: 10px; color: var(--pt-ink-2); }

/* 页脚（照记录页） */
.probability-theater-layer .pt-footer {
    margin-top: 26px;
    text-align: center;
    font-family: var(--pt-mono);
    font-size: 11px;
    line-height: 1.8;
    color: #2a2726;
}

/* 检定：让世界真的发生一次 */
.probability-theater-layer .pt-roll { text-align: center; margin: 10px 0 20px; }
.probability-theater-layer .pt-roll-tag { font-family: var(--pt-mono); font-size: 11px; letter-spacing: 0.3em; color: var(--pt-ink-2); }
.probability-theater-layer .pt-roll-res {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 16px;
    font-family: var(--pt-mono);
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 0.2em;
}
.probability-theater-layer .pt-roll.is-hit .pt-roll-res { background: var(--pt-ink); color: #f6f4f0; }
.probability-theater-layer .pt-roll.is-miss .pt-roll-res { border: 2px solid var(--pt-ink); }

/* 余波 */
.probability-theater-layer .pt-afterglow { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.probability-theater-layer .pt-ag { position: absolute; font-family: var(--pt-mono); color: var(--pt-ink); opacity: 0; }
.probability-theater-layer .pt-afterglow.is-on .pt-ag { animation: pt-ag 4.5s ease-out forwards; }
@keyframes pt-ag {
    0% { opacity: 0; transform: translateY(0); }
    18% { opacity: 0.2; }
    100% { opacity: 0.05; transform: translateY(-26px); }
}

/* ─────────── 编号选项 ─────────── */

.probability-theater-layer .pt-options {
    position: relative;
    z-index: 3;
    flex: none;
    display: none;
    flex-direction: column;
    padding: 6px 22px calc(env(safe-area-inset-bottom, 0px) + 14px);
    border-top: 1px dashed rgba(22, 20, 20, 0.3);
}
.probability-theater-layer .pt-options.is-on { display: flex; }
.probability-theater-layer .pt-opt {
    display: flex;
    gap: 10px;
    align-items: baseline;
    background: none;
    border: 0;
    padding: 8px 0;
    font-family: var(--pt-mono);
    font-size: 14px;
    text-align: left;
    color: var(--pt-ink);
    cursor: pointer;
    animation: pt-fold-in 0.35s ease-out both;
}
.probability-theater-layer .pt-opt-n { font-size: 12px; color: var(--pt-red); }
.probability-theater-layer .pt-opt:active .pt-opt-t,
.probability-theater-layer .pt-opt:hover .pt-opt-t { color: var(--pt-red); text-decoration: underline; text-underline-offset: 4px; }

/* 参数纸 */
.probability-theater-layer .pt-paramsheet {
    padding: 16px 16px 12px;
    background: #f7f6f3;
    box-shadow: 1px 4px 12px rgba(22, 20, 20, 0.16);
    clip-path: polygon(0 2%, 4% 0, 30% 2%, 60% 0, 98% 1%, 100% 50%, 99% 96%, 70% 100%, 40% 98%, 2% 100%, 0 60%);
    transform: rotate(-0.6deg);
}
.probability-theater-layer .pt-sheet-title { font-family: var(--pt-mono); font-size: 15px; font-weight: 900; letter-spacing: 0.2em; color: var(--pt-red); }
.probability-theater-layer .pt-sheet-hint { margin: 2px 0 8px; font-family: var(--pt-mono); font-size: 10px; color: var(--pt-ink-2); }
.probability-theater-layer .pt-param-row { display: flex; align-items: center; gap: 12px; margin: 6px 0; }
.probability-theater-layer .pt-param-name { min-width: 92px; font-family: var(--pt-mono); font-size: 12px; }
.probability-theater-layer .pt-param-slider { flex: 1; accent-color: var(--pt-red); }
.probability-theater-layer .pt-sheet-actions { display: flex; justify-content: flex-end; gap: 16px; margin-top: 8px; }
.probability-theater-layer .pt-sheet-btn {
    background: none;
    border: 0;
    font-family: var(--pt-mono);
    font-size: 13px;
    letter-spacing: 0.2em;
    color: var(--pt-ink-2);
    cursor: pointer;
}
.probability-theater-layer .pt-sheet-btn.is-primary { color: var(--pt-red); font-weight: 900; }

/* ─────────── 聊天里的案卷卡 ─────────── */

.pt-dossier {
    --pt-red: #b0141a;
    --pt-ink: #161414;
    --pt-serif: 'SimSun', 'Songti SC', 'Noto Serif SC', 'Source Han Serif SC', Georgia, serif;
    --pt-mono: 'Courier New', ui-monospace, Consolas, monospace;
    --pt-grain-s: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.08  0 0 0 0 0.08  0 0 0 0 0.08  0 0 0 1.25 -0.38'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    /* 10-21 纸张层叠：案卷夹硬纸（带耳签）→ 垫纸 → 内容页。全部横平竖直；
       只有最上面那页的下沿是撕的，后面两层是规矩的直边，立体感从层叠和投影来 */
    position: relative;
    width: min(320px, 76vw);
    padding: 18px 12px 12px 0;   /* 上：耳签；右 / 下：给后两层露边 */
    color: var(--pt-ink);
    font-family: var(--pt-serif);
    text-align: left;
}
.pt-dossier .pt-dossier-folder { /* 案卷夹：深一档的灰硬纸，直角微圆，最底层 */
    position: absolute;
    left: 10px;
    right: 0;
    top: 18px;
    bottom: 0;
    border-radius: 3px;
    background: linear-gradient(180deg, #8e8b85, #7e7b75);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 1px 1px rgba(22, 20, 20, 0.3), 0 8px 18px rgba(22, 20, 20, 0.22);
}
.pt-dossier .pt-dossier-tab {
    position: absolute;
    top: -16px;
    right: 18px;
    height: 17px;
    padding: 0 12px;
    border-radius: 3px 3px 0 0;
    background: #8e8b85;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
    font-family: var(--pt-mono);
    font-size: 9px;
    font-weight: 700;
    line-height: 17px;
    letter-spacing: 0.22em;
    color: #f2f1ee;
    white-space: nowrap;
}
.pt-dossier .pt-dossier-under { /* 垫纸：规矩的直边，比内容页往右下错开一点 */
    position: absolute;
    left: 5px;
    right: 6px;
    top: 24px;
    bottom: 6px;
    background: #dddbd6;
    box-shadow: 0 1px 1px rgba(22, 20, 20, 0.22), 0 2px 5px rgba(22, 20, 20, 0.12);
}
.pt-dossier .pt-dossier-sheet { /* 内容页：投影用 drop-shadow 打在撕边的形状上（box-shadow 会被 clip-path 吃掉） */
    position: relative;
    padding: 16px 18px 20px;
    filter: drop-shadow(0 1px 1px rgba(22, 20, 20, 0.22)) drop-shadow(0 4px 6px rgba(22, 20, 20, 0.14));
}
.pt-dossier .pt-dossier-sheet::before,
.pt-dossier .pt-dossier-sheet::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: #efeeeb;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), 94% calc(100% - 3px), 87% calc(100% - 8px), 80% 100%, 72% calc(100% - 6px),
        63% calc(100% - 1px), 55% calc(100% - 7px), 46% 100%, 38% calc(100% - 6px), 29% calc(100% - 1px), 21% calc(100% - 8px),
        12% calc(100% - 2px), 5% calc(100% - 7px), 0 calc(100% - 3px));
}
.pt-dossier .pt-dossier-sheet::after { /* 纸纹薄薄一层，别压字 */
    background: var(--pt-grain-s);
    background-size: 160px 160px;
    opacity: 0.22;
    mix-blend-mode: multiply;
}
.pt-dossier .pt-dossier-sheet > * { position: relative; }
.pt-dossier .pt-dossier-tape { /* 一小截红胶带压住内容页上沿，端正 */
    position: absolute !important;
    top: -7px;
    left: 22px;
    width: 34px;
    height: 13px;
    background: var(--pt-grain-s), rgba(176, 20, 26, 0.82);
    background-size: 80px 80px, auto;
    box-shadow: 0 1px 2px rgba(22, 20, 20, 0.25);
}
.pt-dossier .pt-dossier-head { position: relative; display: flex; align-items: center; min-height: 26px; }
.pt-dossier .pt-dossier-no { font-family: var(--pt-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.2em; }
.pt-dossier .pt-dossier-stamp { right: 0; top: -4px; width: 34px; height: 34px; font-size: 10px; opacity: 0.84; }
.pt-dossier.is-stamped .pt-dossier-stamp { animation: pt-stamp 0.42s cubic-bezier(.3, 1.6, .5, 1) forwards; }
.pt-dossier .pt-dossier-q { position: relative; margin: 4px 42px 10px 0; font-family: var(--pt-mono); font-size: 13px; font-weight: 700; line-height: 1.6; }
.pt-dossier .pt-dossier-verdict { position: relative; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pt-dossier .pt-dossier-tag { font-family: var(--pt-mono); font-size: 10px; letter-spacing: 0.25em; color: var(--pt-red); margin-right: 4px; }
.pt-dossier .pt-dossier-num { font-family: var(--pt-mono); font-size: 32px; font-weight: 900; line-height: 1.1; letter-spacing: -0.03em; }
.pt-dossier .pt-dossier-pct { font-family: var(--pt-mono); font-size: 15px; font-weight: 900; }
.pt-dossier .pt-dossier-sub,
.pt-dossier .pt-dossier-rolls { position: relative; font-family: var(--pt-mono); font-size: 11px; color: rgba(22, 20, 20, 0.62); margin-top: 4px; }
.pt-dossier .pt-dossier-premise { position: relative; margin-top: 8px; font-size: 12px; line-height: 1.6; color: rgba(22, 20, 20, 0.75); }
.pt-dossier .pt-dossier-more { color: rgba(22, 20, 20, 0.45); }
.pt-dossier .pt-dossier-stage { position: relative; }
.pt-dossier .pt-dossier-stage:not(:empty) { margin: 14px 0 4px; }
.pt-dossier .pt-voice { min-height: 64px; padding-left: 54px; margin-bottom: 12px; }
.pt-dossier .pt-voice .pt-sigil-box { width: 48px; height: 64px; }
.pt-dossier .pt-voice .pt-name { font-size: 18px; }
.pt-dossier .pt-voice .pt-text { font-size: 13px; line-height: 1.8; }
.pt-dossier.is-replaying .pt-dossier-premise { opacity: 0.4; }
.pt-dossier .pt-dossier-actions { position: relative; display: flex; justify-content: flex-end; margin-top: 6px; }
.pt-dossier .pt-dossier-replay {
    background: none;
    border: 0;
    padding: 4px 0;
    font-family: var(--pt-mono);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.3em;
    color: var(--pt-red);
    cursor: pointer;
}
.pt-dossier .pt-dossier-more-box { position: relative; margin-top: 6px; border-top: 1px dashed rgba(22, 20, 20, 0.25); padding-top: 6px; }
.pt-dossier .pt-dossier-more-box summary { cursor: pointer; font-family: var(--pt-mono); font-size: 10px; letter-spacing: 0.2em; color: rgba(22, 20, 20, 0.5); }
.pt-dossier .pt-dossier-meta { margin-top: 6px; font-family: var(--pt-mono); font-size: 10px; color: rgba(22, 20, 20, 0.6); word-break: break-all; }
.pt-dossier .pt-dossier-list { margin-top: 6px; font-size: 12px; line-height: 1.7; color: rgba(22, 20, 20, 0.78); }
.pt-dossier .pt-dossier-list b { color: var(--pt-red); }

@media (prefers-reduced-motion: reduce) {
    .probability-theater-layer *,
    .pt-dossier * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* 题纸页也铺一圈沙地涟漪，和舞台同一套语言 */
.probability-theater-layer .pt-intro::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 46%;
    width: 760px;
    height: 760px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: repeating-radial-gradient(circle,
        transparent 0, transparent 40px,
        rgba(22, 20, 20, 0.13) 48px, rgba(22, 20, 20, 0.04) 55px, transparent 62px);
    filter: blur(6px);
    -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 62%);
    mask-image: radial-gradient(circle, #000 20%, transparent 62%);
    pointer-events: none;
    z-index: -1;
}
.probability-theater-layer .pt-intro { isolation: isolate; }
.pt-dossier .pt-dossier-branch { color: #b0141a; }
