/* ===== 基础重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --gold: #c9a84c;
    --gold-dim: #8a6d2b;
    --dark-bg: #1a1410;
    --dialog-bg: rgba(15, 10, 5, 0.92);
    --text-color: #e8dcc8;
    --text-dim: #9a8b76;
    --accent-red: #8b2020;
    --accent-red-bright: #c53030;
    --paper: #f4e8c1;
    --ink: #2a1a0a;
    --pressure-green: #4a8c5c;
    --pressure-yellow: #c9a84c;
    --pressure-red: #8b2020;
    --font-main: "Noto Serif SC", "Source Han Serif SC", "SimSun", "STSong", serif;
    --font-ui: "Microsoft YaHei", "PingFang SC", sans-serif;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    font-family: var(--font-main);
}

/* ===== 游戏容器（竖屏 9:16） ===== */
#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    max-width: 500px;
    margin: 0 auto;
    overflow: hidden;
    background: var(--dark-bg);
}
/* ★手机浏览器地址栏/工具条会盖住 100vh 的底部（作者8/9实测底部按钮被切）——
   dvh = 真实可视高度，底部元素才不会被吃掉 */
@supports (height: 100dvh) {
    #game-container { height: 100dvh; }
}

/* ===== 场景背景 ===== */
#scene-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: background-image 0.8s ease, filter 0.6s ease;
}

/* ===== 书房烛光效果 ===== */
#scene-bg[data-scene="study"]::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background: radial-gradient(
        ellipse 35% 30% at 30% 70%,
        rgba(244, 200, 100, 0.08) 0%,
        rgba(244, 180, 80, 0.03) 40%,
        transparent 70%
    );
    animation: candleFlicker 3s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes candleFlicker {
    0%   { opacity: 0.6; }
    25%  { opacity: 0.9; }
    50%  { opacity: 0.5; }
    75%  { opacity: 1; }
    100% { opacity: 0.7; }
}

/* ===== 现场勘查热点 ===== */
#investigation-overlay {
    position: absolute;
    inset: 0;
    z-index: 12;
    pointer-events: none;
}

#investigation-overlay:not(.hidden) {
    pointer-events: none;
}

.hotspot {
    position: absolute;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.3s;
}

.hotspot-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(201, 168, 76, 0.6);
    background: rgba(201, 168, 76, 0.15);
    transform: translate(-50%, -50%);
}

.hotspot-dot:hover {
    background: rgba(201, 168, 76, 0.35);
    border-color: rgba(201, 168, 76, 0.9);
    box-shadow: 0 0 12px rgba(201, 168, 76, 0.4);
    transform: translate(-50%, -50%) scale(1.15);
}

.hotspot-dot:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.hotspot.found {
    border-color: rgba(100, 100, 100, 0.3);
    background: rgba(100, 100, 100, 0.08);
    pointer-events: none;
    opacity: 0.4;
}

.hotspot.found .hotspot-pulse {
    display: none;
}

.hotspot.found .hotspot-label {
    color: rgba(150, 150, 150, 0.5);
}

.hotspot-pulse {
    position: absolute;
    inset: -6px;
    border: 2px solid var(--gold);
    border-radius: 50%;
    opacity: 0;
    animation: hotspotPulse 2s ease-in-out infinite;
}

@keyframes hotspotPulse {
    0%, 100% { opacity: 0; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.5); }
}

.hotspot-label {
    position: absolute;
    bottom: -26px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--gold);
    font-size: 11px;
    font-family: var(--font-ui);
    /* ★长句改为可折行 + 上限宽（作者8/10：原来 nowrap，右侧那条直接伸出屏幕被切）*/
    white-space: normal;
    max-width: min(42vw, 190px);
    width: max-content;
    line-height: 1.35;
    text-align: center;
    background: rgba(20,13,6,0.72);
    padding: 3px 8px;
    border-radius: 4px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.9);
    letter-spacing: 1px;
}
/* 贴边热点：标签靠自己那侧对齐，不再居中外溢 */
.hotspot-label.anchor-right { left: auto; right: 0; transform: none; text-align: right; }
.hotspot-label.anchor-left  { left: 0; right: auto; transform: none; text-align: left; }

#investigation-done-btn {
    position: absolute;
    bottom: 12%;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto;
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.2), rgba(201, 168, 76, 0.08));
    border: 1px solid var(--gold-dim);
    border-radius: 6px;
    padding: 12px 28px;
    color: var(--gold);
    font-family: var(--font-main);
    font-size: 15px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
    animation: fadeInUp 0.5s ease-out;
}

#investigation-done-btn:hover {
    background: rgba(201, 168, 76, 0.2);
    border-color: var(--gold);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== 点选交互场景（走访 hub）===== */
.scene-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    animation: sceneFadeIn 0.5s ease-out;
}

@keyframes sceneFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.scene-banner {
    position: absolute;
    /* ★让开顶部 HUD（钱袋/行囊/札记）——原来 3% 会压住札记那枚（作者8/10）*/
    top: calc(54px + env(safe-area-inset-top, 0px));
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none;
    padding: 8px 28px;
    background: linear-gradient(180deg, rgba(26,18,10,0.78), rgba(26,18,10,0.4));
    border: 1px solid rgba(201,168,76,0.4);
    border-radius: 4px;
    max-width: 78%;
}

.scene-title {
    font-family: var(--font-main);
    font-size: 22px;
    color: var(--gold);
    letter-spacing: 3px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.9);
}

.scene-intro {
    font-family: var(--font-main);
    font-size: 13px;
    color: rgba(245,236,216,0.78);
    margin-top: 3px;
    letter-spacing: 1px;
    line-height: 1.5;
}

.scene-npc {
    position: absolute;
    transform: translate(-50%, -100%);
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.25s ease, filter 0.25s ease;
}

.scene-npc-inner {
    position: relative;
    display: flex;
    flex-direction: column-reverse; /* 标签显示在立绘头顶上方 */
    align-items: center;
}

.scene-npc-sprite {
    height: 30vh;
    max-height: 340px;
    width: auto;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.55));
    -webkit-user-drag: none;
    user-select: none;
}

.scene-npc-label {
    margin: 0 0 6px 0;   /* 头顶上方，而非身下 */
    padding: 3px 12px;
    background: rgba(26,18,10,0.82);
    border: 1px solid rgba(201,168,76,0.55);
    border-radius: 3px;
    color: var(--gold);
    font-family: var(--font-main);
    font-size: 13px;
    letter-spacing: 2px;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.9);
}

.scene-npc:hover {
    transform: translate(-50%, -102%) scale(1.04);
    filter: brightness(1.15);
}

.scene-npc:hover .scene-npc-label {
    background: rgba(201,168,76,0.92);
    color: var(--dark-bg);
    border-color: var(--gold);
}

.scene-npc.visited {
    filter: brightness(0.55) grayscale(0.4);
}
.scene-npc.visited .scene-npc-label {
    opacity: 0.65;
}

.scene-exit-row {
    position: absolute;
    bottom: 6%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    pointer-events: auto;
    z-index: 3;
}

.scene-exit-btn {
    pointer-events: auto;
    background: linear-gradient(135deg, rgba(201,168,76,0.28), rgba(26,18,10,0.85));
    border: 1px solid var(--gold-dim);
    border-radius: 5px;
    padding: 8px 20px;
    color: var(--gold);
    font-family: var(--font-main);
    font-size: 13px;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.scene-exit-btn:hover {
    background: rgba(201,168,76,0.28);
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(201,168,76,0.25);
}

.scene-exit-btn:active {
    transform: translateY(0);
}

.scene-hotspot {
    pointer-events: auto;
}

/* ===== 显眼热点（升堂之类的关键入口）===== */
.hotspot-prominent {
    width: auto !important;
    height: auto !important;
    border-radius: 6px !important;
    border: 2px solid var(--gold) !important;
    background: linear-gradient(135deg, rgba(122, 28, 28, 0.92), rgba(70, 14, 14, 0.95)) !important;
    padding: 14px 28px;
    transform: translate(-50%, -50%) !important;
    box-shadow: 0 0 22px rgba(201, 168, 76, 0.45), inset 0 0 8px rgba(0,0,0,0.5);
    animation: prominentPulse 2.4s ease-in-out infinite;
}

.hotspot-prominent:hover {
    background: linear-gradient(135deg, rgba(150, 38, 38, 0.95), rgba(95, 18, 18, 0.97)) !important;
    border-color: #f0d090 !important;
    box-shadow: 0 0 30px rgba(240, 208, 144, 0.65), inset 0 0 8px rgba(0,0,0,0.5) !important;
    transform: translate(-50%, -50%) scale(1.05) !important;
}

.hotspot-prominent .hotspot-label {
    position: static;
    transform: none;
    color: #f4d090;
    font-size: 17px;
    letter-spacing: 6px;
    font-weight: 700;
    text-shadow: 0 2px 6px rgba(0,0,0,0.9), 0 0 14px rgba(201,168,76,0.3);
    white-space: nowrap;
}

.hotspot-prominent .hotspot-pulse {
    display: none; /* 用 box-shadow 自带的 prominent 脉动代替 */
}

@keyframes prominentPulse {
    0%, 100% { box-shadow: 0 0 22px rgba(201, 168, 76, 0.45), inset 0 0 8px rgba(0,0,0,0.5); }
    50% { box-shadow: 0 0 36px rgba(201, 168, 76, 0.75), inset 0 0 8px rgba(0,0,0,0.5); }
}

/* ===== 氛围叠加层 ===== */
#atmosphere-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    transition: background 0.8s ease;
    z-index: 1;
}

.atmosphere-interrogation {
    background: linear-gradient(
        to bottom,
        rgba(60, 10, 10, 0.3) 0%,
        rgba(20, 5, 5, 0.1) 40%,
        rgba(20, 5, 5, 0.4) 100%
    ) !important;
}

.atmosphere-tense {
    background: linear-gradient(
        to bottom,
        rgba(80, 10, 10, 0.45) 0%,
        rgba(30, 5, 5, 0.2) 40%,
        rgba(40, 5, 5, 0.55) 100%
    ) !important;
}

.atmosphere-breakthrough {
    background: rgba(0, 0, 0, 0.7) !important;
}

/* ===== 角色立绘 ===== */
#character-layer {
    position: absolute;
    bottom: 37%;
    left: 50%;
    transform: translateX(-50%);
    width: 72%;
    height: 58%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 2;
    transition: transform 0.3s ease, filter 0.3s ease;
}

#character-sprite {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom center;
    transition: background-image 0.15s ease, transform 0.2s ease, filter 0.3s ease;
    filter: drop-shadow(0 4px 20px rgba(0,0,0,0.5));
}

/* ── 双人同台（作者 8/9：参考 blood-detective，对话时另一个人别整个消失，模糊一下）──
   主位＝正在说话的人，清晰、在前；副位＝刚说完的那个，压暗+去饱和+轻微模糊，退到后面。
   两人各让开一点，副位略小，看着像站在稍后方。单人说话时副位不显示，主位仍居中。 */
#character-layer { position: absolute; }
#character-sprite, #character-sprite-sub {
    position: absolute;
    left: 0; right: 0; bottom: 0; top: 0;
}
#character-sprite { z-index: 2; }
#character-sprite-sub {
    z-index: 1;
    opacity: 0;
    width: 100%; height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom center;
    transform-origin: bottom center;
    transform: translateX(-14%) scale(.93);
    /* 与 blood-detective 同一档处理 */
    filter: brightness(.68) saturate(.75) blur(1.2px) drop-shadow(0 4px 16px rgba(0,0,0,.45));
    transition: opacity .28s ease, transform .28s ease;
    pointer-events: none;
}
#character-sprite-sub.show { opacity: 1; }
/* 台上两个人时，说话的这位让开一点，别正好压住后面那位的脸 */
#character-layer.duo #character-sprite { transform: translateX(10%); }

/* 角色动画效果 */
.char-shake {
    animation: charShake 0.4s ease-in-out;
}

.char-tremble {
    animation: charTremble 0.8s ease-in-out infinite;
}

.char-flinch {
    animation: charFlinch 0.3s ease-out;
}

@keyframes charShake {
    0%, 100% { transform: translateX(-50%); }
    20% { transform: translateX(calc(-50% + 8px)); }
    40% { transform: translateX(calc(-50% - 8px)); }
    60% { transform: translateX(calc(-50% + 5px)); }
    80% { transform: translateX(calc(-50% - 3px)); }
}

@keyframes charTremble {
    0%, 100% { transform: translateX(-50%); }
    25% { transform: translateX(calc(-50% + 2px)); }
    75% { transform: translateX(calc(-50% - 2px)); }
}

@keyframes charFlinch {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(0.97); }
    100% { transform: translateX(-50%) scale(1); }
}

/* ===== 角色名牌 ===== */
#name-plate {
    position: absolute;
    top: -16px;
    left: 0;
    z-index: 11;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
    padding: 4px 18px;
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    pointer-events: none;
}

#character-name {
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 700;
    color: var(--dark-bg);
    letter-spacing: 4px;
}

/* ===== 对话框 ===== */
#dialog-box {
    position: absolute;
    bottom: 18%;
    left: 4%;
    right: 4%;
    z-index: 10;
    background: var(--dialog-bg);
    border: 1px solid var(--gold-dim);
    border-radius: 4px;
    padding: 20px 18px 16px;
    min-height: 120px;
    cursor: pointer;
    backdrop-filter: blur(4px);
}

#dialog-text {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-color);
    letter-spacing: 1px;
    min-height: 60px;
    max-height: 45vh;
    overflow-y: auto;
}

#dialog-text .highlight {
    color: var(--gold);
    font-weight: 700;
}

/* ===== 附耳私语样式（whisper）===== */
/* 狄仁杰/元芳私下小声沟通时：对话框略暗、加一道竖线、文字偏斜、名牌加"· 附耳"后缀 */
#dialog-box.whisper {
    background: rgba(22, 20, 34, 0.78);
    border: 1px solid rgba(180, 150, 80, 0.35);
    border-left: 3px solid rgba(200, 170, 100, 0.55);
}
#dialog-box.whisper #dialog-text {
    font-style: italic;
    color: #d6cfbd;
    opacity: 0.95;
}
#dialog-box.whisper #character-name::after {
    content: ' · 附耳';
    font-size: 0.72em;
    font-weight: 400;
    letter-spacing: 1px;
    margin-left: 6px;
    opacity: 0.7;
}

#click-indicator {
    position: absolute;
    bottom: 8px;
    right: 14px;
    color: var(--gold);
    font-size: 12px;
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

/* ===== 内心独白 ===== */
#inner-thought {
    position: absolute;
    /* 避开 TapTap 小程序顶栏胶囊（~88px 含 safe-area）+ iOS 灵动岛/刘海 */
    top: max(14%, calc(env(safe-area-inset-top, 0px) + 96px));
    left: 6%;
    right: 6%;
    /* z-index 调高盖住右上角胶囊（#menu-btn z=60 / #back-launcher z=50 / #pressure-meter z=12）
       气泡是临时浮层，玩家点开消失后右上角胶囊重新可见 */
    z-index: 70;
    background: rgba(244, 232, 193, 0.95);
    border: 1px solid var(--gold-dim);
    border-radius: 6px;
    padding: 14px 16px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: thoughtSlideIn 0.4s ease-out;
}

@keyframes thoughtSlideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

#thought-icon {
    font-size: 13px;
    flex-shrink: 0;
    background: var(--gold);
    color: var(--dark-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 700;
    letter-spacing: 2px;
    font-style: normal;
}

#thought-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--ink);
    font-style: normal;
}

/* ===== 选项面板 ===== */
#choices-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);   /* 屏幕上下左右完全居中 */
    z-index: 15;
    display: flex;
    flex-direction: column;
    align-items: stretch;       /* 让所有按钮横向铺满容器 → 等宽，左右对齐 */
    gap: 14px;
    width: 86%;
    max-width: 420px;
}

.choice-btn {
    /* 半透明背景 + 胶囊圆角，弱化"方格"感 */
    background: rgba(20, 14, 8, 0.5);
    border: 1px solid rgba(201, 168, 76, 0.28);
    border-radius: 26px;
    padding: 13px 22px;
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 15px;
    letter-spacing: 0.8px;
    line-height: 1.5;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
    text-align: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    width: 100%;             /* 等宽：所有按钮宽度 = 容器宽度，左右自然对齐 */
    white-space: normal;
    word-break: keep-all;
}

.choice-btn:hover {
    background: rgba(201, 168, 76, 0.18);
    border-color: rgba(201, 168, 76, 0.7);
    transform: scale(1.02);
}

.choice-btn:active {
    transform: scale(0.98);
}

@media (max-width: 480px) {
    #choices-panel {
        width: 88%;
    }
    .choice-btn {
        font-size: 14px;
        padding: 12px 18px;
        letter-spacing: 0.5px;
    }
}

/* ===== 审讯输入面板 ===== */
#interrogation-panel {
    position: absolute;
    bottom: calc(10% + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    z-index: 15;
    background: linear-gradient(to top, rgba(10, 6, 3, 0.98) 70%, rgba(10, 6, 3, 0.8));
    padding: 10px 12px 14px;
    border-top: 1px solid var(--gold-dim);
}

#evidence-hint {
    margin-bottom: 8px;
    padding: 6px 12px;
    background: rgba(201, 168, 76, 0.1);
    border-left: 3px solid var(--gold);
    border-radius: 2px;
    font-size: 12px;
    color: var(--gold);
    animation: hintFade 0.3s ease-out;
}

@keyframes hintFade {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

#input-wrapper {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

#player-input {
    flex: 1;
    background: rgba(244, 232, 193, 0.08);
    border: 1px solid var(--gold-dim);
    border-radius: 4px;
    padding: 10px 14px;
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

#player-input:focus {
    border-color: var(--gold);
}

#player-input::placeholder {
    color: var(--text-dim);
}

#send-btn {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
    border: none;
    border-radius: 4px;
    padding: 10px 26px;
    min-width: 72px;
    color: var(--dark-bg);
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
}

#send-btn:hover { opacity: 0.9; }
#send-btn:active { transform: scale(0.95); }
#send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

#interrogation-tools {
    display: flex;
    gap: 8px;
}

.tool-btn {
    flex: 1;
    background: rgba(244, 232, 193, 0.06);
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 4px;
    padding: 8px;
    color: var(--text-dim);
    font-family: var(--font-ui);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: rgba(201, 168, 76, 0.12);
    color: var(--gold);
    border-color: var(--gold-dim);
}

.tool-btn.has-hint {
    background: rgba(201, 168, 76, 0.18);
    color: var(--gold);
    border-color: var(--gold);
    animation: hintPulse 1.8s ease-in-out infinite;
}

@keyframes hintPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0); }
    50%      { box-shadow: 0 0 10px 2px rgba(201, 168, 76, 0.35); }
}

/* ===== 线索面板 ===== */
#evidence-panel {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
}

#evidence-panel-inner {
    width: 88%;
    max-height: 75vh;
    background: var(--dialog-bg);
    border: 1px solid var(--gold-dim);
    border-radius: 6px;
    padding: 24px 18px;
    overflow-y: auto;
    position: relative;
}

#evidence-panel-inner h3 {
    color: var(--gold);
    font-size: 18px;
    letter-spacing: 4px;
    text-align: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gold-dim);
}

#evidence-search {
    width: 100%;
    background: rgba(244, 232, 193, 0.06);
    border: 1px solid var(--gold-dim);
    border-radius: 4px;
    padding: 8px 12px;
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 14px;
    outline: none;
    margin-bottom: 12px;
    box-sizing: border-box;
    transition: border-color 0.2s, background 0.2s;
}

#evidence-search:focus {
    border-color: var(--gold);
    background: rgba(244, 232, 193, 0.12);
}

#evidence-search::placeholder {
    color: var(--text-dim);
    letter-spacing: 1px;
}

/* 搜索时被过滤掉的项 */
.evidence-item.search-hidden,
.ev-cat-header.search-hidden {
    display: none;
}

/* 关键词高亮 */
.ev-search-hl {
    background: rgba(255, 215, 96, 0.35);
    color: #fff8d8;
    padding: 0 2px;
    border-radius: 2px;
}

.evidence-empty-hint {
    color: var(--text-dim);
    text-align: center;
    padding: 20px 10px;
    font-size: 13px;
    letter-spacing: 1px;
    font-style: italic;
}

.ev-cat-header {
    color: var(--gold);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 6px 0 4px;
    margin-top: 10px;
    border-bottom: 1px solid rgba(201, 168, 76, 0.25);
    margin-bottom: 8px;
    opacity: 0.8;
}

.ev-cat-header:first-child {
    margin-top: 0;
}

.evidence-item {
    background: rgba(244, 232, 193, 0.05);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 4px;
    padding: 12px 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.ev-icon {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
    background: rgba(244, 232, 193, 0.08);
    border: 1px solid rgba(201, 168, 76, 0.15);
    padding: 4px;
}

.ev-text-wrap {
    flex: 1;
    min-width: 0;
}

.evidence-item:hover {
    background: rgba(201, 168, 76, 0.1);
    border-color: var(--gold-dim);
}

.evidence-item .ev-title {
    color: var(--gold);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.evidence-item .ev-desc {
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.6;
}

.evidence-item.ev-new {
    border-color: var(--gold);
    animation: evPulse 1s ease-in-out 2;
}

@keyframes evPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0); }
    50% { box-shadow: 0 0 12px 2px rgba(201, 168, 76, 0.3); }
}

#close-evidence {
    position: sticky;
    top: 0;
    width: 100%;
    margin-bottom: 12px;
    padding: 12px;
    font-size: 14px;
    background: var(--dialog-bg);
    border-color: var(--gold-dim);
    color: var(--gold);
    z-index: 1;
}

/* ===== 压力指示器 ===== */
#pressure-meter {
    position: absolute;
    /* 让心理防线避开 TapTap 顶栏 + #menu-btn (env+100) + #back-launcher (env+148) 两层胶囊 */
    top: calc(env(safe-area-inset-top, 0px) + 196px);
    right: 12px;
    z-index: 12;
    text-align: right;
    background: rgba(15, 10, 5, 0.7);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(201, 168, 76, 0.2);
}

#pressure-label {
    font-size: 12px;
    color: var(--gold-dim);
    margin-bottom: 5px;
    letter-spacing: 2px;
    font-family: var(--font-ui);
}

#pressure-bar-bg {
    width: 130px;
    height: 8px;
    background: rgba(255,255,255,0.12);
    border-radius: 4px;
    overflow: hidden;
}

#pressure-bar-fill {
    height: 100%;
    width: 100%;
    background: var(--pressure-green);
    border-radius: 4px;
    transition: width 0.6s ease, background-color 0.6s ease;
}

/* 审讯开始时高亮提醒 */
#pressure-meter.highlight {
    animation: defenseHighlight 2s ease-out;
    border-color: var(--gold);
}
@keyframes defenseHighlight {
    0%   { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.6); transform: scale(1); }
    15%  { box-shadow: 0 0 16px 4px rgba(201, 168, 76, 0.5); transform: scale(1.08); }
    40%  { box-shadow: 0 0 8px 2px rgba(201, 168, 76, 0.3); transform: scale(1.04); }
    100% { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0); transform: scale(1); }
}

/* ===== 击穿演出 ===== */
#breakthrough-overlay {
    position: absolute;
    inset: 0;
    z-index: 25;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: breakthroughFlash 0.5s ease-out;
}

@keyframes breakthroughFlash {
    0% { background: rgba(201, 168, 76, 0.6); }
    100% { background: rgba(0, 0, 0, 0.9); }
}

#breakthrough-text {
    color: var(--gold);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 8px;
    text-align: center;
    animation: btTextReveal 0.8s ease-out 0.3s both;
}

@keyframes btTextReveal {
    from { transform: scale(1.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ===== 转场遮罩 ===== */
#transition-mask {
    position: absolute;
    inset: 0;
    z-index: 30;
    background: #000;
    transition: opacity 0.6s ease;
}

.mask-fade-in { opacity: 1 !important; }
.mask-fade-out { opacity: 0 !important; }

/* ===== 开始画面 ===== */
#title-screen {
    position: absolute;
    inset: 0;
    z-index: 50;
    background: url('../img/cover.webp') center center / cover no-repeat;
    background-color: #f4e8c1;
    overflow: hidden;
}

/* --- 案卷卷轴 --- */
#scroll-wrap {
    position: absolute;
    inset: 0;
    z-index: 52;
    pointer-events: none;
}

/* 案卷两页：都占满屏，撕缝互补（不规则）——开场看起来是一整张封着的纸 */
#scroll-left, #scroll-right {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, #e0d4b8, #f4e8c1 20%, #f4e8c1 80%, #e0d4b8);
    z-index: 52;
}

#scroll-left {
    clip-path: polygon(0% 0%, 50.3% 0%, 49.2% 5%, 50.7% 9%, 48.4% 16%, 48.9% 19%, 47.2% 27%, 51.9% 30%, 50.8% 38%, 47.6% 45%, 48.3% 50%, 51.2% 58%, 48.7% 66%, 50.3% 71%, 47.4% 80%, 49.2% 87%, 46.8% 94%, 48.8% 100%, 0% 100%);
    filter: drop-shadow(3px 0 8px rgba(60, 40, 20, 0.35));
    animation: scrollTearLeft 2.2s cubic-bezier(0.42, 0.02, 0.3, 1) 1.4s forwards;
}

#scroll-right {
    clip-path: polygon(50.3% 0%, 100% 0%, 100% 100%, 48.8% 100%, 46.8% 94%, 49.2% 87%, 47.4% 80%, 50.3% 71%, 48.7% 66%, 51.2% 58%, 48.3% 50%, 47.6% 45%, 50.8% 38%, 51.9% 30%, 47.2% 27%, 48.9% 19%, 48.4% 16%, 50.7% 9%, 49.2% 5%);
    filter: drop-shadow(-3px 0 8px rgba(60, 40, 20, 0.35));
    animation: scrollTearRight 2.2s cubic-bezier(0.42, 0.02, 0.3, 1) 1.4s forwards;
}

/* 卷轴纹理线 */
#scroll-left::before, #scroll-right::before {
    content: '';
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 40px,
        rgba(160, 130, 80, 0.08) 40px,
        rgba(160, 130, 80, 0.08) 41px
    );
}

/* 页面撕开：先绷住微动 → 撕一段卡一下 → 大幅撕开（带一点旋转，像手拉着两角） */
@keyframes scrollTearLeft {
    0%   { transform: translateX(0) rotate(0deg); }
    12%  { transform: translateX(-1.6%) rotate(-0.25deg); }
    20%  { transform: translateX(-1.2%) rotate(-0.2deg); }   /* 卡住 */
    46%  { transform: translateX(-24%) rotate(-0.9deg); }
    56%  { transform: translateX(-22.5%) rotate(-0.8deg); }  /* 再卡 */
    100% { transform: translateX(-110%) rotate(-1.6deg); }
}

@keyframes scrollTearRight {
    0%   { transform: translateX(0) rotate(0deg); }
    10%  { transform: translateX(1.4%) rotate(0.2deg); }
    18%  { transform: translateX(1.1%) rotate(0.18deg); }    /* 卡住 */
    50%  { transform: translateX(26%) rotate(0.9deg); }
    60%  { transform: translateX(24.5%) rotate(0.85deg); }   /* 再卡 */
    100% { transform: translateX(110%) rotate(1.5deg); }
}

/* --- 火漆封蜡 · 随纸同撕（蜡封在纸缝上，撕纸带撕蜡） --- */
/* 随纸层：满屏、与纸页跑同一套 scrollTear 关键帧（同时长/同缓动/同延时）→ 蜡半 1:1 粘在各自半页上 */
#seal-carry-left, #seal-carry-right {
    position: absolute;
    inset: 0;
    z-index: 53;
    pointer-events: none;
}
#seal-carry-left  { animation: scrollTearLeft  2.2s cubic-bezier(0.42, 0.02, 0.3, 1) 1.4s forwards; }
#seal-carry-right { animation: scrollTearRight 2.2s cubic-bezier(0.42, 0.02, 0.3, 1) 1.4s forwards; }

/* 蜡半：固定尺寸盒居中（margin 定心，keyframes 只管 scale/rotate），全画布烘焙图对位 */
#seal-left, #seal-right {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 172px;
    height: 153px;   /* 与 wax-seal.webp 500:444 同比 */
    margin: -76.5px 0 0 -86px;
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55));
    opacity: 0;
}

#seal-left {
    background-image: url('../img/wax-left.webp');
    transform-origin: 48% 100%;
    animation:
        sealAppear 0.5s cubic-bezier(0.25, 0.9, 0.35, 1.2) 0.1s forwards,  /* 砸下盖印（两半同参→看着是整枚） */
        sealStrain 0.35s ease-in-out 1.0s,                                  /* 撕前绷劲 */
        sealSnapLeft 0.3s cubic-bezier(0.5, 0, 0.4, 1) 1.55s forwards;      /* 纸一给劲，蜡"啪"崩一下 */
}

#seal-right {
    background-image: url('../img/wax-right.webp');
    transform-origin: 48% 100%;
    animation:
        sealAppear 0.5s cubic-bezier(0.25, 0.9, 0.35, 1.2) 0.1s forwards,
        sealStrain 0.35s ease-in-out 1.0s,
        sealSnapRight 0.3s cubic-bezier(0.5, 0, 0.4, 1) 1.58s forwards;     /* 右半晚 0.03s——脆断不齐 */
}

/* 砸下：大→小 + 末端一记回弹（像真盖上去） */
@keyframes sealAppear {
    0%   { opacity: 0; transform: scale(2.6) rotate(-6deg); }
    70%  { opacity: 1; transform: scale(1.42) rotate(1deg); }
    85%  { opacity: 1; transform: scale(1.56) rotate(0deg); }
    100% { opacity: 1; transform: scale(1.5); }
}

/* 撕前绷劲：被两只手拽住微微横向绷紧 */
@keyframes sealStrain {
    0%   { transform: scale(1.5); }
    50%  { transform: scale(1.56, 1.47); }
    100% { transform: scale(1.5); }
}

/* 崩断小动作：撕开瞬间蜡半相对纸面轻轻一崩（大位移全由随纸层承担） */
@keyframes sealSnapLeft {
    0%   { transform: scale(1.5) rotate(0deg); }
    55%  { transform: scale(1.5) rotate(-3.6deg) translate(-2px, 0); }
    100% { transform: scale(1.5) rotate(-3deg)   translate(-2px, 1px); }
}
@keyframes sealSnapRight {
    0%   { transform: scale(1.5) rotate(0deg); }
    55%  { transform: scale(1.5) rotate(4deg)   translate(2px, -1px); }
    100% { transform: scale(1.5) rotate(3.2deg) translate(2px, 1px); }
}

/* --- 标题文字（竖排 · 顶部留白区） --- */
#title-content {
    position: absolute;
    top: 14%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 51;
    text-align: center;
    opacity: 0;
    animation: titleContentReveal 1.2s ease-out 2.5s forwards;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 14px;
}

@keyframes titleContentReveal {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

#game-title {
    font-size: 54px;
    color: #1f1208;
    letter-spacing: 16px;
    text-shadow:
        0 0 10px rgba(244, 232, 193, 0.95),
        0 0 22px rgba(244, 232, 193, 0.75),
        0 1px 0 rgba(244, 232, 193, 0.9);
    writing-mode: vertical-rl;
    display: inline-block;
    margin-bottom: 0;
    font-weight: 600;
}

#title-divider {
    width: 2px;
    height: 0;
    background: linear-gradient(to bottom, transparent, #8a6d2b, transparent);
    margin: 0;
    align-self: stretch;
    animation: dividerGrow 0.8s ease-out 3.2s forwards;
}

@keyframes dividerGrow {
    to { height: 58px; }
}

#case-title {
    font-size: 15px;
    color: #4a3a28;
    letter-spacing: 5px;
    font-weight: 500;
    writing-mode: vertical-rl;
    display: inline-block;
    opacity: 0;
    text-shadow:
        0 0 6px rgba(244, 232, 193, 0.95),
        0 0 12px rgba(244, 232, 193, 0.7);
    animation: fadeIn 0.8s ease-out 3.6s forwards;
}

/* --- 底部按钮组：落在地面墨痕下方的干净区 --- */
#title-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(4.5% + env(safe-area-inset-bottom, 0px));
    z-index: 51;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    opacity: 0;
    background: none;
    animation: fadeIn 1s ease-out 3.8s forwards;
}

/* 极轻的底部渐隐——只给按钮留出一条干净的宣纸底，不遮挡门楼 */
#title-screen::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 16%;
    background: linear-gradient(
        to bottom,
        rgba(244, 232, 193, 0) 0%,
        rgba(244, 232, 193, 0.35) 45%,
        rgba(244, 232, 193, 0.75) 100%
    );
    z-index: 50;
    pointer-events: none;
}

/* 顶部轻柔留白加强——让标题更清晰地浮在宣纸上 */
#title-screen::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 32%;
    background: linear-gradient(
        to bottom,
        rgba(244, 232, 193, 0.55) 0%,
        rgba(244, 232, 193, 0.25) 55%,
        rgba(244, 232, 193, 0) 100%
    );
    z-index: 50;
    pointer-events: none;
}

#api-key-area {
    margin-bottom: 16px;
    width: 75%;
    max-width: 300px;
}

#api-key-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid #a08050;
    border-radius: 4px;
    padding: 10px 14px;
    color: #2a1a0a;
    font-family: var(--font-ui);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

#api-key-input:focus {
    border-color: #6a4a2a;
}

#api-key-input::placeholder {
    color: #8a7a66;
}

#api-status {
    margin-top: 6px;
    font-size: 12px;
    font-family: var(--font-ui);
    min-height: 18px;
    color: #5a4a36;
}

.api-ok { color: #4a8c5c; }
.api-err { color: var(--accent-red-bright); }

#continue-btn {
    background: rgba(248, 238, 208, 0.95);
    border: 1px solid #6a4a2a;
    border-radius: 2px;
    padding: 13px 44px;
    color: #2a1a0a;
    font-family: var(--font-main);
    font-size: 17px;
    letter-spacing: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
    backdrop-filter: blur(3px);
    box-shadow:
        0 3px 12px rgba(42, 26, 10, 0.2),
        inset 0 0 0 1px rgba(244, 232, 193, 0.6);
}
#continue-btn:hover {
    background: rgba(250, 240, 212, 0.99);
    box-shadow:
        0 4px 16px rgba(42, 26, 10, 0.28),
        inset 0 0 0 1px rgba(244, 232, 193, 0.8);
}

#start-btn {
    background: rgba(248, 238, 208, 0.95);
    border: 1px solid #6a4a2a;
    border-radius: 2px;
    padding: 13px 44px;
    color: #2a1a0a;
    font-family: var(--font-main);
    font-size: 17px;
    letter-spacing: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(3px);
    box-shadow:
        0 3px 12px rgba(42, 26, 10, 0.2),
        inset 0 0 0 1px rgba(244, 232, 193, 0.6);
}

#start-btn:hover {
    background: rgba(250, 240, 212, 0.99);
    box-shadow:
        0 4px 16px rgba(42, 26, 10, 0.28),
        inset 0 0 0 1px rgba(244, 232, 193, 0.8);
}

#subtitle {
    margin-top: 10px;
    color: #6a5a46;
    font-size: 11px;
    letter-spacing: 3px;
    font-family: var(--font-ui);
    opacity: 0.85;
    text-shadow: 0 0 6px rgba(244, 232, 193, 0.85);
}

/* ===== 结局尾按钮组（重新开始 + 返回主菜单）===== */
#endgame-btns {
    position: absolute;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 80%;
    max-width: 360px;
    opacity: 0;
}
#endgame-btns.show {
    animation: fadeIn 0.8s ease-out 1s forwards;
}
.endgame-btn {
    display: block;
    width: 100%;
    border-radius: 6px;
    padding: 13px 24px;
    font-family: var(--font-main);
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.endgame-btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
    border: none;
    color: var(--dark-bg);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 5px;
    box-shadow: 0 0 20px rgba(201, 168, 76, 0.3);
}
.endgame-btn-primary:hover {
    box-shadow: 0 0 30px rgba(201, 168, 76, 0.5);
    transform: scale(1.03);
}
.endgame-btn-primary:active { transform: scale(0.97); }
.endgame-btn-secondary {
    background: rgba(15, 10, 5, 0.55);
    border: 1px solid rgba(201, 168, 76, 0.45);
    color: var(--gold);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 4px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.endgame-btn-secondary:hover {
    background: rgba(201, 168, 76, 0.16);
    border-color: var(--gold);
    transform: scale(1.03);
}
.endgame-btn-secondary:active { transform: scale(0.97); }

/* ===== 指认凶手面板 ===== */
#guess-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);   /* 屏幕完全居中 */
    width: 92%;
    max-width: 520px;
    z-index: 15;
    background: var(--dialog-bg);
    border: 1px solid var(--gold-dim);
    border-radius: 4px;
    padding: 20px 18px;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.4s ease-out;
}

#guess-prompt {
    font-size: 15px;
    color: var(--gold);
    letter-spacing: 2px;
    margin-bottom: 14px;
    text-align: center;
}

#guess-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#guess-input {
    width: 100%;
    background: rgba(244, 232, 193, 0.08);
    border: 1px solid var(--gold-dim);
    border-radius: 4px;
    padding: 10px 14px;
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

#guess-input:focus {
    border-color: var(--gold);
}

#guess-input::placeholder {
    color: var(--text-dim);
}

#guess-button-row {
    display: flex;
    gap: 10px;
    justify-content: center;
}

#guess-submit {
    flex: 1;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
    border: none;
    border-radius: 4px;
    padding: 11px 20px;
    color: var(--dark-bg);
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 3px;
    transition: transform 0.1s, opacity 0.2s;
}

#guess-submit:hover { opacity: 0.9; }
#guess-submit:active { transform: scale(0.97); }

/* 升堂结案 / 二级按钮——红木金字，与"确认之人"金底分庭抗礼 */
#guess-secondary-btn {
    flex: 1;
    background: linear-gradient(135deg, #6b2e2e 0%, #4a1f1f 100%);
    border: 1px solid #8a4a3a;
    border-radius: 4px;
    padding: 11px 20px;
    color: #f0d8a8;
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 3px;
    transition: transform 0.1s, opacity 0.2s;
}

#guess-secondary-btn:hover { opacity: 0.9; background: linear-gradient(135deg, #7a3838 0%, #582525 100%); }
#guess-secondary-btn:active { transform: scale(0.97); }

/* ===== 罪状书面板 ===== */
#indictment-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(88%, 380px);
    background: rgba(15, 10, 5, 0.96);
    border: 1px solid var(--gold-dim);
    border-radius: 8px;
    padding: 24px 20px;
    z-index: 45;
    display: flex;
    flex-direction: column;
    gap: 14px;
    opacity: 0;
    transition: opacity 0.35s ease-out;
}
#indictment-panel.visible { opacity: 1; }

#indictment-prompt {
    font-size: 15px;
    color: var(--gold);
    letter-spacing: 2px;
    text-align: center;
}


#indictment-textarea {
    width: 100%;
    min-height: 120px;
    max-height: 200px;
    background: rgba(244, 232, 193, 0.12);
    border: 1px solid var(--gold-dim);
    color: var(--text-color);
    border-radius: 4px;
    padding: 12px;
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 14px;
    line-height: 1.8;
    resize: vertical;
    box-sizing: border-box;
}
#indictment-textarea:focus { border-color: var(--gold); outline: none; }
#indictment-textarea::placeholder { color: var(--text-dim); }

#indictment-btn-row {
    display: flex;
    gap: 10px;
    justify-content: center;
}

#indictment-submit {
    flex: 1;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
    border: none;
    border-radius: 4px;
    padding: 11px 20px;
    color: var(--dark-bg);
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 3px;
    transition: transform 0.1s, opacity 0.2s;
}
#indictment-submit:hover { opacity: 0.9; }
#indictment-submit:active { transform: scale(0.97); }
#indictment-submit:disabled { opacity: 0.5; cursor: wait; }

#indictment-skip {
    flex: 1;
    background: linear-gradient(135deg, #6b2e2e 0%, #4a1f1f 100%);
    border: 1px solid #8a4a3a;
    border-radius: 4px;
    padding: 11px 20px;
    color: #f0d8a8;
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 3px;
    transition: transform 0.1s, opacity 0.2s;
}
#indictment-skip:hover { opacity: 0.9; }
#indictment-skip:active { transform: scale(0.97); }

/* ===== 定场诗 ===== */
#poem-screen {
    position: absolute;
    inset: 0;
    z-index: 55;
    background: linear-gradient(
        to bottom,
        #050302 0%,
        #1a1410 20%,
        #1a1410 80%,
        #050302 100%
    );
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    cursor: pointer;
}

#poem-allusion {
    text-align: center;
    opacity: 0;
    animation: poemFadeIn 1.5s ease-out 0.5s forwards;
}

#allusion-source {
    font-size: 13px;
    color: var(--text-dim);
    letter-spacing: 3px;
    margin-bottom: 12px;
}

#allusion-text {
    font-size: 14px;
    color: var(--gold-dim);
    letter-spacing: 2px;
    line-height: 2;
    max-width: 80%;
    margin: 0 auto;
    font-style: italic;
}

#poem-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 0;
}

.poem-line {
    font-size: 20px;
    color: var(--gold);
    letter-spacing: 4px;
    line-height: 2;
    opacity: 0;
    transform: translateY(12px);
    text-shadow: 0 1px 10px rgba(201, 168, 76, 0.2);
}

.poem-line:nth-child(2n+3) {
    margin-top: 16px;
}

.poem-line.poem-line-show {
    animation: poemLineReveal 0.8s ease-out forwards;
}

@keyframes poemLineReveal {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes poemFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#poem-skip {
    position: absolute;
    bottom: 40px;
    color: var(--text-dim);
    font-size: 13px;
    letter-spacing: 4px;
    font-family: var(--font-ui);
    opacity: 0;
    animation: poemFadeIn 1s ease-out 8s forwards;
}

/* ===== 屏幕震动 ===== */
.screen-shake {
    animation: screenShake 0.5s ease-in-out;
}

@keyframes screenShake {
    0%, 100% { transform: translate(0); }
    10% { transform: translate(-6px, 3px); }
    20% { transform: translate(6px, -3px); }
    30% { transform: translate(-4px, 2px); }
    40% { transform: translate(4px, -2px); }
    50% { transform: translate(-2px, 1px); }
}

/* ===== 通用 ===== */
.hidden { display: none !important; }

.fade-in { animation: fadeIn 0.4s ease-out; }
.fade-out { animation: fadeOut 0.4s ease-out forwards; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ===== 对话框内审讯模式下的狄仁杰发言 ===== */
.di-line {
    color: var(--gold);
    font-weight: 700;
}

/* ===== 加载指示器 ===== */
.typing-indicator {
    display: inline-block;
}

.typing-indicator span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--text-dim);
    border-radius: 50%;
    margin: 0 2px;
    animation: typingDot 1s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-4px); }
}

/* ===== 新线索获得提示 ===== */
#new-evidence-toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 22;
    background: rgba(10, 6, 3, 0.95);
    border: 2px solid var(--gold);
    border-radius: 6px;
    padding: 20px 30px;
    text-align: center;
    animation: toastIn 0.5s ease-out;
    box-shadow: 0 0 30px rgba(201, 168, 76, 0.3);
}

#new-evidence-toast .toast-title {
    color: var(--gold);
    font-size: 14px;
    letter-spacing: 4px;
    margin-bottom: 10px;
}

#new-evidence-toast .toast-content {
    color: var(--text-color);
    font-size: 16px;
    letter-spacing: 2px;
}

@keyframes toastIn {
    from { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* 陆家罪状专用 toast——血色边、暗调，区别于普通线索 */
#new-evidence-toast.toast-lu-charge {
    border-color: #8a3a3a;
    box-shadow: 0 0 30px rgba(138, 58, 58, 0.45);
    background: rgba(18, 6, 6, 0.96);
}
#new-evidence-toast.toast-lu-charge .toast-title {
    color: #c8746b;
    letter-spacing: 5px;
}
#new-evidence-toast.toast-lu-charge .toast-content {
    color: #d6c0b0;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--gold-dim);
    border-radius: 2px;
}

/* ===== 深查面板 ===== */
#investigate-panel {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
}

#investigate-panel-inner {
    width: 88%;
    max-height: 75vh;
    background: var(--dialog-bg);
    border: 1px solid var(--gold-dim);
    border-radius: 6px;
    padding: 24px 18px;
    overflow-y: auto;
}

#investigate-panel-inner h3 {
    color: var(--gold);
    font-size: 18px;
    letter-spacing: 4px;
    text-align: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gold-dim);
}

#investigate-hint {
    color: #c9a84c;
    font-size: 13px;
    text-align: center;
    padding: 8px 12px;
    margin-bottom: 12px;
    background: rgba(201, 168, 76, 0.08);
    border-radius: 4px;
    border: 1px dashed rgba(201, 168, 76, 0.3);
}

.contradiction-item {
    background: rgba(244, 232, 193, 0.05);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 4px;
    padding: 12px 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.contradiction-item:hover {
    background: rgba(201, 168, 76, 0.1);
    border-color: var(--gold-dim);
}

.contradiction-item.investigated {
    opacity: 0.6;
    cursor: default;
}

.contradiction-item.investigated:hover {
    background: rgba(244, 232, 193, 0.05);
    border-color: rgba(201, 168, 76, 0.2);
}

.contradiction-title {
    color: var(--gold);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.contradiction-summary {
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.4;
}

.contradiction-status {
    color: var(--text-dim);
    font-size: 11px;
    margin-top: 6px;
    text-align: right;
}

.contradiction-status.clickable {
    color: var(--gold);
    cursor: pointer;
}

/* ===== 防线进度条状态 ===== */
.defense-stalled {
    animation: defenseBlink 1.2s ease-in-out infinite;
}

@keyframes defenseBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.defense-truth {
    box-shadow: 0 0 8px rgba(139, 32, 32, 0.6), 0 0 16px rgba(139, 32, 32, 0.3);
    animation: defenseGlow 2s ease-in-out infinite;
}

@keyframes defenseGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(139, 32, 32, 0.6); }
    50% { box-shadow: 0 0 16px rgba(201, 64, 64, 0.8), 0 0 24px rgba(201, 64, 64, 0.4); }
}

/* ===== 返回上一节点按钮 ===== */
/* ===== 静音按钮 ===== */
#mute-btn {
    position: absolute;
    top: calc(44px + env(safe-area-inset-top, 0px));
    left: calc(8px + env(safe-area-inset-left, 0px));
    z-index: 50;
    background: rgba(15, 10, 5, 0.5);
    border: 1px solid rgba(201, 168, 76, 0.25);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 16px;
    line-height: 36px;
    text-align: center;
    padding: 0;
    cursor: pointer;
    color: var(--text-dim);
    transition: all 0.2s;
}
#mute-btn:hover {
    background: rgba(15, 10, 5, 0.8);
    border-color: var(--gold);
}

#btn-back {
    position: absolute;
    top: calc(8px + env(safe-area-inset-top, 0px));
    left: calc(8px + env(safe-area-inset-left, 0px));
    z-index: 15;
    background: rgba(15, 10, 5, 0.6);
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 4px;
    padding: 6px 12px;
    color: var(--text-dim);
    font-size: 12px;
    font-family: var(--font-ui);
    cursor: pointer;
    transition: all 0.2s;
}
#btn-back:hover {
    color: var(--gold);
    border-color: var(--gold);
    background: rgba(15, 10, 5, 0.8);
}

/* ===================================
 * 辩护场景 · 县衙临堂 (Defense Court)
 * =================================== */
#defense-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 14;
    padding: 14px 4% 0;
    box-sizing: border-box;
}

/* 顶部一排铜铃，4 或 5 盏 */
#defense-bells {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
    pointer-events: none;
}

.defense-bell {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--gold-dim);
    background: radial-gradient(circle at 30% 30%, rgba(244, 200, 100, 0.35), rgba(122, 80, 30, 0.5));
    box-shadow: 0 0 12px rgba(201, 168, 76, 0.25), inset 0 -3px 6px rgba(0,0,0,0.4);
    position: relative;
    transition: all 0.4s ease;
}

.defense-bell::after {
    content: attr(data-num);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(50, 30, 10, 0.7);
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-main);
}

.defense-bell.active {
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(255, 215, 96, 0.7), inset 0 -3px 6px rgba(0,0,0,0.4);
    animation: bellPulse 1.6s ease-in-out infinite;
    transform: scale(1.08);
}

.defense-bell.cleared {
    border-color: #4a8c4a;
    background: radial-gradient(circle at 30% 30%, rgba(120, 200, 120, 0.45), rgba(40, 80, 40, 0.6));
    box-shadow: 0 0 14px rgba(80, 200, 100, 0.5), inset 0 -3px 6px rgba(0,0,0,0.3);
    transform: scale(0.95);
}

.defense-bell.cleared::after {
    content: '✓';
    color: #d8f0d0;
    font-size: 22px;
}

@keyframes bellPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 96, 0.7), inset 0 -3px 6px rgba(0,0,0,0.4); }
    50% { box-shadow: 0 0 32px rgba(255, 230, 130, 1.0), inset 0 -3px 6px rgba(0,0,0,0.4); }
}

/* 当前指控陈述卡片 */
#defense-charge {
    background: linear-gradient(180deg, rgba(80, 24, 24, 0.92), rgba(45, 12, 12, 0.95));
    border: 2px solid #8a4a3a;
    border-radius: 6px;
    padding: 14px 20px;
    pointer-events: auto;
    box-shadow: 0 4px 18px rgba(0,0,0,0.55);
    backdrop-filter: blur(2px);
}

#defense-charge-label {
    color: #c8746b;
    font-size: 12px;
    letter-spacing: 6px;
    margin-bottom: 8px;
    text-align: center;
    text-transform: none;
}

#defense-charge-text {
    color: #f0d8a8;
    font-size: 16px;
    line-height: 1.55;
    letter-spacing: 1px;
    font-family: var(--font-main);
    text-align: center;
}

/* 元芳推断式提示 */
#defense-yuanfang-hint {
    margin-top: 10px;
    background: linear-gradient(180deg, rgba(20, 30, 50, 0.92), rgba(10, 18, 32, 0.95));
    border: 1px solid var(--gold-dim);
    border-radius: 6px;
    padding: 10px 16px;
    pointer-events: auto;
    box-shadow: 0 4px 14px rgba(0,0,0,0.5);
    animation: hintFadeIn 0.4s ease-out;
}

.dyf-label {
    color: var(--gold);
    font-size: 12px;
    letter-spacing: 4px;
    margin-right: 10px;
    display: inline-block;
    vertical-align: top;
}

#defense-yuanfang-text {
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: 1px;
    font-family: var(--font-main);
    display: inline-block;
    max-width: calc(100% - 70px);
}

@keyframes hintFadeIn {
    from { transform: translateY(-6px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 反驳成功 toast */
#defense-toast {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    background: rgba(40, 80, 40, 0.92);
    border: 2px solid #80c080;
    border-radius: 6px;
    padding: 16px 32px;
    color: #f4ffe8;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 6px;
    box-shadow: 0 0 30px rgba(120, 200, 120, 0.6);
    animation: toastPop 1.4s ease-out forwards;
    pointer-events: none;
}

@keyframes toastPop {
    0% { transform: translateX(-50%) scale(0.5); opacity: 0; }
    20% { transform: translateX(-50%) scale(1.08); opacity: 1; }
    35% { transform: translateX(-50%) scale(1); opacity: 1; }
    80% { transform: translateX(-50%) scale(1); opacity: 1; }
    100% { transform: translateX(-50%) scale(0.95); opacity: 0; }
}

/* ============= 时辰对照（古今时辰科普）============= */
#hour-btn {
    position: absolute;     /* 相对 #game-container（max-width:500px 居中），不再 fixed 跑到黑边里 */
    right: 5%;
    bottom: 9%;             /* 不贴底 — 与 dialog box (bottom 18%) 之间留缓冲 */
    min-width: 50px;
    height: 32px;
    padding: 0 12px;
    border-radius: 4px;
    border: 1px solid #c9b886;
    background: rgba(20, 14, 8, 0.85);
    color: #e8d49c;
    font-family: var(--font-main);
    font-size: 13px;
    letter-spacing: 2px;
    cursor: pointer;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s, background 0.25s, box-shadow 0.25s;
    line-height: 1;
}
#hour-btn:hover {
    background: rgba(40, 30, 20, 0.95);
    transform: scale(1.08);
    box-shadow: 0 0 12px rgba(212, 192, 138, 0.45);
}
#hour-btn.pulse {
    animation: hourPulse 1.4s ease-in-out 4;
}
@keyframes hourPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(232, 212, 156, 0.7); transform: scale(1); }
    50%      { box-shadow: 0 0 0 12px rgba(232, 212, 156, 0); transform: scale(1.18); }
}

#hour-panel {
    position: absolute;     /* 同上 */
    right: 5%;
    bottom: calc(9% + 42px);   /* 在按钮上方弹出 */
    width: 280px;
    max-width: 80vw;
    max-height: 75vh;
    background: rgba(20, 14, 8, 0.96);
    border: 1.5px solid #c9b886;
    border-radius: 8px;
    z-index: 60;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
    animation: hourPanelIn 0.25s ease-out;
}
@keyframes hourPanelIn {
    0%   { opacity: 0; transform: translateY(8px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
#hour-panel-inner {
    padding: 14px 14px 12px;
    max-height: 75vh;
    overflow-y: auto;
    position: relative;
}
#hour-panel h3 {
    color: #e8d49c;
    font-size: 15px;
    margin: 0 0 10px 0;
    text-align: center;
    border-bottom: 1px solid rgba(201, 184, 134, 0.45);
    padding-bottom: 8px;
    font-weight: 500;
    letter-spacing: 2px;
}
#close-hour {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: 1px solid #c9b886;
    color: #c9b886;
    padding: 1px 8px;
    font-size: 11px;
    border-radius: 3px;
    cursor: pointer;
}
#close-hour:hover { background: rgba(201, 184, 134, 0.15); }

.hour-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
}
.hour-row {
    display: grid;
    grid-template-columns: 36px 96px 1fr;
    align-items: center;
    padding: 4px 6px;
    color: #9c8a64;
    font-size: 12.5px;
    border-radius: 3px;
    line-height: 1.4;
}
.hour-row.hour-key {
    color: #f0d878;
    background: rgba(160, 110, 50, 0.22);
    font-weight: 600;
}
.hour-name {
    font-weight: bold;
    letter-spacing: 1px;
}
.hour-time {
    font-family: 'Courier New', monospace;
    font-size: 11.5px;
}
.hour-note {
    font-size: 11.5px;
    color: inherit;
    opacity: 0.92;
}
.hour-tip {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed rgba(201, 184, 134, 0.3);
    color: #8c7c58;
    font-size: 11px;
    text-align: center;
    letter-spacing: 1px;
}

/* —— 时辰对照·移动端适配 —— */
@media (max-width: 480px) {
    #hour-btn {
        min-width: 46px;
        height: 28px;
        padding: 0 10px;
        font-size: 12px;
        letter-spacing: 1.5px;
        right: 5%;
        bottom: 9%;
    }
    #hour-panel {
        width: 88vw;
        right: 6vw;
        bottom: calc(9% + 38px);
        max-height: 70vh;
    }
    #hour-panel-inner { padding: 12px 12px 10px; max-height: 70vh; }
    #hour-panel h3 { font-size: 14px; letter-spacing: 1px; }
    .hour-row {
        grid-template-columns: 32px 80px 1fr;
        font-size: 11.5px;
        padding: 3px 4px;
        gap: 4px;
    }
    .hour-time { font-size: 10.5px; }
    .hour-note { font-size: 11px; }
    .hour-tip { font-size: 10px; }
}
@media (max-width: 360px) {
    #hour-panel { width: 92vw; right: 4vw; }
    .hour-row {
        grid-template-columns: 28px 72px 1fr;
        font-size: 10.5px;
    }
    .hour-time { font-size: 10px; }
}

/* ===== 一级菜单（汇总返回主菜单 / 返回本节 / 静音）===== */
/* 旧按钮全部隐藏，由 #menu-panel 接管 UI（保留 DOM 供 JS 引用）*/
#mute-btn,
#back-launcher,
#btn-back { display: none !important; }

#menu-btn {
    position: absolute;
    /* 避开 TapTap 小程序顶栏胶囊（实测 ~100px，含 safe-area）+ iOS Safari 灵动岛/刘海 */
    top: calc(env(safe-area-inset-top, 0px) + 100px);
    right: 12px;
    z-index: 60;
    height: 36px;
    padding: 0 16px;
    border-radius: 18px;
    border: 1px solid rgba(201, 168, 76, 0.45);
    background: rgba(15, 10, 5, 0.7);
    color: #c9a84c;
    font-family: var(--font-main);
    font-size: 14px;
    line-height: 1;
    letter-spacing: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
#menu-btn:hover {
    background: rgba(40, 30, 20, 0.85);
    border-color: var(--gold);
    transform: scale(1.04);
}
#menu-btn:active { transform: scale(0.96); }

#menu-panel {
    position: absolute;
    /* 按钮下方留间隙（按钮 top + 36 高 + 8 间距）*/
    top: calc(env(safe-area-inset-top, 0px) + 100px);
    right: 12px;
    z-index: 60;
    background: rgba(15, 10, 5, 0.95);
    border: 1px solid rgba(201, 168, 76, 0.45);
    border-radius: 8px;
    padding: 6px;
    min-width: 168px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
    animation: menuFadeIn 0.18s ease-out;
}
#menu-panel.hidden { display: none !important; }
@keyframes menuFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.menu-item {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: none;
    color: #d8c08c;
    font-family: var(--font-main);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    letter-spacing: 1.5px;
    transition: background 0.15s ease, color 0.15s ease;
}
.menu-item:hover {
    background: rgba(201, 168, 76, 0.16);
    color: var(--gold);
}
.menu-item.hidden { display: none !important; }
.menu-item + .menu-item { margin-top: 2px; }

/* ===== 章节选择（通关后解锁）===== */
#chapter-btn {
    background: rgba(244, 232, 193, 0.55);
    border: 1px solid #6a4a2a;
    border-radius: 4px;
    padding: 10px 36px;
    color: #2a1a0a;
    font-family: var(--font-main);
    font-size: 14px;
    letter-spacing: 6px;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
    transition: all 0.3s ease;
}
#chapter-btn:hover {
    background: rgba(244, 232, 193, 0.85);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
#chapter-btn.chapter-btn-locked {
    opacity: 0.72;
    color: rgba(42, 26, 10, 0.6);
    border-color: rgba(106, 74, 42, 0.55);
    cursor: not-allowed;
    box-shadow: none;
}
#chapter-btn.chapter-btn-locked:hover {
    background: rgba(244, 232, 193, 0.55);
    box-shadow: none;
}
#chapter-panel {
    position: absolute;
    inset: 0;
    background: rgba(20, 15, 10, 0.96);
    z-index: 60;
    padding: 50px 18px 30px 18px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.chapter-panel-title {
    color: var(--gold);
    text-align: center;
    font-size: 18px;
    letter-spacing: 8px;
    margin-bottom: 20px;
    font-family: var(--font-main);
}
#chapter-list {
    width: 100%;
    max-width: 320px;
    flex: 1;
    overflow-y: auto;
}
.chapter-item {
    padding: 12px 18px;
    margin: 8px auto;
    border: 1px solid var(--gold-dim);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-main);
    font-size: 14px;
    letter-spacing: 2px;
    border-radius: 2px;
}
.chapter-item.unlocked {
    color: var(--gold);
    background: rgba(60, 40, 20, 0.5);
}
.chapter-item.unlocked:hover {
    background: rgba(120, 80, 40, 0.6);
    border-color: var(--gold);
    transform: translateY(-1px);
}
.chapter-item.locked {
    color: #5a4a38;
    background: transparent;
    cursor: not-allowed;
    border-color: rgba(138, 109, 43, 0.3);
}
#chapter-close {
    display: block;
    margin: 18px auto 0 auto;
    padding: 8px 24px;
    background: transparent;
    border: 1px solid var(--gold-dim);
    color: var(--text-dim);
    font-family: var(--font-main);
    font-size: 12px;
    letter-spacing: 4px;
    cursor: pointer;
    border-radius: 2px;
}
#chapter-close:hover {
    color: var(--gold);
    border-color: var(--gold);
}


/* ============================================================
   第三案 · 悬壶双鸩 — 三件套 UI（钱袋 / 行囊 / 线索）
   纯 CSS 古风皮肤；美术素材到位后替换各 background-image 即可。
   ============================================================ */
:root{
  --c3-ink:#2e2317; --c3-gold:#c9a55a; --c3-gold-bright:#f0cd72;
  --c3-paper-1:#efe6cf; --c3-paper-2:#e2d3ad; --c3-paper-edge:#cdb988;
  --c3-lacquer-1:#36281a; --c3-lacquer-2:#241a10; --c3-cinnabar:#9e3b2e;
}

/* —— 顶部 HUD：三枚漆木牌 —— */
#c3-hud{
  position:absolute; top:calc(12px + env(safe-area-inset-top, 0px)); left:calc(12px + env(safe-area-inset-left, 0px));
  display:flex; gap:5px; align-items:stretch;
  flex-wrap:wrap; max-width:calc(100% - 24px);   /* 图标放大后四枚牌接近满行，小屏允许折行别溢出 */
  z-index:60; font-family:"KaiTi","STKaiti",serif;
}
#c3-hud.hidden{display:none;}
/* ★8/9 作者：漆木牌框子全撤——图标裸放，靠投影在深浅背景上都立得住 */
#c3-purse,#c3-bag-btn,#c3-clue-btn,#c3-note-btn{
  display:flex; align-items:center; gap:2px;
  background:none; border:none; box-shadow:none; border-radius:0;
  color:#e6d6a6; padding:0 2px; font-size:13px; letter-spacing:.5px; white-space:nowrap;
  text-shadow:0 1px 3px rgba(0,0,0,.9), 0 0 7px rgba(0,0,0,.65);
}
#c3-purse{cursor:default;}
/* ★图为主字为辅（作者8/9）：图标去底放大到 30px 一眼看懂，文字退成小注 */
#c3-hud .c3-uiico{ height:30px; width:auto; vertical-align:middle;
  filter:drop-shadow(0 1px 2px rgba(0,0,0,.75)) drop-shadow(0 0 5px rgba(0,0,0,.5)); }
#c3-purse b,#c3-bag-btn b,#c3-clue-btn b,#c3-note-btn b{
  color:var(--c3-gold-bright); font-size:18px; font-weight:bold; line-height:1; margin:0 1px; }
#c3-purse small,#c3-bag-btn small,#c3-clue-btn small,#c3-note-btn small{
  color:#c3b085; font-size:11px; letter-spacing:0; line-height:1; }
#c3-bag-btn,#c3-clue-btn,#c3-note-btn{cursor:pointer; transition:filter .15s, transform .1s;}
#c3-bag-btn:hover,#c3-clue-btn:hover,#c3-note-btn:hover{filter:brightness(1.28); color:var(--c3-gold-bright);}
#c3-bag-btn:active,#c3-clue-btn:active,#c3-note-btn:active{transform:translateY(1px);}

/* —— 行囊 / 线索：卷宗册页 —— */
#c3-panel{position:absolute; inset:0; background:rgba(8,5,2,.66); z-index:200;
  display:flex; align-items:center; justify-content:center;}
#c3-panel.hidden{display:none;}
#c3-panel-inner{
  position:relative; width:84%; max-width:380px; max-height:74%;
  background:linear-gradient(180deg,var(--c3-paper-1),var(--c3-paper-2));
  border:1px solid var(--c3-paper-edge);
  box-shadow:0 0 0 6px rgba(54,40,26,.92), 0 12px 48px rgba(0,0,0,.6);
  border-radius:3px; display:flex; flex-direction:column;
  padding:20px 20px 16px; color:var(--c3-ink);
  font-family:"KaiTi","STKaiti",serif;
}
#c3-panel-inner::before,#c3-panel-inner::after{
  content:""; position:absolute; width:17px; height:17px; pointer-events:none;
  border-color:var(--c3-gold); border-style:solid;
}
#c3-panel-inner::before{top:6px; left:6px; border-width:2px 0 0 2px;}
#c3-panel-inner::after{bottom:6px; right:6px; border-width:0 2px 2px 0;}
#c3-panel-title{
  font-size:20px; text-align:center; letter-spacing:5px; color:#3a2c18;
  padding-bottom:9px; margin-bottom:10px; border-bottom:2px solid var(--c3-cinnabar);
}
#c3-panel-list{overflow-y:auto; flex:1; padding-right:4px;}
.c3-entry{padding:9px 2px; border-bottom:1px dashed rgba(120,90,40,.45);}
.c3-entry:last-child{border-bottom:none;}
.c3-entry-name{color:#5a3a22; font-size:15.5px; margin-bottom:4px; font-weight:600;}
.c3-entry-name::before{content:"◈ "; color:var(--c3-cinnabar);}
.c3-entry-desc{color:#4a3c2a; font-size:13px; line-height:1.62;}
.c3-empty{color:#8a7550; text-align:center; padding:30px 0; font-size:14.5px;}

/* ── 随身札记 · 自己写的那几页（作者 8/9：札记应该是能点开自己打字的东西）── */
#c3-pad-wrap{margin-bottom:6px;}
.c3-pad-head{
  color:#5a3a22; font-size:14.5px; letter-spacing:3px; font-weight:600;
  display:flex; align-items:baseline; justify-content:space-between; margin-bottom:6px;
}
.c3-pad-head::before{content:"✎ "; color:var(--c3-cinnabar);}
#c3-pad-state{font-size:11.5px; letter-spacing:1px; color:#9a8560; font-weight:400;}
#c3-pad{
  width:100%; box-sizing:border-box; resize:vertical; min-height:110px;
  /* 竖格稿纸：一条条横线，像真在纸上写 */
  background:
    repeating-linear-gradient(180deg, transparent 0 25px, rgba(120,90,40,.22) 25px 26px),
    rgba(255,250,236,.55);
  border:1px solid rgba(120,90,40,.5); border-radius:3px;
  padding:4px 9px; line-height:26px;
  color:#3a2c18; font-family:inherit; font-size:14px;
  outline:none; -webkit-appearance:none;
}
#c3-pad:focus{border-color:var(--c3-cinnabar); background-color:rgba(255,252,242,.75);}
#c3-pad::placeholder{color:#a28f6a; line-height:26px;}
.c3-pad-sep{
  margin:14px 0 4px; padding-top:9px; border-top:1px solid rgba(120,90,40,.35);
  color:#5a3a22; font-size:14px; letter-spacing:3px; font-weight:600;
}
.c3-pad-sep::before{content:"◈ "; color:var(--c3-cinnabar);}
#c3-panel-close{
  margin-top:12px; align-self:center;
  background:linear-gradient(160deg,#a8412f,#86301f); color:#f3e0c0;
  border:1px solid #d8a060; border-radius:4px;
  padding:6px 26px; cursor:pointer; font-family:inherit; font-size:14.5px; letter-spacing:3px;
  box-shadow:0 2px 6px rgba(0,0,0,.3);
}
#c3-panel-close:hover{filter:brightness(1.12);}

/* ═══════ 行囊皮肤（作者8/12：打开的 UI 做成行囊的样子）═══════
   摊开的粗布包袱皮：染布底+斜纹布纹+缝线+翻出的布角，顶上压着那只打结的行囊（ui-bag 图标）；
   东西是摆在布上的一张张纸签。只挂在 .c3-bag（行囊模式），札记不受影响 */
#c3-panel-knot{display:none;}
.c3-bag #c3-panel-knot{
  display:block; position:absolute; top:-36px; left:50%; transform:translateX(-50%);
  height:68px; width:auto; z-index:2;
  filter:drop-shadow(0 5px 9px rgba(0,0,0,.55));
}
.c3-bag #c3-panel-inner{
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,240,210,.10), transparent 55%),
    repeating-linear-gradient(45deg,  rgba(58,41,24,.15) 0 2px, transparent 2px 6px),
    repeating-linear-gradient(-45deg, rgba(58,41,24,.12) 0 2px, transparent 2px 6px),
    linear-gradient(165deg, #8a6a44, #6f5233 58%, #5d4329);
  border:none; border-radius:16px;
  box-shadow:
    inset 0 0 0 7px rgba(43,30,17,.38),
    inset 0 0 46px rgba(30,20,10,.42),
    0 14px 48px rgba(0,0,0,.65);
  padding:34px 18px 16px;
  overflow:visible;   /* 结扣要探出布面 */
}
/* 缝线一圈（盖掉原卷宗金角样式） */
.c3-bag #c3-panel-inner::before{
  content:""; position:absolute; inset:10px; width:auto; height:auto;
  border:2px dashed rgba(240,220,180,.36); border-radius:10px; pointer-events:none;
}
/* 右下翻出一只布角 */
.c3-bag #c3-panel-inner::after{
  content:""; position:absolute; top:auto; left:auto; right:-1px; bottom:-1px;
  width:58px; height:58px; pointer-events:none;
  border:none; border-radius:0 0 16px 0;
  background:linear-gradient(315deg, #4a341d 46%, #7a5c39 47%, #8a6a44 55%, transparent 56%);
  filter:drop-shadow(-3px -3px 5px rgba(0,0,0,.28));
}
.c3-bag #c3-panel-title{
  color:#f6ead0; border-bottom:1px dashed rgba(240,220,180,.4);
  text-shadow:0 1px 3px rgba(0,0,0,.55);
}
/* 布上的纸签卡片 */
.c3-bag .c3-item{
  background:linear-gradient(180deg,#f4ecd6,#e8dcbc);
  border:1px solid #a8895c; border-radius:9px;
  box-shadow:0 3px 9px rgba(0,0,0,.35);
}
.c3-bag .c3-item:active{background:#efe2c2; border-color:var(--c3-cinnabar);}
.c3-bag .c3-empty{color:#ead9b4; text-shadow:0 1px 2px rgba(0,0,0,.4);}
/* 详情页同底：纸签放大铺在布上 */
.c3-bag .c3-detail{
  background:linear-gradient(180deg,#f4ecd6,#e8dcbc);
  border:1px solid #a8895c; border-radius:10px;
  box-shadow:0 4px 12px rgba(0,0,0,.35);
  padding:12px;
}

/* ═══════ 札记皮肤＝线装纸册（作者8/12：做得像纸）═══════
   毛边宣纸叠成一册：纸下露出两层书页，左侧一道线装缝线；写字区本来就是稿纸横线 */
.c3-note #c3-panel-inner{
  background:
    radial-gradient(ellipse 120% 60% at 30% 8%, rgba(120,95,55,.07), transparent 60%),
    radial-gradient(ellipse 90% 50% at 75% 90%, rgba(120,95,55,.09), transparent 55%),
    repeating-linear-gradient(93deg, rgba(150,125,80,.05) 0 3px, transparent 3px 7px),
    linear-gradient(180deg,#f6efd9,#eee2c2);
  border:1px solid #c8b48a; border-radius:2px;
  /* 右下错开两层＝下面还压着几页 */
  box-shadow:
    3px 3px 0 -1px #e8dcba, 3px 3px 0 0 #bfa87c,
    7px 7px 0 -1px #decfa8, 7px 7px 0 0 #b09a6e,
    0 14px 44px rgba(0,0,0,.55);
  padding:20px 20px 16px 30px;   /* 左边给装订线让位 */
}
/* 左侧线装：一道缝线 + 三针脚 */
.c3-note #c3-panel-inner::before{
  content:""; position:absolute; top:8px; bottom:8px; left:14px; width:0; height:auto;
  border-left:2px solid rgba(140,105,60,.55); pointer-events:none;
}
.c3-note #c3-panel-inner::after{
  content:""; position:absolute; top:10%; bottom:10%; left:9px; width:12px; height:auto;
  border:none; pointer-events:none;
  background:repeating-linear-gradient(180deg, transparent 0 26%, rgba(140,105,60,.6) 26% 33%, transparent 33% 100%);
  background-size:100% 33.4%;
}
.c3-note #c3-panel-title{
  color:#3a2c18; border-bottom:2px solid var(--c3-cinnabar);
}

/* —— 钱财/物品 提示 toast —— */
#c3-toast{
  position:absolute; top:calc(54px + env(safe-area-inset-top, 0px)); left:50%; transform:translateX(-50%) translateY(-8px);
  background:linear-gradient(160deg,var(--c3-lacquer-1),var(--c3-lacquer-2));
  border:1px solid var(--c3-gold); color:var(--c3-gold-bright);
  border-radius:6px; padding:7px 18px; font-size:13.5px;
  font-family:"KaiTi","STKaiti",serif; letter-spacing:.5px;
  box-shadow:0 4px 14px rgba(0,0,0,.45);
  z-index:210; opacity:0; pointer-events:none; white-space:nowrap;
  transition:opacity .3s, transform .3s;
}
#c3-toast.hidden{display:none;}
#c3-toast.c3-toast-show{opacity:1; transform:translateX(-50%) translateY(0);}

/* —— 弄盘缠：信笺 —— */
#c3-earn{position:absolute; inset:0; background:rgba(8,5,2,.7); z-index:200;
  display:flex; align-items:center; justify-content:center;}
#c3-earn.hidden{display:none;}
#c3-earn-inner{
  position:relative; width:86%; max-width:390px;
  background:linear-gradient(180deg,var(--c3-paper-1),var(--c3-paper-2));
  border:1px solid var(--c3-paper-edge);
  box-shadow:0 0 0 6px rgba(54,40,26,.92), 0 12px 48px rgba(0,0,0,.6);
  border-radius:3px; padding:20px 18px; color:var(--c3-ink);
  font-family:"KaiTi","STKaiti",serif;
}
#c3-earn-title{color:#4a3826; font-size:14.5px; line-height:1.7; margin-bottom:13px;}
#c3-earn-reply{
  color:#5a3a22; font-size:14px; line-height:1.65;
  background:rgba(158,59,46,.08); border-left:3px solid var(--c3-cinnabar);
  padding:8px 11px; margin-bottom:13px; border-radius:2px;
}
#c3-earn-reply.hidden{display:none;}
#c3-earn-input{
  width:100%; box-sizing:border-box;
  background:rgba(255,250,235,.72); border:1px solid var(--c3-paper-edge);
  color:#3a2c18; border-radius:3px; padding:9px;
  font-size:14px; font-family:inherit; resize:none; margin-bottom:11px;
}
#c3-earn-input::placeholder{color:#9a8560;}
#c3-earn-send{
  width:100%; background:linear-gradient(160deg,#a8412f,#86301f); color:#f3e0c0;
  border:1px solid #d8a060; border-radius:4px;
  padding:9px 0; cursor:pointer; font-family:inherit; font-size:15px; letter-spacing:2px;
  box-shadow:0 2px 6px rgba(0,0,0,.3);
}
#c3-earn-send:hover{filter:brightness(1.12);}
#c3-earn-send:disabled{opacity:.6; cursor:default; filter:none;}

/* —— 证人 AI 审讯聊天框 —— */
/* ★问话＝演出（作者8/10）：这里不再是聊天窗，只是压在对话框上沿的一条输入行。
   立绘和对方的话都在对话框里演——那才看得见表情变化。 */
#c3-chat { position:absolute; left:4%; right:4%; bottom:calc(18% + 132px); z-index:12;
  background:none; display:block; }
#c3-chat.hidden { display:none; }
#c3-chat-inner {
  width:100%; max-width:none; box-sizing:border-box;
  background:var(--dialog-bg); border:1px solid var(--gold-dim);
  border-radius:4px; padding:9px 10px; backdrop-filter:blur(4px);
  font-family:"KaiTi","STKaiti",serif;
}
/* 聊天记录流整个不要了 */
#c3-chat-log { display:none !important; }
/* ★例外：石信三支柱辩白复用这个外壳，但它是【辩白】不是问话——
   指控／反驳／让步的往复必须留在屏上，否则整场是个空框（作者 8/13：「石信辩白那里会卡住」）。 */
#c3-chat.c3-defense #c3-chat-log { display:block !important; }
#c3-chat-name { display:none !important; }
/* 玩家刚问的那句：挂在输入行上方，对方答完前一直看得见 */
#c3-asked {
  position:absolute; left:4%; right:4%; bottom:calc(18% + 132px); z-index:11;
  background:rgba(26,19,11,.9); border:1px solid rgba(201,168,76,.32);
  border-radius:4px; padding:7px 11px;
  color:#c9b98a; font-size:13px; line-height:1.5;
  font-family:"KaiTi","STKaiti",serif;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
#c3-asked.hidden, #c3-asked.too-tall { display:none; }
#c3-chat-name {
  color:#f0cd72; font-size:16px; letter-spacing:2px; text-align:center;
  padding-bottom:8px; margin-bottom:8px; border-bottom:1px solid rgba(201,168,76,.35);
}
#c3-chat-log {
  height:230px; overflow-y:auto; padding:2px 6px 2px 2px; margin-bottom:10px;
  display:flex; flex-direction:column; gap:8px;
}
.c3-chat-line { font-size:14.5px; line-height:1.6; max-width:88%; padding:7px 11px; border-radius:10px; word-break:break-word; }
.c3-chat-sys { align-self:center; color:#9a8b66; font-size:13px; background:none; padding:2px; text-align:center; }
.c3-chat-q { align-self:flex-end; background:rgba(60,42,18,.85); color:#e9dcb4; border:1px solid rgba(201,168,76,.4); }
.c3-chat-q .c3-chat-who { color:#f0cd72; font-weight:600; margin-right:6px; }
.c3-chat-a { align-self:flex-start; background:rgba(40,32,22,.9); color:#d8c9a8; border:1px solid rgba(120,100,60,.4); }
.c3-chat-pending { opacity:.85; }
.c3-chat-pending .typing-indicator { display:inline-flex; align-items:center; }
#c3-chat-row { display:flex; gap:8px; margin-bottom:8px; }
#c3-chat-input {
  flex:1; box-sizing:border-box; background:rgba(10,7,4,.7);
  border:1px solid rgba(201,168,76,.4); color:#e8d9a8; border-radius:8px;
  padding:9px 11px; font-size:14.5px; font-family:inherit;
}
#c3-chat-input::placeholder { color:#8a7a55; }
#c3-chat-send {
  background:linear-gradient(160deg,#60421a,#3c2a12); color:#f0cd72;
  border:1px solid rgba(201,168,76,.55); border-radius:8px;
  padding:0 18px; cursor:pointer; font-family:inherit; font-size:15px; letter-spacing:1px;
}
#c3-chat-send:hover { filter:brightness(1.2); }
#c3-chat-send:disabled { opacity:.5; cursor:default; }
#c3-chat-end {
  display:block; margin:0 auto; background:none; border:1px solid rgba(201,168,76,.4);
  color:#b6a986; border-radius:16px; padding:5px 22px; cursor:pointer;
  font-family:inherit; font-size:13.5px; letter-spacing:2px;
}
#c3-chat-end:hover { color:#f0cd72; border-color:var(--c3-gold,#c9a55a); }

/* ============================================================
   获得道具/银两 · 全屏高光特效（立绘居中 + 背后旋转放射光 + 星芒）
   ============================================================ */
#c3-acquire {
  position: absolute; inset: 0; z-index: 240;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(20,14,6,0.62), rgba(4,3,6,0.82));
  cursor: pointer; overflow: hidden;
}
#c3-acquire.hidden { display: none; }
#c3-acq-inner {
  position: relative; width: 100%;
  display: flex; flex-direction: column; align-items: center;
  font-family: "KaiTi","STKaiti",serif;
  opacity: 0; transform: scale(0.9);
}
#c3-acquire.c3-acq-in  #c3-acq-inner { animation: c3AcqIn 0.46s cubic-bezier(0.2,0.8,0.3,1) forwards; }
#c3-acquire.c3-acq-out #c3-acq-inner { animation: c3AcqOut 0.32s ease-in forwards; }
@keyframes c3AcqIn  { from { opacity:0; transform:scale(0.9); } to { opacity:1; transform:scale(1); } }
@keyframes c3AcqOut { from { opacity:1; transform:scale(1); } to { opacity:0; transform:scale(0.94); } }

/* 背后旋转放射光 */
#c3-acq-rays {
  position: absolute; top: 42%; left: 50%;
  width: 150vmax; height: 150vmax; transform: translate(-50%,-50%);
  background: repeating-conic-gradient(from 0deg,
    rgba(240,205,114,0) 0deg 5deg,
    rgba(240,205,114,0.16) 5deg 8deg,
    rgba(240,205,114,0) 8deg 13deg);
  -webkit-mask: radial-gradient(circle, #000 0, #000 14%, transparent 42%);
  mask: radial-gradient(circle, #000 0, #000 14%, transparent 42%);
  animation: c3RaySpin 16s linear infinite;
  pointer-events: none;
}
@keyframes c3RaySpin { to { transform: translate(-50%,-50%) rotate(360deg); } }

/* 中心柔光 */
#c3-acq-glow {
  position: absolute; top: 42%; left: 50%;
  width: 60vmin; height: 60vmin; transform: translate(-50%,-50%);
  background: radial-gradient(circle, rgba(255,225,150,0.42) 0%, rgba(240,205,114,0.16) 38%, transparent 66%);
  animation: c3GlowPulse 2.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes c3GlowPulse { 0%,100% { opacity:0.72; transform:translate(-50%,-50%) scale(0.94); } 50% { opacity:1; transform:translate(-50%,-50%) scale(1.06); } }

/* 星芒 */
.c3-acq-spark {
  position: absolute; width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #ffe9a8 40%, transparent 70%);
  opacity: 0; pointer-events: none;
  box-shadow: 0 0 8px 2px rgba(255,230,160,0.8);
}
.c3-acq-spark.s1 { top: 26%; left: 34%; animation: c3Twinkle 1.8s ease-in-out 0.1s infinite; }
.c3-acq-spark.s2 { top: 30%; left: 66%; animation: c3Twinkle 2.1s ease-in-out 0.5s infinite; }
.c3-acq-spark.s3 { top: 50%; left: 24%; animation: c3Twinkle 1.6s ease-in-out 0.8s infinite; }
.c3-acq-spark.s4 { top: 54%; left: 76%; animation: c3Twinkle 2.3s ease-in-out 0.3s infinite; }
.c3-acq-spark.s5 { top: 40%; left: 50%; animation: c3Twinkle 1.9s ease-in-out 1.1s infinite; }
@keyframes c3Twinkle { 0%,100% { opacity:0; transform:scale(0.4); } 50% { opacity:1; transform:scale(1.3); } }

/* 内容 */
#c3-acq-header {
  position: relative; color: #f0cd72; font-size: 21px; letter-spacing: 8px;
  text-shadow: 0 0 12px rgba(240,205,114,0.6); margin-bottom: 14px; padding-left: 8px;
}
#c3-acq-iconwrap {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 160px; margin-bottom: 10px;
  animation: c3IconFloat 3s ease-in-out infinite;
}
@keyframes c3IconFloat { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-6px); } }
#c3-acq-icon { filter: drop-shadow(0 4px 18px rgba(255,210,120,0.55)); }
#c3-acq-icon img { max-width: 168px; max-height: 200px; object-fit: contain; }
/* 占位「宝」字：只在真图缺席时顶上。
   ⚠️ 原先四条规则打架——:not(.c3-acq-noimg) 里的类会计入优先级(0-1-3-0)，
   压过了「有图就隐藏」那条(0-1-2-1)，结果图明明加载好了，占位还盖在上面。
   现在就两条：默认显示，图一在就隐藏（图挂了 onerror 会把 img 摘掉，占位自然露出来）。*/
.c3-acq-fallback { display: block; }
#c3-acq-icon img + .c3-acq-fallback { display: none; }
#c3-acq-name {
  position: relative; color: #ffe9b0; font-size: 26px; letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(240,205,114,0.5); margin-bottom: 8px;
}
#c3-acq-desc {
  position: relative; color: #d8c9a0; font-size: 14.5px; line-height: 1.6;
  max-width: 76%; text-align: center; margin-bottom: 20px;
}
#c3-acq-hint {
  position: relative; color: rgba(220,210,180,0.7); font-size: 13px; letter-spacing: 3px;
  transition: opacity 0.4s; animation: c3HintPulse 1.6s ease-in-out infinite;
}
@keyframes c3HintPulse { 0%,100% { opacity: inherit; } 50% { opacity: 0.4; } }

/* ============================================================
   案三 · 自由探索 v2 —— 出示 / 搜证 / 日期 HUD / 对话工具行
   ============================================================ */
#c3-chat-toolrow { display:flex; gap:10px; justify-content:center; }
#c3-chat-toolrow button {
  background:none; border:1px solid rgba(201,168,76,.4); color:#b6a986;
  border-radius:16px; padding:5px 20px; cursor:pointer;
  font-family:inherit; font-size:13.5px; letter-spacing:2px;
}
#c3-chat-toolrow button:hover { color:#f0cd72; border-color:var(--c3-gold,#c9a55a); }
#c3-chat-toolrow button:disabled { opacity:.45; cursor:default; }
#c3-date { color:#e8d9b4; font-size:13px; letter-spacing:1px; margin-right:4px;
  display:flex; align-items:center; text-shadow:0 1px 3px rgba(0,0,0,.9), 0 0 7px rgba(0,0,0,.65); }

/* —— 出示面板 —— */
#c3-present { position:absolute; inset:0; background:rgba(8,5,2,.72); z-index:210;
  display:flex; align-items:center; justify-content:center; }
#c3-present.hidden { display:none; }
#c3-present-inner {
  width:88%; max-width:480px; box-sizing:border-box;
  background:linear-gradient(180deg, rgba(26,19,11,.97), rgba(18,13,8,.98));
  border:1px solid rgba(201,168,76,.5); border-radius:12px; padding:14px 16px;
  font-family:"KaiTi","STKaiti",serif; box-shadow:0 8px 40px rgba(0,0,0,.6);
}
#c3-present-title { color:#f0cd72; font-size:16px; letter-spacing:2px; text-align:center; margin-bottom:10px; }
#c3-present-list { display:flex; flex-wrap:wrap; gap:8px; max-height:180px; overflow-y:auto; margin-bottom:10px; }
.c3-present-item {
  background:rgba(40,32,22,.9); color:#d8c9a8; border:1px solid rgba(120,100,60,.5);
  border-radius:8px; padding:7px 12px; cursor:pointer; font-family:inherit; font-size:13.5px;
}
.c3-present-item:hover { border-color:var(--c3-gold,#c9a55a); color:#f0cd72; }
.c3-present-item.picked { background:rgba(96,66,26,.9); color:#f0cd72; border-color:#c9a55a; }
#c3-present-say.hidden { display:none; }
#c3-present-picked { color:#e9dcb4; font-size:14px; margin-bottom:6px; text-align:center; }
#c3-present-input {
  width:100%; box-sizing:border-box; background:rgba(10,7,4,.7);
  border:1px solid rgba(201,168,76,.4); color:#e8d9a8; border-radius:8px;
  padding:9px 11px; font-size:14px; font-family:inherit; margin-bottom:8px;
}
#c3-present-input::placeholder { color:#8a7a55; }
#c3-present-send {
  display:block; width:100%; background:linear-gradient(160deg,#60421a,#3c2a12); color:#f0cd72;
  border:1px solid rgba(201,168,76,.55); border-radius:8px; padding:9px 0; cursor:pointer;
  font-family:inherit; font-size:14.5px; letter-spacing:2px; margin-bottom:4px;
}
#c3-present-send:hover { filter:brightness(1.2); }
#c3-present-cancel {
  display:block; margin:6px auto 0; background:none; border:none; color:#8a7a55;
  cursor:pointer; font-family:inherit; font-size:13px; letter-spacing:2px; text-decoration:underline;
}
#c3-present-cancel:hover { color:#b6a986; }

/* —— 小雨搜证 —— */
/* 面板压到底部，把上半屏让给小雨的立绘（作者8/10：这里小雨的立绘也要出场）；
   暗罩改成上淡下浓，人在亮处、字在暗处 */
#c3-search { position:absolute; inset:0; z-index:200;
  background:linear-gradient(180deg, rgba(8,5,2,.18) 0%, rgba(8,5,2,.42) 45%, rgba(8,5,2,.86) 72%);
  display:flex; align-items:flex-end; justify-content:center;
  padding-bottom:calc(4% + env(safe-area-inset-bottom, 0px)); box-sizing:border-box; }
#c3-search.hidden { display:none; }
#c3-search-inner {
  width:88%; max-width:460px; box-sizing:border-box;
  background:linear-gradient(180deg, rgba(26,19,11,.97), rgba(18,13,8,.98));
  border:1px solid rgba(201,168,76,.5); border-radius:12px; padding:16px;
  font-family:"KaiTi","STKaiti",serif; box-shadow:0 8px 40px rgba(0,0,0,.6);
}
#c3-search-title { color:#f0cd72; font-size:15.5px; letter-spacing:1px; line-height:1.6; margin-bottom:6px; }
#c3-search-sub { color:#b09a6e; font-size:13px; margin-bottom:10px; }
#c3-search-input {
  width:100%; box-sizing:border-box; background:rgba(10,7,4,.7);
  border:1px solid rgba(201,168,76,.4); color:#e8d9a8; border-radius:8px;
  padding:9px 11px; font-size:14px; font-family:inherit; margin-bottom:10px;
}
#c3-search-input::placeholder { color:#8a7a55; }
#c3-search-btnrow { display:flex; gap:10px; }
#c3-search-go {
  flex:1; background:linear-gradient(160deg,#60421a,#3c2a12); color:#f0cd72;
  border:1px solid rgba(201,168,76,.55); border-radius:8px; padding:9px 0; cursor:pointer;
  font-family:inherit; font-size:14.5px; letter-spacing:2px;
}
#c3-search-go:hover { filter:brightness(1.2); }
#c3-search-back {
  background:none; border:1px solid rgba(201,168,76,.35); color:#b6a986; border-radius:8px;
  padding:9px 16px; cursor:pointer; font-family:inherit; font-size:13.5px;
}
#c3-search-back:hover { color:#f0cd72; }

/* ============================================================
   案三 · 漫画演出（整片落格模型 · ComicCut）
   ============================================================ */
#c3-comic { position:absolute; inset:0; background:#14100c; z-index:230;
  display:flex; align-items:center; justify-content:center; cursor:pointer; }
#c3-comic.hidden { display:none; }
#comic-stage {
  position:relative;
  aspect-ratio: var(--pw) / var(--ph);
  height: min(96%, calc(96vw * var(--ph) / var(--pw)));
  height: min(96%, calc(96cqw * var(--ph) / var(--pw)));
  max-height:96%; max-width:96%;
  background:#fff; box-shadow:0 8px 60px rgba(0,0,0,.8); overflow:hidden;
}
#c3-comic { container-type: size; }
/* 老浏览器（小米自带浏览器）不认 aspect-ratio ——
   格子全是 absolute，撑不出宽度，舞台会塌成 0 宽整段黑屏。
   正常情况由 ComicCut._fitStage() 写死 px；这里只是 JS 没跑到时的保命值。 */
@supports not (aspect-ratio: 1 / 1) {
  #comic-stage { width:96%; height:auto; min-height:60%; }
}
#comic-stage.page-push { transition:transform 5s ease-out; transform:scale(1.015); }
#comic-stage .panel-clip { position:absolute; inset:0; opacity:0; will-change:transform,opacity; }
#comic-stage .panel-clip img { position:absolute; inset:0; width:100%; height:100%; display:block; }
#comic-flash { position:absolute; inset:0; background:#fff; opacity:0; pointer-events:none; }
#comic-flash.on { animation:comicFlash .16s ease-out; }
@keyframes comicFlash { 0%{opacity:.95;} 100%{opacity:0;} }
@keyframes comicShakeS { 0%,100%{transform:translate(0,0)} 20%{transform:translate(3px,-2px)} 40%{transform:translate(-3px,2px)} 60%{transform:translate(2px,2px)} 80%{transform:translate(-2px,-2px)} }
@keyframes comicShakeM { 0%,100%{transform:translate(0,0)} 20%{transform:translate(5px,-4px)} 40%{transform:translate(-5px,3px)} 60%{transform:translate(4px,4px)} 80%{transform:translate(-4px,-3px)} }
@keyframes comicShakeL { 0%,100%{transform:translate(0,0)} 15%{transform:translate(8px,-6px)} 30%{transform:translate(-8px,5px)} 45%{transform:translate(6px,6px)} 60%{transform:translate(-7px,-4px)} 75%{transform:translate(5px,3px)} }
#comic-stage.shake-s { animation:comicShakeS .25s linear; }
#comic-stage.shake-m { animation:comicShakeM .3s linear; }
#comic-stage.shake-l { animation:comicShakeL .38s linear; }
#comic-ink {
  position:absolute; inset:-10%; pointer-events:none; opacity:1;
  background:
    radial-gradient(ellipse 60% 45% at 18% 12%, #0a0806 55%, transparent 72%),
    radial-gradient(ellipse 55% 50% at 85% 20%, #0a0806 52%, transparent 70%),
    radial-gradient(ellipse 70% 55% at 50% 85%, #0a0806 58%, transparent 74%),
    radial-gradient(ellipse 120% 120% at 50% 50%, #0a0806 62%, transparent 88%);
  transition:opacity .55s ease;
}
#comic-ink.off { opacity:0; }
#comic-ink.covering { transition:opacity .4s ease; opacity:1; }
#comic-hint {
  position:absolute; bottom:calc(3.5% + env(safe-area-inset-bottom, 0px)); left:50%; transform:translateX(-50%);
  color:rgba(20,16,12,.75); font-size:15px; letter-spacing:4px;
  opacity:0; transition:opacity .6s ease; pointer-events:none;
  animation:comicHintFloat 1.6s ease-in-out infinite;
  text-shadow:0 0 6px rgba(246,242,233,.9);
  font-family:"KaiTi","STKaiti",serif;
}
@keyframes comicHintFloat { 0%,100%{margin-bottom:0} 50%{margin-bottom:6px} }
#comic-hint.show { opacity:1; }

/* ═══════ 案三 · ADD-12 可点地图 hub（朱点 → 卡片 → 前往）═══════ */
.c3-uiico { height:1.05em; width:auto; vertical-align:-0.15em; display:inline-block; }
#c3-map { position:absolute; inset:0; z-index:190; background:#141008; }
#c3-map.hidden { display:none; }
/* ★地图顶到 10px：原来上方留 52px 给日期牌，牌子悬在黑边里（作者8/10：要落在地图上，别在黑屏那）
   现在牌子直接写进纸面，黑边取消，地图多吃 42px 竖向空间 */
#c3-map-box { position:absolute; left:50%; top:calc(10px + env(safe-area-inset-top, 0px)); transform:translateX(-50%);
  aspect-ratio:9/16;
  width:min(100%, calc((100vh - 108px - env(safe-area-inset-bottom, 0px)) * 0.5625)); }
@supports (height:100dvh) {
  #c3-map-box { width:min(100%, calc((100dvh - 108px - env(safe-area-inset-bottom, 0px)) * 0.5625)); }
}
#c3-map-img { width:100%; height:100%; object-fit:cover; display:block; }
#c3-map-veil { position:absolute; inset:0; pointer-events:none;
  background:radial-gradient(ellipse at 50% 42%, transparent 52%, rgba(10,6,2,.42) 100%); }
#c3-map-hint { position:absolute; top:calc(96px + env(safe-area-inset-top, 0px)); left:50%; transform:translateX(-50%); z-index:3;
  color:#7a3b28; font-size:13px; letter-spacing:3px; white-space:nowrap;
  font-family:"KaiTi","STKaiti",serif;
  text-shadow:0 0 8px rgba(255,250,238,.95), 0 1px 2px rgba(255,250,238,.9);
  background:none; padding:4px 12px;
  animation:c3HintIn .5s ease-out; transition:opacity .8s ease; }
#c3-map-hint.gone { opacity:0; pointer-events:none; }
@keyframes c3HintIn { from { opacity:0; transform:translateX(-50%) translateY(-6px); } to { opacity:1; transform:translateX(-50%); } }
/* 日期牌：两行大字漆木牌（作者8/8「明显点」）——初几·上午/下午 + 剩余晌数 */
#c3-map-date { position:absolute; top:calc(22px + env(safe-area-inset-top, 0px)); left:50%; transform:translateX(-50%); z-index:3;
  background:none; border:none; box-shadow:none; padding:4px 10px;
  text-align:center; white-space:nowrap; font-family:"KaiTi","STKaiti",serif;
  text-shadow:0 1px 3px rgba(0,0,0,.55), 0 0 10px rgba(255,246,222,.85); }
#c3-map-date .row1 { display:flex; align-items:center; justify-content:center; gap:7px; }
/* 篆书子集（方正邓石如篆书·仅日期用 16 字·7KB）
   ★红方印撤了（作者嫌丑），改成：篆书当主角、字最大；简体缩在旁边当翻译（作者8/10） */
@font-face {
  font-family: "C3Zhuan";
  src: url("../fonts/zhuan-deng-subset.woff2") format("woff2");
  font-display: swap;
}
#c3-map-date .zhuan {
  font-family:"C3Zhuan", serif; font-size:40px; line-height:1;
  color:#2f1f0c; letter-spacing:5px; white-space:nowrap;
}
#c3-map-date .trans {
  display:flex; flex-direction:column; align-items:flex-start; gap:1px;
  font-family:"KaiTi","STKaiti",serif; line-height:1.15; text-align:left;
}
/* 无框后落在米色舆图上：字改墨色 + 白光晕，像写在纸上的题记 */
#c3-map-date .row1 b { color:#4a3418; font-size:15px; font-weight:bold; letter-spacing:2px; }
#c3-map-date .row1 em { color:#6b573a; font-size:13px; font-style:normal; letter-spacing:1px; }
#c3-map-date .row1 .c3-uiico { height:28px; filter:drop-shadow(0 1px 2px rgba(255,250,238,.9)); }
#c3-map-date .row2 { color:#6b573a; font-size:11.5px; letter-spacing:1.5px; margin-top:1px; }
.c3-map-dot { position:absolute; width:52px; height:52px; margin:-26px 0 0 -26px;
  border:none; background:none; padding:0; cursor:pointer; -webkit-tap-highlight-color:transparent; }
/* 点击点＝从定稿舆图上抠下的朱笔油墨印子（作者8/7拍板），正片叠底融进纸面，像盖上去的 */
.c3-map-dot::before { content:''; position:absolute; inset:2px;
  background:url("../img/pin-mark.webp") center/contain no-repeat;
  mix-blend-mode:multiply; opacity:.9;
  animation:c3MarkBreath 2.6s ease-in-out infinite; }
.c3-map-dot.on::before { animation:none; opacity:1;
  filter:saturate(1.45) brightness(.9); transform:scale(1.22); }
.c3-map-dot.born { animation:c3DotBorn .55s ease-out; }
@keyframes c3MarkBreath { 0%,100%{ transform:scale(1); opacity:.82; } 50%{ transform:scale(1.07); opacity:1; } }
/* 一闪一闪的星芒（作者8/7）——四角星在印子右上角快闪，各印子错峰，别齐刷刷 */
.c3-map-dot::after { content:''; position:absolute; right:1px; top:0; width:17px; height:17px;
  background:radial-gradient(circle at 50% 50%, #fff8e0 0%, #f0cd72 45%, rgba(240,205,114,0) 74%);
  clip-path:polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  filter:drop-shadow(0 0 4px rgba(255,236,170,.95));
  opacity:0; transform:scale(.2); pointer-events:none;
  animation:c3Glint 2.8s ease-in-out infinite; }
.c3-map-dot:nth-child(2)::after { animation-delay:.5s; }
.c3-map-dot:nth-child(3)::after { animation-delay:1.1s; }
.c3-map-dot:nth-child(4)::after { animation-delay:1.7s; }
.c3-map-dot:nth-child(5)::after { animation-delay:2.2s; }
.c3-map-dot:nth-child(6)::after { animation-delay:.8s; }
.c3-map-dot:nth-child(7)::after { animation-delay:1.4s; }
@keyframes c3Glint {
  0%, 74%, 100% { opacity:0; transform:scale(.2) rotate(0deg); }
  80% { opacity:1; transform:scale(1) rotate(24deg); }
  86% { opacity:0; transform:scale(.3) rotate(45deg); }
}
@keyframes c3DotBorn { 0%{transform:scale(2.4); opacity:0; filter:blur(4px)} 100%{transform:scale(1); opacity:1; filter:blur(0)} }
/* 气泡卡片：贴着所点的印子弹出，上方优先、近边自动翻面（作者8/8） */
#c3-map-card { position:absolute; z-index:5; width:min(282px, 84%);
  display:flex; flex-wrap:wrap; gap:8px 10px; align-items:center; padding:10px 12px;
  background:linear-gradient(160deg, rgba(35,26,12,.97), rgba(18,12,6,.97));
  border:1px solid #6d5a28; border-radius:11px;
  filter:drop-shadow(0 6px 16px rgba(0,0,0,.5));
  opacity:0; transform:scale(.85); pointer-events:none;
  transition:transform .16s ease-out, opacity .16s ease-out; }
#c3-map-card.show { opacity:1; transform:scale(1); pointer-events:auto; }
#c3-map-arr { position:absolute; width:0; height:0; border:9px solid transparent; }
#c3-map-card.below #c3-map-arr { bottom:100%; border-bottom-color:#231a0c; }
#c3-map-card.above #c3-map-arr { top:100%; border-top-color:#1c130a; }
/* ★8/12 作者：抠底图标裸放在深色卡上显白难看——垫一张纸签（同行囊纸签，无金框），
   浅色线描落在纸上就"实"了 */
#c3-map-card img { width:96px; height:96px; flex:none; object-fit:contain;
  background:linear-gradient(180deg,#f4ecd6,#e8dcbc);
  border:1px solid #a8895c; border-radius:10px; padding:7px; box-sizing:border-box;
  box-shadow:0 3px 9px rgba(0,0,0,.4); }
#c3-map-card .t { flex:1; min-width:0; }
#c3-map-card .t b { display:block; color:#f0cd72; font-size:15.5px; letter-spacing:1px;
  font-family:"KaiTi","STKaiti",serif; margin-bottom:3px; }
#c3-map-card .t small { color:#b09a6e; font-size:12px; line-height:1.5; display:block; }
#c3-map-cost { flex:1 1 100%; color:#e0a860; font-size:12px; letter-spacing:1px;
  text-align:center; padding:5px 0 1px; border-top:1px dashed rgba(201,168,76,.3);
  font-family:"KaiTi","STKaiti",serif; }
#c3-map-cost.hidden { display:none; }
#c3-map-cost span { color:#9a8558; font-size:11.5px; }
#c3-map-go { flex:1 1 100%; position:relative; overflow:hidden;
  background:linear-gradient(160deg,#d4b05a,#9a7a2e); color:#241608;
  border:1px solid #f0cd72; border-radius:10px; padding:10px 16px;
  font-size:15px; font-weight:bold; letter-spacing:3px; cursor:pointer;
  font-family:"KaiTi","STKaiti",serif; transition:transform .12s ease;
  animation:c3GoBreath 2.2s ease-in-out infinite; }
#c3-map-go::after { content:''; position:absolute; top:0; bottom:0; left:-60%; width:45%;
  background:linear-gradient(105deg, transparent, rgba(255,246,214,.35), transparent);
  transform:skewX(-18deg); animation:c3Sheen 3.4s ease-in-out infinite; }
#c3-map-go:active { transform:scale(.94); }
@keyframes c3GoBreath { 0%,100%{ box-shadow:0 3px 10px rgba(0,0,0,.4); }
  50%{ box-shadow:0 0 16px 2px rgba(240,205,114,.5), 0 3px 10px rgba(0,0,0,.4); } }
@keyframes c3Sheen { 0%,70%{ left:-60%; } 86%,100%{ left:115%; } }
/* ★底部动作条：iOS 底栏/home indicator 会盖住贴底元素——抬高并让开安全区（作者8/9） */
/* ★夜色（作者8/13）：没有夜景图的场景，夜里压一层月色——比白底照搬强，也不用等美术出图 */
#scene-bg.c3-nighttint { filter:brightness(.52) saturate(.72) contrast(1.06) hue-rotate(-8deg); }

/* ★8/13：夜里这排有 4 个按钮（白天只有 1 个），四等分一行后每个只剩 ~82px，
   nowrap+ellipsis 下就只看得见一两个字。改成可折行、每行两个；只有一个时照旧占满整行。 */
#c3-map-actions { position:absolute; left:10px; right:10px; z-index:3; display:flex; flex-wrap:wrap; gap:9px;
  bottom:calc(26px + env(safe-area-inset-bottom, 0px)); }
.c3-map-act .c3-uiico { height:22px; vertical-align:-6px; margin-right:2px; }
.c3-map-act { flex:1 1 calc(50% - 5px); min-width:0; position:relative; overflow:hidden;
  background:linear-gradient(160deg,#36281a,#241a10);
  border:1px solid #7a6430; border-bottom-color:#4a3a1c;
  color:#e8cf96; border-radius:10px; padding:12px 8px;
  font-size:14px; letter-spacing:2px; cursor:pointer;
  font-family:"KaiTi","STKaiti",serif; white-space:nowrap; text-overflow:ellipsis;
  box-shadow:inset 0 1px 0 rgba(240,205,114,.18), 0 3px 8px rgba(0,0,0,.45);
  animation:c3ActRise .45s ease-out backwards;
  transition:transform .12s ease, filter .12s ease; }
.c3-map-act:nth-child(2) { animation-delay:.07s; }
.c3-map-act:nth-child(3) { animation-delay:.14s; }
.c3-map-act::after { content:''; position:absolute; top:0; bottom:0; left:-60%; width:45%;
  background:linear-gradient(105deg, transparent, rgba(240,205,114,.16), transparent);
  transform:skewX(-18deg); animation:c3Sheen 4.6s ease-in-out infinite; }
.c3-map-act:active { transform:scale(.96); filter:brightness(1.25); }
@keyframes c3ActRise { from { transform:translateY(14px); opacity:0; } to { transform:none; opacity:1; } }

/* ============================================================
   案三 · 8/8 新增 UI：掏钱确认 / 随身札记 / 当铺可售标记
   ============================================================ */
#c3-pay { position:absolute; inset:0; background:rgba(8,5,2,.72); z-index:215;
  display:flex; align-items:center; justify-content:center; }
#c3-pay.hidden { display:none; }
#c3-pay-inner {
  width:86%; max-width:430px; box-sizing:border-box;
  background:linear-gradient(180deg, rgba(26,19,11,.97), rgba(18,13,8,.98));
  border:1px solid rgba(201,168,76,.5); border-radius:12px; padding:16px;
  font-family:"KaiTi","STKaiti",serif; box-shadow:0 8px 40px rgba(0,0,0,.6);
}
#c3-pay-title { color:#f0cd72; font-size:16px; letter-spacing:2px; text-align:center; margin-bottom:10px; }
#c3-pay-row { display:flex; justify-content:space-between; color:#d8c9a8; font-size:14px; margin-bottom:8px; }
#c3-pay-note { color:#b09a6e; font-size:13px; line-height:1.6; margin-bottom:10px; min-height:1px; }
.c3-pay-lend { color:#9fb98a; }
#c3-pay-btns { display:flex; gap:10px; }
#c3-pay-yes {
  flex:1; background:linear-gradient(160deg,#60421a,#3c2a12); color:#f0cd72;
  border:1px solid rgba(201,168,76,.55); border-radius:8px; padding:9px 0; cursor:pointer;
  font-family:inherit; font-size:14.5px; letter-spacing:2px;
}
#c3-pay-yes:hover:not(:disabled) { filter:brightness(1.2); }
#c3-pay-yes:disabled { opacity:.45; cursor:default; }
#c3-pay-no {
  background:none; border:1px solid rgba(201,168,76,.35); color:#b6a986; border-radius:8px;
  padding:9px 18px; cursor:pointer; font-family:inherit; font-size:13.5px;
}
#c3-pay-no:hover { color:#f0cd72; }

/* 随身札记 · 记入那一拍 */
#c3-noteoffer { position:absolute; left:0; right:0; bottom:18%; z-index:205;
  display:flex; justify-content:center; pointer-events:none; }
#c3-noteoffer.hidden { display:none; }
#c3-noteoffer-inner {
  pointer-events:auto; max-width:80%;
  background:linear-gradient(180deg, rgba(30,22,12,.97), rgba(20,14,8,.98));
  border:1px solid rgba(201,168,76,.55); border-radius:10px; padding:12px 16px;
  font-family:"KaiTi","STKaiti",serif; box-shadow:0 6px 24px rgba(0,0,0,.55);
}
#c3-noteoffer-text { color:#e9dcb4; font-size:14.5px; margin-bottom:10px; text-align:center; }
#c3-noteoffer-btns { display:flex; gap:10px; justify-content:center; }
#c3-noteoffer-yes {
  background:linear-gradient(160deg,#60421a,#3c2a12); color:#f0cd72;
  border:1px solid rgba(201,168,76,.55); border-radius:16px; padding:6px 18px; cursor:pointer;
  font-family:inherit; font-size:13.5px; letter-spacing:1px;
}
#c3-noteoffer-no {
  background:none; border:1px solid rgba(201,168,76,.3); color:#9a8b66; border-radius:16px;
  padding:6px 16px; cursor:pointer; font-family:inherit; font-size:13px;
}
.c3-note-when { float:right; color:#8a7a55; font-size:12px; font-weight:normal; }
/* 当铺 · 可售物标记 */
.c3-present-item.sellable { border-color:rgba(201,168,76,.75); color:#f0cd72; }

/* ══════════════════════════════════════════════════════════
   ★存档槽面板（作者 8/10）：1 个自动 + 3 个手动，手动槽可自己起名
   沿用札记/行囊那套纸面样式，槽位做成一行行的签条
   ══════════════════════════════════════════════════════════ */
/* ★★2026-08-13 页内自绘弹窗：替掉 prompt/confirm/alert。
   微信·抖音·QQ 内置浏览器把原生弹窗全屏蔽了（不弹也不报错），
   导致存档/读档/结束审讯/交出物品这些「问一句再做」的操作集体静默失效。
   z-index 要压过存档面板(220)，因为删存档的确认是开在它上面的。 */
#c3-modal{position:absolute; inset:0; background:rgba(8,5,2,.72); z-index:260;
  display:flex; align-items:center; justify-content:center; padding:24px;}
#c3-modal.hidden{display:none;}
#c3-modal-inner{
  position:relative; width:100%; max-width:340px;
  background:linear-gradient(180deg,var(--c3-paper-1),var(--c3-paper-2));
  border:1px solid var(--c3-paper-edge);
  box-shadow:0 0 0 6px rgba(54,40,26,.92), 0 12px 48px rgba(0,0,0,.6);
  border-radius:3px; padding:22px 20px 18px; color:var(--c3-ink);
  font-family:"KaiTi","STKaiti",serif;
}
#c3-modal-inner::before,#c3-modal-inner::after{
  content:""; position:absolute; width:15px; height:15px; pointer-events:none;
  border-color:var(--c3-gold); border-style:solid;
}
#c3-modal-inner::before{top:6px; left:6px; border-width:2px 0 0 2px;}
#c3-modal-inner::after{bottom:6px; right:6px; border-width:0 2px 2px 0;}
#c3-modal-text{font-size:16px; line-height:1.75; color:#4a3520; text-align:center; padding:2px 2px 4px;}
#c3-modal-input{
  width:100%; margin-top:13px; padding:9px 10px; box-sizing:border-box;
  background:rgba(255,252,244,.9); color:#4a3520;
  border:1px solid rgba(120,90,40,.5); border-radius:3px;
  font-family:inherit; font-size:15.5px; outline:none;
}
#c3-modal-input:focus{border-color:var(--c3-cinnabar);}
#c3-modal-btns{margin-top:16px; display:flex; gap:10px; justify-content:center;}
#c3-modal-btns button{
  flex:1; max-width:132px; padding:9px 6px; cursor:pointer;
  font-family:inherit; font-size:14.5px; letter-spacing:2px; border-radius:3px;
}
#c3-modal-yes{
  background:linear-gradient(160deg,#a8412f,#86301f); color:#f3e0c0;
  border:1px solid #d8a060; box-shadow:0 2px 5px rgba(0,0,0,.28);
}
#c3-modal-no{
  background:transparent; color:#7a5a3a; border:1px solid rgba(120,90,40,.5);
}

/* ★对白回看 backlog（8/13）：滚轮上滑弹出；列表贴底再下滚一格收起 */
#c3-backlog{position:absolute; inset:0; background:rgba(8,5,2,.72); z-index:240;
  display:flex; align-items:center; justify-content:center; padding:18px;}
#c3-backlog.hidden{display:none;}
#c3-backlog-inner{
  position:relative; width:100%; max-width:420px; height:84%;
  background:linear-gradient(180deg,var(--c3-paper-1),var(--c3-paper-2));
  border:1px solid var(--c3-paper-edge);
  box-shadow:0 0 0 6px rgba(54,40,26,.92), 0 12px 48px rgba(0,0,0,.6);
  border-radius:3px; display:flex; flex-direction:column;
  padding:18px 16px 14px; color:var(--c3-ink);
  font-family:"KaiTi","STKaiti",serif;
}
#c3-backlog-inner::before,#c3-backlog-inner::after{
  content:""; position:absolute; width:15px; height:15px; pointer-events:none;
  border-color:var(--c3-gold); border-style:solid;
}
#c3-backlog-inner::before{top:6px; left:6px; border-width:2px 0 0 2px;}
#c3-backlog-inner::after{bottom:6px; right:6px; border-width:0 2px 2px 0;}
#c3-backlog-title{
  font-size:18px; text-align:center; letter-spacing:5px; color:#3a2c18;
  padding-bottom:8px; margin-bottom:8px; border-bottom:2px solid var(--c3-cinnabar);
}
#c3-backlog-list{overflow-y:auto; flex:1; padding-right:4px; overscroll-behavior:contain;}
.c3-blog-row{padding:7px 4px 8px; border-bottom:1px dashed rgba(120,90,40,.28);}
.c3-blog-row b{display:block; color:#8a3a24; font-size:13.5px; margin-bottom:2px; font-weight:600;}
.c3-blog-row p{margin:0; color:#4a3520; font-size:14.5px; line-height:1.7;}
.c3-blog-row.nar p{color:#7a6a50; font-size:13.5px;}
.c3-blog-row.di p{color:#3a5068;}
.c3-blog-row.q b{color:#3a5068;}   /* 问话记录里：狄仁杰的问句名牌用墨蓝，与证人的朱红区分 */
/* 轨道回放：对话框顶上的一条小字提示（对话框是深底，用暗金） */
.c3-rp-tip{font-size:11.5px; letter-spacing:1px; color:rgba(220,200,160,.6); margin-bottom:6px; user-select:none;}
/* 回看态：立绘/背景直接换，别走那 0.15s 淡入淡出——连翻几页会一直闪 */
#game-container.c3-replaying #character-sprite,
#game-container.c3-replaying #character-sprite-sub,
#game-container.c3-replaying #scene-bg{transition:none !important; opacity:1 !important;}

/* ★上滑提示（作者8/13：得提醒玩家一下）：飘一次就记进存档，不再烦人 */
#c3-swipe-hint{
  position:absolute; left:50%; transform:translateX(-50%);
  bottom:calc(18% + 150px); z-index:60; pointer-events:none;
  padding:6px 16px; border-radius:14px;
  background:rgba(20,14,8,.72); border:1px solid rgba(201,168,76,.35);
  color:#d8c49a; font-size:13px; letter-spacing:2px;
  font-family:"KaiTi","STKaiti",serif;
  opacity:0; transition:opacity .5s ease;
}
#c3-swipe-hint.show{opacity:1;}
#c3-swipe-hint.hidden{display:none;}
#c3-backlog-close{
  margin-top:12px; align-self:center;
  background:linear-gradient(160deg,#a8412f,#86301f); color:#f3e0c0;
  border:1px solid #d8a060; border-radius:3px;
  padding:8px 26px; cursor:pointer; font-family:inherit; font-size:14px; letter-spacing:3px;
  box-shadow:0 2px 5px rgba(0,0,0,.28);
}

#c3-slots{position:absolute; inset:0; background:rgba(8,5,2,.66); z-index:220;
  display:flex; align-items:center; justify-content:center;}
#c3-slots.hidden{display:none;}
#c3-slots-inner{
  position:relative; width:86%; max-width:400px; max-height:78%;
  background:linear-gradient(180deg,var(--c3-paper-1),var(--c3-paper-2));
  border:1px solid var(--c3-paper-edge);
  box-shadow:0 0 0 6px rgba(54,40,26,.92), 0 12px 48px rgba(0,0,0,.6);
  border-radius:3px; display:flex; flex-direction:column;
  padding:20px 18px 16px; color:var(--c3-ink);
  font-family:"KaiTi","STKaiti",serif;
}
#c3-slots-inner::before,#c3-slots-inner::after{
  content:""; position:absolute; width:17px; height:17px; pointer-events:none;
  border-color:var(--c3-gold); border-style:solid;
}
#c3-slots-inner::before{top:6px; left:6px; border-width:2px 0 0 2px;}
#c3-slots-inner::after{bottom:6px; right:6px; border-width:0 2px 2px 0;}
#c3-slots-title{
  font-size:20px; text-align:center; letter-spacing:5px; color:#3a2c18;
  padding-bottom:9px; margin-bottom:10px; border-bottom:2px solid var(--c3-cinnabar);
}
#c3-slots-list{overflow-y:auto; flex:1; padding-right:3px;}
.c3-slot{
  padding:10px 10px 9px; margin-bottom:8px;
  border:1px solid rgba(120,90,40,.42); border-radius:3px;
  background:rgba(255,250,236,.5);
}
.c3-slot.auto{background:rgba(240,232,210,.55); border-style:dashed;}
.c3-slot.empty{opacity:.72;}
.c3-slot-name{color:#5a3a22; font-size:15.5px; font-weight:600; margin-bottom:3px;}
.c3-slot.auto .c3-slot-name::before{content:"◷ "; color:var(--c3-cinnabar);}
.c3-slot:not(.auto) .c3-slot-name::before{content:"▣ "; color:var(--c3-cinnabar);}
.c3-slot-sub{color:#6a5a42; font-size:12px; line-height:1.5;}
.c3-slot-btns{margin-top:7px; display:flex; gap:8px; align-items:center;}
.c3-slot-btns button{
  background:linear-gradient(160deg,#a8412f,#86301f); color:#f3e0c0;
  border:1px solid #d8a060; border-radius:3px;
  padding:5px 16px; cursor:pointer; font-family:inherit; font-size:13.5px; letter-spacing:2px;
  box-shadow:0 2px 5px rgba(0,0,0,.28);
}
.c3-slot-btns button:disabled{opacity:.4; cursor:default; filter:grayscale(.6);}
.c3-slot-btns .c3-slot-del{
  background:transparent; color:#8a6a4a; border:1px solid rgba(120,90,40,.5);
  box-shadow:none; padding:5px 12px;
}
.c3-slot-tip{color:#8a7550; font-size:12px; letter-spacing:1px;}
#c3-slots-close{
  margin-top:10px; align-self:center;
  background:linear-gradient(160deg,#a8412f,#86301f); color:#f3e0c0;
  border:1px solid #d8a060; border-radius:4px;
  padding:6px 26px; cursor:pointer; font-family:inherit; font-size:14.5px; letter-spacing:3px;
  box-shadow:0 2px 6px rgba(0,0,0,.3);
}

/* ══════════════════════════════════════════════════════════
   ★顾问问答的输入行（作者 8/10：跟元芳讲话不许那种聊天框）
   压在对话框正上方、同宽同色，看着是对话框长出来的一条，不是聊天窗
   ══════════════════════════════════════════════════════════ */
#c3-ask{
  position:absolute; left:4%; right:4%;
  bottom:calc(18% + 132px);        /* 贴在对话框上沿 */
  z-index:12; display:flex; gap:8px; align-items:center;
  background:var(--dialog-bg); border:1px solid var(--gold-dim);
  border-radius:4px; padding:9px 10px; backdrop-filter:blur(4px);
}
#c3-ask.hidden{display:none;}
#c3-ask-input{
  flex:1; min-width:0; background:rgba(20,14,8,.55);
  border:1px solid rgba(201,168,76,.35); border-radius:3px;
  padding:8px 10px; color:#f0e2c4; font-size:14.5px;
  font-family:"KaiTi","STKaiti",serif; outline:none; -webkit-appearance:none;
}
#c3-ask-input::placeholder{color:#8a7a5a;}
#c3-ask-input:focus{border-color:var(--gold-dim); background:rgba(28,20,12,.7);}
#c3-ask button{
  flex:none; background:linear-gradient(160deg,#a8412f,#86301f); color:#f3e0c0;
  border:1px solid #d8a060; border-radius:3px;
  padding:8px 14px; cursor:pointer; font-family:"KaiTi","STKaiti",serif;
  font-size:14px; letter-spacing:2px; box-shadow:0 2px 5px rgba(0,0,0,.3);
}
#c3-ask #c3-ask-end{
  background:transparent; color:#a08a68;
  border:1px solid rgba(201,168,76,.32); box-shadow:none;
}

/* ══════════════════════════════════════════════════════════
   ★行囊图卡（作者 8/12：道具有图，别只排文字 —— 参考 LTD 的物品栏）
   左图右文，图挂了自动退回纯文字（.noimg），不留空框
   ══════════════════════════════════════════════════════════ */
.c3-item{
  display:flex; gap:11px; align-items:flex-start;
  padding:10px 4px 11px; border-bottom:1px dashed rgba(120,90,40,.42);
}
.c3-item:last-child{border-bottom:none;}
.c3-item-pic{
  flex:none; width:72px; height:72px; border-radius:3px;
  background:rgba(255,250,236,.55); border:1px solid rgba(120,90,40,.35);
  display:flex; align-items:center; justify-content:center; overflow:hidden;
}
.c3-item-pic img{max-width:100%; max-height:100%; object-fit:contain; display:block;}
.c3-item.noimg .c3-item-pic{display:none;}          /* 图挂了就不占位 */
.c3-item-text{flex:1; min-width:0;}
.c3-item-name{
  color:#5a3a22; font-size:15.5px; font-weight:600; margin-bottom:4px;
  display:flex; align-items:center; gap:7px; flex-wrap:wrap;
}
.c3-item-name::before{content:"◈ "; color:var(--c3-cinnabar);}
.c3-item-tag{
  font-size:11.5px; font-weight:400; color:#8a6a3a;
  border:1px solid rgba(120,90,40,.45); border-radius:2px; padding:1px 6px;
}
.c3-item-desc{color:#4a3c2a; font-size:13px; line-height:1.62;}

/* ★两个一行的网格（作者 8/12）：图在上、名在下，点开看详情 */
#c3-panel-list.c3-grid{display:grid; grid-template-columns:1fr 1fr; gap:9px; align-content:start;}
.c3-item{
  cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:6px;
  padding:10px 6px 9px; border:1px solid rgba(120,90,40,.38); border-radius:3px;
  background:rgba(255,250,236,.42); transition:background .15s, border-color .15s;
}
.c3-item:active{background:rgba(201,168,76,.18); border-color:var(--c3-cinnabar);}
.c3-item-pic{width:84px; height:84px; background:none; border:none;}
.c3-item-text{flex:none; width:100%; text-align:center;}
.c3-item-name{
  justify-content:center; font-size:14px; margin:0;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block;
}
.c3-item-name::before{content:none;}
/* ★HUD 引导高光（作者 8/13）：序章说「已开启」时，把那几颗按钮点给玩家看 */
@keyframes c3HudPulse{
  0%,100%{ box-shadow:0 0 0 0 rgba(240,205,114,0); transform:scale(1); }
  45%    { box-shadow:0 0 15px 6px rgba(240,205,114,.78); transform:scale(1.13); }
}
.c3-hud-hint{
  animation:c3HudPulse .95s ease-in-out 3;
  border-color:var(--c3-cinnabar)!important;
  position:relative; z-index:6;
}
.c3-hud-tip{
  position:absolute; transform:translateX(-50%); z-index:7; pointer-events:none;
  white-space:nowrap; font-size:12px; letter-spacing:1px; color:#f6e6bd;
  background:rgba(28,20,12,.88); border:1px solid rgba(240,205,114,.55);
  border-radius:3px; padding:3px 9px;
  box-shadow:0 3px 10px rgba(0,0,0,.5);
  animation:c3TipIn .28s ease-out both;
}
@keyframes c3TipIn{ from{opacity:0; transform:translateX(-50%) translateY(-5px);} to{opacity:1;} }

/* ★作者 8/13：整格是按钮，但没信号玩家就不知道能点——右下角留一枚朱砂小箭头 */
.c3-item{position:relative;}
.c3-item-more{
  display:block; position:absolute; right:6px; bottom:4px;
  font-size:15px; line-height:1; color:var(--c3-cinnabar); opacity:.6;
}
.c3-item:active .c3-item-more{opacity:1;}

/* 提示行：铺在包袱布上，所以用浅色 */
.c3-bag-hint{
  grid-column:1/-1; text-align:center;
  font-size:12.5px; letter-spacing:2px; color:#e2cfa4;
  text-shadow:0 1px 3px rgba(0,0,0,.5);
  padding:1px 0 8px; margin-bottom:1px;
  border-bottom:1px dashed rgba(240,220,180,.26);
}

/* ── 详情视图（作者 8/12：学 LTD，点开看详细介绍和价值）── */
.c3-detail{display:flex; flex-direction:column; align-items:center; padding:6px 2px 2px;}
.c3-detail-pic{
  width:170px; height:170px; margin-bottom:12px;
  background:rgba(255,250,236,.5); border:1px solid rgba(120,90,40,.35); border-radius:3px;
  display:flex; align-items:center; justify-content:center; overflow:hidden;
}
.c3-detail-pic img{max-width:100%; max-height:100%; object-fit:contain; display:block;}
.c3-detail-pic.noimg{display:none;}
.c3-detail-desc{
  color:#4a3c2a; font-size:14px; line-height:1.75; text-align:justify;
  width:100%; padding:0 4px 12px; border-bottom:1px dashed rgba(120,90,40,.4);
}
.c3-detail-meta{width:100%; padding-top:10px;}
.c3-detail-row{display:flex; gap:12px; font-size:13.5px; color:#4a3c2a; padding:3px 4px;}
.c3-detail-row .k{color:#8a6a3a; min-width:44px;}
.c3-detail-row .v{color:#5a3a22; font-weight:600;}
.c3-detail-row .v.dim{color:#9a8a70; font-weight:400;}
#c3-detail-back{
  margin-top:14px; align-self:center;
  background:transparent; color:#8a6a4a; border:1px solid rgba(120,90,40,.5);
  border-radius:3px; padding:6px 20px; cursor:pointer;
  font-family:inherit; font-size:14px; letter-spacing:2px;
}

/* ── 札记 · 查案进展（作者 8/13：标准 RPG 任务线，状态机自动更新）── */
.c3-quest{
  padding:9px 10px 10px; margin-bottom:9px;
  background:rgba(255,250,236,.42);
  border:1px solid rgba(120,90,40,.28);
  border-left:3px solid var(--c3-cinnabar, #9c3b2e);
  border-radius:2px;
}
.c3-quest-name{
  font-size:14px; font-weight:600; color:#5a3a22; letter-spacing:.5px;
  margin-bottom:5px;
}
.c3-quest-name::before{content:"◆ "; color:var(--c3-cinnabar, #9c3b2e);}
.c3-quest-did{color:#4a3c2a; font-size:13px; line-height:1.7; text-align:justify;}
.c3-quest-next{
  margin-top:7px; padding-top:6px; border-top:1px dashed rgba(120,90,40,.3);
  color:#6a4a28; font-size:12.5px; line-height:1.65; text-align:justify;
}
.c3-quest-next .k{
  display:inline-block; margin-right:6px; padding:0 5px;
  font-size:11px; color:#fff8ec; background:var(--c3-cinnabar, #9c3b2e);
  border-radius:2px; letter-spacing:1px;
}
/* 已了结的线：压暗、不再给下一步 */
.c3-quest.done{border-left-color:#9a8a70; background:rgba(240,236,226,.35);}
.c3-quest.done .c3-quest-name{color:#8a7a62;}
.c3-quest.done .c3-quest-name::before{content:"✓ "; color:#8a7a62;}
.c3-quest.done .c3-quest-did{color:#7a6a52;}

/* ── 札记按钮上的小红点（有进展未看）── */
#c3-note-btn{position:relative;}
.c3-dot{
  position:absolute; top:-1px; right:-3px; width:8px; height:8px;
  background:var(--c3-cinnabar, #9c3b2e); border-radius:50%;
  box-shadow:0 0 0 1.5px rgba(20,14,6,.55), 0 0 6px rgba(156,59,46,.8);
  animation:c3DotPulse 1.6s ease-in-out infinite;
}
@keyframes c3DotPulse{0%,100%{opacity:1;}50%{opacity:.35;}}

/* ── 查案进展提醒（作者8/13：别搞大段字，只提示点开看）── */
#c3-quest-toast{
  position:absolute; left:50%; transform:translateX(-50%) translateY(-10px);
  top:calc(env(safe-area-inset-top, 0px) + 62px);
  max-width:min(92%, 420px); z-index:220;
  display:flex; align-items:center; gap:8px; white-space:nowrap;
  background:linear-gradient(180deg, rgba(38,28,16,.95), rgba(26,19,11,.95));
  border:1px solid rgba(201,168,76,.45); border-left:3px solid var(--c3-cinnabar, #9c3b2e);
  border-radius:3px; padding:7px 12px;
  box-shadow:0 4px 16px rgba(0,0,0,.5);
  font-family:'Noto Serif SC','SimSun',serif;
  opacity:0; pointer-events:none; transition:opacity .25s, transform .25s;
}
#c3-quest-toast.show{opacity:1; transform:translateX(-50%) translateY(0); pointer-events:auto; cursor:pointer;}
#c3-quest-toast .qt-head{flex:none; font-size:11.5px; color:#c9a84c; letter-spacing:1px;}
#c3-quest-toast .qt-line{
  flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis;
  color:#e8d9b0; font-size:13px; font-weight:600;
}
#c3-quest-toast .qt-tap{flex:none; font-size:10.5px; color:#9a8b70; letter-spacing:1px;}

/* ── 对话里的「元芳」小按钮 + 提点气泡（作者8/13：不必切立绘，冒个泡就行）── */
#c3-chat-yf{
  flex:none; padding:0 10px;
  border:1px solid rgba(201,168,76,.45); border-radius:3px;
  background:rgba(40,30,18,.5); color:#c9a84c;
  font-family:'Noto Serif SC','SimSun',serif; font-size:13px; letter-spacing:1px;
  cursor:pointer; transition:filter .15s, opacity .15s;
}
#c3-chat-yf:active{filter:brightness(1.25);}
#c3-chat-yf:disabled, #c3-chat-yf.busy{opacity:.5; cursor:default;}

#c3-yf-bubble{
  position:absolute; left:50%; transform:translateX(-50%) translateY(6px);
  bottom:calc(env(safe-area-inset-bottom, 0px) + 118px);
  width:min(88%, 440px); z-index:210;
  display:flex; align-items:flex-start; gap:8px;
  background:linear-gradient(180deg, rgba(34,44,38,.96), rgba(22,30,25,.96));
  border:1px solid rgba(140,180,150,.4); border-left:3px solid #6f9c7b;
  border-radius:4px; padding:8px 12px;
  box-shadow:0 5px 18px rgba(0,0,0,.5);
  font-family:'Noto Serif SC','SimSun',serif;
  opacity:0; pointer-events:none; transition:opacity .25s, transform .25s;
}
#c3-yf-bubble.show{opacity:1; transform:translateX(-50%) translateY(0); pointer-events:auto; cursor:pointer;}
#c3-yf-bubble .yf-who{
  flex:none; font-size:11.5px; color:#9ec7a8; letter-spacing:1px;
  padding-top:2px; border-right:1px solid rgba(140,180,150,.3); padding-right:8px;
}
#c3-yf-bubble .yf-say{flex:1 1 auto; color:#dfe8e0; font-size:13px; line-height:1.65; text-align:justify;}
